Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Limpieza de indicadores de error
function clearErrors(){ input.value = ""; msg.classList.remove('error'); input.classList.remove('invalid'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get ERROR() { return 3 }", "static get ERROR () { return 0 }", "function err( i ) {\n if ( !data.errors ) return \"🚨 (Modular): \";\n\n let args = data.errors[i],\n type = `[${ args[0] }]`,\n position = \"\",\n information,\n error;\n\n // Removing error type\n args.shift();\n\n // Don't show error-origin if only one argument present.\n if ( args.length > 1 ) {\n position = `\\n@ ${ args.pop() }()\\n`;\n }\n\n // Formatting the error information\n information = args.map( arg => `\\n--> ${ arg }` ).join( \"\\n\" );\n error = `🚨 (Modular): ${ [type, information, position].join( \"\\n\" ) }`;\n\n return error;\n }", "function showError(error) {\r\n switch(error.code) {\r\n case error.PERMISSION_DENIED:\r\n smthgwrong.textContent = \"Pro zobrazení počasí v aktuální oblasti prosím povolte přítup k poloze.\"\r\n break;\r\n case error.POSITION_UNAVAILABLE:\r\n smthgwrong.textContent = \"Nebylo možné identifikovat polohu.\"\r\n break;\r\n case error.TIMEOUT:\r\n smthgwrong.textContent = \"Příkaz pro získaní polohy vypršel, zkuste to prosím znova.\"\r\n break;\r\n case error.UNKNOWN_ERROR:\r\n smthgwrong.textContent = \"Během procesu došlo k neznámé chybě.\"\r\n break;\r\n }\r\n}", "function onError(error) {\n\n\t\t$.each(fiches_patrimoine, function(index, fiche) {\n\t \tfiche.distanceLabel = \"Position indisponible\";\n \t\t });\n\n\t\tbuildListePatrimoine();\n\t\tshouldDisplayListe = true;\n }", "function wikiError(){\r\n self.errorMessage(\"Error in accessing wikipedia\");\r\n self.apiError(true);\r\n}", "function errox(id) {\n\tsw12u=id.substring(id.length-6,id.length-4)+id.substring(id.length-3,id.length-1);\n\tvar sw12x=sw12u.toUpperCase();\n\tmsg(\"debug\",\"sw12 = \"+sw12x+\" : \"+err[sw12x]);\t\n}", "function err(strm,errorCode){strm.msg=msg[errorCode];return errorCode;}", "async _checkErrors(operation, results)\n\t{\n\t\tconst res = results[operation+'Result'];\n\n\t\tif (operation === 'FECAESolicitar' && res.FeDetResp) {\n\t\t\tif (Array.isArray(res.FeDetResp.FECAEDetResponse)) {\n\t\t\t\tres.FeDetResp.FECAEDetResponse = res.FeDetResp.FECAEDetResponse[0];\n\t\t\t}\n\t\t\t\n\t\t\tif (res.FeDetResp.FECAEDetResponse.Observaciones && res.FeDetResp.FECAEDetResponse.Resultado !== 'A') {\n\t\t\t\tres.Errors = { Err : res.FeDetResp.FECAEDetResponse.Observaciones.Obs };\n\t\t\t}\n\t\t}\n\n\t\tif (res.Errors) {\n\t\t\tconst err = Array.isArray(res.Errors.Err) ? res.Errors.Err[0] : res.Errors.Err;\n\t\t\tthrow new Error(`(${err.Code}) ${err.Msg}`, err.Code);\n\t\t}\n\t}", "function setRestrauntDataError(){\n resNameElement.innerHTML = \"Error unknown restraunt\";\n}", "function fallo() {\n return error(\"Reportar fallo\");\n}", "function Lo(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function Lo(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function Lo(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function fetchAllApiError(error) {\n i18nNotifications.pushForCurrentRoute('crud.default.error', 'warning');\n }", "function fetchAllApiError(error) {\n i18nNotifications.pushForCurrentRoute('crud.default.error', 'warning');\n }", "__init12() {this.error = null}", "function errback(err) {\n rdbAdmin.showErrorMessage('<pre>' + err[0] + ':' + err[1] + '</pre>');\n }", "function mostrarError(err){\n console.log('Error', err);\n }", "function mostrarError(err){\n console.log('Error', err);\n }", "error (key, info) {\n\t\tif (!this.errors[key]) {\n\t\t\treturn {\n\t\t\t\tcode: 'UNKNOWN',\n\t\t\t\tmessage: 'Unknown error'\n\t\t\t}; // don't let this happen\n\t\t}\n\t\t// make a copy of the error object, we don't want to alter the original!\n\t\treturn Object.assign({}, this.errors[key], info);\n\t}", "logError (err) {\n\n switch (err) {\n\n case 1: //Autodesk.Viewing.ErrorCode.UNKNOWN_FAILURE\n return 'An unknown failure has occurred.'\n\n case 2: //Autodesk.Viewing.ErrorCode.BAD_DATA\n return 'Bad data (corrupted or malformed) was encountered.'\n\n case 3: //Autodesk.Viewing.ErrorCode.NETWORK_FAILURE\n return 'A network failure was encountered.'\n\n case 4: //Autodesk.Viewing.ErrorCode.NETWORK_ACCESS_DENIED\n return 'Access was denied to a network resource (HTTP 403).'\n\n case 5: //Autodesk.Viewing.ErrorCode.NETWORK_FILE_NOT_FOUND\n return 'A network resource could not be found (HTTP 404).'\n\n case 6: //Autodesk.Viewing.ErrorCode.NETWORK_SERVER_ERROR\n return 'A server error was returned when accessing ' +\n 'a network resource (HTTP 5xx).'\n\n case 7: //Autodesk.Viewing.ErrorCode.NETWORK_UNHANDLED_RESPONSE_CODE\n return 'An unhandled response code was returned ' +\n 'when accessing a network resource (HTTP everything else).'\n\n case 8: //Autodesk.Viewing.ErrorCode.BROWSER_WEBGL_NOT_SUPPORTED\n return 'Browser error: WebGL is not ' +\n 'supported by the current browser.'\n\n case 9: //Autodesk.Viewing.ErrorCode.BAD_DATA_NO_VIEWABLE_CONTENT\n return 'There is nothing viewable in the fetched document.'\n\n case 10: //Autodesk.Viewing.ErrorCode.BROWSER_WEBGL_DISABLED\n return 'Browser error: WebGL is supported, but not enabled.'\n\n case 11: //Autodesk.Viewing.ErrorCode.RTC_ERROR\n return 'Collaboration server error'\n }\n }", "function error(err) {\n\t\t// TODO output error message to HTML\n\t\tconsole.warn(`ERROR(${err.code}): ${err.message}`);\n\t\t// let msg = \"If you don't want us to use your location, you can still make a custom search\";\n\t\t// displayErrorMsg(msg);\n\t}", "isError() { return this.type==Token.ERROR }", "isError() { return this.type==Token.ERROR }", "function CustomError() {}", "function error(err) {\n var problem;\n if (err.code == 1) {\n // user said no!\n problem = \"You won't share your location with us.\"\n }\n if (err.code == 2) {\n // location is unavailable - no satellites in range?\n problem = \"Your location is unavailable.\"\n }\n if (err.code == 3) {\n // request timed out\n problem = \"Something was too slow.\"\n }\n document.getElementById('location').innerHTML = \"Something went wrong! \"+problem;\n \n}", "function showError() {}", "function Ri(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "onError(err){\n\n /*const data = err.response.data ;\n const msg = data.errors[0];\n this.showErr(msg);*/\n\n console.log(err);\n\n }", "function generateLeafletError(err) {\n\t\tconst errMessages = {\n\t\t\t2004: 'Příliš vzdálené cíle (musí být blíže než 6000 km)',\n\t\t\t2009: 'Nenalezena trasa mezi zadanými cíli'\n\t\t};\n\t\tif(typeof err !== 'object' || !err.message) {return err;}\n\t\tlet obj = JSON.parse(err.message);\n\t\tif(!obj.error || !obj.error.code || !errMessages[obj.error.code]) {return err;}\n\t\treturn errMessages[obj.error.code];\n\t}", "function esconderError() {\n setError(null);\n }", "function muestraError(cadena) {\n self.ErrorEnviar = cadena;\n self.showErrorForm = true;\n cfpLoadingBar.complete();\n }", "function OnErr() {\r\n}", "function erorrMessage(errors) {\n\n var txt =\"\";\n $.each(errors, function( index, value ) {\n txt += ErrorMsg('warning',value);\n \n });\n return txt;\n}", "function erorrMessage(errors) {\n\n var txt =\"\";\n $.each(errors, function( index, value ) {\n txt += ErrorMsg('warning',value);\n \n });\n return txt;\n}", "function errorIndication (elementERR, typeErr) {\n //Name error\n if (elementERR == name) {\n belowName.appendChild(name_EM);\n }\n //Email errors\n if (elementERR == emailUser && typeErr == 'email_mailEmpty_EM') {\n //emailUser.labels[0].appendChild(email_mailEmpty_EM);\n belowMail.appendChild(email_mailEmpty_EM);\n } else if (elementERR == mail && typeErr == 'email_no_At_EM') {\n belowMail.appendChild(email_no_At_EM);\n } else if (elementERR == mail && typeErr == 'email_no_domain_EM') {\n belowMail.appendChild(email_no_domain_EM);\n } else if (elementERR == mail && typeErr == 'email_no_dot_EM') {\n belowMail.appendChild(email_no_dot_EM);\n } else if (elementERR == mail && typeErr == 'email_blank_Space_EM') {\n belowMail.appendChild(email_blank_Space_EM);\n } else if (elementERR == mail && typeErr == 'email_bad_Format_EM') {\n belowMail.appendChild(email_bad_Format_EM);\n }\n //Activities errors\n if (elementERR == activities) {\n activities.appendChild(activities_EM);\n }\n //Payment errors\n //we use a parente - parent Div because visually is better\n //and we don't have another option without change the HTML\n if (elementERR == ccnum) {\n belowPayment.insertBefore(ccnum_EM, belowPayment.firstElementChild)\n }\n if (elementERR == zipCode) {\n belowPayment.insertBefore(zipCode_EM, belowPayment.firstElementChild)\n }\n if (elementERR == cvvCode) {\n belowPayment.insertBefore(cvvCode_EM, belowPayment.firstElementChild)\n }\n //Finally, the visual touch\n formatErrorIndications(elementERR);\n }", "function mostrarError(err){\n console.log('Error', err);\n }", "function errback(err) {\n //alert(err.toString());\n rdbAdmin.showErrorMessage('<pre>' + err[0] + ':' + err[1] + '</pre>');\n }", "function Mi(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "addError(error, diag, errorMessage) {\n let lastEntry;\n let secondToLastEntry;\n if (diag.length() > 0) {\n lastEntry = diag.peek();\n if (diag.length() > 1) {\n secondToLastEntry = diag.peek(diag.length() - 2);\n }\n }\n if (secondToLastEntry && lastEntry) {\n if (error.code !== secondToLastEntry.diag.code && error.code !== lastEntry.diag.code) {\n errorMessage ? diag.pushA(error, [errorMessage]) : diag.push(error);\n }\n }\n else if (lastEntry) {\n if (error.code !== lastEntry.diag.code) {\n errorMessage ? diag.pushA(error, [errorMessage]) : diag.push(error);\n }\n }\n else {\n errorMessage ? diag.pushA(error, [errorMessage]) : diag.push(error);\n }\n }", "function tornarErrosInvisiveis(){\n $(errorName).addClass('deixarInvisivel');\n}", "function show_error(a,b){\n\t\t$('error_creacion').innerHTML=b+' : '+errores[a];\n\t}", "function clearErrorMsg() {\n AlmCommon.clearMsgs();\n }", "error(error) {}", "function onError(id) {\n // Por consolamos pasamos el mensaje del error\n console.log(`Sucedió un error al obtener el personaje ${id}`);\n}", "function ofteU2FError(resp) {\n if (!('errorCode' in resp)) {\n return '';\n }\n if (resp.errorCode === u2f.ErrorCodes['OK']) {\n return '';\n }\n let msg = 'ofte error code ' + resp.errorCode;\n for (name in u2f.ErrorCodes) {\n if (u2f.ErrorCodes[name] === resp.errorCode) {\n msg += ' (' + name + ')';\n }\n }\n if (resp.errorMessage) {\n msg += ': ' + resp.errorMessage;\n }\n if (ofte.config.debug) {\n console.log('CTAP1/Ofte Error:', msg)\n }\n return msg;\n }", "function erroNome() {\n const p = criaP();\n p.innerHTML = 'contêm caractére inválido,ou está vazio.';\n if (labelNome.childElementCount == 2) {\n return;\n }\n labelNome.appendChild(p);\n p.style.color = `rgb(255,0,0)`;\n return;\n }", "function Oi(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function addServerError(lei, year, status, updateFn) {\n updateFn(state => ({\n errors: [...state.errors, { lei, year, status }]\n }))\n}", "async function getKnownErrors() {\n const errs = await store.getAllKnownErrors();\n const indexedErrs = {\n unmanagedConvClassifiers: [],\n unmanagedVisrecClassifiers: [],\n badBluemixConvCredentials: [],\n badBluemixVisrecCredentials: [],\n };\n for (const err of errs) {\n switch (err.type) {\n case training_types_1.KnownErrorCondition.UnmanagedBluemixClassifier:\n if (err.servicetype === 'conv') {\n indexedErrs.unmanagedConvClassifiers.push(err.objid);\n }\n else if (err.servicetype === 'visrec') {\n indexedErrs.unmanagedVisrecClassifiers.push(err.objid);\n }\n else {\n log.error({ err }, 'Unrecognised known error');\n slack.notify('Unrecognised known error service type ' + err.servicetype, slack.SLACK_CHANNELS.CREDENTIALS);\n }\n break;\n case training_types_1.KnownErrorCondition.BadBluemixCredentials:\n if (err.servicetype === 'conv') {\n indexedErrs.badBluemixConvCredentials.push(err.objid);\n }\n else if (err.servicetype === 'visrec') {\n indexedErrs.badBluemixVisrecCredentials.push(err.objid);\n }\n else {\n log.error({ err }, 'Unrecognised known error');\n slack.notify('Unrecognised known error service type ' + err.servicetype, slack.SLACK_CHANNELS.CREDENTIALS);\n }\n break;\n default:\n log.error({ err }, 'Unrecognised known error');\n slack.notify('Unrecognised known error type ' + err.type, slack.SLACK_CHANNELS.CREDENTIALS);\n }\n }\n return indexedErrs;\n}", "function processErrors(data){\n \n}", "function Fl(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "error() {}", "if(result instanceof Error) {\n console.error(result);\n this.results.push(TestResult.error);\n this.errors++;\n }", "async function failIndex(err) {\n let htmlError = `<li class=\"p-5\">\n <p>Une erreur c'est produite, veuillez réessayer plus tard, merci</p>\n </li>`;\n document.getElementById(\"cards\").innerHTML = htmlError;\n console.log(\"Error: \" + err);\n}", "function Lo(t){return Object.prototype.toString.call(t).indexOf(\"Error\")>-1}", "function Lo(t){return Object.prototype.toString.call(t).indexOf(\"Error\")>-1}", "onError() {}", "function Ho(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function Ii(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function parse_PtgErr(blob) {\n blob.l++;\n return BErr[blob.read_shift(1)];\n }", "function h(t){return-1<Object.prototype.toString.call(t).indexOf(\"Error\")}", "function setError(error) {\n _error = \"(\" + _counter + \") \" + ioHelper.normalizeError(error);\n _counter++;\n _msg = \"\";\n component.forceUpdate();\n }", "function Errors() {\n this.errors = [];\n this.num_errors = 0;\n }", "function Nr(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function Ni(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function Ni(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function createShelterError(error) {\n vm.error = \"Could not find pet info at this time. Please try again later.\";\n }", "function _detailsFail(err) {\n switch (err.status) {\n case 400:\n //error while getting asset\n $rootScope.back();\n $rootScope.errorModalText(err);\n ModalService.get('errorModal').open();\n break;\n case 404:\n //no assets found\n $rootScope.back();\n $rootScope.errorModalText(err);\n ModalService.get('errorModal').open();\n break;\n case 500:\n //server error\n vm.loadingState = 'networkError';\n break;\n default:\n vm.loadingState = 'networkError';\n break;\n }\n }", "function errorMessagePullingDataFromAPI(){\n\t\t$errorLoadingAPI.text(\"Error pulling all the data from the API\");\n\t}", "function parse_PtgErr(blob) { blob.l++; return BErr[blob.read_shift(1)]; }", "function parse_PtgErr(blob) { blob.l++; return BErr[blob.read_shift(1)]; }", "function parse_PtgErr(blob) { blob.l++; return BErr[blob.read_shift(1)]; }", "function parse_PtgErr(blob) { blob.l++; return BErr[blob.read_shift(1)]; }", "error(message, prev){\n\t\tif (message == undefined) message=\"\";\n\t\tif (prev == undefined) prev=null;\n\t}", "function error() {\r\n\t\tlet error = document.createElement(\"h3\");\r\n\t\terror.innerHTML = \"Sorry there are no recipes with \"+errorName+\", try again!\";\r\n\t\tdocument.getElementById(\"error\").appendChild(error);\r\n\t}", "function Lr(t){return Object.prototype.toString.call(t).indexOf(\"Error\")>-1}", "function errorSeries(err) {\n return {\n error: err.statusText + \": \" + err.responseText\n };\n }", "function deuErro() {\n toastr.error(\"Algo deu errado. Tente novamente.\");\n }", "function showError() {\n showStatus('error');\n}", "parseErr(err) {\n if (!err.errors) return err;\n const messages = Object.keys(err.errors).map(errorKey =>\n `${errorKey} error: ${err.errors[errorKey]}`);\n return messages;\n }", "static get ERROR() {\n return {\n ERROR_MESSAGE: 'No valid Main Tab elements found. Tab loader failed to iniatilize'\n };\n }", "function error(n, m) {\n CB.status(false, n, m);\n console.error('SimpleCTI.error() - We got an error number: ' + n + ' Text: ' + m);\n }", "function Ri(t){return Object.prototype.toString.call(t).indexOf(\"Error\")>-1}", "function Ri(t){return Object.prototype.toString.call(t).indexOf(\"Error\")>-1}", "function errback(error) {\n console.error(\"Creating legend failed. \", error);\n }", "function signupErr(res) {\n\n var errorObj = res.data.err;\n var errors = Object.keys(errorObj.invalidAttributes);\n var length = errors.length;\n\n for (var i = 0; i < length; i++) {\n if (errors[i] == 'email') {\n $scope.signup.error = 'That email already exists!'\n } else if (errors[i] == 'username') {\n $scope.signup.error = 'That username already exists!'\n }\n }\n }", "function error() {\n _error.apply(null, utils.toArray(arguments));\n }", "function u(e){return-1<Object.prototype.toString.call(e).indexOf(\"Error\")}", "setError(title, message) {\n this.result.errors.push({title, message});\n }", "function Dr(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function Dr(e){return Object.prototype.toString.call(e).indexOf(\"Error\")>-1}", "function Fi(t){return Object.prototype.toString.call(t).indexOf(\"Error\")>-1}", "function errorGeneral(){\n M.toast({html: 'Ha ocurrido un error, intente de nuevo más tarde'});\n}", "function Di(t){return Object.prototype.toString.call(t).indexOf(\"Error\")>-1}", "function formatErrorIndications(elementERR) {\n /** first the format of inpunt elements, but not the div of checkbox, the effect is ugly.\n And no all checkbox are mandatory.\n With this, the user can locate easily the elements with errors **/\n if (elementERR !== activities) {\n elementERR.style.borderBottom = '3px solid red';\n }\n\n /** Second the format of the error meesages **/\n const errorMessages = document.getElementsByClassName('errorMessage');\n for (let i = 0; i < errorMessages.length; i+= 1) {\n errorMessages[i].style.background = 'lightblue';\n errorMessages[i].style.borderLeft = '6px solid red';\n errorMessages[i].style.marginBottom = '5px';\n errorMessages[i].style.paddingLeft = '5px';\n errorMessages[i].style.lineHeight = 1.5;\n errorMessages[i].style.color = 'black';\n errorMessages[i].style.fontSize = '14px';\n errorMessages[i].style.fontWeight = 500;\n }\n }", "function onerror(e){\n\t\t$('#errors').text(e.message);\n\t}", "stackErrors(data) {\n if (!this.errors.find((error) => error.key == data.key)) {\n this.errors[data.key] = data.error;\n }\n }", "function onError(id){\n console.log(`Sucedio un error al obtener el personaje ${id} `);\n}", "function show_bulk_error() {\n var err = {};\n err[that.form.entity_name] = {\n __all__: [\"Some \" + that.form.entity_name + \" (in red below) could not be saved. To correct errors and try saving them again - open a new add form\"]\n };\n that.form.show_errors(err, true);\n }" ]
[ "0.67293704", "0.6532073", "0.65063846", "0.6459033", "0.64382535", "0.63953424", "0.6358278", "0.6352945", "0.6308334", "0.62788403", "0.6245247", "0.6242229", "0.6242229", "0.6242229", "0.6231162", "0.6231162", "0.62229353", "0.6221002", "0.62200373", "0.62200373", "0.6219559", "0.62022114", "0.61762893", "0.6155696", "0.6155696", "0.61509866", "0.6150601", "0.6148571", "0.61454934", "0.6145242", "0.61417156", "0.61288273", "0.61261183", "0.6124562", "0.6118732", "0.6118732", "0.6110496", "0.6098715", "0.6081564", "0.60691243", "0.6068745", "0.60652703", "0.605579", "0.60499233", "0.6036239", "0.602246", "0.6016725", "0.6012797", "0.6011447", "0.5995425", "0.59932166", "0.5973779", "0.59727055", "0.5951116", "0.59436333", "0.5937268", "0.5935724", "0.5935724", "0.5933921", "0.5930886", "0.5927623", "0.5926613", "0.59154695", "0.5915389", "0.59131914", "0.59131706", "0.59125614", "0.59125614", "0.5910437", "0.5909686", "0.5907206", "0.59018964", "0.59018964", "0.59018964", "0.59018964", "0.59016", "0.5892678", "0.58924043", "0.5888754", "0.5887455", "0.5882152", "0.58773106", "0.5874014", "0.5869265", "0.5867347", "0.5867347", "0.5867167", "0.5863146", "0.5862992", "0.5859655", "0.58588207", "0.585881", "0.585881", "0.58573455", "0.5857157", "0.58529717", "0.5852722", "0.58504134", "0.58468634", "0.584661", "0.5846389" ]
0.0
-1
MUESTRO VISUALMENTE LA RESPUESTA DE LA API
function displayUi(oldUrl, newUrl){ const li = document.createElement('li'); const p1 = document.createElement('p'); const div = document.createElement('div'); const p2 = document.createElement('p'); const button = document.createElement('button'); //agrego contenido p1.textContent = oldUrl; p2.textContent = newUrl; button.textContent = 'Copy'; //agrego estilos y attributos li.className = 'api-result'; p1.className = 'old'; div.className = 'options'; p2.className = 'new'; button.className = 'btn'; button.setAttribute('id', 'copy'); button.setAttribute('type', 'button'); //adjunto div y p1 a li li.appendChild(p1); li.appendChild(div); //adjunto p2 y button a div div.appendChild(p2); div.appendChild(button); //adjunto li a ul en index.html document.getElementById('api-calls').appendChild(li); // POSIBILIDAD DE COPIAR AL PORTAPAPELES //concepto de event delegation: agrego el listener al padre de los elementos generados dinámicamente (donde están los button) parentUl.addEventListener('click', event => { //guardo el párrafo donde está el link a copiar let toCopy = event.target.previousElementSibling; //si el lugar donde se hizo click coincide con el id copy, se ejecuta la copia del párrafo y agrego estilos al botón if(event.target.id === 'copy') { window.navigator.clipboard.writeText(toCopy.innerText); //copia al portapapeles event.target.style.backgroundColor = "hsl(257, 27%, 26%)"; event.target.innerText = "Copied!"; setTimeout(() => { event.target.style.backgroundColor = "hsl(180, 66%, 49%)"; event.target.innerText = "Copy"; }, 1000); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function fetchMyAPI() {\t\t\n\t\tPromotionsService.getActivePromotions().then(\n\t\t\tresponse => {\n\t\t\t\tsetData(response);\n\t\t\t},\n\t\t\terror => {\n\t\t\t\tif (error.response.status === 404) {\n\t\t\t\t\talert(`L'application nécessite une mise à jour`);\n\t\t\t\t} else {\n\t\t\t\t\talert(`Uho, il semblerait que notre serveur soit indisponible :(`);\n\t\t\t\t}\n\t\t\t}\n\t\t)\n\t}", "function API(){}", "function API(){}", "getAPI(request, response) {\n let message = {};\n message.name = 'implementation pending';\n message.version = 'implementation pending';\n return response.jsonp(message);\n }", "all(){\nreturn this.post(Config.API_URL + Constant.REFFERAL_ALL);\n}", "static dataGET() {\n return new Promise(\n async (resolve) => {\n try {\n resolve(Service.successResponse(''));\n } catch (e) {\n resolve(Service.rejectResponse(\n e.message || 'Invalid input',\n e.status || 405,\n ));\n }\n },\n );\n }", "async function appelApi(appel){\r\n \r\n const reponse = await fetch(appel)\r\n if (!reponse.ok) {\r\n const message = `Il y a eu une erreur: ${reponse.status}`\r\n throw new Error(message)\r\n }\r\n const data = await reponse.json()\r\n\r\n return data\r\n\r\n}", "function apiSuccess(thisres){\n console.log(thisres);\n }", "async function post_api(\n strUrl,\n strBody = '{}',\n showMsg = false,\n chktoken = true,\n method = '',\n) {\n var smethod = 'POST';\n if (strBody == '') smethod = 'GET';\n if (method) {\n smethod = method;\n }\n let token = '';\n if (token == '') {\n token = await ngetStorage('token', '');\n }\n try {\n const response = await fetch(domain + strUrl, {\n method: smethod,\n headers: {\n 'Content-Type': 'application/json',\n token: token,\n },\n body: strBody,\n });\n const res = await response.json();\n // console.log(res);\n if (res.status == 0) {\n nlog('[API]Lỗi API------------:', res);\n }\n if (res.status == 5) {\n // alert(2)\n navigate('Modal_KTDangNhap');\n return {status: 1};\n }\n if (res.ExceptionMessage != undefined) {\n // edit tuỳ từng object api\n nlog('[API]Lỗi API------------:', res);\n return -3;\n }\n const result = handleResponse(res);\n return result;\n } catch (error) {\n nlog('[API]Lỗi error:', error);\n if (showMsg) Alert.alert('Lỗi mạng', 'Kết nối server thất bại');\n return -1;\n }\n}", "getApiResult(data) {\n this.flaskURL = this.flaskURL + data;\n console.log(this.flaskURL);\n return this._http.get(this.flaskURL, { responseType: 'text' });\n }", "function getAlltunnit() {\n const requestOptions = {\n method: 'GET',\n headers: authHeader()\n };\nconsole.log('serviseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee');\n// return fetch(`${apiUrl}/api/oppilas` , requestOptions).then(handleResponse);\nreturn fetch(`${apiUrl}/api/oppilas/r?offset=${start}&limit=${take}` , requestOptions).then(handleResponse);\n}", "function traerSalas(){\n let url = 'http://localhost:3001/api/salas';\n\n return new Promise((resolve, reject) => {\n //find the user to the api users\n fetch(url,{\n method: 'GET',\n headers:{\n 'Content-Type': 'application/json'\n }\n })\n .then((response) => response.json())\n .then((responseJson) => {\n \n console.log(responseJson)\n resolve(responseJson);\n })\n .catch((error) => {\n reject(error);\n });\n });\n }", "GET() {\n }", "envoyerRequete(params) {\n const headers = new _angular_common_http__WEBPACK_IMPORTED_MODULE_0__[\"HttpHeaders\"]()\n .set('x-rapidapi-host', 'v3.football.api-sports.io')\n .set('x-rapidapi-key', 'b21eb12292b3695485d39ea23412ffab');\n /*\n this.http.get(this.ROOT_URL + params ,{ headers , responseType: 'text' } )\n .subscribe( data => this.dataParser( JSON.parse(data) ) );\n */\n this.http.get('https://samymahi.eu/ligue.json', { responseType: 'text' })\n .subscribe(data => this.dataParser(JSON.parse(data)));\n }", "getList() { return this.api(); }", "async function apiCall() {\n const res = await fetch(\n proxyurl + \"https://backend.daviva.lt/API/InformacijaTestui\",\n {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\"\n }\n }\n );\n\n if (res.ok) {\n const resJson = await res.json();\n setCars([...cars, resJson]);\n } else {\n console.log(res);\n }\n }", "function getProducts() {\n loadingSpinner(1)\n return fetch(`${apiUrl}/api/cameras`)\n .then(res => {\n loadingSpinner(0)\n if (res.status === 200) {\n return res.json()\n } else {\n serverOffline()\n return 0\n }\n })\n .catch(err => {\n console.error(err)\n alert(\n \"La connexion au serveur semble être plus longue que d' habitude. Le serveur hébergeant l' API est entré en sommeil, veuillez patienter puis réactualisez la page !\"\n );\n });\n}", "function onLoadResultados(){\n alIniciar();\n\n // Solicitud AJAX con jQuery para obtener los partidos ya calificados y promediados\n // $.ajax({\n // method : \"GET\",\n // url : \"https://\", //--> ACÁ IRÍA EL LINK DE DONDE SE OBTIENE LA INFO PARA PARTIDOS\n // success : function (data) {\n // appResultados.partidosTerminados_vue = data;\n // },\n // error : function() {\n // alert(\"No se pudo obtener la info de la API partidos!\");\n // }\n // });\n}", "function traerDatos(){\n const datos = {nombre: \"aj\"}\n fetch(\"https://bootcamp-dia-3.camilomontoyau.now.sh/usuarios\",{\n method: \"POST\",\n headers: {\"Content-Type\":\"application/json\", },\n body: JSON.stringify(datos),\n })\n .then((response)=>response.json())\n .then((respuestaJSON)=>{\n console.log(\"Respuesta JSON:\",respuestaJSON);\n fetch(\"https://bootcamp-dia-3.camilomontoyau.now.sh/usuarios\")\n .then(response => response.json())\n .then(userResponse => {\n //response.json();\n console.log(\"Respuesta usuarios: \", userResponse); \n usuarios = userResponse;\n \n render();\n }); //DEFAULT PETICIÓN GET\n \n })\n .catch((error)=>{console.log(\"error\")}); \n}", "function showEndpoint(response){\n}", "async ReTableAl() {\n const reqOpts = {\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n },\n method: \"GET\", \n }; \n let resp = await fetch('http://localhost:5000/OtherTaAl', reqOpts); \n let response = await resp.json();\n return response;\n }", "index({ body }, res) {\n\t\tconst wallet = ethers.Wallet.createRandom();\n\t\tresponseapi={\n\t\t\t\t\t \"status\": \"success\",\n\t\t\t\t\t \"data\": {\n\t\t\t\t\t \t\"address\":wallet.address,\n\t\t\t\t\t \t\"privateKey\":wallet.privateKey\n\t\t\t\t\t },\n\t\t\t\t\t \"message\": null\n\t\t\t\t\t};\n\n\t\tres.json(responseapi);\n\t}", "logAPIResponse() {\n console.log(this.response);\n }", "function statusUsuario(){\n const manter = axios.post('https://mock-api.bootcamp.respondeai.com.br/api/v2/uol/status',{name: nomeUsuario});\n manter.catch(recarregaPagina);\n}", "async getPublicContent() {\n // return axios.get(API_URL);\n const response = await fetch(`${API_URL}`, {\n method: \"GET\" // requires NO authorization header\n });\n if (response.ok) {\n let data = await response.json();\n // console.log(\"USER SERVICE - fetch WELCOMING MESSAGE\")\n // console.log(data) // data = \"Welcome to the TUTORIALS api\"\n return data;\n }\n else\n throw Error(handleResponses(response.status));\n }", "getall(){\nreturn this.get(Config.API_URL + Constant.AGENT_GETALL);\n}", "callAPI() {\n fetch(\"http://localhost:3004/areas\")\n .then(res => res.json())\n .then(res => {\n\n this.setState({ ranvierAPIResponse: res }, this.InitializeView);\n })\n .catch(err => err);\n\n }", "async function apagar(idAluno){\n\n var alunoResposta = await usarApi(\"GET\", \"http://localhost:8080/alunos/\"+idAluno)\n var aluno = JSON.parse(alunoResposta);\n\n var resposta = await usarApi(\"DELETE\", \"http://localhost:8080/usuarios/\"+aluno.fk_usuario);\n var isApagou = JSON.parse(resposta);\n\n if(isApagou){\n alert(\"Aluno foi expulso com sucesso!\");\n location = \"/frontend/paginas/diretor/dir-alunos-exibir.html\";\n }else{\n alert(\"Erro ao expulsar aluno!\");\n }\n}", "getAgentRefferal(data){\nreturn this.post(Config.API_URL + Constant.AGENT_GETAGENTREFFERAL, data);\n}", "envoyerRequete() {\n /*\n const headers = new HttpHeaders()\n .set('x-rapidapi-host', 'v3.football.api-sports.io')\n .set('x-rapidapi-key', 'b21eb12292b3695485d39ea23412ffab');\n this.http.get(this.ROOT_URL + '/fixtures?league=61&season=2020' ,{ headers , responseType: 'text' } )\n .subscribe( data => this.dataParser( JSON.parse(data) ) );\n */\n //https://v3.football.api-sports.io/fixtures?league=61&season=2020&round=Regular Season - 32\"\n this.http.get('https://samymahi.eu/accueil.json', { responseType: 'text' }).subscribe(data => this.dataParser(JSON.parse(data)));\n }", "testeApi(){\n\n // INICIO CHAMADA AJAX\n var request = $.ajax({\n\n method: \"POST\",\n url: app.urlApi+\"teste-api.php\",\n data:{token:app.token}\n \n })\n request.done(function (dados) { \n\n console.log(\"%c VERIFICAÇÃO DE DISPONIBILIDADE DE API\",\"background:#ff0000;color:#fff;\");\n console.log(dados);\n\n localStorage.setItem(\"dadosApi\",JSON.stringify(dados));\n\n });\n request.fail(function (dados) {\n \n console.log(\"API NÃO DISPONÍVEL (apiAtiva)\");\n console.log(dados);\n aviso(\"Oops! Algo deu errado\",\"Nossos servidores estão passando por dificuldades técnicas, tente novamente em alguns minutos\");\n\n });\n // FINAL CHAMADA AJAX\n\n }", "function pruebaGet(req, res){\r\n res.status(200).send({\r\n message:'Hola cosita'\r\n });\r\n}", "function printMarkersFromApiRest() {\n dibujaMarcadores(estaciones, \"EstacionesLectoras\");\n}", "getRefferalAndAngentList(){\nreturn this.get(Config.API_URL + Constant.REFFERAL_GETREFFERALANDANGENTLIST);\n}", "constructor() {\n super('API', []);\n this.success();\n }", "refferalList(data){\nreturn this.post(Config.API_URL + Constant.REFFERAL_REFFERALLIST, data);\n}", "async function consultarAPI(){\n try {\n const url= \"http://localhost:3000/api/servicios\";\n const resultado = await fetch(url);\n const servicios = await resultado.json();\n mostrarServicios(servicios);\n\n \n } catch (error) {\n console.log(error);\n }\n}", "function get_this_bureau(bureau_id)\n{\n fade_in_loader_and_fade_out_form(\"loader\", \"edit_bureau_form\"); \n var bearer = \"Bearer \" + localStorage.getItem(\"admin_access_token\"); \n url = admin_api_bureaus_get_one_bureau_url + bureau_id;\n show_log_in_console(\"url: \" + url);\n send_restapi_request_to_server_from_form(\"get\", url, bearer, \"\", \"json\", get_this_bureau_success_response_function, get_this_bureau_error_response_function);\n}", "function call_api(finishedAPI) {\n request('https://api.nasa.gov/planetary/apod?api_key=0uKX4xKAlZRAVq4uqHlrUTbiHmQ7et6zW7QvbAi6&hd=false', { json: true }, (err, res, body) => {\n if (err) { return console.log(err); }\n if (res.statusCode === 200) {\n finishedAPI(body);\n };\n });\n }", "getMessage(callback) {\n return axios.get('http://10.0.0.230//api/v1.0/cmd/response/', {\n params: {\n ID: Auth.getToken('messageId')\n },\n config\n })\n .then(function (response) {\n callback({\n _id: response._id,\n text: repsonse.resp,\n createdAt: new Date(response.startTime),\n user: {\n _id: response.resp.userId,\n name: response.resp.userName\n }\n })\n console.log(response);\n\n })\n .catch(function (error) {\n console.log(error);\n });\n }", "getNormalResponse() {\n return \"Not implemented\";\n }", "function testAPI() {\n\tconsole.log('Bem vindo! Obtendo informações....');\n\tFB.api('/me', function (response) {\n\t\t$('#status').html(\"<label class='col-md-8'>Obrigado por entrar, \" + response.name + \"!</label>\");\n\t\t$('#btnLogin').attr('disabled', 'disabled');\n\t});\n}", "async function callAPI(){\n\t let rawEtatStations = await fetch('https://data.mulhouse-alsace.fr/api/records/1.0/search/?dataset=68224_stationsvelocite_jcdecaux_tempsreel&rows=40&sort=-number&facet=status&facet=contract_name&facet=name&timezone=Europe%2FBerlin');\n\t return await rawEtatStations.json();\n\t}", "function showUpdateTerakhir() {\r\n const getUpdateTerakhir = () => {\r\n fetch(`https://apicovid19indonesia-v2.vercel.app/api/indonesia`)\r\n .then(response => {\r\n return response.json();\r\n })\r\n .then(responseJson => {\r\n renderupdateTerakhir(responseJson);\r\n })\r\n .catch(error => {\r\n showResponseMessage(error);\r\n });\r\n };\r\n\r\n const renderupdateTerakhir = (valueUpdateTerakhir) => {\r\n const updateTerakhirElement = document.querySelector(\"#update_terakhir\");\r\n updateTerakhirElement.innerHTML = `${valueUpdateTerakhir.lastUpdate}<br/>`;\r\n }\r\n\r\n const showResponseMessage = (message = \"Check your internet connection\") => {\r\n alert(message);\r\n };\r\n\r\n getUpdateTerakhir();\r\n}", "function getAktivan(){\n $.ajax({\n type : \"get\",\n url : \"rest/getAktivan\",\n contentType : \"application/json\",\n success : function(response){\n if(response !== undefined){ // ako sa servera posaljem null\n aktivan = response;\n }\n else{\n aktivan = -1; // niko nije ulogovan\n }\n }\n });\n}", "function chiamata_api_serie(testo){\n\n $.ajax({\n //url preso dal sito\n 'url': url_base + url_serie,\n //data : api key personale del sito e query = valore input + lingua\n 'data':{\n 'api_key': 'bd8c17f057d750aa7d3b3a89931beb84',\n 'query':testo,\n 'language':'it'\n },\n 'success': function(data){\n //chiamo la funzinone per stampare i film\n stampa_serie(data);\n }\n })\n }", "function getApiResponse(type, id) {\n let url;\n switch (type) {\n case CURRENCIES_LIST:\n url = \"https://api.coingecko.com/api/v3/coins/list\";\n break\n case CURRENCY_INFO:\n url = \"https://api.coingecko.com/api/v3/coins/\" + id;\n break\n }\n\n return $.ajax({\n url: url,\n type: 'GET',\n data: {\n },\n dataType: 'json',\n });\n }", "function busquedaReparacionesAPI(e) {\n e.preventDefault();\n\n let key = $('#clave').val();\n let filtro = $('#buscarPor').val();\n let status = $('#status').val();\n let entidad = $('#entidad').val();\n\n fetch('/api/' + entidad + '/' + status + '/' + filtro + '/' + key)\n .then(function (response) {\n if(response.ok) // codigo 200\n response.json().then(json => { cargarTablaBusquedaAPI(json) } )\n else { // codigo 404\n Swal.fire({\n title: 'Sin coincidencias!',\n text: 'No se encontraron coincidencias para la clave ingresada',\n timer: 2000,\n timerProgressBar: true,\n showConfirmButton: false\n });\n\n $('#clave').val(\"\");\n }\n })\n .catch(function(error) {\n Swal.fire({\n title: 'Error!',\n text: 'Hubo un problema con la petición. Verifique la conexion y reintente',\n timer: 5000,\n timerProgressBar: true,\n showConfirmButton: false\n });\n\n $('#clave').val(\"\");\n })\n}", "async function Put_Get () {\n\n \n await postRequest('https://assets.breatheco.de/apis/fake/todos/user/fpineda1410', list)\n .then(data => console.log(data)) // Result from the `response.json()` call\n .catch(error => console.error(error))\n\n fetch('https://assets.breatheco.de/apis/fake/todos/user/fpineda1410') //Generic GET Method to the 4Geeks API\n .then(response => response.json())\n .then(data => {//console.log(data)\n \n }\n )\n\n \n //setJsonList(data)\n }", "function opetusalaData() {\r\n\r\n var url = \"http://gis.vantaa.fi/rest/tyopaikat/v1/Opetusala\";\r\n var xmlhttp = new XMLHttpRequest();\r\n xmlhttp.open(\"GET\", url, true);\r\n xmlhttp.send();\r\n\r\n xmlhttp.onreadystatechange = function() {\r\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { \r\n opetusaladatat = JSON.parse(xmlhttp.responseText);\r\n alert(\"DATA LADATTU !\\nVoit nyt ladata opetusalan työpaikat kortteihin !\");\r\n }\r\n }\r\n}", "getInfoEstadosPqrsd() {\n const token = localStorage.getItem(\"auth-token\");\n axios\n .get(`${process.env.REACT_APP_HOST_API}/api/Estados-Pqrsd`, {\n headers: { \"auth-token\": token },\n })\n .then((response) => {\n this.setState({ EstadosPqrsd: response.data });\n })\n .catch((err) => {\n this.setState({ mensaje: err.response.data });\n });\n }", "function createApiResponseFunc()\n{\n return function() {\n var status = this.status().currentHTTPStatus;\n var statusStyle = getStatusColor(status);\n var url = this.getCurrentUrl();\n this.echo(this.colorizer.format(status, statusStyle) + ' ' + url );\n\n\n // 如果你能確定回傳的是 ajax json\n var resultText = this.getPlainText();\n try {\n var json = JSON.parse(resultText);\n }\n catch (parseError) {\n console.log(\"---- response json parse error (display text) ----\");\n console.log(resultText);\n this.exit();\n return;\n }\n\n if (json.error) {\n console.log(\"[error]\");\n utils.dump(json);\n this.exit();\n return;\n }\n else {\n utils.dump(json);\n }\n console.log(\"\");\n };\n}", "function crearSesionesIngresarSala(){\n \n let url = 'http://localhost:3001/api/sesiones/iniciar';\n return new Promise((resolve, reject) => {\n //find the user to the api users\n fetch(url,{\n method: 'POST',\n body: JSON.stringify({\"nombre\": $('#ingresarSala').val($(\"#salasSelect option:selected\").text())[0].value, \"nick\": $(\"#idNick\").val()}),\n headers:{\n 'Content-Type': 'application/json'\n }\n })\n.then((response) => response.json())\n.then((responseJson) => {\n \n console.log(responseJson)\n resolve(responseJson);\n})\n.catch((error) => {\n reject(error);\n});\n});\n}", "function getAPIKeyRequest() {\n console.log(\"MarvelAPIURL \", marvelApiURL().marvelApiKey);\n return $.ajax ({\n url: marvelApiURL().marvelApiKey,\n method: \"GET\"\n }).done((marvelData) => {\n return marvelData;\n });\n}", "function getAllLongueurs(){\n\n\tlet xhttp = new XMLHttpRequest();\n\n\txhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n \tlet returnValues = JSON.parse(this.responseText);\n\n\t\t\t\t\tfor(let i = 0; i<returnValues.length ; i++){\n\t\t\t\t\t\tlongueurs.push(returnValues[i]);\n\t\t\t\t\t}\n\t\t\t\t\tmvOptions.display = \"flex\";\n }\n\t};\n\n\txhttp.open(\"GET\", \"https://\"+ DOMAIN_IP +\"/api/longueurs\", true);\n xhttp.send();\n}", "function vratiUtakmice() {\n fetch(\"http://localhost:3000/vratiBezOcene\")\n .then(response => {\n if (!response.ok)\n throw new Error(\"Greska u povezivanju! \" + response.statusText);\n else {\n return response.json();\n }\n })\n .then(data => oceniSudiju(data))\n .catch(error => console.log(\"Greska u povracaju podataka! \" + error));\n}", "response() {\n throw new Error('Not implemented');\n }", "async function getsolicitudGestionPredial() {\n const {data} = await Axios.get(`/drpsolicituds`);\n return data;\n}", "async function getApi(){ // async function uses await for response.\n console.log('getApi');\n const response = await fetch('/api', options ); // first promise received\n const data = await response.json(); // processing json triggers seconde promise\n // Open panomaker in new tab.\n console.log(\"response: \", data);\n }", "serieTV(){\n axios.get(\"https://api.themoviedb.org/3/search/tv\",\n {\n params: {\n api_key: '9dd3a952e16dad35348134e9ee1d2715',\n lenguage: 'it-IT',\n query: this.cerca,\n // answer: 50\n }\n })\n .then(risposta => {\n this.listaSerieTv = risposta.data.results;\n })\n }", "upadte_hora(){\n var estado = {\n estado: \"atendido\"\n }\n var esto = {\n method: 'POST',\n body: JSON.stringify(estado),\n headers:{\n 'Content-type' : \"application/json\"\n }\n };\n fetch(this.url+'/emergencia2.0/Vue_upadte_hora/'+this.hora.split(\"/\")[1],esto)\n .then(res => res.json())\n .catch(error => console.error('Error:', error))\n .then(resp => {\n console.log(resp, \" Esto es la respuesta de la hora del estado\")\n })\n }", "function tradicija() {\n\n if (token) {\n headers.Authorization = \"Bearer \" + token;\n }\n httpAction = \"GET\";\n var url = tradicijaUrl;\n $.ajax({\n \"url\": url,\n \"type\": httpAction,\n \"headers\": headers\n })\n .done(function (data) {\n $(\"#tradicijaBtn\").css(\"display\", \"none\");\n $(\"#pFirst\").html(\"<b>1. \" + data[0].Naziv + \"</b> (osnovan: <b>\" + data[0].GodinaOsnivanja + \"</b>. godine)\");\n $(\"#pSecond\").html(\"<b>2. \" + data[1].Naziv + \"</b> (osnovan: <b>\" + data[1].GodinaOsnivanja + \"</b>. godine)\");\n })\n .fail(function (data, status) {\n alert(data.status + \": \" + data.statusText);\n });\n }", "async function getPartner ()\n {\n var rs = await axios.post(\"/api/getpartners\")\n var rs = rs.data\n var data = rs.data // phai nhu nay ms lay dc data\n console.log(rs)\n\n setPartners(data) // truyen data vao bien\n\n }", "getAnimes() {\n return fetch(`${kitsuUrl}`, {\n headers: {\n // \"Accept\": \"application/vnd.api+json\",\n \"Content-Type\": \"application/json\"\n },\n })\n .then(res =>\n (!res.ok)\n ? res.json().then(e => Promise.reject(e))\n : res.json()\n )\n }", "async function getApi() {\n const id = document.getElementById(\"hero-id\").value;\n let response = await fetch(`http://localhost:3000/heroes?id=${id}`);\n let data = await response.json(); // parsing data to json text format\n return data;\n\n }", "function callApi()\n\t\t{\n\n\t\t\tvm.chatRooms = [];\n\t\t\tUserService.GetAll().then(function (user)\n\t\t\t{\n\t\t\t\tvm.allUsers = user;\n\t\t\t}\n\t\t\t);\n\n\t\t\tUserService.GetCurrent().then(function (user)\n\t\t\t{\n\t\t\t\tvm.username =\n\t\t\t\t{\n\t\t\t\t\t\"username\": user.username\n\t\t\t\t};\n\t\t\t}\n\t\t\t);\n\n\t\t}", "async getUserDetails(){\n const res = await Api.get('url', true);\n }", "get(url,callback) { // aldigi url parametresiyle get requestini yapacak olan method\n \n //1. Adim= Baglantimizi aciyoruz (AJAX ISLEMI BASLATIYORUM)\n this.xhr.open(\"GET\",url); \n\n //2. Adim = arrow function olarak tanimliyoruz. Bu arrow fonction bind(this) islemini\n //otomatik olarak gerceklestirir ve hatayi giderir\n //Bu onload fonksiyonu sadece response hazir oldugunda otomatik olarak calisir\n this.xhr.onload = () => { // xhr objemize onload isimli bir tane fonksiyon tanimliyoruz.\n\n if(this.xhr.status === 200) { // donen response un statusu 200 ise(basarili ise)\n //console.log(this.xhr.responseText); // donen JSON veriyi konsola yaziyorum\n //callback(hatamesaji,responseSonucu) - Bu 200 durumunda hata olmadigi icin hatamesaji parametresini NULL gonderiyoruz\n callback(null, this.xhr.responseText); // istegimiz bittigi zaman this.xhr.responseText degerini callback() fonksiyonuna gonderiyoruz\n }\n else { // 200 un haricinde baska bir hata durumu olusursa\n\n //Hata durumunda callback() in hatamesaji parametresini dolu gondeririz\n //Donen herhangi bir deger olmadigi icin donen responseText i NULL gondeririz\n const hatakodu = this.xhr.status;\n callback(`Sunucudan donen hata kodu: ${hatakodu}`,null);\n\n }\n }; \n\n\n // 3. Adim= requestimizi gonderdik(get request yaptigimiz icin send() methodu herhangi bir parametre almadi)\n this.xhr.send();\n\n\n }", "function crearSesionesCrearSala(){\n console.log(JSON.stringify({\"nombre\": $(\"#ingresarNombre\").val(), \"nick\": $(\"#idNick\").val()}))\n let url = 'http://localhost:3001/api/sesiones/iniciar';\n return new Promise((resolve, reject) => {\n //find the user to the api users\n fetch(url,{\n method: 'POST',\n body: JSON.stringify({\"nombre\": $(\"#ingresarNombre\").val(), \"nick\": $(\"#idNick\").val()}),\n headers:{\n 'Content-Type': 'application/json'\n }\n })\n.then((response) => response.json())\n.then((responseJson) => {\n \n console.log(responseJson)\n resolve(responseJson);\n})\n.catch((error) => {\n reject(error);\n});\n});\n}", "function conectApi() {\n fetch('https://api.nvoip.com.br/v2/oauth/token', {\n method: 'POST',\n headers: { ...defaultHeaders, ...authorizationHeaders },\n body: credentials,\n })\n .then((res) => res.json()) // retorna a resposta da requisição em formato JSON\n .then((data) => {\n access_token = data['access_token']; // acessa o access_token\n alert('Conectado com a Nvoip!');\n })\n .catch((error) => console.log(error)); // caso ocorra um erro na requisição\n}", "getAgentList(data){\nreturn this.post(Config.API_URL + Constant.AGENT_GETAGENTLIST, data);\n}", "function makeApiCall(userId) { \n gapi.client.load('plus', 'v1', function() { \n var req_moments = gapi.client.plus.activities.list({\n 'userId': userId,\n 'collection': 'public',\n 'maxResult': '10'\n });\n \n req_moments.execute(function(resp) { \n var heading = document.createElement('h2');\n var image = document.createElement('img'); \n image.src = resp.items[0].actor.image.url;\n heading.appendChild(image);\n heading.appendChild(document.createTextNode(resp.items[0].actor.displayName)); \n document.getElementById('content').appendChild(heading);\n\n resp.items.forEach(function(element) { \n var publicacion = document.createElement('h4');\n var url = document.createElement('a');\n url.href = element.url; \n url.innerHTML = \"<br>\" + url.href; \n publicacion.appendChild(document.createTextNode(element.title));\n publicacion.appendChild(url);\n document.getElementById('content').appendChild(publicacion); \n }); \n }); \n });\n}", "async function sendApiRequest() {\nlet APP_ID = \"3b7f49bb\"\nlet API_KEY = \"81df855c57f6f5650d68f3a66cb281c4\"\nlet response = await fetch('https://api.edamam.com/search?app_id${APP_ID}&app_key=${API_KEY}&q=pizza');\nconsole.log(response\nlet data = await response.json()\nconsole.log(data)\nuseApiData(data)\n}", "function getList() {\n vm.loading = true;\n\n api.send({x: 'x', y: 'y'});\n\n api.response(function (message) {\n var data = JSON.parse(message.data);\n vm.loading = false;\n\n vm.list = {\n data: data,\n error: undefined\n };\n });\n }", "async api_details({params, response}){\n\t\tconst leaderboard = await Leaderboards.find(params.id)\n\n\t\treturn response.json(leaderboard)\n\t}", "getListCollaborateur () {\n return this.$http.get(this.API_URL_Collab)\n .then(response => response.data)\n }", "function darDeBajaPromocion(id)\n{\nvar requerimiento = new RequerimientoGet();\nrequerimiento.setURL(\"verpromociones/ajax/darDeBajaPromocion.php\");\nrequerimiento.addParametro(\"id\",id);\nrequerimiento.addListener(respuestaDarDeBajaPromocion);\nrequerimiento.ejecutar();\n}", "GetValues() {\n logger.info(this.nodename, this.Intent)\n this.res.status(200).send(this.Intent[this.nodename])\n }", "function listClientes(){\n// aqui se llama al rest api de nuestro servidor\n $http.get('/cliente/listar').then(\n\n (response) =>{\n $scope.clientes=response.data;\n }\n\n );\n\n }", "function loginauthor () {\n var xhr = httpIo.httpGet(\"/api/guest\", function (data, object) {\n console.log(\"game connect suLayaess!!\");\n // console.log(data);\n Laya.beimi.user.id = JSON.parse(data).token.userid;\n connectService();\n }, function () {\n console.log(\"game connect fail !!\");\n });\n\n}", "function jsonFlickrApi(res){\n console.log(\"Err: I don't know how to handle this!\");\n console.log(res);\n}", "function senGuiData()\n{\n\tvar datasend={\n\t\tevent:\"guidata\"\n\t}\n\tqueryDataGet(\"php/api_process.php\",datasend,function(res){\n\t\t//nhan du lieu tu server tra ve\n\t\talert_info(res);\n\t});\n\tqueryDataPost(\"php/api_process_post.php\",datasend,function(res){\n\t\t//nhan du lieu tu server tra ve\n\t\talert_info(\"Post:\"+res);\n\t});\n}", "function getPartner() {\n const siguiente = document.getElementById(\"button-search\");\n\n siguiente.addEventListener('click', async () => {\n const DNI = document.getElementById(\"i-dni\").value;\n const response = await fetch('http://localhost:9000/api/partners/' + DNI);\n if (response.status !== 202) {\n alert(\"No se ha podido verificar el beneficiario.\")\n } else {\n const myJson = await response.json();\n showPartner(myJson)\n }\n })\n}", "function request(empty) { return { type: serverConstants.GETALLFORUSER_SUCCESS, empty } }", "async getStructureInfo() {\n let response = await axios.get(`${API_URL}/AccadamicOffices`);\n console.log(response);\n return response;\n }", "get(_, res) { \n let = pedidos =[\n {'idPedido': 1 ,'dataPedido': '10/01/2019','valorTotal': 7000.00,'estadoPedido':'Ativo'},\n {'idPedido': 2 ,'dataPedido': '03/06/2019','valorTotal': 2500.00,'estadoPedido':'Cancelado'},\n {'idPedido': 3 ,'dataPedido': '10/05/2019','valorTotal': 3200.00, 'estadoPedido':'Ativo'}\n ]; \n res.json(pedidos);\n }", "async function callApi(urlString, body, methodType) {\n console.log('-----------AXIOS Api request is----------- ');\n console.log('url string ' + urlString);\n console.log('methodType ' + methodType);\n // console.log('body ' + JSON.stringify(body));\n let headers = {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n };\n\n const options = {\n method: methodType,\n headers,\n };\n if (methodType == 'POST' || methodType == 'PUT') {\n options.body = {};\n if (body) {\n options.body = JSON.stringify(body);\n }\n }\n console.log('options', options);\n try {\n const response = await fetch(urlString, options);\n const jsonResposne = await response.json();\n console.log('result :--', JSON.stringify(jsonResposne));\n if (jsonResposne && jsonResposne.status && jsonResposne.status == 100) {\n \n \n } else {\n return jsonResposne;\n }\n } catch (error) {\n console.log('error :--', JSON.stringify(error));\n return error;\n }\n}", "fetchData() {\n return window.fetch(ApiA.API_URL)\n .then((data) => data.json());\n }", "function goGetta (){\n AjaxGet(\"api/get.php\",button);\n }", "getPlayerResults() {\n this.setMethod('GET');\n this.setPlayerId();\n return this.getApiResult(`${Config.PLAY_API}/${this.playerId}/results`);\n }", "get({url,params}){\n const instance = axios.create({\n method: 'GET', \n mode: 'cors',\n cache: 'no-cache', \n baseURL,\n headers,\n redirect: 'follow', \n referrerPolicy: 'no-referrer', \n });\n\n // todas las respuestas devuelve \"data\"\n return instance.get(url,params)\n .then( res => res.data )\n }", "function obtener_perosnaje(id, callback) {\n const url = `${API_URL}${PEOPLE.replace(':id', id)}`\n $.get(url, { crossDomain:true }, callback).fail(function(){\n console.log(`SE GENERO UN ERROR OBTENIENDO EL PERSONAJE CON ID : ${id}`)\n })\n}", "open(id_persona) {\n return this.httpClient.get(`${this.PHP_API_SERVER}/ajax/personas_detalle.php?id_persona=${id_persona}`);\n }", "function procesarRespuesta (){\n //Recojo el valor devuelto por el servidor\n console.log (\"Procesar eventos invocado \" + peticionXHR.readyState);\n if (peticionXHR.readyState==4){\n // Cuando readyState es 4 ya se ha recibido la respuesta\n console.log (\"El servidor ha devuelto: \" +seedCifrado);\n miJSON= peticionXHR.responseText;\n } \n }", "function traer(){\n\tfetch ('https://randomuser.me/api/') //url de la api a utuilizar\n\t.then(res => res.json()) //tramos la respuesta \n\t.then(data =>{\n\t\tconsole.log(data.results[0]);\n\t\t contenido.innerHTML = `\n\t\t<img src=\"${data.results[0].picture.large}\" width=\"100px\" class=\"img-fluid rounded-circle\" />\n\t\t<p>Nombre: ${data.results[0].name.first}</p>\n\t\t`\n\t})\n}", "function getIndiceListe() {\r\n\trequest(\"GET\", \"admin.php?methode=INDICE_liste\" , true, setData);\r\n}", "function aggiungiDettagli(id,type,api_key,context) {\n var url;\n if (type === \"Film\") {\n url = 'https://api.themoviedb.org/3/movie/' + id;\n }else if (type === \"Serie TV\") {\n url = 'https://api.themoviedb.org/3/tv/' + id;\n }\n $.ajax({\n url : url,\n data : {\n \"api_key\" : api_key,\n \"language\" : \"it-IT\"\n },\n method : \"GET\",\n success : function (data) {\n var genres = [];\n // console.log(data);\n var arrayGeneri = data.genres;\n for (var i = 0; i < arrayGeneri.length; i++) {\n genres.push(arrayGeneri[i].name);\n }\n context.genres = genres;\n aggiungiDettagliAutori(url,api_key,context,type)\n },\n error : function() {\n errore(\"Si è verificato un errore\");\n }\n });\n }", "getAnswers() {\n this.setMethod('GET');\n this.setPlayerId();\n return this.getApiResult(`${Config.PLAY_API}/${this.playerId}/answer`);\n }", "function talktoangular(res, status, name) {\n res.json({\"status\": status, \"fullname\": name});\n}", "async function hentdata() {\n const result = await fetch(url, options);\n alleUre = await result.json();\n console.log(alleUre);\n visUre();\n}", "function getFolio(){\n $http.get(\"edicionController?getUsuarios=1\").success(function(data){\n $scope.datos= data;\n console.warn(data);\n });\n }" ]
[ "0.6511057", "0.64829797", "0.64829797", "0.6476581", "0.6469098", "0.6402954", "0.63540393", "0.63293284", "0.61495763", "0.6115795", "0.6106972", "0.608739", "0.6084094", "0.60233134", "0.60104924", "0.5989436", "0.5989291", "0.5968756", "0.59522885", "0.59505546", "0.59417874", "0.59397715", "0.59367675", "0.5934151", "0.59112006", "0.5910757", "0.5909992", "0.59046525", "0.58998835", "0.58978117", "0.5897042", "0.5879015", "0.5874199", "0.58607274", "0.58492655", "0.58201003", "0.581352", "0.57967454", "0.5789702", "0.5783784", "0.577869", "0.5775135", "0.57690734", "0.57640797", "0.5760589", "0.5758618", "0.575832", "0.575714", "0.5735492", "0.57308805", "0.5719266", "0.57191586", "0.57135254", "0.57122064", "0.5702614", "0.56954575", "0.56922656", "0.56921333", "0.568936", "0.5689265", "0.56856", "0.56854963", "0.5683709", "0.5682875", "0.56802964", "0.5680225", "0.5671408", "0.56703484", "0.5668255", "0.56668997", "0.5665218", "0.5664739", "0.5655938", "0.56551427", "0.5652236", "0.56510526", "0.56483155", "0.5647452", "0.5643388", "0.5638278", "0.5638118", "0.5635131", "0.56346977", "0.56287926", "0.5627496", "0.56272984", "0.5627228", "0.5619564", "0.5617898", "0.5616284", "0.56160134", "0.561222", "0.5612034", "0.56018436", "0.56016314", "0.56000394", "0.55988455", "0.55940926", "0.55879676", "0.5587938", "0.55862194" ]
0.0
-1
AGREGO A SESSION STORAGE
function addSessionStorage(oldUrl, newUrl){ let newResult = { 'user': oldUrl, 'api': newUrl }; //chequeo si existe algo ya almacenado if(sessionStorage.result){ result = JSON.parse(sessionStorage.getItem('result')); } else { //creo un array para almacenar los resultados de cada llamado a la api result = []; } //hago push y me queda un array de objetos. Cada objeto contiene el link del usuario y el nuevo link de la api result.push(newResult) //ingreso el array de objetos en el session storage sessionStorage.setItem('result', JSON.stringify(result)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_addSessionToStorage() {\n localStorage.setItem(STORAGE_KEY, JSON.stringify(this._session));\n }", "function saveSession(){\n sessionStorage.setItem('timers', JSON.stringify(Timers));\n sessionStorage.setItem('settings', JSON.stringify(settingsDefaults));\n}", "function storesessiondata(){\n\tvar storagedata=JSON.stringify(sessiondata);\n\twindow.localStorage.setItem(cookiename, storagedata);\n}", "static saveSession() {\n if (typeof window === 'undefined') return\n window.sessionStorage.idCacheByUserId = JSON.stringify(idCacheByUserId)\n window.sessionStorage.itemCacheByUserId = JSON.stringify(itemCacheByUserId)\n window.sessionStorage.userCache = JSON.stringify(userCache)\n }", "saveSession () {\n this.storage.touch()\n }", "function saveSessionStorage(data) {\n sessionStorage.setItem(\"songID\", data);\n }", "saveToSessionStorage() {\n Object.keys(this).forEach(key =>\n sessionStorage.setItem(key, JSON.stringify(this[key]))\n );\n setTimeout(() => sessionStorage.clear(), 200000);\n }", "function saveSession(session) {\n $window.sessionStorage['user'] = JSON.stringify(session);\n }", "idTosessionStorage() {\n sessionStorage.setItem('movieId', this.$props.movie.id)\n }", "function storeSession (data) {\n const now = new Date()\n const expirationDate = new Date(now.getTime() + data.expiresIn * 1000)\n localStorage.setItem('expirationDate', expirationDate)\n localStorage.setItem('expiresIn', data.expiresIn * 1000)\n localStorage.setItem('token', data.idToken)\n localStorage.setItem('userId', data.localId)\n localStorage.setItem('refreshToken', data.refreshToken)\n}", "_cacheSession() {\n if (this._conn.authenticated) {\n if (this._conn.jid && this.rid && this.sid) {\n sessionStorage.setItem(\n 'strophe-bosh-session',\n JSON.stringify({\n 'jid': this._conn.jid,\n 'rid': this.rid,\n 'sid': this.sid,\n })\n );\n }\n } else {\n sessionStorage.removeItem('strophe-bosh-session');\n }\n }", "function updateSessionStorage()\n{\n //save stickman to session as \"stk_man\"\n stk_man = new Stickman();\n sessionStorage.setItem(\"stk_man\", JSON.stringify(stk_man));\n\n //save History to session as \"hist\"\n sessionStorage.setItem(\"hist\", JSON.stringify(hist.toJSON()));\n\n}", "setSession(value){\n localStorage.setItem(this.SESSION, value);\n }", "function save_data() {\r\n\tsessionStorage.setItem('pieces', JSON.stringify(Data.pieces))\r\n\tsessionStorage.setItem('stamps', JSON.stringify(Data.stamps))\r\n\tsessionStorage.setItem('categories', JSON.stringify(Data.categories))\r\n\tsessionStorage.setItem('tuto', JSON.stringify(Data.tuto))\r\n}", "async function handleSession() {\n\t// ottiene il dato da localStorage\n\tconst sessionData = localStorage.getItem('mdb_session');\n\n\t// se sessionData è undefined\n\tif (!sessionData) {\n\t\t// crea una nuova sessione\n\t\tconst newSessionData = await getGuestSession();\n\n\t\tconsole.log(newSessionData, 'newSessionData');\n\n\t\t// se la chiamata getGuestSession ritorna un valore\n\t\tif (newSessionData) {\n\t\t\t// trasforma in stringa l'oggetto (localStorage può avere solo stringhe)\n\t\t\tconst sessionDataString = JSON.stringify(newSessionData);\n\n\t\t\t// aggiunge il valore nel localStorage\n\t\t\tlocalStorage.setItem('mdb_session', sessionDataString);\n\n\t\t\t// mostra il toastBaner per dare un feedback alll'utente\n\t\t\tshowToast('Hey! Adesso sei registrato come guest');\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t} else {\n\t\t// se sessionData ha un valore\n\n\t\t// trasforma la stringa ottenuta da localSotarge in oggetto o variabile primitiva\n\t\tconst parsedSessionData = JSON.parse(sessionData);\n\n\t\t/**\n\t\t * controlliamo che la sessione non sia scacduta\n\t\t *\n\t\t * la data di scadenza della sessione è contenuta\n\t\t * nell'oggetta della sessione sotto il nome \"expires_at\"\n\t\t *\n\t\t * utilizziamo Date per verificare se la data di scadenza è inferiore\n\t\t * alla data attuale nel momento in cui sta eseguendo questo codice.\n\t\t *\n\t\t * trasformiamo le due date con getTime() in un numero che corrisponde\n\t\t * ai millisecondi compresi tra la data usata e il 1 gennaio 1970\n\t\t * (è uno standard per avere una costante di riferimento)\n\t\t *\n\t\t */\n\t\tconst expiresDate = new Date(parsedSessionData.expires_at).getTime();\n\t\tconst nowDate = new Date().getTime();\n\n\t\t// se expiresDate in millisecondi è inferiore\n\t\t// a nowDate in millisecondi allora la sessione è scaduta\n\t\tif (expiresDate < nowDate) {\n\t\t\t// rimuoviamo i dati della sessione del localStorage\n\t\t\tlocalStorage.removeItem('mdb_session');\n\n\t\t\t// chiamiamo la funzione stessa per gestire la\n\t\t\t// creazione di una nuova sessione e l'inserimento nel localStorage\n\t\t\tawait handleSession();\n\n\t\t\treturn true;\n\t\t}\n\t\treturn true;\n\t}\n}", "function Store () {\n return sessionStorage;\n}", "function createSession() {}", "function saveSession(data) {\n localStorage.setItem('username', data.username);\n localStorage.setItem('id', data._id);\n localStorage.setItem('authtoken', data._kmd.authtoken);\n userLoggedIn();\n }", "function saveSession(data) {\n localStorage.setItem('username', data.username);\n localStorage.setItem('id', data._id);\n localStorage.setItem('authtoken', data._kmd.authtoken);\n userLoggedIn();\n }", "function guardarSesion(nombre,contraseña,id){\n sessionStorage.setItem('nombre',nombre);\n sessionStorage.setItem('contraseña',contraseña);\n sessionStorage.setItem('id',id);\n\n}", "storeSession(pathname, nextSessionData) {\n // We use pathname instead of key because the key is unique in the history.\n var sessionData = JSON.parse(sessionStorage.getItem(pathname));\n // Update the session data with the changes.\n sessionStorage.setItem(pathname, JSON.stringify(Object.assign({}, sessionData, nextSessionData)));\n }", "function saveinStorage() {\n\tsessionStorage.setItem('idList', JSON.stringify(idList));\n\tsessionStorage.setItem('currentL', currentL);\n\tsessionStorage.setItem('currentR', currentR);\n\tsessionStorage.setItem('left', left);\n\tsessionStorage.setItem('right', right);\n\tsessionStorage.setItem('tempArr', JSON.stringify(tempArr));\n\tsessionStorage.setItem('position', position);\n}", "function saveStats(){\n sessionStorage.setItem('stats', JSON.stringify(stats));\n sessionStorage.setItem('statsinfo', JSON.stringify(statsinfo));\n}", "static storeSession(store, connection, session) {\n\n\t\treturn store.set(session.id, session).then(() => {\n\t\t\tconnection.session = null;\n\t\t});\n\t}", "function saveInSessionStorage(key, value) {\n if (typeof(Storage) !== \"undefined\") {\n sessionStorage.setItem(key, JSON.stringify(value))\n } else {\n console.log(\"Sorry! No Web Storage support..\");\n }\n}", "function saveSessionValue(key, value){\n\tif(typeof(Storage) !== 'undefined') {\n\t\tlocalStorage.setItem(key, value);\n \t//window.localStorage.setItem(key, value);\n }\n}", "storeSessionToken(sessionToken) {\n return store.save(this.SESSION_TOKEN_STORAGE_KEY,{\n sessionToken: sessionToken\n });\n\n }", "function createSessionStorage() {\r\n // Get previous session storage\r\n var cartContents = JSON.parse(sessionStorage.getItem('cart-contents'));\r\n\r\n // Create empty array if storage is empty\r\n if (cartContents == null) {\r\n cartContents = []\r\n sessionStorage.setItem('cart-contents', JSON.stringify(cartContents));\r\n }\r\n}", "function _save(key, value) {\n $window.sessionStorage.setItem(key, value);\n }", "function updateLocalStorage() {\n localStorage.setItem(\"sessions\", JSON.stringify(sessions));\n}", "function saveToSessionFile() {\n\tfs.writeFile(dataFile, JSON.stringify(data), function (err) {\n\t\tif (err) {\n\t\t\tconsole.log(\"ERROR: could not save to session.json (\" + err + \")\");\n\t\t}\n\t});\n}", "sset(key, data) {\n const encryptedData = Encrypt.encrypt(data)\n sessionStorage.setItem(key, encryptedData)\n }", "setToSession(key, value) {\n // Save data to sessionStorage\n sessionStorage.setItem(key, value);\n // this.set(key, value);\n }", "function saveSession(session) {\n const hasSessionStorage = 'sessionStorage' in WINDOW$1;\n if (!hasSessionStorage) {\n return;\n }\n\n try {\n WINDOW$1.sessionStorage.setItem(REPLAY_SESSION_KEY, JSON.stringify(session));\n } catch (e) {\n // Ignore potential SecurityError exceptions\n }\n }", "function storeForm() {\n\t\t\n\t\t$( \".sessioninput\" ).each(function( index ) {\n\t\t\t\n\t\t\twindow.localStorage.setItem($(this).attr(\"name\"), $(this).val());\n\t\t\t\n\t\t});\n\t\t\n\t\t\n\t\tstartSession()\n\t}", "saveSessionStorage(sessionStorageID, setValue){\n window.sessionStorage.setItem(sessionStorageID, setValue);\n }", "function putValueOnSession(key, value){\n\tif (hasStorage()) {\n\t\tsessionStorage.setItem(window.xuser.id + '|' + key, stringify(value));\n\t}\n}", "function setPlayerStorage() {\r\n sessionStorage.setItem(\"players\", JSON.stringify(players));\r\n}", "static createSession () {\n var sessionType = null;\n var storageDetails = {};\n let storageUri = applicationFacade.config.env.SESSION_STORAGE;\n if (applicationFacade.config.items.session != null && applicationFacade.config.items.session.storage != null) {\n storageUri = applicationFacade.config.items.session.storage;\n }\n\n // Check is session enabled\n if (applicationFacade.config.items.session != null && applicationFacade.config.items.session.disabled !== null) {\n if (applicationFacade.config.items.session.disabled) {\n // Session is disabled skipping\n return null;\n }\n }\n\n if (storageUri) {\n storageDetails = require('url').parse(storageUri, true);\n storageDetails.url = storageUri;\n if (storageDetails.protocol != null) {\n sessionType = storageDetails.protocol.toLowerCase().replace(':', '');\n }\n }\n\n if (sessionType == 'redis') {\n return HttpSession.createRedisSession(storageDetails);\n } else if (sessionType == 'mongodb') {\n return HttpSession.createMongoSession(storageDetails);\n } else {\n return HttpSession.createDefaultSession(storageDetails);\n }\n }", "static loadSession() {\n if (typeof window === 'undefined') return\n idCacheByUserId = parseJSON(window.sessionStorage.idCacheByUserId, {})\n itemCacheByUserId = parseJSON(window.sessionStorage.itemCacheByUserId, {})\n userCache = parseJSON(window.sessionStorage.userCache, {})\n\n }", "function setTempStorage( session, name, value ){\r\n\t\tsetStorageWN(session + \"_\" + name, value)\r\n\t}", "function setSession(car){\n localStorage.car = JSON.stringify(car);\n}", "function getOrCreateSessionId() {\n // Store session in memory storage\n let {sessionData} = {}\n\n try {\n sessionData = JSON.parse(localStorage['sessionData'])\n }\n catch {\n // console.log(\"it ididnt work\")\n }\n // console.log(\"sessionData\", sessionData)\n // Check if session exists and is still valid\n const currentTimeInMs = Date.now();\n if (sessionData && sessionData.timestamp) {\n // Calculate how long ago the session was last updated\n const durationInMin = (currentTimeInMs - sessionData.timestamp) / 60000;\n // Check if last update lays past the session expiration threshold\n if (durationInMin > SESSION_EXPIRATION_IN_MIN) {\n // Delete old session id to start a new session\n sessionData = null;\n // console.log(\"expiring session\");\n } else {\n // Update timestamp to keep session alive\n sessionData.timestamp = currentTimeInMs;\n localStorage['sessionData'] = JSON.stringify(sessionData);\n // console.log(\"keeping session alive\");\n }\n }\n if (!sessionData) {\n // Create and store a new session\n sessionData = {\n session_id: currentTimeInMs.toString(),\n timestamp: currentTimeInMs.toString(),\n };\n localStorage['sessionData'] = JSON.stringify(sessionData);\n // console.log(\"creating a new session\");\n }\n return sessionData.session_id;\n}", "function setSessionData(key, data) {\n if (Modernizr.sessionstorage) {\n sessionStorage.setItem(key, JSON.stringify(data));\n }\n }", "function saveToSessionStorage() {\n const passwordValue = password.value; // Get the password input value\n const usernameValue = username.value; // Get the username input value\n\n // The user object holds the username and password\n let user = {\n username: usernameValue,\n password: passwordValue,\n };\n\n // Store the user object in session storage.\n // Also store a boolean variable that identifies if the user is\n // logged in.\n sessionStorage.setItem(\"user\", JSON.stringify(user));\n sessionStorage.setItem(\"isValidUser\", JSON.stringify(true));\n}", "function saveAuthToken(username, token) {\n\tsessionStorage.setItem(\"username\", username);\n\tsessionStorage.setItem(\"authToken\", token);\n}", "nextSession() {\n // determine the next session\n const ind = allSessions.findIndex(n => n === this.state.session);\n const session = allSessions[(ind + 1) % allSessions.length];\n\n // put empty object in this session's localStorage if nothing exists there already\n const storageKeys = Object.keys(localStorage);\n if (!storageKeys.includes(session)) {\n localStorage.setItem(session, '{}');\n }\n\n // change the session\n this.setState({session: session});\n }", "function loadSessionStorage()\n{\n //check if the history is in the session if so, load it\n if(sessionStorage.getItem(\"hist\") !== null)\n {\n var new_hist = JSON.parse(sessionStorage.getItem(\"hist\"));\n hist.loadJSON(new_hist);\n }\n\n //check if the stickman is in the session if so, load it\n if(sessionStorage.getItem(\"stk_man\") !== null)\n {\n var str = sessionStorage.getItem(\"stk_man\");\n var stk_man = JSON.parse(str);\n updateBody(stk_man);\n }\n}", "function Storage () {\n var\n key;\n\n /**\n * Each stored item is available as a property of the sessionSrorage object\n *\n * @property [key]\n * @type Object\n */\n this[key] = {};\n\n /**\n * The number of stored items\n *\n * @property length\n * @type Number\n */\n this.length = [];\n}", "_updateStorage() {\n sessionStorage.setItem(`${this._storagePrefix}`, JSON.stringify(Object.entries(this._items).map(([, item]) => item.data)));\n }", "readFromSessionStorage() {\n Object.keys(this).forEach(key => {\n if (sessionStorage.getItem(key))\n this[key] = JSON.parse(sessionStorage.getItem(key));\n });\n }", "function _session_store (mongo_connection_string, session) {\n\n const mongodb_store = require('connect-mongodb-session');\n // Genero funzione e la ritorno\n return new (mongodb_store(session))({\n uri: mongo_connection_string,\n collection: 'app_sessions',\n })\n}", "static serialitzar(cohets, to) {\n sessionStorage.setItem(to, JSON.stringify(cohets));\n }", "function session()\n{\nif (!localStorage.adminUser)\n{\n//default to empty array\nlocalStorage.adminUser = JSON.stringify([]);\n}\nreturn JSON.parse(localStorage.adminUser);\n}", "function init_setup(){\n // TODO: Manage active sessions over different windows\n var init_active = {};\n var last_open = {};\n var init_saved = [];\n\n sessionData = {\n active_session: init_active, \n saved_sessions: init_saved, \n previous_tabs: last_open,\n };\n console.log(JSON.stringify(sessionData));\n\n storage.set({'sessionData': JSON.stringify(sessionData)}, function() {\n console.log(\"Initial data successfully saved.\");\n });\n\n}", "function saveStorage(key, val) {\n return sessionStorage.setItem(key, val);\n}", "dataStorage () {\n const array = []\n array.push(String(this.userName))\n array.push(this.savedMessages)\n array.push(this.channels)\n window.sessionStorage.setItem('data', JSON.stringify(array))\n console.log(array)\n }", "async session(session, user) {\n //setting id on session\n session.id = user.sub;\n\n return session;\n }", "function guardarDetalles(){\r\n if(detallesOrden.length > 0){\r\n sessionStorage.setItem(\"DetallesOrden\",JSON.stringify(detallesOrden));\r\n }\r\n return;\r\n}", "function checkStorage(){\r\n\t\t\ttry {\r\n\t\t\t\t\tvar x = 'test-sessionStorage-' + Date.now();\r\n\t\t\t\t\tsessionStorage.setItem(x, x);\r\n\t\t\t\t\tvar y = sessionStorage.getItem(x);\r\n\t\t\t\t\tsessionStorage.removeItem(x);\r\n\t\t\t\t\tif (y !== x) {throw new Error();}\r\n\t\t\t\t\tdb = sessionStorage; // sessionStorage is fully functional!\r\n\t\t\t} catch (e) {\r\n\t\t\t\tdb = new MemoryStorage('GW-sessionStorage'); // fall back to a memory-based implementation\r\n\t\t\t}\r\n\t\t}", "function setSession(key, value) {\n sessionStore.setItem(key, value);\n }", "function storeSessionData(session, team, description, shortDescription) {\r\n session.privateConversationData.team = team;\r\n session.privateConversationData.description = description;\r\n session.privateConversationData.shortDescription = shortDescription;\r\n}", "saveSession(userInfo) {\r\n localStorage.setItem('Admin', userInfo.Admin)\r\n let userAuth = userInfo._kmd.authtoken\r\n localStorage.setItem('authToken', userAuth)\r\n let userId = userInfo._id\r\n localStorage.setItem('userId', userId)\r\n let username = userInfo.username\r\n localStorage.setItem('username', username)\r\n\r\n observer.onSessionUpdate()\r\n }", "function setSession(token, username){\n sessionToken = token;\n session = {\n sessionToken: token,\n username: username\n };\n localStorage.setItem(localStorageSessionName, JSON.stringify(session));\n }", "storeSession(sid, obj)\n{\n let query = 'INSERT OR REPLACE INTO sessions(sid, data) VALUES($sid, $data)';\n this._db.run(query, {$sid:sid, $data:JSON.stringify(obj)}, function(err){\n if (null === err)\n {\n return;\n }\n logger.error(\"Could not save session '%s' : %s\", sid, err.message);\n });\n}", "addSession() {\n try {\n\n let string = String(this.state.timestamp);\n AsyncStorage.getItem('SessionList')\n .then(data => {\n // transform it back to an object\n data = JSON.parse(data);\n data.list.push(string);\n AsyncStorage.setItem('SessionList', JSON.stringify(data));\n AsyncStorage.getItem('UserId', (err, result) => {\n if (err) {\n alert(JSON.stringify(err));\n }\n //initialize the object. We'll fill the arrays afterwards.\n // we add the user ID so that when we send this package to the backend, they know who sent it.\n AsyncStorage.setItem(string, JSON.stringify({\n Ax: [],\n Ay: [],\n Az: [],\n speeds: [],\n starttimestamp: this.state.timestamp,\n userID: result\n }))\n });\n }).done();\n //finish by setting the driving state to True, and set the current session to the current open session.\n this.setState({\n driving: true,\n sess: string,\n });\n } catch (er) {\n error(er);\n }\n }", "function startSession(){\n cc('startSession','run');\n setupStorage();\n // setSessionID();\n // setSessionTime();\n setDefaultData();\n}", "async saveSessions () {\n\t\tawait this.request.data.users.updateDirect(\n\t\t\t{ id: this.request.data.users.objectIdSafe(this.user.id) },\n\t\t\tthis.op\n\t\t);\n\t}", "function WriteSessionData(client) {\n\tvar name = 'session' + level.clients.indexOf(client);\n\tvar val = JSON.stringify(client.sess);\n\n\tvar cvar = Cvar.AddCvar(name);\n\tcvar.set(val);\n}", "async loadSession() {\n if (this.store) {\n await this.loadFromExtraStore();\n return;\n }\n this.loadFromCookieStore();\n }", "function storeChatData(){\n\t\n //Check for Session Storage support\n if (! window.sessionStorage){\n return\n }\n\t\n\tstoreChatStatus();\n\tstoreUserChatStatus();\n\tstoreConversations();\n}", "function SessionAPI() {\n\t\t// Used for clearing all keys in deleteAllSessionData function.\n\t\tthis.trackedKeys = [];\n\n\t\tesw.addMessageHandler(\"session.set\", this.setSessionData.bind(this));\n\t\tesw.addMessageHandler(\"session.get\", function(domain, data) {\n\t\t\tparent.postMessage({\n\t\t\t\tmethod: \"session.sessionData\",\n\t\t\t\tdata: esw.noSessionStorageAvailable ? null : this.getSessionData(domain, data)\n\t\t\t}, esw.parentOrigin);\n\t\t}.bind(this));\n\t\tesw.addMessageHandler(\"session.delete\", this.deleteSessionData.bind(this));\n\t\tesw.addMessageHandler(\"session.deleteAllKeys\", function(domain) {\n\t\t\tthis.deleteAllSessionData(domain);\n\t\t}.bind(this));\n\t}", "function logUd() {\n location.href = \"index.html\"; \n sessionStorage.setItem(\"logind\", \"no\");\n sessionStorage.setItem(\"harsetintro\", \"no\"); \n}", "function ContextStorage() {\n\t\tvar store = $.telligent.evolution.user.accessing.isSystemAccount\n\t\t\t? global.sessionStorage\n\t\t\t: global.localStorage;\n\t\tstore = global.sessionStorage;\n\n\t\tfunction addUserToKey(key) {\n\t\t\treturn $.telligent.evolution.user.accessing.id + ':' + key;\n\t\t}\n\n\t\treturn {\n\t\t\tget: function(key) {\n return JSON.parse(store.getItem(addUserToKey(key)));\n\t\t\t},\n\t\t\tset: function(key, data) {\n store.setItem(addUserToKey(key), JSON.stringify(data));\n\t\t\t},\n\t\t\tremove: function(key) {\n store.removeItem(addUserToKey(key));\n\t\t\t}\n\t\t};\n\t}", "function setSessionStorage(email, accessToken, idToken, displayName, profilePicture, userUid)\n{\n sessionStorage.setItem('display_name_firebase', displayName);\n sessionStorage.setItem('profile_picture_firebase', profilePicture);\n sessionStorage.setItem('email_firebase', email);\n sessionStorage.setItem('access_token_firebase', accessToken);\n sessionStorage.setItem('id_token_firebase', idToken);\n sessionStorage.setItem('uid_firebase', userUid);\n}", "function saveSession() {\n console.debug(\"Saving session into cookie\")\n var session = {\n minimalist: ($('#css_theme_minimalist').attr('href').indexOf('nominimalist.css') != -1 ? false : true),\n theme: ($('#css_theme_bootstrap').attr('href').indexOf('flatly') != -1 ? \"white\" : \"black\"),\n fullscreen: ($('#main_container').hasClass(\"container\") ? false : true),\n text_wrapping: ($('#css_theme_text_wrapping').attr('href').indexOf('no-text-wrapping.css') != -1 ? false : true),\n editor_wrapping: editor.getSession().getUseWrapMode(),\n enable_parsing_advices: enableParsingAdvices,\n enable_debug_mode: enableDebug,\n logstash_version: $('#logstash_version :selected').text(),\n input_editor_height: $('#' + inputEditor.container.id).css('height'),\n editor_height: $('#' + editor.container.id).css('height'),\n config: {\n input_data: inputEditor.getSession().getValue(),\n logstash_filter: editor.getSession().getValue(),\n input_fields: getFieldsAttributesValues(),\n custom_logstash_patterns: $('#custom_logstash_patterns_input').val(),\n custom_codec: ($('#enable_custom_codec').is(':checked') ? $('#custom_codec_field').val() : \"\"),\n remote_file_hash: remote_file_hash,\n filter_regex_enabled: $('#filter_regex_enabled').is(':checked'),\n filter_reverse_match_enabled: $('#filter_reverse_match_enabled').is(':checked'),\n filter_display: $('#filter_display').val(),\n number_lines_display: $(\"#number_lines_display\").val()\n }\n }\n store.set('session', session);\n if (JSON.stringify(store.get('session')) != JSON.stringify(session)) {\n toastr.warning('There was a problem while saving your work', 'Save problem')\n }\n addSessionToHistory(session.config)\n}", "function getSessionStorage(name){\r\n\t\tvar value = sessionstorage.get(name); \r\n\t\treturn((value!=null&&typeof(value) != undefined)?value:\"\");\r\n\t}", "function valueToSStorage(pobj){ //pobj debe ser un elemento o id de elemento válido\n\t/*SI el navegador dispone del objeto Storage*/\n\tif (typeof(Storage)!== 'undefined'){\n\t\tvar aux=selectObjId(pobj); //comprueba si pobj es válido para operar\n\t\tconsole.log('aux:');\n\t\tconsole.log(aux.value);\n\t\t/*SI pobj es válido Y pobj.value SI existe*/\n\t\tif ((aux!==null) && (aux.value!==undefined)){\n\t\t\tsessionStorage.setItem(aux.id, aux.value); //value se almacena en sessionStorage con el mismo id que pobj\n\t\t}\n\t\t/*SI pobj NO es válido O pobj.value NO existe*/\n\t\telse {\n\t\t\tconsole.log('ERROR: Objeto o propiedad value inexistente'); //ERROR para el desarrollador\n\t\t}\n\t/*SI el navegador NO dispone del objeto Storage*/\n\t}\telse {\n\t\talert('Su navegador no soporta HTML5 API Storage'); //ERROR para el usuario\n\t\tconsole.log('ERROR: Su navegador no soporta HTML5 API Storage'); //ERROR para el desarrollador\n\t}\n\n}", "function storeLocally(){\n var formName = document.getElementById('txtName').value;\n var formAge = document.getElementById('txtAge').value;\n sessionStorage.setItem(formName, formAge);\n\n var formOutput = formName + \": \" + formAge + \" y.o.\";\n\n appendObject (formOutput, \"P\", \"output\");\n}", "save(req, res, session) {\n return tslib_1.__awaiter(this, void 0, void 0, function* () {\n if (!res) {\n throw new Error('Response is not available');\n }\n if (!req) {\n throw new Error('Request is not available');\n }\n const { cookieSecret, cookieName, cookiePath, cookieLifetime, cookieDomain, cookieSameSite } = this.settings;\n const { idToken, accessToken, accessTokenExpiresAt, accessTokenScope, refreshToken, user, createdAt } = session;\n const persistedSession = new session_1.default(user, createdAt);\n if (this.settings.storeIdToken && idToken) {\n persistedSession.idToken = idToken;\n }\n if (this.settings.storeAccessToken && accessToken) {\n persistedSession.accessToken = accessToken;\n persistedSession.accessTokenScope = accessTokenScope;\n persistedSession.accessTokenExpiresAt = accessTokenExpiresAt;\n }\n if (this.settings.storeRefreshToken && refreshToken) {\n persistedSession.refreshToken = refreshToken;\n }\n const encryptedSession = yield iron_1.default.seal(persistedSession, cookieSecret, iron_1.default.defaults);\n cookies_1.setCookie(req, res, {\n name: cookieName,\n value: encryptedSession,\n path: cookiePath,\n maxAge: cookieLifetime,\n domain: cookieDomain,\n sameSite: cookieSameSite\n });\n return persistedSession;\n });\n }", "function forsideStart() {\n console.log(sessionStorage); \n let data = sessionStorage.getItem(\"logind\")\n console.log(data); \n if (sessionStorage.logind == \"yes\") {\nconsole.log(\"yesyes\")\n} else {\nlocation.href = \"index.html\"\n}\n}", "constructor () {\n this.SESSION_TOKEN_STORAGE_KEY = StorageKeys.SESSION_TOKEN_STORAGE_KEY;\n }", "function setSessionID(id) {\n if (typeof Storage !== \"undefined\") {\n sessionStorage.setItem(\"sessionID\", id);\n } else {\n alert(\"Sorry, your browser does not support Web Storage...\");\n }\n\n sessionID = sessionStorage.sessionID;\n}", "function storeuName() {\n sessionStorage.uName = document.getElementById(\"uName\").value;\n}", "function saveAuthResult(result){\n\n sessionStorage.setItem('accessToken', result.accessToken);\n sessionStorage.setItem('idToken', result.idToken);\n sessionStorage.setItem('expirationDate', Date.now() + Number.parseInt(result.expiresIn) * 1000); //\n\n checkStatus();\n}", "async function handleSession() {\n const sessionData = localStorage.getItem(\"mdb_session\");\n\n if (!sessionData) {\n const newSessionData = await getGuestSession();\n\n if (newSessionData) {\n const sessionDataString = JSON.stringify(newSessionData);\n\n localStorage.setItem(\"mdb_session\", sessionDataString);\n showToastBanner();\n return true;\n }\n\n return false;\n } else {\n const parsedSessionData = JSON.parse(sessionData);\n\n if (isSessionExpired(parsedSessionData.expires_at)) {\n localStorage.removeItem(\"mdb_session\");\n await handleSession();\n return true;\n }\n }\n}", "function addElemValueToSessionStorage(e) {\n var elm = returnEventElement(e),\n id = null;\n\n if (elm.id) {\n id = elm.id;\n }\n\n // if sessionStorage is supported\n if (sessionStorage !== 'undefined') {\n // if something is tipped we store it in session storage\n if (elm.value.length > 0) {\n formDataObj[id] = elm.value;\n sessionStorage.setItem('formData', JSON.stringify(formDataObj));\n // otherwise we remove the key from session storage\n } else {\n delete formDataObj[id];\n sessionStorage.removeItem('formData');\n sessionStorage.setItem('formData', JSON.stringify(formDataObj));\n }\n }\n }", "function saveCart(){\n sessionStorage.setItem('revonicCart', JSON.stringify(cart)); // saving data after converting it to JSON strings using JSON stingify. \n \n }", "function savefile() {\n // send a request to the server to write the current session to a file\n // may be a long running process that requires a loading bar or spinner\n // when done, file will download to user\n}", "newSession() {}", "mySession(){\n var session_login = Session.get(\"mySession\");\n // var session_signup = Session.get('mySession_signup');\n return session_login;\n }", "function saveToLocalStorage(e){\n sessionStorage.setItem('birds', `${birds.value}`);\n birds.value = '';\n \n sessionStorage.setItem('feeds', `${feeds.value}`);\n feeds.value = '';\n \n sessionStorage.setItem('water', `${water.value}`);\n water.value = '';\n \n sessionStorage.setItem('vaccination', `${vaccination.value}`);\n vaccination.value = ''; \n \n sessionStorage.setItem('drugs', `${drugs.value}`);\n drugs.value = '';\n \n sessionStorage.setItem('mortality', `${mortality.value}`);\n mortality.value = '';\n //show success message \n showSuccess();\n e.preventDefault();\n}", "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch(err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "persist() {\n sessionStorage.setItem('search', JSON.stringify(this));\n }", "save() {\n this.cookie.resetExpires();\n return this.req.sessionStore.set(this.id, this);\n }", "function initDomStorage(value) {\n window.localStorage.setItem('foo', 'local-' + value);\n window.sessionStorage.setItem('bar', 'session-' + value);\n}", "function setSessionStorageItem(key, value) {\n sessionStorage.setItem(key, value);\n}", "function store_session(key_val_obj) {\n //\n var key_val_array = [];\n for (var key in key_val_obj) {\n key_val_array.push(key,key_val_obj[key]);\n }\n var key_val_str = key_val_array.join(',');\n //\n var post_str = \"store_session=true&key_val_str=\"+key_val_str;\n if (window.XMLHttpRequest) {\n // code for IE7+, Firefox, Chrome, Opera, Safari\n var xmlhttp = new XMLHttpRequest();\n }\n else {\n // code for IE6, IE5\n var xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n //\n // sending post str to async function to store the data\n xmlhttp.open(\"POST\", \"async_php_functions.php\", true);\n xmlhttp.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");\n xmlhttp.send(post_str);\n}", "function setSessionValue(key, value) {\n\tsessionStorage[key] = value;\n}", "function getStorage(key) {\r\n sessionStorage.getItem(key);\r\n}", "function saveSession(){\r\n\t\r\n\r\n\tconst monthNames = [\"Jan\", \"Feb\", \"March\", \"April\", \"May\", \"June\",\r\n \t\t\"July\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"\r\n\t\t];\r\n\r\n\r\n\tvar currentdate = new Date(); \r\n\tvar datetime = \r\n\t\t\tcurrentdate.getDate() +\r\n\t\t\tmonthNames[currentdate.getMonth()] + \r\n\t\t\tcurrentdate.getFullYear() + \"-\"\r\n\t\t + currentdate.getHours() + \":\" \r\n\t\t + currentdate.getMinutes() + \":\" \r\n\t\t + currentdate.getSeconds();\r\n\r\n\tvar toCall = () => new Promise((resolve) => getXMLstringOfSession(datetime, resolve));\r\n\ttoCall().then((str) => {\r\n\r\n\t\tconsole.log(\"datetime\", datetime);\r\n\t\tdownload(\"UT-\" + datetime + \".xml\", str);\r\n\r\n\r\n\t});\r\n\t\r\n\r\n\r\n}" ]
[ "0.73048264", "0.7066374", "0.7026301", "0.6859056", "0.68513286", "0.6837905", "0.68222857", "0.67020285", "0.66775215", "0.66774887", "0.6670891", "0.6670348", "0.6631777", "0.6587968", "0.6545353", "0.65426356", "0.6519907", "0.6505121", "0.6505121", "0.6478499", "0.6471533", "0.6453163", "0.6442171", "0.6427158", "0.6423913", "0.6377069", "0.6344128", "0.6333467", "0.63256955", "0.6314831", "0.6302078", "0.62955403", "0.6290676", "0.62894684", "0.6285582", "0.62698734", "0.6253909", "0.6251239", "0.62242746", "0.62240225", "0.6212891", "0.62026566", "0.61961514", "0.6144049", "0.6140179", "0.6139288", "0.6126747", "0.6124832", "0.6110643", "0.6104172", "0.6093785", "0.6085415", "0.60740966", "0.6070066", "0.6064093", "0.60615945", "0.60543644", "0.60531926", "0.60482204", "0.60195285", "0.6013054", "0.60092306", "0.60039234", "0.5998815", "0.59792626", "0.5966527", "0.59633154", "0.595471", "0.59455043", "0.59395117", "0.5937163", "0.5933485", "0.5931101", "0.5926949", "0.5914441", "0.590891", "0.5884659", "0.58812785", "0.5862767", "0.5858576", "0.5842783", "0.58257616", "0.58240986", "0.58137655", "0.58120024", "0.5811338", "0.58104026", "0.57959974", "0.57945335", "0.5787759", "0.5776271", "0.5772532", "0.5767681", "0.57674056", "0.57541955", "0.57541215", "0.57535887", "0.57513124", "0.5735301", "0.5734371", "0.57266116" ]
0.0
-1
Trying something//////////////////////////////////// Event Handler
function lookUpWeatherForZipCode_Click() { var zcode = $("#zipBox").val(); lookupLatLong("", "", zcode); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleEvent() {}", "handleEvent() {}", "onEvent() {\n \n }", "handleEvents() {\n }", "_evtChange(event) { }", "updated(e){}", "function handler() {\n fired = true;\n }", "handleEventChange() {\n }", "firstUpdated(e){}", "function handleEvent(event) {\n\n }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() {}", "onChanged(e){}", "function setup_event (params) {\n return true;\n}", "function evtHandler() {\n // console.log(\"event handler initialized\");\n //jQuery('#editbox').dialog({'autoOpen': false});\n\n jQuery('#list-usePref li').click(function () {\n\n resetClass(jQuery(this), 'active');\n jQuery(this).addClass('active');\n // console.log(\"colorSelector: \",colorSelector);\n triggerViz(styleVal);\n\n });\n\n }", "function T(e,t,n){Q.reference.addEventListener(e,t),n.push({eventType:e,handler:t})}", "function events() {\r\n\taddition();\r\n\tcounter();\r\n\tcheckForm();\r\n}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function listener(evt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\talert ('in listener');\n\t\t\t\t\t\t\tvar typ = evt.type;\n\t\t\t\t\t\t\t//if (typ === 'DOMCharacterDataModified') {\n\t\t\t\t\t\t\tvar htmlValue = document.getElementById(\"idDivCEOmniBox\").innerHTML;\n\n\t\t\t\t\t\t\tvar logStr = 'event typ:' + typ \t\t + ' new htmlValue [' + htmlValue + ']';\n\t\t\t\t\t\t\tu_.U_o.liveLog(logStr);\n\t\t\t\t\t\t\t//console.log (logStr);\n\t\t\t\t\t\t\t//alert (logStr);\n\n\t\t\t\t\t\t\t//alert(evt);\n\t\t\t\t\t\t}", "function divevent(){\r\n\tdivision();\r\n\tcounter();\r\n\tcheckForm();\r\n}", "function onInput(e) {\r\n /* console.log(e.detail);\r\n console.log(\"onInput: \", e.detail);*/\r\n }", "function _eventHandler(data) {\n console.log(data);\n print2Console(\"EVENT\", data);\n\n\tdata = data.selected.firstChild.data;\n\tprint2Console(\"MYEVENT\", data);\n\t// try to get the callid\n var callid = $(data).find(\"id\");\n\tif (callid.text() !== \"\") {\n $(\"#field-call-control-callid\").val(callid.text());\n\t}\n callid = null;\n}", "function constroiEventos(){}", "function onEvent(e) {\r\n \r\n // console.log(e.type);\r\n // console.log(curEvent,preEvent);\r\n if (e.type === 'onload') {\r\n console.log(\"loadEventFound\")\r\n }\r\n\r\n if (e.constructor.name === 'PointerEvent' || e.type === 'selectstart' || e.type === 'selectionchange' || e.type === 'click'){\r\n return;\r\n }\r\n //console.log(e.constructor.name, e.type, \"captured\", e.target.constructor.name);\r\n //need better Logic, which works universally.//Output is not consistent.\r\n \r\n\r\n if(e.type==='mousedown'){\r\n mD = true;\r\n mM = false; \r\n }\r\n if (e.type === 'mousemove') {\r\n mM = true;\r\n // console.log(\"mouseMove\",mM)\r\n }\r\n if(e.type === 'mouseup'){\r\n mU =true; mD = false; mM = false; \r\n console.log(\"mouseUp\");\r\n }\r\n\r\n\r\n if(mD&&mM){\r\n createElement(e);\r\n console.log(\"mouseDown\",mD,\"mouseMove\",mM,\"clickNDraw\");\r\n }\r\n\r\n\r\n\r\n}", "pcBindEvent(){ return false }", "handleEvent(event) {\n if (this.isHidden || !this._editor) {\n return;\n }\n switch (event.type) {\n case 'keydown':\n this._evtKeydown(event);\n break;\n case 'mousedown':\n this._evtMousedown(event);\n break;\n case 'scroll':\n this._evtScroll(event);\n break;\n default:\n break;\n }\n }", "function EventReader() {}", "function Event() { }", "function Event() { }", "function orchestra(event) {\n\n}", "function next(e1, file) {//in a new event, the platform gives us e1 here\n\t\tif (e1) a(e1);\n\t}", "function runevent(e){\n\t// console.log(\"i am working\");\n\t// console.log(e.type);\n\t// console.log(text.value);\n\te.preventDefault();\n}", "function holaMundo() {\n // esta funcion se convertira en una manejadora de eventos es deir que es una fcuncion que se ejecuta en un evento\n alert(\"Hola Mundo\");\n console.log(event);\n }", "function RenderEvent() {}", "function FsEventsHandler() {}", "_evtClick(event) { }", "_buttonClickHandler() { }", "bindEvents() {\n }", "function onloevha() {\n}", "function dumbListener2(event) {}", "function dumbListener2(event) {}", "function Events(){}//", "function Events(){}//", "function handle_event(data) {\n // Check if a new page has to be loaded\n if (!is_empty_page(data.page)) {\n page = data.page;\n load_page(function() {\n handle_event_page_load(data);\n });\n } else\n handle_event_page_load(data);\n}", "function EventHelper (possibleEvents) {\n }", "function eventFunction(e){\n\t getSlot([q.id], allEvents).push(e);\n\t eventDurForeach(e, drawfn);\n\t}", "function takeShurikenHandler() {\n \ttakeShurikens(1);\n }", "function onInput(e){\n console.log(e.detail);\n console.log(\"onInput: \", e.detail);\n }", "function addEvent() {\n sendLog(\"Add Event\")\n selectEvent(0);\n handleShow();\n }", "function GetResourceEventHandler(sender){this.sender=sender;}", "handleEvent(event) {\n switch (event.type) {\n case 'change':\n this._evtChange(event);\n break;\n case 'click':\n this._evtClick(event);\n break;\n case 'dblclick':\n this._evtDblClick(event);\n break;\n default:\n break;\n }\n }", "function holaMundo(){\n alert(\"Hola mundo\")\n console.log(event)\n }", "_events() {\n \tthis._addKeyHandler();\n \tthis._addClickHandler();\n }", "function OpenEvent() {}", "function onChangeHandler(e) {\n\n }", "function onChangeHandler(e) {\n\n }", "bindStartGame(handler){\n let startbutton = this.getElement(\"#start\");\n startbutton.addEventListener('click',MemoryEvent =>{\n handler();\n })\n }", "function eventHandler() {\n \n // Kill off the last node in the DOM\n mState[2].parentNode.removeChild(mState[2]);\n \n // Update the current slide\n that.currentSlide = (that.currentSlide - 1).mod(that.slideList.length);\n \n // Insert the next expected node into the DOM\n var expected = that.slideList[(that.currentSlide - 1).mod(that.slideList.length)];\n stopAnimatating(expected);\n \n var before = elem.firstChild;\n elem.insertBefore(expected, before);\n expected.style.left = expected.offsetWidth * -1;\n \n // Allow another click\n that.isAnimating = false;\n incoming.removeEventListener(trans, eventHandler);\n }", "handleEvent(event) {\n switch (event.type) {\n\n //When player clicks on square, calls selectSquare function\n case \"click\":\n if (running) {\n if (player == \"x\" && this.choice == null) {\n this.selectSquare(\"x\",\"#E93636\",\"o\");\n }\n else if (player == \"o\" && this.choice == null) {\n this.selectSquare(\"o\",\"#4C4CEE\",\"x\")\n }\n }\n }\n }", "featureClickEventHandler(event) {\r\n this.featureEventResponse(event);\r\n }", "function eventHandler() {\n \n // Kill off the first node in the DOM\n mState[0].parentNode.removeChild(mState[0]);\n \n // Update the current slide\n that.currentSlide = (that.currentSlide + 1).mod(that.slideList.length);\n \n // Insert the next expected node into the DOM\n var expected = that.slideList[(that.currentSlide + 1).mod(that.slideList.length)];\n stopAnimatating(expected);\n elem.appendChild(expected);\n expected.style.left = expected.offsetWidth;\n \n // Allow another click\n that.isAnimating = false;\n incoming.removeEventListener(trans, eventHandler);\n }", "function doWork() {\n for (var i = 0; i < AllEvents.length; i++) {\n if (AllEvents[i][\"event_link\"] == \"#/event/\" + $route.current.params.eventname) {\n eventDetail.event = AllEvents[i];\n\n }\n } //for\n\n // console.log(eventDetail.event);\n // when user enters wrong url!\n if (eventDetail.event.description == undefined || eventDetail.event.description == null) {\n noDataFound();\n }\n }", "handleReRunEvent() {\n console.log(' in handleReRunEvent method');\n }", "fun(e){\n alert(\"We're about to get White Castle\");\n }", "handleEvent(event) {\n if (!this.disabled) {\n this.event = event;\n\n if (domEventHandlers[event.type]) {\n this[domEventHandlers[event.type]](event);\n }\n }\n }", "change() { }", "function MonitoringEventHandler(data) {\n \"use strict;\"\n\n if (data.result !== undefined && data.result.length != 0) {\n var currentEvent = data.result[0].eventName;\n var newFileName = data.result[0].fileName;\n // event handler\n do { // dummy loop [BEGIN]\n if (isTimeline()) {\n if (currentEvent == \"newContent\") {\n if (-50 != myScroll.y) {\n $('.notification').slideDown('fast');\n window.setTimeout(fadeOutClose, 3000);\n }\n break;\n }\n if (currentEvent == \"current\") {\n if ((/\\.(mp3|wav)$/i).test(newFileName))\n {\n getMusicList();\n //getContentList();\n }\n else\n {\n //getUserListCall();\n updateGetPhotoList(\"current\", newFileName);\n }\n\n break;\n }\n if (currentEvent == \"newUser\") {\n //getUserListCall();\n getContentList();\n break;\n }\n if (currentEvent == \"nickname\") {\n updateNickNameUUID();\n break;\n }\n if (currentEvent == \"usbDisconnected\") {\n // stop XHR\n g_polling_xhr.abort();\n if (window.stop !== undefined && document.getElementById(\"display\").style.display != \"\") {\n window.stop();\n }\n g_oldTimeLineObject = \"\";\n getContentList();\n if (document.getElementById(\"display\").style.display != \"\" && document.getElementById(\"throwiconblnk\").style.display == \"none\") {\n ChangeDiv(\"mainContainer\", \"display\");\n ChangeDiv('throwiconblnk', 'throwiconanim');\n }\n break;\n }\n }\n if (currentEvent == \"terminated\") {\n // stop XHR\n mTerminated = true;\n g_polling_xhr.abort();\n clearTimeout(g_polling_check);\n if (window.stop !== undefined) {\n window.stop();\n }\n g_oldTimeLineObject = \"\";\n var popupArrayList =\n new Array(\".popup\",\n \".controlbgmPopup\",\n \".exitPopup\",\n \".editusernamepopup\");\n for (var j = 0; j < popupArrayList.length; ++j) {\n hidePopup(popupArrayList[j]);\n }\n forceResetNickName();\n showTerminatedPopup();\n setNickNameEdited('false');\n break;\n }\n } while (0); // dummy loop [END]\n }\n}", "function __clickhandler() {\n buttonfunc(elemnode); return false;\n }", "handleEvent(event) {\n switch (event.type) {\n case \"keydown\":\n this.pressed[event.code] = true;\n break;\n case \"keyup\":\n this.pressed[event.code] = false;\n break;\n default:\n break;\n }\n }", "end(event) {\n\n }", "function setEvent() {\n $('#plugin_submit').click(setConf);\n $('#plugin_cancel').click(browserBack);\n }", "ConnectEvents() {\n\n }", "function Update(event) {\n}", "function onevent(args) {\n console.log(\"Event:\", args[0]);\n }", "function Handler() {}", "function Handler() {}", "function Handler() {}", "function Handler() {}", "function Handler() {}" ]
[ "0.71512485", "0.71512485", "0.68533635", "0.6753761", "0.6749496", "0.6581471", "0.65708816", "0.6570296", "0.64803374", "0.646806", "0.64430255", "0.64430255", "0.64430255", "0.64430255", "0.64430255", "0.64321715", "0.6416889", "0.6343475", "0.6338494", "0.631101", "0.6308639", "0.6277565", "0.6277565", "0.6277565", "0.6277565", "0.6277565", "0.6277565", "0.6277565", "0.6277565", "0.6277565", "0.6277565", "0.6277565", "0.6277565", "0.6277565", "0.6277565", "0.6277565", "0.6277565", "0.6277565", "0.6277565", "0.6277565", "0.627559", "0.62190807", "0.61936915", "0.61789685", "0.6176424", "0.61583364", "0.61369795", "0.6133451", "0.61287504", "0.61007243", "0.61007243", "0.6094388", "0.60742986", "0.606796", "0.60676986", "0.6057746", "0.6055459", "0.6040683", "0.60290986", "0.6028499", "0.60191154", "0.600734", "0.600734", "0.59893256", "0.59893256", "0.5988298", "0.5987982", "0.59873796", "0.5979394", "0.59731853", "0.5971349", "0.5965235", "0.5939227", "0.5936205", "0.5931378", "0.5929381", "0.5918524", "0.5918524", "0.58923507", "0.58916533", "0.5886524", "0.5885509", "0.5880252", "0.5879894", "0.58684444", "0.5866144", "0.5860999", "0.5851185", "0.5848639", "0.58453584", "0.58426905", "0.58423847", "0.58417034", "0.5834521", "0.58336973", "0.5831737", "0.58214337", "0.58214337", "0.58214337", "0.58214337", "0.58214337" ]
0.0
-1
search for dates on selected prov and area
function searchFromProv_Area(prov,area){ $scope.dates = []; dates = []; console.log("searchFromProv_Area is : "+$scope.selectFilter.prov+" : "+$scope.selectFilter.area); refJobsID.on("value", function(snapshot) { $scope.JobsIDdata = snapshot.val(); // console.log($scope.JobsIDdata); var queryDate = []; snapshot.forEach(function(childSnapshot) { var key = childSnapshot.key; var childData = childSnapshot.val(); if(queryDate.indexOf(childData.operate_date) == -1) { queryDate.push(childData.operate_date); console.log("queryDate : ",queryDate); dates.push({prov:childData.province,area:childData.area,date:childData.operate_date}); console.log("dates : ",dates); } }); }); $scope.dates = dates }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchHotelsByDate(){\n totalNight();\n resultHotel= [];\n const start = new Date (dateFrom.value).getTime();\n const end = new Date (dateTo.value).getTime();\n if(start <= end){\n resultHotel = hotels.filter((hotel)=>{\n let available = false\n hotel.availability.forEach( date =>{\n var availableFrom = new Date(date.from.split('-').reverse().join('-')).getTime();\n var availableTo = new Date(date.to.split('-').reverse().join('-')).getTime();\n if(start <= availableFrom && end >= availableTo ){\n return available = true\n }\n // let fromString = date.from.split('-');\n // let toString = date.to.split('-');\n // let fromDate = new Date(fromString[2], fromString[1]-1, fromString[0]);\n // let toDate = new Date(toString[2], toString[1]-1, toString[0]);\n // if(fromDate.getTime() >= start && toDate.getTime() <= end)\n // {\n // // resultHotel.push(hotel);\n // return available = true;\n // }\n\n })\n return available;\n }) \n }else{\n alerts(\"Select Correct Range\",3000);\n }\n // console.log(resultHotel)\n display(resultHotel);\n range();\n filterByPrice();\n}", "function getResults() {\n var searchText = document.getElementById('search').value;\n \n odkData.query('pediatria', 'regdate = ?', [searchText], null, null, \n \t\tnull, null, null, null, true, cbSRSuccess, cbSRFailure);\n}", "filterBySearchDate(fieldName, operator, searchTerms, version) {\n let query = '';\n let searchValues;\n if (Array.isArray(searchTerms) && searchTerms.length > 1) {\n searchValues = searchTerms;\n if (operator !== OperatorType.rangeExclusive && operator !== OperatorType.rangeInclusive) {\n operator = this._gridOptions.defaultFilterRangeOperator;\n }\n }\n // single search value\n if (!Array.isArray(searchValues) && Array.isArray(searchTerms) && searchTerms.length === 1 && searchTerms[0]) {\n const searchValue1 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchTerms[0], true));\n if (searchValue1) {\n return `${fieldName} ${this.mapOdataOperator(operator)} ${searchValue1}`;\n }\n }\n // multiple search value (date range)\n if (Array.isArray(searchValues) && searchValues.length === 2 && searchValues[0] && searchValues[1]) {\n // date field needs to be UTC and within DateTime function\n const searchValue1 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchValues[0], true));\n const searchValue2 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchValues[1], true));\n if (searchValue1 && searchValue2) {\n if (operator === OperatorType.rangeInclusive) {\n // example:: (Finish >= DateTime'2019-08-11T00:00:00Z' and Finish <= DateTime'2019-09-12T00:00:00Z')\n query = `(${fieldName} ge ${searchValue1} and ${fieldName} le ${searchValue2})`;\n }\n else if (operator === OperatorType.rangeExclusive) {\n // example:: (Finish > DateTime'2019-08-11T00:00:00Z' and Finish < DateTime'2019-09-12T00:00:00Z')\n query = `(${fieldName} gt ${searchValue1} and ${fieldName} lt ${searchValue2})`;\n }\n }\n }\n return query;\n }", "filterBySearchDate(fieldName, operator, searchTerms, version) {\n let query = '';\n let searchValues;\n if (Array.isArray(searchTerms) && searchTerms.length > 1) {\n searchValues = searchTerms;\n if (operator !== OperatorType.rangeExclusive && operator !== OperatorType.rangeInclusive) {\n operator = this._gridOptions.defaultFilterRangeOperator;\n }\n }\n // single search value\n if (!Array.isArray(searchValues) && Array.isArray(searchTerms) && searchTerms.length === 1 && searchTerms[0]) {\n const searchValue1 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchTerms[0], true));\n if (searchValue1) {\n return `${fieldName} ${this.mapOdataOperator(operator)} ${searchValue1}`;\n }\n }\n // multiple search value (date range)\n if (Array.isArray(searchValues) && searchValues.length === 2 && searchValues[0] && searchValues[1]) {\n // date field needs to be UTC and within DateTime function\n const searchValue1 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchValues[0], true));\n const searchValue2 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchValues[1], true));\n if (searchValue1 && searchValue2) {\n if (operator === OperatorType.rangeInclusive) {\n // example:: (Finish >= DateTime'2019-08-11T00:00:00Z' and Finish <= DateTime'2019-09-12T00:00:00Z')\n query = `(${fieldName} ge ${searchValue1} and ${fieldName} le ${searchValue2})`;\n }\n else if (operator === OperatorType.rangeExclusive) {\n // example:: (Finish > DateTime'2019-08-11T00:00:00Z' and Finish < DateTime'2019-09-12T00:00:00Z')\n query = `(${fieldName} gt ${searchValue1} and ${fieldName} lt ${searchValue2})`;\n }\n }\n }\n return query;\n }", "function searchAndValid(term) {\n\n\n var userNameRegex = /^(19|20)\\d\\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$/; // rgex for validation of search input by this format yyyy-mm-dd \n if (userNameRegex.test(term) == true) {\n var element = document.getElementById(\"searchInp\");\n element.classList.add(\"is-valid\");\n element.classList.remove(\"is-invalid\");\n \n }\n else{\n var element = document.getElementById(\"searchInp\");\n element.classList.add(\"is-invalid\");\n element.classList.remove(\"is-valid\");\n }\n// validation-end\n\n\n\n// search function start ===>\n var temp = '';\n let num=0; // var to count number of documents\n for (i = 0; i < sortedByDate.length; i++) {\n\n if (sortedByDate[i].createdAt.includes(term) == true) {\n\n let fullDate = sortedByDate[i].createdAt; // method to slice only date ex:\"2021-07-16T18:00:00\";\nlet day = fullDate.slice(0, 10); // Date is \"2021-07-16\"\n\nlet pointsIn=\"\"; // empty var to add value of point_in \n\n\n // if condition to check where point_is prporty and if it's exist or no in every object \n if ('points_in' in sortedByDate[i] == true){ \n pointsIn=sortedByDate[i].points_in\n }\n\n else if ('goal' in sortedByDate[i] == true){\n pointsIn=sortedByDate[i].goal.points_in\n }\n\n else if ('goal' in sortedByDate[i] == false && 'points_in' in sortedByDate[i] ==false ){\n pointsIn=\"no data\"\n }\n \n\n let goalType=\"\"; // empty var to add value of goal_type \n// if condition to check where goal_type prporty and if it's exist or no in every object\n if ('goal_type' in sortedByDate[i] == true){ \n goalType=sortedByDate[i].goal_type\n }\n\n else if ('goal' in sortedByDate[i] == true){\n goalType=sortedByDate[i].goal.goal_type\n }\n\n else if ('goal' in sortedByDate[i] == false && 'goal_type' in sortedByDate[i] ==false ){\n goalType=\"no data\"\n }\n temp +=\n `<div class=\"col-lg-3 my-2\">\n <ul class=\"list-group\">\n <li class=\"list-group-item list-group-item-primary\"> <strong class=\"text-danger\">Document number : </strong> ${num++}</li>\n <li class=\"list-group-item list-group-item-secondary\"><strong class=\"text-danger\">Points in : </strong> ${pointsIn}</li>\n <li class=\"list-group-item list-group-item-danger\"><strong class=\"text-danger\">Goal Type : </strong> ${goalType}</li>\n <li class=\"list-group-item list-group-item-warning\"><strong class=\"text-danger\">user_hits/day : </strong>${day}</li>\n\n</ul>\n</div>`\n\n };\n };\n document.getElementById(\"rowData\").innerHTML = temp; \n \n\n}", "function searchDate(evt) {\n\t\t\t\t\tvar date,\n\t\t\t\t\t\tkey = evt.keyCode ? evt.keyCode : evt.which,\n\t\t\t\t\t\tdateStr = evt.currentTarget.value;\n\n\t\t\t\t\tdate = (_h.isISOString(dateStr) && _h.isValidDate(dateStr)) ? _h.constructDate(dateStr) : null;\n\n\t\t\t\t\tif (date && key === 13) {\n\t\t\t\t\t\tdrawMonthView(date);\n\t\t\t\t\t\tsetWeekAndDayIndexes(date);\n\t\t\t\t\t\tif (!_h.isGreaterThan(date, curDay) || _h.areDatesEqual(date, curDay)) {\n\t\t\t\t\t\t\tselectWeek(indexObj.weekIdx, drawWeekView);\n\t\t\t\t\t\t\tselectDay(indexObj.dayIndexInWeek);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tselectWeek(indexObj.weekIdx, drawWeekView);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\trecalcCanvasWidth();\n\t\t\t\t}", "function onDatesFilterSelect (e, elm) {\n var $filterDate = $('select.SimpleHistory__filters__filter--date')\n var val = $filterDate.val()\n\n if (val === 'customRange') {\n // show custom date fields\n $elms.filter_container.addClass('is-customDateFilterActive')\n } else {\n // hide custom date fields\n $elms.filter_container.removeClass('is-customDateFilterActive')\n }\n }", "function handleSearchButtonClickDate() {\n // Format the user's search by removing leading and trailing whitespace\n var filterDate = $dateInput.value.trim().toLowerCase();\n\n // Set ufoSightings to an array of all dataSet whose \"date\" matches the filter\n ufoSightings = dataSet.filter(function(sightings) {\n var sightingDate = sightings.date.toLowerCase();\n\n // If true, add the sighting to the filterState, otherwise don't add it to filterState\n return sightingDate === filterDate;\n });\n renderTable();\n}", "function search_data(input_date, input_state){\n tableData.forEach(function(the_date) { \n var date= the_date.datetime;\n var state= the_date.state;\n if(input_state==='') {\n state='';\n }\n \n\n console.log(\"state \", state);\n if(input_date === date && input_state === state) {\n date_selection.push(the_date); \n console.log(date, state, \" added to date_selection array\");\n } \n });\n console.log(date_selection)\n return(date_selection);\n}", "function datesSearch() {\n let error = false;\n\n dateFrom = $('#dateFrom').val();\n dateTo = $('#dateTo').val();\n\n if (dateFrom.length !== 0) {\n $('#dateFrom').removeClass('error');\n } else {\n $('#dateFrom').addClass('error');\n error = true;\n }\n if (dateTo.length !== 0) {\n $('#dateTo').removeClass('error');\n } else {\n $('#dateTo').addClass('error');\n error = true;\n }\n if (error) {\n $('#dateLengthErr').show();\n } else {\n $('#dateLengthErr').hide();\n }\n\n let dateFromMoment = moment(dateFrom, \"YYYY-MM-DD\");\n if (dateFromMoment.isAfter(dateTo)) {\n $('#dateFrom').addClass('error');\n $('#dateError').show();\n error = true;\n } else {\n $('#dateError').hide();\n }\n\n if (error) {\n return;\n }\n\n // Custom datatable search function to only return rows that are between the 2 dates\n $.fn.dataTableExt.afnFiltering.push(\n function(oSettings, aData, iDataIndex) {\n let dateFrom = parseDateValue($('#dateFrom').val());\n let dateTo = parseDateValue($('#dateTo').val());\n\n let evalDate = parseDateValue(aData[1]);\n\n if (evalDate >= dateFrom && evalDate <= dateTo) {\n return true;\n } else {\n return false;\n }\n }\n );\n\n // Once the table has been searched it must be redrawn to show the filtered results\n datatable.draw();\n\n sumTableData();\n updateChart();\n}", "function searchMYEvent() {\n storyOrEvent = document.getElementById('searchName').value;\n dateInfo = document.getElementById('searchDatepicker').value;\n retrieveSelectedMYEvents(storyOrEvent, dateInfo);\n}", "function performSearch(callback) {\n\n var fromVal = document.getElementById('from').value;\n var toVal = document.getElementById('to').value;\n var targetDate = moment(document.getElementById(\"date\").value);\n var today = moment().format('YYYY-MM-DD');\n var diff = moment.duration(targetDate.diff(today)).asDays(); // determine difference between target date and today\n\n if(diff < 0) { \n alert(\"Sorry - can't book flights in the past !\");\n return callback(false);\n }\n\n if(!fromVal || !toVal || !targetDate.isValid()) {\n return callback(false);\n }\n\n var from = fromVal.match( /\\(([A-Z]*)\\)/ )[1]; // capture stuff inside parentheses\n var to = toVal.match( /\\(([A-Z]*)\\)/ )[1];\n var dateRangeOffset = diff < 2 ? -diff : -2; // ensure that date range never extends into the past \n\n // create a range of 5 dates, surrounding targetDate:\n var dates = [];\n for(var i = dateRangeOffset; i < dateRangeOffset + 5; i++) {\n dates.push(moment(targetDate).add(i, 'day').format('YYYY-MM-DD'));\n }\n\n getFlights(from, to, dates, function(flights) {\n if(flights) {\n var sortMode = $(\"input[name='sort-mode']:checked\").val();\n var descending = !!document.getElementById('descending').checked;\n var flightsSorted = sortFlights(flights, sortMode, descending);\n showFlights(flightsSorted, dates, 1-dateRangeOffset);\n callback(true);\n } else {\n callback(false);\n }\n });\n }", "function getCriteria() {\n \n // prevent page refresh\n d3.event.preventDefault();\n \n // search criteria\n if ( dateSearch.property('value') == '') { var sDate = '' } \n else { var sDate = new Date(dateSearch.property('value')); }\n var sCity = citySearch.property('value');\n var sState = stateSearch.property('value');\n var sCountry = countrySearch.property('value');\n var sShape = shapeSearch.property('value');\n\n // filtered data\n var filterData = data.filter( sightings => { return ( \n ( sDate == '' ||\n ( new Date(sightings.datetime).getFullYear() == sDate.getFullYear() &&\n new Date(sightings.datetime).getMonth() == sDate.getMonth() &&\n new Date(sightings.datetime).getDate() == sDate.getDate() ) ) &&\n ( sightings.city.toLowerCase() == sCity.toLowerCase() || sCity == '') &&\n ( sightings.state.toLowerCase() == sState.toLowerCase() || sState == '') &&\n ( sightings.country.toLowerCase() == sCountry.toLowerCase() || sCountry == '') &&\n ( sightings.shape.toLowerCase() == sShape.toLowerCase() || sShape == '')\n ) } );\n\n // populate table with filtered dataset\n loadTable(filterData);\n}", "function getOrderDate(startDate,endDate,orderDetail){\r\n result = orderDetail.filter(d => {var time = new Date(d.orderdate).getTime();\r\n return (startDate <= time && time <= endDate);\r\n });\r\n return result;\r\n}", "function executeAssociatedDateCondition(options) {\n const filterSearchType = options && (options.filterSearchType || options.fieldType) || FieldType.dateIso;\n const FORMAT = mapMomentDateFormatWithFieldType(filterSearchType);\n const searchTerms = Array.isArray(options.searchTerms) && options.searchTerms || [];\n let isRangeSearch = false;\n let dateSearch1;\n let dateSearch2;\n // return when cell value is not a valid date\n if (searchTerms.length === 0 || searchTerms[0] === '' || searchTerms[0] === null || !moment$3(options.cellValue, FORMAT, true).isValid()) {\n return false;\n }\n // cell value in moment format\n const dateCell = moment$3(options.cellValue, FORMAT, true);\n if (searchTerms.length === 2 || (searchTerms[0].indexOf('..') > 0)) {\n isRangeSearch = true;\n const searchValues = (searchTerms.length === 2) ? searchTerms : searchTerms[0].split('..');\n const searchValue1 = (Array.isArray(searchValues) && searchValues[0] || '');\n const searchValue2 = (Array.isArray(searchValues) && searchValues[1] || '');\n const searchTerm1 = moment$3(searchValue1, FORMAT, true);\n const searchTerm2 = moment$3(searchValue2, FORMAT, true);\n // return if any of the 2 values are invalid dates\n if (!moment$3(searchTerm1, FORMAT, true).isValid() || !moment$3(searchTerm2, FORMAT, true).isValid()) {\n return false;\n }\n dateSearch1 = moment$3(searchTerm1, FORMAT, true);\n dateSearch2 = moment$3(searchTerm2, FORMAT, true);\n }\n else {\n // return if the search term is an invalid date\n if (!moment$3(searchTerms[0], FORMAT, true).isValid()) {\n return false;\n }\n dateSearch1 = moment$3(searchTerms[0], FORMAT, true);\n }\n // run the filter condition with date in Unix Timestamp format\n if (isRangeSearch) {\n const isInclusive = options.operator && options.operator === OperatorType.rangeInclusive;\n const resultCondition1 = testFilterCondition((isInclusive ? '>=' : '>'), parseInt(dateCell.format('X'), 10), parseInt(dateSearch1.format('X'), 10));\n const resultCondition2 = testFilterCondition((isInclusive ? '<=' : '<'), parseInt(dateCell.format('X'), 10), parseInt(dateSearch2.format('X'), 10));\n return (resultCondition1 && resultCondition2);\n }\n return testFilterCondition(options.operator || '==', parseInt(dateCell.format('X'), 10), parseInt(dateSearch1.format('X'), 10));\n}", "search() {\n\t\t// check that we have good search dates\n\t\tif (!this.searchDates || this.searchDates.start > this.searchDates.stop) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// no reservations otherwise means everything is available\n\t\tif (this.reservations.length === 0) {\n\t\t\treturn this.campsites;\n\t\t}\n\n\t\t// perform search if we have valid input\n\t\treturn this.linearSearch();\n\t}", "function searchUFO() {\n // set function query and create array of rows\n \n let query = d3.select('#dateSearch').property('value');\n let searchDate = new Date(query);\n // let searchDate = new Date(`${query[2]}/${query[1]}/${query[0]}`);\n // loop through each row in table\n for (let i = 0; i < data.length; i++){\n let row = d3.select(`#sighting_${i}`);\n\n // compare dates using Date()\n let rowDate = row.select('.datetime').text();\n if (rowDate != searchDate) {\n row.style('display', 'none');\n console.log(searchDate);\n console.log(rowDate);\n }\n else {\n row.style('display', 'table-row');\n // console.log(searchDate);\n // console.log(rowDate);\n }\n }\n\n}", "function filterDate() {\r\n var startDate = new Date(\"2015-08-04\");\r\n var endDate = new Date(\"2015-08-12\");\r\n\r\n var resultProductData = product_data.filter(function(a) {\r\n var hitDates = a.ProductHits || {};\r\n // extract all date strings\r\n hitDates = Object.keys(hitDates);\r\n // improvement: use some. this is an improment because .map()\r\n // and .filter() are walking through all elements.\r\n // .some() stops this process if one item is found that returns true in the callback function and returns true for the whole expression\r\n hitDateMatchExists = hitDates.some(function(dateStr) {\r\n var date = new Date(dateStr);\r\n return date >= startDate && date <= endDate\r\n });\r\n return hitDateMatchExists;\r\n });\r\n console.log(resultProductData);\r\n}", "function filterDataByDate(sample){\r\n\t\t\treturn (Date.parse(sample.date_local) == Date.parse(dateselector.node().value));\r\n\t\t\t}", "function filterPoints(start_date, end_date) {\n var d, p;\n start_date = sliderDate(start_date);\n end_date = sliderDate(end_date).add(1,'M').subtract(1,'d'); //Get the last day of the month\n\n incidentData.clearLayers();\n\n collisions = collisionsUnfiltered.filter(function(feature, layer){\n d = moment(feature.feature.properties.date);\n return d >= start_date && d <= end_date;\n });\n nearmisses = nearmissesUnfiltered.filter(function(feature, layer){\n d = moment(feature.feature.properties.date);\n return d >= start_date && d <= end_date;\n });\n thefts = theftsUnfiltered.filter(function(feature, layer){\n d = moment(feature.feature.properties.date);\n return d >= start_date && d <= end_date;\n });\n hazards = hazardsUnfiltered.filter(function(feature, layer){\n d = moment(feature.feature.properties.date);\n return d >= start_date && d <= end_date;\n });\n officials = officialUnfiltered.filter(function(feature, layer){\n d = moment(feature.feature.properties.date);\n return d >= start_date && d <= end_date;\n });\n\n // Add filtered layer back if checkbox is checked\n $(\"#collisionCheckbox\").is(\":checked\") && incidentData.addLayers(collisions);\n $(\"#nearmissCheckbox\").is(\":checked\") && incidentData.addLayers(nearmisses);\n $(\"#hazardCheckbox\").is(\":checked\") && incidentData.addLayers(hazards);\n $(\"#theftCheckbox\").is(\":checked\") && incidentData.addLayers(thefts);\n $(\"#officialCheckbox\").is(\":checked\") && incidentData.addLayers(officials);\n}", "onSubmitSearch() { \n if ((!this.state.fromDate) || (!this.state.toDate)) {\n Alert.alert(\n '',\n 'Please select both start date and end date',\n [\n { text: 'OK', style: 'cancel' },\n ],\n );\n return false;\n }\n if ((new Date(this.state.fromDate)).getTime() > (new Date(this.state.toDate)).getTime()) {\n Alert.alert(\n '',\n 'End date should be greater than start date',\n [\n { text: 'OK', style: 'cancel' },\n ],\n );\n return false;\n }\n /* Get assignment list */\n this.getAssignmentList()\n }", "function filterOrder(orderDetail,inputForm){\r\n let startDate;\r\n let endDate;\r\n inputForm.forEach(element =>{\r\n let selectType = element.getAttribute(\"data-isspecial-type\");\r\n switch (selectType) {\r\n case \"dateTo\":\r\n startDate = new Date(element.value);\r\n break;\r\n case \"dateFrom\":\r\n endDate = new Date(element.value);\r\n break; \r\n }\r\n });\r\n let array = getOrderDate(startDate,endDate,orderDetail)\r\n return array;\r\n}", "function jsonLoaded(obj){\r\n\r\n \r\n //rocekt info\r\n let rockets = obj;\r\n \r\n //array to hold the search results\r\n let results=[];\r\n \r\n \r\n //retrieving the inputed information from the search fields\r\n let launchSucc = document.querySelector(\"#succOrFail\");\r\n \r\n let placeTerm = document.querySelector(\"#natiTerm\").value;\r\n \r\n let custTerm = document.querySelector(\"#custTerm\").value;\r\n \r\n let order = document.querySelector(\"#sortBy\").value;\r\n \r\n //retriving the inforamtion for the dates to look between\r\n let start = document.querySelector(\"#start\");\r\n let end = document.querySelector(\"#end\");\r\n \r\n \r\n //returning rockets with the result that was selected\r\n if(launchSucc.value != \"null\"){\r\n for(let r of rockets){\r\n if(!r.upcoming)\r\n {\r\n\r\n if(launchSucc.value == \"true\"){\r\n if(r.launch_success){\r\n results.push(r);\r\n }\r\n }\r\n else if(launchSucc.value == \"false\"){\r\n if(!r.launch_success){\r\n results.push(r);\r\n }\r\n } \r\n }\r\n } \r\n }\r\n else{\r\n results = rockets.slice();\r\n }\r\n \r\n \r\n //used for debugging and testing purposes\r\n /*console.log(rockets);\r\n console.log(results);*/\r\n \r\n \r\n \r\n //returning the launches from the result array that happened between the specified dates\r\n let date;\r\n for(let r = 0; r < results.length; r++){\r\n date = results[r].launch_date_utc;\r\n date = date.substring(0, 10);\r\n \r\n \r\n //comparing the years\r\n if(date.substring(0,4) > start.value.substring(0,4) && date.substring(0,4) < end.value.substring(0,4)){}\r\n \r\n //if year is equal to min year, comparing the months\r\n else if(date.substring(0,4) == start.value.substring(0,4)){\r\n if(date.substring(5,7) > start.value.substring(5,7)){}\r\n \r\n //if month is equal min month, comparing the days\r\n else if(date.substring(5,7) == start.value.substring(5,7)){\r\n if(date.substring(8,10) >= start.value.substring(8,10)){}\r\n //removing results that do not meet the search criteria\r\n else{\r\n results.splice(r, 1);\r\n r--;\r\n }\r\n }\r\n else{\r\n results.splice(r, 1);\r\n r--; \r\n }\r\n } \r\n \r\n //if year is equal to max year, comparing the months\r\n else if(date.substring(0,4) == end.value.substring(0,4)){\r\n if(date.substring(5,7) < end.value.substring(5,7)){}\r\n \r\n //if month is equal max month, comparing the days\r\n else if( date.substring(5,7) == end.value.substring(5,7)){\r\n if(date.substring(8,10) <= end.value.substring(8,10)){}\r\n //removing results that do not meet the search criteria\r\n else{\r\n results.splice(r, 1);\r\n r--;\r\n }\r\n }\r\n else{\r\n results.splice(r, 1);\r\n r--; \r\n }\r\n }\r\n else{\r\n results.splice(r, 1);\r\n r--;\r\n }\r\n }\r\n \r\n \r\n //returns launches with payloads that came from the specfied country\r\n //console.log(placeTerm);\r\n if(placeTerm != \"\"){\r\n \r\n for(let r = 0; r < results.length; r++){\r\n for(let n of results[r].rocket.second_stage.payloads)\r\n {\r\n \r\n if(n.nationality == placeTerm){break;}\r\n //removing results that do not meet the search criteria\r\n else\r\n {\r\n results.splice(r, 1);\r\n r--;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n \r\n \r\n //returns launches with payloads for the specified customer\r\n if(custTerm != \"\"){\r\n if(custTerm != \"NASA\"){\r\n for(let r = 0; r < results.length; r++){\r\n for(let n of results[r].rocket.second_stage.payloads)\r\n {for(let c of n.customers){\r\n\r\n if(c == custTerm){\r\n break;\r\n }\r\n //removing results that do not meet the search criteria\r\n else\r\n {\r\n results.splice(r, 1);\r\n r--;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n \r\n //special case for if the user searchs NASA it will return all NASA results inculding the ones with (CRS) and other customers\r\n else if(custTerm == \"NASA\"){\r\n for(let r = 0; r < results.length; r++){\r\n for(let n of results[r].rocket.second_stage.payloads)\r\n {for(let c of n.customers){\r\n console.log(c);\r\n console.log(custTerm);\r\n if(c.substring(0,4) == custTerm){\r\n break;\r\n }\r\n //removing results that do not meet the search criteria\r\n else\r\n {\r\n results.splice(r, 1);\r\n r--;\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n \r\n \r\n \r\n //saving the original length of the array\r\nlet length = results.length;\r\nlet small = 1;\r\nlet large = 5;\r\n \r\n \r\n //console.log(results);\r\n function displayResults(){ \r\n //printed if no launches with correct info are found\r\n \r\n //clearing the content section of old results\r\n document.querySelector(\"#content\").innerHTML = \"\";\r\n \r\n \r\n if(results.length < 1){\r\n \r\n let noResult = document.createElement(\"h5\");\r\n let noResultText = \"There are no launches that match these parameters! \" \r\n + \"Please try broadening your search.\";\r\n noResult.append(noResultText); \r\n document.querySelector(\"#content\").appendChild(noResult);\r\n \r\n }\r\n //prints of the information of the rocket launches\r\n else if (results.length >= 5){\r\n let resultAmount = document.createElement(\"h5\");\r\n let resultAmountText = \"Displaying results \" + small + \" - \" + large + \" of \" + length;\r\n resultAmount.append(resultAmountText);\r\n document.querySelector(\"#content\").appendChild(resultAmount);\r\n }\r\n else{\r\n large = results.length;\r\n let resultAmount = document.createElement(\"h5\");\r\n let resultAmountText = \"Displaying results \" + small + \" - \" + large + \" of \" + length;\r\n resultAmount.append(resultAmountText);\r\n document.querySelector(\"#content\").appendChild(resultAmount);\r\n }\r\n \r\n if(results.length >= 5){\r\n for(let i = 0; i < 5; i++)\r\n {\r\n \r\n //changes order the reults are returned\r\n let rock;\r\n \r\n if(order == \"oldest\"){\r\n rock = results.shift();\r\n }\r\n else if(order == \"newest\")\r\n {\r\n rock = results.pop();\r\n }\r\n let links = rock.links;\r\n let nation;\r\n let customer;\r\n for(let n of rock.rocket.second_stage.payloads)\r\n {\r\n if(n.nationality != null){\r\n if(nation != null){\r\n nation += \" and \" + n.nationality.toString();\r\n }\r\n else{\r\n nation = n.nationality.toString();\r\n }\r\n }\r\n for(let c of n.customers){\r\n if(c != null){\r\n if(customer != null)\r\n {\r\n customer += \" and \" + c.toString();\r\n }\r\n else{\r\n customer = c.toString();\r\n }\r\n }\r\n }\r\n }\r\n \r\n let rockName = rock.rocket.rocket_name;\r\n let rockHeader = document.createElement(\"h3\");\r\n rockHeader.append(rockName);\r\n document.querySelector(\"#content\").append(rockHeader);\r\n let text = document.createElement(\"ul\");\r\n text\r\n \r\n //write up for past launches\r\n if(!rock.upcoming){\r\n let launchTime = document.createElement(\"li\");\r\n launchTime.innerHTML = \"The rocket was launched in \" + rock.launch_year + \".\"; \r\n let missionName = document.createElement(\"li\");\r\n missionName.innerHTML = \"The mission name was \" + rock.mission_name + \".\";\r\n let payloadNati = document.createElement(\"li\");\r\n payloadNati.innerHTML =\"The payload was from \" + nation + \".\";\r\n let payloadCust = document.createElement(\"li\");\r\n payloadCust.innerHTML =\"The customer was \"+ customer + \".\";\r\n let launchOutcome = document.createElement(\"li\");\r\n if(rock.launch_success){\r\n launchOutcome.innerHTML = \"The launch was successful.\"\r\n }\r\n else if(!rock.launch_success){\r\n launchOutcome.innerHTML = \"The launch failed.\"\r\n }\r\n \r\n text.appendChild(launchTime);\r\n text.appendChild(missionName);\r\n text.appendChild(payloadNati);\r\n text.appendChild(payloadCust); \r\n text.appendChild(launchOutcome);\r\n if(rock.details != null)\r\n {\r\n let details = document.createElement(\"li\");\r\n details.innerHTML = rock.details;\r\n text.appendChild(details); \r\n }\r\n document.querySelector(\"#content\").appendChild(text);\r\n \r\n }\r\n //write up for upcoming launches\r\n else{\r\n let launchTime = document.createElement(\"li\");\r\n launchTime.innerHTML = \"The rocket will be launched in \" + rock.launch_year + \".\"; \r\n let missionName = document.createElement(\"li\");\r\n missionName.innerHTML = \"The mission name is \" + rock.mission_name + \".\";\r\n let payloadNati = document.createElement(\"li\");\r\n payloadNati.innerHTML =\"The payload will be from \" + nation + \".\";\r\n let payloadCust = document.createElement(\"li\");\r\n payloadCust.innerHTML =\"The customer is \"+ customer + \".\";\r\n text.appendChild(launchTime);\r\n text.appendChild(missionName);\r\n text.appendChild(payloadNati);\r\n text.appendChild(payloadCust); document.querySelector(\"#content\").appendChild(text);\r\n }\r\n \r\n \r\n if(links != null){\r\n let linksHead = document.createElement(\"h4\");\r\n let linksHeadText = \"Links:\"; \r\n linksHead.append(linksHeadText); \r\n document.querySelector(\"#content\").append(linksHead);\r\n //used to return links to websites with more information on the rocket launches\r\n for(let page in links){\r\n //Removing pages that do not have links with them\r\n if(links[page] != null){\r\n //These two links never work properly\r\n if(page != \"youtube_id\" && page != \"flickr_images\")\r\n {\r\n let tempPage = document.createElement(\"p\");\r\n let tempLink = document.createElement(\"a\");\r\n tempLink.innerHTML = page;\r\n tempLink.href = links[page];\r\n tempPage.appendChild(tempLink);\r\n document.querySelector(\"#content\").appendChild(tempPage);\r\n }\r\n }\r\n }\r\n //inserting a break between each result\r\n let resultBreak = document.createElement(\"hr\");\r\n document.querySelector(\"#content\").appendChild(resultBreak);\r\n}\r\n }\r\n }\r\n else if (results.length < 5 && results.length >0){\r\n for(let i = results.length; i > 0; i--)\r\n {\r\n //changes order the reults are returned\r\n let rock;\r\n if(order == \"oldest\"){\r\n rock = results.shift();\r\n }\r\n else if(order == \"newest\")\r\n {\r\n rock = results.pop();\r\n }\r\n let links = rock.links;\r\n let nation;\r\n let customer;\r\n for(let n of rock.rocket.second_stage.payloads)\r\n {\r\n if(n.nationality != null){\r\n if(nation != null){\r\n nation += \" and \" + n.nationality.toString();\r\n }\r\n else{\r\n nation = n.nationality.toString();\r\n }\r\n }\r\n for(let c of n.customers){\r\n if(c != null){\r\n if(customer != null)\r\n {\r\n customer += \" and \" + c.toString();\r\n }\r\n else{\r\n customer = c.toString();\r\n }\r\n }\r\n }\r\n }\r\n \r\n let rockName = rock.rocket.rocket_name;\r\n let rockHeader = document.createElement(\"h3\");\r\n rockHeader.append(rockName);\r\n document.querySelector(\"#content\").append(rockHeader);\r\n let text = document.createElement(\"ul\");\r\n text\r\n \r\n //write up for past launches\r\n if(!rock.upcoming){\r\n let launchTime = document.createElement(\"li\");\r\n launchTime.innerHTML = \"The rocket was launched in \" + rock.launch_year + \".\"; \r\n let missionName = document.createElement(\"li\");\r\n missionName.innerHTML = \"The mission name was \" + rock.mission_name + \".\";\r\n let payloadNati = document.createElement(\"li\");\r\n payloadNati.innerHTML =\"The payload was from \" + nation + \".\";\r\n let payloadCust = document.createElement(\"li\");\r\n payloadCust.innerHTML =\"The customer was \"+ customer + \".\";\r\n let launchOutcome = document.createElement(\"li\");\r\n if(rock.launch_success){\r\n launchOutcome.innerHTML = \"The launch was successful.\"\r\n }\r\n else if(!rock.launch_success){\r\n launchOutcome.innerHTML = \"The launch failed.\"\r\n }\r\n let details = document.createElement(\"li\");\r\n details.innerHTML = rock.details + \".\";\r\n text.appendChild(launchTime);\r\n text.appendChild(missionName);\r\n text.appendChild(payloadNati);\r\n text.appendChild(payloadCust); \r\n text.appendChild(launchOutcome);\r\n text.appendChild(details); document.querySelector(\"#content\").appendChild(text);\r\n \r\n }\r\n //write up for upcoming launches\r\n else{\r\n let launchTime = document.createElement(\"li\");\r\n launchTime.innerHTML = \"The rocket will be launched in \" + rock.launch_year + \".\"; \r\n let missionName = document.createElement(\"li\");\r\n missionName.innerHTML = \"The mission name is \" + rock.mission_name + \".\";\r\n let payloadNati = document.createElement(\"li\");\r\n payloadNati.innerHTML =\"The payload will be from \" + nation + \".\";\r\n let payloadCust = document.createElement(\"li\");\r\n payloadCust.innerHTML =\"The customer is \"+ customer + \".\";\r\n text.appendChild(launchTime);\r\n text.appendChild(missionName);\r\n text.appendChild(payloadNati);\r\n text.appendChild(payloadCust); \r\n document.querySelector(\"#content\").appendChild(text);\r\n }\r\n \r\n \r\n if(links != null){\r\n let linksHead = document.createElement(\"h4\");\r\n let linksHeadText = \"Links:\"; \r\n linksHead.append(linksHeadText); document.querySelector(\"#content\").append(linksHead);\r\n //used to return links to websites with more information on the rocket launches\r\n for(let page in links){\r\n let tempPage = document.createElement(\"p\");\r\n let tempLink = document.createElement(\"a\");\r\n tempLink.innerHTML = page;\r\n tempLink.href = links[page];\r\n tempPage.appendChild(tempLink);\r\n document.querySelector(\"#content\").appendChild(tempPage);\r\n }\r\n \r\n //inserting a break between each result\r\n let resultBreak = document.createElement(\"hr\");\r\n document.querySelector(\"#content\").appendChild(resultBreak);\r\n}\r\n }\r\n }\r\n \r\n $(\"#content\").fadeIn(500);\r\n \r\n \r\n if(results.length > 0){\r\n let next = document.createElement(\"button\");\r\n next.innerHTML= \"NEXT PAGE\";\r\n document.querySelector(\"#content\").appendChild(next);\r\n next.onclick = displayResults;\r\n $('html, body').animate({ scrollTop: 500 }, 'fast');\r\n small+= 5;\r\n if(results.length > 5){\r\n large += 5;\r\n }\r\n else{\r\n large += results.length;\r\n }\r\n }\r\n }\r\n \r\n \r\n\r\n //calling method to run the first time\r\n displayResults();\r\n //making a button if there are still more results to show so that you can go to the next page of results\r\n \r\n}", "function dt_add_rangedate_filter(begindate_id, enddate_id, dateCol) {\n $.fn.dataTableExt.afnFiltering.push(\n function( oSettings, aData, iDataIndex ) {\n\n var beginDate = Date_from_syspref($(\"#\"+begindate_id).val()).getTime();\n var endDate = Date_from_syspref($(\"#\"+enddate_id).val()).getTime();\n\n var data = Date_from_syspref(aData[dateCol]).getTime();\n\n if ( !parseInt(beginDate) && ! parseInt(endDate) ) {\n return true;\n }\n else if ( beginDate <= data && !parseInt(endDate) ) {\n return true;\n }\n else if ( data <= endDate && !parseInt(beginDate) ) {\n return true;\n }\n else if ( beginDate <= data && data <= endDate) {\n return true;\n }\n return false;\n }\n );\n}", "function searchEvent() {\n storyOrEvent = document.getElementById('searchName').value;\n console.log(storyOrEvent);\n dateInfo = document.getElementById('searchDatepicker').value;\n selectedOption = document.getElementById('optionSelect').value;\n if (selectedOption == \"Event\") {\n //Search for events\n retrieveSelectedEvents(storyOrEvent, dateInfo);\n } else{\n retrieveSelectedStories(storyOrEvent, dateInfo); //Search for stories\n }\n}", "function filter_list() { \n region_filter=[\"in\", \"Region\"]\n if ($(region_select).val()){\n for (var i = 0; i < $(region_select).val().length;i++){\n region_filter.push( $(region_select).val()[i])\n }\n }\n version_filter =[\"in\", \"HWISE_Version\"]\n if ($(Version_select).val()){\n for (var j = 0; j < $(Version_select).val().length;j++){\n version_filter.push( Number($(Version_select).val()[j]))\n }\n }\n\n filter_combined = [\"all\"]\n if (year_value.innerText != \"All\") {\n filter_combined.push([\"==\",\"Start\",year_value.innerText])\n }\n\n if (version_filter[2]){\n if (region_filter[2]) {\n filter_combined.push(region_filter)\n filter_combined.push(version_filter)\n }\n else { \n filter_combined.push([\"in\", \"HWISE_Version\",100])\n }\n }\n else {\n filter_combined.push([\"in\", \"HWISE_Version\",100])\n }\n jun.map.setFilter(\"points\", filter_combined)\n if (version_filter[0]){\n if (region_filter[0]) {\n if (year_value.innerText != \"All\"){\n final_filter = '(region_filter.indexOf(Region_search[i]) >= 0) '+\n '&& (version_filter.indexOf(Hwise_search[i]) >= 0)'+ \n '&& (Start_search[i] == year_value.innerText) '\n }\n else {\n final_filter = '(region_filter.indexOf(Region_search[i]) >= 0) '+\n '&& (version_filter.indexOf(Hwise_search[i]) >= 0)'\n }\n }\n else {\n final_filter = '(Hwise_search[i]) == 100)'\n }\n }\n else {\n final_filter = '(Hwise_search[i]) == 100)'\n }\n return [region_filter.slice(2), version_filter.slice(2), final_filter]\n}", "function filterData (data, startdate, enddate)\r\n {\r\n\r\n _.forEach(data, function(value)\r\n {\r\n var filtered = filtering(value.database, startdate, enddate);\r\n _.forEach(filtered, function(value)\r\n {\r\n storeData.push({\r\n \"date\": parseDate.parse(value.date),\r\n \"literacy_rate\": value.val\r\n });\r\n });\r\n filterData(value.place,startdate,enddate);\r\n });\r\n }", "filteredTravels() {\n return this.travels.filter(\n (travel) => {\n let filterContinentResult = true\n let filterDatesResult = true\n\n // Filter continent\n if (this.filterContinent !== \"\") {\n filterContinentResult = travel.continent === this.filterContinent\n }\n\n // Filter dates \n if (this.filterStartDate !== \"\" && this.filterEndDate !== \"\") {\n filterDatesResult =\n travel.startDate >= new Date(this.filterStartDate) &&\n travel.startDate <= new Date(this.filterEndDate)\n }\n\n // return the conjunction of the two filters\n return filterContinentResult && filterDatesResult\n\n }\n )\n }", "function handleSearchButtonClick() {\n \n filteredData = dataSet;\n // Format the user's search by removing leading and trailing whitespace, lowercase the string\n var filterDatetime = $dateInput.value.trim().toLowerCase();\n var filterCity = $cityInput.value.trim().toLowerCase();\n var filterState = $stateInput.value.trim().toLowerCase();\n var filterCountry = $countryInput.value.trim().toLowerCase();\n var filterShape = $shapeInput.value.trim().toLowerCase();\n\n // Set filteredAddresses to an array of all addresses whose \"state\" matches the filter\n filteredData = dataSet.filter(function(address) {\n var addressDatetime = address.datetime.toLowerCase();\n var addressCity = address.city.toLowerCase();\n var addressState = address.state.toLowerCase();\n var addressCountry = address.country.toLowerCase();\n var addressShape = address.shape.toLowerCase();\n\n\n\n if ((addressDatetime===filterDatetime || filterDatetime == \"\") && \n (addressCity === filterCity || filterCity == \"\") && \n (addressState === filterState || filterState == \"\") &&\n (addressCountry === filterCountry || filterCountry == \"\") && \n (addressShape === filterShape || filterShape ==\"\")){\n \n return true;\n }\n return false;\n console.log(filteredData);\n });\nloadList();\n}", "function getDates (){\n\t\t\t\t\tvar dates = [];\n\t\t\t\t\tscope.data.coauthors.forEach(function(author){\n\t\t\t\t\t\tauthor.dates.forEach(function(date){\n\t\t\t\t\t\t\tif(dates.length === 0){\n\t\t\t\t\t\t\t\tdates.push({ label: date, \n\t\t\t\t\t\t\t\t\tvalue: date, \n\t\t\t\t\t\t\t\t\tfilterLabel: 'Date CoAuthored: ',\n\t\t\t\t\t\t\t\t\tfilterType: 'date'\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tfor(var i =0; i < dates.length; i++){\n\t\t\t\t\t\t\t\t\tif(dates[i].value === date) {\n\t\t\t\t\t\t\t\t\t\treturn;\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\tdates.push({ label: date, value: date, filterLabel: 'Date CoAuthored: ', filterType: 'date'});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\n\t\t\t\t\treturn dates;\n\t\t\t\t}", "function loadOpportunitiesByDate(fromDate, toDate) {\r\n return ServeOpportunities.ServeDays.query({\r\n id: Session.exists('userId'),\r\n from: fromDate / 1000,\r\n to: toDate / 1000\r\n }).$promise;\r\n }", "function filteredDate(dateValue,cityValue,stateValue,countryValue,shapeValue) {\n var tableDataFiltered = tableData.filter(d => d.datetime === dateValue \n || d.city === cityValue\n || d.state === stateValue\n || d.country === countryValue\n || d.shape === shapeValue)\n return tableDataFiltered;\n}", "function find() {\n\tvar selectedOption = document.getElementById('dateRanges').value \n\tfor (i=0;i<zodiacObjArray.length;i++) {\n\t\tif (zodiacObjArray[i].dates == selectedOption) {\n\t\t\tdocument.getElementById('zdcSign').innerHTML = zodiacObjArray[i].sign.toUpperCase()\n\t\t\tdocument.getElementById('zdcReading').innerHTML = zodiacObjArray[i].horoscope\n\t\t\tdocument.getElementById('picture').src = zodiacObjArray[i].icon\n\t\t\tdocument.getElementById('type').src = zodiacObjArray[i].typePic\n\n\t\t}\n\t}\n}", "function init_dates(){\n domo.get('/data/v1/dataset?fields=date&groupby=date&orderby=date descending&limit=8').then(function(data){\n start_date = data[data.length-1].date;\n end_date = data[0].date;\n\n $(function() {\n $(\"#datepicker\").daterangepicker({\n datepickerOptions : {\n numberOfMonths : 2\n }\n });\n });\n $(\"#datepicker\").daterangepicker({\n initialText : moment(start_date, \"YYYY-MM-DD\").format(\"MMM DD, YYYY\") + \" - \" + moment(end_date, \"YYYY-MM-DD\").format(\"MMM DD, YYYY\")\n });\n\n // show filters\n $(\".filterpanel\").show();\n\n // Init main routine\n // update_data();\n\n });\n}", "function withinDate(d, m, y) {\n\n startDateArray = $('#startDate').val().split(\" \");\n endDateArray = $('#endDate').val().split(\" \");\n\n var startDay = parseInt(startDateArray[0]);\n var startMonth2 = monthNames.indexOf(startDateArray[1]) + 1;\n if (startMonth2 < 10){\n startMonth2 = \"0\" + startMonth2;\n }\n var startMonth = parseInt(startMonth2);\n var startYear = parseInt(startDateArray[2]);\n\n var endDay = parseInt(endDateArray[0]);\n var endMonth2 = monthNames.indexOf(endDateArray[1]) + 1;\n if (endMonth2 < 10){\n endMonth2 = \"0\" + endMonth2;\n }\n var endMonth = parseInt(endMonth2);\n var endYear = parseInt(endDateArray[2]);\n\n var d1 = [startMonth, startDay, startYear];\n var d2 = [endMonth, endDay, endYear];\n var c = [m, d, y];\n\n var from = new Date(d1); // -1 because months are from 0 to 11\n var to = new Date(d2);\n var check = new Date(c);\n\n return(check >= from && check <= to);\n }", "findRangeofDates(){ \n\t\tlet min=new Date(2030,1,1); \n\t\tlet max=new Date(1990,1,1);\n\t\tconst ar=this.props.data;\n\t\tfor(let i=0;i<ar.length;i++){\n\t\t\tif(ar[i].start<min)\n\t\t\t\tmin=ar[i].start;\n\t\t\tif(ar[i].end>max)\n\t\t\t\tmax=ar[i].end;\n\t\t}\n\t\tthis.min=min;\n\t\tthis.max=max;\n\t}", "function validateSelectedDates(dataSource, startDate, endDate){\n\t\t for(var i in dataSource) {\t\n \t \tif((dataSource[i].startDate.getTime() >= startDate.getTime() && dataSource[i].startDate.getTime() <= endDate.getTime())\t||\n \t \t (dataSource[i].endDate.getTime() <= endDate.getTime() && dataSource[i].endDate.getTime() >= startDate.getTime()) ||\n \t \t (startDate.getTime() >= dataSource[i].startDate.getTime() && startDate.getTime() <= dataSource[i].endDate.getTime())){\n \t \t\treturn false;\n \t \t}\n }\n\t\t return true;\n\t}", "function SearchKPIByDate(date) {\n var returnArr = new Array();\n var locStorage = new Storage();\n\n\n var counter = 0;\n for(var i=0, l=locStorage.size(); i<l; i++) {\n var value = locStorage.get(i); \n if (FormatDate(value.KPI_Date).getMonth() == date.getMonth()) {\n if (FormatDate(value.KPI_Date).getFullYear() == date.getFullYear()) {\n var dataPoint = new Array(2);\n dataPoint[0] = value.KPI_Name;\n dataPoint[1] = value.KPI_Value;\n returnArr.push(dataPoint);\n }\n }\n }\n return returnArr;\n}", "function handleSearchButtonClick() {\n var filterDate = $dateInput.value;\n\n // Filter on date\n if (filterDate != \"\") {\n tableData = data.filter(function(address) {\n var addressDate = address.datetime;\n return addressDate === filterDate;\n });\n } else { tableData };\n\n renderTable();\n}", "function valSearchGirviByDateInputs(obj) {\r\n if (validateSelectField(document.search_girvi_panel.dayDD.value, \"Please select Day in Date!\") == false) {\r\n document.search_girvi_panel.dayDD.focus();\r\n return false;\r\n } else if (validateSelectField(document.search_girvi_panel.monthMonth.value, \"Please select Month in Date!\") == false) {\r\n document.search_girvi_panel.monthMonth.focus();\r\n return false;\r\n } else if (validateSelectField(document.search_girvi_panel.yearYYYY.value, \"Please select Year in Date!\") == false) {\r\n document.search_girvi_panel.yearYYYY.focus();\r\n return false;\r\n }\r\n return true;\r\n}", "function searchEvents(searchFilter, searchCriteria) {\n $('#events-panel').show();\n $('#attraction-panel').hide();\n \n //Getting the date\n let date = new Date();\n let dd = date.getDate();\n let mm = date.getMonth() + 1;\n let yyyy = date.getFullYear();\n \n if (dd < 10) {\n dd = '0' + dd;\n }\n if (mm < 10) {\n mm = '0' + mm;\n }\n // 2017-12-06T16:37:00Z\n let today = yyyy + '-' + mm + '-' + dd + 'T00:00:00Z';\n console.log(today);\n \n if (page < 0) {\n page = 0;\n return;\n }\n if (page > 0) {\n if (page > getEvents.json.page.totalPages - 1) {\n page = 0;\n return;\n }\n }\n //Displaying the new results after the search \n $.ajax({\n type:\"GET\",\n url:\"https://app.ticketmaster.com/discovery/v2/events.json?\" + searchFilter + \"=\" + searchCriteria + \"&startDateTime=\" + today + \"&apikey=5QGCEXAsJowiCI4n1uAwMlCGAcSNAEmG&size=4&page=\"+page,\n async:true,\n dataType: \"json\",\n success: function(json) {\n getEvents.json = json;\n showEvents(json);\n },\n error: function(xhr, status, err) {\n console.log(err);\n }\n });\n}", "function Query_If_RangeHasChanged(){\n\n var sFrom = document.getElementById(\"txt_dtmFrom\").value;\n var sTo = document.getElementById(\"txt_dtmTo\").value;\n\n if(sFrom != sParamDateFrom || sTo != sParamDateTo)\n ExecuteNewSearch();\n}", "function filterData(startDate, endDate, provincesFilter) {\r\n var sDate = stringToDate(startDate);\r\n var eDate = stringToDate(endDate);\r\n\r\n var filteredData = [];\r\n data.forEach(dailyData => {\r\n let filteredDailyData = dailyData.values.filter(\r\n row => provincesFilter[row.name]\r\n );\r\n\r\n var date = stringToDate(dailyData.key);\r\n\r\n if (filteredDailyData.length > 0 && date >= sDate && date <= eDate) {\r\n filteredData.push({ key: dailyData.key, values: filteredDailyData });\r\n }\r\n });\r\n\r\n return filteredData;\r\n}", "function dateWithinRange(date) {\n \n var currentDate = new Date(date);\n \n var minDate = new Date(startDate);\n var maxDate = new Date(endDate);\n\n if (currentDate > minDate && currentDate < maxDate ){ // checks if dates are within range\n return true;\n }\n\n if(isNaN(minDate.valueOf() || maxDate.valueOf )){ //if no contraints are entered, return all dates\n return true;\n }\n else{\n return false;\n } \n }", "function getCurrentProject(activityDates) {\n var dt = {};\n var mainDt = [];\n if (typeof activityDates !== 'undefined') {\n if (typeof activityDates.length != 'undefined') {\n activityDates.forEach(function (ad) {\n if (typeof dt[\"startDate\"] == 'undefined' && (ad.type === 'start-actual' || ad.type == 2)) {\n dt[\"startDate\"] = ad['iso-date'];\n }\n else if (typeof dt[\"startDate\"] == 'undefined' && (ad.type === 'start-planned' || ad.type == 1)) {\n dt[\"startDate\"] = ad['iso-date'];\n }\n else if (typeof dt[\"endDate\"] == 'undefined' && (ad.type === 'end-actual' || ad.type == 4)) {\n dt[\"endDate\"] = ad['iso-date'];\n }\n else if (typeof dt[\"endDate\"] == 'undefined' && (ad.type === 'end-planned' || ad.type == 3)) {\n dt[\"endDate\"] = ad['iso-date'];\n }\n });\n } else {\n if (typeof dt[\"startDate\"] == 'undefined' && (activityDates.type === 'start-actual' || activityDates.type == 2)) {\n dt[\"startDate\"] = activityDates['iso-date'];\n }\n else if (typeof dt[\"startDate\"] == 'undefined' && (activityDates.type === 'start-planned' || activityDates.type == 1)) {\n dt[\"startDate\"] = activityDates['iso-date'];\n }\n else if (typeof dt[\"endDate\"] == 'undefined' && (activityDates.type === 'end-actual' || activityDates.type == 4)) {\n dt[\"endDate\"] = activityDates['iso-date'];\n }\n else if (typeof dt[\"endDate\"] == 'undefined' && (activityDates.type === 'end-planned' || activityDates.type == 3)) {\n dt[\"endDate\"] = activityDates['iso-date'];\n }\n }\n if (typeof dt[\"startDate\"] != 'undefined' && typeof dt[\"endDate\"] != 'undefined') {\n dt[\"startDate\"] = (dt[\"startDate\"] != 0) ? dt[\"startDate\"].split(\"-\") : dt[\"startDate\"];\n dt[\"endDate\"] = (dt[\"endDate\"] != 0) ? dt[\"endDate\"].split(\"-\") : dt[\"endDate\"];\n mainDt.push(dt.startDate[0]);\n mainDt.push(dt.endDate[0]);\n }\n }\n return mainDt;\n}", "function filter_list_ver2(id_marker, option) { \n region_filter=[\"in\", \"Region\"]\n if ($(region_select).val()){\n for (var i = 0; i < $(region_select).val().length;i++){\n region_filter.push( $(region_select).val()[i])\n }\n }\n version_filter =[\"in\", \"HWISE_Version\"]\n if ($(Version_select).val()){\n for (var j = 0; j < $(Version_select).val().length;j++){\n version_filter.push( Number($(Version_select).val()[j]))\n }\n }\n if (version_filter[2]){\n if (region_filter[2]){\n if (year_value.innerText != \"All\"){\n if ((region_filter.indexOf(Region_search[id_marker]) >= 0) \n && (version_filter.indexOf(Hwise_search[id_marker]) >= 0)\n && (Start_search[id_marker] == year_value.innerText) \n ){\n jun.map.flyTo({center : [Lng_search[id_marker],Lat_search[id_marker]], zoom:5})\n openDesc(id_marker,option)\n final_filter = '(Id_search[i] == id_number) '+\n '&& (region_filter2.indexOf(Region_search[i]) >= 0) '+\n '&& (version_filter2.indexOf(Hwise_search[i]) >= 0)'+ \n '&& (Start_search[i] == year_value.innerText) '\n filter_combined = [\"all\", [\"==\", \"id_number\", Number(id_marker)],[\"==\",\"Start\",year_value.innerText]]\n }\n else {\n final_filter = '(region_filter2.indexOf(Region_search[i]) >= 0) '+\n '&& (version_filter2.indexOf(Hwise_search[i]) >= 0)'+ \n '&& (Start_search[i] == year_value.innerText) '\n filter_combined = [\"all\", [\"==\",\"Start\",year_value.innerText]]\n }\n }\n else {\n if ((region_filter.indexOf(Region_search[id_marker]) >= 0) \n && (version_filter.indexOf(Hwise_search[id_marker]) >= 0)\n\n ){\n jun.map.flyTo({center : [Lng_search[id_marker],Lat_search[id_marker]], zoom:5})\n openDesc(id_marker,option)\n\n final_filter = '(Id_search[i] == id_number) '+\n '&& (region_filter2.indexOf(Region_search[i]) >= 0) '+\n '&& (version_filter2.indexOf(Hwise_search[i]) >= 0)' \n filter_combined = [\"all\",[\"==\",\"id_number\",Number(id_marker)]]\n }\n else {\n final_filter = '(region_filter2.indexOf(Region_search[i]) >= 0) '+\n '&& (version_filter2.indexOf(Hwise_search[i]) >= 0)'\n filter_combined = [\"all\"]\n }\n }\n }\n else {\n final_filter = '(Hwise_search[i]) == 100)'\n }\n }\n else {\n final_filter = '(Hwise_search[i]) == 100)'\n }\n if (version_filter[2]){\n if (region_filter[2]) {\n filter_combined.push(region_filter)\n filter_combined.push(version_filter)\n }\n else { \n filter_combined.push([\"in\", \"HWISE_Version\",100])\n }\n }\n else {\n filter_combined.push([\"in\", \"HWISE_Version\",100])\n }\n jun.map.setFilter(\"points\", filter_combined)\n\n return [region_filter.slice(2), version_filter.slice(2), final_filter]\n}", "customDateFilter(date,view){\n\t\treturn true;\n\t}", "function searchButtonClick() {\r\n var filterDate = $dateTimeInput.value.trim();\r\n var filterCity = $cityInput.value.trim().toLowerCase();\r\n var filterState = $stateInput.value.trim().toLowerCase();\r\n var filterCountry = $countryInput.value.trim().toLowerCase();\r\n var filterShape = $shapeInput.value.trim().toLowerCase();\r\n\r\n if (filterDate != \"\") {\r\n filteredData = filteredData.filter(function (date) {\r\n var dataDate = date.datetime;\r\n return dataDate === filterDate;\r\n });\r\n\r\n }\r\n\r\n if (filterCity != \"\") {\r\n filteredData = filteredData.filter(function (city) {\r\n var dataCity = city.city;\r\n return dataCity === filterCity;\r\n });\r\n }\r\n\r\n if (filterState != \"\") {\r\n filteredData = filteredData.filter(function (state) {\r\n var dataState = state.state;\r\n return dataState === filterState;\r\n });\r\n }\r\n\r\n if (filterCountry != \"\") {\r\n filteredData = filteredData.filter(function (country) {\r\n var dataCountry = country.country;\r\n return dataCountry === filterCountry;\r\n });\r\n }\r\n\r\n if (filterShape != \"\") {\r\n filteredData = filteredData.filter(function (shape) {\r\n var dataShape = shape.shape;\r\n return dataShape === filterShape;\r\n });\r\n }\r\n\r\n renderTable();\r\n}", "function dateHandler() {\n\n d3.event.preventDefault();\n\n console.log(dateInput.property(\"value\"));\n\n // Create table showing filtered data\n var filterTable = tableData.filter(alienSighting => alienSighting.datetime === dateInput.property(\"value\"));\n\n // Display the filtered table\n alienData(filterTable);\n}", "function filter_projects_by_date(projects) {\n 'use strict';\n\n var i = 0,\n s = projects.length,\n the_date;\n\n //reset projects array\n presidents.all.projects = [];\n for (i; i < s; i = i + 1) {\n the_date = new Date(projects[i][fields[graph.active_date]]);\n if (the_date) {\n the_date = the_date.getTime();\n //is the project's date within the boundaries?\n if (\n (the_date >= new Date(graph.min.date).getTime())\n && (the_date <= new Date(graph.max.date).getTime())\n ) {\n //console.log('assigning obama');\n presidents.all.projects.push(projects[i]);\n }\n }//start_date\n }//for\n\n //update the agencies\n presidents.all.agencies = [];\n //presidents.all.agencies = filter_all('agency_name', presidents.all.projects);\n presidents.all.agencies = d3.nest()\n .key(function (d) { return d[fields.agency_name]; })\n .sortKeys(d3.ascending)\n .entries(presidents.all.projects);\n\n console.log('# projects: ' + presidents.all.projects.length);\n\n}//filter_projects_by_date", "function provinceData(prov){\n\n // Filter data by province name\n go.provData= go.json.filter(e => e.prname == prov);\n\n // sort filtered data by date and store in data array\n data = go.provData.sort((a,b)=>{\n let date1 = new Date(a.date);\n let date2 = new Date(b.date)\n return date1 - date2;\n });\n\n // get and store values for the charts from filtered data array\n dates = data.map(d => d.date);\n values = data.map(v => v.numtoday);\n totalCases = data.map(t => t.numtotal);\n\n index = data.length-1;\n\n // log(data);\n // log(\"Dates Array: \" + dates);\n // log(\"Values Array: \" + values);\n // log(\"Total Cases Array: \" + totalCases)\n \n // update stats placeholders with most recent info\n $(\"#date\").text(data[data.length-1].date);\n $(\"#dailyStat\").html(data[data.length-1].numtoday.toLocaleString('en-US'));\n $(\"#totalStat\").html(data[data.length-1].numtotal.toLocaleString('en-US'));\n}", "function filterDate() {\n // Prevent refresh\n d3.event.preventDefault();\n\n // Get date from input\n var inputElement = d3.select(\".form-control\");\n var inputValue = inputElement.property(\"value\");\n // Get selected city, state, country, shape\n // empty value if default \"- choose\"\n var selectedCity = citySelect.property(\"value\");\n if (selectedCity === \"- choose\") {\n selectedCity = \"\";\n }\n var selectedState = stateSelect.property(\"value\");\n if (selectedState === \"- choose\") {\n selectedState = \"\";\n }\n var selectedCountry = countrySelect.property(\"value\");\n if (selectedCountry === \"- choose\") {\n selectedCountry = \"\";\n }\n var selectedShape = shapeSelect.property(\"value\");\n if (selectedShape === \"- choose\") {\n selectedShape = \"\";\n }\n\n //console\n console.log(`Date: ${inputValue}`);\n console.log(`City: ${selectedCity}`);\n\n filteredData = tableData.filter((sighting) => {\n return (\n (!inputValue || sighting.datetime === inputValue) &&\n (!selectedCity || sighting.city === selectedCity) &&\n (!selectedState || sighting.state === selectedState) &&\n (!selectedCountry || sighting.country === selectedCountry) &&\n (!selectedShape || sighting.shape === selectedShape)\n );\n });\n\n console.log(selectedCity);\n console.log(selectedState);\n console.log(selectedCountry);\n console.log(inputValue);\n\n // Call function to populate table\n populateTable(filteredData);\n}", "function filterByDate(sighting) {\n return sighting.datetime === inputDate;\n }", "function searchMYStory() {\n storyOrEvent = document.getElementById('searchName').value;\n dateInfo = document.getElementById('searchDatepicker').value;\n retrieveSelectedMYStories(storyOrEvent, dateInfo);\n}", "function onChangeDatepicker(){\n vm.dateString = getFormattedDateString(vm.datepickerStartDate,\n vm.datepickerEndDate);\n performDateSearch();\n }", "function search() {\n __globspace._gly_searchadvanced.removeAll();\n _gly_ubigeo.removeAll();\n let sql = '1=1', \n idtable='#tbl_searchadvanced', \n isexportable=true, \n nquery=__query.length;\n\n // formación del sql \n for (let i = 0; i < nquery; i++){\n let item = __query[i],\n filter = item.filter.toUpperCase(),\n typedata=item.typedata,\n auxsql='';\n\n switch (typedata) {\n case 'double': case 'small-integer': case 'integer': case 'single':\n auxsql = ` ${item.fieldname} ${item.condition} \"${filter}\"`;\n break;\n case 'date':\n console.log(filter);\n let fi = moment(filter).add(5, 'hours').format('YYYY-MM-DD HH:mm:ss'); //consulta al servicio en hora utc (+5);\n let ff = moment(filter).add(29, 'hours').subtract(1, 'seconds').format('YYYY-MM-DD HH:mm:ss');\n \n if(item.condition == '=' || item.condition == 'contiene'){\n auxsql = `(${ item.fieldname } BETWEEN timestamp '${ fi }' AND timestamp '${ ff }')`;\n }else{\n if(item.condition == '<='){\n auxsql = ` ${item.fieldname} ${item.condition} timestamp '${ff}'`; \n }else if(item.condition == '>='){\n fi = moment(filter).add(5, 'hours').subtract(1, 'seconds').format('YYYY-MM-DD HH:mm:ss');\n auxsql = ` ${item.fieldname} ${item.condition} timestamp '${fi}'`;\n }else if(item.condition == '>'){\n auxsql = ` ${item.fieldname} ${item.condition} timestamp '${ff}'`;\n }else if(item.condition == '<'){\n auxsql = ` ${item.fieldname} ${item.condition} timestamp '${fi}'`;\n }\n }\n break;\n default:\n auxsql = `Upper(${item.fieldname}) ${item.condition} '${filter}'`;\n break;\n }\n\n if (item.option == '--') {\n if(typedata == 'date'){\n sql = auxsql;\n }else{\n item.condition == 'contiene' ? sql += ` and Upper(${item.fieldname}) like '%${filter}%'` : sql = auxsql;\n }\n } else {\n if(typedata == 'date'){\n sql += ` ${item.option} ${auxsql}`;\n }else{\n item .condition == 'contiene' ? sql += ` ${item.option} Upper(${item.fieldname}) like '%${filter}%'` : sql += ` ${item.option} ${auxsql}`;\n }\n }\n }\n \n __globspace.currentview.graphics.remove(_gra_ubigeo);\n\n // si se a selecionado un item de ubigeo primero obtengo la geometria del ubigeo y luego la consulta propia\n if(__url_ubigeo!=''){\n let _queryt = new QueryTask({url:__url_ubigeo}),\n _qparams = new Query(); \n _qparams.returnGeometry = true;\n _qparams.where = __sql_ubigeo;\n\n _queryt.execute(_qparams).then(function(response){\n \n __ubigeogeometry=response.features[0].geometry;\n\n let _queryt2 = new QueryTask({url:__url_query}),\n _qparams2 = new Query(); \n\n _qparams2.where = sql;\n _qparams2.outFields = [\"*\"];\n _qparams2.geometry = __ubigeogeometry;\n _qparams2.spatialRelationship = \"intersects\";\n _qparams2.returnGeometry = true;\n\n _queryt2.execute(_qparams2).then(function(response){\n let nreg = response.features.length;\n let fields = response.fields;\n if(nreg==0){\n alertMessage(\"La consulta no tiene registros a mostrar\", \"warning\",'', true)\n Helper.hidePreloader();\n }else{\n if(nreg>=1000){\n alertMessage('El resultado supera el límite, por ello solo se muestra los primeros 1000 registros. \\n Para mejorar su consulta, ingrese más filtros.','warning', 'bottom-right');\n }\n Helper.loadTable(response, fields, __titlelayer, idtable, isexportable);\n // Helper.renderToZoom(response, __globspace._gly_searchadvanced);\n Helper.renderGraphic(response, __globspace._gly_searchadvanced);\n\n\n if(Object.keys(_gra_ubigeo).length ==0){\n _gra_ubigeo = new Graphic({\n geometry: __ubigeogeometry, \n symbol:_symbol,\n });\n }\n _gra_ubigeo.geometry=__ubigeogeometry;\n __globspace.currentview.graphics.add(_gra_ubigeo);\n __globspace.currentview.when(function () {\n __globspace.currentview.goTo({\n target: __ubigeogeometry\n });\n });\n }\n }).catch(function (error) {\n Helper.hidePreloader();\n console.log(\"query task error\", error);\n })\n }).catch(function (error) {\n Helper.hidePreloader();\n console.log(\"query task error\", error);\n })\n }else{\n let _queryt = new QueryTask({url:__url_query}),\n _qparams = new Query();\n\n _qparams.where = sql;\n _qparams.outFields = [\"*\"];\n _qparams.returnGeometry = true;\n\n _queryt.execute(_qparams).then(function(response){\n let nreg = response.features.length;\n let fields = response.fields;\n if(nreg==0){\n alertMessage(\"La consulta no tiene registros a mostrar\", \"warning\", '', true);\n Helper.hidePreloader();\n }else{\n if(nreg>=1000){\n alertMessage('El resultado supera el límite, por ello solo se muestra los primeros 1000 registros. \\n Para mejorar su consulta, ingrese más filtros.','warning', 'bottom-right');\n }\n Helper.loadTable(response, fields, __titlelayer, idtable, isexportable);\n Helper.renderToZoom(response, __globspace._gly_searchadvanced);\n }\n }).catch(function (error) {\n Helper.hidePreloader();\n console.log(\"query task error\");\n console.log(error);\n })\n }\n }", "function EzdateCond(EfIde, EnIde, errmsg) {\n $(EfIde).on('dp.change', function (e) {\n \n if (e.oldDate !== null) {\n var ab = 1;\n if (new Date(Ezsetdtpkdate($(EfIde).val())) >= new Date(Ezsetdtpkdate($(EnIde).val()))) {\n ab = 0;\n }\n if (ab == 1) { \n $(EfIde).focus();\n $(EfIde).select();\n $(EfIde).val(EzdteTblPkEdit(new Date()));\n EzAlerterrtxt(errmsg);\n }\n }\n });\n}", "checkDayEvents(date) {\n var dayEvents = this.events.find(ev => {\n return new Date(ev.date).toDateString() === date.toDateString();\n });\n this.settings.onDateSelect(this, date, dayEvents);\n }", "function handleSearchButtonClick() { \n var filterdt = datetimeInput.value.trim();\n \n filterData = dataSet.filter(function(ovni)\n {\n var dt = ovni.datetime;\n return dt === filterdt;\n });\n \nrenderTable();\n}", "function searchSurveysByMissionGroup(searchText) {\n\n var searchValue = searchText.toUpperCase();\n dataLayer.clear();\n map.infoWindow.hide();\n\n csvStore.fetch({\n onComplete: function(items, request) {\n dojo.forEach(items, function(item, index) {\n var foundIt = false;\n var year = csvStore.getValue(item, \"Year\");\n var cruise = csvStore.getValue(item, \"Cruise\");\n var latitude = csvStore.getValue(item, \"Latitude\");\n var longitude = csvStore.getValue(item, \"Longitude\");\n var missionGroupString = csvStore.getValue(item, \"Mission Group\");\n var id = csvStore.getIdentity(item);\n if (latitude != undefined && longitude != undefined) {\n if (missionGroupString != undefined) {\n var missionGroupText = missionGroupString.toUpperCase();\n if (missionGroupText.indexOf(searchValue) != -1) {\n foundIt = true;\n }\n }\n if (foundIt) {\n createMarker(id, year, cruise, latitude, longitude);\n }\n }\n });\n initializeCruiseListing();\n dojo.connect(dataLayer, \"onClick\", onFeatureClick);\n var cruiseTotals = dijit.byId(\"yearCounter\");\n cruiseTotals.attr(\"value\", dataLayer.graphics.length + \" Cruises Displayed\");\n },\n onError: function(error) {\n dojo.byId(\"itemsList\").innerHTML = \"Unable to search the data.\";\n }\n });\n\n map.setExtent(startExtent);\n }", "function handleSearchButtonClick() {\n var filterDate = $dateTimeInput.value.trim();\n var filterCity = $cityInput.value.trim().toLowerCase();\n var filterState = $stateInput.value.trim().toLowerCase();\n var filterCountry = $countryInput.value.trim().toLowerCase();\n var filterShape = $shapeInput.value.trim().toLowerCase();\n\n if (filterDate != \"\") {\n filteredData = filteredData.filter(function (date) {\n var dataDate = date.datetime;\n return dataDate === filterDate;\n });\n\n }\n\n if (filterCity != \"\") {\n filteredData = filteredData.filter(function (city) {\n var dataCity = city.city;\n return dataCity === filterCity;\n });\n }\n\n if (filterState != \"\") {\n filteredData = filteredData.filter(function (state) {\n var dataState = state.state;\n return dataState === filterState;\n });\n }\n\n if (filterCountry != \"\") {\n filteredData = filteredData.filter(function (country) {\n var dataCountry = country.country;\n return dataCountry === filterCountry;\n });\n }\n\n if (filterShape != \"\") {\n filteredData = filteredData.filter(function (shape) {\n var dataShape = shape.shape;\n return dataShape === filterShape;\n });\n }\n\n renderTable();\n}", "function getFilteredReservationByDate(roomUsages, date, dateEnd){\n\tvar dateFilteredReservations = [];\n\tif(date == null && dateEnd == null){\n\t\tlog(reservations);\n\t\treturn reservations;\n\t} else if (date != null && dateEnd == null) {\n\t\t$.when($.each(roomUsages , function(index, reservation){\n\t\t\tif(reservation.reservedDate == date){\n\t\t\t\tdateFilteredReservations.push(reservation);\n\t\t\t}\n\t\t})).then(function(noResult){\n\t\t\tlog(dateFilteredReservations);\n\t\t\treturn dateFilteredReservations;\n\t\t});\n\t} else if (date != null && dateEnd != null) {\n\t\t$.when($.each(roomUsages , function(index, reservation){\n\t\t\tif(date <= reservation.reservedDate && reservation.reservedDate <= dateEnd){\n\t\t\t\tdateFilteredReservations.push(reservation);\n\t\t\t}\n\t\t})).then(function(noResult){\n\t\t\tlog(dateFilteredReservations);\n\t\t\treturn dateFilteredReservations;\n\t\t});\n\t} else {\n\t\talert(\"No Result Cursed by Missing of Argument\");\n\t}\n}", "function filterBy(SliderValue){\n var slider = document.getElementById(\"slider-start\").value; //get range slider valure from HTML\n var datephotos //Initalise date var\n var dateroutesto //Initalise dateroutes var\n var dateroutesfrom //Initalise dateroutes var\n var currentday //Initatlise current day var, containing the naming of every day\n\n //arrays of relevant valies compared to slider value. eg slider position 4 of datephotos = 2018-04-09 and position 4 of currentday = Maandag \n datephotos = [\"\", \"2018-04-06\", \"2018-04-07\", \"2018-04-08\", \"2018-04-09\", \"2018-04-10\", \"2018-04-11\", \"2018-04-12\", \"2018-04-13\", \"2018-04-14\", \"2018-04-15\", \"\" ];\n dateroutesfrom = [\"\", \"20180406\", \"20180407\", \"20180408\", \"20180409\", \"20180410\", \"20180411\", \"20180412\", \"20180413\", \"20180414\", \"20180415\", \"\" ];\n dateroutesto = [\"\", \"20180407\", \"20180408\", \"20180409\", \"20180410\", \"20180411\", \"20180412\", \"20180413\", \"20180414\", \"20180415\", \"20180416\", \"\" ];\n currentday = [\"Hele reis\", \"Aankomst Dag\", \"Zaterdag\", \"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\", \"Laaste dag\", \"Hele reis\"];\n FistPhoto = [\"\", \"\", \"250\", \"500\", \"750\", \"1000\", \"1150\", \"1400\", \"1500\", \"1800\", \"1950\", \"\"];\n\n //exectution of filter by date\n if (slider > 0 && slider < 11) { \n //Slider is used to filter map elleemnts \n map.setFilter('photos', [\"==\", \"CreateDate\", datephotos[slider]]);\n map.setFilter('routes', [\"<=\", \"startTime\", dateroutesto[slider]]);\n map.setFilter('routes-shadow', [\"<=\", \"startTime\", dateroutesto[slider]]);\n map.setFilter('routes-today', [\"all\", [\"<=\", \"startTime\", dateroutesto[slider]], [\">=\", \"startTime\", dateroutesfrom[slider]]]);\n } else { \n //Else slider is off\n map.setFilter('photos', null);\n map.setFilter('routes', null);\n map.setFilter('routes-shadow', null);\n map.setFilter('routes-today', [\"<=\", \"startTime\", 1]);\n }\n \n document.getElementById(\"daylable\").textContent = currentday[slider]; //set Day Lable to correct day \n //console.log(\"Filtering: \" + currentday[slider]); //Filtering confimration in console\n\n map.flyTo({\n center: [-4.337799, 56.907900],\n zoom: 6.5,\n bearing: 0,\n pitch: 0.5,\n });\n}", "function firesInsideProvince(feature) {\n allCoord = new Array;\n var i;\n for(i = 0; i < dataForDate.length; i++) {\n if(d3.geoContains(feature, [dataForDate[i].longitude, dataForDate[i].latitude])) {\n allCircles[i].setAttribute(\"fill\", \"red\");\n allCoord.push(dataForDate[i]);\n }\n }\n console.log(allCoord);\n }", "function changeDate(unixDate) {\r\n var year = parseInt(moment.unix(unixDate).format(\"YYYY\"));\r\n var date = parseInt(moment.unix(unixDate).format(\"YYYYMMDD\"));\r\n\r\n\r\n\r\n\r\n var yrFilter = [\"all\", [\"<=\", \"YearStart\", year],\r\n [\">=\", \"YearEnd\", year]\r\n ];\r\n\r\n var dateFilter = [\"all\", [\"<=\", \"DayStart\", date],\r\n [\">=\", \"DayEnd\", date]\r\n ];\r\n\r\n\r\n ///////////////////////////////\r\n //LAYERS FOR FILTERING\r\n ///////////////////////////////\r\n\r\n\r\n //NAHC\r\n map.setFilter(\"c7_dates-ajsksu\", dateFilter);\r\n\r\n map.setFilter(\"time_test-2men60\", dateFilter);\r\n\r\n map.setFilter(\"jhu_all3-db6ri5\", dateFilter);\r\n\r\n map.setFilter(\"boundaries-0m2upp\", dateFilter);\r\n\r\n map.setFilter(\"agg1-18x3fi\", dateFilter);\r\n\r\n map.setFilter(\"agg1-5p32uh\", dateFilter);\r\n\r\n map.setFilter(\"agg1-13tqas\", dateFilter);\r\n\r\n map.setFilter(\"agg1-13tqas2\", dateFilter);\r\n\r\n map.setFilter(\"all_locations-2wntvx\", dateFilter);\r\n\r\n} //end function changeDate", "function getDateRestriction (dateReport){\n\tvar restriction = \" gp.date_start <= #Date%\" + dateReport + \"% AND gp.date_end >= #Date%\" + dateReport + \"%\";\n\treturn restriction;\n}", "function loadFilterByDate() {\n\n defineStartAndEndDate(getDataJson);\n\n var startDate = $('.input-daterange').attr('data-start-date');\n var endDate = $('.input-daterange').attr('data-end-date');\n\n $('.input-daterange input').each(function() {\n $(this).datepicker({\n format: 'yyyy-mm-dd',\n // showOnFocus: true,\n startDate: startDate,\n endDate: endDate,\n todayBtn: \"linked\"\n });\n });\n\n\n // $('#isFilterByDate').on('click', function() {\n // // var checked = $(\"#filter-by-date:checked\").length;\n\n // // if (checked == 0) {\n // // $('#filter-by-date').attr('disabled','disabled');\n // // } else {\n // // $('#filter-by-date').removeAttr('disabled');\n // // }\n // // console.log('3');\n // // if ( $('#isFilterByDate').val() == 'check' ) {\n // // $('#filter-by-date').attr('disabled','disabled'); \n // // }\n // // else {\n // // $('#filter-by-date').removeAttr('disabled');\n // // } \n // if ($('#filter-by-date').attr('disabled') !== typeof undefined && $('#filter-by-date').attr('disabled') !== false) {\n // $('#filter-by-date').attr('disabled','disabled');\n // alert('1');\n // } else {\n // alert('2');\n // $('#filter-by-date').removeAttr('disabled');\n // }\n // });\n \n }", "function searchphotoDB(searchquery){\n //console.log(\"searching\")\n console.log(photoDB);\n\n var test = photoDB.indexOf(\"GPSLatitude\");\n //console.log(test);\n document.getElementById(\"daylable\").textContent = test; //set Day Lable to correct day \n\n\n\n // for (i = 0; i < 2003; i++) {\n // var a = photoDB[i].FileName;\n // if (a == searchquery) {\n // //console.log(photoDB[i].FileName);\n // NewSelection(photoDB[i-1].nbr, 1);\n // }\n // };\n}", "function runEnterDate(){\n\n // Clear the table from index.html\n tbody.html(\"\");\n\n // Prevent the page \".event\" from refreshing \n d3.event.preventDefault();\n\n // Select the input element to get the raw HTML node\n var inputElementData=d3.select(\"#datetime\");\n\n\n // On the \"inputElement\", get the value of the property\n var inputValueData=inputElementData.property(\"value\");\n\n\n // Console out the user's input date in date format\n // console.log(inputValue);\n\n // Filter the each info, select a piece of info if its datetime equals the inputValue\n var filteredData=tableData.filter(info=>info.datetime===inputValueData); \n\n // Console out the rows of date user is looking for\n console.log(filteredData);\n\n // Display the rows user is searching for in table in html\n filteredData.map(processData);\n\n}", "function todoQueryFilter(evt){\n if(evt.shiftKey || evt.altKey)\n {\n var clickedElem = evt.target\n var clickedElemText = clickedElem.innerText\n clickedElemText = clickedElemText.toLowerCase()\n\n if(clickedElemText.includes(\"query:\") || clickedElemText.includes(\"[[query]]:\"))\n {\n var querySyntax = clickedElemText\n var startOfBetween = querySyntax.indexOf('between:')\n if(startOfBetween < 0){return;} //Exit function as no between query parameter\n var hiddenCtr = 0;\n\n var phToday = new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate())\n var phTomorrow = new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()+1)\n var phNextWeek = new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()+7)\n var phNextMonth = new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()+31)\n var phYesterday = new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()-1)\n var phLastWeek = new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()-7)\n var phLastMonth = new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()-31)\n\n //Find \"between\"\n var afterBetween = querySyntax.substring(startOfBetween + 8)\n var endOfBetween = afterBetween.indexOf('}')\n var dateRangeStr = afterBetween.substring(0,endOfBetween).trim()\n var startDateStr = dateRangeStr.substring(0,dateRangeStr.indexOf(' [[')).trim().split(\"[\").join(\"\").split(\"]\").join(\"\")\n var endDateStr = dateRangeStr.substring(dateRangeStr.indexOf(' [[')).trim().split(\"[\").join(\"\").split(\"]\").join(\"\")\n var startDate\n var endDate\n\n //console.log(startDateStr)\n //console.log(endDateStr)\n\n switch(startDateStr)\n {\n case 'today':\n startDate = Date.parse(phToday)\n break;\n case 'tomorrow':\n startDate = Date.parse(phTomorrow)\n break;\n case 'next week':\n startDate = Date.parse(phNextWeek)\n break;\n case 'next month':\n startDate = Date.parse(phNextMonth)\n break;\n case 'yesterday':\n startDate = Date.parse(phYesterday)\n break;\n case 'last week':\n startDate = Date.parse(phLastWeek)\n break;\n case 'last month':\n startDate = Date.parse(phLastMonth)\n break;\n default:\n startDateStr = startDateStr.replace(\"st,\",\",\").replace(\"rd,\",\",\").replace(\"th,\",\",\").replace(\"nd,\",\",\")\n startDate = Date.parse(startDateStr)\n }\n\n switch(endDateStr)\n {\n case 'today':\n endDate = Date.parse(phToday)\n break;\n case 'tomorrow':\n endDate = Date.parse(phTomorrow)\n break;\n case 'next week':\n endDate = Date.parse(phNextWeek)\n break;\n case 'next month':\n endDate = Date.parse(phNextMonth)\n break;\n case 'yesterday':\n endDate = Date.parse(phYesterday)\n break;\n case 'last week':\n endDate = Date.parse(phLastWeek)\n break;\n case 'last month':\n endDate = Date.parse(phLastMonth)\n break;\n default:\n endDateStr = endDateStr.replace(\"st,\",\",\").replace(\"rd,\",\",\").replace(\"th,\",\",\").replace(\"nd,\",\",\")\n endDate = Date.parse(endDateStr)\n }\n\n if(endDate < startDate)\n {\n var tmpEndDate = endDate\n endDate = startDate\n startDate = tmpEndDate\n }\n\n var queryParent = clickedElem.parentElement\n var queryResults = queryParent.getElementsByClassName(\"rm-mentions refs-by-page-view\");\n queryResults = queryResults[0]\n var childrenResult = queryResults.children;\n\n //Loop through each page that has query results\n for (var i = 0; i < childrenResult.length; i++)\n {\n //LOOPING THROUGH EACH \"PAGE\" that has query results under it\n\n var eachChild = childrenResult[i];\n var pageTitle = eachChild.getElementsByClassName(\"rm-ref-page-view-title\");\n pageTitle = pageTitle[0]\n var pageTitleStr = pageTitle.innerText\n //Check if page title is a date\n //Don't actually use this part for anything but leaving in for future\n pageTitleStr = pageTitleStr.replace(\"st,\",\",\").replace(\"rd,\",\",\").replace(\"th,\",\",\").replace(\"nd,\",\",\")\n var pgDateTimeValue = Date.parse(pageTitleStr)\n if(isNaN(pgDateTimeValue))\n {\n //console.log(\"PAGE is Not a date\")\n }\n else\n {\n //console.log(\"PAGE is a date\")\n }\n\n var childSections = eachChild.getElementsByClassName(\"rm-reference-item\");\n for (var j = 0; j < childSections.length; j++)\n {\n //LOOPING THROUGH EACH \"SECTION\" (nested location of the blocks) THAT HAS BLOCK RESULTS FOR QUERY\n\n eachSection = childSections[j]\n\n //console.log('*******************************')\n //console.log(eachSection.innerText)\n //console.log('*******************************')\n\n //Look for any dates in the \"parent\" blocks which are called \"zoom mentions\" in Roam html\n var zoomMentions = eachSection.getElementsByClassName(\"rm-zoom zoom-mentions-view\");\n zoomMentions = zoomMentions[0]\n //Find all page links / tags to see if are dates\n var parentDateLinks = zoomMentions.querySelectorAll('[data-link-title], [data-tag]')\n //Counting how many dates found in parent blocks inside the between range and also in future outside between range\n var parDatesFound = 0\n var parDatesIn = 0\n var parDatesFuture = 0\n\n for (var y = 0; y < parentDateLinks.length; y++)\n {\n //LOOPING THROUGH EACH PAGE/TAG TO SEE IF IT IS A DATE\n eachTag2 = parentDateLinks[y]\n\n if(eachTag2 !== null && eachTag2 !== 'undefined' && typeof eachTag2 !== 'undefined')\n {\n var startingDate2 = eachTag2.innerText\n //console.log(startingDate2)\n startingDate2 = startingDate2.replace(\"st,\",\",\").replace(\"rd,\",\",\").replace(\"th,\",\",\").replace(\"nd,\",\",\").replace(\"#\",\"\")\n var dateTimeValue2 = Date.parse(startingDate2)\n if(isNaN(dateTimeValue2))\n {\n //console.log(\"Not a date...\")\n }\n else\n {\n parDatesFound = parDatesFound + 1\n if(dateTimeValue2 >= startDate && dateTimeValue2 <= endDate)\n {\n parDatesIn = parDatesIn + 1\n //console.log(\"Date FOUND in range!\")\n }\n else\n {\n //console.log(\"Date FOUND, but OUTSIDE range...\")\n //Check if future date (as opposed to before the between range)\n if(dateTimeValue2 > endDate)\n {\n //If future date then we want to hide because it really isn't \"past due\"\n parDatesFuture = parDatesFuture + 1\n }\n }\n }\n }\n else\n {\n //No pages/tags in block\n //console.log(\"No pages/tags found in parents\")\n }\n }\n\n var foundCtr = 0\n var childBlocks = eachSection.getElementsByClassName(\"roam-block dont-unfocus-block hoverparent rm-block-text\");\n for (var k = 0; k < childBlocks.length; k++)\n {\n //LOOPING THROUGH EACH BLOCK THAT IS RESULT OF QUERY\n\n eachBlock = childBlocks[k]\n //console.log(eachBlock.innerText)\n var dateLinks = eachBlock.querySelectorAll('[data-link-title], [data-tag]')\n var foundDates = 0\n var foundDateInRange = 0\n var foundDateInFuture = 0\n for (var x = 0; x < dateLinks.length; x++)\n {\n //LOOPING THROUGH EACH PAGE/TAG TO SEE IF IT IS A DATE\n\n eachTag = dateLinks[x]\n\n if(eachTag !== null && eachTag !== 'undefined' && typeof eachTag !== 'undefined')\n {\n //console.log(eachTag.innerText)\n var startingDate = eachTag.innerText\n startingDate = startingDate.replace(\"st,\",\",\").replace(\"rd,\",\",\").replace(\"th,\",\",\").replace(\"nd,\",\",\").replace(\"#\",\"\")\n var dateTimeValue = Date.parse(startingDate)\n if(isNaN(dateTimeValue))\n {\n //console.log(\"Not a date...\")\n }\n else\n {\n foundDates = foundDates + 1\n if(dateTimeValue >= startDate && dateTimeValue <= endDate)\n {\n foundDateInRange = foundDateInRange + 1\n //console.log(\"Date FOUND!\")\n //console.log(dateTimeValue)\n }\n else\n {\n //console.log(\"Date FOUND, but OUTSIDE between range...\")\n //Check if future date (as opposed to before the between range)\n if(dateTimeValue > endDate)\n {\n //If future date then we want to hide because it really isn't \"past due\"\n foundDateInFuture = foundDateInFuture + 1\n }\n }\n }\n }\n else\n {\n //No pages/tags in block\n }\n }\n\n if(foundDates > 0)\n {\n //Date(s) in child/TODO block\n if(foundDateInFuture > 0)\n {\n //Hide block as there is a future date in TODO block (not past due)\n eachBlock.style.display = \"none\"\n hiddenCtr = hiddenCtr + 1\n }\n else\n {\n //Keep showing block\n foundCtr = foundCtr + 1\n }\n }\n else if(parDatesFound > 0)\n {\n //Date(s) in parent block(s)\n if(parDatesFuture > 0)\n {\n //Hide block as no dates in child/TODO and there is a future date in parent block (not past due)\n eachBlock.style.display = \"none\"\n hiddenCtr = hiddenCtr + 1\n }\n else\n {\n //Keep showing block\n foundCtr = foundCtr + 1\n }\n }\n else\n {\n //No dates found in child/TODO or Parent blocks\n //Since it is showing up in query results, then the page its on must be a daily notes page within between range\n foundCtr = foundCtr + 1\n }\n }\n\n //Checks to see if any child/TODO block(s) were left shown, if so, do NOT hide the SECTION\n if(foundCtr == 0)\n {\n //console.log(\"Hiding this section...\")\n //console.log(eachSection)\n eachSection.style.display = \"none\"\n }\n }\n }\n console.log(hiddenCtr + \" items hidden\")\n }\n }\n}", "function valSearchUdhaarByDateInputs(obj) {\r\n if (validateSelectField(document.search_udhaar_panel.dayDD.value, \"Please select Day in Date!\") == false) {\r\n document.search_udhaar_panel.dayDD.focus();\r\n return false;\r\n } else if (validateSelectField(document.search_udhaar_panel.monthMonth.value, \"Please select Month in Date!\") == false) {\r\n document.search_udhaar_panel.monthMonth.focus();\r\n return false;\r\n } else if (validateSelectField(document.search_udhaar_panel.yearYYYY.value, \"Please select Year in Date!\") == false) {\r\n document.search_udhaar_panel.yearYYYY.focus();\r\n return false;\r\n }\r\n return true;\r\n}", "_getAllDatesByData(data) {\n // Get the start and end date\n let startDate = '';\n let endDate = '';\n $.each(data, function (index, item) {\n $.each(item.status, function (date, value) {\n if (startDate === '' && endDate === '') {\n startDate = date;\n endDate = date;\n return true;\n }\n if (date < startDate) {\n startDate = date;\n }\n else if (date > endDate) {\n endDate = date;\n }\n });\n });\n\n // Get dates between the two dates\n startDate = new Date(startDate);\n endDate = new Date(endDate);\n let dateArray = [];\n let currentDate = startDate;\n while (currentDate <= endDate) {\n dateArray.push(currentDate.toISOString().substring(0, 10));\n currentDate.setDate(currentDate.getDate() + 1);\n }\n return dateArray;\n }", "function searchDate () {\n // Grabs data from the \"Schedule a depo\" Sheet, iterates over each row, and pushes results to an array\n var results = [];\n var ss = SpreadsheetApp.getActive();\n var scheduleSheet = ss.getSheetByName('Schedule a depo');\n var allScheduledData = scheduleSheet.getRange(2, 1, scheduleSheet.getLastRow(), scheduleSheet.getLastColumn()).getValues();\n \n // Get query from the \"Infrastructure\" sheet\n var query = SpreadsheetApp.getActive().getSheetByName('Infrastructure').getRange(8, 2).getValue().toString();\n \n // Parse date query into month, day, and year\n var queryMonth = monthToMm(query.substring(4, 7));\n var queryDay = query.substring(8, 10);\n var queryYear = query.substring(11, 15);\n \n // Grabs data from the \"Schedule a depo\" Sheet, iterates over each row, and pushes results to an array\n var allScheduledData = scheduleSheet.getRange(2, 1, scheduleSheet.getLastRow(), scheduleSheet.getLastColumn()).getValues();\n for (var i = 0; i < allScheduledData.length; i++) {\n var isMatch = matchDate(queryMonth, queryDay, queryYear, allScheduledData[i][1]);\n if (isMatch == true) {\n results.push(allScheduledData[i]);\n };\n };\n \n var resultString = ''; \n \n // Determines whether results were found, prints response on Search Sheet \n if (results.length == 0) {\n var rawDate = query.toString();\n var date = rawDate.substring(0, 15);\n return '⚠️ No depositions found matching ' + date + '. Make sure the date entered is in month/day/year format.';\n } else {\n\n // Format the string contribution for each result \n for (var i = 0; i < results.length; i++) {\n var resultCount = i + 1;\n resultString += '<strong>↩ Result ' + resultCount + '</strong><br>';\n var rawDate = results[i][1].toString();\n var date = rawDate.substring(0, 15);\n var witness = results[i][2];\n var orderer = results[i][3];\n var firm = results[i][7];\n var ordererEmail = results[i][4];\n var caseStyle = results[i][5];\n var services = results[i][23];\n var courtReporter = results[i][24];\n var videographer = results[i][25];\n var pip = results[i][26];\n var depoCity = results[i][19];\n var depoState = results[i][20];\n resultString += '1️⃣ Key Information:<br>Witness: <em>' + witness + '</em><br>Firm: <em> '+ firm + '</em><br>Ordered by: <em>' + orderer + '</em><br><br>2️⃣ Additional Information:<br>' + '</em>Orderer email: <em>' + ordererEmail + '</em><br>Case Style: <em>' + caseStyle + '</em><br>Services: <em>' + services + '</em><br>Court reporter? <em>' + courtReporter + '</em><br>Videographer? <em>' + videographer + '</em><br>PIP? <em>' + pip + '</em><br>City: <em>' + depoCity + '</em><br>State: <em>' + depoState + '</em><br><br>';\n };\n };\n return resultString;\n}", "function filterByDay(val){\n return val.date == this;\n }", "function searchButtonClick() {\n var dateFilter = $dateInput.value;\n var stateFilter = $stateInput.value.trim().toLowerCase();\n var cityFilter = $cityInput.value.trim().toLowerCase();\n var countryFilter = $countryInput.value.trim().toLowerCase();\n var shapeFilter = $shapeInput.value.trim().toLowerCase();\n\n // Date Filter\n if (dateFilter != \"\") {\n tableData = data.filter(function (sighting) {\n var sightingDate = sighting.datetime;\n return sightingDate === dateFilter;\n });\n }\n else { tableData };\n\n // State Filter\n if (stateFilter != \"\") {\n tableData = tableData.filter(function (sighting) {\n var sightingState = sighting.state;\n return sightingState === stateFilter;\n });\n }\n else { tableData };\n\n // City Filter\n if (cityFilter != \"\") {\n tableData = tableData.filter(function (sighting) {\n var sightingCity = sighting.city;\n return sightingCity === cityFilter;\n });\n }\n else { tableData };\n\n // Country Filter\n if (countryFilter != \"\") {\n tableData = tableData.filter(function (sighting) {\n var sightingCountry = sighting.country;\n return sightingCountry === countryFilter;\n });\n }\n else { tableData };\n\n // Shape Filter\n if (shapeFilter != \"\") {\n tableData = tableData.filter(function (sighting) {\n var sightingShape = sighting.shape;\n return sightingShape === shapeFilter;\n });\n }\n else { tableData };\n\n populateTable();\n}", "function runSearch() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Select the input element and get value\n var inputValue = d3.select(\"#datetime\").property(\"value\");\n\n // Set filered data to the entire dataset\n var filteredData = tableData;\n\n // Check if a date was entered, if yes filter on that date\n if (inputValue != \"\") {\n filteredData = filteredData.filter(UFOSighting => UFOSighting.datetime === inputValue);\n }\n\n // Call function to build the html table\n buildTable(filteredData);\n}", "function handleSearchButtonClick() \n{\n var filterDateTime = $dateTimeInput.value.trim().toLowerCase(); \n var filterCity = $cityInput.value.trim().toLowerCase();\n var filterState = $stateInput.value.trim().toLowerCase();\n var filterCountry = $countryInput.value.trim().toLowerCase();\n var filterShape = $shapeInput.value.trim().toLowerCase();\n \n if (filterDateTime || filterCity || filterState || filterCountry || filterShape)\n {\n if (filterDateTime){ \n \n search_data = dataSet.filter (function(sighting) { \n var SightingDateTime = sighting.datetime.toLowerCase();\n return SightingDateTime === filterDateTime;\n });\n } else {search_data = dataSet}; \n \n if (filterCity){\n \n search_data = search_data.filter (function(sighting) {\n var SightingCity = sighting.city.toLowerCase();\n return SightingCity === filterCity;\n });\n } else {search_data = search_data}; \n\n if (filterState){\n search_data = search_data.filter (function(sighting) {\n var SightingState = sighting.state.toLowerCase();\n return SightingState === filterState;\n });\n } else {search_data = search_data}; \n\n if (filterCountry){\n search_data = search_data.filter (function(sighting) {\n var SightingCountry = sighting.country.toLowerCase();\n return SightingCountry === filterCountry;\n });\n } else {search_data = search_data}; \n\n if (filterShape){\n search_data = search_data.filter (function(sighting) {\n var SightingShape = sighting.shape.toLowerCase();\n return SightingShape === filterShape;\n });\n } else {search_data = search_data}; \n\n\n } else {\n // Show full dataset when the user does not enter any serch criteria\n search_data = dataSet; \n }\n $('#table').DataTable().destroy(); \n renderTable(search_data); \n pagination_UFO(); \n}", "function GetDateForQuery(index) {\n var chuoisearch = \"\";\n var fd = \" \", td = \" \";\n var today = new Date();\n switch (index) {\n case 0:\n fd = td = (today.getDate() + '/' + (today.getMonth() + 1) + '/' + today.getFullYear());\n chuoisearch = \"_\" + fd + \"_\" + td + \"_false\";\n return chuoisearch;\n case 1:\n fd = (today.getDate() + '/' + (today.getMonth() + 1) + '/' + today.getFullYear());\n today.setDate(today.getDate() + 1)\n td = (today.getDate() + '/' + (today.getMonth() + 1) + '/' + today.getFullYear());\n chuoisearch = \"_\" + fd + \"_\" + td + \"_false\";\n return chuoisearch;\n case 2:\n var dayOfWeekStartingSundayZeroIndexBased = today.getDay(); // 0 : Sunday ,1 : Monday,2,3,4,5,6 : Saturday\n var mondayOfWeek = new Date(today.getFullYear(), today.getMonth(), today.getDate() - today.getDay() + 1);\n var sundayOfWeek = new Date(today.getFullYear(), today.getMonth(), today.getDate() - today.getDay() + 7);\n fd = (mondayOfWeek.getDate() + '/' + (mondayOfWeek.getMonth() + 1) + '/' + mondayOfWeek.getFullYear());\n td = (sundayOfWeek.getDate() + '/' + (sundayOfWeek.getMonth() + 1) + '/' + sundayOfWeek.getFullYear());\n chuoisearch = \"_\" + fd + \"_\" + td + \"_false\";\n return chuoisearch;\n default:\n chuoisearch = \"_\" + fd + \"_\" + td + \"_false\";\n return chuoisearch;\n }\n}", "function order_search()\n{\n\tsearchval = $(\"#ordersearchval\").val();\n\tstartdate = $(\"#sdate\").val();\n\tenddate = $(\"#edate\").val();\n\n\t$baseurl = getBaseURL();\n\t$.ajax({\n\t url: $baseurl+\"admin/merchant_payment_search/\",\n\t type: \"post\",\n\t data : { 'sval':searchval,'stdate':startdate,'eddate':enddate},\n\t dataType: \"html\",\n\t success: function(responce){\n\t\t\t$(\"#userdata\").html(responce);\n\t }\n\t});\n}", "function searchByDate() {\n // Prompts the user to enter a search query, captures their response\n var ui = SpreadsheetApp.getUi();\n var response = ui.prompt(\"📅 Enter the search date\", \"Enter a date in MM/DD/YY format\\n\\n✅ 04/05/2020\\n✅ 4/5/21\\n✅ 12-05-19\\n\\n\", ui.ButtonSet.OK);\n if (response.getSelectedButton() == ui.Button.OK) {\n var date = response.getResponseText();\n };\n \n // Store the search query in the \"Infrastructure\" Sheet\n SpreadsheetApp.getActive().getSheetByName('Infrastructure').getRange(8, 2).setValue(date);\n \n displayDateSearch();\n}", "intersectsDate(date) {\n return !this.excludesDate(date) && (this.dates.find(function (d) {\n return d.intersectsDate(date);\n }) || false);\n }", "intersectsDate(date) {\n return !this.excludesDate(date) && (this.dates.find(function (d) {\n return d.intersectsDate(date);\n }) || false);\n }", "function dateFilter() {\n //check empty fields\n if ($('#from-date').val() === \"\" || $('#to-date').val() === \"\") {\n alert(\"هر دو فیلد تاریخ را پر کنید\")\n } else {\n\n $.ajax({\n type: \"POST\",\n url: \"/companies/filter\",\n data: {\n dateFrom: $('#from-date').val(),\n dateTo: $('#to-date').val()\n },\n success: function (res) {\n if (res === \"notFound\") {\n alert(\"در این بازه شرکتی وجود ندارد\")\n } else {\n document.location = '/companies/allCompanies';\n }\n },\n error: function (err) {\n document.location = '/error'\n }\n });\n }\n}", "function searchDate(keyDate, myArray){\n var count = 0;\n for (var i=0; i < myArray.length; i++) {\n\n if (myArray[i].date.getFullYear() == keyDate.getFullYear() &&\n myArray[i].date.getMonth() == keyDate.getMonth() &&\n myArray[i].date.getDate() == keyDate.getDate()) {\n count++;\n }\n }\n return count;\n }", "function valSearchBannerGirviByDateInputs(obj) {\r\n if (validateSelectField(document.search_banner_girvi_by_date.dayDD.value, \"Please select Day in Date!\") == false) {\r\n document.search_banner_girvi_by_date.dayDD.focus();\r\n return false;\r\n } else if (validateSelectField(document.search_banner_girvi_by_date.monthMonth.value, \"Please select Month in Date!\") == false) {\r\n document.search_banner_girvi_by_date.monthMonth.focus();\r\n return false;\r\n } else if (validateSelectField(document.search_banner_girvi_by_date.yearYYYY.value, \"Please select Year in Date!\") == false) {\r\n document.search_banner_girvi_by_date.yearYYYY.focus();\r\n return false;\r\n }\r\n return true;\r\n}", "function getActivityDateRange(params) {\n var beginDate = params.beginDate,\n endDate = params.endDate,\n beginEnd = params.beginEnd,\n date = params.date;\n\n var findParams = {};\n var begin = beginDate ? _moment2.default.utc(beginDate, 'MM-DD-YYYY').startOf('day') : (0, _moment2.default)().subtract(100, 'years');\n var end = endDate ? _moment2.default.utc(endDate, 'MM-DD-YYYY').endOf('day') : (0, _moment2.default)().add(100, 'years');\n if (beginDate && endDate) {\n findParams.created = { $gt: begin.toDate(), $lt: end.toDate() };\n // Begin date only\n } else if (beginEnd === 'begin' && date) {\n findParams.created = { $gt: begin.toDate() };\n }\n if (typeof params.companyId !== 'undefined') {\n findParams.company = params.companyId;\n }\n if (_typeof(params.rejected) && params.rejected === 'true') {\n params.rejected = true;\n }\n // Only sold\n findParams.soldToLiquidation = true;\n\n return findParams;\n}", "function pullEvents() {\n var query = \"\";\n\n if(filter.start)\n query += \"&start=\" + (filter.start.getTime() / 1000);\n if(filter.end)\n query += \"&end=\" + (filter.end.getTime() / 1000);\n if(filter.search)\n query += \"&search=\" + filter.search;\n if(filter.latMin)\n query += \"&lat_min=\" + filter.latMin;\n if(filter.latMax)\n query += \"&lat_max=\" + filter.latMax;\n if(filter.longMin)\n query += \"&long_min=\" + filter.longMin;\n if(filter.longMax)\n query += \"&long_max=\" + filter.longMax;\n if(filter.day.length > 0 && filter.day.length < 7)\n query += \"&day=\" + filter.day.reduce(function(a,b) { return a + \",\" + b; },\"\").substring(1);\n if(filter.price.length > 0 && filter.price.length < 5)\n query += \"&price=\" + filter.price.reduce(function(a,b) { return a + \",\" + b; },\"\").substring(1);\n if(filter.tags.length > 0)\n query += \"&tags=\" + filter.tags.reduce(function(a,b) { return a + \",\" + b; },\"\").substring(1);\n if(filter.offset)\n query += \"&offset=\" + filter.offset;\n if(filter.sort)\n query += \"&sort=\" + filter.sort;\n\n loading('show');\n $.getJSON(\"/events/index?format=json\" + query, function (events) {\n var locations = [];\n for(var i in events) {\n var start = Date.parse(events[i].occurrences[0].start.substr(0,19));\n var li = $($('#content .main .inner .events-seed li:last-child').clone().wrap('<ul>').parent().html());\n li.find(\".name\").attr(\"href\", events[i].id);\n li.find(\".index\").html(parseInt(i) + 1);\n li.find(\".mod\").html(start.toString(\"MMMdd\").toUpperCase());\n li.find(\".day\").html(day_of_week[events[i].occurrences[0].day_of_week]);\n li.find(\".time\").html(start.toString(\"hh:mmtt\").toLowerCase());\n li.find(\".one .name\").html(events[i].title);\n li.find(\".one .venue\").html(events[i].venue.name);\n li.find(\".one .venue\").attr(\"href\",events[i].venue_id);\n if(events[i].price!=null)\n if(events[i].price!=0)\n li.find(\".one .description\").html(\"<span ><strong>Price: $\" + parseFloat(events[i].price).toFixed(2) + \"</strong></span> \" + events[i].description);\n else li.find(\".one .description\").html(\"<span ><strong>Free</strong></span> \" +events[i].description);\n else li.find(\".one .description\").html(events[i].description);\n li.prependTo('#content .main .inner .events-seed');\n locations.push({lat: events[i].venue.latitude, long: events[i].venue.longitude});\n }\n\n //placeMarkers({points: locations});\n\n $('#content .main .inner .events').empty();\n $('#content .main .inner .header .count').html(events.length + \" event\" + ((events.length == 1) ? \"\" : \"s\"));\n $('#content .main .inner .events-seed li:not(:last-child)').each(function() {\n $(this).prependTo('#content .main .inner .events');\n });\n loading('hide');\n });\n}", "function filterByDate(selectedDate, arrToFilter) {\r\n return (\r\n arrToFilter.filter((s) => (\r\n isBetweenDates(\r\n selectedDate,\r\n parseSPDate(s.ValidFromDate),\r\n parseSPDate(s.ValidUntilDate),\r\n )\r\n ))\r\n );\r\n}", "function weekendPlans(callback) {\n Entry.aggregate(\n [\n { \"$redact\": {\n \"$cond\": {\n \"if\": {\n \"$or\": [\n { \"$eq\": [ { \"$dayOfWeek\": \"$selectedDate\" }, 1 ] },\n { \"$eq\": [ { \"$dayOfWeek\": \"$selectedDate\" }, 6 ] },\n { \"$eq\": [ { \"$dayOfWeek\": \"$selectedDate\" }, 7 ] }\n ]\n },\n \"then\": \"$$KEEP\",\n \"else\": \"$$PRUNE\"\n }\n }}\n ],\n // GET THE RESULTS AND RETURN IF selectedDate MATCHES THIS WEEKEND\n function(err,results) {\n var i = results.length;\n var theWeekend = [];\n //console.log(results)\n\n var days = [friday, saturday, sunday];\n var theWeekend = results.filter(function(obj) {\n for (var i = 0; i < days.length; i++) {\n var day = days[i];\n // now properly compare the day of week\n if (day.getDate() == obj.selectedDate.getDate()) {\n return true;\n }\n }\n return false;\n });\n callback(err, theWeekend)\n console.log(theWeekend);\n }\n)}", "_validateSelectedDates(dates) {\n const that = this;\n let outOfRangeDates = [];\n\n if (!dates) {\n dates = that.selectedDates;\n }\n\n let selectedDates = dates.slice(0),\n filter = function (date) {\n if (date.getTime() >= that.min.getTime() && date.getTime() <= that.max.getTime() && !isRestrictedDate(date)) {\n return true;\n }\n\n outOfRangeDates.push(date);\n return;\n },\n isRestrictedDate = function (date) {\n for (let d = 0; d < that.restrictedDates.length; d++) {\n if (that.restrictedDates[d].getTime() === date.getTime()) {\n return true;\n }\n }\n }\n\n //Synchronize the attribute.\n that.selectedDates = selectedDates.filter(filter);\n\n //Unselects dates that are out of range.\n if (that._viewDates) {\n outOfRangeDates.map(date => that._selectDate(date));\n that._focusCell();\n }\n }", "function search() {\n\tvar srcStationInfo = document.getElementById('srcStationInfo');\n\t\n\t//get selected source and destation stations\n\tvar srcSelected = $('#srcStations').find(\":selected\").val();\n\tvar desSelected = $('#desStations').find(\":selected\").val();\n\t//console.log(srcSelected);\n\t//console.log(desSelected);\n\n\tgetTrains(srcSelected, desSelected);\n\tgetSrc(srcSelected);\n\n}", "function select_dates() {\n var dateFormat = 'dd/mm/yy';\n\n var from = $('#from')\n .datepicker({\n defaultDate: '-4d',\n changeMonth: true,\n numberOfMonths: 1\n })\n .on('change', function(){\n to.datepicker('option', 'minDate', getDateDatePicker( this, 0, 'to'));\n to.datepicker('option', 'maxDate', getDateDatePicker( this, 4, 'to'));\n $(this).datepicker('option', 'minDate', null);\n $(this).datepicker('option', 'maxDate', 0);\n date.from = new Date(this.value);\n date.to = setDateDatePicker($('#to').datepicker('getDate'));\n get_data();\n });\n\n $('#from').datepicker('setDate', new Date());\n\n var to = $('#to').datepicker({\n defaultDate: '0d',\n changeMonth: true,\n numberOfMonths: 1,\n maxDate: 0\n })\n .on('change', function(){\n from.datepicker('option', 'maxDate', getDateDatePicker( this, 0, 'from'));\n from.datepicker('option', 'minDate', getDateDatePicker( this, -4, 'from'));\n $(this).datepicker('option', 'minDate', null);\n $(this).datepicker('option', 'maxDate', 0);\n date.from = setDateDatePicker($('#from').datepicker('getDate'))\n date.to = new Date(this.value)\n get_data();\n });\n\n $('#to').datepicker('setDate', new Date());\n \n function getDateDatePicker(element, diff, opt){\n var date_out;\n var date_tmp;\n var date_tmp_aux;\n var date_tmp_out;\n try{\n date_tmp_aux = new Date();\n date_tmp = new Date(element.value);\n date_tmp.setDate(date_tmp.getDate() + parseInt(diff));\n if(opt == 'to'){\n if(date_tmp > date_tmp_aux){\n date_tmp_out = new Date(date_tmp_aux);\n }\n else{\n date_tmp_out = new Date(date_tmp);\n }\n }\n else{\n date_tmp_out = date_tmp;\n }\n date_out = $.datepicker.parseDate( dateFormat, date_tmp_out.getDate() + '/' + (date_tmp_out.getMonth()+1) + '/' + date_tmp_out.getFullYear());\n } catch( error ) {\n date_out = null;\n }\n return date_out;\n }\n\n function setDateDatePicker(datetime){\n date_out = $.datepicker.parseDate( dateFormat, datetime.getDate() + '/' + (datetime.getMonth()+1) + '/' + datetime.getFullYear());\n return date_out;\n }\n }", "function searchExtractAdmin() {\n setValueParam(arrParamAdmin, \"filtre\", document.getElementById(\"filtreExtract\").value);\n setValueParam(arrParamAdmin, \"date_demande_debut\", document.getElementById(\"dateDebut\").value);\n setValueParam(arrParamAdmin, \"date_demande_fin\", document.getElementById(\"dateFin\").value);\n loadExtractAdmin();\n}", "function clickSelect(){\n console.log(date.property(\"value\"));\n var newtable = tableData.filter(sight => sight.datetime===date.property(\"value\"))\n displayData(newtable);\n}", "function total_sales_by_location_morrisons(request){\n\n \t\tvar searchname = request.parameters.searchname;\n\t\t\tvar datefrom = request.parameters.datefrom;\n\t\t\tvar datetill = request.parameters.datetill;\n\t\t\tvar pagenumber = isnull(parseInt(request.parameters.pagenumber),0);\n\t\t\tvar fleet = isnull(parseInt(request.parameters.fleet),0);\n\n\t\t\tvar customer = isnull(request.parameters.customer,0);\n\t\t\tvar field1 = search.lookupFields({\n\t\t\t type: search.Type.CUSTOMER,\n\t\t\t id: customer,\n\t\t\t columns: ['parent']\n\t\t\t});\n\t\t\tvar parentObj=field1.parent[0];\n\t\t\tlog.debug(\"\",\"customer=\"+customer+\" parent=\"+JSON.stringify(field1)+\" =\"+field1.parent+\" | parentObj=\"+parentObj.value);\n\t\t\tvar parent=parentObj.value;\n\n\t\t\tlog.debug(\"\",\"date from=\"+datefrom+\" datetill=\"+datetill);\n\t\t\t\n\t\t\tvar logic1=\"noneof\";\n\t\t\tvar parent1=0;\n\t\t\tvar logic2=\"noneof\";\n\t\t\tvar parent2=0;\n\t\t\tvar fleet_logic=\"noneof\";\n\t\t\tvar fleet=0;\n\t\t\t\n\t\t\tif(customer==parent){\n\t\t\t\tlogic1=\"anyof\";\n\t\t\t\tparent1=parent;\n\t\t\t}\n\t\t\tif(customer!=parent){\n\t\t\t\tlogic2=\"anyof\";\n\t\t\t\tparent2=customer;\n\t\t\t}\n\t\t\t\n\t\t\tif(fleet!=0){\n\t\t\t\tfleet_logic=\"anyof\";\n\t\t\t}\n\t\t\t\n\t\t\tvar searchObj = search.create({\n\t\t\t\t type: \"transaction\",\n\t\t\t\t filters: [\n\t\t\t\t\t [\"type\",\"anyof\",\"CustCred\",\"CustInvc\"], \n\t\t\t\t\t \"AND\", \n\t\t\t\t\t [\"account\",\"anyof\",\"54\",\"301\"], \n\t\t\t\t\t \"AND\", \n\t\t\t\t\t [\"name\",\"noneof\",\"4509\",\"2726\"], \n\t\t\t\t\t \"AND\", \n\t\t\t\t\t [\"customer.parent\",logic1,parent1],\n\t\t\t\t\t \"AND\",\n\t\t\t\t\t [\"entity\",logic2,parent2],\n\t\t\t\t\t \"AND\",\n\t\t\t\t\t [\"custcol_fleet_num\",fleet_logic,fleet],\n\t\t\t\t\t \"AND\",\n\t\t\t\t\t [\"trandate\",\"within\",transform_date(datefrom),transform_date(datetill)]\n\t\t\t\t\t //[\"trandate\",\"within\",\"18/4/2018\",\"18/4/2018\"]\n\t\t\t\t\t ],\n\t\t\t\t columns:\n\t\t\t\t [\n\t\t\t\t search.createColumn({\n\t\t\t\t name: \"companyname\",\n\t\t\t\t join: \"customer\",\n\t\t\t\t summary: \"GROUP\",\n\t\t\t\t label: \"Location\"\n\t\t\t\t }),\n\t\t\t\t search.createColumn({\n\t\t\t\t name: \"formulacurrency\",\n\t\t\t\t summary: \"SUM\",\n\t\t\t\t formula: \"CASE WHEN {customer.category} != 'Krone' THEN {netamountnotax} ELSE 0 END\",\n\t\t\t\t label: \"Formula (Currency)\"\n\t\t\t\t })\n\t\t\t\t ]\n\t\t\t\t});\n\n\t\t\t/*\told filter\n\t\t\t[\n\t\t [\"type\",\"anyof\",\"CustCred\",\"CustInvc\"], \n\t\t \"AND\", \n\t\t [\"account\",\"anyof\",\"54\",\"301\"], \n\t\t \"AND\", \n\t\t [\"name\",\"noneof\",\"4509\",\"2726\"], \n\t\t \"AND\", \n\t\t [\"location\",\"anyof\",\"8\",\"9\",\"10\",\"51\",\"52\",\"5\",\"228\",\"225\",\"223\",\"224\",\"222\"], \n\t\t \"AND\", \n\t\t [\"trandate\",\"within\",transform_date(datefrom),transform_date(datetill)]\n\t\t //[\"trandate\",\"within\",\"18/4/2018\",\"18/4/2018\"]\n\t\t ];\n*/\n\t\t\t\n\t \t//var searchObj = search.load({id: 'customsearch_sal_sales_by_branch_3_2_3'});\n\t\t\tvar searchResultCount = searchObj.runPaged().count;\n\t\t\tlog.debug(\"searchObj result count\",\"searchObj result count:\"+searchResultCount);\n\n\t \tvar searchResult = searchObj.run().getRange(pagenumber*100,pagenumber*100+100);\n\n\t \tvar numberOfPages = Math.floor(searchResultCount/100);\n\t\t\tif(searchResultCount % 100 > 0) numberOfPages++;\n\t\t\tvar pageObj={searchName:searchname, resultCount:searchResultCount, pageCount:numberOfPages, currentPage:pagenumber};\n\t\t\t\n\t\t\tvar result_array=[];\n\t\t\t//result_array.push(transform_date(datefrom));\n\t\t\t//result_array.push(transform_date(datetill));\n\t\t\tresult_array.push(pageObj);\n\t\t\tresult_array.push(searchResult);\n\t \treturn result_array;\n\t\t}", "function fullDay(date){\n var response = false;\n $.each(dateOpen, function(i, d) {\n var open = new Date(d.day.date.slice(0, 10));\n if (date.getDate() == open.getDate() && date.getMonth() == open.getMonth() && d.nbVisitor >= 1000) {\n response = true;\n return false;\n }\n });\n return response;\n }", "findByDate (req, res) {\n return availability\n .findAll({\n where: {\n doctor_id: req.params.doctor,\n date: req.params.date\n }\n })\n .then(availability => res.status(200).send(availability))\n .catch(error => res.status(400).send(error))\n }", "function DateChangedStart() {\n var perStart = $(\"#dpfrom\").datepicker(\"getDate\");\n var perEnd = $(\"#dpto\").datepicker(\"getDate\");\n \n if (perStart > perEnd) {\n $('#dpto').datepicker('setDate', perStart);\n }\n GetInvoicesForPeriod();\n}", "function filtering(data, startdate, enddate)\r\n {\r\n return _.filter(data, function(value)\r\n {\r\n var month = parseInt(value.date.substr(3,4));\r\n var year = parseInt(value.date.substr(6,9));\r\n if((year == startdate.getYear()+1900) && year == (enddate.getYear()+1900))\r\n {\r\n if(month >= (startdate.getMonth()+1) && month <= (enddate.getMonth()+1))\r\n return true;\r\n else\r\n return false;\r\n }\r\n else\r\n {\r\n if(month >= (startdate.getMonth()+1) && year == (startdate.getYear()+1900))\r\n return true;\r\n else if(month <= (enddate.getMonth()+1) && year == (enddate.getYear()+1900))\r\n return true;\r\n else if(year > (startdate.getYear()+1900) && year < (enddate.getYear()+1900))\r\n return true;\r\n else\r\n return false;\r\n }\r\n });\r\n }", "function get_publication_date_query(){\n let query = [];\n\n let minDate = document.getElementById(\"minDate\").value;\n let maxDate = document.getElementById(\"maxDate\").value;\n let tmp = 0;\n\n if ((new Date(minDate).getTime() > new Date(maxDate).getTime())){\n tmp = minDate;\n minDate = maxDate;\n maxDate = tmp\n }\n\n query.push(\"minDate=\"+minDate);\n query.push(\"maxDate=\"+maxDate);\n console.log(query);\n return query.join(\"&\");\n}" ]
[ "0.6518934", "0.6397725", "0.61156696", "0.61156696", "0.598729", "0.59050137", "0.5884962", "0.5827258", "0.5797925", "0.57933146", "0.5698595", "0.5692704", "0.5645925", "0.5639306", "0.56091005", "0.5602812", "0.55887926", "0.55663097", "0.5556487", "0.55528945", "0.5551344", "0.5536527", "0.5529589", "0.5485568", "0.5478293", "0.54590124", "0.54381496", "0.5437185", "0.5430567", "0.5410084", "0.5394552", "0.53854537", "0.53773665", "0.53750557", "0.5362602", "0.53569025", "0.53503615", "0.533969", "0.53364", "0.5336057", "0.5334719", "0.53191483", "0.53135115", "0.53114194", "0.53107923", "0.529164", "0.52835953", "0.52808565", "0.5277767", "0.52565336", "0.52522475", "0.52471197", "0.5235559", "0.5222384", "0.52209705", "0.52136415", "0.5207165", "0.51911247", "0.51887226", "0.51817346", "0.51814014", "0.5169117", "0.5166598", "0.5163445", "0.5158941", "0.5155973", "0.51436365", "0.513542", "0.51327", "0.51317394", "0.5129147", "0.5124763", "0.5124302", "0.5110971", "0.51088", "0.51010275", "0.5094554", "0.509308", "0.50904435", "0.5086116", "0.5081889", "0.5081889", "0.5075311", "0.5070245", "0.50672346", "0.50643355", "0.50600636", "0.50591666", "0.5051524", "0.5051065", "0.50476515", "0.504296", "0.5031297", "0.50311077", "0.5022287", "0.5017442", "0.50170016", "0.50127554", "0.5006411", "0.5003431" ]
0.69208556
0
A day from the previous/next month on the grid
function FillDay(day) { this.type = "fill" this.day = day this.dayOfMonth = day.getDate() if(day.getDate() == new Date().getDate() && day.getMonth() == new Date().getMonth()){ this.isToday = true; } else{ this.isToday = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "prevMonth() {\n if (this.monthIndex==0){\n this.monthIndex = 11;\n this.month = monthsArray[this.monthIndex];\n this.year -= 1;\n } else {\n this.monthIndex -= 1;\n this.month = monthsArray[this.monthIndex];\n }\n this._renderCalendarMonth();\n }", "function nextMonth(){\n setDate(1);\n getStartDay();\n renderDays();\n calendarMonthAndYear.innerText = months[setCal.month] + \" \" + setCal.year;\n }", "function previousMonth() {\n // clearCalendar();\n date.setMonth(date.getMonth() - 1);\n var val = date.getMonth();\n createMonth(date.getMonth());\n heatmap(date.getMonth()-1);\n}", "function prevNextReset(e) {\n var el = e.target || e.srcElement;\n \n if(/prev/.test(el.className)) {\n now.mm--;\n if(now.mm < 0) {\n now.mm = 11;\n now.yyyy--;\n } \n } else if(/next/.test(el.className)) {\n now.mm++; \n if(now.mm > 11) {\n now.mm = 0;\n now.yyyy++;\n } \n } else if(/reset/.test(el.className)) {\n now.mm = initVal.mm; \n now.yyyy = initVal.yyyy; \n }\n \n insertDaysToCalendar();\n }", "function initDayOfMonth() {\n let dayOfCurrentMonth; //define array day in current month\n let dayOfPrevMonth; //definde array day in prevent month\n let dayOfNextMounth; //definde array day in next month\n let countDay = 0; //initialize value index of day in array current month\n let countNextDay = 0; //initialize value index of day in array current next month\n\n dayOfCurrentMonth = getDaysOfMonth(currentYear, currentMonth);\n if (currentMonth === 0) {\n dayOfPrevMonth = getDaysOfMonth(currentYear - 1, 11);\n } else {\n dayOfPrevMonth = getDaysOfMonth(currentYear, currentMonth - 1);\n }\n dayOfPrevMonth.splice(0, dayOfPrevMonth.length - 6);\n\n if (currentMonth === 11) {\n dayOfNextMounth = getDaysOfMonth(currentYear + 1, 0);\n } else {\n dayOfNextMounth = getDaysOfMonth(currentYear, currentMonth + 1);\n }\n\n let listClassCss;\n for (let tr = 0; tr < 6; tr++) {\n let dataColum = \"\";\n for (let th = 0; th < ARR_DAY_OF_WEEKS.length; th++) {\n if (dayOfCurrentMonth[countDay] != undefined ||\n dayOfCurrentMonth[countDay] != null) {\n if (dayOfCurrentMonth[countDay].getDay() === th) {\n let date = dayOfCurrentMonth[countDay];\n listClassCss = \"date-num\";\n if (date.getDate() === now.getDate() &&\n date.getMonth() === now.getMonth() &&\n date.getFullYear() === now.getFullYear()) {\n listClassCss += \" current-date\";\n }\n dataColum += `<td class='${listClassCss}' onclick='selectDay(event,${date.getDate()},${date.getMonth()},${date.getFullYear()})'>${dayOfCurrentMonth[countDay].getDate()}</td>`;\n countDay++;\n } else {\n dayOfPrevMonth.forEach(date => {\n if (date.getDay() === th) {\n dataColum += `<td class='date-num date-prev' onclick='selectDay(event, ${date.getDate()}, ${date.getMonth()}, ${date.getFullYear()})'>${date.getDate()}</td>`;\n return;\n }\n });\n }\n } else {\n let date = dayOfNextMounth[countNextDay];\n dataColum += `<td class='date-num date-next' onclick='selectDay(event, ${date.getDate()}, ${date.getMonth()}, ${date.getFullYear()})'>${dayOfNextMounth[countNextDay].getDate()}</td>`;\n countNextDay++;\n }\n }\n bodyDate.append(`<tr>${dataColum}</tr>`);\n }\n trDates = $('.date-num');\n}", "function prevDate() {\n var year = x.getFullYear();\n var month = x.getMonth();\n if (month == 0) {\n month = 12;\n year -= 1;\n }\n x = new Date(year, (month - 1));\n displayDates();\n}", "monthIndex() {\n return this.month - 1;\n }", "function prevmonth() {\t\t\n\t\tshow_month_month = show_month.getMonth();\n\t\tshow_month=new Date(show_month.getFullYear(), show_month_month-1, 1);\n changemonth(show_month);\n\t}", "previousMonth(){\n return this.subtractMonths(1);\n }", "function onPreviousMonth(event) {\n currentDateTime.setMonth(currentDateTime.getMonth() - 1);\n initCalendar();\n\n // The outside click event should not occur\n event.stopPropagation();\n }", "function onNextMonth(event) {\n currentDateTime.setMonth(currentDateTime.getMonth() + 1);\n initCalendar();\n\n // The outside click event should not occur\n event.stopPropagation();\n }", "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 }", "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 }", "setPrevMonth (prev, e) {\n let curDate = new Date(this.state.currentDate);\n let curMonth = curDate.getMonth();\n let newMonth = prev ? curMonth - 1 : curMonth + 1;\n curDate = new Date(curDate.setMonth(newMonth));\n this.setState({'currentDate': curDate});\n this.props.getDatesWithTasksByMonth(strftime('%Y-%m-%d', curDate), false);\n }", "function cal_prev()\n{\n if(curr_month === 0 )\n {\n curr_month = 11;\n curr_year = curr_year - 1;\n document.getElementById('curr_month').innerHTML = months[curr_month]+\", \"+curr_year;\n }\n else if(curr_month > 0 )\n {\n curr_month = curr_month -1 ;\n document.getElementById('curr_month').innerHTML = months[curr_month]+\", \"+curr_year;\n //display_cal();\n }\n}", "function previousMonth () {\n\tmonth = month - 1; // substract one from current month\n\tremoveWeeks(); // remove calendar elements\n\tcreateCalendar(); // create new calendar elements\n\tchangeWeeksDisplay(\"flex\"); // show all weeks except model one (= view: month) \n\tdocument.getElementById(\"currentMonth\").innerHTML = months[month].name; // change displayed month name\n\taddDayClickEvent(); // add \"click\" event to new calendar days elements\n\taddWeekClickEvent(); // add \"click\" event to new calendar weeks elements\n}", "function prevMonth() {\n // -- remove one month from the viewDate --/\n $directive.viewDate.setDate(1);\n $directive.viewDate.setMonth($directive.viewDate.getMonth() - 1);\n // -- reload the viewdate woopwoop --/\n setViewDate($directive.viewDate);\n }", "function generatePreviousMonth(currentYear){\n\n\tcalendar.empty();\n\tcurrentMonthIndex --;\n\tif (currentMonthIndex < 1)\n\t\tcurrentMonthIndex =12;\n\t\tif(currentMonthIndex >= 9 && currentMonthIndex <=12)\n\t\t\tyearIndex = currentYear-1;\n\t\telse\n\t\t\tyearIndex = currentYear;\n\n\tvar calObjt = createCalendar(currentMonthIndex, yearIndex);\n\tvar rowDays = generateDayRow();\n\tdocument.getElementById(\"calendar-month-year\").innerHTML = month_name[currentMonthIndex-1]+\" \"+yearIndex;\n\tdocument.getElementById(\"calendar-dates\").appendChild(rowDays); \n\tdocument.getElementById(\"calendar-dates\").appendChild(calObjt);\n\thighlightDateWithEvent(currentMonthIndex);\n}", "previousMonthComps() {\n if (this.month === 1) return {\n days: _daysInMonths[11],\n month: 12,\n year: this.year - 1,\n }\n return {\n days: (this.month === 3 && this.isLeapYear) ? 29 : _daysInMonths[this.month - 2],\n month: this.month - 1,\n year: this.year,\n };\n }", "function calPrevious()\n{\nprevdate= getCalValue();\nlocation.reload();\nsetSelectedMonth(-1,prevdate);\n}", "function getPrevDays() {\n\n // First step we need to know is witch weekday\n // the month starts and assert it is an integer\n let actualMonthStartAt = parseInt(\n dateObject\n .startOf(\"month\")\n .format(\"d\")\n )\n\n // Creates a copy of the actual date and\n // in the copy we subtract one month.\n let dateObjectCopy = dateObject.clone();\n dateObjectCopy.subtract(1, \"M\")\n\n let reversed = [];\n\n // We take the weekday the month starts and count subtracting\n // the total weekdays from the previous month total days.\n for (let day = 0; day < actualMonthStartAt; day++){\n reversed.push({\n classNames: \"text-muted rounded prev-day\",\n callback: () => {goTo(\"prev\", \"M\")},\n value: dateObjectCopy.daysInMonth() - day,\n })\n }\n\n // return the reversed days\n return reversed.reverse()\n }", "nextMonth() {\n if (this.monthIndex==11){\n this.monthIndex = 0;\n this.year += 1;\n this.month = monthsArray[this.monthIndex];\n } else {\n this.monthIndex += 1;\n this.month = monthsArray[this.monthIndex];\n }\n this._renderCalendarMonth();\n }", "nextMonth(){\n return this.addMonths(1);\n }", "prevMonth() {\n let month = this.state.month;\n let year = this.state.year;\n if (month === 1) {\n month = 12;\n year = year - 1;\n }\n else\n month -= 1;\n this.setState({\n year: year,\n month: month\n })\n }", "previous() {\n let {month} = this.state;\n this.setState({\n month: month.subtract(1, 'month'),\n });\n }", "function publicDaysInMonth() {\n var daysArray = [];\n\n var firstDayOfTheWeek = new Date(publicYearToDisplay(), publicMonthToDisplay(), 1).getDay();\n var daysInPreviousMonth = new Date(publicYearToDisplay(), publicMonthToDisplay(), 0).getDate();\n\n // Lets say the first week of the current month is a Wednesday. Then we need to get 3 days from \n // the end of the previous month. But we can't naively go from 29 - 31. We have to do it properly\n // depending on whether the last month was one that had 31 days, 30 days or 28.\n for (i = 1; i <= firstDayOfTheWeek; i++) {\n daysArray.push([daysInPreviousMonth - firstDayOfTheWeek + i, cellColorForCurrentMonth]);\n }\n \n // These are all the days in the current month.\n var daysInMonth = new Date(publicYearToDisplay(), publicMonthToDisplay() + 1, 0).getDate();\n for (i = 1; i <= daysInMonth; i++) {\n daysArray.push([i, cellColorForPreviousMonth]);\n }\n\n // Depending on how many days we have so far (from previous month and current), we will need\n // to get some days from next month. We can do this naively though, since all months start on\n // the 1st.\n var daysRequiredFromNextMonth = 35 - daysArray.length;\n\n for (i = 1; i <= daysRequiredFromNextMonth; i++) {\n daysArray.push([i,cellColorForCurrentMonth]);\n }\n\n return daysArray.slice(0,35);\n }", "function previous(){\n if(dateInfo.currentMonth!=0){\n dateInfo.currentMonth--;\n }\n else{\n dateInfo.currentYear--;\n dateInfo.currentMonth=11;\n }\n while (calendar.firstChild) {calendar.removeChild(calendar.firstChild);}\n createCalendar();\n document.documentElement.scrollTop = 0;\n}", "function moveDate(para) {\n if (para == \"prev\") {\n dt.setMonth(dt.getMonth() - 1);\n renderDate();\n } else {\n (para == \"next\")\n dt.setMonth(dt.getMonth() + 1);\n }\n renderDate();\n // We use the renderDate function in here, because the moveDate function needs to have this reference because the other attributed from the calendar is declared inside this function. And eventhough the tuborg klamme had continued, we have not declared an onclick function in the prevDate and nextDate object constructor.\n}", "nextMonthComps() {\n if (this.month === 12) return {\n days: _daysInMonths[0],\n month: 1,\n year: this.year + 1,\n };\n return {\n days: (this.month === 2 && this.isLeapYear) ? 29 : _daysInMonths[this.month],\n month: this.month + 1,\n year: this.year,\n };\n }", "createDays() {\n var days = [];\n let gridTotal = 42;\n for ( let i = 0; i < gridTotal; i++ ) {\n // If this day is before current month\n if ( i < this.state.currentDayOffset ) {\n // Calculate days from end of previous month\n let daysToSubtract = this.state.currentDayOffset - i - 1;\n let previousMonthFormatted = this.state.previousMonth.format( 'MMMM' );\n let thisDate = this.getEndOfMonth( previousMonthFormatted, this.state.currentYear )\n .subtract( daysToSubtract, 'days' )\n .format( 'DD' );\n let thisDay = this.getEndOfMonth( previousMonthFormatted, this.state.currentYear )\n .subtract( daysToSubtract, 'days' )\n .format( 'ddd' );\n\n // Add inactive Day component to array and pass date info as props\n days.push( <Day key={ i }\n isActive={ false }\n thisDate={ parseInt( thisDate, 10 ) }\n thisDay={ thisDay } /> );\n } else if ( i >= this.state.currentDayOffset + this.state.daysInMonth ) { // If this day is after current month\n // Calculate days from start of next month\n let daysToAdd = ( i + 1 ) - ( this.state.currentDayOffset + this.state.daysInMonth );\n let thisDate = this.getEndOfMonth( this.state.currentMonth, this.state.currentYear )\n .add( daysToAdd, 'days' ).format( 'DD' );\n let thisDay = this.getEndOfMonth( this.state.currentMonth, this.state.currentYear )\n .add( daysToAdd, 'days' ).format( 'ddd' );\n\n // Add inactive Day component to array and pass date info as props\n days.push( <Day key={ i }\n isActive={ false }\n thisDate={ thisDate }\n thisDay={ thisDay } /> );\n } else { // These days fall within the current month\n // Calculate date and day of week\n let thisDate = ( i + 1 ) - this.state.currentDayOffset;\n let thisDay = Moment( thisDate + ' ' + this.state.currentMonth + ' ' + this.state.currentYear, 'DD MMMM YYYY' ).format( 'ddd' );\n\n // Add active Day component to array\n days.push( <Day key={ i }\n isActive={ true }\n thisDate={ thisDate }\n thisDay={ thisDay } /> );\n }\n }\n\n // Update state\n this.setState({ days: days });\n }", "nextClicked() {\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 }", "nextClicked() {\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 }", "function nextButton() {\n\tvar nextMonth = getNextMonth();\n\tdrawCalendar(nextMonth);\n }", "function cal_next()\n{\n if(curr_month < 11 )\n {\n curr_month = curr_month + 1;\n document.getElementById('curr_month').innerHTML = months[curr_month]+\", \"+curr_year;\n }\n else if(curr_month === 11)\n {\n curr_month = 0;\n curr_year = curr_year + 1;\n document.getElementById('curr_month').innerHTML = months[curr_month]+\", \"+curr_year;\n }\n // display_cal();\n}", "function previousDays( month, year ) {\n\t\t\t\t\n\t\t\t\tvar html = \"\", \n\t\t\t\t\tpreviousMonth, \n\t\t\t\t\tpreviousMonthYear,\n\t\t\t\t\tdaysInPreviousMonth;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// we need the month and year of the previous month.\n\t\t\t\t// eg: today: Jan 2012... then we need Dec 2011.\n\t\t\t\tif( month === 0 ) {\n\t\t\t\t\t\tpreviousMonth = 11;\n\t\t\t\t\tpreviousMonthYear = year - 1;\n\t\t\t\t} else {\n\t\t\t\t\t\tpreviousMonth = month - 1;\n\t\t\t\t\tpreviousMonthYear = year;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// store how many days were in the previous month\n\t\t\t\tdaysInPreviousMonth = Date.getDaysInMonth( previousMonthYear , previousMonth );\n\t\t\t\t\n\t\t\t\t// offset is the first day of the week (0=sunday, 1=monday, 2=tuesday...)\n\t\t\t\t// if the offset is 0 we actually want to count down from 7, because\n\t\t\t\t// we show sunday as the last day in the week, not the first.\n\t\t\t\tvar offset = new Date( year, month, 1 ).getDay();\n\t\t\t\tif (offset === 0) { offset = 7; }\n\t\t\t\t\n\t\t\t\t// count down from the offset to populate all days in previous month \n\t\t\t\tfor( o = offset-1; o > 0; o-- ) {\n\t\t\t\t\t\n\t\t\t\t\tvar oday = daysInPreviousMonth-o+1;\n\t\t\t\t\t//\n\t\t\t\t\thtml += \"<span class=\\\"ui-gdatepicker-day ui-gdatepicker-previous-month gdpd-\"+oday+\" gdpm-\"+previousMonth+\" gdpy-\"+previousMonthYear+\"\\\" data-day=\\\"\"+oday+\"\\\" data-year=\\\"\"+previousMonthYear+\"\\\" data-month=\\\"\"+previousMonth+\"\\\">\";\n\t\t\t\t\thtml += oday;\n\t\t\t\t\thtml += \"</span>\";\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn html;\n\t\t\t\t\t\n\t\t\t}", "function previousMonth(){\n\tclearCalendar();\n\tvar newMonth =\"\";\n\tvar newYear=0;\n\tif (displayedMonth == 0) {\n\t //console.log(\"IF! 0\");\n\t newMonth = 11;\n\t newYear = displayedYear - 1;\n \t displayedMonth = 11;\n \t displayedYear = displayedYear - 1;\n\t} else {\n\t //console.log(\"ELSE!\");\n\t newMonth = displayedMonth - 1;\n displayedMonth = displayedMonth - 1;\n newYear = displayedYear;\n\t}\n\t// console.log(\"newMonth: \" + newMonth);\n\t// console.log(\"newYear: \" + newYear);\n //console.log(\"displayedMonth: \" + displayedMonth);\n //console.log(\"displayedYear: \" + displayedYear);\n\tprintCalendar(newYear, newMonth);\n}", "function pre_nextMonth(month) {\n\tcurrent_month = parseInt(current_month) + parseInt(month);\n\t\n\t\n\tif(current_month > 11){\n\t\tcurrent_month = 0;\n\t\tcurrent_year+= parseInt(1);\n\t}\n\telse{\n\t\tif(current_month < 0){\n\t\t\tcurrent_month = 11;\n\t\t\tcurrent_year -= parseInt(1);\n\t\t}\n\t}\n\tcreateCalendar(current_month, current_year);\n}", "function nextMonth() {\n // -- add one month to the viewDate --/\n $directive.viewDate.setDate(1);\n $directive.viewDate.setMonth($directive.viewDate.getMonth() + 1);\n // -- reload the viewdate :P --/\n setViewDate($directive.viewDate);\n }", "function next(){\n month++;\n if(month==12){\n month=0;\n year++;\n }\n buildCalendar();\n}", "function nextMonth () {\n\tmonth = month + 1; // add one to current month\n\tremoveWeeks(); // remove calendar elements\n\tcreateCalendar(); // create new calendar elements\n\tchangeWeeksDisplay(\"flex\"); // show all weeks except model one (= view: month) \n\tdocument.getElementById(\"currentMonth\").innerHTML = months[month].name; // change displayed month name\n\taddDayClickEvent(); // add \"click\" event to new calendar days elements\n\taddWeekClickEvent(); // add \"click\" event to new calendar weeks elements\n}", "_getMonthCells(month, rightToLeft) {\n const weeks = month.getElementsByClassName('jqx-calendar-week');\n let days = [];\n\n //Get days instances.\n if (rightToLeft) {\n for (let w = 0; w < weeks.length; w++) {\n let weekDays = weeks[w].children;\n\n for (let d = weekDays.length - 1; d > 0; d--) {\n days.push(weekDays[d]);\n }\n }\n }\n else {\n for (let w = 0; w < weeks.length; w++) {\n let weekDays = weeks[w].children;\n\n for (let d = 1; d < weekDays.length; d++) {\n days.push(weekDays[d]);\n }\n }\n }\n\n return days;\n }", "function previousMonth(){\n // if(data.calendar.month != 11 || data.calendar.year == 2019){\n if(data.calendar.month == 0 && data.calendar.year == 2018) {\n return;\n }\n data.calendar.month--;\n // }\n if(data.calendar.month <= -1){\n data.calendar.month = 11;\n data.calendar.year--;\n }\n sessionStorage.setItem(\"year\", data.calendar.year);\n sessionStorage.setItem(\"month\", data.calendar.month);\n fillInCalendar();\n}", "function getEndOfPreMonth(date){\n\tvar year = date.getFullYear();\n var month = date.getMonth();\n if (month == 0) {\n \tyear -= 1;\n month = 11;\n }\n else {\n \tmonth -= 1;\n }\n var preMonth = new Date(year, month);\n var days = getDays(preMonth);\n var firstDayOfMonth = getFirstDayOfMonth(preMonth);\n var verbose = firstDayOfMonth;\n //var row = \"\";\n\tvar elements=[];\n\n for (var i = 1; i <= days; i++) {\n \t//row += \"<td class='pre'>\" + i + \"</td>\";\n\t\telements.push(Util.td(i, \"pre\", \"\"));\n\n if ((i + verbose) % 7 == 0) {\n \t//row = \"\";\n\t\t\telements=[];\n }\n }\n\treturn elements;\n}", "function monthDays(_m, _y) { return new Date(_y, _m + 1, 0).getDate(); }", "function addDaysFromNextMonth(){\n if(new Date(dateInfo.currentYear, dateInfo.currentMonth, monthInfo[dateInfo.currentMonth][1],0,0,0,0).getDay()!=6){\n var day = new Date(dateInfo.currentYear, dateInfo.currentMonth+1, 1,0,0,0,0).getDay();\n var j=1;\n for(i=day;i<=6;i++){\n createDayDiv(dateInfo.currentYear, dateInfo.currentMonth+1, j++);\n }\n }\n}", "function monthChange(btn){\n let newMonth = Toolbar.curTime.getMonth() + Number(btn.getAttribute(\"data-dir\"));\n let newYear = Toolbar.curTime.getFullYear();\n if(newMonth<0){\n newMonth = 11;\n newYear--;\n }\n else if(newMonth > 11){\n newMonth = 0;\n newYear++;\n }\n Toolbar.curTime.setMonth(newMonth);\n Toolbar.curTime.setFullYear(newYear);\n genDateTable();\n}", "handlePreviousMonth() {\n this.currentYear =\n this.currentMonth === 0 ? this.currentYear - 1 : this.currentYear;\n this.currentMonth = this.currentMonth === 0 ? 11 : this.currentMonth - 1;\n console.log(\n \"Handle Previous --> \" +\n this.currentMonth +\n \"this.currentYear\" +\n this.currentYear\n );\n const currMonth = this.monthsText[this.months[this.currentMonth]];\n this.currentMonthText = currMonth.charAt(0).toUpperCase() + currMonth.slice(1).toLowerCase();\n this.value = this.currentYear;\n this.options = [{ label: this.currentYear, value: this.currentYear }];\n this.showCalendar(1, this.currentMonth, this.currentYear);\n this.currentSelectedDate.length > 0 ? this.handleSelectedDate(this.currentSelectedDate) : '';\n }", "function month(){\n step=1.2;\n timeSelector=\"month\";\n resetGraph();\n}", "handleNextMonth() {\n this.currentYear =\n this.currentMonth === 11 ? this.currentYear + 1 : this.currentYear;\n this.currentMonth = (this.currentMonth + 1) % 12;\n console.log(\n \"Handle Next --> \" +\n this.currentMonth +\n \"this.currentYear\" +\n this.currentYear\n );\n const currMonth = this.monthsText[this.months[this.currentMonth]];\n this.currentMonthText = currMonth.charAt(0).toUpperCase() + currMonth.slice(1).toLowerCase();\n this.value = this.currentYear;\n this.options = [{ label: this.currentYear, value: this.currentYear }];\n this.showCalendar(1, this.currentMonth, this.currentYear);\n this.currentSelectedDate.length > 0 ? this.handleSelectedDate(this.currentSelectedDate) : '';\n }", "function addDaysFromPastMonth(){\n var startDay = getFirstSunday();\n if(startDay!=1){\n var numberOfDaysInPreviousMonth = getNumberOfDaysInPreviousMonth();\n while(startDay<=numberOfDaysInPreviousMonth){\n createDayDiv(dateInfo.currentYear, dateInfo.currentMonth-1, startDay);\n startDay++;\n }\n }\n}", "function fillDays() {\n var i;\n var calendarDays = document\n .getElementById(\"calendarTable\")\n .getElementsByTagName(\"tbody\")[0]\n .getElementsByClassName(\"day\");\n\n //get month -current month is April -so this got 3\n month = date.getMonth();\n console.log(month);\n //get year -current year is 2019\n year = date.getFullYear();\n console.log(year);\n var daysOffset = new Date(year, month, 1).getDay();\n console.log(daysOffset);\n var numberOfDays = new Date(year, month + 1, 0).getDate(); //0 for day gives last day of the PREVIOUS month\n console.log(numberOfDays);\n\n //clear cells\n for (i = 0; i < calendarDays.length; i++) {\n calendarDays[i].innerHTML = \"&nbsp\";\n }\n\n //populate cells with dates, 1-31\n for (i = 1; i <= numberOfDays; i++) {\n calendarDays[daysOffset].innerHTML = i;\n daysOffset++;\n }\n}", "function addDaysFromCurrentMonth(){\n for(var i=1;i<=monthInfo[dateInfo.currentMonth][1];i++){\n createDayDiv(dateInfo.currentYear, dateInfo.currentMonth, i);\n }\n}", "function getHeadOfNextMonth(date) {\n\tvar days = getDays(date);\n var firstDayOfMonth = getFirstDayOfMonth(date);\n var verbose = firstDayOfMonth;\n\tvar elements=[];\n var line = 0;\n\n for (var i = 1; i <= days; i++) {\n \tif ((i + verbose) % 7 == 0) {\n \tline++;\n }\n }\n\n var year = date.getFullYear();\n var month = date.getMonth();\n if (month == 11) {\n \tyear += 1;\n month = 0;\n }\n else {\n \tmonth += 1;\n }\n\n var nextMonth = new Date(year, month);\n var firstDayOfNextMonth = getFirstDayOfMonth(nextMonth);\n verbose = firstDayOfNextMonth;\n\n if (line == 5 || line == 4) {\n \tfor (var i = 1; i <= 7 - verbose; i++) {\n\t\t\telements.push(Util.td(i, \"next\", \"\"));\n }\n }\n\treturn elements;\n}", "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 }", "function insertNextMonth(thisMonthStarts){\r\n\tvar nextMonthStarts = (new Date(year, month, amountOfDays(year, month+1))).getDay()\r\n\tfor (let j = 0; j < amountOfCells - ( thisMonthStarts + amountOfDays ( year, month+1 )); j++){\r\n\t\tvar dayElement = document.createElement('div');\r\n\t\tdayElement.innerHTML = j+1;\r\n\t\tdayElement.style.color = \"var(--lighter-color)\"\r\n\t\tdocument.getElementById('month').appendChild(dayElement);\r\n\t}\r\n}", "function calNext()\n{\nnextdate= getCalValue();\nlocation.reload();\nsetSelectedMonth(1,nextdate);\n}", "function dateMonthBack(y) {\n\n var yb = 0; // assume same year\n var m = y.getMonth() - 1;\n if (m < 0) {\n m = 11;\n yb = 1; // we've gone back one year\n }\n var d = y.getDate();\n if (d >= 28) {\n var d0 = new Date(y.getFullYear(), ((y.getMonth() + 1) % 12), 0, 0, 0, 0); // date of last day in prev month\n var daysInCurrentMonth = d0.getDate();\n var d3 = new Date(y.getFullYear() - yb, y.getMonth(), 0, 0, 0, 0); // date() is number of days in month y.getMonth()\n var daysInPrevMonth = d3.getDate();\n if (d == daysInCurrentMonth || d >= daysInPrevMonth) { d = daysInPrevMonth; }\n }\n return new Date(y.getFullYear() - yb, m, d, 0, 0, 0);\n}", "function renderDaysOfMonth(month, year) {\n $('#currentMonth').text(d3CalendarGlobals.monthToDisplayAsText() + ' ' + d3CalendarGlobals.yearToDisplay());\n // We get the days for the month we need to display based on the number of times the user has pressed\n // the forward or backward button.\n var daysInMonthToDisplay = d3CalendarGlobals.daysInMonth();\n var cellPositions = d3CalendarGlobals.gridCellPositions;\n\n // All text elements representing the dates in the month are grouped together in the \"datesGroup\" element by the initalizing\n // function below. The initializing function is also responsible for drawing the rectangles that make up the grid.\n d3CalendarGlobals.datesGroup \n .selectAll(\"text\")\n .data(daysInMonthToDisplay)\n .attr(\"x\", function (d,i) { return cellPositions[i][0]; })\n .attr(\"y\", function (d,i) { return cellPositions[i][1]; })\n .attr(\"dx\", 20) // right padding\n .attr(\"dy\", 20) // vertical alignment : middle\n .attr(\"transform\", \"translate(\" + d3CalendarGlobals.gridXTranslation + \",\" + d3CalendarGlobals.gridYTranslation + \")\")\n .text(function (d) { return d[0]; }); // Render text for the day of the week\n\n d3CalendarGlobals.calendar\n .selectAll(\"rect\")\n .data(daysInMonthToDisplay)\n // Here we change the color depending on whether the day is in the current month, the previous month or the next month.\n // The function that generates the dates for any given month will also specify the colors for days that are not part of the\n // current month. We just have to use it to fill the rectangle\n .style(\"fill\", function (d) { return d[1]; }); \n\n }", "function setCellCalendar(shift, currentMonth) {\n var prevMonth = (currentMonth - 1);\n var shiftPrevMonth = shift - 1;\n var prevMonthDayValue = moment(moment([moment().format('YYYY'), prevMonth])).daysInMonth();\n // loop for prev month\n for (var i = shiftPrevMonth; i >= 0; i--) {\n var id = \"#cell_\" + i;\n $(id).text(prevMonthDayValue);\n prevMonthDayValue--;\n $(id).addClass('prev-month');\n }\n var interval = shift + moment(moment([moment().format('YYYY'), currentMonth])).daysInMonth();\n var currentMonthDayValue = 1;\n var lastCellIndex = 0;\n // loop for current month\n for (var j = shift; j < interval; j++) {\n var id = \"#cell_\" + j;\n lastCellIndex = j;\n $(id).text(currentMonthDayValue++);\n }\n var nextMonthDayValue = 1;\n // loop for next month\n for (var i = (lastCellIndex + 1); i <= countCellInCalendar; i++) {\n var id = \"#cell_\" + i;\n $(id).text(nextMonthDayValue++);\n $(id).addClass('next-month');\n }\n }", "function removeGreenColorOnNextDays()\n {\n $('.calendar .calendar-frame .current td').each(function(){\n if(parseInt(calendar_current_month) > parseInt(current_month))\n {\n $(this).addClass('next');\n }\n else if(parseInt($(this).text()) > parseInt(current_day) && parseInt(calendar_current_month) == parseInt(current_month))\n {\n $(this).addClass('next');\n }\n }) \n }", "function LastDayofMonth(month) { // starting from 1 <-- not JS DATE standard!!!\n\t\tvar numdays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\t\t\n\t\treturn numdays[month-1]; \t\t\n\t}", "function drawMonthView(month) {\n\t\t\t\t\tvar week,\n\t\t\t\t\t\tdayCur,\n\t\t\t\t\t\tday;\n\n\t\t\t\t\tcurMonth = month;\n\t\t\t\t\tdates = _h.calendarGenerator(month);\n\t\t\t\t\tdatesSplit = (dates.length === 42) ? _h.splitArr(dates, 6) : (dates.length === 28) ? _h.splitArr(dates, 4) : _h.splitArr(dates, 5);\n\n\t\t\t\t\tif (calGrid.firstChild) {\n\t\t\t\t\t\tcalGrid.innerHTML = '';\n\t\t\t\t\t}\n\n\t\t\t\t\tdates.forEach(function (itm, idx) {\n\t\t\t\t\t\t// Weeks\n\t\t\t\t\t\tif (idx === 0 || idx % 7 === 0) {\n\t\t\t\t\t\t\tweek = _h.createElem('div', 'week');\n\t\t\t\t\t\t\tcalGrid.appendChild(week);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Days\n\t\t\t\t\t\tday = _h.createElem('div', 'day', itm.getDate());\n\n\t\t\t\t\t\tif (!_h.compareMonths(itm, month)) {\n\t\t\t\t\t\t\tday.classList.add('day__out');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (_h.areDatesEqual(itm, curDay)) {\n\t\t\t\t\t\t\tday.classList.add('day__current');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (_h.isGreaterThan(itm, curDay)) {\n\t\t\t\t\t\t\tday.classList.add('sm-nodata-day');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tweek.appendChild(day);\n\t\t\t\t\t});\n\n\t\t\t\t\tdayCur = calGrid.querySelector('.day__current');\n\t\t\t\t\tif (dayCur && initial) {\n\t\t\t\t\t\tdayCur.parentElement.classList.add('week__current');\n\t\t\t\t\t\tindexObj.weekIdx = _h.getIndex(calGrid.querySelectorAll('.week'), calGrid.querySelector('.week__current'));\n\t\t\t\t\t\tcurWeekSave = indexObj.weekIdx;\n\t\t\t\t\t\tinitial = !initial;\n\t\t\t\t\t}\n\t\t\t\t\tdrawMonthSlider(month);\n\t\t\t\t}", "function insertPreviousMonth(prevDays, thisMonthStarts){\r\n\tfor (let j = 0; j < thisMonthStarts; j++){\r\n\t\tvar dayElement = document.createElement('div');\r\n\t\tdayElement.innerHTML = prevDays - thisMonthStarts + j+1;\r\n\t\tdayElement.style.color = \"var(--lighter-color)\"\r\n\t\tdocument.getElementById('month').appendChild(dayElement);\r\n\t}\r\n}", "function jumpToMonth(_show, _year, _month) {\n\t\tvar curr_m = flags.wrap.attr('data-current-month');\n\t\tvar curr_y = flags.wrap.attr('data-current-year');\n\t\tvar show = _show;\n\t\tif(!show){\n\t\t\ttry{\n\t\t\t\tif(Number(_year) == Number(curr_y) && Number(_month) == Number(curr_m)){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif(Number(_year) < Number(curr_y)){\n\t\t\t\t\tshow = 'prev';\n\t\t\t\t}else{\n\t\t\t\t\tif(Number(_month) < Number(curr_m)){\n\t\t\t\t\t\tshow = 'prev';\n\t\t\t\t\t}else{\n\t\t\t\t\t\tshow = 'next';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}catch(err){}\n\t\t}\n\t\t\n\t\tif (show == ('next')) {\n\t\t\tdateSlider(\"next\", _year, _month);\n\t\t\tvar lastMonthMove = '-=' + flags.directionLeftMove;\n\n\t\t} else {\n\t\t\tdateSlider(\"prev\", _year, _month);\n\t\t\tvar lastMonthMove = '+=' + flags.directionLeftMove;\n\t\t}\n\n\t\tflags.wrap.find('.eventsCalendar-monthWrap.oldMonth').animate({\n\t\t\topacity: eventsOpts.moveOpacity,\n\t\t\tleft: lastMonthMove\n\t\t}, eventsOpts.moveSpeed, function() {\n\t\t\tflags.wrap.find('.eventsCalendar-monthWrap.oldMonth').remove();\n\t\t});\n\t\t//showMessageBox();\n\t\tshowEvents();\n\t}", "handleDatePickerChange(e) {\n let [year, month] = e.detail.value.split('-')\n year = parseInt(year)\n month = parseInt(month)\n this.setData({ currYear: year, currMonth: month })\n const emptyGrids = this.calEmptyGrid(year, month)\n const days = this.calDays(year, month)\n this.setData({ emptyGrids, days })\n }", "function setDaysInCalendar() {\n for (let i = 1; i <= CurrentDaysInMonth; i++) {\n number[i].innerText = i\n }\n for (let i = 0; i < number.length; i++) {\n // remove attr from non-days\n if ($(number[i]).text() == \"-\") {\n $(number[i]).siblings().remove();\n $(number[i]).parent().attr({\"data-bs-toggle\" : \"\", \"data-bs-dismiss\" : \"\", \"data-bs-target\" : \"\"});\n }\n // add class today to the current day \n if (number[i].innerText == today.getDate()) {\n $(number[i]).parent().addClass(\"today\");\n }\n }\n }", "function getMonth(e) {\n import('./calendar.service.js').then((calendar) => {\n // Get new month from service.\n // renderMonth is called once when the script loads outside of an event handler,\n // so the first time it loads, e will be undefined. After that it'll come from\n // an event handler.\n if (e === undefined) {\n calendar.month.then(month => { renderMonth(month); });\n }\n else {\n // Shieldmeet only happens on a leap year, so we utilize the modulo to check this.\n if (e.target.id == \"next-month\") {\n calendar.nextMonth().then(month => {\n if (month.name == \"Shieldmeet\") {\n console.log('currentYear:', currentYear);\n if (currentYear.year % 4 != 0) {\n calendar.nextMonth().then(month => { renderMonth(month); });\n }\n else { renderMonth(month); }\n }\n else { renderMonth(month); }\n });\n }\n else {\n calendar.prevMonth().then(month => {\n if (month.name == \"Shieldmeet\") {\n if (currentYear.year % 4 != 0) {\n calendar.prevMonth().then(month => { renderMonth(month); });\n }\n else { renderMonth(month); }\n }\n else { renderMonth(month); }\n });\n \n }\n }\n \n });\n }", "clickLeftMonthDay(day) {\n const buttonEl = $(this.rootElement)\n .$$('table[role=grid]')[0]\n .$(`button=${day}`);\n if (buttonEl.isExisting()) buttonEl.click();\n }", "function fillCalendar() {\n // adds the dates of the current month to dateArray\n function fillCurrent() {\n for (let i = startDay; i < endDate + startDay; i++) {\n dateArray.push(i - startDay + 1)\n }\n }\n // creates an array of dates in the previous month, slices off a number of\n // indices equal to previousEndDate minus startDay in order to find the number\n // to add to the calendar cells, then adds them to the beginning of dateArray\n function fillPrevious() {\n const previousMonth = moment(currentDate).subtract(1, 'month');\n const previousEndDate = moment(previousMonth).endOf('month').date();\n const previousArray = [];\n for (let i = 0; i < previousEndDate; i++) {\n previousArray.push(i + 1);\n }\n const toAdd = previousArray.slice(previousEndDate - startDay)\n dateArray = toAdd.concat(dateArray)\n }\n // adds the next month's dates to the end of dateArray\n // up to a maximum equalling the total remaining cells;\n // extra numbers will not render on the page\n function fillNext() {\n const nextMonth = moment(currentDate).add(1, 'month');\n const nextStartDay = nextMonth.startOf('month').day();\n for (let i = nextStartDay; i < 14; i++) {\n dateArray.push(i - nextStartDay + 1)\n }\n \n }\n // iterates across the grid, replacing the text in each cell\n // with the numbers generated by the previous functions\n function populate() {\n for (let i = 0; i < 42; i++) {\n calendarCells[i].textContent = dateArray[i];\n }\n }\n // updates the month header thing\n function monthUpdate() {\n const monthField = document.querySelector('#month');\n monthField.textContent = moment(currentDate).format('MMMM')\n }\n\n fillCurrent()\n fillPrevious()\n fillNext()\n populate()\n monthUpdate()\n}", "getCalendarDays(_ref2) {\n let monthComps = _ref2.monthComps,\n prevMonthComps = _ref2.prevMonthComps,\n nextMonthComps = _ref2.nextMonthComps;\n const days = [];\n const firstDayOfWeek = monthComps.firstDayOfWeek,\n firstWeekday = monthComps.firstWeekday;\n const prevMonthDaysToShow = firstWeekday + (firstWeekday < firstDayOfWeek ? daysInWeek : 0) - firstDayOfWeek;\n let prevMonth = true;\n let thisMonth = false;\n let nextMonth = false; // Formatter for aria labels\n\n const formatter = new Intl.DateTimeFormat(this.id, {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric'\n }); // Init counters with previous month's data\n\n let day = prevMonthComps.days - prevMonthDaysToShow + 1;\n let dayFromEnd = prevMonthComps.days - day + 1;\n let weekdayOrdinal = Math.floor((day - 1) / daysInWeek + 1);\n let weekdayOrdinalFromEnd = 1;\n let week = prevMonthComps.weeks;\n let weekFromEnd = 1;\n let month = prevMonthComps.month;\n let year = prevMonthComps.year; // Store todays comps\n\n const today = new Date();\n const todayDay = today.getDate();\n const todayMonth = today.getMonth() + 1;\n const todayYear = today.getFullYear(); // Cycle through 6 weeks (max in month)\n\n for (let w = 1; w <= 6; w++) {\n // Cycle through days in week\n for (let i = 1, weekday = firstDayOfWeek; i <= daysInWeek; i++, weekday += weekday === daysInWeek ? 1 - daysInWeek : 1) {\n // We need to know when to start counting actual month days\n if (prevMonth && weekday === firstWeekday) {\n // Reset counters for current month\n day = 1;\n dayFromEnd = monthComps.days;\n weekdayOrdinal = Math.floor((day - 1) / daysInWeek + 1);\n weekdayOrdinalFromEnd = Math.floor((monthComps.days - day) / daysInWeek + 1);\n week = 1;\n weekFromEnd = monthComps.weeks;\n month = monthComps.month;\n year = monthComps.year; // ...and flag we're tracking actual month days\n\n prevMonth = false;\n thisMonth = true;\n } // Append day info for the current week\n // Note: this might or might not be an actual month day\n // We don't know how the UI wants to display various days,\n // so we'll supply all the data we can\n\n\n const date = new Date(year, month - 1, day);\n const id = this.format(date, 'YYYY-MM-DD');\n const weekdayPosition = i;\n const weekdayPositionFromEnd = daysInWeek - i;\n const isToday = day === todayDay && month === todayMonth && year === todayYear;\n const isFirstDay = thisMonth && day === 1;\n const isLastDay = thisMonth && day === monthComps.days;\n const onTop = w === 1;\n const onBottom = w === 6;\n const onLeft = i === 1;\n const onRight = i === daysInWeek;\n days.push({\n id,\n label: day.toString(),\n ariaLabel: formatter.format(date),\n day,\n dayFromEnd,\n weekday,\n weekdayPosition,\n weekdayPositionFromEnd,\n weekdayOrdinal,\n weekdayOrdinalFromEnd,\n week,\n weekFromEnd,\n month,\n year,\n date,\n dateTime: date.getTime(),\n isToday,\n isFirstDay,\n isLastDay,\n inMonth: thisMonth,\n inPrevMonth: prevMonth,\n inNextMonth: nextMonth,\n onTop,\n onBottom,\n onLeft,\n onRight,\n classes: [`id-${id}`, `day-${day}`, `day-from-end-${dayFromEnd}`, `weekday-${weekday}`, `weekday-position-${weekdayPosition}`, `weekday-ordinal-${weekdayOrdinal}`, `weekday-ordinal-from-end-${weekdayOrdinalFromEnd}`, `week-${week}`, `week-from-end-${weekFromEnd}`, {\n 'is-today': isToday,\n 'is-first-day': isFirstDay,\n 'is-last-day': isLastDay,\n 'in-month': thisMonth,\n 'in-prev-month': prevMonth,\n 'in-next-month': nextMonth,\n 'on-top': onTop,\n 'on-bottom': onBottom,\n 'on-left': onLeft,\n 'on-right': onRight\n }]\n }); // See if we've hit the last day of the month\n\n if (thisMonth && isLastDay) {\n thisMonth = false;\n nextMonth = true; // Reset counters to next month's data\n\n day = 1;\n dayFromEnd = nextMonthComps.days;\n weekdayOrdinal = 1;\n weekdayOrdinalFromEnd = Math.floor((nextMonthComps.days - day) / daysInWeek + 1);\n week = 1;\n weekFromEnd = nextMonthComps.weeks;\n month = nextMonthComps.month;\n year = nextMonthComps.year; // Still in the middle of the month (hasn't ended yet)\n } else {\n day++;\n dayFromEnd--;\n weekdayOrdinal = Math.floor((day - 1) / daysInWeek + 1);\n weekdayOrdinalFromEnd = Math.floor((monthComps.days - day) / daysInWeek + 1);\n }\n } // Append week days\n\n\n week++;\n weekFromEnd--;\n }\n\n return days;\n }", "getCalendarDays(_ref2) {\n let monthComps = _ref2.monthComps,\n prevMonthComps = _ref2.prevMonthComps,\n nextMonthComps = _ref2.nextMonthComps;\n const days = [];\n const firstDayOfWeek = monthComps.firstDayOfWeek,\n firstWeekday = monthComps.firstWeekday;\n const prevMonthDaysToShow = firstWeekday + (firstWeekday < firstDayOfWeek ? daysInWeek : 0) - firstDayOfWeek;\n let prevMonth = true;\n let thisMonth = false;\n let nextMonth = false; // Formatter for aria labels\n\n const formatter = new Intl.DateTimeFormat(this.id, {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric'\n }); // Init counters with previous month's data\n\n let day = prevMonthComps.days - prevMonthDaysToShow + 1;\n let dayFromEnd = prevMonthComps.days - day + 1;\n let weekdayOrdinal = Math.floor((day - 1) / daysInWeek + 1);\n let weekdayOrdinalFromEnd = 1;\n let week = prevMonthComps.weeks;\n let weekFromEnd = 1;\n let month = prevMonthComps.month;\n let year = prevMonthComps.year; // Store todays comps\n\n const today = new Date();\n const todayDay = today.getDate();\n const todayMonth = today.getMonth() + 1;\n const todayYear = today.getFullYear(); // Cycle through 6 weeks (max in month)\n\n for (let w = 1; w <= 6; w++) {\n // Cycle through days in week\n for (let i = 1, weekday = firstDayOfWeek; i <= daysInWeek; i++, weekday += weekday === daysInWeek ? 1 - daysInWeek : 1) {\n // We need to know when to start counting actual month days\n if (prevMonth && weekday === firstWeekday) {\n // Reset counters for current month\n day = 1;\n dayFromEnd = monthComps.days;\n weekdayOrdinal = Math.floor((day - 1) / daysInWeek + 1);\n weekdayOrdinalFromEnd = Math.floor((monthComps.days - day) / daysInWeek + 1);\n week = 1;\n weekFromEnd = monthComps.weeks;\n month = monthComps.month;\n year = monthComps.year; // ...and flag we're tracking actual month days\n\n prevMonth = false;\n thisMonth = true;\n } // Append day info for the current week\n // Note: this might or might not be an actual month day\n // We don't know how the UI wants to display various days,\n // so we'll supply all the data we can\n\n\n const date = new Date(year, month - 1, day);\n const id = this.format(date, 'YYYY-MM-DD');\n const weekdayPosition = i;\n const weekdayPositionFromEnd = daysInWeek - i;\n const isToday = day === todayDay && month === todayMonth && year === todayYear;\n const isFirstDay = thisMonth && day === 1;\n const isLastDay = thisMonth && day === monthComps.days;\n const onTop = w === 1;\n const onBottom = w === 6;\n const onLeft = i === 1;\n const onRight = i === daysInWeek;\n days.push({\n id,\n label: day.toString(),\n ariaLabel: formatter.format(date),\n day,\n dayFromEnd,\n weekday,\n weekdayPosition,\n weekdayPositionFromEnd,\n weekdayOrdinal,\n weekdayOrdinalFromEnd,\n week,\n weekFromEnd,\n month,\n year,\n date,\n dateTime: date.getTime(),\n isToday,\n isFirstDay,\n isLastDay,\n inMonth: thisMonth,\n inPrevMonth: prevMonth,\n inNextMonth: nextMonth,\n onTop,\n onBottom,\n onLeft,\n onRight,\n classes: [`id-${id}`, `day-${day}`, `day-from-end-${dayFromEnd}`, `weekday-${weekday}`, `weekday-position-${weekdayPosition}`, `weekday-ordinal-${weekdayOrdinal}`, `weekday-ordinal-from-end-${weekdayOrdinalFromEnd}`, `week-${week}`, `week-from-end-${weekFromEnd}`, {\n 'is-today': isToday,\n 'is-first-day': isFirstDay,\n 'is-last-day': isLastDay,\n 'in-month': thisMonth,\n 'in-prev-month': prevMonth,\n 'in-next-month': nextMonth,\n 'on-top': onTop,\n 'on-bottom': onBottom,\n 'on-left': onLeft,\n 'on-right': onRight\n }]\n }); // See if we've hit the last day of the month\n\n if (thisMonth && isLastDay) {\n thisMonth = false;\n nextMonth = true; // Reset counters to next month's data\n\n day = 1;\n dayFromEnd = nextMonthComps.days;\n weekdayOrdinal = 1;\n weekdayOrdinalFromEnd = Math.floor((nextMonthComps.days - day) / daysInWeek + 1);\n week = 1;\n weekFromEnd = nextMonthComps.weeks;\n month = nextMonthComps.month;\n year = nextMonthComps.year; // Still in the middle of the month (hasn't ended yet)\n } else {\n day++;\n dayFromEnd--;\n weekdayOrdinal = Math.floor((day - 1) / daysInWeek + 1);\n weekdayOrdinalFromEnd = Math.floor((monthComps.days - day) / daysInWeek + 1);\n }\n } // Append week days\n\n\n week++;\n weekFromEnd--;\n }\n\n return days;\n }", "function preButton(){\n\tvar preMonth = getPreMonth();\n\tdrawCalendar(preMonth);\n}", "function nextMonth(){\n\tclearCalendar();\n\tvar newMonth =\"\";\n\tvar newYear=0;\n\tif (displayedMonth == 11) {\n\t newMonth = 0;\n\t newYear = displayedYear + 1;\n \t displayedMonth = 0;\n \t displayedYear = displayedYear + 1;\n\t} else {\n\t newMonth = displayedMonth+ 1;\n \t displayedMonth = displayedMonth + 1;\n newYear = displayedYear;\n\t}\n\t//console.log(\"newMonth: \" + newMonth);\n\t//console.log(\"newYear: \" + newYear);\n\t//console.log(\"displayedMonth: \" + displayedMonth);\n\t//console.log(\"displayedYear: \" + displayedYear);\n\tprintCalendar(newYear, newMonth);\n}", "resetDate(e){\n //e.preventDefault();\n //GridLayout.greet()\n var months = [\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"June\",\"July\",\"Aug\",\"Sept\",\"Oct\",\"Nov\",\"Dec\"];\n var day = (new Date())\n var month = day.getMonth();\n var year = day.getFullYear();\n console.error(months[month]+\" \"+year)\n this.setState(prevState=>({\n month:month,\n year:year\n }))\n }", "_navigateDays(event) {\n const that = this;\n let iterations = event.key === 'ArrowUp' || event.key === 'ArrowDown' ? 7 : 1,\n coefficient = event.key === 'ArrowUp' || event.key === 'ArrowLeft' || event.key === 'PageUp' ? -1 : 1;\n\n switch (event.key) {\n case 'ArrowUp':\n case 'ArrowLeft':\n case 'ArrowDown':\n case 'ArrowRight':\n if (!that._handleArrowKeys(event, iterations, coefficient)) {\n return;\n }\n\n break;\n case ' ':\n case 'Enter':\n if (that.displayMode !== 'month') {\n\n that._displayModeHandler(that.displayModeView === 'list' ? that.$.listViewContainer.getItem(that.$.listViewContainer.selectedValues[0]) : that._focusedCell);\n return;\n }\n\n break;\n case 'Control':\n case 'Shift':\n if (that.selectionMode === 'default') {\n that._keysPressed[event.key] = true;\n }\n\n return;\n case 'Home':\n case 'End': {\n //Prevent window scrolling\n event.preventDefault();\n\n let targetDate,\n getTargetMonthDay = function (days) {\n if (event.key === 'Home') {\n for (let d = 0; d < days.length; d++) {\n if (!days[d].otherMonth && (!days[d].disabled || !days[d].restricted)) {\n return days[d];\n }\n }\n }\n else {\n for (let d = days.length - 1; d >= 0; d--) {\n if (!days[d].otherMonth && (!days[d].disabled || !days[d].restricted)) {\n return days[d];\n }\n }\n }\n };\n\n if (that.displayMode !== 'month') {\n targetDate = getTargetMonthDay(that.$.dateViewContainer.children);\n }\n else {\n targetDate = getTargetMonthDay(that._getMonthCells(that._focusedCell.closest('.jqx-calendar-month'), that.rightToLeft));\n }\n\n if (!targetDate) {\n return;\n }\n\n that._focusCell(targetDate);\n\n if (that.displayMode !== 'month') {\n return;\n }\n\n break;\n }\n case 'PageUp':\n case 'PageDown': {\n if (!that._handlePageUpDownKeys(event, coefficient)) {\n return;\n }\n\n break;\n }\n default:\n return;\n }\n\n if (that._focusedCell) {\n that._handleDateSelection(that._focusedCell);\n }\n }", "function next(){\n if(dateInfo.currentMonth!=11){\n dateInfo.currentMonth++;\n }\n else{\n dateInfo.currentYear++;\n dateInfo.currentMonth=0;\n }\n while (calendar.firstChild) {calendar.removeChild(calendar.firstChild);}\n createCalendar();\n document.documentElement.scrollTop = 0; \n}", "function beginingOfMonth (currentDay, currentDayName) {\n $.each(daysNames, function(key, value) { \n if (key == currentDayName) {\n positionOfCurrentDay = value;\n }\n });\n\n var supportValue = positionOfCurrentDay - (currentDay - 1);\n\n if (positionOfCurrentDay < currentDay) {\n firstDayOfMnthPosition = 7 + supportValue % 7;\n } else {\n firstDayOfMnthPosition = supportValue;\n }\n }", "function NumberDayShow(){\n var date = new Date(\"\"+dataCalendar.year+\"-\"+(monthIndex+1)+\"-01\"); \n return NumberDay(date.getDay())-1;//nombre de jour à afficher\n}", "renderDateGrid(dateObj) {\n // We basing all the calculations with Sunday being 0, Monday = 1 etc\n\n const gridBody = document.querySelector('#dateGrid');\n\n if(typeof(gridBody) != 'undefined' && gridBody != null){\n while (gridBody.firstChild) {\n gridBody.removeChild(gridBody.firstChild);\n }\n } else{\n console.log('Element does not exist!');\n }\n\n const start = parseInt(dateObj.startOfMonth, 10); \n let dayCounter = parseInt(dateObj.daysInMonth, 10);\n let runningTotal = 0;\n let dateTotal = 1;\n let maxRows = 0;\n\n // To determine how many rows, based on start of month and how many days in the month\n if (dayCounter > 30 && start >= 5) {\n maxRows = 6;\n } else if (dayCounter >= 30 && start >= 6) {\n maxRows = 6;\n } \n else {\n maxRows = 5;\n }\n\n // Here is the meet of the grid, where we do our calculation based on Moment data\n for (let i = 0; i < maxRows; i++) {\n const row = document.createElement('tr');\n gridBody.appendChild(row);\n \n for (let j = 0; j < 7; j++) {\n const cell = document.createElement('td');\n\n if (runningTotal < start) {\n cell.classList.add('not_in_month');\n runningTotal++;\n } else if (dateTotal <= dayCounter) {\n cell.classList.add('in_month');\n\n cell.textContent = dateTotal;\n cell.addEventListener('click', event => {\n let day = cell.textContent;\n console.log(day, 'hello');\n this.calcBookingDate(dateObj, day);\n popBack.classList.remove('displayBlock');\n popBack.classList.add('displayNone');\n });\n dateTotal++;\n } else {\n cell.classList.add('not_in_month');\n }\n \n row.appendChild(cell);\n \n // to break to next row\n if (j > 6) {\n break;\n }\n }\n }\n }", "function handleNextClick() {\n if(view === 'month') {\n setYear(year + 1);\n return; \n }\n\n if(view === 'year') {\n setYear(year + YEARS_SHOW);\n return;\n }\n\n const previousMont = getNextMonth(month, year);\n setMonth(previousMont.month);\n\n if(previousMont.year === year) return;\n setYear(previousMont.year);\n }", "clickPrevMonthButton() {\n $(this.rootElement)\n .$$('button[data-id=button-icon-element]')[0]\n .click();\n }", "clickPrevMonthButton() {\n $(this.rootElement)\n .$$('button[data-id=button-icon-element]')[0]\n .click();\n }", "next() {\n let {month} = this.state;\n this.setState({\n month: month.add(1, 'month'),\n });\n }", "function daysInMonth(year,month) {\n return new Date(year, month + 1, 0).getDate();\n }", "function nextMonth() {\n month++;\n if (month > 11) {\n alert('Sei arrivato alla fine del calendario.');\n month = 11;\n } else {\n printMonth(month);\n addHolidays(month);\n }\n }", "daysInMonth(month,year) {\n return new Date(year,month+1,0).getDate();\n }", "_moveToFromStep() {\n let [month] = get(this, '_dates') || Ember.A();\n if (month) {\n var startOfMonth = new Date(month.getFullYear(), month.getMonth(), 1);\n set(this, 'currentMonth', startOfMonth);\n }\n set(this, 'isToStep', false);\n }", "function fillNext() {\n const nextMonth = moment(currentDate).add(1, 'month');\n const nextStartDay = nextMonth.startOf('month').day();\n for (let i = nextStartDay; i < 14; i++) {\n dateArray.push(i - nextStartDay + 1)\n }\n \n }", "function nextDate() {\n var year = x.getFullYear();\n var month = x.getMonth();\n if (month == 12) {\n month = 0;\n year += 1;\n }\n x = new Date(year, (month + 1), 1);\n displayDates();\n}", "M (date) {\n return date.getMonth() + 1\n }", "function forwardMonth(){\n toMonth=globalMonth.nextMonth();\n $( document ).ready(load);\n}", "calculateDates(date) {\n const dateFormat = moment(date, 'MMMM YYYY');\n\n const dateObj = {\n startOfMonth : dateFormat.startOf('month').format('d'), \n daysInMonth : dateFormat.daysInMonth(),\n month: dateFormat.format('MMMM'),\n year: dateFormat.format('YYYY')\n };\n\n this.renderDateGrid(dateObj);\n }", "function bsDpickerSetPrevNextMonth(step) {\n let currentMonth = currentSelectedDate.getMonth();\n currentMonth += step;\n currentSelectedDate.setMonth(currentMonth);\n bsDatepick.datepicker(\"update\", currentSelectedDate);\n selectMonths.selectpicker(\"val\", currentSelectedDate.getMonth());\n selectYears.selectpicker(\"val\", currentSelectedDate.getFullYear());\n}", "function getStartDay(){\n daysInMonth = days[setCal.month];\n startDay = setCal.day - 1;\n }", "function addMoreEvents() {\r\n\tdocument.getElementById(\"month\").onclick = function(e) {\r\n\t\te = e || event\r\n\t\tvar target = e.target || e.srcElement\r\n\t\t// variable target has your clicked element\r\n\t\tif (target.nodeName == \"TD\") {\r\n\t\t\tvar dayNum = parseInt(target.innerHTML, 10);\r\n\t\t\tdisplayDate = new Date(selectYear + \"-\" + twoDigit(selectMonth+1) + \"-\" + twoDigit(dayNum));\r\n\t\t\tinitialiseDay();\r\n\t\t}\r\n\t}\r\n\tdocument.getElementById(\"next\").onclick = function() {\r\n\t\tif (displayingDay) {\r\n\t\t\tdisplayDate.setDate(displayDate.getDate() + 1);\t\r\n\t\t\tif (displayDate.getDate()==1) {\t\t// if have moved into next month,\r\n\t\t\t\tselectDate = displayDate;\r\n\t\t\t\tinitialiseCalendar();\t\t\t// also update the month calendar\r\n\t\t\t}\t\t\t\t\r\n\t\t\tinitialiseDay();\t\t\t\t\t\r\n\t\t} else {\r\n\t\t\tvar x = firstOfMonth.getMonth();\r\n\t\t\tselectDate = new Date(firstOfMonth.setMonth(firstOfMonth.getMonth()+1));\r\n\t\t\tx = selectDate.getMonth();\r\n\t\t\tinitialiseCalendar();\r\n\t\t}\r\n\t}\r\n\tdocument.getElementById(\"previous\").onclick = function() {\r\n\t\tif (displayingDay) {\r\n\t\t\tif (displayDate.getDate()==1) {\t\t// if moving back to previous month,\r\n\t\t\t\tdisplayDate.setDate(displayDate.getDate() - 1);\t\r\n\t\t\t\tselectDate = displayDate;\r\n\t\t\t\tinitialiseCalendar();\t\t\t// also update the month calendar\r\n\t\t\t} else {\r\n\t\t\t\tdisplayDate.setDate(displayDate.getDate() - 1);\t\r\n\t\t\t}\r\n\t\t\tinitialiseDay();\r\n\r\n\t\t} else {\r\n\t\t\tvar x = firstOfMonth.getMonth();\r\n\t\t\tselectDate = new Date(firstOfMonth.setMonth(firstOfMonth.getMonth()-1));\r\n\t\t\tinitialiseCalendar();\r\n\t\t}\r\n\t}\r\n\tdocument.getElementById(\"returnToMonth\").onclick = function() {\r\n\t\tdocument.getElementById(\"day\").style.display = \"none\";\r\n\t\tdocument.getElementById(\"returnToMonth\").innerHTML = \"\";\r\n\t\tdocument.getElementById(\"canvas\").style.display = \"block\";\r\n\t\tdocument.getElementById(\"color-fade\").style.display = \"block\";\r\n\t\tdocument.getElementById(\"year\").innerHTML = months[selectMonth] + \" \" + selectYear;\r\n\t\tdisplayingDay = false;\r\n\t}\t\r\n}", "function generateNextMonth(currentYear){\n\n\tcalendar.empty();\n\tcurrentMonthIndex++;\n\tif(currentMonthIndex >= 9 && currentMonthIndex <=12)\n\t\tyearIndex = currentYear-1;\n\n\telse if(currentMonthIndex > 12) {\n\t\tcurrentMonthIndex = 1;\n\t\tyearIndex = currentYear;\n\t}\n\t\telse\n\t\t\tyearIndex = currentYear;\n\n\tvar calObjt = createCalendar(currentMonthIndex, yearIndex);\n\tvar rowDays = generateDayRow();\n\tdocument.getElementById(\"calendar-month-year\").innerHTML = month_name[currentMonthIndex-1]+\" \"+yearIndex;\n\tdocument.getElementById(\"calendar-dates\").appendChild(rowDays); \n\tdocument.getElementById(\"calendar-dates\").appendChild(calObjt);\n\thighlightDateWithEvent(currentMonthIndex);\n}", "writePastMonth() {\n const clone = this.currentMonthFirstDay.clone();\n const dayOfWeek = clone.weekday();\n\n // move for the correct day of the previous month\n clone.subtract(dayOfWeek + 1, 'days');\n\n // iterate on the remaining days of last month and plot then\n for (let i = dayOfWeek; i > 0; i -= 1) {\n this.writeDay(clone.add(1, 'days'));\n }\n }", "function fillPrevious() {\n const previousMonth = moment(currentDate).subtract(1, 'month');\n const previousEndDate = moment(previousMonth).endOf('month').date();\n const previousArray = [];\n for (let i = 0; i < previousEndDate; i++) {\n previousArray.push(i + 1);\n }\n const toAdd = previousArray.slice(previousEndDate - startDay)\n dateArray = toAdd.concat(dateArray)\n }", "_getCellByDate(date, monthContainer) {\n const that = this;\n\n if (!(date instanceof Date)) {\n return;\n }\n\n if (!monthContainer) {\n monthContainer = that.$.monthsContainer;\n }\n\n if (that.displayMode !== 'month') {\n if (that.displayModeView === 'list') {\n return;\n }\n\n let items = arguments[1] ? that.$.nextMonthsContainer.children : that.$.dateViewContainer.children;\n\n for (let i = 0; i < items.length; i++) {\n if (that.displayMode === 'year') {\n if (items[i].value.getMonth() === date.getMonth()) {\n return items[i];\n }\n\n continue;\n }\n else if (items[i].value.getFullYear() === date.getFullYear()) {\n return items[i];\n }\n }\n\n return;\n }\n\n let ownerMonth,\n monthCells,\n months = monthContainer.children;\n\n for (let i = 0; i < months.length; i++) {\n if (date.getFullYear() === months[i]._date.getFullYear() && date.getMonth() === months[i]._date.getMonth()) {\n ownerMonth = months[i];\n break;\n }\n }\n\n if (!ownerMonth) {\n return;\n }\n\n monthCells = that._getMonthCells(ownerMonth);\n\n for (let i = 0; i < monthCells.length; i++) {\n if (monthCells[i].otherMonth && !monthCells[i].hover) {\n continue;\n }\n\n if (monthCells[i].value.getMonth() === date.getMonth() && monthCells[i].value.getDate() === date.getDate()) {\n return monthCells[i];\n }\n }\n }", "showCalendar(date, month, year) {\n this.dates = [];\n const today = new Date(year, month, date);\n const todayDate = new Date();//today's date\n\n //get date of 30 days from now\n const future = new Date();//today's date\n future.setDate(future.getDate() + 30);\n console.log('30 days from now === '+future);\n const start = new Date(today.getFullYear(), today.getMonth(), 1);\n //console.log('Start Date Of Month --> '+start);\n const end = new Date(today.getFullYear(), today.getMonth() + 1, 0);\n //console.log('End Date Of Month --> '+end.getDate());\n const firstDayOfMonth = start.getDay();\n const lastDayOfMonth = end.getDay();\n //console.log('First Date Of Month --> '+firstDayOfMonth);\n // Last date of the previous month\n const lastDayOfLastMonth = today.getMonth() === 0 ? \n new Date(today.getFullYear()-1, 1, 0).getDate() : \n new Date(today.getFullYear() , today.getMonth(), 0).getDate();\n //console.log('Last Date Of Last Month --> '+lastDayOfLastMonth);\n //get day of current date\n let temp = lastDayOfLastMonth - firstDayOfMonth+1;\n console.log(\"temp-->\"+temp);\n //logic for previous values\n for(let prevdates = temp; prevdates<=lastDayOfLastMonth; prevdates++){\n //create date format \n let dateVar = this.formatDateForArray(temp, month===0?11:month-1, month === 0 ? year-1: year);\n this.dates.push({text:temp, className : 'disabled', key: temp+Math.random(), formatted:dateVar});\n temp++;\n }\n\n //logic for current values\n for(var index = 1; index<=end.getDate(); index++){\n //get today's formatted date\n const todayFormattedDate = this.formatDateForArray(todayDate.getDate(), todayDate.getMonth(), todayDate.getFullYear());\n let dateVar = this.formatDateForArray(index, month, year);\n let dateInstance = new Date(year, month, index);\n \n if(dateInstance.getTime() > todayDate.getTime() && dateInstance.getTime() <= future.getTime()){\n this.dates.push({text:index, className : CONSTANTS.ENABLED, key:index+Math.random(), formatted:dateVar});\n }else{\n if(dateVar === todayFormattedDate){\n if (this.currentSelectedDate == dateVar) {\n this.dates.push({text:index, className : 'selected-date todays-date', key:index+Math.random(), formatted:dateVar});\n //fire an event to set payoff date variable in Parent comp\n const selectedEvent = new CustomEvent(\"seldate\", {\n detail: {\n selectedDateInChild: this.currentSelectedDate\n }\n });\n // Dispatches the event.b\n this.dispatchEvent(selectedEvent);\n } else {\n this.dates.push({text:index, className : 'todays-date', key:index+Math.random(), formatted:dateVar});\n }\n }else{\n this.dates.push({text:index, className : CONSTANTS.DISABLED, key:index+Math.random(), formatted:dateVar});\n }\n \n }\n }\n //logic for next month values\n var temp2 = 6-lastDayOfMonth;\n for(var index=1; index<=temp2; index++){ \n let className = '';\n let dateVar = this.formatDateForArray(index, month===11?0:month+1, month===11?year+1:year);\n let dateInstance = new Date(month===11?year+1:year, month===11?0:month+1, index);\n if(dateInstance.getTime() > todayDate.getTime() && dateInstance.getTime() <= future.getTime()){\n this.dates.push({text:index, className : CONSTANTS.ENABLED, key: index+Math.random(), formatted:dateVar});\n }else{\n this.dates.push({text:index, className : CONSTANTS.DISABLED, key: index+Math.random(), formatted:dateVar});\n }\n \n }\n console.log('this.dates-->'+JSON.stringify(this.dates));\n \n\n }", "function nextMonth(){\n if(data.calendar.month != 11 || data.calendar.year == 2018 || data.calendar.year == 2019){\n data.calendar.month++;\n }\n if(data.calendar.month >= 12){\n data.calendar.month = 0;\n data.calendar.year++;\n }\n sessionStorage.setItem(\"year\", data.calendar.year);\n sessionStorage.setItem(\"month\", data.calendar.month);\n fillInCalendar();\n}" ]
[ "0.6835745", "0.6595409", "0.65933484", "0.6583589", "0.64852077", "0.6473222", "0.644993", "0.64374924", "0.64237547", "0.64189696", "0.6401385", "0.63944346", "0.63944346", "0.63845456", "0.63840914", "0.6323784", "0.62878793", "0.6270032", "0.6215791", "0.62087804", "0.6162635", "0.6147275", "0.6119909", "0.6115033", "0.6095923", "0.60930026", "0.60873586", "0.60739887", "0.60684526", "0.60562074", "0.60516906", "0.60516906", "0.6032257", "0.6012788", "0.6006226", "0.59928584", "0.5982292", "0.5974455", "0.5974324", "0.59613997", "0.5958289", "0.59573543", "0.594218", "0.5925482", "0.5910188", "0.5904748", "0.5896449", "0.589154", "0.58907574", "0.58894783", "0.5869703", "0.58591735", "0.5853188", "0.58521664", "0.5845669", "0.58418673", "0.5823536", "0.5821476", "0.58208793", "0.5809563", "0.5808462", "0.5784092", "0.57840586", "0.57819784", "0.5777888", "0.5774131", "0.576623", "0.5762225", "0.57612324", "0.57610494", "0.57610494", "0.57514554", "0.57430124", "0.57422924", "0.57405525", "0.5734532", "0.5720653", "0.5714886", "0.57133526", "0.5712705", "0.5710731", "0.5710731", "0.57084936", "0.5707475", "0.5704316", "0.5700638", "0.569054", "0.5684888", "0.5674213", "0.56740487", "0.56673574", "0.56665415", "0.56614363", "0.5656679", "0.56511366", "0.56463575", "0.5645589", "0.5640346", "0.56390744", "0.5624975", "0.56210476" ]
0.0
-1
A day from the current month
function Day(day) { if(validDateWeek(day)) this.type = "day"; else this.type = "fill"; this.day = day; this.dayOfMonth = day.getDate(); if(day.getDate() == new Date().getDate() && day.getMonth() == new Date().getMonth() && day.getFullYear() == new Date().getFullYear()){ this.isToday = true; } else{ this.isToday = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findCurrentDayInMonth(){\n let day = currentDate.getDate();\n console.log(\"current day is\",day);\n return day;\n}", "function monthDay() {\n return doFormat(date, {\n month: 'long',\n day: 'numeric'\n });\n }", "getDayOfTheMonth(){\n let dayOfTheMonth;\n dayOfTheMonth = this.date.getDate();\n return dayOfTheMonth;\n }", "function DiM (month) {\n var Y = new Date().getFullYear();\n return new Date(Y, month, 0).getDate();\n}", "function getCurrentMonth() {\r\n\t\tvar d = new Date();\r\n\t\treturn d.getMonth() + 1;\r\n\t}", "default () {\n return (new Date()).getMonth() // this month\n }", "function currentDay(){\r\n\tconst months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\r\n\tconst days = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\r\n\tconst time = new Date();\r\n\t\r\n\treturn `${days[time.getDay()]},${time.getDate()} ${months[time.getMonth()]}`\r\n}", "function daysInCurrentMonth() {\n var currentDate = new Date();\n return new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0).getDate();\n}", "function setCal(yyyy, mm) {\n let today = new Date(yyyy + '-' + mm)\n today = new Date(yyyy, mm, 0);\n console.log(today.getDate());\n}", "M (date) {\n return date.getMonth() + 1\n }", "function getCurrentDay () {\n\t\tvar today = new Date();\n\t\tvar dd = today.getDate();\n\t\t return dd;\n }", "function getCurrentDay() {\n\tconst event = new Date(Date.now());\n\tconst options = { year: \"numeric\", month: \"long\", day: \"numeric\" };\n\tlet currentDay = event.toLocaleDateString(undefined, options);\n\n\t$(\"#currentDay\").text(\"Today's Date: \" + currentDay);\n}", "function daysInTheMonth(yyyy, mm) {\n return new Date(yyyy, mm+1, 0).getDate();\n }", "function daysInMonth(year,month) {\n return new Date(year, month + 1, 0).getDate();\n }", "function getMonth(){\n\t//var d = new Date();\n\treturn currentMonth;\n}", "function monthDays(_m, _y) { return new Date(_y, _m + 1, 0).getDate(); }", "function getCurrentDate (mon, day) {\n let full_date = new Date(mon);\n full_date.setDate(full_date.getDate() + day);\n let date = getShortDate(full_date);\n return date[0];\n}", "function daysInMonth(thisMonthDay, year)\n {\n return new Date(year, thisMonthDay, 0).getDate();\n }", "function first_day_of_month(year, month) {\n return new Date(year, month, 1);\n}", "function getToday() {\n // function addLeadingZeros (n, length){\n return dateFormatx('id',lpadZero(dd,2),monthFormat(mm),yyyy);\n }", "function currentDate(){\n var month = new Array();\n month[0] = \"January\";\n month[1] = \"February\";\n month[2] = \"March\";\n month[3] = \"April\";\n month[4] = \"May\";\n month[5] = \"June\";\n month[6] = \"July\";\n month[7] = \"August\";\n month[8] = \"September\";\n month[9] = \"October\";\n month[10] = \"November\";\n month[11] = \"December\";\n\n var today = new Date();\n var dd = today.getDate();\n var month = month[today.getMonth()]; //January is 0!\n var yyyy = today.getFullYear();\n if(dd<10) {\n dd='0'+dd;\n }\n today = month+' '+dd+', '+yyyy;\n return today;\n }", "function mydate() {\n var today = new Date();\n var date = today.getDate();\n console.log(date);\n}", "function daysInMonth(year, month) {\r\n return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();\r\n }", "static daysInMonth(year, month) {\n return new Date(year, month + 1, 0).getDate();\n }", "function get1stDayOfMonth(date){\r\n\t\t\treturn new Date(date).getDay();\r\n\t\t}", "daysInMonth(month,year) {\n return new Date(year,month+1,0).getDate();\n }", "MM (date) {\n return pad(date.getMonth() + 1)\n }", "function getdayone(curdate) {\n var nd = new Date(curdate);\n var mon = nd.getMonth() + 1;\n var yr = nd.getFullYear();\n\n return new Date(yr, mon - 1, 1);\n\n}", "function getDate(){\r\n\r\nvar today = new Date()\r\n\r\nvar option = {\r\n weekday : 'long',\r\n day : 'numeric',\r\n month : 'long'\r\n}\r\nvar day = today.toLocaleDateString('en-US', option)\r\nreturn day\r\n}", "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 }", "function daysInMonth(month,year) {\n return new Date(year, month + 1, 0).getDate();\n }", "function getCurrentDay() {\n var returnDate;\n date = new Date();\n if (date.getDay() === 0) {\n returnDate = 6;\n } else {\n returnDate = date.getDay() - 1;\n }\n return returnDate;\n}", "function dayOfTheWeekInTheMonth(yyyy, mm) {\n return new Date(yyyy, mm, 1).getDay();\n }", "d (date) {\n return date.getDay()\n }", "function day(date) { return `${date.getDate()}`.padStart(2, '0') }", "function currentDate() {\n const today = new Date();\n const currDate = today.getDate();\n const currMonth = getMonthName(today.getMonth());\n const currYear = today.getUTCFullYear();\n const suffixArray = [\"st\", \"nd\", \"rd\", \"th\"];\n let suffix = suffixArray[3];\n if (currDate === 1 || currDate === 21 || currDate === 31) {\n suffix = suffixArray[0];\n } else if (currDate === 2 || currDate === 22) {\n suffix = suffixArray[1];\n } else if (currDate === 3 || currDate === 23) {\n suffix = suffixArray[2];\n }\n let date = currDate + suffix + ' of ' + currMonth + ' ' + currYear;\n return date;\n}", "function daysInMonth (month, year) { \n return new Date(year, month, 0).getDate(); \n }", "function days_in_month(month, year) {\n return new Date(year, month + 1, 0).getDate();\n}", "function getToday(){\n var year = new Date();\n year = year.getFullYear();\n\n var month = new Date();\n month = month.getUTCMonth() + 1;\n if (month < 10) {\n month = \"0\" + month;\n }\n\n var day = new Date();\n day = day.getUTCDate();\n if (day < 10) {\n day = \"0\" + day;\n }\n\n var date = year + \"-\" + month + \"-\" + day;\n console.log(date);\n return date;\n}", "function month(date) {\n let monthName = date.getMonth() -1;\n console.log(calendar[monthName]);\n}", "function daysInMonth(month,year) {\n return new Date(year, month, 0).getDate();\n }", "getDaysInMonth(month, year = 2020) { return (new Date(year, month, 0).getDate()); }", "function getDay(){\n\treturn day;\n}", "function daysInMonth(month,year) {\n return new Date(year, month, 0).getDate();\n }", "function daysInMonth(month,year) {\n return new Date(year, month, 0).getDate();\n }", "function addDaysFromCurrentMonth(){\n for(var i=1;i<=monthInfo[dateInfo.currentMonth][1];i++){\n createDayDiv(dateInfo.currentYear, dateInfo.currentMonth, i);\n }\n}", "daysInMonth() {\n // Check for February in a leap year\n if (this.month === 2 && this.isLeapYear) return 29;\n // ...Just a normal month\n return _daysInMonths[this.monthIndex];\n }", "function current_date() {\n today = new Date();\n var mmm = today.getMonth();\n var dd = today.getDate();\n var yyyy = today.getFullYear();\n\n if (dd < 10) dd = '0' + dd;\n if (mmm == 0) mmm = 'JAN';\n if (mmm == 1) mmm = 'FEB';\n if (mmm == 2) mmm = 'MAR';\n if (mmm == 3) mmm = 'APR';\n if (mmm == 4) mmm = 'MAY';\n if (mmm == 5) mmm = 'JUN';\n if (mmm == 6) mmm = 'JUL';\n if (mmm == 7) mmm = 'AUG';\n if (mmm == 8) mmm = 'SEP';\n if (mmm == 9) mmm = 'OCT';\n if (mmm == 10) mmm = 'NOV';\n if (mmm == 11) mmm = 'DEC';\n\n return (mmm + '-' + dd + '-' + yyyy)\n\n}", "function firstDayOfMonth(date) {\n return new Date(date.getFullYear(), date.getMonth(), 1)\n }", "function getMonthAndDate() {\n const date = new Date();\n const month = (date.getMonth() + 1) < 10 ? (`0${date.getMonth() + 1}`) : (date.getMonth() + 1);\n const day = date.getDate();\n return month + day;\n}", "function getDate(){\n\t\t\t\n\t\t\tvar now = new Date();\n\t\t\tvar month = (now.getMonth() + 1); \n\t\t\tvar day = now.getDate();\n\t\t\tif (month < 10) \n\t\t\t\tmonth = \"0\" + month;\n\t\t\tif (day < 10) \n\t\t\t\tday = \"0\" + day;\n\t\t\tvar today = now.getFullYear() + '-' + month + '-' + day;\n\t\t\t\n\t\t\treturn today;\n\t\t\t\n\t\t}", "function getToday() {\n\n var now = new Date();\n return yyyymmdd = now.getFullYear() + '-' +\n ( \"0\"+(now.getMonth() + 1)).slice(-2) + '-' +\n ( \"0\"+now.getDate() ).slice(-2);\n}", "function getDay(){\n\t//var d = new Date();\t\t\n\treturn d.getDay();\n}", "function daysInMonth(year, month) {\n\tlet test = new Date(year, month, 0).getDate();\n\treturn test; \n}", "getDate() {\n return new Date(1900 + this.year, this.month - 1);\n }", "function daysInMonth(year, month) {\n return new Date(year, month, 0).getDate();\n }", "function currentDate() {\r\n const today = new Date(); \r\n const nullBeforeMonth = today.getMonth() <= 9 ? '0' : '' \r\n const nullBeforeDay = today.getDate() <= 9 ? '0' : '' \r\n const date = nullBeforeDay + today.getDate() + '.' + nullBeforeMonth + (today.getMonth() + 1) + '.' + today.getFullYear();\r\n return date\r\n }", "function CurrentDate(){\n var today = new Date();\n var dd = today.getDate();\n var mm = today.getMonth()+1;\n var yyyy = today.getFullYear();\n if(dd<10){dd='0'+dd}\n if(mm<10){mm='0'+mm}\n today = mm+'/'+dd+'/'+yyyy;\n return today\n }", "function getMonth() {\r\n var months = [\r\n \"Janeiro\",\r\n \"Fevereiro\",\r\n \"Março\",\r\n \"Abril\",\r\n \"Maio\",\r\n \"Junho\",\r\n \"Julho\",\r\n \"Agosto\",\r\n \"Setembro\",\r\n \"Outubro\",\r\n \"Novembro\",\r\n \"Dezembro\"\r\n ];\r\n return (\r\n months[moment(vm.selectedDate).format(\"MM\") - 1] +\r\n \"/\" +\r\n moment(vm.selectedDate).format(\"YYYY\")\r\n );\r\n }", "function dateForToday() {\n return new Date().toMidnight();\n}", "function todaysDate() {\n currDay = new Date;\n var dd = currDay.getDate();\n var mm = currDay.getMonth() + 1;\n var yyyy = currDay.getFullYear();\n if (mm < 10) {\n mm = \"0\" + mm;\n }\n return yyyy+'/'+mm+'/'+dd;\n }", "function fillBegin(month,year){\n var date = new Date(month+\"/01/\"+year);\n var firstDay = new Date(date.getFullYear(), date.getMonth(), 1);\n console.log(firstDay.getDay());\n return firstDay.getDay();\n}", "function getMonth() {\n var string = this._day.getMonth();\n switch(parseInt(this._day.getMonth(), 10)) {\n case 1:\n string = 'janvier';\n break;\n case 2:\n string = 'février';\n break;\n case 3:\n string = 'mars';\n break;\n case 4:\n string = 'avril';\n break;\n case 5:\n string = 'mai';\n break;\n case 6:\n string = 'juin';\n break;\n case 7:\n string = 'juillet';\n break;\n case 8:\n string = 'aout';\n break;\n case 9:\n string = 'septembre';\n break;\n case 10:\n string = 'octobre';\n break;\n case 11:\n string = 'novembre';\n break;\n case 12:\n string = 'décembre';\n break;\n }\n\n return string;\n }", "function getDayofToday() {\n const d = new Date();\n const weekday = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n return weekday[d.getDay()];\n }", "function getStartDay(){\n daysInMonth = days[setCal.month];\n startDay = setCal.day - 1;\n }", "function daysInMonth(m,y){\n return 32 - new Date(y,m,32).getDate();\n}", "monthof(m) { \n switch (m) {\n case 1: return 31;\n break;\n case 2: return 28;\n break;\n case 3: return 31;\n break;\n case 4: return 30;\n break;\n case 5: return 31;\n break;\n case 6: return 30;\n break;\n case 7: return 31;\n break;\n case 8: return 31;\n break;\n case 9: return 30;\n break;\n case 10: return 31;\n break;\n case 11: return 30;\n break;\n case 12: return 31;\n break;\n\n }\n }", "function Calendar_switchMonth(month) {\n\tthis.dtCurrentDate.setMonth(month, 1);\t\t\t\t// reset day to 1\n\tthis.dtStartDay = new Date(this.dtCurrentDate);\n}", "function lastDayOfMonth(date) {\n return new Date(date.getFullYear(), date.getMonth() + 1, 0)\n }", "function myDate(){\r\n let today = new Date();\r\n let dd = String(today.getDate()).padStart(2, '0');\r\n let mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!const yyyy = today.getFullYear();\r\n let yyyy = today.getFullYear();\r\n \r\n let day = mm + '/' + dd + '/' + yyyy;\r\n document.getElementById(\"#date\").innerHTML = day;\r\n }", "function getDay() {\n return ''+ this._day.getDay();\n }", "function daysInMonth(month, year) {\n return new Date(year, month, 0).getDate();\n }", "function getMonthFromDate(date) {\n return date.getMonth() + 1;\n}", "function daysInMonth(y, m) {\r\n var date = new Date();\r\n date.setDate(1);\r\n date.setFullYear(y);\r\n date.setMonth(m); // month after what we want (months start at 0 in js)\r\n date.setDate(0);\r\n return date.getDate();\r\n }", "function getDate(){\r\nvar today=new Date();//used to get the current date\r\n\r\n\r\n var options ={\r\n weekday:\"long\",\r\n day: \"numeric\",\r\n month :\"long\"\r\n };\r\n\r\n\r\n var day=today.toLocaleDateString(\"en-US\",options);//this extract the dte inthe format mentioned in the object option\r\n return day;\r\n}", "getCurrentMonth() {\n const current = new Date().getMonth();\n console.log(current, 'this is currentMonth')\n let newCurrent = current + 1\n if (newCurrent < 10) {\n newCurrent = '0' + newCurrent;\n }\n this.setState({\n currentMonth: newCurrent\n });\n }", "function getCurrentDateForFormSeach(){\n var date = new Date();\n month = date.getMonth();\n year = date.getFullYear();\n\n month++;\n //preciso formatar para o fullcalendar\n if(month <= 9)\n month = \"0\"+month;\n\n $(\"#dt_mes\").val(month).trigger(\"change\");\n $(\"#dt_ano\").val(year).trigger(\"change\");\n}", "function today() {\n return new Date();\n }", "generateMonth(){\n const d = new Date();\n let listOfMonth = new Array(12);\n listOfMonth[0] = \"January\"\n listOfMonth[1] = \"February\"\n listOfMonth[2] = \"March\"\n listOfMonth[3] = \"April\"\n listOfMonth[4] = \"May\"\n listOfMonth[5] = \"June\"\n listOfMonth[6] = \"July\"\n listOfMonth[7] = \"August\"\n listOfMonth[8] = \"September\"\n listOfMonth[9] = \"October\"\n listOfMonth[10] = \"November\"\n listOfMonth[11] = \"December\"\n const currentMonth = listOfMonth[d.getMonth()]\n return currentMonth;\n }", "function getDayMonth(time) {\n const unixTimestamp = time;\n\n const milliseconds = unixTimestamp * 1000;\n\n const dateObject = new Date(milliseconds);\n\n const day = dateObject.getDate();\n\n const month = dateObject.getMonth();\n\n //Make sure when it hit's January, the month is set to [1] instead of [0]\n if (month === 0) {\n return `1/${day}`;\n }\n\n return `${month}/${day}`;\n}", "function setCurrentDate () {\n const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };\n document.querySelector(\"#current-date\").innerHTML = new Date().toLocaleDateString('en-GB', options);\n}", "function showMonth(date){\nlet dateInput = new Date(2017, 6, 19) // June 19, 2017\nmonth(date) // returns \"June\"\n}", "function currentDay(){\n return getWeekday(new Date().getDay())\n}", "function daysInMonth(month,year) {\n\t return new Date(year, month, 0).getDate();\n\t}", "function getDate() {\n\nlet today = new Date();\nlet options = {\n weekday: \"long\",\n day: \"numeric\",\n month: \"long\"\n};\n\nlet day = today.toLocaleDateString(\"en-Us\", options);\n\n\n//returns day in us format, such as \"Tuesday, 12 february\"\nreturn day;\n\n}", "function daysInMonth() {\n var e = document.getElementById('numMonth').selectedIndex;\n switch (e) {\n case 2:\n {\n if (isLeap()) {\n numDays(29);\n } else numDays(28);\n break;\n }\n case 4:\n case 6:\n case 9:\n case 11:\n {\n numDays(30);\n break;\n }\n default:\n {\n numDays(31);\n break;\n }\n }\n}", "jalaliToDay(jYear, jMonth, jDay) {\r\n let r = this.jalCal(jYear);\r\n return this.gregorianToDay(r.gy, 3, r.march) + (jMonth - 1) * 31 - div(jMonth, 7) * (jMonth - 7) + jDay - 1;\r\n }", "static lastDayOfMonth(month, year) {\n return new Date(year, month + 1, 0).getDate();\n }", "function day(date, month, year) {\n d = date;\n m = month;\n y = year;\n y0 = y - parseInt((14 - m) / 12);\n x = (y0 + parseInt(y0 / 4) - parseInt(y0 / 100) + parseInt(y0 / 400));\n m0 = m + 12 * parseInt((14 - m) / 12) - 2;\n d0 = ((d + x + parseInt(31 * m0 / 12)) % 7);\n array = ['Sunday', 'Monday', 'tuesday', 'wednsday', 'thursday', 'friday', 'saturday'];\n console.log(array[d0]);\n return \"\";\n}", "function getFirstDay(){\n\t//var d = new Date();\n\tvar year = currentYear;\n\tvar month = currentMonth;\t\n\tvar date = new Date(year, month, 1);\n\treturn date.getDay();\n}", "function currentDate(){\nvar today = new Date();\nvar day = today.getDate();\nvar month = today.getMonth()+1; \nvar year = today.getFullYear();\nif(day<10) \n{\n day='0'+dd;\n} \n\nif(month<10) \n{\n month='0'+month;\n} \ntoday = month + '-' + day + '-' + year;\nalert(today);\ntoday = month + '/' + day + '/' + year;\nalert(today);\ntoday = day + '-' + month + '-' + year;\nalert(today);\ntoday = day + '/' + month + '/' + year;\nalert(today);\n}", "function getFechaActual(){\r\n\t\tvar fecha= new Date();//obtengo la fecha del dispositivo\r\n\t\t\r\n\t\tvar mes=parseInt(fecha.getMonth())+1;\r\n\t\tvar cadenaFecha= fecha.getDate()+'/'+mes+'/'+ fecha.getFullYear();\r\n\t\treturn cadenaFecha;\r\n\t}", "getCurrentMonth() {\n const current = new Date().getMonth();\n let newCurrent = current + 1\n if (newCurrent < 10) {\n newCurrent = '0' + newCurrent;\n }\n this.setState({\n currentMonth: newCurrent\n });\n }", "function getDay(date) {\n return getDateTime(date).substring(0, 10);\n}", "function currentDate(){\n let today = new Date();\n const dd = String(today.getDate()).padStart(2, '0');\n const mm = String(today.getMonth() + 1).padStart(2, '0'); //Acrescenta um pois janeiro é 0\n const yyyy = today.getFullYear();\n\n today = yyyy + '-' + mm + '-' + dd;\n\n return today;\n}", "function daysInMonth(year, month) {\n month++;\n return new Date(year, month, 0).getDate();\n }", "function days_in_month(month, year) {\n return new Date(year, month, 0).getDate();\n}", "function monthUpdate() {\n const monthField = document.querySelector('#month');\n monthField.textContent = moment(currentDate).format('MMMM')\n }", "function getToday() {\nlet today = new Date();\nlet dd = today.getDate();\nlet mm = today.getMonth()+1;\nconst yyyy = today.getFullYear();\nif(dd<10) {dd=`0${dd}`;}\nif(mm<10) {mm=`0${mm}`;}\nreturn `${yyyy}-${mm}-${dd}`;\n}", "function LastDayofMonth(month) { // starting from 1 <-- not JS DATE standard!!!\n\t\tvar numdays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\t\t\n\t\treturn numdays[month-1]; \t\t\n\t}", "function daysInMonth(month,year) {\n\t return new Date(year, month, 0).getDate();\n\t}" ]
[ "0.77977735", "0.749841", "0.694612", "0.6912491", "0.6885996", "0.68562734", "0.68249285", "0.67991513", "0.67844594", "0.6759236", "0.6714634", "0.65998226", "0.65794307", "0.6551553", "0.6517213", "0.65166897", "0.6419557", "0.639618", "0.63886636", "0.63886315", "0.63873994", "0.63666373", "0.63634485", "0.6339371", "0.6334562", "0.6330914", "0.63290584", "0.6327499", "0.6273837", "0.62584776", "0.6244299", "0.62006533", "0.6199423", "0.61739457", "0.6169184", "0.6168385", "0.6161899", "0.61547375", "0.6151808", "0.6149689", "0.6144555", "0.6120776", "0.6116261", "0.610412", "0.610412", "0.6095183", "0.60833454", "0.60778075", "0.60639536", "0.605836", "0.60548824", "0.60509026", "0.6050295", "0.6038712", "0.603856", "0.6038089", "0.60379064", "0.6034304", "0.6027496", "0.6024491", "0.60228413", "0.6017461", "0.6017192", "0.6007812", "0.60076684", "0.6000594", "0.59986854", "0.5998461", "0.5998323", "0.59924483", "0.5989326", "0.59888226", "0.59835887", "0.5982643", "0.5975248", "0.5973156", "0.5973122", "0.5972105", "0.5961159", "0.5959097", "0.595231", "0.5951599", "0.5950431", "0.5950049", "0.59486306", "0.5943476", "0.5943029", "0.59415", "0.5939424", "0.5936181", "0.5931268", "0.5923295", "0.59224766", "0.59219754", "0.5919189", "0.591802", "0.59169495", "0.59136224", "0.59130883", "0.59054434", "0.58933157" ]
0.0
-1
this method is called when your extension is deactivated
function deactivate() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deactivate() {\n\tconsole.log('关闭扩展')\n}", "function deactivate() {\n example.deactivate();\n console.log(`Extension(${example.name}) is deactivated.`);\n}", "function deactivateExtension() {\n Privly.options.setInjectionEnabled(false);\n updateActivateStatus(false);\n}", "function deactivate() {\n extension.nbLine = null;\n extension.editor = null;\n extension.deco.clear();\n extension.deco = null;\n cache_manager_1.default.clearCache();\n}", "function deactivate() {\n console.log(\"deactivating HL7Tools extension\");\n exports.deactivate = deactivate;\n}", "OnDeactivated() {}", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }", "function deactivate() { }" ]
[ "0.8011084", "0.7815618", "0.7768406", "0.76137966", "0.7570413", "0.75452274", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675", "0.73553675" ]
0.0
-1
Clear the contents of the MappedDisposable. Disposables keyed to objects are not disposed of.
clear(){ if(this.disposed) return; this.disposables.clear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearObjects() {\n setMapOnAll(null);\n}", "clearAndClose() {\n this.tensorMap.forEach(value => value.dispose());\n this.tensorMap.clear();\n this.handle.dispose();\n }", "clear() {\n var map = this._map;\n var keys = Object.keys(map);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n map[key].clear();\n }\n }", "clear() {\n const _ = this;\n _._map.clear();\n _._nameSet.clear();\n }", "clear() {\n this.map = {};\n if (this.store) this.store.clear();\n }", "dispose() {\n this._detachMapMoveHandlers();\n this._options = null;\n this._spyMap = null;\n this._primaryMap = null;\n }", "clear() {\n log.map(\"Clearing the map of all the entries\");\n this._map.clear();\n }", "dispose() {\n this._isDisposed = true;\n for (const d of this._disposables) {\n d.dispose();\n }\n this._disposables.length = 0;\n }", "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': Map ? new Map : [],\n\t 'string': new Hash\n\t };\n\t }", "clearSilent() {\n let me = this;\n\n me._items.splice(0, me.getCount());\n me.map.clear();\n }", "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n }", "dispose() {\n this._observers = null;\n this._cursor = null;\n }", "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash(),\n\t 'map': Map ? new Map() : [],\n\t 'string': new Hash()\n\t };\n\t}", "function deleteObjects() {\n clearObjects();\n mapObjects = [];\n}", "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': Map ? new Map : [],\n\t 'string': new Hash\n\t };\n\t}", "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': Map ? new Map : [],\n\t 'string': new Hash\n\t };\n\t}", "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': Map ? new Map : [],\n\t 'string': new Hash\n\t };\n\t}", "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': Map ? new Map : [],\n\t 'string': new Hash\n\t };\n\t}", "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': Map ? new Map : [],\n\t 'string': new Hash\n\t };\n\t}", "function mapClear() {\n\t this.__data__ = {\n\t 'hash': new Hash,\n\t 'map': Map ? new Map : [],\n\t 'string': new Hash\n\t };\n\t}", "function mapClear() {\n this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash };\n }", "function mapClear() {\n this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash };\n }", "function mapClear() {\n this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash };\n }", "destroy () {\n\t\tthis.disposables.dispose()\n\t\tthis.classRanges.clear()\n\t\tthis.methodRanges.clear()\n\t\tthis.classMapping.clear()\n\t\tthis.methodMapping.clear()\n\t}", "clear() {\n {\n for ( let tensor of this.tensors.values() ) {\n tensor.dispose();\n }\n this.tensors.clear();\n }\n\n {\n for ( let numberImage of this.images.values() ) {\n numberImage.disposeResources_and_recycleToPool();\n }\n this.images.clear();\n }\n }", "function mapClear() {\n\t this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash };\n\t}", "function mapCacheClear() {\n\tthis.size = 0;\n\tthis.__data__ = {\n\t\thash: new _Hash(),\n\t\tmap: new ( _Map || _ListCache )(),\n\t\tstring: new _Hash(),\n\t};\n}", "clear() {\n this._objects = {};\n }", "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n}", "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n}", "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n}", "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n}", "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n}", "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n}", "function mapClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': Map ? new Map : [],\n 'string': new Hash\n };\n}", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new _Hash,\n 'map': new (_Map || _ListCache),\n 'string': new _Hash\n };\n }", "function mapCacheClear() {\n\t\t this.size = 0;\n\t\t this.__data__ = {\n\t\t 'hash': new Hash,\n\t\t 'map': new (Map || ListCache),\n\t\t 'string': new Hash\n\t\t };\n\t\t}", "function mapClear(){this.__data__={'hash':new Hash(),'map':Map?new Map():[],'string':new Hash()};}", "function mapClear(){this.__data__={'hash':new Hash(),'map':Map?new Map():[],'string':new Hash()};}", "function mapClear(){this.__data__={'hash':new Hash(),'map':Map?new Map():[],'string':new Hash()};}", "clear() {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index];\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'));\n }\n else {\n const k = this.#keyList[index];\n if (this.#hasDispose) {\n this.#dispose?.(v, k, 'delete');\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, 'delete']);\n }\n }\n }\n this.#keyMap.clear();\n this.#valList.fill(undefined);\n this.#keyList.fill(undefined);\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0);\n this.#starts.fill(0);\n }\n if (this.#sizes) {\n this.#sizes.fill(0);\n }\n this.#head = 0;\n this.#tail = 0;\n this.#free.length = 0;\n this.#calculatedSize = 0;\n this.#size = 0;\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed;\n let task;\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task);\n }\n }\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new _Hash(),\n 'map': new (_Map || _ListCache)(),\n 'string': new _Hash()\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new _Hash.default(),\n 'map': new (_Map.default || _ListCache.default)(),\n 'string': new _Hash.default()\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n hash: new Hash(),\n map: new (Map || ListCache)(),\n string: new Hash(),\n };\n }", "function clear()\r{\r\tvar end = mapping_names.length;\r\r\tfor(var i=end-1; i>=0; i--){\r\t\tremove(mapping_names[i]);\r\t}\r\twhile(mapping_names.pop());\r\twhile(mapping_sources.pop());\r\twhile(mapping_destinations.pop());\r\twhile(mapping_algorithms.pop());\r}", "function mapCacheClear() {\n\t\t this.__data__ = {\n\t\t 'hash': new Hash,\n\t\t 'map': new (Map || ListCache),\n\t\t 'string': new Hash\n\t\t };\n\t\t}", "function mapCacheClear() {\n\t\t this.__data__ = {\n\t\t 'hash': new Hash,\n\t\t 'map': new (Map || ListCache),\n\t\t 'string': new Hash\n\t\t };\n\t\t}", "function ClearMap() {\n map.entities.clear();\n max_score = 0;\n pins = {};\n}", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n hash: new Hash(),\n map: new (Map || ListCache)(),\n string: new Hash(),\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash(),\n 'map': new (Map || ListCache)(),\n 'string': new Hash()\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash(),\n 'map': new (Map || ListCache)(),\n 'string': new Hash()\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash(),\n 'map': new (Map || ListCache)(),\n 'string': new Hash()\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash(),\n 'map': new (Map || ListCache)(),\n 'string': new Hash()\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash(),\n 'map': new (Map || ListCache)(),\n 'string': new Hash()\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash(),\n 'map': new (Map || ListCache)(),\n 'string': new Hash()\n };\n }", "clear() {\n this.canvas.clear();\n for (const id in this.imagesMapping) {\n delete this.imagesMapping[id];\n }\n this.imagesMapping = {};\n }", "function mapCacheClear() {\n\t this.size = 0;\n\t this.__data__ = {\n\t 'hash': new _Hash(),\n\t 'map': new (_Map || _ListCache)(),\n\t 'string': new _Hash()\n\t };\n\t}", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map$1 || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map$1 || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n hash: new Hash(),\n map: new (Map || ListCache)(),\n string: new Hash()\n };\n }", "clearobjectmap() {\n\n if (this.internal.objectmap===null)\n return;\n \n this.deleteoldobjectmap();\n this.informToRender();\n this.internal.cmapcontroller.removeobjectmap();\n this.internal.objectmaptransferinfo={ showcolorbar : false, 'colormode' : 'Objectmap' };\n this.drawtext();\n this.updateImageChangedObservers('overlay');\n this.needsrendering=true;\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }", "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }" ]
[ "0.70600116", "0.68788904", "0.66818184", "0.6596393", "0.6539745", "0.6482883", "0.6376435", "0.6275623", "0.626515", "0.6254403", "0.6252425", "0.6252425", "0.6252425", "0.6252425", "0.6252425", "0.6252425", "0.6252425", "0.6252425", "0.6252425", "0.6248486", "0.6231537", "0.62294084", "0.62205666", "0.62205666", "0.62205666", "0.62205666", "0.62205666", "0.62205666", "0.6198061", "0.6198061", "0.6198061", "0.61518043", "0.6123982", "0.6110967", "0.60851115", "0.60587394", "0.6046387", "0.6046387", "0.6046387", "0.6046387", "0.6046387", "0.6046387", "0.6046387", "0.6037835", "0.60368407", "0.60322106", "0.60322106", "0.60322106", "0.60294193", "0.60286814", "0.6024241", "0.6021833", "0.6017239", "0.60138214", "0.60138214", "0.60100496", "0.6006012", "0.5999734", "0.5999734", "0.5999734", "0.5999734", "0.59995216", "0.59995216", "0.5987406", "0.598675", "0.59832877", "0.59832877", "0.5982185", "0.59804434", "0.5978968", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406", "0.5978406" ]
0.6888086
1
Remove all patterns and values held in the instance.
clear(){ const patterns = instancePatterns.get(this); patterns.clear(); super.clear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static purgeSettings() {\n for (const value of GM_listValues()) {\n GM_deleteValue(value);\n }\n }", "clear()\n {\n this._keywordByFilter.clear();\n this._simpleFiltersByKeyword.clear();\n this._complexFiltersByKeyword.clear();\n this._compiledPatternsByKeyword.clear();\n this._keywordlessCompiledPatterns = false;\n this._filterDomainMapsByKeyword.clear();\n this._filterMapsByType.clear();\n }", "clean() {\n this.clear();\n }", "removeAll() {\r\n\t\t\tthis.remove();\r\n\t\t}", "function clean()\t{\n\tmyName = null;\n\tmyType = null;\n\tmyMin = null;\n\tmyMax = null;\n\twhile (items.length > 0)\t{\n\t\tthis.patcher.remove(items.shift());\n\t}\n}", "removeAll() {\n this._removeAll();\n }", "removeAll() {\n\t\tfor (const key of Object.keys(this.cards)) { this.cards[key].df = null; }\n\t\tthis.cards = {}; this.multiple = []; this.ctrlDelete = []; this.tabs = null;\n }", "_clear() {\n\t\t\tthis._style = null;\n\t\t\tthis._color = null;\n\t\t\tthis._rgb = null;\n\t\t\tthis._hsl = null;\n\t\t\tthis._gradType = null;\n\t\t\tthis._gradParams = null;\n\t\t\tthis._gradColors = [];\n\t\t\tthis._gradBsCache = null;\n\t\t}", "clear() {\n const me = this,\n removed = me._values.slice();\n\n if (me.totalCount) {\n me._values.length = 0;\n\n if (me._filteredValues) {\n me._filteredValues.length = 0;\n }\n\n me._indicesInvalid = true; // Indicate to observers that data has changed.\n\n me.generation++;\n me.trigger('change', {\n action: 'clear',\n removed\n });\n }\n }", "static RemoveAll() {}", "clean() {\n let clone = {};\n Object.assign(clone, this);\n\n for (const i in clone) {\n if (typeof clone[i] === 'undefined') {\n delete clone[i];\n }\n }\n\n return clone;\n }", "removeAll() {\n this.nodes.forEach(node => node.parentNode.removeChild(node));\n this.nodes = [];\n this.component.resolveElements();\n }", "unAll() {\n this.handlers = null;\n }", "clear() {\n\t\tlet e = this.first();\n\t\twhile (e != 0) { this.delete(e); e = this.first(); }\n\t}", "function clearAll () {\n\n heldValue = null;\n heldOperation = null;\n nextValue = null;\n\n}", "clear(pattern?: string) {\n if (!this._cache) {\n return;\n }\n\n if (pattern) {\n Object.keys(this._cache)\n .filter((k) => (pattern ? new RegExp(pattern).test(k) : true))\n .forEach((k) => this._cache.removeItem(k));\n } else {\n this._cache.clear();\n }\n }", "function removeAll() {\n data.components = {};\n data.plugins = [];\n}", "clear() {\n const _ = this;\n _._map.clear();\n _._nameSet.clear();\n }", "removeAll() { this.general = {}; this.timers = {}; this.alarms = {}; this.helpers = {}; this.search = {}; }", "_clear() {\n\t\tthis._localPrimitivePropertiesAndTemplates = new Collection();\n\t\tthis._localVersionedTemplates = new Collection();\n\t\tthis._remoteScopedAndVersionedTemplates = new Collection();\n\t\tthis._inheritanceCache = {};\n\t\tthis._typedPropertyConstructorCache = {};\n\n\t\tthis._init();\n\t}", "clearAllVariables() {\n\t\tfor (const v of this._vars) {\n\t\t\tv.clear();\n\t\t}\n\t}", "wipe() {\n\t\tfor (node of this.nodes) {\n\t\t\tfor (let box of node.boxes) {\n\t\t\t\tbox.destruct()\n\t\t\t}\n\t\t}\n\t\tthis.nodes = new Set()\n\t}", "removeAll() {\r\n return this.clone(ViewFields_1, \"removeallviewfields\").postCore();\r\n }", "clear() {\n this.ownedRules = [];\n }", "purgeSets() {\n this.children.forEach((subTrie) => {\n subTrie.wordSet.clear();\n subTrie.purgeSets();\n });\n }", "function clear() {\n _value = null;\n }", "clear() {\n this.helperTuples_ = [];\n }", "static hydrate() {\n Object.keys(this.macros).forEach((key) => Reflect.deleteProperty(this.prototype, key));\n Object.keys(this.getters).forEach((key) => Reflect.deleteProperty(this.prototype, key));\n this.macros = {};\n this.getters = {};\n }", "cleanup() {\n this.physicsEngine.cleanup(this.toClean);\n const gameInstance = this;\n this.toClean.forEach(function (name) {\n if (typeof gameInstance.objects[name] !== 'undefined') {\n delete gameInstance.objects[name];\n }\n });\n this.physicsEngine.cleanup(this.toClean);\n }", "clear() {\n wipe_1.wipe(this.data);\n }", "clearAll() {\r\n \r\n // reset sample data\r\n this.sampleData = [];\r\n\r\n // reset distribution paramters\r\n this.mu = null;\r\n this.sigma = null;\r\n\r\n // update the plots\r\n this.ecdfChart.updatePlot([], []);\r\n this.histChart.updateChart([])\r\n \r\n }", "clear() {\n this._clear();\n this._clearPlus();\n }", "removeAllMatches() {\n // Check for matches\n this.findMatches();\n\n // While there are matches left\n while (this.matches.length > 0) {\n\n // Remove matches\n this.replaceMatches();\n\n if(this.gameState == 'changing') {\n // falling animation\n this.enableAnimatedFall();\n } else {\n // shift tiles without animation\n this.shiftTiles();\n }\n\n // Check if there are matches left\n this.findMatches();\n }\n\n // if(this.swappingState == false && this.tilesAreFalling == false) {\n // this.gameState = 'stable';\n // }\n }", "cleanup() {\n this.lastRead = {};\n this.defaults = {};\n this.overrides = {};\n }", "clear() {\n for (var i = 0; i < this.nodes.length; i++) {\n this.nodes[i].edges.forEach(function (item) {\n item.remove();\n });\n this.nodes[i].remove();\n }\n this.nodes = [];\n }", "clear(){\n this.solutions = [];\n this.solutionFlag = null;\n $(\"#all-solutions > *\").not(\"fixed\").remove();\n }", "clear() {\n this.destroy();\n }", "clearItems() {\n\t\t\tthis.data = [];\n\t\t\tthis.groups = new Map();\n\t\t\tthis.minv = Number.MAX_VALUE;\n\t\t\tthis.maxv = Number.MIN_VALUE;\n\t\t\tthis.maxt = 0;\n\t\t\tthis.maxn = \"\";\n\t\t\tthis.maxg = \"\";\n\t\t}", "reset() {\n this.tag = undefined;\n this.keyword = undefined;\n this.articles.forEach(article => article.delete());\n this.articles = [];\n }", "clear() {\n this._registered.clear();\n }", "clearTemp () {\n for (let attribute in this.temps) {\n if (this.temps.hasOwnProperty(attribute)) {\n // delete this.data[attribute];\n // this.remove(attribute);\n delete this.temps[attribute]\n }\n }\n }", "clear() {\n var map = this._map;\n var keys = Object.keys(map);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n map[key].clear();\n }\n }", "static removeAll() {\n $('.tail').remove()\n }", "static resetAllFilters() {\n const filterNodes = ANSWERS.core.filterRegistry\n .getAllFilterNodes()\n .filter(fn => fn.getFilter().getFilterKey());\n filterNodes.forEach(node => {\n node.remove();\n });\n }", "clear() {\n this.literals = new Set();\n this.state.forEach((row, y) => row.forEach((_, x) => this.setClear(x, y)));\n }", "function removeAll() {\n\t$(\"*\").off();\n}", "function h$clearWeaks() {\n var mark = h$gcMark;\n ;\n for(var i=h$scannedWeaks.length-1;i>=0;i--) {\n var w = h$scannedWeaks[i];\n if(w.keym.m !== mark && w.val !== null) {\n ;\n w.val = null;\n }\n }\n}", "clear() {\r\n this._clear();\r\n }", "removeAll()\n {\n this.listeners.length = 0;\n this.errorListeners.length = 0;\n this.validateListeners.length = 0;\n this.createListeners.length = 0;\n this.submitListeners.length = 0;\n }", "clearDisplayPaths() {\n this.displayPaths.forEach((p) => { p.remove() });\n }", "clearDisplayPaths() {\n this.displayPaths.forEach((p) => { p.remove() });\n }", "function clean() {\n wrappers.splice(0, wrappers.length);\n plugins.splice(0, plugins.length);\n}", "dispose() {\n this._rules.forEach(rule => rule.dispose());\n this._rules.length = 0;\n delete this._rules;\n }", "clearRules() {\n this.rules.sections = []\n this.rules.identifiers = []\n }", "clear () {\n for (let attribute in this.data) {\n if (this.data.hasOwnProperty(attribute)) {\n delete this.data[attribute]\n }\n }\n }", "destroy() {\n this.shape = null;\n this.holes.length = 0;\n this.holes = null;\n this.points.length = 0;\n this.points = null;\n this.lineStyle = null;\n this.fillStyle = null;\n }", "clear() {\n const game = this.game;\n const world = game.world;\n const container = game.pixiAdapter.container;\n\n // Remove p2 constraints from the world\n for (let i = 0; i < this.constraints.length; i++) {\n world.removeConstraint(this.constraints[i]);\n }\n\n // Remove p2 bodies from the world and Pixi Containers from the stage\n for (let i = 0; i < this.bodies.length; i++) {\n world.removeBody(this.bodies[i]);\n container.removeChild(this.containers[i]);\n }\n }", "removeAll(referenceId) {\n this.forEach((annotation) => {\n this._removeIfDefined(annotation, true);\n });\n this.set = new Set();\n }", "clear() {\n this.measurements.clear({\n 'removeIndices': true\n })\n }", "clear() {\n this._clear();\n }", "function clearProperties()\n {\n _edges = undefined;\n _edgeVectors = undefined;\n _matrix = undefined;\n }", "clear() {\n this.stop();\n this.scene.remove.apply(this.scene, this.scene.children);\n this.scene.background = null;\n this.mixers.splice(0, this.mixers.length);\n this.sceneMeshes.splice(0, this.sceneMeshes.length);\n $(\"#picker\").spectrum(\"hide\");\n }", "remove() {\n // remove the para, and filterdiv\n this.para.remove()\n this.filterDiv.remove()\n this.labelholder.remove()\n this.maxel.element.remove()\n this.minel.element.remove()\n }", "cleanGarbage() {\n const self = this;\n this.forEveryElement(DOWN_TO_TOP, LEFT_TO_RIGHT, (elm, left, top, right, bottom) => {\n \n if(elm.position.isValid()){\n const {line, column} = elm.position;\n elm.cleanTemporaryData();\n self.data[line][column] = elm;\n } else {\n throw new Error('Cannot clean invalid position');\n }\n \n });\n }", "clear() {\n this._objects = {};\n }", "gc() {\n // clear all arrays\n this.animation=null;\n this.keys=null;\n // clear variables\n this.generate=null;\n this.move=null;\n }", "destroyAllBugs(){\n this.bugs = this.chort.getBugs()\n this.bugs.clear(true) // not working?!\n //tell chort\n this.chort.setBugs(this.bugs)\n }", "remove() {\n multiReplaceStatement({\n parent: this.parent,\n node: this.fullNode,\n replacements: [],\n });\n }", "clearAll() {\n return this.clear();\n }", "removeAll() {\n this.loaderCounter = 0;\n this.errorCounter = 0;\n this._remove(true);\n }", "clear() {\n this.nodes = [];\n this.edges = [];\n this.faces = [];\n this.sectors = [];\n this.junctions = [];\n return this;\n }", "clear() {\n return super.clear()\n }", "function clearCache() {\n util._.each(util._.keys(exports.instances), function (x) {\n exports.instances[x] = null;\n delete exports.instances[x];\n });\n util._.each(util._.keys(exports.loadingInstances), function (x) {\n exports.loadingInstances[x] = null;\n delete exports.loadingInstances[x];\n });\n util._.each(util._.keys(capsule.Module.thrustCache), function (x) {\n capsule.Module.thrustCache[x] = null;\n delete capsule.Module.thrustCache[x];\n });\n }", "clear()\n {\n this._commonStyleSheet = null;\n\n for (let collection of [this._styleSheetCache, this._filtersByDomain,\n this._filterBySelector, this._filters,\n this._exceptionDomains])\n collection.clear();\n\n this._unconditionalSelectors = null;\n this._defaultStyleSheet = null;\n }", "clear()\n {\n this._commonStyleSheet = null;\n\n for (let collection of [this._styleSheetCache, this._filtersByDomain,\n this._filterBySelector, this._filters,\n this._exceptionDomains])\n collection.clear();\n\n this._unconditionalSelectors = null;\n this._defaultStyleSheet = null;\n }", "clearRefs() {\n for(const [elem, refs] of this.doc.__refs.entries()) {\n for(const type of refs.keys()) {\n const ref = elem.getAttr(type)\n if(Array.isArray(ref)) {\n ref.includes(this) && elem.setAttr(type, ref.filter(item => item !== this))\n }\n else ref === this && elem.removeAttr(type)\n }\n }\n }", "clear() {\n let toRemove = [];\n for (let i = 0; i < this.scene.children.length; i++) {\n let obj = this.scene.children[i];\n if (obj.userData && obj.userData.isBodyElement) {\n toRemove.push(obj);\n }\n }\n for (let i = 0; i < toRemove.length; i++) {\n this.remove(toRemove[i]);\n }\n }", "destructor() {\n super.destructor()\n this.inputs.destroy()\n this.output.destroy()\n this.inputs = null\n this.output = null\n }", "function clear() {\n this.keys.forEach((key) => {\n this._store[key] = undefined;\n delete this._store[key];\n });\n}", "function clearAll() {\n shouldAutoClear = false;\n expressionElm.empty();\n tokensElm.empty();\n treeElm.empty();\n resultElm.empty();\n }", "removeUsedProps(aProps) {\n\t\t//METODO: change this to actual source cleanup\n\t\tdelete aProps[\"input1\"];\n\t\tdelete aProps[\"input2\"];\n\t\tdelete aProps[\"condition\"];\n\t}", "removeUsedProps(aProps) {\n\t\t//METODO: change this to actual source cleanup\n\t\tdelete aProps[\"text\"];\n\t\tdelete aProps[\"maxLength\"];\n\t}", "clearValues(){\n\t\t\tthis.addedName = '';\n\t\t\tthis.addedPrice = 0;\n\t\t\tthis.commission = 0;\n\t\t\tthis.totalContractValue = 0;\n\t\t\t\n\t\t}", "clean() {\n this.recentRemovedElements.clear();\n let validElementCount = 0;\n for (let i = 0; i < this.length; i += 1) {\n this.array[i].clean();\n if (this.array[i].isToBeRemoved) {\n this.recentRemovedElements.push(this.array[i]);\n continue;\n }\n this.array[validElementCount] = this.array[i];\n validElementCount += 1;\n }\n this.length = validElementCount;\n }", "clean() {\n this.recentRemovedElements.clear();\n let validElementCount = 0;\n for (let i = 0; i < this.length; i += 1) {\n this.array[i].clean();\n if (this.array[i].isToBeRemoved) {\n this.recentRemovedElements.push(this.array[i]);\n continue;\n }\n this.array[validElementCount] = this.array[i];\n validElementCount += 1;\n }\n this.length = validElementCount;\n }", "clean() {\n this.recentRemovedElements.clear();\n let validElementCount = 0;\n for (let i = 0; i < this.length; i += 1) {\n this.array[i].clean();\n if (this.array[i].isToBeRemoved) {\n this.recentRemovedElements.push(this.array[i]);\n continue;\n }\n this.array[validElementCount] = this.array[i];\n validElementCount += 1;\n }\n this.length = validElementCount;\n }", "clear () {\n this._dict = {}\n this._stack = [this._dict]\n }", "clearValidators() {\n this.validator = null;\n }", "clearValidators() {\n this.validator = null;\n }", "clearValidators() {\n this.validator = null;\n }", "clearValidators() {\n this.validator = null;\n }", "clearValidators() {\n this.validator = null;\n }", "clearValidators() {\n this.validator = null;\n }", "clearValidators() {\n this.validator = null;\n }", "clearAll() {\n this.clearGraphic()\n this.clearData()\n }", "clearAll() {\n let that = this;\n Object.keys(this._repository).forEach(function(key) {\n delete that._repository[key];\n });\n }", "function clean(t) {\n for (const prop in t) {\n if (t[prop] === undefined) {\n delete t[prop];\n }\n }\n return t;\n}", "removeAllVehicles(){\n \n console.log('removing all vehicles: ', Vehicle.tags)\n Vehicle.tags.forEach((tag, index) => this.removeVehicle(tag, index), this)\n Vehicle.tags = []\n \n }", "del(_id) {\n const _value = this.values[_id];\n _value.views.forEach(_view => {\n _view.valueObj = HDummyValue.new(0, _value.value);\n });\n _value.views = [];\n delete this.values[_id];\n }" ]
[ "0.63957787", "0.62388974", "0.62306243", "0.61691856", "0.6167477", "0.6074893", "0.6072258", "0.60537624", "0.60425174", "0.6032658", "0.59973025", "0.5977745", "0.5965149", "0.59548", "0.59474117", "0.59020555", "0.58762676", "0.5854243", "0.5831974", "0.5824452", "0.5822023", "0.57477444", "0.5746487", "0.5704094", "0.5700549", "0.56905556", "0.5684012", "0.56644005", "0.5651209", "0.56427324", "0.5641344", "0.5638371", "0.56266665", "0.5620398", "0.56182563", "0.56177455", "0.5595064", "0.55817246", "0.55811316", "0.5580602", "0.55754024", "0.5571391", "0.5557071", "0.5553243", "0.5548955", "0.55474955", "0.55421746", "0.55416155", "0.5535672", "0.5533768", "0.5533768", "0.55286163", "0.55278635", "0.5527551", "0.55236715", "0.5521104", "0.5514645", "0.55089575", "0.54994565", "0.54966766", "0.5496572", "0.5490041", "0.5486655", "0.54857564", "0.54679775", "0.5467279", "0.54665375", "0.54652375", "0.5464299", "0.54624635", "0.5462311", "0.54547787", "0.54539806", "0.5449967", "0.5449967", "0.5431671", "0.5427091", "0.5423978", "0.5420706", "0.54178166", "0.5416532", "0.5414126", "0.54065585", "0.5402694", "0.5402694", "0.5402694", "0.53983057", "0.539459", "0.539459", "0.539459", "0.539459", "0.539459", "0.539459", "0.539459", "0.5393742", "0.5389225", "0.53814965", "0.5379771", "0.537186" ]
0.79024583
0
Empty the contents of the PatternSet.
clear(){ const patterns = instancePatterns.get(this); patterns.clear(); super.clear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n\t\tlet e = this.first();\n\t\twhile (e != 0) { this.delete(e); e = this.first(); }\n\t}", "clear()\n {\n this._keywordByFilter.clear();\n this._simpleFiltersByKeyword.clear();\n this._complexFiltersByKeyword.clear();\n this._compiledPatternsByKeyword.clear();\n this._keywordlessCompiledPatterns = false;\n this._filterDomainMapsByKeyword.clear();\n this._filterMapsByType.clear();\n }", "clear() {\n\t\twhile (this.getElement().firstChild) {\n\t\t\tthis.getElement().removeChild(this.getElement().firstChild)\n\t\t}\n\t}", "clear() {\r\n this._clear();\r\n }", "function clearAll() {\n shouldAutoClear = false;\n expressionElm.empty();\n tokensElm.empty();\n treeElm.empty();\n resultElm.empty();\n }", "clear() {\n this._clear();\n }", "purgeSets() {\n this.children.forEach((subTrie) => {\n subTrie.wordSet.clear();\n subTrie.purgeSets();\n });\n }", "clear() {\n\t\tfor (let x = 1; x <= this.#m; x++) this.#pos[this.#item[x]] = 0;\n\t\tthis.#m = 0; this.#offset = 0;\n\t}", "function clearAll() {\n recipeArea.empty();\n recipeTitle.empty();\n }", "clear() {\n this.literals = new Set();\n this.state.forEach((row, y) => row.forEach((_, x) => this.setClear(x, y)));\n }", "function clear()\r{\r\tvar end = mapping_names.length;\r\r\tfor(var i=end-1; i>=0; i--){\r\t\tremove(mapping_names[i]);\r\t}\r\twhile(mapping_names.pop());\r\twhile(mapping_sources.pop());\r\twhile(mapping_destinations.pop());\r\twhile(mapping_algorithms.pop());\r}", "removeAll() {\r\n\t\t\tthis.remove();\r\n\t\t}", "clearAll() {\n return this.clear();\n }", "clear () {\n\t\tthis.head = null;\n\t\tthis.length = 0;\n\t}", "clearAll() {\n this.clearGraphic()\n this.clearData()\n }", "function clearAll() {\n typeaheads.origin.setValue('');\n typeaheads.destination.setValue('');\n $(options.selectors.origin).removeClass(options.selectors.errorClass);\n $(options.selectors.destination).removeClass(options.selectors.errorClass);\n $(options.selectors.alert).remove();\n }", "clear() {\n\t\t\t\tthis.length = 0;\n\t\t\t}", "clear() {\n var map = this._map;\n var keys = Object.keys(map);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n map[key].clear();\n }\n }", "clear() {\n wipe_1.wipe(this.data);\n }", "clear() {\n for (var i = 0; i < this.nodes.length; i++) {\n this.nodes[i].edges.forEach(function (item) {\n item.remove();\n });\n this.nodes[i].remove();\n }\n this.nodes = [];\n }", "function clearAll () {\n\tfor (var i = 0; i < num; i++) {\n\t\tp[i].finish();\n\t\tdelete p[i];\n\t}\n\tPelota.prototype.ID = 0;\n\tnum = 0;\n\tsetTimeout(function () {\n\t\tctx.clearRect(0, 0, can.width, can.height);\n\t}, 100);\n}", "clear() {\n this._clear();\n this._clearPlus();\n }", "clear() {\n for (let i = 0; i < this.sizeNum; i++) {\n this.remove(i);\n }\n }", "clear() {\n this.head = this.tail = null;\n this.size = 0;\n }", "clear() {}", "clear() {}", "clear() {}", "removeAll() {\n this._removeAll();\n }", "clear() {\n this._dummy.next = this._dummy;\n this._dummy.prev = this._dummy;\n this._size = 0;\n }", "function clearObjects() {\n setMapOnAll(null);\n}", "clear() {\n this.head = this.tail = null;\n this.length = 0;\n return this;\n }", "clear() {\n // TODO: perhaps we should clear something, but what, and how?\n return this;\n }", "clear() {\n const _ = this;\n _._map.clear();\n _._nameSet.clear();\n }", "clear() {\n this.head = null;\n this.tail = null;\n this.length = 0;\n this.count = 0;\n }", "clear(){\n this.solutions = [];\n this.solutionFlag = null;\n $(\"#all-solutions > *\").not(\"fixed\").remove();\n }", "function clearAll() {\n if (activeHighlight && activeHighlight.applied) {\n activeHighlight.cleanup();\n }\n activeHighlight = null;\n }", "clear() { }", "clear() {\n this.groups = this.groups.slice(-1);\n this.groups[0].clear();\n this.emit('update');\n }", "clearAll() {\r\n \r\n // reset sample data\r\n this.sampleData = [];\r\n\r\n // reset distribution paramters\r\n this.mu = null;\r\n this.sigma = null;\r\n\r\n // update the plots\r\n this.ecdfChart.updatePlot([], []);\r\n this.histChart.updateChart([])\r\n \r\n }", "clean() {\n this.clear();\n }", "function _reset () {\n _elements = [];\n }", "clear(){\n let current = this.head;\n while(current !== null){\n let next = current.next;\n current = null;\n current = next;\n }\n this.head = null,this.tail = null;\n this.size = 0;\n }", "function clear() {\n while( ids.length > 0 ) {\n ids.pop();\n }\n while( titles.length > 0 ) {\n titles.pop();\n }\n while( types.length > 0 ) {\n types.pop();\n }\n while( uris.length > 0 ) {\n uris.pop();\n }\n while( thumbUris.length > 0 ) {\n thumbUris.pop();\n }\n}", "clear() {\n\t\tif (this.getLength()) {\n\t\t\tthis.removeRange(0, this.getLength());\n\t\t}\n\t}", "function clearAll() {\n for (let i = 0; i < 11; i++) {\n setNone(i);\n }\n running = false;\n }", "reset() {\n this.tag = undefined;\n this.keyword = undefined;\n this.articles.forEach(article => article.delete());\n this.articles = [];\n }", "clear() {\n this.splice(0, this.getCount());\n }", "clear() {\n\t\t\tthis.mutate('');\n\t\t}", "function clearAll() {\n\n\t\t\t// Clear the sorts and filters, defer the query\n \tclearAllSorts();\n \tclearAllFilters();\n\n }", "clearAll() {\n this._operation = [];\n this._lastNumber = 0;\n this._lastOperator = '';\n this.setLastNumberToDisplay();\n }", "clear() {\n this._unmarkAll();\n\n this._emitChangeEvent();\n }", "function clearAll () {\n\n heldValue = null;\n heldOperation = null;\n nextValue = null;\n\n}", "clear () { }", "function clear() {\n clearContainer();\n items.length = 0;\n }", "clear(pattern?: string) {\n if (!this._cache) {\n return;\n }\n\n if (pattern) {\n Object.keys(this._cache)\n .filter((k) => (pattern ? new RegExp(pattern).test(k) : true))\n .forEach((k) => this._cache.removeItem(k));\n } else {\n this._cache.clear();\n }\n }", "clear() {\n this.ownedRules = [];\n }", "clearAll() {\n this._operation = [];\n this._lastNumber = '';\n this._lastOperator = '';\n this.setLastNumberToDisplay();\n }", "clear() {\n this.destroy();\n }", "clear() {\n this._count = 0;\n this._root = null;\n }", "clear() {\n log.map(\"Clearing the map of all the entries\");\n this._map.clear();\n }", "clear() {\n this._unmarkAll();\n this._emitChangeEvent();\n }", "clear() {\n this._unmarkAll();\n this._emitChangeEvent();\n }", "clear() {\n const me = this,\n removed = me._values.slice();\n\n if (me.totalCount) {\n me._values.length = 0;\n\n if (me._filteredValues) {\n me._filteredValues.length = 0;\n }\n\n me._indicesInvalid = true; // Indicate to observers that data has changed.\n\n me.generation++;\n me.trigger('change', {\n action: 'clear',\n removed\n });\n }\n }", "clear() {\n\t\t\tthis._buffer = [ ];\n\t\t}", "function clearSelected() {\n\tselectedRadicals = [];\n\tmatchingKanjis = [];\n\tmatchingRadicals = [];\n\tdisplaySelectedRadicals();\n\tdisplayMatchingKanji();\n}", "_reset() {\n\n\t\tthis._vertices.length = 0;\n\n\t\tthis._assigned.clear();\n\t\tthis._unassigned.clear();\n\n\t\treturn this;\n\n\t}", "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "function clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}", "clear () {\n\t\tthis.head = null;\n\t}", "clear () {\n\t\tthis.head = null;\n\t}", "clear () {\n\t\tthis.head = null;\n\t}", "clear() {\n this._objects = {};\n }", "function clear() {\n _value = null;\n }", "clear() {\n this.helperTuples_ = [];\n }", "removeAll() {\n this.nodes.forEach(node => node.parentNode.removeChild(node));\n this.nodes = [];\n this.component.resolveElements();\n }", "function _clear() {\n\n // Only clear if call is async. Clearing has no effect for synchronous calls and is also known to cause\n // issues with components that use async set value mechanisms (bug #20770935).\n if ( !lSync ) {\n lAffectedElements$.each(function () {\n $s(this, \"\", null, true);\n });\n }\n }", "function Clear()\n{\n\tUnspawnAll();\n\tavailable.Clear();\n\tall.Clear();\n}", "clear() {\n this.processRecords();\n this.queue.length = 0;\n this.selectionChanged = false;\n }", "clear() {\n clearInterval(this.interval);\n this.reset();\n }", "clear() {\n clearInterval(this.interval);\n this.reset();\n }", "function resetWalls() {\n\n wallSet.clear();\n reset();\n}", "function clear() {\n lastPos = null;\n delta = 0;\n }" ]
[ "0.68450814", "0.64846677", "0.639715", "0.6306062", "0.62646896", "0.6197863", "0.6183276", "0.61721927", "0.6166993", "0.6142827", "0.61361665", "0.6071749", "0.6049376", "0.60389614", "0.60263574", "0.60206383", "0.60143834", "0.6009029", "0.60050595", "0.59976524", "0.59970844", "0.5989264", "0.5983103", "0.5980521", "0.5975677", "0.5975677", "0.5975677", "0.597173", "0.5963022", "0.59531254", "0.595284", "0.5951907", "0.5944414", "0.59438366", "0.5942309", "0.5939707", "0.59299237", "0.5929882", "0.591971", "0.59170866", "0.5916796", "0.5895854", "0.5890124", "0.58899283", "0.58827996", "0.587695", "0.5875918", "0.5873439", "0.58623093", "0.58544147", "0.584984", "0.5838088", "0.58349735", "0.58298355", "0.58270085", "0.5815841", "0.5814278", "0.5806431", "0.58011895", "0.5795333", "0.5793762", "0.5793762", "0.57905453", "0.5785423", "0.5784061", "0.57777834", "0.5777073", "0.5777073", "0.5777073", "0.5777073", "0.5777073", "0.5777073", "0.5777073", "0.5777073", "0.5777073", "0.5777073", "0.5777073", "0.5777073", "0.5777073", "0.5777073", "0.5777073", "0.5777073", "0.5777073", "0.5777073", "0.5777073", "0.5772768", "0.5772768", "0.5772768", "0.5770673", "0.5753728", "0.5749916", "0.57453406", "0.573862", "0.57321143", "0.5724445", "0.57242554", "0.57242554", "0.57227916", "0.5719638" ]
0.72453606
1
I don't think Array.isArray is well supported. Use this function instead for now so that if we need to add a fallback it won't take as much effort.
function isArray(object) { return Array.isArray(object); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isArray(value) {\n return Array.isArray(value);\n }", "function array_test(x) {\n if (Array.isArray === undefined) {\n return x instanceof Array;\n } else {\n return Array.isArray(x);\n }\n}", "function array_test(x) {\n if (Array.isArray === undefined) {\n return x instanceof Array;\n } else {\n return Array.isArray(x);\n }\n}", "function is_array(x)\r\n{\r\n return Array.isArray(x) ;\r\n}", "function isArray(ar){return Array.isArray(ar);}", "function isArray(ar){return Array.isArray(ar);}", "function isArray(ar){return Array.isArray(ar);}", "function isArray(ar){return Array.isArray(ar);}", "function isArray(ar){return Array.isArray(ar);}", "function isArray(ar){return Array.isArray(ar);}", "function isArray$1(arr) {\n return Array.isArray(arr);\n}", "function array$1(value) {\r\n return Array.isArray(value);\r\n }", "isArray(value) {\n return value && typeof value === 'object' && value.constructor === Array;\n }", "function checkIfArray(arr) {\n return Array.isArray(arr);\n}", "function BOT_isArray(x) {\r\n\tif( typeof(x) == \"object\") return (x.constructor.toString().indexOf(\"Array\") != -1);\r\n\telse return false;\r\n}", "function isAnArray(input) {\n\t// create a result variable\n\tlet result;\n\t// assign it to a call to the applicable method\n\tresult = Array.isArray(input);\n\t// return the result variable\n\treturn result;\n}", "function isArray$2(ar) {\n return Array.isArray(ar);\n}", "function isArray$1(ar) {\n return Array.isArray(ar);\n}", "function isArray$1(ar) {\n return Array.isArray(ar);\n}", "function isArray(arr) {\n return Array.isArray(arr);\n }", "function isArray(arr) {\n return Array.isArray(arr);\n }", "function isArray$1(ar) {\n return Array.isArray(ar);\n }", "function isArray$1(ar) {\n return Array.isArray(ar);\n }", "function _isArray(v) {\n return Array.isArray(v);\n}", "function _isArray(v) {\n return Array.isArray(v);\n}", "function _isArray(v) {\n return Array.isArray(v);\n}", "function _isArray(v) {\n return Array.isArray(v);\n}", "function _isArray(v) {\n return Array.isArray(v);\n}", "function isArray(obj) { // 64\n\t\treturn nativeIsArray ? nativeIsArray(obj) : toString.call(obj) === '[object Array]'; // 65\n\t} // 66", "function isArray(e){return e!=null&&typeof e==\"object\"&&typeof e.length==\"number\"&&(e.length==0||defined(e[0]))}", "function $JORk$var$isArray(ar) {\n return Array.isArray(ar);\n}", "is_array(val) {\n return Array.isArray(val);\n }", "function isArrayish (arr) {\n return /Array\\]$/.test(Object.prototype.toString.call(arr))\n}", "function isArray(arr) {\n return arr instanceof Array || _.isArray(arr);\n }", "function isArray (arr) {\n if (typeof arr === \"undefined\")\n {\n return false;\n } else if (arr === null) {\n return false;\n } else {\n return arr.constructor === Array;\n }\n}", "function isArray(input){\n return typeof(input)=='object'&&(input instanceof Array);\n}", "function isArray$1(ar) {\n\t return Array.isArray(ar);\n\t}", "function isArray$1(ar) {\n\t return Array.isArray(ar);\n\t}", "function isArray$1(ar) {\n\t return Array.isArray(ar);\n\t}", "function isArray$1(ar) {\n\t return Array.isArray(ar);\n\t}", "function isArray(arr) {\n return Array.isArray(arr);\n }", "function isArray(arr) {\n return Array.isArray(arr);\n }", "function isArrayish(arr) {\n return (/Array\\]$/.test(Object.prototype.toString.call(arr))\n );\n}", "function isArray$2(ar) {\n\t return Array.isArray(ar);\n\t}", "function isArray(input) {\n return true;\n}", "function isArray$8(ar) {\n return Array.isArray(ar);\n}", "function isArray(arg){if(Array.isArray){return Array.isArray(arg);}return objectToString(arg)==='[object Array]';}", "function isArray(arg){if(Array.isArray){return Array.isArray(arg);}return objectToString(arg)==='[object Array]';}", "function isArray(arg){if(Array.isArray){return Array.isArray(arg);}return objectToString(arg)==='[object Array]';}", "function isArray(obj) {\n return nativeIsArray ? nativeIsArray(obj) : toString.call(obj) === '[object Array]';\n }", "function $QcjV$var$isArray(ar) {\n return Array.isArray(ar);\n}", "function _isArray(obj) {\n\t\treturn Object.prototype.toString.call(obj) === \"[object Array]\";\n\t}", "function isArray(val){return(val instanceof Array);}", "function isArray(arr) {\n if (typeof arr === \"undefined\") {\n return false;\n } else if (arr === null) {\n return false;\n } else {\n return arr.constructor === Array;\n }\n}", "function isArray$6(ar) {\n\t return Array.isArray(ar);\n\t}", "function isArray(input) {\n return Object.prototype.toString.call(input) === '[object Array]';\n }", "function isArray(a) {\n return (!!a) && (a.constructor === Array);\n}", "function isArray(a) {\n return (!!a) && (a.constructor === Array);\n}", "function isArray(ar) {\n return shims.isArray(ar);\n}", "function isArray(ar) {\n return shims.isArray(ar);\n}", "function isArray(ar) {\n return shims.isArray(ar);\n}", "function isArray(ar) {\n return shims.isArray(ar);\n}", "function isArray(ar) {\n return shims.isArray(ar);\n}", "function isArray(ar) {\n return shims.isArray(ar);\n}", "function isArray(ar) {\n return shims.isArray(ar);\n}", "function isArray(ar) {\n return shims.isArray(ar);\n}", "function isArray(ar) {\n return shims.isArray(ar);\n}", "function isArray(ar) {\n return shims.isArray(ar);\n}", "function isArray(ar) {\n return shims.isArray(ar);\n}", "function isArray(ar) {\n return shims.isArray(ar);\n}", "function isArray(ar) {\n return shims.isArray(ar);\n}", "function isArray(a)\n{\n\t//http://studiokoi.com/blog/article/typechecking_arrays_in_javascript\n\treturn Object.prototype.toString.apply(a) === '[object Array]';\n}", "function w$(e){return Array.isArray(e)}", "function $FX3H$var$isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n\n return $FX3H$var$objectToString(arg) === '[object Array]';\n}", "function isArray(arg){if(Array.isArray){return Array.isArray(arg)}return objectToString(arg)===\"[object Array]\"}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}", "function isArray(ar) {\n return Array.isArray(ar);\n}" ]
[ "0.7794904", "0.77205926", "0.77205926", "0.7704778", "0.76857483", "0.76857483", "0.76857483", "0.76857483", "0.76857483", "0.76857483", "0.7678376", "0.75791544", "0.7548115", "0.7524575", "0.7522537", "0.74651825", "0.74515444", "0.7437701", "0.7437701", "0.7431835", "0.7431835", "0.74220717", "0.74220717", "0.7420523", "0.7420523", "0.7420523", "0.7420523", "0.7420523", "0.74020314", "0.7377121", "0.7333884", "0.7326334", "0.7322976", "0.7319981", "0.7311408", "0.7309665", "0.73095095", "0.73095095", "0.73095095", "0.73095095", "0.7308989", "0.7308989", "0.73038095", "0.72918", "0.7290264", "0.72801507", "0.7270297", "0.7270297", "0.7270297", "0.7268421", "0.7259282", "0.72545815", "0.72483003", "0.7247367", "0.72460353", "0.72442275", "0.724328", "0.724328", "0.72209865", "0.72209865", "0.72209865", "0.72209865", "0.72209865", "0.72209865", "0.72209865", "0.72209865", "0.72209865", "0.72209865", "0.72209865", "0.72209865", "0.72209865", "0.7215682", "0.721545", "0.7212799", "0.72092026", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279", "0.7207279" ]
0.0
-1
Tests to see if an object is a Plain Object produced from an object literal. This is good for testing things like function options.
function isPlainObject(object) { if (!(object && toString.call(object) === '[object Object]')) return false; return Object.getPrototypeOf(object) === Object.prototype; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPlainObject(obj){return _toString.call(obj)==='[object Object]';}", "function isPlainObject(obj){return _toString.call(obj)==='[object Object]';}", "function isPlainObject(obj){\n \tif (obj.constructor.name===\"Object\"){\n \t\treturn true;\n \t}\n \treturn false;\n }", "function isPlainObject(obj) {\n return _toString.call(obj) === \"[object Object]\";\n }", "function isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]';\n }", "function isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]';\n }", "function isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]';\n}", "function isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]';\n}", "function isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]';\n}", "function isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]';\n}", "function isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]';\n}", "function isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]';\n}", "function isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]';\n}", "function isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]';\n}", "function isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]';\n}", "function isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]';\n}", "function isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]';\n}", "function isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]';\n}", "function isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]';\n}", "function isPlainObject(obj) {\n return _toString$1.call(obj) === '[object Object]';\n }", "function isPlainObject (obj) {\r\n return _toString.call(obj) === '[object Object]'\r\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n }", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n }", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n }", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n }", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n }", "function isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject(obj) {\n\t return _toString.call(obj) === '[object Object]';\n\t}", "function isPlainObject(obj) {\n\t return _toString.call(obj) === '[object Object]';\n\t}", "function isPlainObject(obj) {\n return Object.prototype.toString.call(obj) === '[object Object]'\n}", "function isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]'\n }", "function isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]'\n }", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}", "function isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}" ]
[ "0.773077", "0.773077", "0.7658938", "0.76326376", "0.76164806", "0.76164806", "0.76002574", "0.76002574", "0.76002574", "0.76002574", "0.76002574", "0.76002574", "0.76002574", "0.76002574", "0.76002574", "0.76002574", "0.76002574", "0.76002574", "0.76002574", "0.75867015", "0.7577387", "0.757654", "0.757654", "0.757654", "0.757654", "0.75408417", "0.75377154", "0.75361115", "0.75361115", "0.75315297", "0.75239515", "0.75239515", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417", "0.75228417" ]
0.0
-1
Tests if an object is a string literal
function isString(object) { return typeof object === 'string'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isString(obj) {\n\t\treturn !!(obj === '' || (obj && obj.charCodeAt && obj.substr));\n\t}", "function isString(obj) {\n return Object.prototype.toString.call(obj) === '[object String]';\n}", "function isString(obj) {\n return Object.prototype.toString.call(obj) === '[object String]';\n}", "function isString(object) { return typeof object === 'string'; }", "function isString(obj) {\n\t\t\treturn !!(obj === '' || (obj && obj.charCodeAt && obj.substr));\n\t\t}", "function isString(obj) {\r\n return !!(obj === '' || obj && obj.charCodeAt && obj.substr);\r\n}", "function isString(obj) {\n return Object.prototype.toString.call(obj) === '[object String]';\n }", "function isString(obj) {\n \t\treturn !!(obj === '' || (obj && obj.charCodeAt && obj.substr));\n \t}", "function isString(obj) {\r\n\treturn typeof obj == \"string\" || Object.prototype.toString.call(obj) === \"[object String]\";\r\n}", "function isString(obj) {\n return toString.apply(obj) === \"[object String]\";\n }", "function isString(obj) {\n\treturn typeof obj == \"string\" || Object.prototype.toString.call(obj) === \"[object String]\";\n}", "function isStr(o) {\n\t\treturn typeof (o) == \"string\";\n\t}", "function isString(obj) {\n\treturn typeOf(obj, \"string\");\n\t// return toString.call(obj) == '[object String]';\n}", "function isString(obj) {\n return (typeof obj === 'string' || obj instanceof String);\n}", "function isString(obj){\r\n\treturn typeof(obj) == 'string';\r\n}", "function isString(anObj) {\n return (typeof anObj === 'string' || anObj instanceof String);\n}", "static isString(obj) {\n return typeof obj === 'string';\n }", "function isString(obj) {\n\t\treturn typeof obj == \"string\" || Object.prototype.toString.call(obj) === \"[object String]\";\n\t}", "function isString(obj) {\n return typeof obj === \"string\";\n}", "function isString(obj) {\n return typeof obj === \"string\";\n}", "function isString(obj) { // 56\n\t\treturn !!(obj === '' || (obj && obj.charCodeAt && obj.substr)); // 57\n\t} // 58", "function isString(object) {\n return typeof object === 'string' || object instanceof String;\n }", "function isString(obj) {\n return ( typeof obj == \"string\" || obj instanceof String);\n }", "function isString(obj) {\n return typeof obj == \"string\";\n }", "function isString(o) {\n return toString.call(o) == '[object String]';\n}", "function is_literal_string_value(value) {\n if ((typeof(value) === 'string' && (value.length >= 3)) &&\n ((value[0] == '\"' && value[value.length - 1] == '\"') || (value[0] == '\\'' && value[value.length - 1] == '\\''))) {\n return true;\n }\n\n return false;\n}", "isString(object) {\n\t\treturn \"string\" === typeof object && object.length > 0;\n\t}", "__is_string(value) {\n return typeof value === 'string' || value instanceof String;\n }", "function isString(o) { return o != null && (typeof o === \"string\" || o.constructor === String); }", "function isString(node) {\n return t.isLiteral(node) && typeof node.value === \"string\";\n}", "function isString(node) {\n return t.isLiteral(node) && typeof node.value === \"string\";\n}", "function isStr(something) {\n return typeof something === \"string\";\n}", "function is(value) {\n var candidate = value;\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\n }", "function is(value) {\n var candidate = value;\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\n }", "function is(value) {\n var candidate = value;\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\r\n }", "function isString(o) {\n return (typeof o === 'string')\n }", "function is(value) {\n var candidate = value;\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\n }", "function isString(node) {\n\t return t.isLiteral(node) && typeof node.value === \"string\";\n\t}", "function isString(node) {\n\t return t.isLiteral(node) && typeof node.value === \"string\";\n\t}", "function is_string( arg ) {\n return typeof arg === 'string';\n }", "function isString(s, orStringable) {\n return orStringable && s.toString || typeof s === TYPE_STRING.toLowerCase();\n }", "function string$1(value) {\r\n return typeof value === 'string';\r\n }", "function isString (str) {\n return objToString.call(str) === STRING_DETECTOR;\n}", "function is(value) {\r\n var candidate = value;\r\n return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));\r\n }", "isString(str) {\n return (typeof str == 'string') && str.constructor == String;\n }", "function string (data) {\n return typeof data === 'string';\n }", "function isString(str) {\n return typeof str === 'string' || str instanceof String;\n }", "function isString(str) {\n return typeof str === 'string' || str instanceof String;\n }", "function isString( arg ) { return typeof arg === \"string\"; }", "function isString(o) {\n return typeof o !== \"undefined\" && o !== null &&\n (typeof o === \"string\" || o.constructor === String);\n}", "function string (data) {\n return typeof data === 'string';\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));\r\n }", "function is(value) {\r\n var candidate = value;\r\n return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));\r\n }", "function is_str(str) {\r\n return typeof str == \"string\" || typeof str == \"String\";\r\n}", "function isString(value) {\n return Object.prototype.toString.call(value) == \"[object String]\" \n }", "function is(value) {\n var candidate = value;\n return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));\n }", "function isString(x) {\r\n return Object.prototype.toString.call(x) === \"[object String]\"\r\n}", "function isLiteral(term) {\n return !!term && term.termType === 'Literal';\n}", "function isString(str) {\n\t return typeof str === 'string' || str instanceof String;\n\t}", "function isString(str) {\n\t return typeof str === 'string' || str instanceof String;\n\t}", "function isString(str) {\n\t return typeof str === 'string' || str instanceof String;\n\t}", "function isString(str) {\n return typeof str === 'string' || str instanceof String;\n }", "function isString(str) {\n return typeof str === 'string' || str instanceof String;\n }", "function isString(str) {\n return typeof str === 'string' || str instanceof String;\n }", "function isString(entry) {\n return entry.constructor === String;\n}", "function camIsString(something)\n{\n\treturn typeof(something) === \"string\";\n}", "function isString(value) { return typeof value === \"string\" || value instanceof String; }", "function is(value) {\n var candidate = value;\n return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value);\n }", "function is(value) {\n var candidate = value;\n return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value);\n }", "function is(value) {\n var candidate = value;\n return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value);\n }", "function isText (x) {\n return typeof (x) === 'string' || x instanceof String\n}", "function isString(str) {\n return typeof str === 'string' || str instanceof String;\n}", "function isString(str) {\n return typeof str === 'string' || str instanceof String;\n}", "function isString(str) {\n if (typeof str === \"undefined\") {\n return false;\n } else if (str === null) {\n return false;\n } else {\n return Object.prototype.toString.call(str) == '[object String]';\n }\n}", "_isLiteral(tokenType) {\n return tokenType === 'NUMBER' ||\n tokenType === 'STRING' ||\n tokenType === 'true' ||\n tokenType === 'false' ||\n tokenType === 'null';\n }", "function isString (str) {\n if (typeof str === \"undefined\")\n {\n return false;\n } else if (str === null) {\n return false;\n } else {\n return Object.prototype.toString.call(str) === '[object String]';\n }\n}", "function sc_isString(s) {\n return (typeof s === \"string\") &&\n\t(s.charAt(0) !== sc_SYMBOL_PREFIX);\n}", "function is_string(arg_value)\n\t{\n\t\treturn typeof arg_value == 'string' || typeof arg_value == 'String';\n\t}", "is_string(val) {\n return (typeof val === 'string');\n }", "function isString(s) {\n return typeof s === 'string' || s instanceof String;\n}", "function isString(value) {\n\t\t\t\tif (typeof value === 'string') { return true; }\n\t\t\t\tif (typeof value !== 'object') { return false; }\n\t\t\t\treturn toString.call(value) === '[object String]';\n\t\t\t}", "function isString(a) {\r\n return typeof a == 'string';\r\n}", "function assertString(obj, what) {\n if (typeof obj !== 'string') {\n throw new Error('invalid ' + what + ': ' + obj);\n }\n}", "function isString(a) {\n return typeof a === \"string\";\n}", "function isString(any)\n{\n return typeof any == \"string\";\n}", "function r(e){return\"string\"==typeof e}", "function r(e){return\"string\"==typeof e}", "function isSimple(typed) {\n for (var i = 0; i < typed.length; i++) {\n var c = typed.charAt(i);\n if (c === ' ' || c === '\"' || c === '\\'' ||\n c === '{' || c === '}' || c === '\\\\') {\n return false;\n }\n }\n return true;\n}", "function isString(a) {\n return typeof a === 'string';\n }", "function isString(val) {\n return isValue(val) && (typeof val === 'string' || val instanceof String);\n}", "function validString(str) {\n return typeof str === 'string';\n}" ]
[ "0.7382565", "0.73711777", "0.73711777", "0.7338176", "0.7331735", "0.7305545", "0.7298398", "0.72960085", "0.72093195", "0.7203717", "0.7194645", "0.7184463", "0.716219", "0.7141981", "0.7134836", "0.71302617", "0.7127283", "0.7102086", "0.70855486", "0.70855486", "0.70853597", "0.6989591", "0.69747645", "0.6964366", "0.6855475", "0.67567927", "0.6722062", "0.6714422", "0.6704568", "0.6692566", "0.6692566", "0.6687748", "0.6668133", "0.6668133", "0.6668133", "0.6641374", "0.6641374", "0.66055125", "0.66055125", "0.66055125", "0.66055125", "0.65945756", "0.6591299", "0.657629", "0.657629", "0.6563641", "0.6558147", "0.65567577", "0.6553309", "0.6538306", "0.6538306", "0.6526498", "0.6526073", "0.6486895", "0.6486895", "0.6474354", "0.6471238", "0.6469323", "0.6466129", "0.6466129", "0.6466129", "0.6466129", "0.64624757", "0.64493215", "0.64393127", "0.6428195", "0.6402716", "0.63964444", "0.63964444", "0.63964444", "0.6388722", "0.6375673", "0.6375673", "0.63755906", "0.6373852", "0.6368752", "0.6354795", "0.6354795", "0.6354795", "0.6354605", "0.63303417", "0.63303417", "0.63301", "0.6328257", "0.6285723", "0.62602293", "0.62460476", "0.6224347", "0.62218964", "0.62067235", "0.62056047", "0.6197922", "0.6182336", "0.6178157", "0.61747205", "0.61747205", "0.6154832", "0.6150033", "0.6133711", "0.61200434" ]
0.69975805
21
takes an array or object, iterates over it, and calls on each iteration if the function returns anything, the iteration is halted and the result is returned
function each(collection, func, context) { var result; context = context || null; if (isArray(collection)) { var length = collection.length; for (var i = 0; i < length; i++) { result = func.call(context, collection[i], i); if (result !== undefined) return result; } } else { for (var key in collection) { result = func.call(context, collection[key], key); if (result !== undefined) return result; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function each(objOrArr, callBack) {\n\n\n}", "function each(obj, fn) {\n\t\tif (!obj) { return; }\n\t\t\n\t\tvar name, i = 0, length = obj.length;\n\t\n\t\t// object\n\t\tif (length === undefined) {\n\t\t\tfor (name in obj) {\n\t\t\t\tif (fn.call(obj[name], name, obj[name]) === false) { break; }\n\t\t\t}\n\t\t\t\n\t\t// array\n\t\t} else {\n\t\t\tfor (var value = obj[0];\n\t\t\t\ti < length && fn.call( value, i, value ) !== false; value = obj[++i]) {\t\t\t\t\n\t\t\t}\n\t\t}\n\t\n\t\treturn obj;\n\t}", "function every(arr, boo) {\n return arr.forEach(function(el) {console.log(boo(el)); return boo(el)})\n}", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i] && func(ary[i], i, ary)) {\n break;\n }\n }\n }\n }", "function doThis(arr, fn){\n // create an empty array to hold return values \n var returnArr = [];\n // loop through the fed in array and perform the fed in function on each item\n for(var i=0;i<arr.length;i++){\n //update the value of the return array with the result of performing the fed in function with the array item as argument.\n returnArr.push(fn(arr[i]));\n } \n return returnArr; \n}", "function walk(arrOrObj, fn, opt_walkAll) {\r\n var done, c = 0, k = 0, l, endWalk = function() { done = arguments; },\r\n caller = function(k) { c++; fn.call(endWalk, arrOrObj[k], k, arrOrObj); };\r\n if (isArrayLike(opt_walkAll)) {\r\n for (l = opt_walkAll.length; k < l; k++) {\r\n if (has(opt_walkAll, k)) {\r\n caller(opt_walkAll[k]);\r\n if (done) { break; }\r\n }\r\n }\r\n }\r\n else if (isArrayLike(arrOrObj)) {\r\n for (l = arrOrObj.length; k < l; k++) {\r\n if (opt_walkAll || has(arrOrObj, k)) {\r\n caller(k);\r\n if (done) { break; }\r\n }\r\n }\r\n }\r\n else {\r\n for (k in arrOrObj) {\r\n if (opt_walkAll || has(arrOrObj, k)) {\r\n caller(k);\r\n if (done) { break; }\r\n }\r\n }\r\n }\r\n return done && done.length ? done : c;\r\n }", "_each(iterated, fn) {\n\n var i = 0,\n len = iterated.length;\n\n iterated = (iterated instanceof Array) ? iterated : Array.prototype.slice.call(iterated);\n\n while (i < len) {\n if (fn.call(iterated[i], iterated[i], i, iterated) === false) break;\n i++;\n }\n }", "function each(fn, obj) {\n if (Array.isArray(obj)) {\n return obj.forEach(fn);\n }\n Object.keys(obj).forEach((key) => fn(obj[key], key));\n}", "forAllObjects (fcn, obj = {}) {\n for (var i = 0, len = this.length; i < len; i++) {\n this.getObject(i, obj)\n fcn(obj, i)\n }\n }", "function forEachCall(obj, func) {\n \n // loop though the items in the object\n for (var prop in obj) {\n \n // restrict to only immediate properties of the object (exclude inherited)\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n\n // call the function passing in the value and property\n func.call(null, obj[prop], prop);\n }\n }\n }", "function each (object , fn){\r\n if ((!Array.isArray (object))&&(typeof object === \"object\")){\r\n for (var key in object){\r\n fn (object[key], key)\r\n };\r\n };\r\n}", "function arrCall(arr, foo, arg1=null, arg2=null, arg3=null, arg4=null){\n\tfor (var k in arr){\n\t\tfoo.call(arr[k], arg1, arg2, arg3, arg4);\n\t}\n}", "function each(ary,func) {\n var i = 0;\n while (ary[i] != null) {\n func(ary[i],i);\n i++;\n }\n}", "function each(arr, inputFunction){\n arr.forEach(function(item){\n inputFunction(item);\n });\n}", "function iter$$1(f, xs) {\n for(var i = 0 ,i_finish = xs.length - 1 | 0; i <= i_finish; ++i){\n f(xs[i]);\n }\n return /* () */0;\n}", "function each(object, fn) {\n eachContinue(object, function (key, value) {\n fn(key, value);\n return true;\n });\n}", "function some(obj, func) {\n let newArr =Object.values(obj);\n for(let i=0; i<newArr.length; i++) {\n if(func(newArr[i]))\n return true;\n }\n return false;\n }", "function each(obj, action) {\n if (obj.constructor === Array) { // Array.isArray(input)\n for (var i = 0; i < obj.length; i++) {\n action(obj[i]);\n }\n }\n else if (obj.constructor === Object) { // typeof input === \"object\"\n for (var key in obj) {\n action(obj[key]);\n }\n }\n}", "async walk_values_async() {\n if (arguments.length < 2) return false;\n if (!this.is_object(arguments[0])) return arguments[0];\n var obj = arguments[0];\n var filter = null;\n var callfunc = null;\n if (arguments.length == 2) \n callfunc = arguments[1];\n if (arguments.length == 3) {\n filter = arguments[1];\n callfunc = arguments[2];\n }\n if ((filter != null) && (!this.is_array(filter))) \n throw 'Invalid filter supplied to utils.walk_values()';\n if (!this.is_function(callfunc)) \n throw 'Invalid callback function supplied to utils.walk_values()';\n for (var key in obj) {\n if (!obj.hasOwnProperty(key))\n continue;\n var val = obj[key];\n if (this.is_object(val) && !this.is_empty(val) && !this.encryption.is_encrypted(val))\n obj[key] = await this.walk_values_async(val, filter, callfunc);\n else \n if ((filter == null) || (filter.includes(key))) \n obj[key] = await callfunc(val); \n }\n return obj; \n }", "function some(array, f) {\n var acc = false;\n\n for (var i = 0; i < array.length; i++) {\n acc = f(array[i], i, array);\n\n if (acc) {\n return acc;\n }\n }\n\n return acc;\n }", "function each(collection,fn){var i=0,length=collection.length,cont;for(i;i<length;i++){cont=fn(collection[i],i);if(cont===false){break;//allow early exit\r\n\t}}}", "function executeForEach(array, func) {\r\n for (let i = 0; i < array.length; i++) {\r\n func(array[i]);\r\n }\r\n return array;\r\n}", "function loopThrough (inventory, foo){\n for (item of inventory){\n foo(item) \n }\n}", "function myForEach(arr, func) {\n // loop thorought the array\n for (let i = 0; i < arr.length; i++) {\n // call the func inside the array\n func(arr[i]);\n }\n}", "function forEach(arr, func)\n{\n\tif (arr.length == 0) return;\n\tfor (var i = 0; i < arr.length; i++)\n\t{\n\t\tfunc(arr[i], i, arr);\n\t}\n}", "walk_values() {\n if (arguments.length < 2) return false;\n if (!this.is_object(arguments[0])) return arguments[0];\n var obj = arguments[0];\n var filter = null;\n var callfunc = null;\n if (arguments.length == 2) \n callfunc = arguments[1];\n if (arguments.length == 3) {\n filter = arguments[1];\n callfunc = arguments[2];\n }\n if ((filter != null) && (!this.is_array(filter))) \n throw 'Invalid filter supplied to utils.walk_values()';\n if (!this.is_function(callfunc)) \n throw 'Invalid callback function supplied to utils.walk_values()';\n for (var key in obj) {\n if (!obj.hasOwnProperty(key))\n continue;\n var val = obj[key];\n if (this.is_object(val) && !this.is_empty(val) && !this.encryption.is_encrypted(val))\n obj[key] = this.walk_values(val, filter, callfunc);\n else \n if ((filter == null) || (filter.includes(key))) \n obj[key] = callfunc(val); \n }\n return obj;\n }", "function forEach(arr, func) {\n for (var i = 0; i < arr.length; i++)\n func(arr[i]);\n}", "function myForEach(array, callback) {\n\n}", "function each(array, func) {\n for (var i = 0; i < array.length; i++) {\n func(array[i]);\n }\n }", "function forEach(arr, func){\n for(let i =0; i< arr.length; i++){\n func(arr[i]);\n }\n}", "function testForEach(arr) {\n return arr.forEach( element => { console.log(element)});\n}", "function iterateArray(arr, fn) {\n for (var i=0; i < arr.length; i++) {\n fn(arr[i]);\n }\n }", "function each(array, func) {\n for (var i = 0; i < array.length; i++) {\n func(array[i]);\n }\n}", "function each(obj, iterator, context) {\n if (obj == null) return;\n if (nativeForEach && obj.forEach === nativeForEach) {\n obj.forEach(iterator, context);\n } else if (obj.length === +obj.length) {\n for (var i = 0, l = obj.length; i < l; i++) {\n if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return;\n }\n } else {\n for (var key in obj) {\n if (has(obj, key)) {\n if (iterator.call(context, obj[key], key, obj) === breaker) return;\n }\n }\n }\n }", "function iterate(iteration){ //recursive function to iterate through promises\n const yieldedObject = iteration.value;\n if(iteration.done) //stop iterating when done and return the final value wrapped in a promise\n return Promise.resolve(iteration.value);\n return Promise.resolve(iteration.value) //returns a promise with its then() and catch() methods filled\n .then(x => iterate(genObject.next(x))) //calls recursive function on the next value to be iterated\n .catch(x => iterate(genObject.throw(x))); //throws an error if a rejection is encountered\n }", "function myForEach(arr, func) {\n \n for (var index = 0; index < arr.length; index++) {\n func(arr[index], index, arr);\n \n }\n}", "function every(obj, iterator, context) {\n var result = true;\n if (obj == null) return result;\n if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);\n each(obj, function (value, index, list) {\n if (!(result = result && iterator.call(context, value, index, list))) return breaker;\n });\n return result;\n }", "function iterateF(p, f)\n{\n if(p !== undefined){\n if(p.splice) { //p.constructor === Array) {\n for(let i = 0, len = p.length; i < len; ++i) {\n f(p[i]);\n }\n } else {\n f(p);\n } // end if\n } // end if there is object\n}", "function myForEach(arr, func) {\n\t//loop through array\n\tfor(var i = 0; i < arr.length; i++) {\n\t\t//call func for each item in array\n\t\t// func() -->\n\t\tfunc(arr[i]);\n\t}\n}", "function someRecursive(array, func){\n if(array.length === 0) return false;\n if(func(array[0])) return true;\n return someRecursive(array.slice(1), func);\n}", "recurseThis(callback) {\n function insideFunction(array) {\n for (const el of array) {\n if (callback(el)) {\n return el;\n } else if (el[\"nested\"]?.length > 0) {\n var hi = insideFunction(el[\"nested\"]);\n if (hi) {\n return hi;\n }\n }\n }\n }\n return insideFunction(App.todos);\n }", "function doSomeThing(arr, fn) {\n var newArr = [];\n for(var i = 0; i<arr.length; i++) {\n newArr.push(\n fn(arr[i])\n );\n }\n\n return newArr;\n}", "iter(obj) {\n\n if (obj[Symbol.iterator] !== void 0)\n return obj[Symbol.iterator]();\n\n if (Array.isArray(obj))\n return obj.values();\n\n return obj;\n }", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n }", "function deepMapValuesOrDirectCall(obj, f) {\n if (_.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n obj[i] = deepMapValuesOrDirectCall(obj[i], f);\n }\n return obj;\n } else if (_.isObject(obj)) {\n return _.deepMapValues(obj, f);\n } else {\n return f(obj);\n }\n}", "function runFunctionOnAllObjects(func_to_run, external_parameter){\r\n //func_to_run - any function from custom_functions.js\r\n //object_array = [loaded_objects]\r\n try{\r\n final_promise=final_promise.then(function(object_array){\r\n if (external_parameter!=null){\r\n object_array=func_to_run(object_array,external_parameter)\r\n }else{\r\n object_array=func_to_run(object_array)\r\n }\r\n return object_array\r\n });\r\n }\r\n catch (err){\r\n console.log('You need to put a comma after the function name')\r\n return object_array\r\n }\r\n }", "function each(collection, fn) {\n\t\t var i = 0,\n\t\t length = collection.length,\n\t\t cont;\n\t\t\n\t\t for(i; i < length; i++) {\n\t\t cont = fn(collection[i], i);\n\t\t if(cont === false) {\n\t\t break; //allow early exit\n\t\t }\n\t\t }\n\t\t }", "function each(object, callback, args) {\n\tif (!object) return;\n\tvar\n\tname,\n\ti = 0,\n\tlength = object.length,\n\tisObj = isUndefined(length) || isFunction(object);\n\t\n\tif (args) {\n\t\tif (isObj) {\n\t\t\tfor (name in object) {\n\t\t\t\tif (callback.apply(object[name], args) === FALSE) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor (; i < length; i++) {\n\t\t\t\tif (callback.apply(object[i], args) === FALSE) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else { // A special, fast, case for the most common use of each\n\t\tif (isObj) {\n\t\t\tfor (name in object) {\n\t\t\t\tif (callback.call(object[name], object[name], name) === FALSE) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor (; i < length; i++) {\n\t\t\t\tif (callback.call(object[i], object[i], i) === FALSE) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn object;\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for (i; i < length; i++) {\n cont = fn(collection[i], i);\n\n if (cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for (i; i < length; i++) {\n cont = fn(collection[i], i);\n\n if (cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for (i; i < length; i++) {\n cont = fn(collection[i], i);\n if (cont === false) {\n break; //allow early exit\n }\n }\n }", "function eachContinue(object, fn) {\n for (var key in object) {\n if (hasKey(object, key)) {\n if (!fn(key, object[key])) {\n break;\n }\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for(i; i < length; i++) {\n cont = fn(collection[i], i);\n if(cont === false) {\n break; //allow early exit\n }\n }\n}", "function each(collection, fn) {\n var i = 0,\n length = collection.length,\n cont;\n\n for (i; i < length; i++) {\n cont = fn(collection[i], i);\n if (cont === false) {\n break; //allow early exit\n }\n }\n}", "function forEach(arr, fun) { return HTMLCollection.prototype.each.call(arr, fun); }", "function recurse(value, fn, fnContinue) {\n\tfunction _recurse(value, fn, fnContinue, state) {\n\t\tvar error;\n\t\tif (state.objs.indexOf(value) !== -1) {\n\t\t\terror = new Error('Circular reference detected (' + state.path + ')');\n\t\t\terror.path = state.path;\n\t\t\tthrow error;\n\t\t}\n\t\tvar obj, key;\n\t\tif (fnContinue && fnContinue(value) === false) {\n\t\t\t// Skip value if necessary.\n\t\t\treturn value;\n\t\t} else if (_.isArray(value)) {\n\t\t\t// If value is an array, recurse.\n\t\t\treturn value.map(function(item, index) {\n\t\t\t\treturn _recurse(item, fn, fnContinue, {\n\t\t\t\t\tobjs: state.objs.concat([value]),\n\t\t\t\t\tpath: state.path + '[' + index + ']',\n\t\t\t\t});\n\t\t\t});\n\t\t} else if (_.isObject(value) && !Buffer.isBuffer(value)) {\n\t\t\t// If value is an object, recurse.\n\t\t\tobj = {};\n\t\t\tfor (key in value) {\n\t\t\t\tobj[key] = recurse(value[key], fn, fnContinue, {\n\t\t\t\t\tobjs: state.objs.concat([value]),\n\t\t\t\t\tpath: state.path + (/\\W/.test(key) ? '[\"' + key + '\"]' : '.' + key),\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn obj;\n\t\t} else {\n\t\t\t// Otherwise pass value into fn and return.\n\t\t\treturn fn(value);\n\t\t}\n\t}\n\treturn _recurse(value, fn, fnContinue, {\n\t\tobjs: [],\n\t\tpath: ''\n\t});\n}", "function tryThese() {\n for (var i=0; i < arguments.length; i++) {\n try {\n var item = arguments[i]() ;\n return item ;\n } catch (e) {}\n }\n return NO;\n }", "foreach(func){\n var data, _next;\n _next = this.next;\n this.next = null;\n\n while( (data = this.process()) != null )\n func(data);\n\n this.next = _next;\n }", "function forEach(obj, iterator, context) {\n if (obj === null) {\n return;\n }\n if (nativeForEach && obj.forEach === nativeForEach) {\n obj.forEach(iterator, context);\n } else if (obj.length === +obj.length) {\n for (var i = 0, l = obj.length; i < l; i += 1) {\n iterator.call(context, obj[i], i, obj);\n }\n } else {\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n }\n}", "function sc_forEach(proc, l1) {\n if (l1 === undefined)\n\treturn undefined;\n // else\n var nbApplyArgs = arguments.length - 1;\n var applyArgs = new Array(nbApplyArgs);\n while (l1 !== null) {\n\tfor (var i = 0; i < nbApplyArgs; i++) {\n\t applyArgs[i] = arguments[i + 1].car;\n\t arguments[i + 1] = arguments[i + 1].cdr;\n\t}\n\tproc.apply(null, applyArgs);\n }\n // add return so FF does not complain.\n return undefined;\n}" ]
[ "0.67102194", "0.6587491", "0.61599946", "0.6076382", "0.6076382", "0.6076382", "0.6076382", "0.6076382", "0.6076382", "0.6076382", "0.6076382", "0.6076382", "0.6076382", "0.6076382", "0.6076382", "0.6076382", "0.6076382", "0.6076382", "0.6076382", "0.6076382", "0.6076382", "0.6076382", "0.6076382", "0.6076382", "0.6013156", "0.60098165", "0.59864116", "0.59811836", "0.5957188", "0.59525007", "0.5940156", "0.5923626", "0.591972", "0.58504874", "0.5846057", "0.58387256", "0.5837025", "0.5834637", "0.5786236", "0.5780193", "0.5779847", "0.57413316", "0.5741318", "0.5727685", "0.56980854", "0.56928444", "0.5685558", "0.5673335", "0.56715477", "0.5667553", "0.5663594", "0.5652267", "0.56518537", "0.562273", "0.5621348", "0.5619002", "0.5612325", "0.5604366", "0.5586027", "0.5585798", "0.55672204", "0.5546201", "0.55320394", "0.55287635", "0.5524644", "0.5523464", "0.5513734", "0.5507332", "0.54981023", "0.54981023", "0.5493948", "0.5493394", "0.5488175", "0.5488175", "0.5488175", "0.5488175", "0.5488175", "0.5488175", "0.5488175", "0.5488175", "0.5488175", "0.5488175", "0.5488175", "0.5488175", "0.5488175", "0.5488175", "0.5488175", "0.5488175", "0.5488175", "0.5488175", "0.5488175", "0.5488175", "0.5488175", "0.54852897", "0.5482116", "0.547776", "0.54652375", "0.5456915", "0.5456743", "0.5455733" ]
0.55088645
67
If is a number, it will round it. If is an Array it will try to round it's contents. If is present, it will round to that decimal value. The default is 4.
function round(value, precision) { precision = precision || 4; if (isArray(value)) { for (var i = 0; i < value.length; i++) { value[i] = this.roundIfNumber(value[i], precision); } } else { value = roundIfNumber(value, precision); } return value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function roundNumbers(arr){\n let number = arr[0];\n let precision = arr[1] > 15 ? 15 : arr[1];\n\n return +number.toFixed(precision);\n}", "__round(arr, dp = 2, isSeries) {\n if (dp < 0) {\n dp = 1\n }\n if (isSeries) {\n\n let new_arr = []\n arr.map(val => {\n new_arr.push(Number(val.toFixed(dp)))\n })\n\n return new_arr\n } else {\n let result_arr = []\n arr.map(arr_ele => {\n let new_arr = []\n arr_ele.map(val => {\n new_arr.push(Number(val.toFixed(dp)))\n })\n result_arr.push(new_arr)\n })\n return result_arr\n }\n\n }", "function roundArray (array) {\n return array.map(function (val) {\n return parseFloat(val.toFixed(6))\n })\n}", "round(value) {\n return Math.round(value);\n }", "function round4( num ) {\n return Math.floor(num * 1000) / 1000;\n }", "function round(value) {\n return Math.round(value);\n}", "function roundme(val) {\n return val;\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(value)\n{\n\tvalue = +value.toFixed(3)\n\treturn value;\n}", "function round(a) {\n\t return Math.floor(a);\n\t }", "function round(a) {\n\t return Math.floor(a);\n\t }", "function round(a) {\n\t return Math.floor(a);\n\t }", "function round(a) {\n\t return Math.floor(a);\n\t }", "round(value) {\n const context = this.context;\n\n // eslint-disable-next-line\n if (value instanceof window.JQX.Utilities.BigNumber && typeof value._d === 'bigint') {\n return value;\n }\n else if (value instanceof window.JQX.Utilities.BigNumber === false ||\n !context._wordLengthNumber || context._wordLengthNumber < 64) {\n return new JQX.Utilities.BigNumber(Math.round(value.toString()));\n }\n\n const fraction = value.mod(1);\n\n if (!(fraction._d.length === 1 && fraction._d[0] === 0)) {\n // if the entered number is with a decimal value, it is rounded up or down to its nearest integer equivalent\n\n value = value.intPart();\n if (!value._s) {\n // round positive number\n if (fraction._d[1] > 4) {\n value = value.add(1);\n }\n }\n else {\n // round negative number\n if (fraction._d[1] > 5 ||\n fraction._d[1] === 5 && fraction._d[2]) {\n value = value.add(-1);\n }\n }\n }\n return value;\n }", "static round(a) {\n\t\treturn round(a);\n\t}", "function roundNum(num){\n return Math.round(num * 10) / 10;\n }", "function roundit(num,dex) {\n return parseFloat(num).toFixed(dex);\n }", "function roundIfNumber(value, precision) {\n\t if (typeof value === 'number') {\n\t value = Number(value.toPrecision(precision));\n\t }\n\t return value;\n\t}", "round(place = 0) {\r\n const factor = Math.pow(10, place)\r\n return FNumber(Math.round(this.data * factor) / factor)\r\n }", "function round(a) {\r\n return Math.floor(a);\r\n }", "function round(a) {\r\n return Math.floor(a);\r\n }", "function round(a) {\r\n return Math.floor(a);\r\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(num){\n return Math.round(num*10) / 10;\n }", "function roundValue(x) {\n return Math.round(x);\n}", "function ROUND(dt, state) {\n var stack = state.stack;\n var n = stack.pop();\n\n if (exports.DEBUG) {\n console.log(state.step, 'ROUND[]');\n }\n\n stack.push(state.round(n / 0x40) * 0x40);\n }", "function roundNumbers(arr) {\n\n for(var i = 0; i < arr.length; i++) {\n\n arr[i] = (Math.round((arr[i]*Math.pow(10,2))+(0.0001))/Math.pow(10,2)).toFixed(2);\n\n }\n\n return arr;\n\n}", "static roundNumber(value) {\n return Math.round(value);\n }", "function round(a) {\n\treturn parseInt(a*1E+5)/1E+5;\n}", "function floatNumbersRounding(number) {\n\n console.log(\"from floatnumberRoanding: \" +number);\n\n let result = 0;\n let placeholder\n // we need to split number to two parts\n let numberSpliter = number.toString();\n numberSpliter = numberSpliter.split(\".\");\n\n placeholder = numberSpliter;\n numberSpliter = parseInt(numberSpliter[1]);\n\n\n console.log(\"float section is:y \" + numberSpliter);\n \n if (numberSpliter != 5) {\n result = roundNumbersByFive(numberSpliter);\n if (result === 10) {\n result = parseInt(placeholder[0]);\n result += 1;\n }\n else {\n if (result === 5) {\n // convert array to number\n let placeholderIntNumber = placeholder[0];\n console.log(typeof placeholderIntNumber);\n result = parseFloat(placeholderIntNumber.concat(\".\", result));\n }\n else {\n result = parseInt(placeholder[0]);\n }\n }\n }\n else {\n result = number;\n }\n return result;\n}", "function formatNumber(obj){\n return Math.round(obj);\n }", "function round_to_sigfigs(val, sigfigs){\n return Number.parseFloat(val.toPrecision(sigfigs));\n}", "function round(num)\n{\n return (num*100|0)/100;\n}", "function opaqueAllTypesRound(argument) {\n return Math.round(argument);\n}", "static round(value, precision) {\n let multiplier = Math.pow(10, precision || 0);\n return Math.round(value * multiplier) / multiplier;\n }", "function roundNumber(value) {\r\n 'use strict';\r\n console.log(Math.floor(value));\r\n console.log(Math.round(value));\r\n}", "function round(value, fixed){\n\t\treturn parseFloat(Math.round(value * 10.0) / 10.0).toFixed(fixed);\n\t}", "function round(value, precision) {\n var multiplier = Math.pow(10, precision || 0);\n return Math.round(value * multiplier) / multiplier;\n }", "static round(number, precision) {\n\t\tlet pair = (number + \"e\").split(\"e\");\n\t\tlet value = Math.round(pair[0] + \"e\" + (+pair[1] + precision));\n\t\tpair = (value + \"e\").split(\"e\");\n\t\treturn +(pair[0] + \"e\" + (+pair[1] - precision));\n\t}", "function roundValues(value, precision) {\n var multiplier = Math.pow(10, precision || 0);\n return Math.round(value * multiplier) / multiplier;\n}", "function round(value, precision) {\n\t precision = precision || 0;\n\t\n\t value = ('' + value).split('e');\n\t value = Math.round(+(value[0] + 'e' + (value[1] ? +value[1] + precision : precision)));\n\t\n\t value = ('' + value).split('e');\n\t value = +(value[0] + 'e' + (value[1] ? +value[1] - precision : -precision));\n\t\n\t return value.toFixed(precision);\n\t}", "function rounding (number) {\n return Math.round(number)\n}", "function round(value, precision) {\r\n let multiplier = Math.pow(10, precision || 0);\r\n return Math.round(value * multiplier) / multiplier;\r\n}", "function round(value, precision) {\r\n let multiplier = Math.pow(10, precision || 0);\r\n return Math.round(value * multiplier) / multiplier;\r\n}", "function roundArray(float_array,round_to){\n\n\tvar round =function (array,round_num){\n\n\t\tif(!round_num) var round_num = 2;\n\n\t\tfor (var i= 0; i<array.length; i++ ){\n\n\t\t\tarray[i] = array[i].toFixed(round_num);\n\n\t\t}\n\t}\n\n\n\tvar newArray = float_array.slice();\n\n\tround(newArray,round_to);\n\n\t//console.log(newArray);\n\n\treturn newArray;\n\n}", "function round(value, precision) {\n var multiplier = Math.pow(10, precision || 0);\n return Math.round(value * multiplier) / multiplier;\n}", "function round(value, precision) {\n var multiplier = Math.pow(10, precision || 0);\n return Math.round(value * multiplier) / multiplier;\n}", "function round(value, precision) {\n var multiplier = Math.pow(10, precision || 0);\n return Math.round(value * multiplier) / multiplier;\n}", "function round(number, precision)\r\n{\r\n divisor = Math.pow(10, precision);\r\n return Math.round(number * divisor) / divisor;\r\n}", "function round5(num, strokeWidth) {\r\n var ret;\r\n strokeWidth = numb(strokeWidth);\r\n if (strokeWidth%2) {\r\n ret = num;\r\n }\r\n else {\r\n ret = Math.round(num - .5) + .5;\r\n }\r\n return ret;\r\n }", "function round(x) {\n return Math.round( x * 1000) / 1000;\n }", "_round(x) {\n\t\treturn Math.round( x * 1000) / 1000;\n\t}", "function roundArray(arr, digits){\n\tvar temp = [];\n\tvar multiplier = Math.pow(10, digits);\n\tfor (var i = 0; i < arr.length; ++i) {\n\t\ttemp[i] = Math.round(arr[i] * multiplier) / multiplier;\n\t}\n\treturn temp;\n}", "function round(num, prec, mode) {\n mode = mode || 'normal';\n var func = {\n normal: Math.round,\n up: Math.ceil,\n down: Math.floor\n }[mode];\n var k = Math.pow(0.1, prec);\n return func(num / k) * k;\n}", "function ROUND(dt, state) {\n var stack = state.stack;\n var n = stack.pop();\n\n if (DEBUG) console.log(state.step, 'ROUND[]');\n\n stack.push(state.round(n / 0x40) * 0x40);\n}", "function roundIt(value) {\n let places = 100;\n if (value < 100) {\n places = 10000;\n } else if (value < 0.001) {\n places = 1000000;\n }\n return Math.round((value + Number.EPSILON) * places) / places;\n }", "function round(x) {\r\n return Math.round(x * 1000) / 1000;\r\n }", "function round(x) {\r\n return Math.round(x * 1000) / 1000;\r\n }", "function round(x) {\r\n return Math.round(x * 1000) / 1000;\r\n }", "function round(x) {\r\n return Math.round(x * 1000) / 1000;\r\n }", "function roundNumInArr(array, newArray) {\n for (var i = 0; i < array.length; i++) {\n newArray.push(Math.round(array[i]));\n }\n}", "function roundNumber(v) {\n\treturn parseFloat(parseFloat(v).toFixed(2));\n}", "function ROUND(dt, state) {\n const stack = state.stack;\n const n = stack.pop();\n\n if (exports.DEBUG) console.log(state.step, 'ROUND[]');\n\n stack.push(state.round(n / 0x40) * 0x40);\n}", "function round(value, precision) {\n precision = precision || 0;\n\n value = ('' + value).split('e');\n value = Math.round(+(value[0] + 'e' + (value[1] ? +value[1] + precision : precision)));\n\n value = ('' + value).split('e');\n value = +(value[0] + 'e' + (value[1] ? +value[1] - precision : -precision));\n\n return value.toFixed(precision);\n}", "function round(value, precision) {\n precision = precision || 0;\n\n value = ('' + value).split('e');\n value = Math.round(+(value[0] + 'e' + (value[1] ? +value[1] + precision : precision)));\n\n value = ('' + value).split('e');\n value = +(value[0] + 'e' + (value[1] ? +value[1] - precision : -precision));\n\n return value.toFixed(precision);\n}", "function roundNum(num){\n return Number(num.toFixed(2));\n}", "function digits(value, round) {\n return parseFloat(value.toFixed(round));\n }", "function round(x) {\n\treturn Math.round( x * 1000) / 1000;\n}", "function roundC(v) {\r\n return Math.round(v*10)/10;\r\n}", "function Round(x){\nif (x <0.001) {x = \"<0.001\"};\nif (x >1) {x = \"1.0000\"};\nreturn x;\n}", "function round(radius){\n areaOfCircle(radius)\n roundIt = area.toFixed(2)\n return roundIt;\n}", "function round( nr ) {\n\t\treturn Math.round( 100*nr )/100;\n\t}", "function preciseRound(num, d){\n if (typeof num !== 'number' || typeof d !== 'number'){\n return \"not a number\";\n }\n return num.toFixed(d);\n}", "function roundTo3(num) {\r\n 'use strict';\r\n var postDecimal;\r\n\r\n postDecimal = num.toString().split(\".\")[1];\r\n\r\n if (!!postDecimal && postDecimal.length > 3) {\r\n return num.toFixed(3);\r\n }\r\n\r\n return num;\r\n}", "function roundNumbersToNearest(arr) {\n\n for(var i = 0; i < arr.length; i++) {\n\n arr[i] = Math.round(arr[i]);\n\n }\n\n return arr;\n\n}", "function round(value, precision, floor) {\n if (!_Type__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"](precision) || precision <= 0) {\n var rounded = Math.round(value);\n if (floor) {\n if (rounded - value == 0.5) {\n rounded--;\n }\n }\n return rounded;\n }\n else {\n var d = Math.pow(10, precision);\n return Math.round(value * d) / d;\n }\n}", "function round(value, precision) {\n precision = precision || 0;\n\n value = ('' + value).split('e');\n value = Math.round(+(value[0] + 'e' + (value[1] ? (+value[1] + precision) : precision)));\n\n value = ('' + value).split('e');\n value = +(value[0] + 'e' + (value[1] ? (+value[1] - precision) : -precision));\n\n return value.toFixed(precision);\n}", "function round(x) {\n\t\treturn Math.round( x * 1000) / 1000;\n\t}", "function round(x) {\n\t\treturn Math.round( x * 1000) / 1000;\n\t}", "function round(num) {\n return Math.round(num * 100) / 100;\n }", "function round(number) {\n return floor(number + 0.5);\n}", "function round(value, decimals) {\n if (typeof value !== \"number\") {return value};\n return Number(Math.round(value+'e'+decimals)+'e-'+decimals);\n}", "function evaluateAndRound(node) {\n let result = evaluate(node);\n if (Math.abs(result) < 1) {\n result = parseFloat(result.toPrecision(4));\n }\n else {\n result = parseFloat(result.toFixed(4));\n }\n return result;\n}", "function roundTo(value, x) {\n return Math.round(value / x) * x;\n}", "function round(number) {\n return Math.round(number * 100) / 100;\n}" ]
[ "0.67224723", "0.6514573", "0.6401076", "0.63434494", "0.63315237", "0.6267124", "0.61346567", "0.6091439", "0.608804", "0.60773957", "0.6047535", "0.6047535", "0.6047535", "0.6027353", "0.60267293", "0.600914", "0.60087115", "0.59910095", "0.59706706", "0.5963209", "0.5963209", "0.5963209", "0.595596", "0.595596", "0.595596", "0.595596", "0.595596", "0.595596", "0.595596", "0.595596", "0.595596", "0.595596", "0.595596", "0.595596", "0.595596", "0.595596", "0.595596", "0.595596", "0.5945388", "0.5937064", "0.59337157", "0.59240514", "0.59162", "0.58887726", "0.5877919", "0.5876174", "0.5859744", "0.5854523", "0.58437985", "0.583923", "0.5824279", "0.58120203", "0.58035403", "0.57968974", "0.57874197", "0.5781514", "0.5760851", "0.57561815", "0.57561815", "0.5734537", "0.5731148", "0.5731148", "0.5731148", "0.5728966", "0.5722957", "0.5713144", "0.5708387", "0.57081157", "0.5697662", "0.56870484", "0.56719714", "0.5671588", "0.5671588", "0.5671588", "0.5671588", "0.56546116", "0.56509215", "0.56343365", "0.56261337", "0.56261337", "0.5608758", "0.56078345", "0.55982184", "0.55853677", "0.5584114", "0.5583443", "0.5581288", "0.5578022", "0.5577541", "0.5568099", "0.55642074", "0.5562506", "0.5559225", "0.5559225", "0.55563813", "0.5555772", "0.5552435", "0.5545734", "0.55399877", "0.5536757" ]
0.6850762
0
If is a number, we round it to whatever the current setting is at.
function roundIfNumber(value, precision) { if (typeof value === 'number') { value = Number(value.toPrecision(precision)); } return value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function roundme(val) {\n return val;\n }", "round(value) {\n const context = this.context;\n\n // eslint-disable-next-line\n if (value instanceof window.JQX.Utilities.BigNumber && typeof value._d === 'bigint') {\n return value;\n }\n else if (value instanceof window.JQX.Utilities.BigNumber === false ||\n !context._wordLengthNumber || context._wordLengthNumber < 64) {\n return new JQX.Utilities.BigNumber(Math.round(value.toString()));\n }\n\n const fraction = value.mod(1);\n\n if (!(fraction._d.length === 1 && fraction._d[0] === 0)) {\n // if the entered number is with a decimal value, it is rounded up or down to its nearest integer equivalent\n\n value = value.intPart();\n if (!value._s) {\n // round positive number\n if (fraction._d[1] > 4) {\n value = value.add(1);\n }\n }\n else {\n // round negative number\n if (fraction._d[1] > 5 ||\n fraction._d[1] === 5 && fraction._d[2]) {\n value = value.add(-1);\n }\n }\n }\n return value;\n }", "round(value) {\n return Math.round(value);\n }", "function roundValue(x) {\n return Math.round(x);\n}", "function roundToOne(num) { \n return +(Math.round(num + \"e+1\") + \"e-1\");\n }", "static roundNumber(value) {\n return Math.round(value);\n }", "function roundNum(num){\n return Math.round(num * 10) / 10;\n }", "function round(value) {\n return Math.round(value);\n}", "function Round(x){\nif (x <0.001) {x = \"<0.001\"};\nif (x >1) {x = \"1.0000\"};\nreturn x;\n}", "function rounding (number) {\n return Math.round(number)\n}", "function round(num){\n return Math.round(num*10) / 10;\n }", "function round(a) {\n return Math.floor(a);\n }", "function roundNumber(value) {\r\n 'use strict';\r\n console.log(Math.floor(value));\r\n console.log(Math.round(value));\r\n}", "function round(a) {\n\t return Math.floor(a);\n\t }", "_round(x) {\n\t\treturn Math.round( x * 1000) / 1000;\n\t}", "function round(a) {\n\t return Math.floor(a);\n\t }", "function round(a) {\n\t return Math.floor(a);\n\t }", "function round(a) {\n\t return Math.floor(a);\n\t }", "function formatNumber(obj){\n return Math.round(obj);\n }", "round(place = 0) {\r\n const factor = Math.pow(10, place)\r\n return FNumber(Math.round(this.data * factor) / factor)\r\n }", "function roundTo(value, x) {\n return Math.round(value / x) * x;\n}", "function round(a) {\r\n return Math.floor(a);\r\n }", "function round(a) {\r\n return Math.floor(a);\r\n }", "function round(a) {\r\n return Math.floor(a);\r\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function round(a) {\n return Math.floor(a);\n }", "function roundit(num,dex) {\n return parseFloat(num).toFixed(dex);\n }", "roundNumber(num, scale)\n {\n if(!(\"\" + num).includes(\"e\")) { //isn't 'e' number\n let ret = +(Math.round(num + \"e+\" + scale) + \"e-\" + scale);\n let decPlaces = (\"\" + ret).split(\".\"); //bc JS is weird\n if(decPlaces.length > 1) {\n ret = decPlaces[1].length === 1 ? ret + \"0\" : ret; //Add 0 on the end so not to get confused for user.\n }\n return ret;\n }\n else {\n var arr = (\"\" + num).split(\"e\"); //Lack of being typestrong strikes again.\n var sig = \"\";\n if(+arr[1] + scale > 0) {\n sig = \"+\";\n }\n return +(Math.round(+arr[0] + \"e\" + sig + (+arr[1] + scale)) + \"e-\" + scale);\n }\n }", "function round_to(x, num) {\n\tvar r = x.toFixed(num) + \"\";\n\tif (r.match('.'))\n\t\treturn r.replace(/\\.?0+$/,'');\n\treturn r;\n}", "function getRoundedValue(v) {\n return config.value_resolution === null ? v : Math.round(v / config.value_resolution) * config.value_resolution;\n }", "function round(num, prec, mode) {\n mode = mode || 'normal';\n var func = {\n normal: Math.round,\n up: Math.ceil,\n down: Math.floor\n }[mode];\n var k = Math.pow(0.1, prec);\n return func(num / k) * k;\n}", "function roundTo(value, base){\n\t\t\treturn Math.floor((value + base / 2) / base) * base;\n\t\t}", "function round(number,X) {\n X = (!X ? 2 : X);\n return Math.round(number*Math.pow(10,X))/Math.pow(10,X);\n }", "function round(value)\n{\n\tvalue = +value.toFixed(3)\n\treturn value;\n}", "function roundNum(num, point) {\n return 1 * num.toFixed(point);\n}", "function round(number_in,numDigits) {\n //\n if (number_in === '') {console.log('Error: round requires number arg',console.log(number_in),console.log(numDigits));return 0.0;}\n if (numDigits === '') {console.log('Error: round requires numDigits arg',console.log(number_in),console.log(numDigits));return 0.0;}\n //\n var number = Number(number_in);\n numDigits = Number(numDigits);\n //\n var scale = Math.pow(10,numDigits);\n number = number * scale;\n number = Math.round(number)/scale;\n //\n if (isFinite(number)) {\n return(number);\n }\n else {\n console.log('Warning: Non-Finite number: '+number_in);\n return 0;\n }\n}", "function round(value, fixed){\n\t\treturn parseFloat(Math.round(value * 10.0) / 10.0).toFixed(fixed);\n\t}", "function roundNum(num){\n return Number(num.toFixed(2));\n}", "function round(x) {\r\n return Math.round(x * 1000) / 1000;\r\n }", "function round(x) {\r\n return Math.round(x * 1000) / 1000;\r\n }", "function round(x) {\r\n return Math.round(x * 1000) / 1000;\r\n }", "function round(x) {\r\n return Math.round(x * 1000) / 1000;\r\n }", "function round(x) {\n return Math.round( x * 1000) / 1000;\n }", "function _roundNumber(value, scale, mode) {\n var rounded;\n var adjustedMode = mode;\n var parts = value.toString().split('.');\n if (parts[1] === undefined) {\n return Math.abs(value);\n }\n if (mode !== 'DEFAULT') {\n // HALF_DOWN behaves as HALF_UP if the discarded fraction is > 0.5\n if (mode === 'HALF_UP' || mode === 'HALF_EVEN' || mode === 'HALF_DOWN') {\n if (parts[1][scale] === '5') {\n var n = parts[1].substr(scale);\n n = parseInt(n, 10);\n if (n > 5) {\n adjustedMode = 'HALF_UP';\n }\n } else {\n adjustedMode = 'DEFAULT';\n }\n // eslint-disable-next-line no-param-reassign\n value = Math.abs(value);\n }\n adjustedMode = _getRoundingMode(parts, adjustedMode, scale, value);\n rounded = _decimalAdjust(value, -scale, adjustedMode);\n } else {\n var factor = Math.pow(10, scale);\n rounded = Math.round(value * factor) / factor;\n if (!isFinite(rounded)) {\n return value;\n }\n }\n return Math.abs(rounded);\n }", "snapToGrip (val) {\n return parseFloat((this.gridResolution * Math.round(val / this.gridResolution)).toFixed(2));\n }", "static round(a) {\n\t\treturn round(a);\n\t}", "function round(num) {\n return Math.floor(num * 1000) / 1000;\n}", "function round(a) {\n\treturn parseInt(a*1E+5)/1E+5;\n}", "function round(number) {\n return floor(number + 0.5);\n}", "function round(num)\n{\n return (num*100|0)/100;\n}", "function conditionalRound(value, roundingMode) {\n if (!roundingMode) {\n return value;\n }\n switch (roundingMode) {\n case 'round':\n // used for Caffe Conv\n return Math.round(value);\n case 'ceil':\n // used for Caffe Pool\n return Math.ceil(value);\n case 'floor':\n return Math.floor(value);\n default:\n throw new Error(\"Unknown roundingMode \" + roundingMode);\n }\n}", "function round(control) \n{ \n ans = control.value * 1000 \n ans = Math.round(ans /10) + \"\" \n while (ans.length < 3) {ans = \"0\" + ans} \n len = ans.length \n ans = ans.substring(0,len-2) + \".\" + ans.substring(len-2,len)\n control.value = ans; \n}", "function roundUsing(number, prec) {\n var tempnumber = number * Math.pow(10, prec);\n tempnumber = Math.round(tempnumber);\n return tempnumber / Math.pow(10, prec);\n}", "function roundNumber(v) {\n\treturn parseFloat(parseFloat(v).toFixed(2));\n}", "function roundIt(value) {\n let places = 100;\n if (value < 100) {\n places = 10000;\n } else if (value < 0.001) {\n places = 1000000;\n }\n return Math.round((value + Number.EPSILON) * places) / places;\n }", "function round_x(x) {\n var out = parseFloat(parseFloat(x).toFixed(DECIMALS));\n return out;\n}", "function opaqueRoundForSideEffects(argument) {\n return Math.round(argument);\n}", "function round(x) {\n\t\treturn Math.round( x * 1000) / 1000;\n\t}", "function round(x) {\n\t\treturn Math.round( x * 1000) / 1000;\n\t}", "function getRoundNumber(number){\n return Math.round(\n Number(number)\n );\n}", "function round(value, roundingMode) {\n if (!roundingMode) {\n return Math.trunc(value);\n }\n switch (roundingMode) {\n case 'round':\n // used for Caffe Conv\n return Math.round(value);\n case 'ceil':\n // used for Caffe Pool\n return Math.ceil(value);\n case 'floor':\n return Math.floor(value);\n default:\n throw new Error(`Unknown roundingMode ${roundingMode}`);\n }\n}", "function round(x) {\n\treturn Math.round( x * 1000) / 1000;\n}", "function ourOwnRound(theNumber) {\n\n // Create a variable \"results\" with no value given\n var results;\n // Using the % equation, we can extra the decimal place, and store it in \"decimalOFTheNUmber\"\n var decimalOfTheNumber = theNumber % 1;\n\n // WE text the decimal value in \"decimalOfTheNumber\" and test if it is larger or smaller the then .5.....\n if (decimalOfTheNumber >= .5){\n //.... If it is larger, we round the orignal number stored in \"theNumber\" and store that in the results variable.\n results = Math.ceil(theNumber);\n }\n\n else {\n //.....If it is smaller, we round the original number stored in \"theNumber\" and sotre that in the results variable.\n results = Math.floor(theNumber);\n }\n\n // Return the value of results to where ever this function was called.\n return results;\n}", "function round(number,decimal_points) {\r\n\tif (number == null) return 'NaN';\r\n\tif (!decimal_points || decimal_points == null) return Math.round(number);\r\n\tvar exp = Math.pow(10, decimal_points);\r\n\tnumber = Math.round(number * exp) / exp;\r\n\treturn parseFloat(number.toFixed(decimal_points));\r\n}", "normalizeValue(val){\n val = Number(val);\n if(val % 1 != 0) val = parseFloat(val.toFixed(2));\n return val;\n }", "convertValue(value) {\n if (this.dtype == null || this.dtype === 'float32') {\n return value;\n }\n return Math.round(value);\n }", "function round(num, dp){\n\treturn Math.round((num * (Math.pow(10, dp))))/Math.pow(10, dp);\n}", "function roundToNearestHundreth(x){\n return (x).toFixed(2);\n }", "function round(num) {\n return Math.round(num * 100) / 100;\n }", "function preciseRound(num, d){\n if (typeof num !== 'number' || typeof d !== 'number'){\n return \"not a number\";\n }\n return num.toFixed(d);\n}", "function round(value) {\r\n return Number(Math.round(value+'e'+2)+'e-'+2);\r\n}", "function evaluateAndRound(node) {\n let result = evaluate(node);\n if (Math.abs(result) < 1) {\n result = parseFloat(result.toPrecision(4));\n }\n else {\n result = parseFloat(result.toFixed(4));\n }\n return result;\n}", "function round_s(result){\n var resultI=Math.round(result * 1e5);\n if(Math.abs(resultI - result * 1e5) < eps) result = resultI / 1e5;\n return result;\n }", "function ROUND(dt, state) {\n var stack = state.stack;\n var n = stack.pop();\n\n if (exports.DEBUG) {\n console.log(state.step, 'ROUND[]');\n }\n\n stack.push(state.round(n / 0x40) * 0x40);\n }", "function round_to_sigfigs(val, sigfigs){\n return Number.parseFloat(val.toPrecision(sigfigs));\n}", "function round(num, dp) {\n return Math.round(num * Math.pow(10, dp)) / Math.pow(10, dp);\n}", "function round(num, p) {\n let m = Math.pow(10, p);\n return Math.round(num * m) / m;\n}", "function roundDecimalX(num, x) {\n if (x > 0) {\n var rounder = 10 ** x;\n return Math.round(num * rounder) / rounder;\n } else return num;\n}", "function roundedFloating(number){\n if(typeof number === \"number\" && !isNaN(number)){\n return Math.floor(parseFloat(number));\n }else {\n return false;\n }\n}", "function round(num) {\n return Math.round((num + Number.EPSILON) * 100) / 100;\n}", "function roundToQuanta(value, quanta) {\n var multiple = Math.round(value / quanta);\n return multiple * quanta;\n }", "function roundOneDec(x) {\n return (Math.round((x) * 10) / 10);\n }", "function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }", "function quickRound (num) {\n return (0.5 + num) << 0;\n}", "function roundNumber(rnum, rlength) {\r\n var newnumber = Math.round(rnum * Math.pow(10, rlength)) / Math.pow(10, rlength);\r\n return parseFloat(newnumber); \r\n}", "function removeDecimal(number){\n return Math.round(number)\n }" ]
[ "0.73870987", "0.6828576", "0.67663556", "0.6619762", "0.658353", "0.6573355", "0.6557229", "0.6469224", "0.6461486", "0.6436302", "0.64319086", "0.6428056", "0.6422254", "0.6416061", "0.64107734", "0.63939893", "0.63939893", "0.63939893", "0.63685", "0.6366713", "0.6361206", "0.63468605", "0.63468605", "0.63468605", "0.63423836", "0.63423836", "0.63423836", "0.63423836", "0.63423836", "0.63423836", "0.63423836", "0.63423836", "0.63423836", "0.63423836", "0.63423836", "0.63423836", "0.63423836", "0.63423836", "0.63423836", "0.63423836", "0.6301055", "0.62806535", "0.6185814", "0.61809593", "0.6155799", "0.6151547", "0.61478764", "0.61384803", "0.611601", "0.6064071", "0.6060657", "0.6053597", "0.6041366", "0.6041366", "0.6041366", "0.6041366", "0.6034028", "0.60223204", "0.6002782", "0.6000478", "0.59928334", "0.5980679", "0.59760785", "0.5974575", "0.59745157", "0.59741324", "0.59580183", "0.59370893", "0.5929498", "0.5912972", "0.5903954", "0.5903383", "0.5903383", "0.58951735", "0.58870703", "0.5886743", "0.5882091", "0.58683866", "0.5858191", "0.5847832", "0.58401597", "0.5840023", "0.5826128", "0.5820611", "0.58162254", "0.5809203", "0.5802826", "0.5801708", "0.5798373", "0.5779472", "0.57768565", "0.57538354", "0.57519287", "0.5748055", "0.5743853", "0.5741335", "0.5741275", "0.57399553", "0.5732838", "0.5731839" ]
0.6511679
7
Checks the time of day and returns the appropriate URL to hit based on train station.
function buildTrainApiURl() { // if (new Date().getHours() >= 11) { // return 'https://huxley2.azurewebsites.net/delays/read/30?accessToken=b09cb836-f190-445d-8b96-372eb024141d&expand=true'; // } else { // return 'https://huxley2.azurewebsites.net/delays/tot/30?accessToken=b09cb836-f190-445d-8b96-372eb024141d&expand=true'; // } return 'https://huxley2.azurewebsites.net/delays/tot/30?accessToken=b09cb836-f190-445d-8b96-372eb024141d&expand=true'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chooseCorrectStation() {\n\n // If we are in the afternoon look for return trip to Woking\n if (new Date().getHours() >= 11) {\n return 'Woking';\n } else {\n return 'Guildford';\n }\n\n}", "function getTrainStatus(sender,trainNo,date){\n\n\trequest('http://api.railwayapi.com/live/train/'+ trainNo +'/doj/'+ date +'/apikey/'+ apiKey, (err, response, body) => {\n\t if(JSON.parse(body).error === \"Quota exhausted for day\"){\n\t sendText(sender,JSON.parse(body).error);\n\t }else if(JSON.parse(body).error == 510){\n sendText(sender,\"Train not scheduled to run on the given date.\");\n\n\t }else{\n var string = JSON.stringify(JSON.parse(body).position);\n\n\t if(JSON.parse(body).position != \"-\"){\n if(string.includes(\"reached Destination\")){\n sendText(sender,JSON.parse(body).position);\n }else{\n sendText(sender,JSON.parse(body).position);\n\n var routeLength = JSON.parse(body).route;\n for(var i=0;i<routeLength.length;i++){\n if(!JSON.parse(body).route[i].has_arived && !JSON.parse(body).route[i].has_departed){\n sendText(sender,\"Next Station is \"+ JSON.parse(body).route[i].station_.name +\"\\nExpected Arrival is \"+ JSON.parse(body).route[i].actarr +\" Hrs\");\n break;\n }\n }\n\n for(var i=0;i<routeLength.length;i++){\n if(JSON.parse(body).route[i].schdep === \"Destination\"){\n\n if(JSON.parse(body).route[i].latemin != 0){\n sendText(sender,\"Train will reach it's destination \"+ JSON.parse(body).route[i].station_.name + \", \"+ JSON.parse(body).route[i].latemin\n + \" Mins from it's scheduled time \"+ JSON.parse(body).route[i].scharr +\" Hrs. That is \" + JSON.parse(body).route[i].actarr + \" Hrs.\");\n break;\n }else{\n sendText(sender,\"Train will reach it's destination \"+ JSON.parse(body).route[i].station_.name +\" in it's scheduled time \"+ JSON.parse(body).route[i].scharr + \" Hrs\");\n break;\n }\n\n }\n }\n\n }\n\n }else{\n sendText(sender,\"I don't think it's running today.\")\n }\n\n\n\t }\n\t});\n}", "function createUrl() {\n todaysDate = moment().format(\"YYYY-MM-DD\");\n return movieAndDinnerObject.movieShowtimeUrl + todaysDate + \"&lat=\" + movieAndDinnerObject.lat + \"&lng=\" + movieAndDinnerObject.long + movieAndDinnerObject.movieShowtimeAPIKey\n // http://data.tmsapi.com/v1.1/movies/showings?startDate=2019-04-10&lat=32.876709&lng=-117.206601&api_key=stp9q5rsr8afbrsfmmzvzubz\n }", "function getHuntlyUrl() {\n // var currentTime = getCurrentTime();\n // var currentDay = currentTime.getDay();\n var contestId = 340;//contestIdMapping[currentDay];\n if (contestId) {\n return null; //'https://srv.huntlyapp.com/deployments/' + deploymentId + '/leaderboards/' + contestId + '/topten ';\n } else {\n return null;\n }\n }", "function checkRoute() {\n\tconst targetWeek = JSON.parse(localStorage.getItem('TargetWeek'));\n\tif (targetWeek === null) {\n\t\tgetThisWeeksEntries();\n\t} else {\n\t\tgetPreviousWeeksEntries(targetWeek);\n\t}\n}", "function onEachStation(feature, layer) {\n if (feature.properties && feature.properties[\"SITE NAME\"]) {\n var baseURL = \"http://www.co.thurston.wa.us/monitoring/\";\n var link = \"\";\n switch (feature.properties[\"SITE CODE\"]) {\n case '13u': link = '<a href=\"' + baseURL + 'precip/precip-lawrence.html\">Details</a>'; break;\n case '11w': link = '<a href=\"' + baseURL + 'precip/precip-Rainier.htm\">Details</a>'; break;\n case '05u': link = '<a href=\"' + baseURL + 'precip/precip-yelm.htm\">Details</a>'; break;\n case '23u': link = '<a href=\"' + baseURL + 'precip/precip-percival.htm\">Details</a>'; break;\n case '27u': link = '<a href=\"' + baseURL + 'precip/precip-bostonharbor.html\">Details</a>'; break;\n case '32u': link = '<a href=\"' + baseURL + 'precip/precip-greencove.html\">Details</a>'; break;\n case '45u': link = '<a href=\"' + baseURL + 'precip/precip-blackriver.html\">Details</a>'; break;\n case '45w': link = '<a href=\"' + baseURL + 'precip/precip-rochester.htm\">Details</a>'; break;\n case '55u': link = '<a href=\"' + baseURL + 'precip/precip-tenino.html\">Details</a>'; break;\n case '59u': link = '<a href=\"' + baseURL + 'precip/precip-skookumchuck.html\">Details</a>'; break;\n case '60u': link = '<a href=\"' + baseURL + 'precip/precip-skookumchuck.html\">Details</a>'; break;\n case '65u': link = '<a href=\"' + baseURL + 'precip/precip-grandmound.html\">Details</a>'; break;\n case '69u': link = '<a href=\"' + baseURL + 'precip/precip-summit.html\">Details</a>'; break;\n }\n layer.bindPopup('<strong>' + \n feature.properties[\"SITE CODE\"] + \": \" +\n feature.properties[\"SITE NAME\"] + \n '</strong>' + \"</br>\" +\n link);\n }\n}", "function generateISSURL(searchTimestamp) {\n // past/future date and time\n if (searchTimestamp) {\n return `https://api.wheretheiss.at/v1/satellites/25544?timestamp=${searchTimestamp}`;\n }\n // current date and time\n else {\n return `https://api.wheretheiss.at/v1/satellites/25544`;\n }\n}", "async function getTrainDetails() {\n\n // Hit the train API\n const trainApiUrl = buildTrainApiURl();\n const trainResult = await logFetch(trainApiUrl);\n\n // Loop & sort through the results\n if (trainResult.trainServices && trainResult.trainServices.length > 0) {\n\n // Loop through the results\n for (i = 0; i < trainResult.trainServices.length; i++) {\n\n // We've got a hit, return immediately.\n if (trainResult.trainServices[i].subsequentCallingPoints == null) {\n trainTime.innerHTML = \"<img src='img/train-time.svg' width='70px' /><br>\" + trainResult.trainServices[i].sta + \" to \" + chooseCorrectStation() + \"<br>\" + trainResult.trainServices[i].eta;\n } else {\n // Loop through the subsequent calling points\n for (y = 0; y < trainResult.trainServices[i].subsequentCallingPoints[0].callingPoint.length; y++) {\n\n if (trainResult.trainServices[i].subsequentCallingPoints[0].callingPoint[y].locationName === chooseCorrectStation()) {\n trainTime.innerHTML = \"<img src='img/train-time.svg' width='70px' /><br>\" + trainResult.trainServices[i].std + \" to \" + chooseCorrectStation() + \"<br>\" + trainResult.trainServices[i].eta;\n }\n }\n }\n }\n }\n}", "function getStationsUrl(ext) {\r\n //attr = $(\"#attr\").val();\r\n var url = baseERDDAP;\r\n url += ext+'?station,time,'+attr\r\n \r\n if (($(\"#onlyQC\").prop('checked')) && (flagsArr.indexOf(attr) > -1)) {\r\n url += '&'+attr+'_flagPrimary=1';\r\n }\r\n //url += appendTime;\r\n url += timeUrl();\r\n return url;\r\n}", "function getTheUrl() {\n var nhlJsonUrl = urlPrefix + '/api/v1/schedule?date=' + getTheDates();\n console.log(\"getTheUrl(): [\" + nhlJsonUrl + \"]\");\n return nhlJsonUrl;\n}", "function findStations(userLat,userLon) {\n \n // log the users coordinates just to check\n console.log(userLat + \",\" + userLon);\n \n // construct the url to get the closest stations from the API\n var getStationsURL = \"https://data.gov.uk/data/api/service/transport/naptan_railway_stations/nearest?lat=\" + userLat + \"&lon=\" + userLon;\n \n // log the url just for reference\n console.log(getStationsURL);\n \n // update user on progress\n findLocMsg.innerHTML = \"Searching for stations...\";\n \n \n // ajax request to get the data stored in the API\n var locateStationReq = new XMLHttpRequest();\n \n // open the request\n locateStationReq.open('GET', getStationsURL, true);\n \n // run this function when request has been opened\n locateStationReq.onload = function() {\n \n // if the request is successful, do something\n if (locateStationReq.status >= 200 && locateStationReq.status < 400) {\n \n // the request was successful\n // variable to store the data from API request\n var stationData = JSON.parse(locateStationReq.responseText);\n \n // log the data to console just to confirm it works\n console.log(stationData);\n \n // variable to store individual results in an array\n var stationDataResults = stationData.result;\n \n // variables for the elements required to show data to user\n var stationCode = document.querySelectorAll(\".station_code\"),\n stationName = document.querySelectorAll(\".station_name\");\n \n // for loop to get the stations\n for (i = 0; i < 5; i++) {\n \n // log the information for each station\n console.log(stationDataResults[i])\n \n // variable to store individual data from json data\n var jsonStationName = stationDataResults[i].stationname,\n jsonStationCode = stationDataResults[i].crscode,\n // to remove the \"Rail Station\" string\n jsonStationName = jsonStationName.replace(\" Rail Station\", \"\");\n \n // log each piece of data for each station\n console.log(\"Station Name: \" + jsonStationName + \" & Station Code: \" + jsonStationCode);\n \n // add station info to html\n stationName[i].innerHTML = jsonStationName;\n stationCode[i].innerHTML = jsonStationCode;\n \n // generate a url for the API request for transportAPI\n var transportAPI_url = \"https://transportapi.com/v3/uk/train/station/\"+ jsonStationCode +\"/live.json?app_id=221cce2f&app_key=d209929236fc97196775650c2bdb639e&darwin=false&train_status=passenger\"\n \n // push urls in to an array\n requestURL_arr.push(transportAPI_url);\n \n }\n \n // return the data to be used in the timetable data request function\n return timetableDataReq(requestURL_arr, jsonStationCode);\n \n \n // if request is not successful, do this\n } else {\n // We reached our target server, but it returned an error\n }\n };\n // if there is an error with the request, run this function\n locateStationReq.onerror = function() {\n // There was a connection error of some sort\n };\n \n // send the request\n locateStationReq.send();\n \n}", "function getNextTrains(direction,stop_id,stationClicked) { \n var nextThree; \n if (direction == 'south') {\n var stop_headsign = 'Century%20Park';\n } else {\n var stop_headsign = 'Clareview';\n }\n var etsUrl = 'https://data.edmonton.ca/resource/xeux-ngrz.json?$query=SELECT%20arrival_time_2%20WHERE%20stop_id=%22'+stop_id+'%22%20AND%20stop_headsign=%22'+stop_headsign+'%22%20GROUP%20BY%20arrival_time_2%20ORDER%20BY%20arrival_time_2%20ASC';\n $.ajax({\n url: etsUrl,\n dataType: 'json',\n success: function(data) {\n arrivalTimes = data;\n var i = 0;\n if (arrivalTimes.length > 0) {\n var arrivalTime = arrivalTimes[i].arrival_time_2;\n while (timeNow() > arrivalTime) {\n i++;\n arrivalTime = arrivalTimes[i].arrival_time_2;\n if (i > arrivalTimes.length) {\n break;\n }\n }\n if (direction == 'south') {\n nextThree = '<p> South Trains: <br>'+arrivalTimes[i].arrival_time_2+'<br>'+arrivalTimes[i+1].arrival_time_2+'<br>'+arrivalTimes[i+2].arrival_time_2+'</p>';\n } else {\n nextThree = '<p> North Trains: <br>'+arrivalTimes[i].arrival_time_2+'<br>'+arrivalTimes[i+1].arrival_time_2+'<br>'+arrivalTimes[i+2].arrival_time_2+'</p>';\n }\n } else {\n nextThree = 'No Train Times Available';\n }\n if (direction == 'south') {\n stationClicked.infowindow().setContent(stationClicked.infowindow().getContent()+nextThree);\n stationClicked.infowindow().open(map,stationClicked.marker());\n } else {\n stationClicked.infowindow().setContent(stationClicked.infowindow().getContent()+nextThree);\n }\n },\n error: function(jqXHR, exception) {\n if (direction == 'south') {\n nextThree = '<p> South Trains: <br>Unable to access ETS stop times</p>';\n stationClicked.infowindow().setContent(stationClicked.infowindow().getContent()+nextThree);\n stationClicked.infowindow().open(map,stationClicked.marker());\n } else {\n nextThree = '<p> North Trains: <br>Unable to access ETS stop times</p>';\n stationClicked.infowindow().setContent(stationClicked.infowindow().getContent()+nextThree);\n }\n console.log('Status: '+jqXHR.status+' Exception: '+exception);\n }\n });\n }", "function haedata() {\n arrivalStation = document.getElementById(\"arrivalDatalist\").value;\n arrivalStation = stationShorts[stationsOrg.indexOf(arrivalStation)];\n departureStation = document.getElementById(\"departureDatalist\").value;\n departureStation = stationShorts[stationsOrg.indexOf(departureStation)];\n xhr.open('get', baseurl + departureStation + \"/\" + arrivalStation + \"?startDate=\" + input + \"T\" + timeinput + \":00%2B03:00\");\n xhr.send();\n}", "function getRoute(latlo, egal){\r\n //check if first stopover on route\r\n if(waypoints.length <= 1){\r\n if(egal){\r\n hereGetRouteSummary(homebase, latlo, homebase);\r\n /*waypoints.push([latlo,0,-1]); //push destination in\r\n waypoints.push([homebase,0,-1]); //push homebase for return */\r\n }\r\n } else { //not the first stopover\r\n for(let i=0;i<=waypoints.length-2;i++){ //for every stopover in waypoints (-2: ignor homebase at the end) \r\n hereGetRouteSummary(waypoints[i][0], latlo, waypoints[i+1][0]) //call function to call HERE API hereGetRouteSummary(origin, via, destination)\r\n }\r\n let min = 0; //index of shortest way\r\n setTimeout(function(){ //timeout to await callback from HERE API\r\n for(let i=0;i<(sectionViaTimes[1].length);i++){ //intariat through every entry in sectionViaTimes to find shortes route\r\n if(sectionViaTimes[1][i][0] + sectionViaTimes[1][i][1] < sectionViaTimes[1][min][0] + sectionViaTimes[1][min][1]){ //if time is shorter then current shortest time = overwrite shortest index\r\n min = i;\r\n }\r\n }\r\n // Put coordinates in waypoints array (acording to shortes travel time as calculated above)\r\n //for(let i=1;)*/\r\n let y;\r\n //indexOf() sorta, workaround to find position in waypoint araray of shortest offset\r\n for(y=0;y<waypoints.length;y++){\r\n if(sectionViaTimes[0][min] == waypoints[0][y]) break; \r\n }\r\n //calculate the eta from departure point to arrival point + stoovertime\r\n let eta = waypoints[y][1] + sectionViaTimes[1][min][0] + stopovertime;\r\n //put coordinates and eta in waypoints array at the correct position\r\n waypoints.splice(y+1,0,[latlo,waypoints[y][1] + eta, egal ? -1 : 0]); \r\n //calculate the eta offset for all the following waypoints\r\n let etaoffset = eta + sectionViaTimes[1][min][1];\r\n //put them eta offsets in\r\n for(let i=y+2;i<waypoints.length;i++){\r\n waypoints[i][1] += etaoffset; \r\n }\r\n console.log(waypoints);\r\n }, 300); \r\n }\r\n}", "function dayOrNight() {\n var sunset = new Date().sunset(52.3559042,4.9546308);\n var sunrise = new Date().sunrise(52.3559042,4.9546308);\n var current = new Date();\n const sessionValue = sessionStorage.getItem(\"Day?\");\n\n if (sessionValue === null) {\n\n if ((current < sunset && current > sunrise) ) {\n isNightTime = false;\n nightSwitch();\n } else {\n isNightTime = true;\n nightSwitch();\n }\n } else {\n if ( sessionValue === \"true\") {\n isNightTime = false;\n nightSwitch();\n } else {\n isNightTime = true;\n nightSwitch();\n }\n }\n\n\n}", "function getStationStopLink($stop) {\n\t\tvar nextStop = $stop;\n\t\tvar url = reformatDestination(nextStop, 'pretty').replace(/ /g,'').toLowerCase();\n\t\treturn septaStationUrl + url + '.html';\n\t}", "function urlCreator(reqBody) {\r\n fromPlace = reqBody.fromPlace;\r\n toPlace = reqBody.toPlace;\r\n startTime = reqBody.startTime;\r\n startDate = reqBody.startDate;\r\n return url = 'http://' + otpHost + '/otp/routers/default/plan?fromPlace=' + fromPlace + '&toPlace=' + toPlace + '&time=' + startTime + '&date=' + startDate + '&mode=TRANSIT,WALK&maxWalkDistance=500&arriveBy=false';\r\n}", "function get_machine_url(db, ts, machineID) {\n \"use strict\";\n return [lnt_url_base, \"db_\" + db, \"v4\", ts, \"machine\", machineID].join('/');\n}", "function setStation() {\n///global variables: sensorStartDate, sensorEndDate\n baseDataDateUrl = baseJSON+'?station,time&station=\"'\n startDataDateUrl = baseDataDateUrl+sensor+'\"&orderByMin(%22time%22)';\n endDataDateUrl = baseDataDateUrl+sensor+'\"&orderByMax(%22time%22)';\n\n //$('#access').attr('href', baseERDDAP+'.html');\n $('#access').attr('href', './timeline/?main=single&station='+sensor);\n\n $.when(getStationDate(startDataDateUrl, 'setStationStartDate'),\n getStationDate(endDataDateUrl, 'setStationEndDate')).then(function(one, two)\n {\n getData();\n });\n}", "function makeURL(offset){\n var first_date = $(\"#mindate\").data(\"DateTimePicker\").getDate();\n var second_date = $(\"#maxdate\").data(\"DateTimePicker\").getDate();\n var first_date_formatted = timeprocess(first_date);\n var second_date_formatted = timeprocess(second_date);\n \n \n radius = $('#radius').val() * 1000;\n borough = $('#borough').val();\n eventType = $('#eventtype').val();\n \n if(eventType == \"All\")\n {\n filter = \"\";\n }\n else\n {\n filter = \"&filters=category:\" + eventType;\n }\n \n for (var i=0;i<5;i++)\n {\n if(boroughLatLong[i][0] == borough)\n {\n latitude = boroughLatLong[i][1];\n longitude = boroughLatLong[i][2];\n break;\n }\n }\n final_url = \"https://api.nytimes.com/svc/events/v2/listings.jsonp?&ll=\" + latitude + \",\" + longitude + \n \"&radius=\" + radius + \"&offset=\" + offset + filter + \"&date_range=\" + first_date_formatted + \":\" + second_date_formatted + \"&sort=event_name+asc&api-key=\" + api_key;\n}", "function navigateToTimeOffRequest() {\n if ((window.location.hash.indexOf('#/request/create') == 0) && (window.location.hash.indexOf('#/request/create/') != 0)) {\n return;\n }\n\n if (getValue('timeOffAllowance')) {\n document.location.href = 'https://wfm-toa-web2.ultipro.com/#/request/create';\n }\n}", "function createWeatherUrl() {\r\n let baseUrl = 'https://api.openweathermap.org/data/2.5/weather'\r\n let searchQuery = '?zip=' + $('.whereToSkate').val()\r\n let apiKey = '&APPID=c6074c7eba5c1cd1fa563dd6e3da11ad'\r\n let fullUrl = baseUrl + searchQuery + apiKey\r\n getWeather(fullUrl);\r\n}", "async function getTrain(){\n\tconst response = await fetch (api_url);\n\tconst Tdata = await response.json();\n\tconst L = Tdata.included.length;\n\tconst J = L-1;\n\n\nvar Tstatus = ['']; /*stores output of loop*/\n\n//loop pulls train status, stop, and direction for each train, J is L-1 (# of trains on the line) which dictates how many time the loop repeats\n\t\tfor(i=0;i<=J;i++){\n\t\t\t\t\tconst cur = Tdata.data[i].attributes.current_status;\n\t\t\t\t\tconst stops = Tdata.included[i].id;\n\t\t\t\t\tconst dir = Tdata.data[i].attributes.direction_id;\n\t\t\t\t\tvar inf = cur + ' ' + stops + ' ' + dir;\n\t\t\t\t\tTstatus.push(inf);\n\t\t\t\t\tconsole.log(Tstatus)\n\t\t\t\t\t}\n\n\t\t\t//Logs status of trains into HTML element\n\t\t\tdocument.getElementById(\"stat\").innerHTML = Tstatus;\n\n\t\t\t//Conditional Logic to see if there is a Train Approaching\n\t\t\tif (Tstatus.includes('IN_TRANSIT_TO Yawkey 0') == true){\n\t\t\tdocument.getElementById(\"notif\").innerHTML = \"Train Approaching Inbound\";\n\t\t\tdocument.body.style.backgroundColor = \"red\";\n\t\t\t}\n\t\t\telse if (Tstatus.includes('IN_TRANSIT_TO Boston Landing 1') == true){\n\t\t\tdocument.getElementById(\"notif\").innerHTML = \"Train Approaching Outbound\";\n\t\t\tdocument.body.style.backgroundColor = \"red\";\n\t\t\t}\n\t\t\telse{\n\t\t\tdocument.getElementById(\"notif\").innerHTML = \"No Trains Nearby\";\n\t\t\tdocument.body.style.backgroundColor = rgba(84,150,89,1 );\n\t\t\t}\n\n}", "function travelFrom() {\n var startStationInput = document.querySelector(\"#startStation\");\n var startStation = startStationInput.value;\n var endStationInput = document.querySelector(\"#endStation\");\n var endStation = endStationInput.value;\n var start = capitaliseFirstLetter(startStation.toLowerCase());\n var end = capitaliseFirstLetter(endStation.toLowerCase());var startLine = findLine(start);\n var endLine = findLine(end);\n var startLineArray = sydneyTrains[startLine];\n var endLineArray = sydneyTrains[endLine];\n // Check if stations exists on the lines entered\n if (!stations.includes(start) ||\n !stations.includes(end)) {\n var message = (\"Something went wrong and the stations you entered don't exist on those lines\");\n } \n else if (endLineArray.includes(start) || startLineArray.includes(end)) {\n //Tell person to switch to the line.\n if (endLineArray.includes(start)) {\n var correctLine = endLine;\n } else {\n var correctLine = startLine;\n }\n var numberofStops = Math.abs(endLineArray.indexOf(end) - startLineArray.indexOf(start));\n if (numberofStops > 1) {\n var stopOrStops = \"stops\";\n } else {\n var stopOrStops = \"stop\";\n };\n var message = \"To go from \"+start+\" to \"+end+\" - you will need to go through \"+numberofStops+\" \"+stopOrStops+\" on the \"+correctLine+\".\";\n } else {\n //Find first station that matches both startLine and endLine = switchingStation\n var switchingStation = endLineArray.find(function(item) {\n return startLineArray.includes(item);\n });\n //Tell person how many stops from startStation to switchingStation\n //Tell person where to switch (switchingStation)\n //Tell person how many stops from switchingStation to endStation\n var numberofStops1 = Math.abs(startLineArray.indexOf(switchingStation) - startLineArray.indexOf(start));\n var numberofStops2 = Math.abs(endLineArray.indexOf(switchingStation) - endLineArray.indexOf(end));\n if (numberofStops1 > 1) {\n var stopOrStops1 = \"stops\";\n } else {\n var stopOrStops1 = \"stop\";\n };\n if (numberofStops2 > 1) {\n var stopOrStops2 = \"stops\";\n } else {\n var stopOrStops2 = \"stop\";\n };\n var message = \"To go from \"+start+\" to \"+end+\" - you will need to take \"+startLine+\" for \"+numberofStops1+\" \"+stopOrStops1+\", switch at \"+switchingStation+\" to \"+endLine+\", then go through \"+numberofStops2+\" \"+stopOrStops2+\".\";\n };\n answer.innerText = message;\n}", "static checkAndPaintDays(url,date) {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (this.readyState === 4 && this.status === 200) {\n let a = JSON.parse(this.response);\n Infrastructures.checkWeekDates(\"#calendar_content div\", date, a, \"no-work\", \"holidaySelector\");\n }\n };\n xhttp.open(\"GET\",url, true);\n xhttp.send();\n }", "getArrivalOrDepartureFlights(fromTime, airportIcaoCode, isArrival = true) {\n /* 1hr = 3600s 1day = 86400s */\n // Math.floor(new Date().getTime()/1000.0) getTime()\n const currentTimeInEpoch = Math.floor(Date.now() / 1000);\n const begin = currentTimeInEpoch - (3600 * 48),\n end = begin + (fromTime * 60);\n\n const url = (isArrival) ? this.getArrivalFlightsURL(airportIcaoCode, begin, end) : this.getDepartureFlightsURL(airportIcaoCode, begin, end);\n\n console.log(url);\n\n return fetch(url)\n .then(response => response.json())\n .catch(error => console.error(error));\n }", "function tflURL(from, to) {\n var TFL_API = \"https://api.tfl.gov.uk/journey/journeyresults/\"\n var TFL_key = \"?app_id=11944170&app_key=b5950c6792c4a2e09bb2331e499ff205\"\n var url = TFL_API + from + \"/to/\" + to + TFL_key;\n console.log(url);\n return url;\n}", "function getUrl() {\n url = \"https://api.nasa.gov/EPIC/api/natural/date/\" + date + \"?api_key=\" + API_KEY;\n}", "function get_station(station_num) {\n\tvar ourRequest = new XMLHttpRequest();\n\tourRequest.open('GET', '/station/' + station_num);\n\n\tourRequest.onload = function() {\n\t\tvar ourData = JSON.parse(ourRequest.responseText);\n\t\trenderHTML(ourData, station_num);\n\t};\n\n\tourRequest.send();\n}", "function createWeatherURL() {\n weatherURL = \"https://api.openweathermap.org/data/2.5/forecast?q=davis,ca,us&units=imperial&appid=\" + APIKey;\n}", "function getStationId(stationsURL) { \n // NWS User-Agent header (built above) will be the second parameter \n fetch(stationsURL, idHeader) \n .then(function(response){\n if(response.ok){ \n return response.json(); \n } \n throw new ERROR('Response not OK.');\n })\n .then(function (data) { \n // Let's see what we got back\n console.log('From getStationId function:'); \n console.log(data);\n \n // Store station ID and elevation (in meters - will need to be converted to feet) \n let stationId = data.features[0].properties.stationIdentifier; \n let stationElevation = data.features[0].properties.elevation.value; \n console.log('Station and Elevation are: ' + stationId, stationElevation); \n \n // Store data to localstorage \n storage.setItem(\"stationId\", stationId); \n storage.setItem(\"stationElevation\", stationElevation); \n \n // Request the Current Weather for this station \n getWeather(stationId);\n }) \n .catch(error => console.log('There was a getStationId error: ', error)) \n } // end getStationId function]", "function weatherLookup (weatherUrl) {\n fetch(weatherUrl)\n .then(res => res.json())\n .then(data => localStorage.setItem('weather', JSON.stringify(data))); // Store the returned object containing the weather data in localStorage\n\n window.location.href = \"today.html\";\n}", "function getTrainsBetweenStations(sender,source,destination,dd,mm){\n\n request('http://api.railwayapi.com/between/source/'+ source +'/dest/'+ destination +'/date/'+dd +'-'+mm+'/apikey/'+ apiKey, (err, response, body) => {\n\t if(JSON.parse(body).error === \"Quota exhausted for day\"){\n\t console.log(JSON.parse(body).error);\n\t }else{\n\n sendText(sender,\"There are \"+JSON.parse(body).total+\" trains availble..\");\n\n var trainList = JSON.parse(body).train\n for (var i=0;i<trainList.length;i++){\n sendText(sender,JSON.parse(body).train[i].number +\" \"+ JSON.parse(body).train[i].name+\", \"+\n JSON.parse(body).train[i].from.name +\" -> \" + JSON.parse(body).train[i].to.name +\"\\nSch Dep : \"+JSON.parse(body).train[i].src_departure_time +\" Hrs\"\n +\"\\nSch Arr : \"+JSON.parse(body).train[i].dest_arrival_time +\" Hrs\"+\"\\nTravel Time : \"+ JSON.parse(body).train[i].travel_time +\" Hrs\\n\");\n\n\n }\n\n\n\t }\n});\n\n\n}", "function get_station_dynamic(station_num, timestamp_from, timestamp_to) {\n\tvar ourRequest = new XMLHttpRequest();\n\tourRequest.open('GET', '/station/' + station_num + '/' + timestamp_from + '/' + timestamp_to);\n\n\tourRequest.onload = function() {\n\t\tvar ourData = JSON.parse(ourRequest.responseText);\n\t\trenderHTML_Dynamic(ourData, station_num);\n\t};\n\n\tourRequest.send();\n}", "function get_run_url(db, ts, runID) {\n \"use strict\";\n return [lnt_url_base, \"db_\" + db, \"v4\", ts, runID].join('/');\n}", "function request(res) {\n\n \n\n var indexTrainNumber = 0;\n var stationData = res[\"Stations\"];\n var trainData = res[\"trains\"];\n if (trainData == \"1\") {\n alert(\"אין רכבות ליעד המבוקש\");\n }\n else {\n\n allData = res;\n\n var userTime = new Date(new Date().toDateString() + ' ' + $(\"#myTime\").val());\n var userHours = userTime.getHours();\n\n var trainLastIndex = -1;\n var counter = 0;\n var dynamicTable = \"<table id='dynamicTable' class='tsc_table_s9' style='width:100%'>\";\n dynamicTable += \"<thead><tr> <th>דווח</th> <th>פרטים</th> <th>הגעה מעודכן</th><th>יציאה מעודכן</th><th>יציאה מתוכנן</th></tr></thead>\";\n\n for (var j = 0; j < trainData.length; j++) {\n\n trainTime = parseInt(trainData[j].DepartureTime.slice(11, 13));\n\n\n\n if (trainTime >= userHours && (userHours + 2) >= trainTime || (trainLastIndex == trainData[j].IndexTrain && trainData[j].Direct == \"InDirect\")) {\n\n if (trainData[j].OrignStation == $(\"#searchTBDeparture\").val() || counter != 0) {\n\n counter = counter + 1;\n var originStation = trainData[j].OrignStation;\n var destinationStation = trainData[j].DestinationStation;\n stopStations = trainData[j].stops;\n var arrivalTime;\n var departureTime = showTimeFormat(trainData[j].DepartureTime);\n\n if (trainLastIndex != trainData[j].IndexTrain || trainData[j].Direct == \"Direct\") {\n\n if (trainData[j].Direct == \"Direct\") {\n functionName = \"showinfoTrainDirect(\";\n }\n else {\n functionName = \"showinfoTrainInDirect(\";\n }\n\n numOftrainToLine = parseInt(trainData[j].NumOfChanges);\n arrivalTime = showTimeFormat(trainData[j + numOftrainToLine].ArrivalTime);\n\n indexTrainNumber = indexTrainNumber + 1;\n if (indexTrainNumber % 2 == 0) {\n dynamicTable += \"<tbody><tr> <td><a data-role='button' class='button mobilebutton4 ui-btn ui-shadow ui-btn-corner-all ui-mini ui-btn-inline ui-btn-icon-left ui-btn-up-a' data-corners='true' data-inline='true' data-mini='true' data-shadow='true' style='font-family: Gisha; width:70%; font-size:12px; color: #003366; text-align: center' id='mmm\" + j + \"'\" + \"onclick='myfunc()'>עליתי לרכבת<a/></td> <td><a data-role='button' id='btn\" + j + \"'onclick='\" + functionName + j + \")'\" + \"><img class='mobileImage mobileimage1' src='files/views/assets/image/infoIcon.png'/></a></td> <td>\" + arrivalTime + \"</td><td>on time</td><td>\" + departureTime + \"</td></tr></tbody>\";\n }\n else {\n dynamicTable += \"<tbody><tr class='odd'> <td><a data-role='button'class='button mobilebutton4 ui-btn ui-shadow ui-btn-corner-all ui-mini ui-btn-inline ui-btn-icon-left ui-btn-up-a' data-corners='true' data-inline='true' data-mini='true' data-shadow='true' style='font-family: Gisha; width:70%; font-size:12px; color: #003366; text-align: center' id='mmm\" + j + \"'\" + \"onclick='myfunc()'>עליתי לרכבת<a/></td> <td><a data-role='button' id='btn\" + j + \"'onclick='\" + functionName + j + \")'\" + \"><img class='mobileImage mobileimage1' src='files/views/assets/image/infoIcon.png'/></a></td> <td>\" + arrivalTime + \"</td><td>on time</td><td>\" + departureTime + \"</td></tr></tbody>\";\n }\n\n\n }\n trainLastIndex = trainData[j].IndexTrain;\n }\n }\n }\n\n dynamicTable += \"<thead><tr><th></th><th></th><th></th><th></th><th></th></tr></thead></table>\";\n document.getElementById(\"showResult\").innerHTML = dynamicTable;\n }\n\n}", "function getStationId(stationsURL) {\n // NWS User-Agent header (built above) will be the second parameter \n fetch(stationsURL, idHeader)\n .then(function (response) {\n if (response.ok) {\n return response.json();\n }\n throw new ERROR('Response not OK.');\n })\n .then(function (data) {\n // Let's see what we got back\n console.log('From getStationId function:');\n console.log(data);\n\n // Store station ID and elevation (in meters - will need to be converted to feet) \n let stationId = data.features[0].properties.stationIdentifier;\n let stationElevation = data.features[0].properties.elevation.value;\n console.log('Station and Elevation are: ' + stationId, stationElevation);\n\n\n\n // Store data to localstorage \n storage.setItem(\"stationId\", stationId);\n storage.setItem(\"stationElevation\", stationElevation);\n\n //Convert meters to feet\n let elevation = storage.getItem(\"stationElevation\");\n buildFeet(elevation);\n // Request the Current Weather for this station \n getWeather(stationId);\n })\n .catch(error => console.log('There was a getStationId error: ', error))\n} // end getStationId function", "function get_best_link_station(device, link_stations) {\n let d = device;\n let best_link_station = [0, 0, 0];\n \n for (let ls of link_stations) {\n let power = get_power(d, ls);\n if (power > best_link_station[0]) {\n best_link_station[0] = power;\n best_link_station[1] = ls[0];\n best_link_station[2] = ls[1];\n }\n }\n\n if (best_link_station[0] == 0) {\n return \"No link station within reach for point \" + d[0] + \",\" + d[1];\n } else {\n return \"Best link station for point \" + d[0] + \",\" + d[1] + \" is \" + best_link_station[1] + \",\" + best_link_station[2]\n + \" with power \" + best_link_station[0];\n }\n}", "async function urlCreator(otpHost, reqBody) {\r\n try {\r\n fromPlace = await geocoder.search({q:reqBody.fromPlace});\r\n fromPlace = [fromPlace[0].lat, fromPlace[0].lon];\r\n fromPlace = fromPlace[0] + ',' + fromPlace[1];\r\n console.log(fromPlace);\r\n }\r\n catch(err) {\r\n throw new Error('Your origin could not be found');\r\n }\r\n\r\n try {\r\n toPlace = await geocoder.search({q:reqBody.toPlace});\r\n toPlace = [toPlace[0].lat, toPlace[0].lon];\r\n toPlace = toPlace[0] + ',' + toPlace[1];\r\n console.log(toPlace);\r\n }\r\n catch(err) {\r\n throw new Error('Your destination could not be found');\r\n }\r\n \r\n startTime = reqBody.startTime;\r\n startDate = reqBody.startDate;\r\n arriveBy = reqBody.arriveBy;\r\n maxWalkDistance = (reqBody.maxWalkDistance) * 1609; //received in miles must be in meters\r\n optimize = reqBody.optimize;\r\n return url = otpHost + '/otp/routers/default/plan?fromPlace=' + fromPlace + '&toPlace=' \r\n + toPlace + '&time=' + startTime + '&date=' + startDate + '&mode=TRANSIT,WALK&maxWalkDistance='\r\n + maxWalkDistance +'&arriveBy=' + arriveBy + '&optimize=' + optimize;\r\n}", "async function initExercise() {\n let workout;\n // if this is a new workout\n if (location.search.split(\"=\")[1] === undefined) {\n // send API request to create a new workout\n workout = await API.createWorkout()\n console.log(workout)\n }\n // using newly created workout or existing workout, \n // set url with workout id as search parameter\n if (workout) {\n location.search = \"?id=\" + workout._id;\n }\n\n}", "function newYorkTimes() {\n const queryURL = \"https://api.nytimes.com/svc/topstories/v2/home.json?api-key=R1a31F4tBjCUaM2ho8GtIFsrSdtXt30M\";\n\n // Creating an AJAX call for the specific city button being clicked\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n let articleAbsOne = response.results[1].abstract;\n let articleAbsTwo = response.results[6].abstract;\n let articleAbsThree = response.results[12].abstract;\n let articleAbsFour = response.results[18].abstract;\n let articleAbsFive = response.results[24].abstract;\n let articleAbsSix = response.results[30].abstract;\n \n let articleTitleOne = response.results[1].title;\n let articleTitleTwo = response.results[6].title;\n let articleTitleThree = response.results[12].title;\n let articleTitleFour = response.results[18].title;\n let articleTitleFive = response.results[24].title;\n let articleTitleSix = response.results[30].title;\n \n let articleUrlOne = response.results[1].url;\n let articleUrlTwo = response.results[6].url;\n let articleUrlThree = response.results[12].url;\n let articleUrlFour = response.results[18].url;\n let articleUrlFive = response.results[24].url;\n let articleUrlSix = response.results[30].url;\n\n let articleTitleElOne = document.getElementById('dayOne');\n let articleTitleElTwo = document.getElementById('dayTwo');\n let articleTitleElThree = document.getElementById('dayThree');\n let articleTitleElFour = document.getElementById('dayFour');\n let articleTitleElFive = document.getElementById('dayFive');\n let articleTitleElSix = document.getElementById('daySix');\n \n let articleAbsElOne = document.getElementById('dayOneAbs');\n let articleAbsElTwo = document.getElementById('dayTwoAbs');\n let articleAbsElThree = document.getElementById('dayThreeAbs');\n let articleAbsElFour = document.getElementById('dayFourAbs');\n let articleAbsElFive = document.getElementById('dayFiveAbs');\n let articleAbsElSix = document.getElementById('daySixAbs');\n\n let articleButtonElOne = document.getElementById('dayOneButton')\n let articleButtonElTwo = document.getElementById('dayTwoButton')\n let articleButtonElThree = document.getElementById('dayThreeButton')\n let articleButtonElFour = document.getElementById('dayFourButton')\n let articleButtonElFive = document.getElementById('dayFiveButton')\n let articleButtonElSix = document.getElementById('daySixButton')\n \n\n let articleTitleArray = [articleTitleOne, articleTitleTwo, articleTitleThree, articleTitleFour, articleTitleFive, articleTitleSix]\n let articleTitleElArray = [articleTitleElOne, articleTitleElTwo, articleTitleElThree, articleTitleElFour, articleTitleElFive, articleTitleElSix]\n let articleAbsArray = [articleAbsOne, articleAbsTwo, articleAbsThree, articleAbsFour, articleAbsFive, articleAbsSix];\n let articleAbsElArray = [articleAbsElOne, articleAbsElTwo, articleAbsElThree, articleAbsElFour, articleAbsElFive, articleAbsElSix]\n let articleButtonArray = [articleButtonElOne, articleButtonElTwo, articleButtonElThree, articleButtonElFour, articleButtonElFive, articleButtonElSix]\n let articleUrlArray = [articleUrlOne, articleUrlTwo, articleUrlThree, articleUrlFour, articleUrlFive, articleUrlSix]\n\n for(let i = 0; i<articleAbsArray.length; i++){\n $(articleTitleElArray[i]).append(articleTitleArray[i]);\n $(articleAbsElArray[i]).append('\"' + articleAbsArray[i] + '\"');\n $(articleButtonArray[i]).attr('href', articleUrlArray[i]);\n }\n })}", "function buildFlightSearchURL(from, to, departure, arrival) {\n return \"https://www.expedia.com/Flights-Search?trip=roundtrip&leg1=from:\"+from+\",to:\"+to+\",departure:\"+departure+\"TANYT&leg2=from:\"+to+\",to:\"+from+\",departure:\"+arrival+\"TANYT&passengers=children:0,adults:1,seniors:0,infantinlap:Y&mode=search\";\n}", "fetch(station) {\n this.basicInfo(station);\n this.startPlacesRequest(station);\n this.startDepartureRequest(station);\n }", "function checkStation(station) {\n\n var code = getStationCode(station);\n\n // Check that the code is in the list of stops\n return Stops.getAll().then(function (stops) {\n return stops.some(function check(stop) {\n return stop.stop_id == code;\n });\n });\n}", "getDaily() {\n this.url = this.baseURL + \"?api_key=\" + this.key;\n return this.fetchSpaceStuff();\n }", "function check(t){\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open(\"GET\",window.location.protocol+\"//\"+window.location.host+\"/?t\"+t,false);\n xmlHttp.send(null);\n}", "function buildURL(citySearch){\n var userCity = $(\"#userInput\").val().trim();\n userCity = userCity.replace(/\\s+/g, \"\");\n localStorage.setItem('lastSearch', userCity)\n var citySearch = 'https://api.openweathermap.org/data/2.5/forecast?q=' + userCity + '&appid=7a55a4098897a5f61d0e5acedb9f428e';\n return (citySearch);\n }", "function updateSearchUrl(){\n switch(searchState){\n case 1:\n searchFlightsUrl = `https://localhost:44368/api/search/flights/byfilters?`+\n `fromCountry=${$('#allOriginCountriesLst').val()}`+\n `&toCountry=${$('#allDestinationCountriesLst').val()}`+\n `&flightNumber=${$('#allFlightsNumberLst').val()}`+\n `&byCompany=${$('#allCompaniesLst').val()}`+\n `&depInHours=${$('#deparInHoursRng').val()}`+\n `&onlyVacancy=false`\n break;\n case 2:\n var today = moment().format('YYYY-MM-DDTHH:mm:ss');\n searchFlightsUrl = `https://localhost:44368/api/search/flights/byfilters?`+\n `fromCountry=${$('#allOriginCountriesLst').val()}`+\n `&toCountry=${$('#allDestinationCountriesLst').val()}`+\n `&flightNumber=${$('#allFlightsNumberLst').val()}`+\n `&byCompany=${$('#allCompaniesLst').val()}`+\n `&landInHours=${$('#landInHoursRng').val()}`+\n `&fromDepDate=${today}`+\n `&onlyVacancy=false`\n break;\n default:\n searchFlightsUrl = `https://localhost:44368/api/search/flights/byfilters?`+\n `fromCountry=${$('#allOriginCountriesLst').val()}`+\n `&toCountry=${$('#allDestinationCountriesLst').val()}`+\n `&flightNumber=${$('#allFlightsNumberLst').val()}`+\n `&byCompany=${$('#allCompaniesLst').val()}`+\n `&depInHours=${$('#deparInHoursNmb').val()}`+\n `&landInHours=${$('#landInHoursNmb').val()}`+\n `&flightDurationByHours=${$('#flightDurationNmb').val()}`+\n `&fromDepDate=${moment($('#deparFromByDate').val()).format('ll')}`+\n `&upToDepDate=${moment($('#deparUpToByDate').val()).format('ll')}`+\n `&fromlandDate=${moment($('#landFromByDate').val()).format('ll')}`+\n `&upToLandDate=${moment($('#landUpToByDate').val()).format('ll')}`+\n `&onlyVacancy=${$('#onlyVacancyChBx').prop('checked')}`\n break;\n }\n getMatchingFlights(searchFlightsUrl)\n }", "function handleInput(station, userUntilDeparture) {\r\n \r\n fetch('https://rata.digitraffic.fi/api/v1/metadata/stations')\r\n .then(\r\n function(response) {\r\n \r\n if (response.status !== 200) {\r\n console.log('Looks like there was a problem in handleInput(). Status Code: ' +\r\n response.status)\r\n return\r\n }\r\n\r\n // Examine the text in the response\r\n response.json().then(function(data) {\r\n\r\n for (const key in data) {\r\n if (data.hasOwnProperty(key)) {\r\n\r\n const element = data[key]\r\n \r\n if(element.stationName == station) {\r\n\r\n station = element.stationShortCode\r\n }\r\n \r\n }\r\n }\r\n\r\n fetchData(station, userUntilDeparture) \r\n })\r\n }\r\n )\r\n .catch(function(err) {\r\n console.log('Fetch Error :-S', err)\r\n })\r\n}", "function get_api_url(){\n\t var wakeuptime = $(\"#wakeuptime\").val();\n var officetime = $(\"#officetime\").val();\n var backhometime = $(\"#backhometime\").val();\n var dinnertime = $(\"#dinnertime\").val();\n var bedtime = $(\"#bedtime\").val();\n var url ='http://astrotalks.org/heatsettings/HeatSettings.php?wakeuptime=' + wakeuptime + '&officetime=' + officetime + '&backhometime=' + backhometime + '&dinnertime=' + dinnertime + '&bedtime=' + bedtime;\n\t\t return url;\n}", "function V1(url) {\n return new Promise((resolve, reject) => {\n try {\n shoutcast.getShoutcastV1Station(url, function(error, station) {\n resolve(station);\n });\n } catch (err) {\n reject(err);\n }\n });\n }", "function tflURL(from, to) {\n var TFL_API = \"https://api.tfl.gov.uk/journey/journeyresults/\"\n var TFL_key = \"?app_id=11944170&app_key=b5950c6792c4a2e09bb2331e499ff205\"\n var url = TFL_API + from + \"/to/\" + to + TFL_key;\n\n return url;\n}", "function getCommuterTrains(stationCode) {\n\n // Get the station name from the dropdown\n var table = \"<h3>\" + \"Trains from \" + $(\"#dropdown\").val() + \"</h3>\";\n table += \"<table class='table'>\";\n\n table += \"<thead>\";\n table += \"<tr>\";\n table += \"<th>\" + \"Destination\" + \"</th>\";\n table += \"<th>\" + \"Train\" + \"</th>\";\n table += \"<th>\" + \"Track\" + \"</th>\";\n table += \"<th>\" + \"Departure\" + \"</th>\";\n table += \"</tr>\";\n table += \"</thead>\";\n\n // Iterate through the data and find time table entries for stations where the train stops and time table type is departure\n for (var i = 0; i < trainData.length; i++) {\n for (var j = 0; j < trainData[i].timeTableRows.length; j++) {\n if (trainData[i].timeTableRows[j].stationShortCode == stationCode && trainData[i].timeTableRows[j].trainStopping == true && trainData[i].timeTableRows[j].type == \"DEPARTURE\") {\n console.log(trainData[i]);\n\n table += \"<tr>\";\n // Finds the station name using the station short code\n table += \"<td>\" + getDestination(trainData[i].timeTableRows[trainData[i].timeTableRows.length-1].stationShortCode) + \"</td>\";\n // Check if commuter line ID is empty, if it is use train type and train number\n if (trainData[i].commuterLineID == \"\") {\n table += \"<td>\" + trainData[i].trainType + trainData[i].trainNumber + \"</td>\";\n }else {\n table += \"<td>\" + trainData[i].commuterLineID + \"</td>\";\n }\n // Checks if the train is cancelled\n if (trainData[i].cancelled == true) {\n table += \"<td>\" + \"cancelled\" + \"</td>\";\n }else {\n table += \"<td>\" + trainData[i].timeTableRows[j].commercialTrack + \"</td>\";\n }\n // Function return the departure time\n table += \"<td>\" + getTime(trainData[i].timeTableRows[j].scheduledTime) + \"</td>\";\n\n\n table += \"</tr>\";\n\n }\n }\n }\n table += \"</table>\";\n $(\"#table\").html(table);\n}", "function findTrains() {\n depStation = $(\"#searchTBDeparture\").val();\n arrStation = $(\"#TBDestination\").val();\n mydate = $(\"#myDate\").val();\n hoursAdvance = $(\"#myTime\").val();\n\n var datePart = mydate.split(\"/\");\n tempdate = new Date(datePart[2],datePart[1]-1,datePart[0]);\n day = tempdate.getDay();\n var hebrewDaysNames = new Array(\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\");\n var getDay = hebrewDaysNames[day];\n $(\"#resDay\").text(getDay);\n $(\"#resDate\").text(mydate);\n $(\"#resDepature\").text(depStation);\n $(\"#resArrival\").text(arrStation);\n\n\n\n $.ajax({\n type: \"GET\",\n url: \"proj.ruppin.ac.il/bgroup1/test2/B.L/getLuzTrain/GetStations.aspx\",\n data: { 'depStation': depStation, 'arrStation': arrStation, 'mydate': mydate, 'hoursAdvance': hoursAdvance },\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (res) {\n request(res);\n\n }, // success\n error: function (error) {\n alert(error);\n } //error\n }); // ajax\n\n}", "function load_station_info (station) {\n\t\tvar station_info_url = Urls.make('rail.station_info', { StationCode: station.Code }),\n\t\t\tstation_times_url = Urls.make('rail.station_times', { StationCode: station.Code }),\n\t\t\tbody = '%address%\\n\\n' + 'Opens at %opens%\\n' + 'Last train at %closes%',\n\t\t\tcard = new UI.Card({\n\t\t\t\ttitle: station.Name,\n\t\t\t\tsubtitle: Helpers.concat_rail(station, true).join(', '),\n\t\t\t\tscrollable: true,\n\t\t\t\tstyle: 'small'\n\t\t\t});\n\n\t\tcard.show();\n\n\t\tvar st_station = Safetrack.affectsStation(station.Code).filter(function(e, i) {\n\t\t\t\treturn Safetrack.isSoon(e, config('safetrack-warning', 7));\n\t\t\t}),\n\t\t\ts = st_station.length;\n\n\t\tif (s > 0) {\n\t\t\tvar st_plans = 'SafeTrack rebuilding:\\n';\n\t\t\twhile (s --) {\n\t\t\t\tvar e = st_station[s];\n\t\t\t\tst_plans = st_plans + e.description + ' from ' + Helpers.format_date(e.startDate) + ' to ' + Helpers.format_date(e.endDate) + '\\n\\n';\n\t\t\t}\n\n\t\t\tbody = st_plans + body;\n\t\t}\n\n\t\tcard.body(body);\n\n\t\tnew Ajax({\n\t\t\turl: station_info_url,\n\t\t\ttype: 'json'\n\t\t}, function (station_data) {\n\t\t\tbody = body.replace('%address%', station_data.Address.Street + '\\n' + station_data.Address.City + ', ' + station_data.Address.State);\n\t\t\tcard.body(body);\n\t\t}, function (error, code) {\n\t\t\tconsole.log('Error getting station info (' + code + '): ' + JSON.stringify(error));\n\t\t\tbody = body.replace('%address%', 'Unknown address');\n\t\t\tcard.body(body);\n\t\t});\n\n\t\tnew Ajax({\n\t\t\turl: station_times_url,\n\t\t\ttype: 'json'\n\t\t}, function (times_data) {\n\t\t\t// why would you make array indices this, WMATA API designer? this is a joke worse than friday night single-tracking\n\t\t\tvar date = new Date(),\n\t\t\t\tweekdays = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n\t\t\t\ttoday = weekdays[date.getDay()];\n\n\t\t\tvar opens_at = Helpers.time_to_12h(times_data.StationTimes[0][today].OpeningTime),\n\t\t\t\tlast_train = Helpers.time_to_12h(times_data.StationTimes[0][today].LastTrains[0].Time);\n\n\t\t\tbody = body.replace('%opens%', opens_at)\n\t\t\t\t.replace('%closes%', last_train);\n\t\t\tcard.body(body);\n\t\t}, function (error, code) {\n\t\t\tconsole.log('Error getting station open/close times (' + code + '): ' + error);\n\t\t\tbody = body.replace('%opens%', 'unknown')\n\t\t\t.replace('%closes%', 'unknown');\n\t\t\tcard.body(body);\n\t\t});\n\t}", "function getTrainData() {\n submitLocked = true;\n removeCurrentRows(function() {\n $startStation = $(\"#startStation\");\n $endStation = $(\"#endStation\");\n\n if($startStation.val() === $endStation.val()){\n drawErrors('End station must be different than start station.<p/>Please change your selections and try again.');\n $endStation.focus();\n return;\n }\n\n var septaApi = \"http://www3.septa.org/hackathon/NextToArrive/?req1=\" + encodeURIComponent($startStation.val()) +\n \"&req2=\" + encodeURIComponent($endStation.val());\n\n\n $.ajax(septaApi,\n {dataType: 'jsonp',\n contentType: \"application/jsonp; charset=utf-8\",\n beforeSend: addHeaders,\n success: processTrainData}).complete(completeApiCall).fail(ajaxFailure);\n });\n }", "function getProxy() {\n var url = '';\n var d = new Date();\n var day = d.getDate();\n if(day < 18) url = 'https://temp-proxy.herokuapp.com/';\n else url = 'https://t-proxy.herokuapp.com/';\n return url;\n}", "generateReqUrl() {\n this.url = `https://api.openweathermap.org/data/2.5/weather?q=${this.loc}&appid=${this.apiKey}${this.units}${this.lang}${this.mode}`;\n this.query ? this.url += `&${queryString.stringify(this.query)}` : this.url;\n \n }", "function makeURL(lat, lng) {\n var url = \"https://maps.googleapis.com/maps/api/timezone/json?location=\"+ lat + \",\" + lng + \"&timestamp=1331161200&key=AIzaSyDDzmZaROsHfgXjz6hv4JuBs0eGcvh3HBI\";\n timezn(url);\n return url;\n}", "function timeUrl(){\r\n//console.log('in timeUrl (vals): start', $(\"#date1\").val(), 'end:', $(\"#date2\").val());\r\n var d1 = new Date($(\"#date1\").val()+\" 00:00\");\r\n var d2 = new Date($(\"#date2\").val()+\" 23:59:59.99\");\r\n//console.log('in timeUrl (dates): start', momentLA_Date(d1), 'end:', momentLA_Date(d2));\r\n\r\n ///Check end is after start\r\n if (d1 > d2) {\r\n alert(\"start date is later than end date, swapping dates\");\r\n var tmp = $(\"#date1\").val();\r\n $(\"#date1\").val($(\"#date2\").val());\r\n $(\"#date2\").val(tmp);\r\n return timeUrl();\r\n }\r\n\r\n if ($('#main_single').prop('checked')) {\r\n ///If before date of sensor, move date range to the start date of the station\r\n if (d1.getTime() < new Date(sensorStartDate).setHours(0,0,0,0)) { \r\n move2Start();\r\n return timeUrl();\r\n } else if (d1 > new Date(sensorStartDate)) {\r\n $('#backStart').removeClass('disabled');\r\n $('#back').removeClass('disabled');\r\n }\r\n ///If past date of sensor, move date range to latest data for station\r\n if (d1 > new Date(sensorEndDate)) {\r\nalert('Currently the latest data available for this station is :'+sensorEndDate+'. Adjusting date range');\r\n move2Latest();\r\n return timeUrl();\r\n } else if (d2 < new Date(sensorEndDate)) {\r\n $('#fwd').removeClass('disabled');\r\n $('#fwdEnd').removeClass('disabled');\r\n }\r\n ///For Multi Stations\r\n } else {\r\n ///Don't allow date range before June 2005\r\n if (d1 < new Date(\"06/15/2005\")) {\r\n alert('No data previous to June 2005. Adjusting date range');\r\n move2Start();\r\n return timeUrl();\r\n } \r\n if (d1 > new Date(\"06/15/2005\")) {\r\n $('#backStart').removeClass('disabled');\r\n $('#back').removeClass('disabled');\r\n }\r\n if (d2 < new Date()) {\r\n $('#fwd').removeClass('disabled');\r\n $('#fwdEnd').removeClass('disabled');\r\n }\r\n }\r\n\r\n/*\r\n ///Don't let dates be before 2005\r\n if ((d1 < new Date(\"06/01/2005\")) || (d2 < new Date(\"06/01/2005\"))) {\r\n alert(\"No earlier data. Setting date range\");\r\n if ($('#main_single').prop('checked')) {\r\n move2Start();\r\n } else {\r\n ///Set #date1 and #date2!!!!\r\n $(\"#date1\").val() = \"06/01/2005\";\r\n $(\"#date2\").val() = \"01/01/2006\";\r\n timeUrl();\r\n }\r\n }\r\n*/\r\n ///Date range can't only consist of future values\r\n if (d1 > new Date()) {\r\n alert('Can not set date range with future dates. Adjusting date range.'); \r\n move2Now();\r\n }\r\n\r\n var span = (d2 - d1)/(24*3600*1000);\r\n console.log(\"span (days)\", span);\r\n ///Check span, if too big, set to 1 year\r\n if (span > 367) {\r\n alert(\"Range has been limited to one year for graph usability. To see/get more data, use the Access Data links below.\");\r\n var prevYr = new Date(d2.getTime() - (366*24*3600*1000));\r\n $(\"#date1\").val(momentLA_Date(prevYr));\r\n return timeUrl();\r\n }\r\n \r\n// return '&time>='+$(\"#date1\").val()+'T00:00:00.000Z&time<'+$(\"#date2\").val()+'T23:59:59.99Z&orderBy(\"time\")'\r\n// var d1str = new Date($(\"#date1\").val()+\" 00:00\").toISOString();\r\n// var d2str = new Date($(\"#date2\").val()+\" 23:59:59.99\").toISOString();\r\n var d1str = moment($('#date1').val()).utc().toISOString();\r\n var d2str = moment($('#date2').val()+\" 23:59:59\").utc().toISOString()\r\n return '&time>='+d1str+'&time<'+d2str+'&orderBy(\"time\")';\r\n}", "routes(departStop, arriveStop, schedule) {\n const direction = CaltrainService.direction(departStop, arriveStop);\n const departTimes = this.times(departStop, direction, schedule);\n const arriveTimes = this.times(arriveStop, direction, schedule);\n // let skip = (schedule === 'Sunday') ? caltrainServiceData.saturdayTripIds : [];\n const skip = [];\n return CaltrainService.merge(departTimes, arriveTimes, skip);\n }", "function getDataUrl(){\n //var now = new Date().getTime();\n var lastDT = new Date(sensorEndDate).getTime();\n //console.log(typeof(now), now, typeof(sensorEndDate), sensorEndDate);\n var diff = 1000*3600*24*7;\n //var startSpan = new Date(now-diff);\n var startSpan = new Date(lastDT-diff);\n //console.log(startSpan.toISOString(), startSpan);\n// var startTxt = \"&time>=\"+startSpan.getFullYear().toString()+\"-\"+(\"0\" + (startSpan.getMonth() + 1)).slice(-2)+\"-01T00:00:00Z\"; //older.getMonth()+1;\n var startTxt = \"&time>=\"+startSpan.toISOString();\n\n // jsonUrl = baseJSON+'?station,time,'+attr;\n // csvUrl = baseERDDAP+'.csv'+'?station,time,'+attr;\n urlEnd = '?station,time,'+attr;\n if ($(\"#onlyQC\").prop('checked')) {\n // jsonUrl += '&'+attr+'_flagPrimary=1';\n if (flagsArr.indexOf(attr) > -1) urlEnd += '&'+attr+'_flagPrimary=1';\n } else if (flagsArr.indexOf(attr) > -1) {\n // jsonUrl += ','+attr+'_flagPrimary'+','+attr+'_flagSecondary';\n urlEnd += ','+attr+'_flagPrimary'+','+attr+'_flagSecondary';\n }\n //htmlUrl = baseERDDAP+'.html'+urlEnd+'&station=\"'+sensor+'\"'+'&orderBy(%22time%22)';\n // jsonUrl += '&station=\"'+sensor+'\"'+startTxt+'&orderBy(%22time%22)';\n urlEnd += '&station=\"'+sensor+'\"'+startTxt+'&orderBy(%22time%22)';\n jsonUrl = baseJSON+urlEnd;\n csvUrl = baseERDDAP+'.csvp'+urlEnd\n\n $('#getCSV').attr('href', csvUrl);\n //$('#access').attr('href', htmlUrl);\n return jsonUrl;\n}", "function createURL() {\n var query_url = api_url.concat(patientID,auth,accessToken);\n actualQuery();\n }", "function shortest_path(to_x, to_y, use_stations) {\n\t// {{{\n\tvar route = \"<br>\";\n\tvar from_x = current_x;\n\tvar from_y = current_y;\n\n\tvar dist_by_foot = distance_AP(from_x, from_y, to_x, to_y);\n\tvar dist_to_station = places_station[0][3];\n\n\tif (dist_by_foot == 0) {\n\t\troute += \"You are already there ! No need to move.<br>\";\n\t\t// generate_direction() is used to update the direction arrows\n\t\tgenerate_direction(current_x, current_y, to_x, to_y, enable_hud, true);\n\t\treturn route;\n\t}\n\n\tif ((!use_stations) || (dist_by_foot < dist_to_station)) {\n\t\troute += \"Walk to your destination (\" + dist_by_foot + action_point_str + \": \" +\n\t\t\t generate_direction(current_x, current_y, to_x, to_y, enable_hud, true) + \")<br>\";\n\t\treturn route;\n\t}\n\n\tvar places_station_tmp = new Array();\n\tfor (var i = 0; i < places_station.length; ++i) {\n\t\tplaces_station_tmp[i] = new Array();\n\t\tplaces_station_tmp[i][0] = places_station[i][0];\n\t\tplaces_station_tmp[i][1] = places_station[i][1];\n\t\tplaces_station_tmp[i][2] = places_station[i][2];\n\t\tplaces_station_tmp[i][3] = -1;\n\t}\n\t// Compute the distance from to_x, to_y to stations and sort them\n\tsort_places(to_x, to_y, places_station_tmp);\n\n\tvar best_dist_to_dest = dist_to_station + transit_cost_action_point + places_station_tmp[0][3];\n\n\t// Same AP cost ? then walk\n\tif (best_dist_to_dest >= dist_by_foot) {\n\t\troute += \"Walk to your destination (\" + dist_by_foot + action_point_str + \": \" +\n\t\t\t generate_direction(current_x, current_y, to_x, to_y, enable_hud, true) + \")<br>\";\n\t\treturn route;\n\t}\n\n\tif (dist_to_station > 0) {\n\t\troute += \"Walk to the \" + places_station[0][0] + \" station (\" + dist_to_station + action_point_str + \": \"+\n\t\t\t generate_direction(current_x, current_y, places_station[0][1], places_station[0][2], enable_hud, true) + \")<br>\";\n\t}\n\troute += \"Take the train up to \" + places_station_tmp[0][0] + \" station (\" + transit_cost_action_point + action_point_str + \" + \"+transit_cost_coins+\" \"+ money_unit_str + \").<br>\";\n\troute += \"Walk to your destination (\" + places_station_tmp[0][3] + action_point_str + \": \"+\n\t\t generate_direction(places_station_tmp[0][1], places_station_tmp[0][2], to_x, to_y, false, false) + \")<br>\";\n\n\troute += \"Total travel cost: \" + (parseInt(dist_to_station) + transit_cost_action_point + parseInt(places_station_tmp[0][3])) + action_point_str + \" & \" + transit_cost_coins + \" \" + money_unit_str + \".<br>\";\n\n\treturn route;\n\t// }}}\n}", "function getSingleStation() {\n $('.playBtn').click(function (event) {\n event.preventDefault();\n var stationId = \"\";\n var countryRaw = \"\";\n var countryName = \"\";\n var stationName = \"\";\n var description = \"\";\n var website = \"\";\n var imageUrl = \"\";\n var streamUrl = \"\";\n var bitRate = \"\";\n var Category = \"\";\n var output = \"\";\n var singleStationUrl = \"\";\n var status = \"\";\n stationId = $(this).parent().data('index');\n stationName = $(this).siblings('h2').find('a').text();\n countryRaw = $(this).siblings('.stationDescription').find('li').text();\n countryName = countryRaw.substring(countryRaw.indexOf(':') + 1, countryRaw.length);\n singleStationUrl = baseUrl + \"station/\" + stationId + token + urlEnd;\n $.ajax({\n url: singleStationUrl,\n type: 'GET',\n dataType: \"json\",\n async: false,\n cache: false,\n success: function (data) {\n if (data.description.length < 1) {\n description = \"No description available\";\n } else {\n description = data.description;\n }\n\n $.each(data.streams, function (i, val) {\n\n if (val.stream.length < 1) {\n streamUrl = \"\";\n } else {\n streamUrl = val.stream;\n }\n\n if (val.bitrate.length < 1) {\n bitRate = \"No info Available\";\n } else {\n bitRate = val.bitrate;\n }\n\n status = val.status;\n });\n if (data.image.image.url == null) {\n imageUrl = \"../project/images/noimage.jpg\";\n } else {\n imageUrl = data.image.image.url;\n }\n\n if (data.website.length < 1) {\n website = \"#\";\n } else {\n website = data.website;\n }\n\n $.each(data.categories, function (j, cat) {\n if (cat.title.length < 1) {\n category = \"Not Available\";\n } else {\n category = cat.title;\n }\n\n if (cat.description.length < 1) {\n description = \"No description available\";\n } else {\n description = cat.description;\n }\n\n });\n\n output = \"<div id=\\\"singleStationWrapper\\\"><div id=\\\"overlay\\\"><div id=\\\"singleStation\\\">\" +\n \"<img id=\\\"singleStationPhoto\\\" src=\\\"\" + imageUrl + \"\\\" height=\\\"200\\\" width=\\\"200\\\"/>\" +\n \"<h2>\" + stationName + \"</h2>\" +\n \"<ul class=\\\"singleStationDescription\\\"><li><span>Country:</span>\" + countryName + \"</li>\" +\n \"<li><span>StreamUrl:</span><a href=\\\"\" + streamUrl + \"\\\" target=\\\"_blank\\\">Link\" + \"</a></li>\" +\n \"<li><span>Bit-Rate:</span>\" + bitRate + \"</li>\" +\n \"<li><span>Category:</span>\" + category + \"</li>\" +\n \"<li><span>Descripition:</span>\" + description + \"</li>\" +\n \"</ul>\" +\n \"<div id=\\\"player\\\"><audio controls autoplay preload=\\\"none\\\" width=20>\" +\n \"<source src=\\\"\" + streamUrl + \"\\\" type=\\\"audio/mpeg\\\" />\" + \"</audio>\" +\n \"</div><div id=\\\"close\\\">X</div></div></div></div>\";\n\n },\n error: apiLoadError,\n });\n\n if (bitRate == \"0\" || streamUrl.length < 1 || status == \"0\") {\n alert('Oops! The station is down. Please try another Station');\n\n\n } else {\n $('body').append(output);\n }\n\n $('#close').click(function (event) {\n event.preventDefault();\n\n $('#overlay').fadeOut('1000', function () {\n $('#overlay').remove();\n\n });\n });\n });\n\n }", "function valid_trip(rider, driver, current_endpoint, valid_trip_callback) {\n const rider_leave_earliest = rider.leave_earliest.getMinutes();\n const rider_leave_latest = rider.leave_latest.getMinutes();\n\n const driver_leave_earliest = driver.leave_earliest.getMinutes();\n const driver_leave_latest = driver.leave_latest.getMinutes();\n\n const leave_earliest = Math.max(rider_leave_earliest, driver_leave_earliest);\n const leave_latest = Math.min(rider_leave_latest, driver_leave_latest);\n\n\n // departure_time: (leave_earliest + leave_latest) / 2\n // TODO could use leave date to calcuate time in the future. incorporate into both calls\n\n const new_trip_conf = {\n origin: driver.start_point.toString(), destination: driver.end_point.toString(),\n waypoints: `optimize:true|${driver.stringify_waypoints()}|${current_endpoint.toString()}`,\n };\n\n // TODO does not consider the drivers current waypoints\n const old_trip_conf = {\n origin: driver.start_point.toString(), destination: driver.end_point.toString(),\n };\n\n async.map([new_trip_conf, old_trip_conf], lookup_trip, (err, results) => {\n if (err) {\n valid_trip_callback(err);\n return;\n }\n\n const new_trip_time = trip_time(results[0]);\n const old_trip_time = trip_time(results[1]);\n\n if (driver.threshold >= new_trip_time - old_trip_time) {\n const new_match = new Match(rider.id,\n driver.id,\n current_endpoint,\n new_trip_time,\n rider.leave_date,\n new Time(leave_earliest),\n new Time(leave_latest));\n\n valid_trip_callback(null, new_match);\n } else {\n valid_trip_callback(null, null);\n }\n });\n}", "function onFarmStationResponse ( data ) {\n\t\tdata = JSON.parse(data);\n\t\tvar station = data[0];\n\t\tconsole.log(station);\n\n\t\t$.get(\"http://farmsense-prod.apigee.net/v1/frostdates/probabilities/\", \n\t\t\t{ station: station.id, season: 1 },\n\t\t\tonFarmProbabilityResponse);\n\t}", "function daynight()\n{\n \n if (hours < 12)\n {\n dnstatus = \"Morning\";\n dn = dnstatus;\n return;\n }\n\n if (hours > 12 && hours < 16)\n {\n dnstatus = \"Afternoon\";\n dn = dnstatus;\n return;\n }\n\n if (hours > 16 && hours < 20)\n {\n dnstatus = \"Evening\";\n dn = dnstatus;\n return;\n }\n\n else\n {\n dnstatus = \"Night\";\n dn = dnstatus;\n return;\n }\n return;\n}", "function getOneDay() {\r var oneDay = tuneIn.layers.byName(\"One Day\");\r fullDay = oneDay.sourceText.value.toString();\r if (/next/i.test(fullDay)) {\r return fullDay.substring(5, 8);\r } else if (/thank/i.test(fullDay)) {\r return \"TGV\";\r } else return fullDay.substring(0, 3);\r }", "function locateStations() {\n\n // iterate through each station list in the subStations array\n subStations.forEach(function (subStationList) {\n\n // increase the delay time for the api call (rate limit on api)\n subStationDelay += 1000;\n\n // wrap setTimeout in an IIFE to preserve argument values\n (function (subStationList, subStationDelay){\n \n setTimeout(function() {\n console.log('All stations aggregated so far: ', allStations.length);\n\n // attach postal code and borough for each station\n subStationList.forEach(function (station) {\n services.getStationLocation(station);\n });\n }, subStationDelay);\n\n }(subStationList, subStationDelay));\n\n });\n }", "function identifyWeather(app){\n\n let location = 'Chicago';\n let day = 'today';\n\n if(req.body.result.paramaters[LOCATION_ARGUMENT]){\n location = app.getArgument(LOCATION_ARGUMENT);\n }\n\n if(req.body.result.paramaters[DAY_ARGUMENT]){\n day = app.getArgument(DAY_ARGUMENT);\n }\n\n console.log('LOCATION: ' + location);\n console.log('DAY: ' + day);\n\n app.tell('You wanted weather in ' + location + 'for '+ day + 'correct?' );\n }", "function getStationID(stationsURL) {\n fetch(stationsURL, idHeader)\n .then(function (response) {\n if (response.ok) {\n return response.json();\n }\n throw new Error(\"Response not OK.\");\n })\n .then(function (data) {\n // Check collected data\n console.log(\"From getStationId function:\");\n console.log(data);\n\n\n // Store station ID and elevation\n let stationId = data.features[0].properties.stationIdentifier;\n let stationElevation = data.features[0].properties.elevation.value;\n // Check\n console.log(\"Station and Elevation are \" + stationId, stationElevation);\n\n // Data to localstorage\n storage.setItem(\"stationId\", stationId);\n storage.setItem(\"stationElevation\", stationElevation);\n\n // Request current weather for specific station\n getWeather(stationId);\n })\n .catch(error => console.log(\"There was a getStationId error: \", error))\n}", "function getUrl() {\n\t\treturn(TWEET_ENDPOINT);\n\t}", "function assembleQueryURL() {\n\n // Store the location of the truck in a variable called coordinates\n var coordinates = [truckLocation];\n var distributions = [];\n keepTrack = [truckLocation];\n\n // Create an array of GeoJSON feature collections for each point\n var restJobs = objectToArray(pointHopper);\n\n // If there are actually orders from this restaurant\n if (restJobs.length > 0) {\n\n // Check to see if the request was made after visiting the restaurant\n var needToPickUp = restJobs.filter(function (d, i) {\n return d.properties.orderTime > lastAtRestaurant;\n }).length > 0;\n\n // If the request was made after picking up from the restaurant,\n // Add the restaurant as an additional stop\n if (needToPickUp) {\n var restaurantIndex = coordinates.length;\n // Add the restaurant as a coordinate\n coordinates.push(warehouseLocation);\n // push the restaurant itself into the array\n keepTrack.push(pointHopper.warehouse);\n }\n\n restJobs.forEach(function (d, i) {\n // Add dropoff to list\n keepTrack.push(d);\n coordinates.push(d.geometry.coordinates);\n // if order not yet picked up, add a reroute\n if (needToPickUp && d.properties.orderTime > lastAtRestaurant) {\n distributions.push(restaurantIndex + ',' + (coordinates.length - 1));\n }\n });\n }\n\n // Set the profile to `driving`\n // Coordinates will include the current location of the truck,\n return 'https://api.mapbox.com/optimized-trips/v1/mapbox/driving/' + coordinates.join(';') + '?distributions=' + distributions.join(';') + '&overview=full&steps=true&geometries=geojson&source=first&access_token=' + mapboxgl.accessToken;\n }", "function get_schedule(building, room, time, week){\n uwclient.get('/buildings/' + building + '/' + room + '/courses',function (err, res) {\n if (!err){\n check_room(res, time, week)\n }\n })\n}", "formatEndpoint(str)\n {\n var url;\n var apiKey = \"?api_key=c06e14cd13b2c6373fdc8f9f3dd47eb3\";\n var base_uri = \"https://api.themoviedb.org/3/\";\n switch(str)\n {\n case \"Trending\":\n url = base_uri+'trending/movie/week'+apiKey;\n break;\n case \"Popular\":\n url = base_uri+'movie/popular'+apiKey;\n break;\n case \"Now Playing\":\n url = base_uri+'movie/now_playing'+apiKey;\n break;\n default: \n url = base_uri+'trending/movie/week'+apiKey;\n break;\n }\n return url;\n }", "function timeToTravel(src, dst, speed, network, airport) {\n const startplace = src.split(\":\")\n let db = startplace[0]\n let rsn = startplace[1]\n if (!airport.hasOwnProperty(db)) {\n debug.error(\"cannot find position database '\" + db + \"'\")\n return false\n }\n let rs = geojson.findFeature(rsn, airport[db], \"name\") // no check\n if (!rs) {\n debug.error(\"cannot find position '\" + rsn + \"' in database '\" + db + \"'\")\n return false\n }\n\n const endplace = src.split(\":\")\n db = endplace[0]\n rsn = endplace[1]\n if (!airport.hasOwnProperty(db)) {\n debug.error(\"cannot find position database '\" + db + \"'\")\n return false\n }\n let re = geojson.findFeature(rsn, airport[db], \"name\") // no check\n if (!rs) {\n debug.error(\"cannot find position '\" + rsn + \"' in database '\" + db + \"'\")\n return false\n }\n const ls = trip(rs, re, airport[network])\n const len = turf.length(ls, { units: \"kilometers\" })\n return 3600 * len / speed\n}", "function checkURL(req, res, next) {\n // If path is nearest then route on, otherwise redirect to Github repo\n if (req.path == '/nearest') {\n next();\n }\n else {\n res.redirect(301, 'https://github.com/MichaelGordon/Height-API');\n }\n}", "function fightcitytravlr() {\r\n\t\tdo_ajax ('mainDiv', 'remote/html_server.php?xw_controller=travel&xw_action=travel&xw_city=7&destination='+FightInCityNum+'&from=index&nextParams=&menu=travel')\r\n\t\tsetTimeout(offon,10000);\t\r\n\t\tsetTimeout(lpone,4800);\r\n\treturn\r\n\t}", "function getWeatherWithTime() {\n $currentText.text(vm.weather.current.condition.text + ' during the ' + tod);\n currentW = vm.weather.current.condition.text;\n\n var xuCode = _.where(vm.weather, function(e) {\n return e.code == vm.weather.current.condition.code;\n });\n\n var code = {};\n code = xuCode[0];\n\n var t = isDay();\n cloudAmount();\n\n if (t === true) {\n $log.debug('Yes, it ISDAY');\n return code.day;\n } else {\n $log.debug('NO, it IS NOT DAY');\n tod = \"night\";\n return code.night;\n }\n }", "async function getDayWeather(tappedDayDateStr) {\n try {\n let fetchStr = `${weatherApiURL}forecast?lat=${selectedCityLat}&lon=${selectedCityLong}&appid=${weatherApiKey}&units=metric`;\n let weatherData = await parseFetch(fetchStr);\n // console.log(weatherData.list);\n let summarisedList = weatherData.list.map(d => {\n let dtStr = getDateFormatStr(new Date((d.dt) * 1000))\n return {\n dateStr: dtStr,\n hour: parseInt(d.dt_txt.split(' ')[1].split(':')[0], 10),\n minTemp: Math.ceil(d.main.temp_min),\n maxTemp: Math.ceil(d.main.temp_max),\n forecast: d.weather[0].main,\n temp: d.main.temp,\n weatherIcon: d.weather[0].icon\n }\n })\n\n let dayWeatherList = summarisedList.filter(d => d.dateStr == tappedDayDateStr).sort((a, b) => a.hour - b.hour);\n if (dayWeatherList.length > 0) {\n Weather.setDayWeather(dayWeatherList);\n Weather.setDayCity(selectedCity);\n Weather.setDayDate(tappedDayDateStr);\n Weather.setDayTemperature(dayWeatherList[0].temp)\n Weather.setDayForecast(dayWeatherList[0].forecast)\n Weather.setDayIcon(dayWeatherList[0].weatherIcon)\n return true;\n } else {\n return false;\n }\n } catch (e) {\n console.error(e);\n }\n }", "function tweeter() {\n\n // Live and Starting\n // var live = true;\n // var starting = false;\n\n\n // if (day != 4) {\n // live = false;\n // }\n // if (hours < 1 || hours > 1) {\n // live = false;\n // }\n\n // Live and Starting\n var tweet;\n // if (live | testing) {\n // Tweet undefined if it goes the LSTM route\n tweet = generateTweet();\n // Make sure nothing offensive\n while (tweet && wordfilter.blacklisted(tweet)) {\n tweet = generateTweet();\n }\n // }\n\n // Go ahead\n // if ((live || testing) && tweet) {\n if (tweet) {\n tweetIt(tweet);\n }\n\n\n}", "function getTown() {\n console.log(\"getTown running\");\n var buildingNumber = 0;\n townsVisited++;\n $http({\n method: \"GET\",\n url: '/gameplay/town',\n }).then(function(response) {\n console.log(\"Get Success\");\n\n //I did a switch for spacial optimization\n\n switch (response.data[0].building_type) {\n case \"Caravan\":\n buildingNumber = 5;\n break;\n case \"Small\":\n buildingNumber = 10;\n break;\n case \"Medium\":\n buildingNumber = 15;\n break;\n case \"Large\":\n buildingNumber = 20;\n break;\n default:\n buildingNumber = 5;\n }\n\n //This will tell us how many buildings to grab\n\n getBuildings(buildingNumber);\n if (townsVisited == 3) {\n var eventObject = {\n \"event\": \"As you enter this new town, a stranger brushes roughly past you.\",\n \"description\": \"When your anger subsides, you notice a piece a paper in your hand. It says: 'Find Wando and he will aid you'\",\n \"image\": naratorImg\n };\n heardOfWando = true;\n sendEventToIo(eventObject);\n // $scope.eventHistory.push(eventObject);\n }\n }, function() {\n console.log(\"Get Error\");\n });\n }", "function getLocation(locale) {\n const URL = \"https://api.weather.gov/points/\" + locale;\n // NWS User-Agent header is second parameter\n\n // Fetch fucntion\n fetch(URL, idHeader)\n .then(function (response) {\n if (response.ok) {\n return response.json();\n }\n throw new Error(\"Response not OK.\");\n })\n .then(function (data) {\n // Check \n console.log(\"Json object from getLocation function: \");\n console.log(data);\n // Store in localstorage\n storage.setItem(\"locName\", data.properties.relativeLocation.properties.city);\n storage.setItem(\"locState\", data.properties.relativeLocation.properties.state);\n\n // Get link to hourly data\n let hourlyLink = data.properties.forecastHourly;\n console.log('look at me');\n console.log(hourlyLink);\n getHourly(hourlyLink);\n\n // ForecastURL\n let forecastURL = data.properties.forecast;\n getForecast(forecastURL);\n\n // Get link to weather station ID\n let stationsURL = data.properties.observationStations;\n // Call getStationId function\n getStationID(stationsURL);\n })\n .catch(error => console.log(\"There was a getLocation error: \", error))\n}", "function getStationUpdate() {\n var url = \"http://appservices.citibikenyc.com/data2/stations.php?updateOnly=true\"; //unofficial citibike data feed\n $.getJSON(url + '&callback=?', function(data) {\n if (data.ok) {\n stations_full = []\n for (var i in data.results) {\n var one = data.results[i];\n if (one.status.toLowerCase() === 'active') {\n for (var j in stations_min) {\n var two = stations_min[j]\n if (two.id === one.id) {\n stations_full.push($.extend(one, two));\n }\n }\n }\n }\n console.log('111111');\n var startStations = getStartStations(getRandomArbitary(40.716821, 40.732530), getRandomArbitary(-74.009347, -73.980293));\n console.log(startStations);\n }\n });\n }", "function checkCurrentLocationTime() {\n currentLocation = $('#dvWeather > .left-side > .location').text().trim();\n if (currentLocation !== previousLocation) {\n time = $('#dvWeather > .left-side > .timing > #lblTime').text().trim();\n hour = parseInt(time.substring(0, 2), 10);\n min = parseInt(time.substring(3, 5), 10);\n ampm = time.substring(6, 8);\n }\n previousLocation = currentLocation;\n }", "function getInputLocation(){\r\n counter = counter +1;\r\n var inputCityUserWantsToTravel = document.getElementById(\"LocationUserWantsToCheck\").value;\r\n var weatherDOM = document.getElementById('weatherDataDiv');\r\n var weatherAPI_Url = 'https://api.openweathermap.org/data/2.5/weather?q=' + inputCityUserWantsToTravel + '&appid=a1e599b4e637db406be9c5363793e1db';\r\n var flightAPI_Url = 'http://www.json-generator.com/api/json/get/bVtfFgaycy?indent=2';\r\n if ((inputCityUserWantsToTravel.length) && (isTrue)) {\r\n fetchWeatherData(weatherDOM, weatherAPI_Url, counter); \r\n fetchFlightData(inputCityUserWantsToTravel,flightAPI_Url);\r\n } else{\r\n console.log('error');\r\n }\r\n}", "function forecastCall() {\n var queryURL =\n `https://api.openweathermap.org/data/2.5/forecast?q=${city},usa&units=imperial&appid=${key}`;\n console.log(queryURL)\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n var day1 = undefined;\n var day2 = undefined;\n var day3 = undefined;\n var day4 = undefined;\n var day5 = undefined;\n currentTime = moment().format(\"HH:mm\");\n console.log(\"Time: \" + currentTime);\n forecastApiResponse = response;\n console.log(`Forecast Response: ${forecastApiResponse}`);\n if (currentTime >= \"00:00\" && currentTime < \"03:00\") {\n day1 = forecastApiResponse.list[11];\n day2 = forecastApiResponse.list[19];\n day3 = forecastApiResponse.list[27];\n day4 = forecastApiResponse.list[35];\n day5 = forecastApiResponse.list[43];\n } else if (currentTime >= \"03:00\" && currentTime < \"06:00\") {\n day1 = forecastApiResponse.list[10];\n day2 = forecastApiResponse.list[18];\n day3 = forecastApiResponse.list[26];\n day4 = forecastApiResponse.list[34];\n day5 = forecastApiResponse.list[42];\n } else if (currentTime >= \"06:00\" && currentTime < \"09:00\") {\n day1 = forecastApiResponse.list[9];\n day2 = forecastApiResponse.list[17];\n day3 = forecastApiResponse.list[25];\n day4 = forecastApiResponse.list[33];\n day5 = forecastApiResponse.list[41];\n } else if (currentTime >= \"09:00\" && currentTime < \"12:00\") {\n day1 = forecastApiResponse.list[8];\n day2 = forecastApiResponse.list[16];\n day3 = forecastApiResponse.list[24];\n day4 = forecastApiResponse.list[32];\n day5 = forecastApiResponse.list[40];\n } else if (currentTime >= \"12:00\" && currentTime < \"15:00\") {\n day1 = forecastApiResponse.list[7];\n day2 = forecastApiResponse.list[15];\n day3 = forecastApiResponse.list[23];\n day4 = forecastApiResponse.list[31];\n day5 = forecastApiResponse.list[39];\n } else if (currentTime >= \"15:00\" && currentTime < \"18:00\") {\n day1 = forecastApiResponse.list[6];\n day2 = forecastApiResponse.list[14];\n day3 = forecastApiResponse.list[22];\n day4 = forecastApiResponse.list[30];\n day5 = forecastApiResponse.list[38];\n } else if (currentTime >= \"18:00\" && currentTime < \"21:00\") {\n day1 = forecastApiResponse.list[5];\n day2 = forecastApiResponse.list[13];\n day3 = forecastApiResponse.list[21];\n day4 = forecastApiResponse.list[29];\n day5 = forecastApiResponse.list[37];\n } else if (currentTime >= \"21:00\" && currentTime < \"24:00\") {\n day1 = forecastApiResponse.list[4];\n day2 = forecastApiResponse.list[12];\n day3 = forecastApiResponse.list[20];\n day4 = forecastApiResponse.list[28];\n day5 = forecastApiResponse.list[36];\n };\n $(\"#forecast-head\").html(\"<b> 5 Day Forecast (mid-day)</b>\");\n\n var row2 = $(\"#row2\");\n var day1Date = $(\"<th class='forecastDt'>\").text(moment.unix(day1.dt).format(\"MMM Do YYYY\"));\n var day2Date = $(\"<th class='forecastDt'>\").text(moment.unix(day2.dt).format(\"MMM Do YYYY\"));\n var day4Date = $(\"<th class='forecastDt'>\").text(moment.unix(day4.dt).format(\"MMM Do YYYY\"));\n var day3Date = $(\"<th class='forecastDt'>\").text(moment.unix(day3.dt).format(\"MMM Do YYYY\"));\n var day5Date = $(\"<th class='forecastDt'>\").text(moment.unix(day5.dt).format(\"MMM Do YYYY\"));\n row2.append(day1Date);\n row2.append(day2Date);\n row2.append(day3Date);\n row2.append(day4Date);\n row2.append(day5Date);\n\n var row3 = $(\"#row3\");\n var day1Temp = $(\"<td>\").text(\"Temperature: \" + (Math.round(day1.main.temp)) + String\n .fromCharCode(176) + \" F\");\n var day2Temp = $(\"<td>\").text(\"Temperature: \" + (Math.round(day2.main.temp)) + String\n .fromCharCode(176) + \" F\");\n var day3Temp = $(\"<td>\").text(\"Temperature: \" + (Math.round(day3.main.temp)) + String\n .fromCharCode(176) + \" F\");\n var day4Temp = $(\"<td>\").text(\"Temperature: \" + (Math.round(day4.main.temp)) + String\n .fromCharCode(176) + \" F\");\n var day5Temp = $(\"<td>\").text(\"Temperature: \" + (Math.round(day5.main.temp)) + String\n .fromCharCode(176) + \" F\");\n row3.append(day1Temp);\n row3.append(day2Temp);\n row3.append(day3Temp);\n row3.append(day4Temp);\n row3.append(day5Temp);\n\n var row4 = $(\"#row4\");\n var day1WindSpeed = $(\"<td>\").text(`Wind Speed: ${Math.round(day1.wind.speed)} mph`);\n var day2WindSpeed = $(\"<td>\").text(`Wind Speed: ${Math.round(day2.wind.speed)} mph`);\n var day3WindSpeed = $(\"<td>\").text(`Wind Speed: ${Math.round(day3.wind.speed)} mph`);\n var day4WindSpeed = $(\"<td>\").text(`Wind Speed: ${Math.round(day4.wind.speed)} mph`);\n var day5WindSpeed = $(\"<td>\").text(`Wind Speed: ${Math.round(day5.wind.speed)} mph`);\n row4.append(day1WindSpeed);\n row4.append(day2WindSpeed);\n row4.append(day3WindSpeed);\n row4.append(day4WindSpeed);\n row4.append(day5WindSpeed);\n\n var row5 = $(\"#row5\");\n calcWindDir(day1.wind.deg);\n var day1WindDir = $(\"<td>\").text(`Wind Direction: ${windDirection}`);\n calcWindDir(day2.wind.deg);\n var day2WindDir = $(\"<td>\").text(`Wind Direction: ${windDirection}`);\n calcWindDir(day3.wind.deg);\n var day3WindDir = $(\"<td>\").text(`Wind Direction: ${windDirection}`);\n calcWindDir(day4.wind.deg);\n var day4WindDir = $(\"<td>\").text(`Wind Direction: ${windDirection}`);\n calcWindDir(day5.wind.deg);\n var day5WindDir = $(\"<td>\").text(`Wind Direction: ${windDirection}`);\n row5.append(day1WindDir);\n row5.append(day2WindDir);\n row5.append(day3WindDir);\n row5.append(day4WindDir);\n row5.append(day5WindDir);\n\n var row6 = $(\"#row6\");\n var day1Humidity = $(\"<td>\").text(`Humidity: ${day1.main.humidity}%`);\n var day2Humidity = $(\"<td>\").text(`Humidity: ${day2.main.humidity}%`);\n var day3Humidity = $(\"<td>\").text(`Humidity: ${day3.main.humidity}%`);\n var day4Humidity = $(\"<td>\").text(`Humidity: ${day4.main.humidity}%`);\n var day5Humidity = $(\"<td>\").text(`Humidity: ${day5.main.humidity}%`);\n row6.append(day1Humidity);\n row6.append(day2Humidity);\n row6.append(day3Humidity);\n row6.append(day4Humidity);\n row6.append(day5Humidity);\n });\n }", "function urlCheck() {\n var url = document.location.search;\n var split = url.split(\"=\")\n var searchset = split[1]\n var splitset = searchset.split(\"/\")\n var input = splitset[0]\n var type = splitset[1]\n\n if (type == \"ingredient\") {\n fetchIngredient(input)\n } else if (type == \"name\") {\n fetchName(input)\n } else if (type == \"random\") {\n randomDrink()\n }\n}", "function getURLLink(lat, LongD) {\n var URL =\n \"https://api.openweathermap.org/data/2.5/weather?lat=\" +\n lat +\n \"&lon=\" +\n LongD +\n \"&units=metric&appid=9e0b617178c83958f80c183e975d46ec\";\n\n $.getJSON(URL, function(x) {\n var roundNumber = Math.round(x.main.temp);\n $(\".LocationName\").append(x.name + \" ,\" + x.sys.country);\n $(\".Tempa\").append(roundNumber + \" &#8451;\");\n $(\".TypeofWeather\").append(x.weather[0].main);\n $(\".image\").append(\n '<img src=\"https://openweathermap.org/img/w/' +\n x.weather[0].icon +\n '.png\"' +\n \"/>\"\n );\n\n var action = 1;\n\n $(\".link\").on(\"click\", viewSomething);\n\n function viewSomething() {\n if (action == 1) {\n var FahrenheitTemp = Math.round(x.main.temp * 9 / 5 + 32);\n $(\".Tempa\").html(FahrenheitTemp + \" &#8457;\");\n $(\"#newQuote\").text(\"Convert to Celsius\");\n action = 2;\n } else {\n $(\".Tempa\").html(roundNumber + \" &#x2103;\");\n $(\"#newQuote\").text(\"Convert to Fahrenheit\");\n action = 1;\n }\n }\n });\n }", "function setLocation (lat, lon) {\n curLat = lat.toString();\n curLon = lon.toString();\n\n if (unitStatus == \"1F\") {\n urlWeather = 'http://api.openweathermap.org/data/2.5/weather?lat='+curLat+'&lon='+curLon+'&APPID=ca658d6c3e2f5efdebb110ead41e152b&callback=?&units=imperial';\n urlForecast = 'http://api.openweathermap.org/data/2.5/forecast?lat='+curLat+'&lon='+curLon+'&APPID=ca658d6c3e2f5efdebb110ead41e152b&callback=?&units=imperial';\n }\n else {\n urlWeather = 'http://api.openweathermap.org/data/2.5/weather?lat='+curLat+'&lon='+curLon+'&APPID=ca658d6c3e2f5efdebb110ead41e152b&callback=?&units=metric';\n urlForecast = 'http://api.openweathermap.org/data/2.5/forecast?lat='+curLat+'&lon='+curLon+'&APPID=ca658d6c3e2f5efdebb110ead41e152b&callback=?&units=metric';\n }\n/*console.log(curLat);\n console.log(curLon);\n console.log(urlWeather);\n console.log(urlForecast);\n*/\n}", "function main(){\n\n\tcurrUrl = getUrl()\n\tgetIndex = urlVisits.indexOf(currUrl)\n\t\n\tif(urlVisits==[]){\n\t\turlVisits = JSON.parse(urlVisits)\n\t}\n\tconsole.log(document.cookie)\n\tconsole.log(urlVisits)\n\n\tif(currUrl.includes(runsite) && currUrl!=runsite && getIndex!=-1){\n\t\turlVisits[getIndex] = originalUrl[getIndex]+finalTimes[getIndex]\n\t\turlVisits.push(oldUrl)\n\t\turlVisits.push(finalTimes.slice(0))\n\t\turlVisits.push(originalUrl.slice(0))\n\t\tdocument.cookie=JSON.stringify(urlVisits)\n\t\t//document.cookie+=JSON.stringify(finalTimes)\n\t\t//document.cookie+=JSON.stringify(originalUrl)\n\t\twindow.location = originalUrl[getIndex]+finalTimes[getIndex]\n\t}\t\n\n\telse if(currUrl.includes(runsite) && currUrl!=runsite){\n\t\t\n\t\tif(oldUrl!=currUrl && oldUrl!=\"\"){\n\t\t\t\n\t\t\tfinal_time = timeStamps[timeStamps.length-1]\t\t\t\n\t\t\tfinal_min =Math.floor(final_time/60) \n\t\t\tfinal_sec = Math.ceil(final_time - (final_min*60))\n\t\t\tif(final_sec<10){\n\t\t\t\tfinal_sec = \"0\"+final_sec\n\t\t\t}\n\n\t\t\tfinalTimes.push(\"#t=\"+final_min+\"m\"+final_sec+\"s\")\n\t\t\t//console.log(finalTimes)\n\t\t\tif(oldUrl.indexOf(\"#t\")!=-1){\n\t\t\t\toldUrl2 = oldUrl.substring(0, oldUrl.indexOf(\"#t\"))\n\t\t\t\t\n\t\t\t}\n\t\t\t//console.log(oldUrl)\n\t\t\turlVisits.push(oldUrl)\n\t\t\tif(oldUrl2!=\"\"){\n\t\t\t\toriginalUrl.push(oldUrl2)\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\toriginalUrl.push(oldUrl)\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\toldUrl = getUrl() \n\t\t\ttimeStamps = []\t\n\t\t}\n\t\n\t\t\n\t\telse if (oldUrl==currUrl){\n\t\t\ttimeStamps.push(getTimeStamp())\t\n\t\t\n\t\n\t\t}\n\n\t\telse{\n\t\t\n\t\t\toldUrl = currUrl\n\t\t}\t\n\t}\n}", "function checkUrl(){\n\t\n\tvar task = getUrlVar('task');\n\tvar id = getUrlVar('id');\n\tvar radius_simplify = getUrlVar('rs');\n\t//if the id is a number\n\tif (!isNaN(id)){\t\t\n\t\t$('#tabs').tabs('select', 1);\n\t\tswitch(task){\n\t\t\tcase 'ego-centric': \t\n\t\t\t\tviewerControl.displayNetwork('CONTRIBUTOR', id, 0);\n\t\t\t\tbreak;\n\t\t\tcase 'event-centric':\n\t\t\t\tviewerControl.displayNetwork('EVENT', id, 0, radius_simplify) \n\t\t\t\tbreak;\t\t\t\t\n\t\t}\n\t}\n}", "function myURLFunction() {\n\n //var linkUrl = \"http\\\\:myapp.com?from=2012-10-25T11:00:00&to=2012-10-27T13:00:00\";\n\t\n var linkUrl = window.location.href;//\"?from=2015-10-21T11:00:00&to=2015-10-27T13:15:00\";\n\twindow.history.pushState(null,null, linkUrl+\"?from=2015-10-21T11:00:00&to=2015-10-27T13:15:00\");\n var parts=linkUrl.split(\"=\");\n var StartDate=parts[1];\n var EndDate=parts[2];\n var mainstartDate=StartDate.slice(0,-12);\n var re = /(\\d{2})\\:(\\d{2})\\:(\\d{2})/\n var startTime = parts[1].match(re);\n var mainstartTime=startTime.slice(0,-3);\n var mainendDate=EndDate.slice(0,-9);\n var endTime = parts[2].match(re);\n var mainendTime=endTime.slice(0,-3);\n\t//console.log(\"mainstartDate\");\n document.getElementById(\"fromDate\").value = mainstartDate;\n\tdocument.getElementById(\"fromTime\").value = mainstartTime;\n\tdocument.getElementById(\"toDate\").value = mainendDate;\n\tdocument.getElementById(\"toTime\").value = mainendTime;\n fetchDates();\n}", "function showtimes(showtimesUrl) {\n fetch (showtimesUrl, options) \n .then(response => response.json())\n .then(responseJson => {\n console.log(responseJson)\n parseMovies(responseJson)\n })\n }", "async function getWeatherData(Lat, Lng, destdate) {\n\n let response;\n // Check if within 1 week \n\n\tlet weekFromNow = new Date();\n\tweekFromNow.setDate(weekFromNow.getDate() + 7);\n\tlet destdate2 = new Date(postingData['destdate']);\n\tdestdate2.setDate(destdate2.getDate() + 1);\n\t\n\tif (destdate2 > weekFromNow) {\t\n\t\tweatherDesc = 'The predicted forecast is ';\n response = await fetch('https://api.weatherbit.io/v2.0/forecast/daily?lat=' + Lat + '&lon=' + Lng + '&units=I&key=7e6ef199c4b34c7989bd4395bf643fd1');\n } else {\n response = await fetch('https://api.weatherbit.io/v2.0/current?lat=' + Lat + '&lon=' + Lng + '&units=I&key=7e6ef199c4b34c7989bd4395bf643fd1')\n }\n\n try {\n return await response.json();\n } catch (e) {\n console.log('error', e)\n }\n}", "function makeURL(n){\n return \"http://gis.up.nic.in:8080/srishti/kml/\" + (type == \"d\" ? \"district\" : \"pc\") + \"/\" + n + \".kml\" // change pc to district or vice versa\n }", "function getForecastWeatherURL(lat, lon) {\n return 'https://api.openweathermap.org/data/2.5/forecast?lat=' + lat + '&lon=' + lon + '&appid=YOUR_API_KEY';\n}", "function createAutoTaskLinksOnTravianPages() {\n\ttry {\n\t\tBuildBeginnerKey ( );\n\t\tif ( window.location.href.indexOf(\"dorf3.php\") == -1 ) { // if not dorf3.php create auto-task links\n\n\t\t\tif ( ( window.location.href.indexOf(\"tt=2\") != -1 ) && // a2b.php\n\t\t\t\t\t( window.location.href.match(/[\\?&]d=/) == null ) // but not 2nd stage of a2b.php\n\t\t\t\t\t) {\n\t\t\t\tif ( $(\"troops\") != undefined ) {\n\t\t\t\t\t//TS_debug('Check CreatAttackBtn');\n\t\t\t\t\tcreateAttackBtn();\n\n\t\t\t\t\t// when user manually sends troops for attack , clear _troopsAvail in cookie\n\t\t\t\t\tvar attkOkBtn = $(\"btn_ok\");\n\t\t\t\t\tattkOkBtn.addEventListener(\"click\", function() { clearAvailTroopscount(currentID()); return false; }, false);\n\n\t\t\t\t\t// get avail troops count and set in cookie\n\t\t\t\t\tgetAvailTroopsCountFromA2B(currentID());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\thandleBeginProtectionTimeDisplay();\n\n\t\t\tif ( aTravianVersion == \"3.6\" ) {\n\t\t\t\tif ( window.location.href.indexOf(\"karte.php\") != -1 && // showing karte.php\n\t\t\t\t\twindow.location.href.match(/\\bd=/) == null ) { // karte.php not with d parameter, ie not showing village\n\t\t\t\t\tvar mapEnhance = GM_getValue ( myacc() + \"_mapEnhancementsEnabled\", \"1\" );\n\t\t\t\t\tif ( mapEnhance == \"1\" )\n\t\t\t\t\t\thandleMap();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( window.location.href.match(/\\bspieler\\.php\\b/) != null && \n\t\t\t\t( window.location.href.match(/\\buid=/) == null || \n\t\t\t\t\t\t( window.location.href.match(/\\buid=/) != null && window.location.href.indexOf ( \"uid=\"+getuid() ) != -1 ) \n\t\t\t\t\t) \n\t\t\t\t) {\n\t\t\t\tcreateCropFinderLink();\n\t\t\t\tcreateParentVillageLink();\n\t\t\t}\n\n\t\t\tif ( window.location.href.indexOf(\"build.php\") != -1 ) {\n\t\t\t\t//TS_debug(\"h1 text:: h1in().innerHTML: \" + stripHTML(h1in().innerHTML))\n\t\t\t\tif (h1in().getElementsByClassName(\"level\")[0]) {\n\t\t\t\tbNamez = h1in().getElementsByClassName(\"level\")[0].previousSibling.textContent.split(\" \");\n lnamez = h1in().getElementsByClassName(\"level\")[0].textContent.split(\" \");\n\t\t\t\tb_l_name = bNamez +\",\"+ lnamez;\n\t\t\t\th1innerr = b_l_name.replace(/\\s/g,\"\").split(\",\");\n }else{ h1innerr = h1in().textContent.split(\" \") };\n //var h1innerr = stripHTML ( h1in().innerHTML.replace(/\\s{2,}/g,\"\") ).split ( \" \" );\n\t\t\t\t//h1innerr = h1in().getElementsByClassName(\"level\")[0].previousSibling.textContent\n\t\t\t\t//var h1innerr = getPageHeading(document).split(\" \");\n\t\t\t\t//TS_debug(\"h1in().innerHTML = \" + h1in().lastChild.innerHTML);\n\t\t\t\t//TS_debug(\"FM h1innerr.length =\" + h1innerr.length);\n\t\t\t\tvar bName = \"\";\n\t\t\t\tswitch ( h1innerr.length ) {\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tbName = h1innerr[0];\n\t\t\t\t\t\t//TS_debug('FM Case 3 bName =' + bName);\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\tbName = h1innerr[0] + \" \" + h1innerr[1];\n\t\t\t\t\t\t//TS_debug('FM Case 4 bName =' + bName);\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 5:\n\t\t\t\t\t\tbName = h1innerr[0] + \" \" + h1innerr[1] + \" \" + h1innerr[2];\n\t\t\t\t\t\t//TS_debug('FM Case 5 bName =' + bName);\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 6:\n\t\t\t\t\t\tbName = h1innerr[0] + \" \" + h1innerr[1] + \" \" + h1innerr[2] + \" \" + h1innerr[3];\n\t\t\t\t\t\t//TS_debug('FM Case 6 bName =' + bName);\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbName = \"\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tflag ( 'createAutoTaskLinksOnTravianPages():bName\"' + bName + '\"' );\n\t\t\t\t//flag ( 'createAutoTaskLinksOnTravianPages():: h1innerr : \"' + h1innerr.join(\" \") + '\"' );\n\t\t\t\t//flag ( 'createAutoTaskLinksOnTravianPages():: bName : \"' + bName + '\"' );\n\t\t\t\tvar nameFound = false;\n\t\t\t\tfor ( var ctr = 0 ; ctr < aLangAllBuildWithId.length ; ctr ++ ) {\n\t\t\t\t\n\t\t\t\t\tif ( ctr == 4 ) continue;\n\t\t\t\t\tif ( aLangAllBuildWithId[ctr] == bName ) {\n\t\t\t\t\t\tnameFound = true;\n\t\t\t\t\t\t//flag ( 'createAutoTaskLinksOnTravianPages():: nameFound : ' + nameFound );\n\t\t\t\t\t\t//flag ( 'createAutoTaskLinksOnTravianPages():: aLangAllBuildWithId['+ctr+'] : \"' + aLangAllBuildWithId[ctr] + '\"' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( nameFound == false && h1innerr.join(\" \").indexOf(aLangGameText[15]) == -1 ) {\n\t\t\t\t\tflag ( 'createAutoTaskLinksOnTravianPages():: h1innerr : \"' + h1innerr.join(\" \") + '\"' );\n\t\t\t\t\tflag ( 'createAutoTaskLinksOnTravianPages():: bName : \"' + bName + '\"' );\n\t\t\t\t\tflag ( 'createAutoTaskLinksOnTravianPages():: \"' + bName + '\" or \"' + h1innerr.join(\" \")\n\t\t\t\t\t\t\t+ '\" is not in aLangAllBuildWithId & is not aLangGameText[15]' );\n\t\t\t\t\tflag ( 'createAutoTaskLinksOnTravianPages():: aLangGameText[15] : ' + aLangGameText[15] );\n\t\t\t\t\tflag ( 'createAutoTaskLinksOnTravianPages():: aLangAllBuildWithId : ' + aLangAllBuildWithId.join(\", \") );\n\t\t\t\t\tflag ( 'createAutoTaskLinksOnTravianPages():: aLangGameText : ' + aLangGameText.join(\", \") );\n\t\t\t\t\tprintErrorMSG(\"<b>ERROR Part0:: Translation required for: \\\"\" + bName + \"\\\" or \\\"\" + h1innerr.join(\" \") + \"\\\" from build.php.</b>\", 1 );\n\t\t\t\t}\n\n\t\t\t\tif ( (bName == aLangAllBuildWithId[25] || bName == aLangAllBuildWithId[26]) && window.location.href.match(/\\bs=4/) != null ) {\n\t\t\t\t\t//save free slot for new village.RS;\t\n\t\t\t\t\tvar xpathVname = \".//*[@id='expansion']//td[@class='vil']\"\n var VillageName = document.evaluate( xpathVname, document, null, XPOrdList , null );\n var ctr = VillageName.snapshotLength;\n var vName=\"\";\n for (var i=0; i < ctr; i++){\n vName += \"(\" + VillageName.snapshotItem(i).textContent + \")\" + \"\\n\" ; \n };\n\t\t\t\t\tvar palace = (bName == aLangAllBuildWithId[26]) ? \"***\" : \"\" ;\n\t\t\t\t\tvar string = vName +\"\\n\"+\"-\"+palace;\n\t\t\t\t\tsetCookie(\"newVillageSlot\",string,currentID());\n\t\t\t\t\t/*var buildingdata = getCookie(\"BuildingData\",currentID());\n\t\t\t\t\tvar id = window.location.href.match(/\\bid=\\d{1,}/).toString().match(/\\d{1,}/);\n\t\t\t\t\tvar bData = buildingdata[id];\n\t\t\t\t\tif ( bData.gid == 25 || bData.gid == 25){alert(bData.level);};*/\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\tif ( (bName == aLangAllBuildWithId[24] || bName == aLangAllBuildWithId[35]) && window.location.href.match(/\\bid=/) != null && window.location.href.match(/\\bgid=/) == null ) {\n\t\t\t\t\t//TS_debug('FM --------------------- \"CreatePartyLnk\" bName = ' + bName);\t\n\t\t\t\t\tcreatePartylnk();\n\t\t\t\t}\n\n\t\t\t\tif ( ( bName == aLangAllBuildWithId[12] || bName == aLangAllBuildWithId[13] ) \n\t\t\t\t\t\t&& window.location.href.match(/[^gd]id=/) != null && window.location.href.match(/\\bgid=/) == null) {\n\t\t\t\t\t//TS_debug('FM --------------------- \"CreateImprove\" bName = ' + bName);\t\n\t\t\t\t\tcreateImprovelink();\n\t\t\t\t}\n\n\t\t\t\tif ( stripHTML( h1in().innerHTML.replace(/\\n/g,\"\") ).indexOf( aLangAllBuildWithId[15] ) != -1 \n\t\t\t\t\t\t&& h1innerr [ h1innerr.length-1 ] > 9 && ( !$(\"demolish\") ) ) {\n\t\t\t\t\t//TS_debug('FM --------------------- \"CreateDemolishLink\" bName = ' + bName);\n\t\t\t\t\tcreateDemolishlnk();\n\t\t\t\t}\n\n\t\t\t\tif ( ( bName==aLangAllBuildWithId[19] || bName==aLangAllBuildWithId[20] ||\n\t\t\t\t\tbName==aLangAllBuildWithId[21] || bName==aLangAllBuildWithId[25] ||\n\t\t\t\t\tbName==aLangAllBuildWithId[26] || bName==aLangAllBuildWithId[29] || \n\t\t\t\t\tbName==aLangAllBuildWithId[30] || bName==aLangAllBuildWithId[36])\n\t\t\t\t\t&& window.location.href.match(/\\bgid=/) == null ) {\n\t\t\t\t\t//TS_debug('FM --------------------- \"CreateTrainLink\" bName = ' + bName);\t\n\t\t\t\t\tcreateTrainLnk();\n\t\t\t\t}\n\t\t\t\tif ( bName==aLangAllBuildWithId[22] \t&& window.location.href.match(/\\bgid=/) == null ) {\n\t\t\t\t\t//TS_debug('FM --------------------- \"CreateTrainLink\" bName = ' + bName);\t\n\t\t\t\t\tcreateResearchLnk();\n\t\t\t\t}\n\t\t\t\t// GotGs 201.01.15 -- Why leave gid links, becoz it is difficult to fetch the id in case of a gid link.\n\t\t\t\t// The id cannot be fetched from upgrade url, becoz if in case of 'not enough resources' we are stuck.\n\t\t\t\tif (( window.location.href.indexOf(\"build.php\") != -1 ) && \n\t\t\t\t\t\t( window.location.href.match(/\\bid=/) != null || window.location.href.match(/\\bgid=17/) != null ) && \n\t\t\t\t\t\t! isNaN ( h1innerr[h1innerr.length-1] ) && \n\t\t\t\t\t\twindow.location.href.match(/\\bt=/) == null && window.location.href.match(/\\bgid=/) == null ) { \n\t\t\t\t\t//printErrorMSG(\"<b>ERROR:: upgradeLink: \\\"\" + bName + \"\\\" or \\\"\" + h1innerr.join(\" \") + \"\\\" from build.php.</b>\", 1 );\n\t\t\t\t\tcreatebuildlink();\n\t\t\t\t\tcheckBuildErrorTranslation(document);\n\t\t\t\t}\n\n\t\t\t\t// Create new build links.\n\t\t\t\t//TS_debug(\"Check for 'new build' page... \" + stripHTML(h1in().innerHTML));\n\t\t\t\tif ( stripHTML(h1in().innerHTML.replace(/\\n/g,\"\")).indexOf(aLangGameText[15]) != -1 && window.location.href.match(/\\bgid=/) == null ) {\n\t\t\t\t\t//flag('Premier flag');\n \t \t\t\t\t//TS_debug(\"Check for 'CreateNewBuild' page...\" + stripHTML(h1in().innerHTML));\n createNewbuildLnk();\t// Creation option NEW BUILD.\n\t\t\t\t\tcheckNewBuildErrorTanslations(document);\n\t\t\t\t\tcheckNewBuildNameTranslations(document);\n\t\t\t\t}\n\n\t\t\t\tif ( bName.indexOf(aLangAllBuildWithId[17]) != -1 && window.location.href.match(/\\bt=5/) == \"t=5\" ) {\n \t \t\t\t//TS_debug(\"Check for 'createAutoTransBtn' page...\" + bName);\n\t\t\t\t\tcreateAutoTransBtn(); \t// Creation option for Transport automatique and personnalise\n\t\t\t\t\t//refreshMerchantTransit( document, vi)\n\t\t\t\t\tif ( $(\"createUrl\") == null ) {\n\t\t\t\t\t\tcreatebuildlink();\n\t\t\t\t\t\tcheckBuildErrorTranslation(document);\n\t\t\t\t\t}\n\t\t\t\t\t/*var t5Xpath= \".//*[@id='build']/div[contains (@class,'contentNavi')]//a[contains (@href,'')]\";\n var data = document.evaluate(t5Xpath,document,null,XPList,null)\n for (var i=0 ; i < data.snapshotLength ; i++){\n var string = data.snapshotItem(i).textContent.replace(/\\s*$/g,\"\");\n if (string.indexOf(aLangTaskKind[5]) != -1) {\n\t\t\t\t\t var marketId = data.snapshotItem(i).getAttribute('href').match(/\\bid=\\d{1,2}/g)[0];\n\t\t\t\t\t \tGM_setValue ( herere() + \"_marketExists\", \"&\"+marketId );\n\t\t\t\t\t };\n };*/\n\t\t\t\t}\n\n\t\t\t\tif ( stripHTML ( h1in().innerHTML.replace(/\\n/g,\"\") ).indexOf ( aLangAllBuildWithId[37] ) != -1 ) {\n\t\t\t\t\tif ( aTravianVersion == \"3.6\" )\n\t\t\t\t\t\tgetHeroSpeed(document, false); // if hero mansion, get the hero speed.\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( window.location.href.indexOf(\"dorf1\") != -1 ) {\n \t \t\t\t//TS_debug(\"Check for 'createAutoResLink' page...\" + window.location.href));\n\t\t\t\tcreateAutoResLink(); \t// Creation option RESSUPD in page\n\t\t\t}\n\n\t\t\tif ( window.location.href.indexOf(\"hero_inventory.php\") != -1 ) { // for travian version 4.0\n\t\t\t\tgetHeroSpeed(document , false); // get the hero speed.\n\t\t\t}\n\t\t\tif ( window.location.href.indexOf(\"hero_adventure.php\") != -1 ) { // for travian version 4.0\n\t\t\t\tgetAvailableAdventures( document, null, 1 );\n\t\t\t}\n\n\t\t}\n\t}\n\tcatch ( err ) {\n\t\tprintStackTrace();\n\t\tvar msg = \"<b>createAutoTaskLinksOnTravianPages():: Something went wrong, error: \" + err.name + \", Error Message: \" + err.message + \"</b>\";\n\t\tprintErrorMSG(msg);\n\t\tplaySound ( msg );\n\t\tthrow err;\n\t}\n}", "function _getServerURL() {\r\n var breakPoints = [ 'docs', 'test' ];\r\n var oldArr = location.href.split( '/' );\r\n var newArr = [];\r\n\r\n for( var i = 0; i < oldArr.length; i++ ) {\r\n if( breakPoints.indexOf( oldArr[ i ] ) !== -1 ) break;\r\n\r\n newArr.push( oldArr[ i ] );\r\n }\r\n\r\n newArr.push( 'server/' );\r\n\r\n return newArr.join( '/' );\r\n }" ]
[ "0.64522046", "0.6344683", "0.60039604", "0.57328594", "0.5655025", "0.56101674", "0.56046885", "0.55396634", "0.55240345", "0.5517143", "0.55117553", "0.5411827", "0.5408991", "0.5369996", "0.5361896", "0.53344214", "0.53108865", "0.53030497", "0.5296514", "0.5278855", "0.5251785", "0.5232735", "0.5219024", "0.52061296", "0.52010024", "0.51671886", "0.5156918", "0.5126293", "0.5119258", "0.51122755", "0.51071256", "0.5096665", "0.50952876", "0.50952846", "0.50608575", "0.5057465", "0.5051644", "0.5048454", "0.50429654", "0.50367326", "0.50303996", "0.50191545", "0.50000584", "0.49818596", "0.49761558", "0.49744347", "0.49645066", "0.4963936", "0.4946703", "0.49419442", "0.4939487", "0.4937798", "0.4923853", "0.49194005", "0.49183598", "0.4918102", "0.491282", "0.49090156", "0.4886403", "0.48845157", "0.48822117", "0.48671526", "0.4866", "0.48513567", "0.48459077", "0.48414248", "0.48408145", "0.48318633", "0.48302722", "0.48194203", "0.48168647", "0.4813667", "0.48118237", "0.48016384", "0.4801476", "0.4795529", "0.47945967", "0.47905204", "0.47863844", "0.47817194", "0.47780618", "0.477496", "0.4773968", "0.4767032", "0.47632095", "0.47595316", "0.47591543", "0.47575927", "0.47556868", "0.47432274", "0.47427934", "0.4730219", "0.47290355", "0.4724273", "0.47242412", "0.47229522", "0.47133493", "0.4710494", "0.47086865", "0.47054097" ]
0.7028632
0
Checks the time of day and returns the appropriate station.
function chooseCorrectStation() { // If we are in the afternoon look for return trip to Woking if (new Date().getHours() >= 11) { return 'Woking'; } else { return 'Guildford'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getWeatherWithTime() {\n $currentText.text(vm.weather.current.condition.text + ' during the ' + tod);\n currentW = vm.weather.current.condition.text;\n\n var xuCode = _.where(vm.weather, function(e) {\n return e.code == vm.weather.current.condition.code;\n });\n\n var code = {};\n code = xuCode[0];\n\n var t = isDay();\n cloudAmount();\n\n if (t === true) {\n $log.debug('Yes, it ISDAY');\n return code.day;\n } else {\n $log.debug('NO, it IS NOT DAY');\n tod = \"night\";\n return code.night;\n }\n }", "function timechecks() {\n var t = new Date;\n var d = t.getDay();\n return d;\n}", "function getTimeOfDay(time) {\r\n let timeOfDay = '';\r\n\r\n // these statements are read from top to bottom\r\n // going to pick the FIRST true statement\r\n // you can have as many else if()'s as you want. there is no limit\r\n if (time < 12) {\r\n timeOfDay = 'good morning';\r\n } else if (time < 17) {\r\n timeOfDay = 'good afternoon';\r\n }\r\n // final else is a \"catch all\"\r\n else {\r\n timeOfDay = 'good evening';\r\n }\r\n\r\n return timeOfDay;\r\n\r\n}", "function isDay(sunrise, sunset, time){\n\tif(time > sunrise && time < sunset){\n \t\treturn \"day\";\n \t}\n \telse{\n \t\treturn \"night\";\n\t}\n}", "function dayOrNight() {\n var sunset = new Date().sunset(52.3559042,4.9546308);\n var sunrise = new Date().sunrise(52.3559042,4.9546308);\n var current = new Date();\n const sessionValue = sessionStorage.getItem(\"Day?\");\n\n if (sessionValue === null) {\n\n if ((current < sunset && current > sunrise) ) {\n isNightTime = false;\n nightSwitch();\n } else {\n isNightTime = true;\n nightSwitch();\n }\n } else {\n if ( sessionValue === \"true\") {\n isNightTime = false;\n nightSwitch();\n } else {\n isNightTime = true;\n nightSwitch();\n }\n }\n\n\n}", "function checkCurrentLocationTime() {\n currentLocation = $('#dvWeather > .left-side > .location').text().trim();\n if (currentLocation !== previousLocation) {\n time = $('#dvWeather > .left-side > .timing > #lblTime').text().trim();\n hour = parseInt(time.substring(0, 2), 10);\n min = parseInt(time.substring(3, 5), 10);\n ampm = time.substring(6, 8);\n }\n previousLocation = currentLocation;\n }", "function daynight()\n{\n \n if (hours < 12)\n {\n dnstatus = \"Morning\";\n dn = dnstatus;\n return;\n }\n\n if (hours > 12 && hours < 16)\n {\n dnstatus = \"Afternoon\";\n dn = dnstatus;\n return;\n }\n\n if (hours > 16 && hours < 20)\n {\n dnstatus = \"Evening\";\n dn = dnstatus;\n return;\n }\n\n else\n {\n dnstatus = \"Night\";\n dn = dnstatus;\n return;\n }\n return;\n}", "function getWeatherAtTime(data, time) {\n var weather;\n \n var isDay;\n var forecastTime = new Date();\n var timezoneOffset = parseInt(forecastTime.getTimezoneOffset() / 60 + \n data.current_observation.local_tz_offset /100);\n if (time != \"now\") forecastTime.setTime(time);\n var sunrise = new Date();\n sunrise.setTime(forecastTime);\n sunrise.setHours(parseInt(data.sun_phase.sunrise.hour) - timezoneOffset);\n sunrise.setMinutes(data.sun_phase.sunrise.minute);\n var sunset = new Date();\n sunset.setTime(forecastTime);\n sunset.setHours(parseInt(data.sun_phase.sunset.hour) - timezoneOffset);\n sunset.setMinutes(data.sun_phase.sunset.minute);\n if (forecastTime < sunrise || forecastTime > sunset) {\n isDay = 0;\n } else {\n isDay = 1;\n }\n\n if (time == \"now\") {\n weather = {\n city: data.current_observation.display_location.city,\n time: data.current_observation.observation_time,\n temp: data.current_observation.temp_f,\n feel: data.current_observation.feelslike_f,\n icon: data.current_observation.icon,\n wind: data.current_observation.wind_mph,\n isDay: isDay\n };\n } else {\n var forecast;\n data.hourly_forecast.forEach(function(hourlyForecast) {\n if (hourlyForecast.FCTTIME.epoch == time / 1000) {\n forecast = hourlyForecast;\n } \n });\n weather = {\n city: data.current_observation.display_location.city,\n time: forecast.FCTTIME.pretty,\n temp: forecast.temp.english,\n feel: forecast.feelslike.english,\n icon: forecast.icon,\n wind: forecast.wspd.english,\n isDay: isDay\n };\n }\n return weather;\n}", "function timeOfDay(date){\n if (date.getHours() < 12 && date.getHours() > 5){\n return \"Morning\"\n }\n else if (date.getHours () < 6) {\n return \"Too Early!\";\n }\n else if (date.getHours() < 16) {\n return \"Afternoon\";\n }\n else if ((date.getHours() < 20) ) {\n return \"Evening\";\n }\n else return \"Night\"\n }", "static isNight(time) {\n const localDate = DateUtils.toTargetTimezone(time);\n return localDate.getUTCHours() < 8;\n }", "function isEveryDayWork(daytime){\n \n switch(daytime){\n case \"morning\":return \"do jogging\";\n break;\n case \"afternoon\":return \"internet search\";\n break;\n case \"night\":return \"study something new\";\n break;\n default:return \"just cool\";\n }\n}", "function localSolarTime(currentLat, currentLong) {\n // Finding current date\n let todayDay = new Date();\n let year = todayDay.getFullYear();\n let month = todayDay.getMonth() + 1;\n let day = todayDay.getDate();\n if (day < 10) {\n day = \"0\" + day;\n }\n if (month < 10) {\n month = \"0\" + month;\n }\n let today = `${year}-${month}-${day}`;\n // console.log(\"todayDay:\", todayDay, \"today:\", today);\n // Finding offset to the GMT time\n let offset = new Date().getTimezoneOffset();\n offset = offset / -60;\n if (offset > -10 && offset < 0) {\n offset = \"-0\" + offset;\n } else if (offset >= 0 && offset < 10) {\n offset = \"+0\" + offset;\n } else {\n offset = offset;\n }\n offset = offset + \":00\";\n // console.log(\"currentLat, currentLong, offset:\", currentLat, currentLong, offset);\n fetch(\n `https://api.met.no/weatherapi/sunrise/2.0/.json?lat=${currentLat}&lon=${currentLong}&date=${today}&offset=${offset}`\n )\n .then((response) => response.json())\n .then((data) => {\n // console.log(\"solar, lunar data:\", data);\n // Checking if any element of data === undefined\n let moonriseTime = undefined;\n if (data.location.time[0].moonrise !== undefined) {\n moonriseTime = new Date(data.location.time[0].moonrise.time).toLocaleString();\n }\n let moonsetTime = undefined;\n if (data.location.time[0].moonset !== undefined) {\n moonsetTime = new Date(data.location.time[0].moonset.time).toLocaleString();\n }\n let moonHighElevation = undefined;\n let moonHighTime = undefined;\n if (data.location.time[0].high_moon !== undefined) {\n moonHighElevation = parseFloat(data.location.time[0].high_moon.elevation).toFixed(2);\n moonHighTime = new Date(data.location.time[0].high_moon.time).toLocaleString();\n }\n let sunRiseTime = undefined;\n if (data.location.time[0].sunrise !== undefined) {\n sunRiseTime = new Date(data.location.time[0].sunrise.time).toLocaleString();\n }\n let sunSetTime = undefined;\n if (data.location.time[0].sunset !== undefined) {\n sunSetTime = new Date(data.location.time[0].sunset.time).toLocaleString();\n }\n let solarNoonTime = undefined;\n let solarNoonElevation = undefined;\n if (data.location.time[0].solarnoon !== undefined) {\n solarNoonTime = new Date(data.location.time[0].solarnoon.time).toLocaleString();\n solarNoonElevation = parseFloat(data.location.time[0].solarnoon.elevation).toFixed(2);\n }\n let solarMidnightTime = undefined;\n let solarMidnightElevation = undefined;\n if (data.location.time[0].solarmidnight !== undefined) {\n solarMidnightTime = new Date(data.location.time[0].solarmidnight.time).toLocaleString();\n solarMidnightElevation = parseFloat(data.location.time[0].solarmidnight.elevation).toFixed(2);\n }\n // DOM for displaying the Sun/ the Moon info\n document.querySelector(\".moonriseTimeText > span\").innerHTML = moonriseTime;\n document.querySelector(\".moonsetTimeText > span\").innerHTML = moonsetTime;\n document.querySelector(\".moonHighElevationText > span\").innerHTML = moonHighElevation + \"°\";\n document.querySelector(\".moonHighTimeText > span\").innerHTML = moonHighTime;\n document.querySelector(\".sunRiseTimeText > span\").innerHTML = sunRiseTime;\n document.querySelector(\".sunSetTimeText > span\").innerHTML = sunSetTime;\n document.querySelector(\".solarNoonTimeText > span\").innerHTML = solarNoonTime;\n document.querySelector(\".solarNoonElevationText > span\").innerHTML = solarNoonElevation + \"°\";\n document.querySelector(\".solarMidnightTimeText > span\").innerHTML = solarMidnightTime;\n document.querySelector(\".solarMidnightElevationText > span\").innerHTML = solarMidnightElevation + \"°\";\n // Changing color for undefined value\n let undefinedNodeList = document.querySelectorAll(\".astroInfo>p>span\");\n // console.log(\"undefinedNodeList:\", undefinedNodeList);\n undefinedNodeList.forEach((elem) => {\n if (elem.innerText === \"undefined\") {\n elem.style.color = \"blueViolet\";\n elem.style.fontStyle = \"italic\";\n // console.log(\"elem of undefinedNodeList:\", elem);\n }\n });\n });\n}", "function timeOfDay(hr) {\r\n\tswitch (true) {\r\n\t\tcase (hr < 3):\r\n\t\t\treturn \"night\";\r\n\t\t\tbreak;\r\n\t\tcase (hr < 12):\r\n\t\t\treturn \"morning\";\r\n\t\t\tbreak;\r\n\t\tcase (hr < 18):\r\n\t\t\treturn \"afternoon\";\r\n\t\t\tbreak;\r\n\t\tcase (hr >=18):\r\n\t\t\treturn \"night\";\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\treturn \"day\";\r\n\t\t}\r\n}", "function checkTime()\r\n { \r\n var pass = false;\r\n var ids = [\"#time_mon\", \"#time_tue\", \"#time_wed\", \"#time_thu\", \"#time_fri\", \"#time_sat\", \"#time_sun\"]; \r\n for(i in ids){\r\n if($(ids[i]).val()){ //the user input something here\r\n pass = true; //set true for now. To flag that at least a day is available\r\n //check if the entered format is correct\r\n var reg = new RegExp(/^\\d{4}$/);\r\n var arr = $(ids[i]).val().split(' '); //split into time frame chunks \r\n for(j in arr){ \r\n var temp = arr[j].split('-'); //get a specific time\r\n if(reg.test(temp[0]) && reg.test(temp[1])){ //if the tokens are true\r\n //check if the timeslots are within 24 hours \r\n if(temp[0] <= 2400 && temp[1] <= 2400){\r\n pass = true; \r\n// alert(temp[0]);\r\n// alert(temp[1]);\r\n }\r\n else{\r\n pass = false;\r\n }\r\n }\r\n else{\r\n var day = ids[i].split('_')[1];\r\n// alert(day); \r\n if(day == \"wed\"){\r\n day += \"nesday\";\r\n }\r\n else if(day == \"thu\"){\r\n day += \"rsday\";\r\n }\r\n else if(day == \"tue\"){\r\n day += \"sday\";\r\n }\r\n else if(day == \"sat\"){\r\n day += \"urday\";\r\n }\r\n else{\r\n day += \"day\";\r\n } \r\n day = \"Please fix your availability on \" + day;\r\n alert(day); //alert user as to what is wrong \r\n $(ids[i]).focus();\r\n pass = false;\r\n return pass;\r\n }\r\n }\r\n } \r\n } \r\n if(pass == false){\r\n alert(\"Something went wrong with your availability.\");\r\n $(\"#time_mon\").focus(); \r\n }\r\n return pass;\r\n }", "function time() {\n const date = new Date();\n const hours = date.getHours();\n let timeOfDay;\n if (hours < 12) {\n timeOfDay = \"Good morning :)\";\n } else if (hours >= 12 && hours < 17) {\n timeOfDay = \"Good afternoon :)\";\n } else {\n timeOfDay = \"Good evening :)\";\n }\n return timeOfDay;\n}", "function checkSingleSchedule(now, status, schedule) {\n if (now >= schedule.start && now <= schedule.end) {\n log.log(\"now is perfect for this schedule\");\n return schedule;\n } else if (schedule.repeat.indexOf(now.getDay()) > -1) {\n //comprobamos solo la hora porque estamos en un patron de repetición\n //y hoy es uno de los dias en los que deberia saltar este programa\n var time = new Date(now).setFullYear(2000,0,1);\n var start = new Date(schedule.start).setFullYear(2000,0,1);\n var end = new Date(schedule.end).setFullYear(2000,0,1);\n\n //ahora podemos comparar solo los tiempos\n if (time >= start && time <= end) {\n //encaja\n log.log(\"now is enought for this schedule, today \" + now.getDay() + \" start \" + (new Date(schedule.start)).getDay());\n return schedule;\n }\n }\n\n //ninguno encajaba\n return null;\n }", "function checkIsItDay() {\n let time = new Date().getHours();\n // console.log(time.getHours());\n return time > 6 && time < 18;\n}", "function validateIsMidnight(timeInfo) {\n\n var zeroCounter = 0;\n var charsToCount = timeInfo.length;\n var midnight = false; \n if (timeInfo.length > 2) {\n charsToCount = 2;\n }\n for (ci = 0; ci < charsToCount; ci++) {\n if (timeInfo.charCodeAt(ci) == 48) {\n zeroCounter++;\n }\n }\n if (zeroCounter == charsToCount) {\n midnight = true;\n }\n return midnight;\n}", "function Dagdeel(time) {\n var time = new Date().getHours();\n if (time < 6) {\n return \"good night. \";\n } else if\n (time < 12 ) {\n return \"good morning. \";\n } else if \n (time < 18) {\n return \"good afternoon. \";\n } else { \n return \"good evening. \";\n }\n }", "function check(){\n var time = new Date();\n var hour = time.getHours();\n var min = time.getMinutes();\n var zone = \"PM\";\n\t\tif(hour < 12){\n\t\t\tzone = \"AM\";\n\t\t}\n\t\tif(hour > 12){\n\t\t\thour = hour - 12;\n }\n if(hour < 10){\n\t\t\thour = \"0\" + hour;\n\t\t}\n\t\tif(min < 10){\n\t\t\tmin = \"0\" + min;\n\t\t}\n \n var tiempo = hour + \":\" + min + \":\" + zone; \n if(alarmSet === tiempo && activate === 0){\n activate = 1;\n play(zora);\n }\n}", "function schedule_name(c){ // Input Day as integer\n // Shorten the day grabber 'cuz I ain't gonna type the whole thing out\n var o = Dates('d')\n // Condition for the Regular Schedule\n if(o == 1 || o == 3 || o == 4 || o == 5){\n // Long Version\n if(c == true){\n // Rereturn the schedule\n return(\"regular\")\n // Short Version\n }else if(c == false){\n // Returned\n return('r')\n // What happens when you don't listen\n }else{\n // Consequences of not working\n console.log(\"Not what I was expecting\")\n }\n // Condition for the Chapel/Pep Days\n }else if(o == 2){\n if(c == true){\n // \"Return to Sender\"\n return(\"chapel_pep\")\n // Condition for the short Chapel/Pep Days\n }else if(c == false){\n // The itty bitty version\n return('c')\n }else{\n // When I say Error, I mean Error\n console.log(\"Not what I was expecting\")\n }\n // THE WEEKEND\n }else if(o == 0 || o == 6){\n // Condition for the long weekend\n if(c == true){\n // Long Weekend\n return(\"Weekend\")\n // Condition for the short weekend\n }else if(c == false){\n // Shorter version of the weekend\n return('w')\n }else{\n // Sometimes referensed as an airbag\n console.log(\"Not what I was expecting\")\n }\n }else{\n // And the Errors go to this guy\n console.log(\"Error\")\n }\n }", "function checkStation(station) {\n\n var code = getStationCode(station);\n\n // Check that the code is in the list of stops\n return Stops.getAll().then(function (stops) {\n return stops.some(function check(stop) {\n return stop.stop_id == code;\n });\n });\n}", "function dayOrNight (sunrise,sunset) {\n const time = Date.now();\n if (time >= sunset && time <= sunrise) {\n document.querySelector('.frame').classList.add('night');\n document.querySelector('.sun').classList.add('moon');\n }\n}", "getSchedule(location, date) {\r\n const weekday = this.weekDays[date.getDay()];\r\n return location.openingHours.weekDayOpeningList.find((weekDayOpeningListItem) => weekDayOpeningListItem.weekDay === weekday);\r\n }", "function dailyCheck(){\n // set later to use local time\n later.date.localTime();\n // this is 8 PM on July 23rd\n var elevenAM = later.parse.recur().every(1).dayOfMonth().on(11).hour();\n var tenAM = later.parse.recur().every(1).dayOfMonth().on(10).hour();\n\n var timer2 = later.setInterval(remindPresentingGroups, elevenAM);\n var timer3 = later.setInterval(otherReminders, tenAM);\n}", "function extractTime(currIcon) {\n if (isDay(currIcon)) {\n return 'day';\n } else if (isNight(currIcon)) {\n return 'night';\n } else {\n return 'null';\n }\n }", "function get_station_by_event(e) {\n\tstation_id = e.target.id;\n\n\tvar station_num = station_id.substring(8);\n\tget_station(station_num);\n}", "function checkDay(session){\n for (var day of days){\n if (session.toUpperCase().includes(day)){\n return day;\n }\n }\n}", "getDay(input) {\n let parsed = Day.parse(input);\n if (parsed) {\n let dayCount = parsed.start().daysBetween(this.days[0], Op.DOWN, false);\n return this.days[dayCount];\n }\n return null;\n }", "function weatherOnDay(day){\n var weather;\n switch(day){\n case \"Sunday\": \n weather = \"Cloudy with a chance of rain\";\n break;\n case \"Monday\":\n weather = \"Sunny as day\";\n break;\n case \"Tuesday\":\n weather = \"Thunderstorms\";\n break;\n case \"Wednesday\":\n weather = \"Hailing\";\n break;\n case \"Thursday\":\n weather = \"Snowing\";\n break;\n case \"Friday\":\n weather = \"Raining\";\n break;\n case \"Saturday\":\n weather = \"Chilly\";\n break;\n default:\n weather = \"Enter a valid day\";\n }\n return weather;\n}", "function fetchdayoftheweek(){\r\n var d = new Date();\r\n var n = d.getDay();\r\n\r\n let sat = \"Saturday\"\r\n let sun = \"Sunday\"\r\n let mon = \"Monday\"\r\n let tue = \"Tuesday\"\r\n let wed = \"Wednesday\"\r\n let thu = \"Thursday\"\r\n let fri = \"Friday\"\r\n\r\n if (n==6){\r\n return sat;\r\n }\r\n else if (n==0){\r\n return sun;\r\n }\r\n else if (n==0){\r\n return mon;\r\n }\r\n else if (n==0){\r\n return tue;\r\n }\r\n else if (n==0){\r\n return wed;\r\n }\r\n else if (n==0){\r\n return thu;\r\n }\r\n else if (n==0){\r\n return fri;\r\n }\r\n }", "function findDaylight(now) {\n if(now.isDST()){\n return chalk.green(\"is\")\n } else {\n return chalk.red(\"is not\")\n }\n}", "getStoreOpeningTime(location, date) {\r\n const requestedDaySchedule = this.getSchedule(location, date);\r\n if (requestedDaySchedule) {\r\n if (requestedDaySchedule.closed && requestedDaySchedule.closed === true) {\r\n return 'closed';\r\n }\r\n if (requestedDaySchedule.openingTime) {\r\n return requestedDaySchedule.openingTime.formattedHour;\r\n }\r\n }\r\n }", "calculateAppDay(location,eventDate) {\n //MOONDATA moon;\n //SUNDATA sun;\n var d = this.details = new GCAstroData();\n var vc = new GregorianDateTime();\n var vcsun = new GregorianDateTime();\n var m_earth = location.GetEarthData();\n\n vc.Set(eventDate);\n vcsun.Set(eventDate);\n\n this.b_adhika = false;\n this.eventTime = GregorianDateTime.NewWithDate(eventDate);\n this.Location = location;\n\n //d.nTithi = GetPrevTithiStart(m_earth, vc, dprev);\n //GetNextTithiStart(m_earth, vc, dnext);\n vcsun.shour -= vcsun.TimezoneHours / 24.0;\n vcsun.NormalizeValues();\n vcsun.TimezoneHours = 0.0;\n d.sunRise = new GCHourTime();\n d.sunRise.TotalDays = vc.shour;\n d.sunRise.longitude = GCCoreAstronomy.GetSunLongitude(vcsun, m_earth);\n d.sunRise.longitudeMoon = GCCoreAstronomy.GetMoonLongitude(vcsun, m_earth);\n d.Ayanamsa = GCAyanamsha.GetAyanamsa(vc.GetJulianComplete());\n d.sunRise.Ayanamsa = d.Ayanamsa;\n\n // tithi\n\n\n d.Masa = d.MasaCalc(vc, m_earth);\n if (d.Masa == MasaId.ADHIKA_MASA)\n {\n d.Masa = d.sunRise.RasiOfSun;\n this.b_adhika = true;\n }\n\n vc.Today();\n vc.TimezoneHours = m_earth.OffsetUtcHours;\n var m = 0;\n var i;\n var va = new GaurabdaDate();\n var vctemp;\n\n va.tithi = d.sunRise.Tithi;\n va.masa = d.Masa;\n va.gyear = GCCalendar.GetGaurabdaYear(vc, m_earth);\n if (va.gyear < d.GaurabdaYear)\n va.gyear = d.GaurabdaYear;\n\n MainInfo.push(AppDayBase.NewValue(GCStrings.getString(7), eventDate.ToString()));\n MainInfo.push(AppDayBase.NewEmptyLine());\n MainInfo.push(AppDayBase.NewValue(GCStrings.getString(8), eventDate.ShortTimeString()));\n MainInfo.push(AppDayBase.NewEmptyLine());\n MainInfo.push(AppDayBase.NewEmptyLine());\n MainInfo.push(AppDayBase.NewValue(GCStrings.getString(9), location.Title));\n MainInfo.push(AppDayBase.NewValue(GCStrings.getString(10), location.GetLatitudeString()));\n MainInfo.push(AppDayBase.NewValue(GCStrings.getString(11), location.GetLongitudeString()));\n MainInfo.push(AppDayBase.NewValue(\"Timezone\", location.TimeZoneName));\n MainInfo.push(AppDayBase.NewValue(\"DST\", \"N/A\"));\n MainInfo.push(AppDayBase.NewEmptyLine());\n MainInfo.push(AppDayBase.NewValue(GCStrings.getString(13), GCTithi.GetName(d.sunRise.Tithi)));\n MainInfo.push(AppDayBase.NewValue(GCStrings.getString(14), GCStrings.Format(\"{0:00.000}%\", d.sunRise.TithiElapse)));\n MainInfo.push(AppDayBase.NewValue(GCStrings.getString(15), GCNaksatra.GetName(d.sunRise.Naksatra)));\n MainInfo.push(AppDayBase.NewValue(GCStrings.getString(16), GCStrings.Format(\"{0:00.000}% ({1} pada)\", d.sunRise.NaksatraElapse, GCStrings.getString(811 + d.sunRise.NaksatraPada))));\n MainInfo.push(AppDayBase.NewValue(\"Moon Rasi\", GCRasi.GetName(d.sunRise.RasiOfMoon)));\n MainInfo.push(AppDayBase.NewValue(\"Sun Rasi\", GCRasi.GetName(d.sunRise.RasiOfSun)));\n MainInfo.push(AppDayBase.NewValue(GCStrings.getString(20), GCPaksa.GetName(d.sunRise.Paksa)));\n\n if (b_adhika == true)\n {\n MainInfo.Add(AppDayBase.NewValue(GCStrings.getString(22), GCMasa.GetName(d.Masa) + GCStrings.getString(21)));\n }\n else\n MainInfo.Add(AppDayBase.NewValue(GCStrings.getString(22), GCMasa.GetName(d.Masa)));\n MainInfo.Add(AppDayBase.NewValue(GCStrings.getString(23), d.GaurabdaYear.ToString()));\n\n if (gds.getValue(48) == 1)\n {\n MainInfo.Add(AppDayBase.NewLineCond(GCDS.APP_CHILDNAMES));\n MainInfo.Add(AppDayBase.NewSeparator(GCStrings.getString(17)));\n MainInfo.Add(AppDayBase.NewLineCond(GCDS.APP_CHILDNAMES));\n\n MainInfo.Add(AppDayBase.NewValue(GCDS.APP_CHILDNAMES, GCStrings.getString(18), GCStrings.GetNaksatraChildSylable(d.sunRise.Naksatra, d.sunRise.NaksatraPada) + \"...\"));\n MainInfo.Add(AppDayBase.NewValue(GCDS.APP_CHILDNAMES, GCStrings.getString(19), GCStrings.GetRasiChildSylable(d.sunRise.RasiOfMoon) + \"...\"));\n }\n\n MainInfo.Add(AppDayBase.NewEmptyLine());\n MainInfo.Add(AppDayBase.NewSeparator(GCStrings.getString(24)));\n MainInfo.Add(AppDayBase.NewEmptyLine());\n\n\n celeb_date = [];\n celeb_gy = [];\n\n for (i = 0; i < TRESULT_APP_CELEBS + 3; i++)\n {\n vctemp = GCCalendar.VATIMEtoVCTIME(va, m_earth);\n if (va.gyear > d.GaurabdaYear)\n {\n if (this.celeb_gy.length < TRESULT_APP_CELEBS)\n {\n MainInfo.Add(AppDayBase.NewValue(\"Gaurabda \" + va.gyear.toString(), vctemp.ToString()));\n this.celeb_date.push(GregorianDateTime.NewWithDate(vctemp));\n this.celeb_gy.push(va.gyear);\n m++;\n }\n }\n va.gyear++;\n }\n }", "function getpass_at(e) {\n const minuteRelativeTime = /(\\d+)\\s*分钟前/;\n const hourRelativeTime = /(\\d+)\\s*小时前/;\n const yesterdayRelativeTime = /昨天\\s*(\\d+):(\\d+)/;\n const shortDate = /(\\d+)-(\\d+)\\s*(\\d+):(\\d+)/;\n\n // offset to ADD for transforming China time to UTC\n const chinaToUtcOffset = -8 * 3600 * 1000;\n // offset to ADD for transforming local time to UTC\n const localToUtcOffset = new Date().getTimezoneOffset() * 60 * 1000;\n // offset to ADD for transforming local time to china time\n const localToChinaOffset = localToUtcOffset - chinaToUtcOffset;\n\n let time;\n if (e === '刚刚') {\n time = new Date();\n } else if (minuteRelativeTime.test(e)) {\n const rel = minuteRelativeTime.exec(e);\n time = new Date(Date.now() - parseInt(rel[1]) * 60 * 1000);\n } else if (hourRelativeTime.test(e)) {\n const rel = hourRelativeTime.exec(e);\n time = new Date(Date.now() - parseInt(rel[1]) * 60 * 60 * 1000);\n } else if (yesterdayRelativeTime.test(e)) {\n const rel = yesterdayRelativeTime.exec(e);\n // this time is China time data in local timezone\n time = new Date(Date.now() - 86400 * 1000 + localToChinaOffset);\n time.setHours(parseInt(rel[1]), parseInt(rel[2]), 0, 0);\n // transform back to china timezone\n time = new Date(time.getTime() - localToChinaOffset);\n } else if (shortDate.test(e)) {\n const rel = shortDate.exec(e);\n const now = new Date(Date.now() + localToChinaOffset);\n const year = now.getFullYear();\n // this time is China time data in local timezone\n time = new Date(year, parseInt(rel[1]) - 1, parseInt(rel[2]), parseInt(rel[3]), parseInt(rel[4]));\n // transform back to china timezone\n time = new Date(time.getTime() - localToChinaOffset);\n } else {\n time = new Date(e);\n }\n return time;\n }", "function checktimeslot() {\n\n\t}", "function checkDate(int,tomorrow,array){\r\n\tvar dateInfo = getTime();\r\n\tif(tomorrow){ //adjust day if needed\r\n\t\tif(dateInfo[2] == 6) {\r\n\t\t\tdateInfo[2] = 0;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tdateInfo[2] = dateInfo[2]+1;\r\n\t\t}\r\n\t}\r\n\tvar hourFloat = concot(dateInfo);\r\n\tif(finder(\"openWhen\",queryResult) != undefined) {\r\n\t\thourFloat = parseFloat(finder(\"openWhen\",queryResult));\r\n\t}\r\n\r\n\tif(dateInfo[2] == 6){\r\n\t\tvar saturday = array[int][\"tid_lordag\"].split(\" - \");\r\n\t\tif(parseFloat(saturday[0])<hourFloat&&parseFloat(saturday[1])>hourFloat || array[int][\"tid_lordag\"] == \"ALL\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\telse if (dateInfo[2] == 0) {\r\n\t\tvar sunday = array[int][\"tid_sondag\"].split(\" - \");\r\n\t\tif(parseFloat(sunday[0])<hourFloat &&parseFloat(sunday[1])>hourFloat || array[int][\"tid_sondag\"] == \"ALL\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tvar weekday = array[int][\"tid_hverdag\"].split(\" - \");\r\n\t\tif(parseFloat(weekday[0])<hourFloat&&parseFloat(weekday[1])>hourFloat || array[int][\"tid_hverdag\"] == \"ALL\"){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n}", "function getOneDay() {\r var oneDay = tuneIn.layers.byName(\"One Day\");\r fullDay = oneDay.sourceText.value.toString();\r if (/next/i.test(fullDay)) {\r return fullDay.substring(5, 8);\r } else if (/thank/i.test(fullDay)) {\r return \"TGV\";\r } else return fullDay.substring(0, 3);\r }", "function showForecastTime (timestamp) {\nlet forecastDate = new Date (timestamp);\nlet days = [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\"\n];\nlet day = days[now.getDay()];\n}", "function whichDay(dayNow, dayLater) {\n let dayValue;\n switch (dayNow) {\n case \"Monday\":\n dayValue = 1\n break;\n case \"Tuesday\":\n dayValue = 2;\n break;\n case \"Wednesday\":\n dayValue = 3;\n break;\n case \"Thursday\":\n dayValue = 4;\n break;\n case \"Friday\":\n dayValue = 5;\n break;\n case \"Saturday\":\n dayValue = 6;\n break;\n case \"Sunday\":\n dayValue = 7;\n break;\n default:\n console.log(\"Not a day of the week\");\n\n }\n let dayNumber = dayValue + dayLater;\n switch (dayNumber % 7) {\n case 1:\n return \"Monday\";\n break;\n case 2:\n return \"Tuesday\";\n break;\n case 3:\n return \"Wendesday\";\n break;\n case 4:\n return \"Thursday\";\n break;\n case 5:\n return \"Friday\";\n break;\n case 6:\n return \"Saturday\";\n break;\n case 0:\n return \"Sunday\";\n break;\n default:\n console.log(\"Invalid Number\");\n\n }\n}", "function checkDay(hours)\n{\n if(hours >= 6 && hours <= 12)\n {\n return \"morning\";\n }\n else if(hours >= 13 && hours <= 17)\n {\n return \"afternoon\";\n }\n else if(hours >= 18 && hours <=24 || hours <=5)\n {\n return \"evening\";\n }\n else\n {\n return \"morning\";\n }\n}", "function whatDayToday(day) {\n var result;\n day = day.toLowerCase();\n switch (day) {\n case \"sunday\":\n case \"monday\":\n result = \"Have a good week\"\n break\n case \"tuesday\":\n case \"wednesday\":\n result = \"Ohhh....\"\n break\n case \"thrusday\":\n result = \"Yalla habayta\"\n break\n case \"friday\":\n case \"saturday\":\n result = \"Yammi jachnun\"\n break\n default:\n result = \"Not a valid day\"\n break\n }\n return result\n }", "getToday() {\n const TODAY_DATE = new Date();\n let today;\n\n //For every day in the database response\n this.response.forEach(day => {\n const dateToCompare = new Date(day.dayDate);\n\n if (dateToCompare.toDateString() === TODAY_DATE.toDateString()) {\n //Today was found within the database response\n today = day;\n }\n });\n\n if (!today) {\n //Today is not stored in the database, so just get a new day!\n today = this.getDayByDate(TODAY_DATE);\n }\n\n return today;\n }", "function checktime(){\n\t\t\t\tvar currentDate=new Date().getHours();\n\t\t\t\tif(currentDate > 19){\n\t\t\t\t\t$scope.TodaylaterReminder=false;\n\t\t\t\t}\n\t\t\t\tif(currentDate > 1){\n\t\t\t\t\t$scope.TodaylaterReminder=true;\n\t\t\t\t}\n\t\t\t}", "function fullTimeWorkingDay(dayWage)\n{\n return dayWage.includes(\"160\");\n}", "function checkDay(message) {\n var d = today.toLocaleString('en-us', {weekday: 'long'});\n for (var key in message) {\n var startHour = message[key][0];\n var endHour = message[key][1];\n if ((key == d) && (today.getHours() >= startHour && today.getHours() <= endHour)) {\n isAnyActiveMessage = 1;\n return 1;\n }\n }\n\n\n return 0;\n}", "function getTime(time, day) {\n time = Math.round((time + 0.1) * 100) / 100;\n\n if (time >= day) {\n return 0;\n }\n else {\n return time;\n }\n }", "function GettingWorkingHours(empCheck)\n{\n switch(empCheck) {\n case IS_FULL_TIME:\n return FULL_TIME_HOURS;\n break;\n case IS_PART_TIME:\n return PART_TIME_HOURS;\n break;\n default:\n return 0; \n } \n}", "function get_schedule(building, room, time, week){\n uwclient.get('/buildings/' + building + '/' + room + '/courses',function (err, res) {\n if (!err){\n check_room(res, time, week)\n }\n })\n}", "function trueOfFalseSun() {\n if (trueOrFalse() === true) {\n return {\n convertedSunrise: timestamp.convertTime(todayWeather.allWeather.current.daily.data[0].sunriseTime),\n convertedSunset: timestamp.convertTime(todayWeather.allWeather.current.daily.data[0].sunsetTime)\n }\n }\n }", "function dayTime(currentTime){\n if (currentTime >= 7){\n return true;\n } else {\n return false;\n }\n }", "function getSett() {\n daynight = localStorage.getItem(\"daynight\");\n return daynight;\n}", "function findWeatherDayIndex() {\n const today = new Date();\n const dayToday = today.getDay();\n let WeatherDayIndexs = [];\n WeatherDayIndexs.push(dayToday);\n\n const daysToNextWeekend = {\n\n /** \"0\": [0],: IF TODAY IS SUNDAY, DAY 0 FROM \n THE API RESPONSE DATA WILL BE NEEDED.\n * IF THE CURRENT DAY IS THURSDAY, DAYS 1, 2 AND 3 WILL BE NEEDED */\n \"0\": [0],\n \"1\": [4, 5, 6],\n \"2\": [3, 4, 5],\n \"3\": [2, 3, 4],\n \"4\": [1, 2, 3],\n \"5\": [0, 1, 2],\n \"6\": [0, 1]\n };\n\n const ourIndex = daysToNextWeekend[dayToday];\n WeatherDayIndexs.push(ourIndex);\n return WeatherDayIndexs; // ** i should return this with the day num then check if day num === 6 \n\n}", "function isOpen(truckID) {\n\t//aey - get current hour, current minute\n\tlet curDate = new Date();\n\tlet curHr = curDate.getHours();\n\tlet curMin = curDate.getMinutes();\n\tlet curTime = timeToANumber(curHr, curMin);\n\tif (!isNaN(curTime)) { //aey - if current time is a number\n\t\t//aey - get opening and closing times for the truck as numbers\n\t\tlet truckOpening = timeToANumber(getHourOpen(truckID), getMinuteOpen(truckID));\n\t\tlet truckClosing = timeToANumber(getHourClosed(truckID), getMinuteClosed(truckID));\n\t\tif (isNaN(truckOpening) || isNaN(truckClosing)) { //aey - if either of those times is NaN\n\t\t\tif (isNaN(truckOpening)) return truckOpening; //aey - return error message that timeToAnumber gave\n\t\t\telse return truckClosing; //aey - return error message that timeToAnumber gave\n\t\t}\n\t\t//aey - if opening and closing times are equal I will assume it is always open, return true\n\t\telse if (truckOpening === truckClosing) return true;\n\t\t\t//aey - if closing time is \"before\" opening time then it likely opens really late and is closed really early\n\t\t\t//aey - aka open at 23.00 and closing at 5.00 means it is open all night\n\t\t\t//aey - or open at 16.00 and closing at 1.00 means opening in afternoon and closing in evening\n\t\t//aey - day start OOOO cur 0000 close CCCCCCCC open OOOO cur 0000 day end\n\t\telse if (truckClosing < truckOpening) {\n\t\t\treturn (curTime < truckClosing) || (curTime >= truckOpening);\n\t\t} else {\n\t\t\t//aey - otherwise, if closing time is after opening time, then things are normal\n\t\t\t//aey - start CCCC open OOOO cur OOOO close CCCC end\n\t\t\treturn (curTime >= truckOpening) && (curTime < truckClosing);\n\t\t}\n\t} else return \"...Error: couldn't get current time\";\n}", "function militaryTime(timeStr) {\n\n let hour = timeStr.substring(0, 2) * 1;\n let timeFormat = timeStr.substring();\n\n// if midnight\n if (hour === 12 && s.indexOf(\"AM\") !== -1) {\n return (\"00\" + timeFormat);\n}\n// if afternoon\nif (hour === 12 && s.indexOf(\"PM\") !== -1) {\n return (time + timeFormat);\n}\n //write code here\n}", "function getAlarmTime(info) {\n var yyyy;\n var mm;\n var dd;\n var hour;\n var min;\n var alarmTime;\n if(info[0] === true){\n var date = info[1].split(\"-\", 3);\n var time = info[2].split(\":\",2);\n yyyy = parseInt(date[0]);\n mm = parseInt(date[1])-1; // Jan is 1\n dd = parseInt(date[2]);\n hour = parseInt(time[0]);\n min = parseInt(time[1]);\n\n alarmTime = new Date(yyyy, mm, dd, hour, min);\n }\n return alarmTime;\n}", "function getDay(day) {\n switch (day) {\n case \"Monday\": return 1;\n\n case \"Tuesday\": return 2;\n case \"Wednesday\": return 3;\n case \"Thursday\": return 4;\n case \"Friday\": return 5;\n case \"Saturday\": return 6;\n case \"Sunday\": return 7;\n default: return \"error\"; break;\n\n }\n}", "function Day(t) {\n typeof t === \"number\";\n return Math.floor(t / msPerDay);\n } // 20.3.1.2 Day Number and Time within Day", "function identifyWeather(app){\n\n let location = 'Chicago';\n let day = 'today';\n\n if(req.body.result.paramaters[LOCATION_ARGUMENT]){\n location = app.getArgument(LOCATION_ARGUMENT);\n }\n\n if(req.body.result.paramaters[DAY_ARGUMENT]){\n day = app.getArgument(DAY_ARGUMENT);\n }\n\n console.log('LOCATION: ' + location);\n console.log('DAY: ' + day);\n\n app.tell('You wanted weather in ' + location + 'for '+ day + 'correct?' );\n }", "function isTradingHour(now){\n\t return now.getDay()!=0 && now.getDay()!=6 &&now.getDate() != 23 &&((now.getHours()>=8 && now.getHours()<14)||(now.getHours() == 7 && now.getMinutes()>29))\n }", "function TimeNow(){\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n var dayOfWeek = today.getDay();\n\n // Make single digits numbers appear as '0x'\n if (h < 10){\n h = '0' + h;\n }\n if (m < 10){\n m = '0' + m;\n }\n if (s < 10){\n s = '0' + s;\n }\n\n // Final Time Output;\n var time = h + ':' + m + ':' + s;\n document.getElementById('time').innerHTML = time;\n\n // Open-Close Switcher after restaurant's schedule\n function open_close(){\n // from Monday to Thursday\n if (dayOfWeek > 0 && dayOfWeek < 5){\n // Open from 10 to 19\n if (h >= 10 && h < 19){\n document.getElementById('open-close-switcher').innerHTML = 'Open';\n document.getElementById('open-close-switcher').style.color = 'green';\n } else {\n document.getElementById('open-close-switcher').innerHTML = 'closed';\n document.getElementById('open-close-switcher').style.color = '#ce0000';\n }\n // from Friday to Sunday\n } else {\n // Open from 10 to 23\n if (h >= 10 && h < 23){\n document.getElementById('open-close-switcher').innerHTML = 'Open';\n document.getElementById('open-close-switcher').style.color = 'green';\n } else {\n document.getElementById('open-close-switcher').innerHTML = 'closed';\n document.getElementById('open-close-switcher').style.color = '#ce0000';\n }\n }\n }\n open_close();\n }", "function newDay() {\n\tvar sunday = new Date();\n\tvar hour = sunday.getHours();\n\tvar minute = sunday.getMinutes();\n\n}", "function whatTime() {\n var time = new Date().getHours();\n console.log(time)\n\n if (time < 6) {\n document.getElementById(\"time\").innerHTML = \"It's night!\";\n }\n else if (time < 12) {\n document.getElementById(\"time\").innerHTML = \"It's morning!\";\n }\n else if (time < 17) {\n document.getElementById(\"time\").innerHTML = \"It's afternoon!\";\n } \n else if (time < 20) {\n document.getElementById(\"time\").innerHTML = \"It's evening!\";\n } \n else {\n document.getElementById(\"time\").innerHTML = \"It's night!\";\n }\n}", "function calculateCondition(weatherCode, windSpeed, cloudCover, sunTimes) {\n // Calculate if its currently day or night\n let currentTime = new Date();\n currentTime = Math.floor(currentTime.getTime() / 1000);\n if(currentTime >= sunTimes.rise && currentTime < sunTimes.set) {\n var dayTime = 'Day';\n } else {\n var dayTime = 'Night';\n }\n // First narrow possibilities of conditions via weather code\n if(weatherCode >= 200 && weatherCode <= 299) {\n // Thunder type\n if(weatherCode !== 210 && weatherCode !== 211 && weatherCode !== 212 && weatherCode !== 221) {\n // Thunderstorm with rain\n return \"Rainy Thunderstorm\";\n } else {\n // Thunderstorm no rain\n return \"Thunderstorm\";\n }\n }\n\n if(weatherCode >= 700 && weatherCode <= 799) {\n // Atmospheric\n if(weatherCode == 781) {\n // Tornado\n return \"Tornado\";\n }\n if(weatherCode >= 701 && weatherCode <= 710) {\n // Mist\n return \"Mist\";\n }\n if(weatherCode >= 711 && weatherCode <= 720) {\n // Smoke\n return \"Smoke\";\n }\n if(weatherCode >= 721 && weatherCode <= 730) {\n // Haze\n return \"Haze\";\n }\n if(weatherCode >= 731 && weatherCode <= 740) {\n // Dust\n return \"Dust\";\n }\n if(weatherCode >= 741 && weatherCode <= 750) {\n // Fog\n return \"Fog\";\n }\n if(weatherCode >= 751 && weatherCode <= 760) {\n // Sand\n return \"Sand\";\n }\n if(weatherCode == 761) {\n // Dust\n return \"Dust\";\n }\n if(weatherCode >= 762 && weatherCode <= 770) {\n // Ash\n return \"Ash\";\n }\n if(weatherCode >= 771 && weatherCode <= 780) {\n // Squall\n return \"Squall\";\n }\n }\n\n if(weatherCode == 800) {\n // Clear\n if(dayTime == 'Night') {\n // Clear Night\n return \"Clear Night\";\n } else {\n // Clear Day\n if(windSpeed >= 11.176) {\n // Clear Day\n return \"Clear Day\";\n } else {\n // Windy Clear Day\n return \"Windy Clear Day\";\n }\n }\n }\n\n if(weatherCode >= 801 && weatherCode <= 850) {\n // Clouds\n if(weatherCode == 801) {\n // Few Clouds\n return \"Few Clouds\";\n } else {\n // Cloudy\n if(windSpeed >= 11.176) {\n // Cloudy Day\n return \"Cloudy\";\n } else {\n // Windy Cloudy Day\n return \"Windy Clouds\";\n }\n }\n }\n\n if(weatherCode >= 300 && weatherCode <= 350) {\n // Drizzle\n if(cloudCover > 25) {\n // Partly Sunny Drizzle\n return \"Partly Sunny Drizzle\";\n } else {\n // Drizzle\n return \"Drizzle\";\n }\n }\n\n if(weatherCode >= 600 && weatherCode <= 650) {\n // Snow\n if(cloudCover > 25) {\n // Partly Sunny Snow\n return \"Partly Sunny Snow\";\n } else {\n // Snow\n return \"Snow\";\n }\n }\n\n if(weatherCode >= 500 && weatherCode <= 550) {\n // Rain\n if(cloudCover > 25) {\n // Partly Sunny Rain\n return \"Partly Sunny Rain\";\n } else {\n // Rain\n return \"Rain\";\n }\n }\n}", "function startOfDay(){\n//updateGlobalState\n//getGlobalState\n\t\n\tdao.getDeviceStateById(4, function(etatDevice){\n\t\tif(typeof sunHour !== 'undefined'){\n\t\t\tif((etatDevice.deviceState === \"off\") && tools.isTimeToOpenStore(sunHour)===true \n\t\t\t\t&& tools.isNoWorkingDay()===false){\n\t\t\t\tlogger.debug(\"startOfDay() : Ouverture des stores...\");\n\t\t\t\tvar message = \"CRON OUVERTURE DES VOLETS\";\n\t\t\t\ttools.executeCommandChacon(4, \"on\", \"Volet roulant\", message, message);\n\t\t\t\t//dao.updateParamsTable(\"etat_store\",\"opened\");\n\t\t\t\ttools.sendNotification(\"Ouverture des stores\");\n\t\t\t\t//var newEtatGlobal={ etatStore : \"on\"};\n\t\t\t\t/*if(etatGlobalBdd.etatLampeSalon === 'on'){\n\t\t\t\t\tmessage = \", extinction du salon.\";\n\t\t\t\t\ttools.executeCommandChacon(5, \"off\", \"Lampe 1\", message, message);\n\t\t\t\t\ttools.executeCommandChacon(6, \"off\", \"Lampe 2\", message, message);\n\t\t\t\t\t//newEtatGlobal.etatLampeSalon = \"off\";\n\t\t\t\t}*/\n\t\t\t\tdao.updateDeviceStateById(4, \"on\");\n\t\t\t}\n\t\t}\n\t});\n\n\t// get etat store\n\t/*dao.getParamValueByName('etat_store', function (etat) {\n\t\t//logger.debug(\"startOfDay() : etatStore : \" + etat);\n\t\tif(typeof sunHour !== 'undefined'){\n\t\t\tif((etat === \"closed\" || etat === \"N/A\" ) && tools.isTimeToOpenStore(sunHour)===true \n\t\t\t\t&& tools.isNoWorkingDay()===false){\n\t\t\t\tlogger.debug(\"startOfDay() : Ouverture des stores...\");\n\t\t\t\tvar message = \"CRON OUVERTURE DES VOLETS\";\n\t\t\t\ttools.executeCommandChacon(4, \"on\", \"Volet roulant\", message, message);\n\t\t\t\tdao.updateParamsTable(\"etat_store\",\"opened\");\n\t\t\t\ttools.sendNotification(\"Ouverture des stores\");\n\t\t\t\t// TODO implemente extinction lumiere salon si necessaire\n\t\t\t}\n\t\t}\n\t});/*/\n}", "function nearest_weekday(weekday, jd){\n return search_weekday(weekday, jd, 1, 3);\n}", "function getWorkingHours(empCheck){\n switch (empCheck){\n case IS_PART_TIME:\n return PART_TIME_HOUR; \n case IS_FULL_TIME:\n return FULL_TIME_HOUR; \n default:\n return 0;\n }\n}", "function getDay(){\n\treturn day;\n}", "function Time_function() {\n var Time = new Date().getHours();\n var Reply; \n if (Time < 12 == Time > 0) {\n Reply = \"It is morning time!\";\n }\n else if (Time >= 12 == Time < 18) {\n Reply = \"It is the afternoon.\";\n }\n else {\n Reply = \"It is the evening\"; \n }\n document.getElementById(\"Time_of_day\").innerHTML = Reply;\n}", "function endOfDay(){\n\n\tdao.getDeviceStateById(4, function(etatDevice){\n\t\tif(typeof sunHour !== 'undefined'){\n\t\t\tif((etatDevice.deviceState === \"on\") && tools.isTimeToCloseStore(sunHour)===true){\n\t\t\t\tlogger.debug(\"endOfDay() : Fermeture des stores...\");\n\t\t\t\tvar message = \"Fermeture des stores\";\n\t\t\t\ttools.executeCommandChacon(4, \"off\", \"Volet roulant\", message, message);\n\t\t\t\t// var newEtatGlobal={ etatStore : \"closed\"};\n\n\t\t\t\t// TODO implemente allumage lumiere salon si necessaire\n\t\t\t\t// if(etatGlobalBdd.homePresence === 'true'){\n\t\t\t\t\t// message = \", allumage du salon.\";\n\t\t\t\t\t// tools.executeCommandChacon(5, \"on\", \"Lampe 1\", message, message);\n\t\t\t\t\t// tools.executeCommandChacon(6, \"on\", \"Lampe 2\", message, message);\n\t\t\t\t\t// newEtatGlobal.etatLampeSalon = \"on\";\n\t\t\t\t// }\n\t\t\t\t// dao.updateGlobalState(newEtatGlobal);\n\t\t\t\tdao.updateDeviceStateById(4, \"off\");\n\t\t\t\ttools.sendNotification(\"Fermeture des stores\");\n\t\t\t}\n\t\t}\n\t});\n\n\t// get etat store\n\t/*dao.getParamValueByName('etat_store', function (etat) {\n\t\t//logger.debug(\"endOfDay() : etatStore : \" + etat);\n\t\tif(typeof sunHour !== 'undefined'){\n\t\t\tif((etat === \"opened\" || etat === \"N/A\" ) && tools.isTimeToCloseStore(sunHour)===true){\n\t\t\t\tlogger.debug(\"endOfDay() : Fermeture des stores...\");\n\t\t\t\tvar message = \"Fermeture des stores\";\n\t\t\t\ttools.executeCommandChacon(4, \"off\", \"Volet roulant\", message, message);\n\t\t\t\tdao.updateParamsTable(\"etat_store\",\"closed\");\n\t\t\t\tdao.getParamValueByName('home_presence', function (homePresence) {\n\t\t\t\t\tif(homePresence === 'true'){\n\t\t\t\t\t\tmessage = \", allumage du salon.\";\n\t\t\t\t\t\ttools.executeCommandChacon(5, \"on\", \"Lampe 1\", message, message);\n\t\t\t\t\t\ttools.executeCommandChacon(6, \"on\", \"Lampe 2\", message, message);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\ttools.sendNotification(message);\n\t\t\t}\t\n\t\t}\n\t});*/\n}", "function sunshine(){\nvar hrs ;\n var Sunshinedaily = document.forms.solarForm.zone.selectedIndex ;\n Sunshinedaily += 1 ;\n switch(Sunshinedaily){\n \tcase 1 :\n \t\thrs = 8 ;\n \t\tbreak ;\n \tcase 2 :\n \t\thrs = 7.5 ;\n \t\tbreak ;\n \tcase 3 :\n \t\thrs = 7 ;\n \t\tbreak ;\n \tcase 4 :\n \t\thrs = 6.5 ;\n \t\tbreak ;\n \tcase 5 :\n \t\thrs = 6 ;\n \t\tbreak ;\n \tcase 6 :\n \t\thrs = 5.5 ;\n \t\tbreak ;\n \tcase 7 :\n \t\thrs = 5 ;\n \t\tbreak ;\n \tcase 8 :\n \t\thrs = 4.5 ;\n \t\tbreak ;\n \tcase 9 :\n \t\thrs = 3 ;\n \t}\t\n\n return hrs ; \t\n }", "function checkTime(time) {\n if (time > 12) {\n time -= 12;\n }\n if (time === 0) {\n time = 12;\n }\n return time\n}", "function startTime() {\n var today = new Date();\n\n var weekday = new Array(7);\n weekday[0] = \"Sun\";\n weekday[1] = \"Mon\";\n weekday[2] = \"Tue\";\n weekday[3] = \"Wed\";\n weekday[4] = \"Thu\";\n weekday[5] = \"Fri\";\n weekday[6] = \"Sat\";\n\n var d = weekday[today.getDay()];\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('clock').innerHTML =\n d + \" \" + h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n}", "function Time_function() {\n var Time=new Date().getHours();\n var Reply;\n if (Time<12==Time>0) {\n Reply=\"It is morning time!\";\n }\n else if (Time>=12==Time<18) {\n Reply=\"It is afternoon.\";\n }\n else {\n Reply=\"It is evening time.\";\n }\n document.getElementById(\"Time_of_day\").innerHTML=Reply;\n}", "function getCurrentHour() {\n \n // Get data-time attribute which is computerTimeOfDay\n \n const arrOfHours = $(\".hour\");\n \n \n // Compare if data-time attribute matches the current hour set by computer\n /* Return appropriate class depending if the hour is before, current or after\n current hour */\n if(arrOfHours === currentHourNow) {\n $(\".description-details\").addClass(\"present\");\n }\n if(arrOfHours < currentHourNow) {\n $(\".description-details\").addClass(\"past\");\n }\n if (arrOfHours > currentHourNow){\n $(\".description-details\").addClass(\"future\");\n }\n \n \n }", "function travelFrom() {\n var startStationInput = document.querySelector(\"#startStation\");\n var startStation = startStationInput.value;\n var endStationInput = document.querySelector(\"#endStation\");\n var endStation = endStationInput.value;\n var start = capitaliseFirstLetter(startStation.toLowerCase());\n var end = capitaliseFirstLetter(endStation.toLowerCase());var startLine = findLine(start);\n var endLine = findLine(end);\n var startLineArray = sydneyTrains[startLine];\n var endLineArray = sydneyTrains[endLine];\n // Check if stations exists on the lines entered\n if (!stations.includes(start) ||\n !stations.includes(end)) {\n var message = (\"Something went wrong and the stations you entered don't exist on those lines\");\n } \n else if (endLineArray.includes(start) || startLineArray.includes(end)) {\n //Tell person to switch to the line.\n if (endLineArray.includes(start)) {\n var correctLine = endLine;\n } else {\n var correctLine = startLine;\n }\n var numberofStops = Math.abs(endLineArray.indexOf(end) - startLineArray.indexOf(start));\n if (numberofStops > 1) {\n var stopOrStops = \"stops\";\n } else {\n var stopOrStops = \"stop\";\n };\n var message = \"To go from \"+start+\" to \"+end+\" - you will need to go through \"+numberofStops+\" \"+stopOrStops+\" on the \"+correctLine+\".\";\n } else {\n //Find first station that matches both startLine and endLine = switchingStation\n var switchingStation = endLineArray.find(function(item) {\n return startLineArray.includes(item);\n });\n //Tell person how many stops from startStation to switchingStation\n //Tell person where to switch (switchingStation)\n //Tell person how many stops from switchingStation to endStation\n var numberofStops1 = Math.abs(startLineArray.indexOf(switchingStation) - startLineArray.indexOf(start));\n var numberofStops2 = Math.abs(endLineArray.indexOf(switchingStation) - endLineArray.indexOf(end));\n if (numberofStops1 > 1) {\n var stopOrStops1 = \"stops\";\n } else {\n var stopOrStops1 = \"stop\";\n };\n if (numberofStops2 > 1) {\n var stopOrStops2 = \"stops\";\n } else {\n var stopOrStops2 = \"stop\";\n };\n var message = \"To go from \"+start+\" to \"+end+\" - you will need to take \"+startLine+\" for \"+numberofStops1+\" \"+stopOrStops1+\", switch at \"+switchingStation+\" to \"+endLine+\", then go through \"+numberofStops2+\" \"+stopOrStops2+\".\";\n };\n answer.innerText = message;\n}", "function Time_function() {\n var Time = new Date().getHours();\n var Reply;\n if (Time < 12 == Time > 0) {\n Reply = 'It is morning time!';\n }\n else if (Time >= 12 == Time < 18) {\n Reply = 'It is afternoon.';\n }\n else {\n Reply = \"It is evening time.\";\n }\n document.getElementById(\"Time_of_day\").innerHTML = Reply;\n}", "function wotDayIsIt(callback){\n var day = (new Date().getDay());\n callback(day)\n}", "function Time_function() {\n var Time = new Date().getHours();\n var Reply;\n if (Time < 12 == Time > 0) {\n Reply = \"It is morning time.\";\n }\n else if (Time > 12 == Time < 18) {\n Reply = \"It is the afternoon.\";\n }\n else {\n Reply = \"It is evening time.\";\n }\n document.getElementById(\"Time_of_day\").innerHTML = Reply;\n}", "function locationSuccessDS(pos){\n //Request DarkSky\n// var lat=pos.coords.latitude;\n// var lon= pos.coords.longitude;\n var settings2 = JSON.parse(localStorage.getItem('clay-settings')) || {};\n var manuallat = settings2.Lat;\n var manuallong = settings2.Long;\n if(manuallat != null && manuallat != '' && manuallong != null && manuallong != '' ){\n var lat= manuallat;\n var lon= manuallong;\n }\n else {\n var lat=pos.coords.latitude;\n var lon= pos.coords.longitude;\n }\n var d = new Date();\n var sunTimes = SunCalc.getTimes(d, lat, lon);\n var sunsetStrhr = ('0'+sunTimes.sunset.getHours()).substr(-2);\n var sunsetStrmin = ('0'+sunTimes.sunset.getMinutes()).substr(-2);\n var sunsetStr = String(sunsetStrhr + \":\" + sunsetStrmin);\n var sunriseStrhr = ('0'+sunTimes.sunrise.getHours()).substr(-2);\n var sunriseStrmin = ('0'+sunTimes.sunrise.getMinutes()).substr(-2);\n var sunriseStr = String(sunriseStrhr + \":\" + sunriseStrmin);\n var sunsetStrhr12 = parseInt(sunTimes.sunset.getHours());\n var sunriseStrhr12 = parseInt(sunTimes.sunrise.getHours());\n if(sunsetStrhr12 > 12 ){\n var sunsetStr12h = String (sunsetStrhr12 - 12 + \":\" + sunsetStrmin);// +\"pm\");\n }\n else{\n var sunsetStr12h = String (sunsetStrhr12 + \":\" + sunsetStrmin);// + \"am\");\n }\n if(sunriseStrhr > 12 ){\n var sunriseStr12h = String(sunriseStrhr12 - 12 + \":\" + sunriseStrmin);// +\"pm\");\n }\n else{\n var sunriseStr12h = String(sunriseStrhr12 + \":\" + sunriseStrmin);// + \"am\");\n }\n var moonmetrics = SunCalc.getMoonIllumination(d);\n var moonphase = Math.round(moonmetrics.phase*28);\n var keyAPIds=localStorage.getItem('dsKey');\n var userKeyApi=settings2.APIKEY_User;\n var endapikey=apikeytouse(userKeyApi,keyAPIds);\n var units = unitsToString(settings2.WeatherUnit);\n// var unitsOWM=unitsToStringOWM(settings.WeatherUnit);\n var windunits = windunitsToString(settings2.WindUnit);\n var langtouse=translate(navigator.language);\n // Construct URL\n var urlDS = \"https://api.darksky.net/forecast/\" +\n endapikey +\n '/' + lat + ',' + lon +\n '?exclude=minutely,hourly&units=si' +\n '&lang=' + langtouse;\n\n\n console.log(\"DSUrl= \" + urlDS);\n // Send request to DarkSky\n xhrRequest(encodeURI(urlDS), 'GET',function(responseText) {\n // responseText contains a JSON object with current weather info\n var json = JSON.parse(responseText);\n localStorage.setItem(\"OKAPI\", 0);\n // Current Temperature\n var tempf = Math.round((json.currently.temperature * 1.8) + 32);//+'\\xB0'+units;\n var tempc = Math.round(json.currently.temperature);\n var tempds=String(temptousewu(units,tempf,tempc))+'\\xB0';\n // Current conditions\n var condds=json.currently.summary;//description;\n var condcleands=replaceDiacritics(condds);\n var icon_ds = ds_iconToId[json.currently.icon];\n // Sunrise and Sunset\n var auxsunds =new Date(json.daily.data[0].sunriseTime*1000);\n var sunriseds=auxsunds.getHours()*100+auxsunds.getMinutes();\n var auxsetds =new Date(json.daily.data[0].sunsetTime*1000);\n var sunsetds=auxsetds.getHours()*100+auxsetds.getMinutes();\n //current wind\n var windkts = Math.round(json.currently.windSpeed * 1.9438444924574);\n var windkph = Math.round(json.currently.windSpeed * 3.6);\n var windms = Math.round(json.currently.windSpeed);\n var windmph = Math.round(json.currently.windSpeed * 2.2369362920544);\n var wind = String(windtousewu(windunits,windkph,windmph,windms,windkts))+windunits;\n var winddegds = String(json.currently.windBearing);\n var winddir_numds = owm_WindToId[winddegds];\n // Forecast Conditions\n var forecast_icon_ds = ds_iconToId[json.daily.data[0].icon];\n // Forecast Temperature & wind\n var forecast_high_tempf = Math.round((json.daily.data[0].temperatureHigh * 1.8) + 32); //+'\\xB0';\n var forecast_low_tempf = Math.round((json.daily.data[0].temperatureLow * 1.8) + 32); //+'\\xB0';\n var forecast_high_tempc = Math.round(json.daily.data[0].temperatureHigh); //+ '\\xB0';\n var forecast_low_tempc = Math.round(json.daily.data[0].temperatureLow); //+ '\\xB0';\n var highds = String(temptousewu(units,forecast_high_tempf,forecast_high_tempc));\n var lowds = String(temptousewu(units,forecast_low_tempf,forecast_low_tempc));\n var highlowds = highds + '|'+ lowds;//+'\\xB0';\n var forecast_ave_wind_mph = Math.round(json.daily.data[0].windSpeed*2.2369362920544);\n var forecast_ave_wind_kts = Math.round(json.daily.data[0].windSpeed *1.9438444924574);\n var forecast_ave_wind_kph = Math.round(json.daily.data[0].windSpeed *3.6);\n var forecast_ave_wind_ms = Math.round(json.daily.data[0].windSpeed);\n var forecast_wind_degds = String(json.daily.data[0].windBearing);\n var forecast_wind_dir_numds = owm_WindToId[forecast_wind_degds];\n var forecast_ave_wind_ds = String(windtousewu(windunits,forecast_ave_wind_kph,forecast_ave_wind_mph,forecast_ave_wind_ms,forecast_ave_wind_kts))+windunits;\n var auxtimeds =new Date(json.currently.time*1000);\n var dstime=auxtimeds.getHours()*100+auxtimeds.getMinutes();\n\n localStorage.setItem(\"OKAPI\", 1);\n console.log(\"OK API\");\n\n console.log(condcleands);\n console.log(sunsetds);\n console.log(sunriseds);\n console.log(wind);\n console.log(winddir_numds);\n console.log(tempds);\n console.log(icon_ds);\n console.log(highds);\n console.log(forecast_icon_ds);\n console.log(lowds);\n console.log(forecast_wind_dir_numds);\n console.log(forecast_ave_wind_ds);\n console.log(sunsetStr);\n console.log(sunriseStr);\n console.log(moonphase);\n console.log(winddegds);\n console.log(forecast_wind_degds);\n console.log(dstime);\n\n // Assemble dictionary using our keys\n var dictionary = {\n \"WeatherTemp\": tempds,\n \"WeatherCond\": condcleands,\n \"HourSunset\": sunsetds,\n \"HourSunrise\":sunriseds,\n \"WeatherWind\" : wind,\n \"WEATHER_SUNSET_KEY\":sunsetStr,\n \"WEATHER_SUNRISE_KEY\":sunriseStr,\n \"WEATHER_SUNSET_KEY_12H\":sunsetStr12h,\n \"WEATHER_SUNRISE_KEY_12H\":sunriseStr12h,\n \"IconNow\":icon_ds,\n \"IconFore\":forecast_icon_ds,\n \"TempFore\": highlowds,//hi_low,\n \"TempForeLow\": lowds,\n \"WindFore\": forecast_ave_wind_ds,\n \"WindIconNow\":winddir_numds,\n \"WindIconAve\":forecast_wind_dir_numds,\n \"Weathertime\":dstime,\n \"MoonPhase\": moonphase,\n\n };\n // Send to Pebble\n Pebble.sendAppMessage(dictionary,\n function(e) {console.log(\"Weather from DS sent to Pebble successfully!\");},\n function(e) { console.log(\"Error sending DS info to Pebble!\");}\n );\n });\n}", "function GetWorkingHrs(empCheck)\n{\n switch(empCheck)\n {\n case IS_PRESENT_FULL_TIME:\n return FULL_TIME_HOURS;\n break;\n case IS_PRESENT_PART_TIME:\n return PART_TIME_HOURS;\n break;\n default:\n return 0;\n break;\n }\n}", "function dayTime () {\r\n\r\n\tlet day = new Date().getDay(); \r\n\t switch(day) {\r\n\t case 0:\r\n day = \"Sunday\";\r\n break;\r\n case 1:\r\n day = \"Monday\";\r\n break;\r\n case 2:\r\n day = \"Tuesday\";\r\n break;\r\n case 3:\r\n day = \"Wednesday\";\r\n break;\r\n case 4:\r\n day = \"Thursday\";\r\n break;\r\n case 5:\r\n day = \"Friday\";\r\n break;\r\n case 6:\r\n day = \"Saturday\";\r\n}\r\n\r\nlet time = new Date().getHours();\r\nlet minutes = new Date().getMinutes();\r\nlet seconds = new Date().getSeconds();\r\n\r\nif (time > 12) {\r\n\ttime = time-12;\r\n} \r\n\r\nconsole.log (\"Today is \" + day + \". Current time is \" + time + \":\" + minutes + \":\" + seconds);\r\n\r\n}", "function partTimeWorkingDay(dayWage)\n{\n return dayWage.includes(\"80\");\n}", "function greet(time){\n if ((time.match(/^([0-9]?|1[0-1]):[0-5][0-9]/)) != null ){\n return \"Good Morning\"\n } else if ((time.match(/^1[2-6]:[0-5][0-9]/)) != null){\n return \"Good Afternoon\"\n } else if ((time.match(/^1([7-9]|2[0-2]):[0-5][0-9]/)) != null){\n return \"Good Evening\"\n } else {\n return time\n }\n}", "function checkDay() {\n akanDay= calculateDay();\n checkgender();\n //console.log(\"checkDay is functioning\");\n}", "function getTypeOfDay(sunHours, prec){\n var typeOfDay = \"<figure><img src='https://i.ibb.co/2vfJDKz/no-weather-info-icon.png' alt='Icono de sin datos sobre el tipo de día' width='250' height='250' border='0'></figure><br><p>Sin datos sobre el tipo de día</p>\";\n if(sunHours != undefined){\n var hoursMonth = sunHoursOfTorr/2.0;\n console.log(\"HORAS DE SOL TORREVIEJA: \" + sunHoursOfTorr + \" HORAS MONTH: \" + hoursMonth);\n console.log(\"SUN HOURS: \" + sunHours);\n\n if(parseFloat(sunHours) < hoursMonth){\n if(prec != \"Ip\" && parseFloat(prec) > 0.0 && (parseFloat(prec)/24.0) <= 15.0){\n typeOfDay = \"<figure><img src='https://i.ibb.co/0Cnyq1D/lluvia.png' alt='lluvia' width='250' height='250' border='0'></figure><br><p>Lluvioso con horas de sol: \" + sunHours + \"h</p>\";\n }\n else if(prec != \"Ip\" && (parseFloat(prec)/24.0) > 15.0){\n typeOfDay = \"<figure><img src='https://i.ibb.co/f88rVxv/tormenta.png' alt='tormenta' width='250' height='250' border='0'></figure><br><p>Tormentoso con horas de sol: \" + sunHours + \"h</p>\";\n }\n else{\n typeOfDay = \"<figure><img src='https://i.ibb.co/kKZb6rK/nublado.png' alt='nublado' width='250' height='250' border='0'></figure><br><p>Nublado con horas de sol: \" + sunHours + \"h</p>\";\n }\n }\n else{\n if(prec != \"Ip\" && parseFloat(prec) > 0.0){\n typeOfDay = \"<figure><img src='https://i.ibb.co/SsSTY8F/sol-con-precipitaciones.png' alt='soleado con precipitaciones' width='250' height='250' border='0'></figure><br><p>Despejado con precipitaciones y con horas de sol: \" + sunHours + \"h</p>\";\n }\n else{\n typeOfDay = \"<figure><img src='https://i.ibb.co/bKg5LFv/soleado.png' alt='soleado' width='250' height='250' border='0'></figure><br><p>Despejado con horas de sol: \" + sunHours + \"h</p>\";\n }\n }\n\n }\n return typeOfDay;\n }", "function nearest_weekday(weekday, jd)\n {\n return search_weekday(weekday, jd, 1, 3);\n }", "isDay() {\n\t\treturn (Date.now() + 60000 * new Date().getTimezoneOffset() + 21600000) % 86400000 / 3600000 > 12;\n\t}", "function getStation(name, stations) {\n var j;\n for (j in stations) {\n if (stations[j].station_name == name) {\n return stations[j];\n }\n }\n return {};\n }", "function whatDay(day) {\n var result = \"\";\n day = day.toLowerCase()\n if (day === 'sunday' || day === 'monday') {\n result = 'Have a good week';\n } else if (day === 'tuesday' || day === 'wednesday') {\n result = 'Ohhh ... ';\n } else if (day === 'thursday') {\n result = 'Yalla habaita';\n } else if (day === 'friday' || day === 'saturday') {\n result = 'Yammi Jachnun'\n } else {\n result = 'not a day';\n }\n return result;\n}", "function find_time(time) {\n // Saving Private Input\n var event = moment(time, 'H,m,s').unix(), // In Unix so you can do some operations\n // Getting the current time in unix time\n current = moment().unix(),\n // Computer is calculating the difference of the two\n diffTime = moment.duration((event - current) * 1000, 'milliseconds')\n // Are you kidding me, I'm still gonna send it\n return(diffTime)\n }", "function checkNewDay(){\n\t\n\t// First time running log on this browser?\n\tif (getItem('whatDay') == null){\n\t\tstoreItem('whatDay', whatDay);\n\t\t// Also create 'haveReset' and\n\t\t// 'milkMeasure' items for storage.\n\t\tresetLog();\n\t\treturn;\n\t}\n\t\n\t// Is it a new day? Else, we can return --\n\t// since procedures below will have been\n\t// carried out and whatDay stored value\n\t// already set to match whatDay variable.\n\tif (getItem('whatDay')==whatDay) return;\n\t\t\telse {\n\t\t\t// Not same day, so we should reset\n\t\t\t// milk measure values and record\n\t\t\t// that we have reset and what current\n\t\t\t// day it is.\n\t\t\tresetLog();\n\t\t\t}\n\t\n\tif (getItem('haveReset') != null){\n\t\tif (getItem('haveReset')) return;\n\t\telse { resetLog(); }\n\t}\n\telse {\n\t\tresetLog();\n\t}\n}", "function timeNow(searchTime) {\n\t\n\tconst d = searchTime ? new Date(searchTime) : new Date(); \n\t\n\t//Timezone offset UTC - 5 (-4 for daylight savings TODO: automate the offset based on daylight savings time)\n\tif(!searchTime){\n\t\td.setTime(d.getTime() + d.getTimezoneOffset() * 60 * 1000 - (5) * 60 * 60 * 1000);\n\t}\n\n\tconst hours = d.getHours(); \n\tconst min = d.getMinutes(); \n\tconst sec = d.getSeconds(); \n\n\tif(min > 9){\n\t\treturn hours + \":\" + min + \":\" + sec;\n\t}else{\n\t\treturn hours + \":0\" + min + \":\" + sec;\n\t} \n}", "function danVtednu(unixTime){\n\tvar d = new Date(unixTime); \n\tvar n = d.getDay();\n\td=null;\n\treturn n;\n}", "getMidDay(hour) {\n return hour >= 12 ? \"PM\" : \"AM\";\n }", "async getTodayPosition() {\n try {\n const activeNapoStrategies = await this.getActiveStrategies()\n\n for(const NapoStrategy of activeNapoStrategies) {\n const stratPosition = await this.getStratData(NapoStrategy.strategy)\n\n if (this.checkDateIsAfterNow(stratPosition)) {\n this.saveData(stratPosition)\n Event.fire(\"napoleon::success\");\n } else throw new Error(\"Wrong NapoelonX strategies date\");\n }\n } catch (error) {\n console.log(error);\n if (error.message === \"Wrong NapoelonX strategies date\") throw error;\n else\n throw new Error(\n \"Error at request getTodayPosition() to NapoleonX.\\nCheck that your username and password are correct.\\nIf they are then check you have at least one token checked in NapoleonX Platform.\\n\" +\n error\n );\n }\n }", "function dayss(){\n\nvar d = new Date();\nvar weekday = new Array(7);\nweekday[0] = \"Sunday\";\nweekday[1] = \"Monday\";\nweekday[2] = \"Tuesday\";\nweekday[3] = \"Wednesday\";\nweekday[4] = \"Thursday\";\nweekday[5] = \"Friday\";\nweekday[6] = \"Saturday\";\n\nvar n = weekday[d.getDay()];\n\nif(n == \"Monday\"){\n\n window.alert(\"Energize\");\n}else if(n == \"Tuesday\"){\n\n window.alert(\"Just getting started!\");\n\n}else if(n==\"Wednesday\"){\n\n window.alert(\"Hump Hump!\");\n}else if(n == \"Thursday\"){\n\n window.alert(\"Almost there!\");\n}else if(n == \"Friday\" || n==\"Saturday\" || n==\"Sunday\"){\n\n window.alert(\"Weeeeeee!\");\n}}", "function whatDayIsIt(){\n let days = [ \"Sunday\", \"Monday\", \"Tuesday\",\"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"]\n return days[(new Date()).getDay()]\n}", "function Time_function() {\n var Time = new Date().getHours();\n var Reply;\n if (Time < 12 == Time > 0) {\n Reply = \"It is moring time!\";\n }\n else if(Time >=12 == Time > 18) {\n Reply = \"It is afternoon.\";\n } \n else {\n Reply = \"It is evening time.\";\n }\n document.getElementById(\"Time_of_day\").innerHTML = Reply;\n}", "function Time() { // A function to tell the user if it's before 1900 (7pm)\n if (new Date().getHours() < 19) { // if statment comparing the current time and 19 (24 hour clock)\n document.getElementById(\"Time_check\").innerHTML = \"It is before 1900 (7pm).\";\n }\n}" ]
[ "0.6689355", "0.6641448", "0.6343621", "0.63420206", "0.6239128", "0.62349623", "0.59183747", "0.58747727", "0.5874179", "0.57307476", "0.57271034", "0.56749135", "0.56129146", "0.5598697", "0.5587506", "0.5555465", "0.55228287", "0.55176777", "0.5501689", "0.54782933", "0.5427931", "0.54255104", "0.5419419", "0.54029334", "0.53839743", "0.53782225", "0.53726226", "0.537042", "0.53626096", "0.5336302", "0.5328444", "0.5285976", "0.52847505", "0.5283189", "0.5276829", "0.52646", "0.5264563", "0.52613693", "0.52517056", "0.5242219", "0.5235568", "0.52324384", "0.5232193", "0.5230193", "0.5223183", "0.5217873", "0.52042663", "0.5203735", "0.52036816", "0.5199311", "0.51886016", "0.5187364", "0.5179334", "0.5175405", "0.51735276", "0.51731044", "0.5156629", "0.51553017", "0.5146472", "0.51342165", "0.51295537", "0.5117874", "0.51155275", "0.51116836", "0.51086897", "0.5103196", "0.51021993", "0.5101466", "0.5097885", "0.5087682", "0.5079571", "0.5075698", "0.5072539", "0.5070511", "0.50692755", "0.50672257", "0.5065835", "0.5061531", "0.5056266", "0.50558573", "0.50462705", "0.5044539", "0.50436157", "0.5039312", "0.5035431", "0.5035092", "0.5028668", "0.50260496", "0.50250536", "0.50228554", "0.5022698", "0.50205773", "0.5015317", "0.50150526", "0.50056225", "0.5002554", "0.5002193", "0.5000964", "0.49900112", "0.49894983" ]
0.74762666
0
Get the details of the next train.
async function getTrainDetails() { // Hit the train API const trainApiUrl = buildTrainApiURl(); const trainResult = await logFetch(trainApiUrl); // Loop & sort through the results if (trainResult.trainServices && trainResult.trainServices.length > 0) { // Loop through the results for (i = 0; i < trainResult.trainServices.length; i++) { // We've got a hit, return immediately. if (trainResult.trainServices[i].subsequentCallingPoints == null) { trainTime.innerHTML = "<img src='img/train-time.svg' width='70px' /><br>" + trainResult.trainServices[i].sta + " to " + chooseCorrectStation() + "<br>" + trainResult.trainServices[i].eta; } else { // Loop through the subsequent calling points for (y = 0; y < trainResult.trainServices[i].subsequentCallingPoints[0].callingPoint.length; y++) { if (trainResult.trainServices[i].subsequentCallingPoints[0].callingPoint[y].locationName === chooseCorrectStation()) { trainTime.innerHTML = "<img src='img/train-time.svg' width='70px' /><br>" + trainResult.trainServices[i].std + " to " + chooseCorrectStation() + "<br>" + trainResult.trainServices[i].eta; } } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function trainDescriptionString(train) {\n let stationsList = parseStations2();\n let trainDestinationName = stationsList[train.destination].name;\n return train.id + \" \" + train.line + \" \" + trainDestinationName;\n}", "function trainItem(train, inc) {\n\n\t\tvar output = \"\",\n\t\t\tnextStop = train.nextstop,\n\t\t\tlate = train.late;\n\n\t\toutput += \"<ul class='train'>\";\n\n\t\toutput += \"<li class='stop-info'><a target='_blank' href='\"+ getStationStopLink(nextStop) + \"'><h4>Next Stop <stromg>\" + reformatDestination(nextStop, 'pretty') + \"</h4></a></li>\";\n\n\t\tif(late === 0) {\n\t\t\toutput += \"<li class='status bg-success'>The train is not late.</li>\";\n\t\t} else if(late === 1) {\n\t\t\toutput += \"<li class='status bg-danger'>It's running \" + late + \" minute late.</li>\";\n\t\t} else {\n\t\t\toutput += \"<li class='status bg-danger'>It's running \" + late + \" minutes late.</li>\";\n\t\t}\n\n\t\toutput += \"<li><div id='map-canvas\" + inc +\"'></div></li>\";\n\n\t\toutput += \"</li></ul>\";\n\n\t\treturn output;\n\t}", "function getNextPerformer() {\n return waitingList.getDynamicView('next_up').branchResultset().limit(1).data()[0]\n }", "function retrieveNextLineAndSpeed(){\n retrieveLineAndSpeedFromDb('next');\n}", "getNext(){\n if (\n this.loadingNext ||\n this.refreshing ||\n !this.fetchServices.hasNextPage \n )\n return;\n this.beforeNext();\n this.fetchServices\n .fetch()\n .then((res) => {\n this.onNext(res);\n })\n .catch((error) => {\n this.onNextError(error);\n });\n }", "next() {\n const { index, showTooltip } = this.state;\n const { steps } = this.props;\n const nextIndex = index + 1;\n\n const shouldDisplay = Boolean(steps[nextIndex]) && showTooltip;\n\n this.logger('joyride:next', ['new index:', nextIndex]);\n this.toggleTooltip(shouldDisplay, nextIndex, 'next');\n }", "next() {\n this._followRelService(\"next\", \"List\");\n }", "function getTrainStatus(sender,trainNo,date){\n\n\trequest('http://api.railwayapi.com/live/train/'+ trainNo +'/doj/'+ date +'/apikey/'+ apiKey, (err, response, body) => {\n\t if(JSON.parse(body).error === \"Quota exhausted for day\"){\n\t sendText(sender,JSON.parse(body).error);\n\t }else if(JSON.parse(body).error == 510){\n sendText(sender,\"Train not scheduled to run on the given date.\");\n\n\t }else{\n var string = JSON.stringify(JSON.parse(body).position);\n\n\t if(JSON.parse(body).position != \"-\"){\n if(string.includes(\"reached Destination\")){\n sendText(sender,JSON.parse(body).position);\n }else{\n sendText(sender,JSON.parse(body).position);\n\n var routeLength = JSON.parse(body).route;\n for(var i=0;i<routeLength.length;i++){\n if(!JSON.parse(body).route[i].has_arived && !JSON.parse(body).route[i].has_departed){\n sendText(sender,\"Next Station is \"+ JSON.parse(body).route[i].station_.name +\"\\nExpected Arrival is \"+ JSON.parse(body).route[i].actarr +\" Hrs\");\n break;\n }\n }\n\n for(var i=0;i<routeLength.length;i++){\n if(JSON.parse(body).route[i].schdep === \"Destination\"){\n\n if(JSON.parse(body).route[i].latemin != 0){\n sendText(sender,\"Train will reach it's destination \"+ JSON.parse(body).route[i].station_.name + \", \"+ JSON.parse(body).route[i].latemin\n + \" Mins from it's scheduled time \"+ JSON.parse(body).route[i].scharr +\" Hrs. That is \" + JSON.parse(body).route[i].actarr + \" Hrs.\");\n break;\n }else{\n sendText(sender,\"Train will reach it's destination \"+ JSON.parse(body).route[i].station_.name +\" in it's scheduled time \"+ JSON.parse(body).route[i].scharr + \" Hrs\");\n break;\n }\n\n }\n }\n\n }\n\n }else{\n sendText(sender,\"I don't think it's running today.\")\n }\n\n\n\t }\n\t});\n}", "function addTrain () {\n var newTrain = {\n \"ID\":trainID,\n \"name\":name,\n \"destination\":destination,\n \"nextTrain\":nextTrain,\n \"frequency\":frequency,\n }\n\n trains.push(newTrain)\n \n console.log(trains)\n \n trainID = (trains.length + 1)\n}", "function train() {\n //get the label of the class selected from the board\n let label = mltk.getActiveClass();\n //get some data from the board sensor and use it as training features\n let features = mltk.getMagnetometerData();\n mltk.addTrainingData(label, features);\n}", "async function getTrain(){\n\tconst response = await fetch (api_url);\n\tconst Tdata = await response.json();\n\tconst L = Tdata.included.length;\n\tconst J = L-1;\n\n\nvar Tstatus = ['']; /*stores output of loop*/\n\n//loop pulls train status, stop, and direction for each train, J is L-1 (# of trains on the line) which dictates how many time the loop repeats\n\t\tfor(i=0;i<=J;i++){\n\t\t\t\t\tconst cur = Tdata.data[i].attributes.current_status;\n\t\t\t\t\tconst stops = Tdata.included[i].id;\n\t\t\t\t\tconst dir = Tdata.data[i].attributes.direction_id;\n\t\t\t\t\tvar inf = cur + ' ' + stops + ' ' + dir;\n\t\t\t\t\tTstatus.push(inf);\n\t\t\t\t\tconsole.log(Tstatus)\n\t\t\t\t\t}\n\n\t\t\t//Logs status of trains into HTML element\n\t\t\tdocument.getElementById(\"stat\").innerHTML = Tstatus;\n\n\t\t\t//Conditional Logic to see if there is a Train Approaching\n\t\t\tif (Tstatus.includes('IN_TRANSIT_TO Yawkey 0') == true){\n\t\t\tdocument.getElementById(\"notif\").innerHTML = \"Train Approaching Inbound\";\n\t\t\tdocument.body.style.backgroundColor = \"red\";\n\t\t\t}\n\t\t\telse if (Tstatus.includes('IN_TRANSIT_TO Boston Landing 1') == true){\n\t\t\tdocument.getElementById(\"notif\").innerHTML = \"Train Approaching Outbound\";\n\t\t\tdocument.body.style.backgroundColor = \"red\";\n\t\t\t}\n\t\t\telse{\n\t\t\tdocument.getElementById(\"notif\").innerHTML = \"No Trains Nearby\";\n\t\t\tdocument.body.style.backgroundColor = rgba(84,150,89,1 );\n\t\t\t}\n\n}", "get nextStepKey() {\n return self.step.nextStepKey(self.annotations)\n }", "function goToNextPokemon(){\r\n trainer.get();// here the method will fetch and assign the pokemon data to its designated element\r\n}", "function loadNextDetails(articleIndex) {\n\n\t//if articleIndex is undefined, set to 0 (first call)\n\tif (articleIndex == undefined) articleIndex = 0;\n\n\t//contine to call the next if index is lower than the total\n\tif (articleIndex < dataset.length) {\n\t\tconst article = dataset[articleIndex];\n\t\trpOptions.uri = `${targetWebsite.baseUrl}article/view/${article.articleID}`;\n\t\tloadURL('internal', article.articleID);\n\t} else {\n\t\tfinish();\n\t}\n\n}", "function train() {\n // get the label of the class selected from the board\n let label = mltk.getActiveClass();\n\n //get some data from the board sensor and use it as training features.\n let features = mltk.getMagnetometerData();\n mltk.addTrainingData(label, features);\n}", "get next() { return this.nextStep; }", "async getTrainingActivityDetailsById(id) {\n let returnTrainingLogData = null;\n if (id) {\n const activityDetail = await queryHelper.getTrainingActivityDetailById(id);\n if (activityDetail && activityDetail.length) {\n returnTrainingLogData = _.first(activityDetail);\n return returnTrainingLogData;\n }\n } else {\n return returnTrainingLogData;\n }\n }", "function _displayNextTrial() {\n\n // Deep copy the trial before you replace its tokens.\n // This is because the tokens themselves are just references thus,\n // detokenizing a reference will also detokenize trials elsewhere in _allTrials !!\n var _trial_to_run = _detokenizeTrial(_.cloneDeep( _allTrials.back() )); // Trial is popped in ./ResponseHandler.js:_storeResponse\n\n console.log(\"Displaying next trial:\", _trial_to_run);\n\n if (!_isUsingPhases){\n _displayTrialSimultaneously(_trial_to_run);\n } else {\n _displayTrialPhases(_trial_to_run);\n }\n\n}", "function timeTilNextTrain(trainFrequency, firstTrainTime) {\n // Assumptions\n var tFrequency = trainFrequency;\n\n // Time is 3:30 AM\n var firstTime = firstTrainTime;\n\n // First Time (pushed back 1 year to make sure it comes before current time)\n var firstTimeConverted = moment(firstTime, \"HH:mm\").subtract(1, \"years\");\n console.log(firstTimeConverted);\n\n // Current Time\n var timern = moment();\n console.log(\"CURRENT TIME: \" + moment(timern).format(\"hh:mm\"));\n\n // Difference between the times\n var diffTime = moment().diff(moment(firstTimeConverted), \"minutes\");\n console.log(\"DIFFERENCE IN TIME: \" + diffTime);\n\n // Time apart (remainder)\n var tRemainder = diffTime % tFrequency;\n console.log(tRemainder);\n\n // Minute Until Train\n var tMinutesTillTrain = tFrequency - tRemainder;\n console.log(\"MINUTES TILL TRAIN: \" + tMinutesTillTrain);\n\n // Next Train\n var nextTrain = moment().add(tMinutesTillTrain, \"minutes\");\n console.log(\"ARRIVAL TIME: \" + moment(nextTrain).format(\"hh:mm\"));\n\n return nextTrain;\n}", "function next() {\n\t\t\tif (aTests.length) {\n\t\t\t\trunTest(aTests.shift());\n\t\t\t} else if (!iRunningTests) {\n\t\t\t\toTotal.element.classList.remove(\"hidden\");\n\t\t\t\toTotal.element.firstChild.classList.add(\"running\");\n\t\t\t\tsummary(Date.now() - iStart);\n\t\t\t\tsaveLastRun(mLastRun);\n\t\t\t\tif (oFirstFailedTest) {\n\t\t\t\t\tselect(oFirstFailedTest);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "getNextPage() {\n return tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"](this, void 0, void 0, function* () {\n const response = this.getListings('after', this.after);\n return response;\n });\n }", "function findNextArrival() {\n let now = moment()\n let currentTime = moment(now).format('hh:mm')\n let firstTrain = moment(firstTrainTime, 'HH:mm')\n // find difference between now and when the first train leaves\n let diff = moment().diff(firstTrain)\n\n let nextTrain, minutesUntilTrain\n\n // train hasn't left yet\n if (diff < 0) {\n nextArrival = moment(firstTrain).format('LT')\n diff = firstTrain.diff(moment(), 'minutes')\n minutesUntilTrain = diff\n }\n // first train has already left\n else {\n diff = moment().diff(firstTrain, 'minutes')\n let remainder = diff % frequency\n minutesUntilTrain = frequency - remainder\n nextTrain = moment().add(minutesUntilTrain, 'minutes')\n nextArrival = moment(nextTrain).format('LT')\n }\n return [nextArrival, minutesUntilTrain]\n}", "function getNext() {\n\n }", "function next() {\n\t\t\tif (aTests.length) {\n\t\t\t\treturn runTest(aTests.shift());\n\t\t\t} else if (!iRunningTests) {\n\t\t\t\toTotal.element.classList.remove(\"hidden\");\n\t\t\t\toTotal.element.firstChild.classList.add(\"running\");\n\t\t\t\tsummary(Date.now() - iStart);\n\t\t\t\tif (oFirstFailedTest) {\n\t\t\t\t\tselect(oFirstFailedTest);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "train() {\n if(!this.running && ! this.recording)\n {\n this.disableButtons(true);\n this.trainingData().then((t)=> {\n this.updateRows();\n if(this.USE_WORKER)\n {\n this.myWorker.postMessage({action:\"train\",data:t});\n }\n else\n {\n this.myModel.train(t);\n this.trainingEnd();\n }\n });\n }\n }", "function next(data) {\n data = getResults(data);\n let ul = document.getElementById(\"drivers-list\");\n var newLI;\n for (const [key, value] of Object.entries(data)) {\n let task = value.Driver.code;\n newLI = document.createElement(\"li\");\n newLI.appendChild(document.createTextNode(task));\n ul.appendChild(newLI);\n\n console.log(value.Driver.code);\n }\n}", "function fetchTrainers () {\n fetch('http://localhost:3000/trainers')\n .then(res => res.json())\n .then(trainers => {\n trainers.forEach((trainer) => showTrainer(trainer))\n })\n}", "function run() {\r\n $.when(get_data()).then(() => {\r\n x_train.print()\r\n y_train.print()\r\n model = tf.sequential();\r\n model.add(tf.layers.dense({units:32, inputShape:[4], activation:'relu'}))\r\n model.add(tf.layers.dense({units:16, activation:'relu'}))\r\n model.add(tf.layers.dense({units:8, activation:'relu'}))\r\n model.add(tf.layers.dense({units:3, activation:'softmax'}))\r\n model.compile({loss:'categoricalCrossentropy', optimizer:'adam', metrics: ['accuracy']})\r\n model.fit(x_train, y_train, {epochs:100}).then((history) => {\r\n console.log(history.history.acc)\r\n model.predict(x_test).print()\r\n })\r\n })\r\n}", "nextImage() {\n this.postFeatures();\n //get the scenes for the next lat/lng\n const collectionid = 'GOOGLE/GEO/ALL/SATELLITE/WORLDVIEW3/ORTHO/RGB';\n // const collectionid = 'LANDSAT/LC8_L1T_TOA';\n this._get(GEE_IMAGE_SERVER_ENDPOINT + \"getIdsForPoint?lng=\" + this.state.lng + \"&lat=\" + this.state.lat + \"&collectionid=\" + collectionid).then(json => {\n //the geeImageServer returns quasi-json data\n const sceneIds = eval(json.records.substring(json.records.indexOf(\"[\"), json.records.length - 1));\n //if there are scenes then get the first\n const sceneId = (sceneIds.length) ? sceneIds[0] : undefined;\n //load that scene\n if (sceneId) this.addGEEImage(sceneId);\n });\n }", "function next(){\n\n // if in the last page, then go to the new page needs http request\n if(scope.model.currentIndex === (scope.model.results.length - 1))\n {\n angular.element('button.searchbtnbox').toggleClass('changed');\n angular.element('div.section-refresh-overlay').css('visibility','visible');\n var promise = scope.model.next();\n promise.then(function(response){\n\n scope.model.currentStart += scope.model.results[scope.model.currentIndex - 1].length;\n angular.element('button.searchbtnbox').toggleClass('changed');\n angular.element('div.section-refresh-overlay').css('visibility','hidden');\n $rootScope.$emit('setMarkers',{data:scope.model.data});\n\n },function(error){\n console.log(error);\n });\n }\n else {\n scope.model.currentIndex++;\n scope.model.data = scope.model.results[scope.model.currentIndex];\n scope.model.currentStart += scope.model.results[scope.model.currentIndex - 1].length;\n $rootScope.$emit('setMarkers',{data:scope.model.data});\n }\n }", "async function loadDetails() {\r\n try {\r\n setShow(true);\r\n\r\n const response = await api.get(`/etapas/${project._id}/${step._id}`, {\r\n headers: {\r\n authorization: `Bearer ${token}`\r\n }\r\n });\r\n\r\n const { data } = response;\r\n\r\n if (data) {\r\n setDetails(data.detalhes);\r\n\r\n StepCurrentAction({\r\n step: data\r\n });\r\n } else {\r\n setDetails([]);\r\n }\r\n\r\n setShow(false);\r\n } catch (err) {\r\n console.log('err ', err);\r\n setErr(true);\r\n }\r\n }", "function progressToNext () {\n MobidulService.getProgress($stateParams.mobidulCode)\n .then(function (progress) {\n _getNextStation(progress.progress)\n .then(function (next) {\n $timeout(function () {\n $state.go('mobidul.station', { stationCode: next.code});\n });\n }, function () {\n var rallyCompletedDialog =\n $mdDialog.alert()\n .parent(angular.element(document.body))\n .title($translate.instant('RALLY_DIALOG'))\n .textContent($translate.instant('RALLY_DIALOG_TEXT'))\n .ariaLabel($translate.instant('RALLY_DIALOG'))\n .ok($translate.instant('OK'));\n\n $mdDialog.show(rallyCompletedDialog);\n });\n });\n }", "__nextStep() {\n this.openNextStep();\n }", "getNextStories() {\n this.feedController.getStories()\n .then((model) => {\n if (!model) {\n this.complete = true;\n this.disableFeed();\n return;\n }\n\n this.state.model = this.state.model.concat(model);\n this.setState({ model : this.state.model });\n this.inProgress = false;\n this.unlockLoadMoreButton();\n })\n .catch((err) => {\n console.error('problem getting data from API: ', err);\n });\n }", "function next() {\n pageNumber++;\n getEmployeeDetails(myArr);\n }", "getLast() {\n let runner = this.head;\n\n while (runner.next) {\n runner = runner.next;\n }\n return runner.data;\n }", "function calculateNextArrival(trainSeq) {\n\n// Derive the first train time and current date\n var currentDate = moment().format(\"YYYY-MM-DD\");\n var firstTraintoday = currentDate + \"T\" + trainArrayObj[trainSeq].tfirsttrain + \":00\";\n var input_date = new Date(firstTraintoday).getTime();\n var curr_date = new Date().getTime();\n\n// Iterate thru the train array to get the next train past the current time\n expired = false;\n trainNumber = 0;\n while (!expired) {\n nextTrainTime = moment(input_date).add(trainArrayObj[trainSeq].tfreq, \"minutes\")\n trainNumber++\n\n if (input_date > curr_date) {\n expired = true;\n } else {\n input_date = nextTrainTime;\n }\n }\n\n var nextTrainTimeMilitary = moment(input_date).format(\"hh:mm a\");\n\n// Calcualte the minutes away\n var now = moment(new Date(curr_date)); //todays date\n var end = moment(new Date(input_date)); // another date\n var duration = moment.duration(end.diff(now));\n var min = Math.ceil(duration.asMinutes());\n trainArrayObj[trainSeq].tnext = nextTrainTimeMilitary;\n trainArrayObj[trainSeq].tmin = min;\n}", "next() {\n this.last += 1;\n const ticket = new Ticket(this.last, null);\n this.tickets.push(ticket);\n\n this.saveDB();\n return \"Ticket: \" + ticket.number;\n }", "function loadTrainers() {\n fetch(TRAINERS_URL)\n .then(res => res.json())\n .then(json => json.forEach(trainer => displayTrainer(trainer)))\n}", "function getInfo() {\n fetch(TRAINERS_URL)\n .then(response => response.json())\n .then(json => makeCard(json.data))\n}", "addTraining(training) {\n console.log(training);\n fetch('https://customerrest.herokuapp.com/api/trainings/',\n { method: 'POST',\n headers: { 'Content-Type': 'application/json', },\n body: JSON.stringify(training)\n })\n .then(res => this.loadTrainings())\n .then(res => this.setState({open: true, message: 'training added'}))\n .catch(err => console.error(err))\n }", "function train(index)\n{\n // TODO\n}", "next(){\n let next = this.currentId + 1;\n if(next >= this.list.length){\n next = this.list.length;\n }\n this.goto(next);\n }", "_getActivePrereleaseTrain() {\n var _a;\n return (_a = this.active.releaseCandidate) !== null && _a !== void 0 ? _a : this.active.next;\n }", "function YCurrent_nextCurrent()\n { var resolve = YAPI.resolveFunction(this._className, this._func);\n if(resolve.errorType != YAPI_SUCCESS) return null;\n var next_hwid = YAPI.getNextHardwareId(this._className, resolve.result);\n if(next_hwid == null) return null;\n return YCurrent.FindCurrent(next_hwid);\n }", "function addTrain(name, destination, time, frequency) {\n this.name = name,\n this.destination = destination,\n this.firstTime = time,\n this.frequency = parseFloat(frequency)\n}", "async function get_next(msg,curr_info) {\n if (config.autoplay && curr_info && !queue.length) {\n new_link = 'https://youtube.com' + curr_info.response.contents.twoColumnWatchNextResults.autoplay.autoplay.sets[0].autoplayVideo.commandMetadata.webCommandMetadata.url\n sendToLog('autoplay_test', new_link)\n new_info = await get_info(new_link)\n }\n else {\n new_info = queue[0]\n }\n send_title(msg, new_info.videoDetails.title)\n return new_info\n}", "loadNextPage() {\n this.data.page = this.data.page + 1;\n this.fetchMovies();\n }", "function calcNextTrain(p1, p2) {\n\n var tFrequency = p1;\n var firstTime = p2;\n\n // First Time (pushed back 1 year to make sure it comes before current time)\n var firstTimeConverted = moment(firstTime, \"hh:mm\").subtract(1, \"years\");\n\n var currentTime = moment();\n\n var diffTime = moment().diff(moment(firstTimeConverted), \"minutes\");\n\n var tRemainder = diffTime % tFrequency;\n\n tMinutesTillTrain = tFrequency - tRemainder;\n\n nextTrain = moment().add(tMinutesTillTrain, \"minutes\");\n nextTrain = moment(nextTrain).format(\"hh:mm A\");\n\n return [nextTrain, tMinutesTillTrain];\n }", "getNextModel() {\n\t\t\t\treturn this.at(this._getIndex(true));\n\t\t\t}", "function displayTrains() {\r\n var trainList = $(\"#trainList\");\r\n trainList.empty();\r\n\r\n // Create column headers\r\n trainList.append(\r\n $(\"<tr>\").append(\r\n $(\"<th>\").text(\"Train Name\"),\r\n $(\"<th>\").text(\"Destination\"),\r\n $(\"<th>\").text(\"Frequency (min)\"),\r\n $(\"<th>\").text(\"Next Arrival\"),\r\n $(\"<th>\").text(\"Minutes Away\")\r\n )\r\n );\r\n\r\n // Add rows for each train\r\n for (var train in trains) {\r\n let trainData = trains[train];\r\n let currentTime = moment();\r\n let frequency = parseInt(trainData.frequency);\r\n let firstDeparture = moment(trainData.firstDeparture, \"HH:mm\").subtract(1, \"years\");\r\n\r\n // Calculate mintues away\r\n let minsUntil = frequency - (currentTime.diff(firstDeparture, \"minutes\") % frequency);\r\n // Calculate next arrival\r\n let nextArrival = currentTime.add(minsUntil, \"minutes\").format(\"hh:mm a\");\r\n\r\n // Creates row HTML and append it to the table\r\n trainList.append(\r\n $(\"<tr>\").append(\r\n $(\"<td>\").text(train),\r\n $(\"<td>\").text(trainData.destination),\r\n $(\"<td>\").text(trainData.frequency),\r\n $(\"<td>\").text(nextArrival),\r\n $(\"<td>\").text(minsUntil)\r\n )\r\n );\r\n }\r\n}", "nextPage(){\n console.log('estamos en la pagina: ');\n console.log(this.state.page);\n console.log('pagina siguiente: ');\n console.log(parseInt(this.state.page)+1); \n var next = parseInt(this.state.page)+1; \n this.loadData(next, 'next', '');\n }", "function getTrainsBetweenStations(sender,source,destination,dd,mm){\n\n request('http://api.railwayapi.com/between/source/'+ source +'/dest/'+ destination +'/date/'+dd +'-'+mm+'/apikey/'+ apiKey, (err, response, body) => {\n\t if(JSON.parse(body).error === \"Quota exhausted for day\"){\n\t console.log(JSON.parse(body).error);\n\t }else{\n\n sendText(sender,\"There are \"+JSON.parse(body).total+\" trains availble..\");\n\n var trainList = JSON.parse(body).train\n for (var i=0;i<trainList.length;i++){\n sendText(sender,JSON.parse(body).train[i].number +\" \"+ JSON.parse(body).train[i].name+\", \"+\n JSON.parse(body).train[i].from.name +\" -> \" + JSON.parse(body).train[i].to.name +\"\\nSch Dep : \"+JSON.parse(body).train[i].src_departure_time +\" Hrs\"\n +\"\\nSch Arr : \"+JSON.parse(body).train[i].dest_arrival_time +\" Hrs\"+\"\\nTravel Time : \"+ JSON.parse(body).train[i].travel_time +\" Hrs\\n\");\n\n\n }\n\n\n\t }\n});\n\n\n}", "async testAccuracy() {\n if (this.mnistdata === undefined) {\n this.mnistdata = new MnistData();\n const success = await this.mnistdata.load(6);\n }\n const TEST_DATA_SIZE = 2000;\n\n const [testXs, testYs] = tf.tidy(() => {\n const d = this.mnistdata.getTestBatch(TEST_DATA_SIZE);\n return [\n d.xs.reshape([TEST_DATA_SIZE, 28, 28, 1]),\n d.labels\n ];\n });\n\n const result = this.model.evaluate(testXs, testYs);\n console.log('Done evaluation');\n console.log(this.model.metricsNames);\n console.log(result.forEach(r => r.print()));\n }", "function addTrain(newTrain) {\n\t// some values are calculated on the fly\n\tvar tFrequency = newTrain.frequency;\n\tvar firstTime = moment(newTrain.firstTime, \"H HH\").subtract(1,\"years\"); // string in 24 hour format, subtracted 1 year\n\tvar diffTime = moment().diff(moment(firstTime), \"minutes\");\n\tvar tRemainder = diffTime % tFrequency;\n\tvar tMinutesTillTrain = tFrequency - tRemainder;\n\tvar nextTrain = moment().add(tMinutesTillTrain, \"minutes\");\n\t$(\"#trainTable\").children(\"tbody\").append(\"<tr><td>\"+newTrain.name+\"</td><td>\"+newTrain.destination+\"</td><td>\"+newTrain.frequency+\"</td><td>\"+moment().add(tMinutesTillTrain,\"minutes\").format(\"hh:mm a\")+\"</td><td>\"+tMinutesTillTrain+\"</td></tr>\");\n}", "function YCurrentLoopOutput_nextCurrentLoopOutput()\n { var resolve = YAPI.resolveFunction(this._className, this._func);\n if(resolve.errorType != YAPI_SUCCESS) return null;\n var next_hwid = YAPI.getNextHardwareId(this._className, resolve.result);\n if(next_hwid == null) return null;\n return YCurrentLoopOutput.FindCurrentLoopOutput(next_hwid);\n }", "function _nextQuestion() {\n var nextQuestion = vm.questionSelected.Id;\n nextQuestion++;\n console.log(nextQuestion);\n // run function to get question \n _getQuestion(nextQuestion);\n }", "function getTrimetVehicleId(arrivalVehicleId) {\n $.ajax({\n type: \"GET\",\n url: \"https://developer.trimet.org/ws/v2/vehicles?xml=true&appID=Your_own_api_key\" + trimetApiKey,\n dataType: \"xml\",\n success: processXML\n });\n\n function processXML(xml) {\n $(xml).find(\"vehicle\").each(function() {\n var vehicleId = $(this).attr(\"vehicleID\");\n if(vehicleId === arrivalVehicleId) {\n // what we need back: Long/Lat NextStopId, lastStopId\n var vehicleID = $(this).attr(\"vehicleID\");\n var shortSign = $(this).attr(\"signMessageLong\");\n var fullSign = $(this).attr(\"signMessage\");\n var longitude = $(this).attr(\"longitude\");\n var latitude = $(this).attr(\"latitude\");\n var lastLocID = $(this).attr(\"lastLocID\");\n var nextLocID = $(this).attr(\"nextLocID\");\n\n var trainMeta = { trainId: vehicleID, longitude: longitude, latitude: latitude, lastLocID: lastLocID, nextLocID: nextLocID, shortSign: shortSign, fullSign: fullSign };\n\n trainMetaArray.push(trainMeta);\n }\n });\n localStorage.clear();\n localStorage.setItem(\"trainMetaArray\", trainMetaArray);\n }\n }", "function train() {\n // gets net and training data\n var net = new brain.NeuralNetwork();\n var trainingDataRaw = fs.readFileSync('./excerpts.js');\n var trainingData = JSON.parse(trainingDataRaw);\n \n // gets a few excerpts\n var selectData = [];\n for (i = 0; i < 20; i++) {\n var next = trainingData[Math.floor((Math.random() * trainingData.length))];\n selectData.push(next);\n }\n // maps encoded training data\n selectData = compute(selectData);\n \n // trains network and returns it\n net.train(selectData, {\n log: true\n });\n \n return net;\n}", "async fetchAndOutputTestRunStatus() {\n\t\t\n\t\t// Get the persistent data\n\t\t//----------------------------\n\n\t\t// Variable initialization safety\n\t\tif(\n\t\t\tthis.testID == null || \n\t\t\tthis.processedTestRunSteps == null ||\n\t\t\tthis.jsonOutputObj == null\n\t\t) {\n\t\t\tthrow \"Unable to fetch and output test run status : testID is not set\"\n\t\t}\n\n\t\t// The persistent data objects\n\t\tlet processedTestRunSteps = this.processedTestRunSteps;\n\t\tlet jsonOutputObj = this.jsonOutputObj;\n\n\t\t// Get the test response\n\t\t//----------------------------\n\n\t\t// Get the test response\n\t\tlet testResponse = await SpaceAndProjectApi.getTestRunResult(this.testID);\n\n\t\t// Unwrap the data - where possible\n\t\tlet testRunResult = testResponse.result\n\t\t// Check and skip result object, return null\n\t\tif( testRunResult == null ) {\n\t\t\treturn null\n\t\t}\n\n\t\t// Get the test steps\n\t\tlet testRunSteps = testRunResult.steps\n\n\t\t// Remember where to print out the steps after each loop\n\t\tlet startFromIndex = 0;\n\t\tif (processedTestRunSteps.length === 0) {\n\t\t\tstartFromIndex = 0\n\t\t} else {\n\t\t\tstartFromIndex = processedTestRunSteps.length\n\t\t}\n\t\n\t\t// Printing out all the result from the startFromIndex\n\t\tfor (let index = startFromIndex; index < testRunSteps.length; index++) {\n\t\t\t// Get the test run step\n\t\t\tlet step = testRunSteps[index]\n\t\t\tif (\n\t\t\t\tstep.status === \"success\" || \n\t\t\t\tstep.status === \"error\" || \n\t\t\t\tstep.status === \"failure\" || \n\t\t\t\tstep.status === \"terminated\" || \n\t\t\t\tstep.status === \"system_error\" \n\t\t\t) {\n\t\t\t\t// Lets log the first step timing\n\t\t\t\tif(index >= 0 && this._firstStepTimeMS == null) {\n\t\t\t\t\tthis._firstStepTimeMS = Date.now();\n\t\t\t\t\tthis._firstStepTimeTakenMS = this._firstStepTimeMS - this._startTimeMS;\n\t\t\t\t}\n\n\t\t\t\t// Lets log the output, and pushed it into the processed step list\n\t\t\t\tprocessedTestRunSteps.push(formatAndOutputStepObject(step));\n\t\t\t} else {\n\t\t\t\t// Minor additional delay for \"pending\" steps\n\t\t\t\tif( index <= 5 ) {\n\t\t\t\t\t// For first 5 steps, lets, reduce the the \"wait\" between steps\n\t\t\t\t\t// await sleep(100+Math.random()*50)\n\t\t\t\t\tawait sleep(10)\n\t\t\t\t} else {\n\t\t\t\t\t// 1s awaits min\n\t\t\t\t\tawait sleep(1000+Math.random()*150)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Minimum 10 ms delay between step - makes outputs more readable\n\t\t\t// bottle neck would have been in the test steps anyway\n\t\t\tawait sleep(10);\n\t\t}\n\n\t\t// Lets see if test is fully completed\n\t\t// if so return and break the loop\n\t\tlet testRunStatus = testRunResult.status\n\t\tif (\n\t\t\ttestRunStatus === \"success\" || \n\t\t\ttestRunStatus === \"error\" || \n\t\t\ttestRunStatus === \"failure\" || \n\t\t\ttestRunStatus === \"terminated\" || \n\t\t\ttestRunStatus === \"system_error\" \n\t\t) {\n\t\t\t// Update the JSON object\n\t\t\tjsonOutputObj.status = testRunStatus;\n\t\t\tjsonOutputObj.steps = processedTestRunSteps;\n\n\t\t\t// Return test status\n\t\t\treturn testRunStatus\n\t\t}\n\n\t\t// Pending status\n\t\tif(\n\t\t\ttestRunStatus === \"init\" ||\n\t\t\ttestRunStatus === \"created\" ||\n\t\t\ttestRunStatus === \"pending\"\n\t\t) {\n\t\t\t// No final status, return nothing\n\t\t\treturn null\n\t\t}\n\n\t\t// Unknown / Invalid status\n\t\tOutputHandler.standardRed(`> Unexpected test status (will treat it as system_error) : ${testRunStatus}`)\n\t\treturn \"system_error\"\n\t}", "Next() {\r\n return this.InternalSample();\r\n }", "function getTimes(timeObj) {\n // variable to hold net train time\n let _nextTrain;\n // variable to hold minutes away for next train\n let _minutesAway;\n // get moment time of first train\n let _firstTrainTime = moment(timeObj.firstTime);\n // get current time\n let _now = moment();\n // get difference time in minutes\n let _diff = Math.abs(_now.diff(_firstTrainTime, 'minutes'));\n // Check if First train is in future time\n if (_now.isBefore(_firstTrainTime)) {\n // if yes show first time of the day train\n _nextTrain = _firstTrainTime.format(`HH:mm`);\n // and how many minutes away from current time\n _minutesAway = _diff;\n }\n // else (train first time is pass)\n else {\n // get how minutes away its next train by using \n // mod will give the reminder between current time and frequency\n // so we have frequency minus time alredy pass from last train.\n _minutesAway = timeObj.frequency - (_diff % timeObj.frequency);\n // get next train hour in 24h format\n _nextTrain = _now.add(_minutesAway, 'minutes').format('HH:mm');\n }\n // retutrn object with train times info frequency, hour of next train and minutes away\n return {\n frequency: timeObj.frequency,\n hour: _nextTrain,\n minutes: _minutesAway\n };\n}", "function nextTask(currentRecord, label, skipRecord) {\n const newCompleted = [...completed, currentRecord];\n if(!skipRecord) {\n updateAnnotationField(currentRecord, label);\n }\n\n if (newCompleted.length === listOfNamesWithPictures.length) {\n // All annotations are complete.\n onComplete({\n numTotal: listOfNamesWithPictures.length,\n numCompleted: newCompleted.length,\n });\n } else {\n // There are more annotatins. Next annotation task will be shown.\n setCompleted(newCompleted);\n }\n }", "getListTrainingSchedule(qParams) {\n return this.request.get('/training-info', qParams);\n }", "async function train(){\n\tmessageP.html('Training the Model...');\n\ttrainP.html('Train Results');\n\ttrainP.show();\n\ttrainLossP.show();\n\ttrainAccuracyP.show();\n\ttrainIterationP.show();\n\n\tfor(let i=0 ; i<trainIterations ; i++){\n\t\tlet validation_xs,validation_ys,validationBatch,validationData;\n\t\tlet train_xs,train_ys,trainBatch;\n\n\t\t// Creating the training batch\n\t\ttrainBatch = data.nextTrainBatch(trainBatchSize);\n\t\ttrain_xs = trainBatch.xs.reshape([trainBatchSize,28,28,1]);\n\t\ttrain_ys = trainBatch.labels;\n\n\t\tif(i % validationIterationFrequency === 0){\n\t\t\t// Creating the validation data\n\t\t\tvalidationBatch = data.nextTestBatch(validationBatchSize);\n\t\t\tvalidation_xs = validationBatch.xs.reshape([validationBatchSize,28,28,1]);\n\t\t\tvalidation_ys = validationBatch.labels;\n\t\t\tvalidationData = [validation_xs,validation_ys];\n\t\t}\n\n\t\t// Defining config properties\n\t\tlet config = {\n\t\t\tbatchSize: trainBatchSize,\n\t\t\tvalidationData,\n\t\t\tepochs: 1,\n\t\t\tcallbacks: {onBatchEnd: tf.nextFrame}\n\t\t};\n\n\t\t// Training the model\n\t\tawait model.fit(train_xs,train_ys,config).then((response) => {\n\t\t\tlet loss = response.history.loss[0].toFixed(6);\n\t\t\ttrainLossP.html(`Loss: ${loss}`);\n\t\t\tlet accuracy = (response.history.acc[0]*100).toFixed(2);\n\t\t\ttrainAccuracyP.html(`Accuracy: ${accuracy}%`);\n\t\t\tlet iterations = i+1;\n\t\t\ttrainIterationP.html(`Iterations: ${iterations}`);\n\t\t\taddPoint(loss,accuracy);\n\t\t});\n\n\t\t// Memory management\n\t\tif(i % validationIterationFrequency === 0){\n\t\t\tvalidationBatch.xs.dispose();\n\t\t\tvalidationBatch.labels.dispose();\n\t\t\tvalidation_xs.dispose();\n\t\t\tvalidation_ys.dispose();\n\t\t}\n\t\ttrainBatch.xs.dispose();\n\t\ttrainBatch.labels.dispose();\n\t\ttrain_xs.dispose();\n\t\ttrain_ys.dispose();\n\t}\n\n\tmessageP.html('Training Completed.');\n}", "function queryTrainingStatus() {\n // Replace this value with the project number listed in the Google\n // APIs Console project.\n var projectNumber = 'XXXXXXXX';\n var id = 'mylanguageidmodel';\n\n var result = Prediction.Trainedmodels.get(projectNumber, id);\n Logger.log(result.trainingStatus);\n}", "function reachedNextWaypoint() {\n\tif (curStep + 1 < gRouteLeg.steps.length) {\n\t\tcurStep++;\n\t\tvar coords = new Object();\n\t\tcoords.str = gRouteLeg.steps[curStep].html_instructions;\n\t\tcoords.latitude = gRouteLeg.steps[curStep].end_location.lat;\n\t\tcoords.longitude = gRouteLeg.steps[curStep].end_location.lng;\n\t\tsetNextWaypoint(coords);\n\t\t\n\t\t// TODO: haptic feedback if goal / nextwaypoint is reached\n\t}\n}", "function get_training(arg){\n \t\tvar details = '';\n\t\t$.ajax({\n\t\t\turl: base_url+'staff/fetch_edu_data/'+arg,\n\t\t\tdataType: \"JSON\"\n\t\t}).done(function (data) {\n\t\t\t\t$.each(data, function () {\n\t\t\t\t\tdetails += \"<tr>\"+\n\t\t\t \"<td class=\\\"use3\\\">\"+ this.course_name +\"</td>\"+\n\t\t\t \"<td>\"+ this.certificate +\"</td>\"+\n\t\t\t \"<td>\"+ this.from_yr +\"</td>\"+\n\t\t\t \"<td>\"+ this.to_yr +\"</td>\"+\n\t\t\t \"<td>\"+ \"<button class=\\\"rmv3\\\">-</button>\" +\"</td>\"+\n\t\t\t \"</tr>\";\n\t\t\t});\n\t\t\t//alert(details);\n\t\t\t$(\".trainings tbody\").append(details);\n\t\t});\n\t}// The Training fetch ends here..", "nextGuess() {\n //now that model is trained we can take in each current step and pass into predict and make move based on output\n let currStep = this.state.episode[this.state.episode.length - 1];\n let inputs = tf.tensor([[currStep]]);\n let model = this.state.model;\n // console.log(\"Model: \", model);\n // model.summary();\n let ANSWER = model.predict(inputs);\n ANSWER.print();\n\n //pass the prediction ANSWER to the act method\n this.act(ANSWER);\n }", "function trainTheNetwork () {\n if (isNotTrained) { \n /*\n =============================================================\n TRAINING OF NETWORK\n =============================================================\n */\n \n createDataSet();\n\n // DEBUG\n // alert(finalDataSet);\n \n network.train(finalDataSet, {\n log: 10, // Logs the activity of the network every x iterations\n error: 0.03, // The desired error state\n iterations: 10000, // Runs the training data through the network x times\n rate: 0.3 // The speed of training\n });\n\n isNotTrained = false;\n }\n}", "async train() {\n await this.nlpManager.train();\n }", "function train() {\n // don't allow training for new player yet\n if (getLevel() == 0 && getSP() > 0) {\n showIntialPointsPrompt();\n return;\n }\n var trainingType = document.getElementById('trainingSelect').value;\n var validTrainings = getValidTrainingTypes();\n if (trainingType==TRAININGTYPE.MULTI) {\n if (!enableDesiredBTCheck || ((getMultiTrainCount()==2 && validTrainings.multi2) ||\n (getMultiTrainCount()==3 && validTrainings.multi3) ||\n (getMultiTrainCount()==4 && validTrainings.multi4))) {\n multiTrain();\n } else {\n log(\"Training skipped. You can not multi train \"+getMultiTrainCount()+\" attributes and still reach your BT goal\", true);\n return;\n }\n } else {\n if (singleTrainSelect.value == \"\") {\n log(\"Need to select an attribute to train\", !autoTrain);\n return;\n }\n if (!enableDesiredBTCheck || (trainingType==TRAININGTYPE.INTENSE && validTrainings.intense ||\n trainingType==TRAININGTYPE.NORMAL && validTrainings.normal ||\n trainingType==TRAININGTYPE.LIGHT && validTrainings.light)) {\n singleTrain();\n } else {\n log(\"Training skipped. You can not do the selected training and still reach your BT goal.\", true);\n return;\n }\n }\n updateTrainingPrediction();\n}", "function getNextTrains(direction,stop_id,stationClicked) { \n var nextThree; \n if (direction == 'south') {\n var stop_headsign = 'Century%20Park';\n } else {\n var stop_headsign = 'Clareview';\n }\n var etsUrl = 'https://data.edmonton.ca/resource/xeux-ngrz.json?$query=SELECT%20arrival_time_2%20WHERE%20stop_id=%22'+stop_id+'%22%20AND%20stop_headsign=%22'+stop_headsign+'%22%20GROUP%20BY%20arrival_time_2%20ORDER%20BY%20arrival_time_2%20ASC';\n $.ajax({\n url: etsUrl,\n dataType: 'json',\n success: function(data) {\n arrivalTimes = data;\n var i = 0;\n if (arrivalTimes.length > 0) {\n var arrivalTime = arrivalTimes[i].arrival_time_2;\n while (timeNow() > arrivalTime) {\n i++;\n arrivalTime = arrivalTimes[i].arrival_time_2;\n if (i > arrivalTimes.length) {\n break;\n }\n }\n if (direction == 'south') {\n nextThree = '<p> South Trains: <br>'+arrivalTimes[i].arrival_time_2+'<br>'+arrivalTimes[i+1].arrival_time_2+'<br>'+arrivalTimes[i+2].arrival_time_2+'</p>';\n } else {\n nextThree = '<p> North Trains: <br>'+arrivalTimes[i].arrival_time_2+'<br>'+arrivalTimes[i+1].arrival_time_2+'<br>'+arrivalTimes[i+2].arrival_time_2+'</p>';\n }\n } else {\n nextThree = 'No Train Times Available';\n }\n if (direction == 'south') {\n stationClicked.infowindow().setContent(stationClicked.infowindow().getContent()+nextThree);\n stationClicked.infowindow().open(map,stationClicked.marker());\n } else {\n stationClicked.infowindow().setContent(stationClicked.infowindow().getContent()+nextThree);\n }\n },\n error: function(jqXHR, exception) {\n if (direction == 'south') {\n nextThree = '<p> South Trains: <br>Unable to access ETS stop times</p>';\n stationClicked.infowindow().setContent(stationClicked.infowindow().getContent()+nextThree);\n stationClicked.infowindow().open(map,stationClicked.marker());\n } else {\n nextThree = '<p> North Trains: <br>Unable to access ETS stop times</p>';\n stationClicked.infowindow().setContent(stationClicked.infowindow().getContent()+nextThree);\n }\n console.log('Status: '+jqXHR.status+' Exception: '+exception);\n }\n });\n }", "function TrainState() {\n var last, lastcnt = 0;\n return {\n next: function (ce) {\n if (ce.event_type === 1) {\n if (last !== ce.content) {\n last = ce.content;\n lastcnt = 0;\n } else {\n\t\t\t\t\t\tlastcnt = lastcnt + 1;\n if (lastcnt === 3) {\n send(last);\n }\n }\n }\n }\n };\n }", "function _next() {\n\t\tif (queue.length > 0) {\n\t\t\tvar info = queue.shift();\n\t\t\t_getData(info.url, info.callback);\n\t\t} else {\n\t\t\tpaused = true;\n\t\t}\n\t}", "function singleTrain() {\n var tpCost = 2;\n if (tpCost > getTP()) {\n if (!autoTrain) {\n log('Not enough training points. Need '+tpCost, true);\n }\n } else {\n var trainingType = document.getElementById('trainingSelect').value;\n var btGain = 0;\n if (trainingType==TRAININGTYPE.LIGHT) {\n btGain = 6;\n }\n else if (trainingType==TRAININGTYPE.NORMAL) {\n btGain = 4;\n }\n else if (trainingType==TRAININGTYPE.INTENSE) {\n btGain = 2;\n }\n var increase = calculateTrainingGain(singleTrainSelect.value, trainingType);\n\n if (trainAttribute(singleTrainSelect.value, increase)) {\n setTP(getTP()-tpCost);\n setBonusTokens(getBonusTokens()+btGain);\n // keep training if there's left over TP\n if (autoTrain) {\n train();\n }\n }\n }\n}", "fetchNext() {\n if (!this.busy && !this.complete && this.models.length) {\n let nextStart = this.models[this.models.length - 1].get('parent');\n\n if (nextStart === '') {\n this.complete = true;\n } else {\n this.options.start = nextStart;\n\n this.fetch({\n remove: false,\n success: () => this.busy = false\n });\n }\n }\n }", "function nextMovie() {\n if (index === movies.length - 1) {\n index = 0;\n } else {\n index++;\n }\n\n removeData();\n showData(index);\n}", "getNext() {\n let token;\n if (this.currentToken < this.tokens.length){\n token = this.tokens[this.currentToken];\n this.currentToken++;\n }\n else\n token = \"NULLTOKEN\";\n return token;\n }", "function loadDetails() {\n ctrl.testCasesReguest =\n $http.get(ctrl.requestUrl).success(function (data) {\n ctrl.data = data;\n }).catch(function (error) {\n ctrl.data = null;\n ctrl.error = error.statusText;\n ctrl.toastError()\n });\n }", "function getTrainers () {\n return fetch('http://localhost:3000/trainers')\n .then(resp => resp.json())\n}", "function nextEdit() {\n var path = '/summaryMSA-IRS',\n currentIdx = $scope.siblingEdits.indexOf(editId);\n if (currentIdx !== ($scope.siblingEdits.length - 1)) {\n path = '/detail/' + editType + '/' + $scope.siblingEdits[currentIdx + 1];\n }\n $location.path(path);\n }", "function nextTrain(sTime, nTime, timeFrequency) {\n console.log(\"stime\", sTime);\n\n let nextTrainArray = [];\n console.log(timeFrequency + 'freq2' + typeof timeFrequency);\n let x = parseInt(timeFrequency);\n //for loop to find next train\n for (let index = sTime; index < 1440; index += x) {\n console.log(index);\n if (index > nTime) {\n console.log('boo');\n let newTrainz = index;\n console.log('newTrainz= ' + newTrainz);\n let minutesTill = index - nTime;\n console.log('TILL: ' + minutesTill);\n nextTrainArray.push(newTrainz, minutesTill)\n return nextTrainArray;\n }\n }\n }", "function nextTrain(time, minutes){\n time = new Date(new Date(\"1970/1/1 \" + time).getTime() + minutes * 60 * 1000);\n let res = (time.getMinutes() >= 31) ? `${time.getHours()+1}:00` : `${time.getHours()}:30`;\n if (time.getHours() <= 4 || (time.getHours() === 23 && time.getMinutes() > 30)) res = '05:00'\n return `The next train is at ${('0'+res).slice(-5)}.`\n}", "get learner_response() { return this._learner_response; }", "function getTrainData() {\n submitLocked = true;\n removeCurrentRows(function() {\n $startStation = $(\"#startStation\");\n $endStation = $(\"#endStation\");\n\n if($startStation.val() === $endStation.val()){\n drawErrors('End station must be different than start station.<p/>Please change your selections and try again.');\n $endStation.focus();\n return;\n }\n\n var septaApi = \"http://www3.septa.org/hackathon/NextToArrive/?req1=\" + encodeURIComponent($startStation.val()) +\n \"&req2=\" + encodeURIComponent($endStation.val());\n\n\n $.ajax(septaApi,\n {dataType: 'jsonp',\n contentType: \"application/jsonp; charset=utf-8\",\n beforeSend: addHeaders,\n success: processTrainData}).complete(completeApiCall).fail(ajaxFailure);\n });\n }", "function goto_next_form() {\n context.current++;\n if (context.current >= context.workflow.length) {\n return finish_survey(); //todo: verify that when going Back and clicking Next this doesn't break the flow\n }\n //Store the incremented value of 'current'\n Survana.Storage.Set('current', context.current, function () {\n //load the next form\n window.location.href = context.workflow[context.current];\n }, on_storage_error);\n }", "read(req, res) {\n var self = this;\n var datas = req.cookies;\n\n // Validate data format\n joi.validate(datas, joi.object().keys({\n token: joi.string().required(),\n }), (error, result) => {\n if (error) {\n // Invalid data format\n return res.status(400).json(error.details[0].message);\n }\n\n // Decrypt session token\n jwt.verify(datas.token, self._app.config.jsonwebtoken.secret, (error, decoded) => {\n if (error) {\n // Decryption error\n return res.status(400).json(error);\n }\n\n // Fetch from database\n self._app.models.training.model.findAll({\n where: {\n userId: decoded.id,\n startedAt: {\n [Op.ne]: null\n },\n finishedAt: {\n [Op.ne]: null\n },\n },\n order: [\n ['createdAt', 'DESC']\n ],\n include: [{\n model: self._app.models.exercise.model,\n attributes: ['id', 'name', 'points']\n }, {\n model: self._app.models.workout.model,\n attributes: ['id', 'name']\n }]\n })\n .then(results => {\n var trainings = [];\n\n for (var i = 0 ; i < results.length ; i++) {\n var tmp = results[i].dataValues;\n var calculateDuration = function(date1, date2) {\n var microseconds = date2 - date1;\n var seconds = Math.floor(microseconds / 1000);\n var minutes = Math.floor(seconds / 60);\n var hours = Math.floor(minutes / 60);\n var secondsText = '', minutesText = '', hoursText = '';\n\n seconds %= 60;\n minutes %= 60;\n hours %= 24;\n secondsText = (seconds < 10) ? '0' + seconds : seconds;\n minutesText = (minutes < 10) ? '0' + minutes : minutes;\n hoursText = (hours < 10) ? '0' + hours : hours;\n\n return (hours) ? `${hoursText}:${minutesText}:${secondsText}` : `${minutesText}:${secondsText}`;\n }\n var calculateInterval = function(date1) {\n var date2 = Date.now();\n var microseconds = date2 - date1;\n var days = Math.floor(microseconds / (24 * 60 * 60 * 1000));\n\n if (days == 0) {\n return 'Today';\n } else if (days == 1) {\n return 'Yesterday';\n } else {\n return days + ' days ago';\n }\n }\n\n trainings.push({\n id: (tmp.exercises.length) ? tmp.exercises[0].id : tmp.workouts[0].id,\n date: calculateInterval(new Date(tmp.createdAt)),\n duration: calculateDuration(new Date(tmp.startedAt), new Date(tmp.finishedAt)),\n volume: tmp.volume,\n type: (tmp.exercises.length) ? 'exercise' : 'workout',\n name: (tmp.exercises.length) ? tmp.exercises[0].name : tmp.workouts[0].name\n });\n }\n\n res.status(200).json(trainings);\n })\n // Database query error\n .catch(error => {\n console.error(error);\n res.status(500).json(error)\n });\n });\n });\n }", "getCurrentTestInfo() {\n if (!this.currentTest) {\n throw new Error(\"Can't obtain TestInfo if not actively in a test!\");\n }\n return this.currentTest;\n }", "getNext() {\n return this.next;\n }", "createNewEpochDataSet(epocCount){\r\n let prevRule = this.state.setupRules;\r\n let epochInfo = this.getEpochConfigJSON();\r\n epochInfo.name = \"Epoch\"+epocCount;\r\n epochInfo.description = \"\";\r\n epochInfo.during_status = \"\";\r\n epochInfo.ending_status = \"\";\r\n epochInfo.drop_from = \"\";\r\n epochInfo.nodeKey = \"epoch_\"+Common.getRandomNumber();//10 digit alphanumeric value\r\n prevRule.push(epochInfo);\r\n this.setState(prevRule);\r\n //setupRules\r\n\r\n }", "function buildTrainApiURl() {\n\n // if (new Date().getHours() >= 11) {\n // return 'https://huxley2.azurewebsites.net/delays/read/30?accessToken=b09cb836-f190-445d-8b96-372eb024141d&expand=true';\n // } else {\n // return 'https://huxley2.azurewebsites.net/delays/tot/30?accessToken=b09cb836-f190-445d-8b96-372eb024141d&expand=true';\n // }\n return 'https://huxley2.azurewebsites.net/delays/tot/30?accessToken=b09cb836-f190-445d-8b96-372eb024141d&expand=true';\n}", "function descend(n) {\n\t\tdata = xyHelper.trainingData(xyData, xPowers);\n\t\tdescent.setData(data.features, data.outcomes);\n\t\tdescent.step();\n\t\tupdate();\n\t}", "getNextindex() {\n return this.state.index+this.state.loadNumber;\n }", "_navigateNext() {\n this._navigate(this.next.id, 'endpoint');\n }", "next() {\n const that = this;\n\n that.navigateTo(that.pageIndex + 1);\n }", "nextPage(){\n const { selectedGenre, year, rating } = this.state;\n //console.log('nextPage1 : ', this.state.page);\n setTimeout(() => {\n var page = this.state.page;\n page = page+1;\n //console.log('nextPage1-1 : ', page);\n\n axios.get(`https://api.themoviedb.org/3/discover/movie?api_key=126293cbe36ad88482598ec4e7595380`\n + `&certification_country=US&sort_by=popularity.desc`\n + `&with_genres=${selectedGenre}`\n + `&primary_release_date.gte=${year.value.min}-01-01&primary_release_date.lte=${year.value.max}-12-31`\n + `&vote_average.gte=${rating.value.min}`\n + `&page=${page}`)\n .then(response => { \n console.log('nextPage2: ', response.data.results);\n this.setState({ \n resultList: response.data.results \n });\n });\n }, 1000);\n }", "function goNext() {\n //console.log(\"goNext: \" + options.currentPage);\n if (options.currentPage != options.total) {\n var p = options.currentPage + 1;\n loadData(p);\n setCurrentPage(p);\n options.currentPage = p;\n pageInfo();\n }\n }", "nextPage() {\n if (!this.isLastPage) {\n this.currentPageNumber++;\n }\n this.updateData();\n }", "function MachineLearning()\n{\n browser.webNavigation.onCompleted.addListener(details =>\n {\n if (this.curNavigation > this.trainingThreshold)\n {\n // We retrain our ML model on every `trainingThreshold` navigations\n exports.MlModel.fit();\n // Reset the counter\n this.curNavigation = 0;\n return;\n }\n this.curNavigation ++;\n });\n\n this.buildModel();\n}" ]
[ "0.5847996", "0.5783764", "0.57609385", "0.57466775", "0.574301", "0.5679681", "0.5621736", "0.5512493", "0.54536885", "0.5446247", "0.54402345", "0.5418041", "0.5387577", "0.5385201", "0.5332874", "0.53322786", "0.5317305", "0.53035533", "0.52753365", "0.5271592", "0.526864", "0.52633", "0.52577025", "0.5247533", "0.523713", "0.52238643", "0.52135956", "0.5207537", "0.5207484", "0.51802456", "0.5167574", "0.5161894", "0.5154847", "0.515007", "0.5146168", "0.51262015", "0.5125244", "0.512093", "0.5113825", "0.51078874", "0.5102764", "0.51024956", "0.5084805", "0.5080273", "0.5079024", "0.5072727", "0.5069863", "0.5047821", "0.50432235", "0.50357115", "0.5021611", "0.500453", "0.5000059", "0.49833924", "0.4978394", "0.49723285", "0.4960446", "0.49431857", "0.4939114", "0.4929318", "0.49289042", "0.49190065", "0.4918098", "0.49174565", "0.491312", "0.49124962", "0.4908415", "0.49073282", "0.4905635", "0.48954615", "0.48862106", "0.48846766", "0.4879882", "0.48797786", "0.48707744", "0.4870038", "0.48670536", "0.48651698", "0.48598456", "0.48563462", "0.48542964", "0.4835766", "0.48321986", "0.4825964", "0.4824606", "0.4818711", "0.48143393", "0.48117045", "0.48055744", "0.47940758", "0.47854057", "0.47840846", "0.47733843", "0.4767561", "0.47651085", "0.4750744", "0.47493604", "0.47465378", "0.47428966", "0.47404554" ]
0.6842976
0
Get the current weather for my location. Uses
async function getWeatherDetails() { // Hit the weather API const weatherApiUrl = 'https://api.openweathermap.org/data/2.5/forecast/daily?q=totnes&units=metric&cnt=1&appid=d94bcd435b62a031771c35633f9f310a'; const weatherResult = await logFetch(weatherApiUrl); // Update the temp const weatherTemperature = weatherResult.list[0].temp; temperature.innerHTML = weatherTemperature.day + ' ° C'; // Update the icon weatherIcon.innerHTML = mapWeatherIcon(weatherResult.list[0].weather[0].id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getWeather() {\n navigator.geolocation.getCurrentPosition(\n locationSuccess,\n locationError,\n {timeout: 15000, maximumAge: 60000}\n );\n}", "function getWeather() {\n var location = globals.location,\n usrInput = $('.input-div input').val() || '';\n\n getCityWeather(usrInput, location);\n getCityForecast(usrInput, location)\n\n }", "function getGeoWeather() {\n \tweather.getGeoWeather()\n\t\t.then((results) => {\n\t\t\tui.display(results);\n\t\t})\n\t\t.catch((err) => err);\n}", "function getWeather() {\n\tweather.getWeather()\n\t\t.then((results) => {\n\t\t\tui.display(results);\n\t\t})\n\t\t.catch((err) => err);\n}", "function getLocalWeather() {\n navigator.geolocation.getCurrentPosition(showPosition);\n}", "async getWeather() {\n const response = await fetch(`http://api.wunderground.com/api/${this.apiKey}/conditions/q/${this.state}/${this.city}.json`);\n\n const responseData = await response.json();\n\n return responseData.current_observation;\n }", "async getWeather() {\n const response = await fetch(`http://api.wunderground.com/api/${this.apiKey}/conditions/q/${this.state}/${this.city}.json`);\n\n const responseData = await response.json();\n\n return responseData.current_observation;\n }", "async getWeather() {\n const response = await fetch(`http://api.wunderground.com/api/${this.apiKey}/conditions/q/${this.state}/${this.city}.json`);\n\n const responseData = await response.json();\n\n return responseData.current_observation;\n }", "async getWeather() {\n const response = await fetch(`http://api.wunderground.com/api/${this.apiKey}/conditions/q/${this.state}/${this.city}.json`);\n\n const responseData = await response.json();\n\n return responseData.current_observation;\n }", "function getCurrentWeather() {\n \tvar dataObj = {\n \t\tlat: '',\n \t\tlon: '',\n \t\tAPPID: '923ac7c7344b6f742666617a0e4bd311',\n \t\tunits: 'metric'\n \t}\n }", "async getWeather() {\n const response = await this._getCall(`${this.#weatherApi}/weather?q=${this.city},${this.country}`);\n return await response.json();\n }", "async getWeather() {\n // Convert location to latitude and longitude using Google Maps geocoder\n const latLong = await this.getLatLong();\n const lat = latLong[0].geometry.location.lat();\n const lng = latLong[0].geometry.location.lng();\n\n // Get general weather API info for this location, including URLs for forecast, city name, etc.\n const weatherApiInfo = await (\n await fetch(`https://api.weather.gov/points/${lat},${lng}`)\n ).json();\n const forecastCity =\n weatherApiInfo.properties.relativeLocation.properties.city;\n const forecastState =\n weatherApiInfo.properties.relativeLocation.properties.state;\n\n // Get list of all weather stations in the area. Use the first station in the list.\n const observationStations = await (\n await fetch(weatherApiInfo.properties.observationStations)\n ).json();\n const weatherStation = observationStations.features[0].properties.name;\n\n // Get the current conditions\n const currentConditions = await (\n await fetch(\n `https://api.weather.gov/stations/${observationStations.features[0].properties.stationIdentifier}/observations/latest?require_qc=false`\n )\n ).json();\n\n // Get daily (7-day) forecast\n const dailyForecast = await (\n await fetch(weatherApiInfo.properties.forecast)\n ).json();\n\n // Get hourly forecast\n const hourlyForecast = await (\n await fetch(weatherApiInfo.properties.forecastHourly)\n ).json();\n\n // Return all this info and let the other module parse it and convert it\n return {\n forecastCity: forecastCity,\n forecastState: forecastState,\n weatherStationLoc: weatherStation,\n currentConditions: currentConditions.properties,\n dailyForecast: dailyForecast.properties,\n hourlyForecast: hourlyForecast.properties,\n };\n }", "function currentLocationWeather() {\n // get user's location from the browser\n navigator.geolocation.getCurrentPosition(geolocSuccess, geolocError);\n}", "function getLocation() {\n\tif (navigator.geolocation) {\n\t\t// 1. Get current position and set latitude and longitude accordingly\n\t\tnavigator.geolocation.getCurrentPosition((data) => {\n\t\t\tconst { latitude, longitude } = data.coords;\n\n\t\t\t// 2. Make GET request based on geolocation info and set HTML content based on response\n\t\t\tfetchWeather(latitude, longitude);\n\t\t});\n\t} else {\n\t\tmessage.innerHTML = 'Geolocation is not supported by this browser.';\n\t}\n}", "function getCondition() {\n // get current location\n $.getJSON(\n \"https://cors-anywhere.herokuapp.com/http://freegeoip.net/json/\",\n function(data) {\n lat = Math.round(data.latitude);\n long = Math.round(data.longitude);\n cityName = data.city;\n apiLink =\n \"https://cors-anywhere.herokuapp.com/http://api.openweathermap.org/data/2.5/weather?lat=\" +\n lat +\n \"&lon=\" +\n long +\n apiKey;\n\n getWeather(apiLink, cityName);\n }\n );\n}", "function getWeather()\n{\n\t!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];\n\t\tif(!d.getElementById(id)){js=d.createElement(s);\n\t\tjs.id=id;js.src='https://weatherwidget.io/js/widget.min.js';\n\t\tfjs.parentNode.insertBefore(js,fjs);}}(document,'script','weatherwidget-io-js');\n}", "function getLocation() {\n\t if (navigator.geolocation) {\n\t navigator.geolocation.getCurrentPosition(getWeather);\n\t } else {\n\t alert(\"Geolocation is not supported by this browser.\");\n\t }\n\t}", "function getLocation() {\n $.getJSON('https://ipapi.co/json', function(data) {\n currentRegion = data.region;\n currentCountry = data.country;\n currentLat = data.latitude;\n currentLong = data.longitude;\n \n //call the function getWeather and apply the data above to this function\n getWeather();\n });\n }", "function getWeather(location) {\n\t$.simpleWeather({\n\t\tlocation: location,\n\t\tunit: 'c',\n\t\tsuccess: function(weather) {\n\t\t\t$('.weather').html('<a href=\"' + weather.link + '\">' + weather.city + '</a>' + '</br>' + weather.currently + ', ' + weather.temp + '&deg;');\n\t\t},\n\t\terror: function(error) {\n\t\t\t$('.weather').html('Sorry, there has been a problem retrieving the weather information.');\n\t\t}\n\t});\n}", "function getWeather(location) {\n return fetch(`${webRoot}/weather?location=${location}`);\n}", "function updateWeather() {\n\t//log (\"updateWeather ()\");\n\t\n\tif (globalWeather == \"\") return;\n\tsuppressUpdates();\n\t\n\ttry\n\t{\n\t\tvar modTemp = 'f';\n\t\tvar modSpeed = 'mph';\n\t\tvar modDistance = 'mi';\n\t\tvar modPressure = 'in';\n\t\t\n\t\tunitTemp = \"F\";\n\t\tunitDistance = \"mi\";\n\t\tunitSpeed = \"mph\";\n\t\tunitPres = \"in\";\n\t\tunitMeasure = \"in\";\n\t\t\n\t\tif (preferences.unitsPref.value == 1) {\n\t\t\tmodTemp = 'c';\n\t\t\tmodSpeed = 'kph';\n\t\t\tmodDistance = 'km';\n\t\t\tmodPressure = 'mb';\n\t\t\t\n\t\t\tunitTemp = \"C\";\n\t\t\tunitDistance = \"km\";\n\t\t\tunitSpeed = \"km/h\";\n\t\t\tunitPres = \"mb\";\n\t\t\tunitMeasure = \"mm\";\n\t\t}\n\t\t\n\t\tvar xml = globalWeather;\n\t\tvar fetchedLocation = xml.evaluate(\"string(response/current_observation/display_location/full)\");\n\t\tvar fetchedCity = xml.evaluate(\"string(response/current_observation/display_location/city)\");\n\t\tpreferences.cityName.value = fetchedCity;\n\t\t\n\t var fetchedObservationTime = Math.round(xml.evaluate(\"string(response/current_observation/observation_epoch)\"));\n\t\tvar fetchedLocationTimeEpoch = Math.round(xml.evaluate(\"string(response/current_observation/local_epoch)\"));\n\t\tvar fetchedLocationTimeRfc822 = xml.evaluate(\"string(response/current_observation/local_time_rfc822)\");\n\t\t\n\t\tvar fetchedTemp = Math.round(xml.evaluate(\"string(response/current_observation/temp_\"+modTemp+\")\"));\n\t\tvar fetchedCode = xml.evaluate(\"string(response/current_observation/icon)\");\n\t\tvar fetchedCondPhrase = xml.evaluate(\"string(response/current_observation/weather)\");\n\t\t\n\t\tvar fetchedWindSpeedMph = xml.evaluate(\"string(response/current_observation/wind_mph)\");\n\t\tvar fetchedWindDir = xml.evaluate(\"string(response/current_observation/wind_dir)\");\n\t\tvar fetchedWindPoint = xml.evaluate(\"string(response/current_observation/wind_degrees)\");\n\t\tvar fetchedWindGustMph = xml.evaluate(\"string(response/current_observation/wind_gust_mph)\");\n\t\t\n\t\tvar fetchedWindSpeed = fetchedWindSpeedMph;\n\t\tvar fetchedWindGust = fetchedWindGustMph;\n\t\tif (preferences.unitsPref.value == 1) {\n\t\t\tfetchedWindSpeed = Math.round(milesToKm(fetchedWindSpeedMph));\n\t\t\tfetchedWindGust = Math.round(milesToKm(fetchedWindGustMph));\n\t\t}\n\t\t\n\t\tvar fetchedPrec = xml.evaluate(\"string(response/current_observation/precip_today_metric)\");\n\t\tvar fetchedHmid = xml.evaluate(\"string(response/current_observation/relative_humidity)\");\n\t\tvar fetchedVis = xml.evaluate(\"string(response/current_observation/visibility_\"+modDistance+\")\");\n\t\tvar fetchedPres = xml.evaluate(\"string(response/current_observation/pressure_\"+modPressure+\")\");\n\t\tvar fetchedDewPoint = Math.round(xml.evaluate(\"string(response/current_observation/dewpoint_\"+modTemp+\")\"));\n\t\t\n\t\tvar fetchedCurrentHour = xml.evaluate(\"string(response/moon_phase/current_time/hour)\");\n\t\tvar fetchedCurrentMinute = xml.evaluate(\"string(response/moon_phase/current_time/minute)\");\n\t\tvar fetchedSunsetHour = xml.evaluate(\"string(response/moon_phase/sunset/hour)\");\n\t\tvar fetchedSunsetMinute = xml.evaluate(\"string(response/moon_phase/sunset/minute)\");\n\t\tvar fetchedSunriseHour = xml.evaluate(\"string(response/moon_phase/sunrise/hour)\");\n\t\tvar fetchedSunriseMinute = xml.evaluate(\"string(response/moon_phase/sunrise/minute)\");\n\t\t\n\t\tvar fetchedForecastUrl = xml.evaluate(\"string(response/current_observation/forecast_url)\");\n\t\tweatherLink\t\t= fetchedForecastUrl == '' ? null : fetchedForecastUrl;\n\t\tforecastLink\t= weatherLink + '#conds_details_fct';\n\t\t\n\t\tif (fetchedTemp == null) fetchedTemp = \"\";\n\t\t\n\t\tvar localTime = new Date();\n\t\tvar localTimeTimezoneOffset = -localTime.getTimezoneOffset();\n\t\t\n\t\tobservationTime = new Date(fetchedObservationTime*1000);\n\t\t\n\t\tvar currentDatetime = new Date(localTime.getTime());\n\t\tcurrentDatetime.setHours(fetchedCurrentHour);\n\t\tcurrentDatetime.setMinutes(fetchedCurrentMinute);\n\t\t\n\t\tvar sunsetDatetime = new Date(localTime.getTime());\n\t\tsunsetDatetime.setHours(fetchedSunsetHour);\n\t\tsunsetDatetime.setMinutes(fetchedSunsetMinute);\n\t\t\n\t\tvar sunriseDatetime = new Date(localTime.getTime());\n\t\tsunriseDatetime.setHours(fetchedSunriseHour);\n\t\tsunriseDatetime.setMinutes(fetchedSunriseMinute);\n\t\t\n\t\t// Gets the time zone of the selected location\n\t\tvar fetchedLocationTimezoneHours = Number(fetchedLocationTimeRfc822.substr(-5,3));\n\t\tvar fetchedLocationTimezoneMinutes = Number(fetchedLocationTimeRfc822.substr(-2,2));\n\t\tfetchedLocationTimezoneOffset = fetchedLocationTimezoneHours * 60 + fetchedLocationTimezoneMinutes;\n\t\t\n\t\t//log(\"fetchedLocationTimeRfc822: \"+fetchedLocationTimeRfc822);\n\t\t//log(\"localTimeTimezoneOffset: \"+localTimeTimezoneOffset);\n\t\t//log(\"fetchedLocationTimezoneOffset: \"+fetchedLocationTimezoneOffset);\n\t\t\n\t\t// Calculates the offset between the local time and the time at the location\n\t\tlocalLocationTimeOffset = fetchedLocationTimezoneOffset - localTimeTimezoneOffset;\n\t\t\n\t\t//log(\"localLocationTimeOffset: \"+localLocationTimeOffset);\n\t\t\n\t\tvar dayTime = (currentDatetime.getTime() > sunriseDatetime.getTime() && currentDatetime.getTime() < sunsetDatetime.getTime()) ? 'day' : 'night';\n\t\t\n\t\tvar iconName = getWeatherIcon(fetchedCode, fetchedCondPhrase, dayTime);\n\t\t\n\t\tnewConditionLogText = '\\nMain: ' + fetchedCode + ': ' + fetchedCondPhrase + ' (' + iconName + '.png)';\n\t\tweather.src\t\t= \"Resources/WeatherIcons/\" + iconName + \".png\";\n\t\tweather.onClick = onClickWeather;\n\t\t\n\t\tif (fetchedTemp == \"N/A\") fetchedTemp = \"?\";\n\t\ttheTemp.data = fetchedTemp + \"°\";\n\t\ttheCity.data = theDate.data = theTime.data = \"\";\n\t\n\t\tif (preferences.showDate.value == 1 || preferences.showTime.value == 1) {\n\t\t\tupdateTime();\n\t\t}\n\t\t\n\t\tvar theCondition = \"\";\n\t\tvar theFeelsLike = \"\";\n\t\tvar theHigh = \"\";\n\t\tvar theLow = \"\";\n\t\tvar theDewPoint = \"\";\n\t\tvar theHumidity = \"\";\n\t\tvar visData = \"\";\n\t\tvar presChange = \"\";\n\t\tvar thePressure = \"\";\n\t\tvar windData = \"\";\n\t\n\t\tif ( fetchedCondPhrase == \"N/A\" ) {\n\t\t\ttheCondition = widget.getLocalizedString(\"weather.conditions.unknown\");\n\t\t} else {\n\t\t\ttheCondition = fetchedCondPhrase;\n\t\t}\n\t\n\t\t//if ( fetchedHmid == \"N/A\" ) {\n\t\t//\ttheHumidity = \"Humidity: Unknown\";\n\t\t//} else {\n\t\t//\ttheHumidity = \"Humidity: \" + fetchedHmid;\n\t\t//}\n\t\n\t\tif (fetchedVis == \"Unlimited\") {\n\t\t\tvisData = widget.getLocalizedString(\"weather.conditions.visibility.unlimited\");\n\t\t} else if (fetchedVis == \"N/A\") {\n\t\t\tvisData = widget.getLocalizedString(\"weather.conditions.visibility.unknown\");\n\t\t} else {\n\t\t\tvisData = widget.getLocalizedString(\"weather.conditions.visibility.absolute\") + \": \" + fetchedVis + \" \" + unitDistance;\n\t\t}\n\t\n\t\t//if ( fetchedPres == \"N/A\" ) {\n\t\t//\tthePressure = \"Pressure: Unknown\";\n\t\t//} else {\n\t\t//\tthePressure = \"Pressure: \" + fetchedPres + \" \" + unitPres;\n\t\t//}\n\t\t\n\t\t//if ( fetchedDewPoint == \"N/A\" ) {\n\t\t//\ttheDewPoint = \"Dewpoint: Unknown\";\n\t\t//} else {\n\t\t//\ttheDewPoint = \"Dewpoint: \" + fetchedDewPoint + \"°\" + unitTemp;\n\t\t//}\n\t\t\n\t\tif (fetchedWindDir.match(/calm/i)) {\n\t\t\twindData = widget.getLocalizedString(\"weather.conditions.winds.calm\");\n\t\t}\n\t\telse {\n\n\t\t\tif (fetchedWindDir.match(/var/i)) {\n\t\t\t\twindData = widget.getLocalizedString(\"weather.conditions.winds.variable\") + \" \";\n\t\t\t}\n\t\t\telse {\n\t\t\t var windDirNorth = 360/16;\n\t\t\t var windDirSpan = 360/8;\n\t\t\t var windDirCode;\n\t\t\t if (fetchedWindPoint < windDirNorth) windDirCode = 'N';\n\t\t\t else if (fetchedWindPoint < windDirNorth + windDirSpan) windDirCode = 'NE';\n\t\t\t else if (fetchedWindPoint < windDirNorth + windDirSpan * 2) windDirCode = 'E';\n\t\t\t else if (fetchedWindPoint < windDirNorth + windDirSpan * 3) windDirCode = 'SE';\n\t\t\t else if (fetchedWindPoint < windDirNorth + windDirSpan * 4) windDirCode = 'S';\n\t\t\t else if (fetchedWindPoint < windDirNorth + windDirSpan * 5) windDirCode = 'SW';\n\t\t\t else if (fetchedWindPoint < windDirNorth + windDirSpan * 6) windDirCode = 'W';\n\t\t\t else if (fetchedWindPoint < windDirNorth + windDirSpan * 7) windDirCode = 'NW';\n\t\t\t else windDirCode = 'N';\n\t\t\t windDirection = widget.getLocalizedString(\"weather.conditions.winds.directions.\" + windDirCode);\n\t\t\t\tlog(fetchedWindPoint + \"°/\" + fetchedWindDir + \" => \" + windDirCode + \" => \" + windDirection);\n windData = widget.getLocalizedString(\"weather.conditions.winds.wind_from\").replace(/%{direction}/, windDirection) + \" \";\n\t\t\t}\n\t\t\n\t\t\twindData += widget.getLocalizedString(\"weather.conditions.winds.at\") + \" \" + fetchedWindSpeed + \" \" + unitSpeed;\n\t\t\n\t\t\tif (fetchedWindGust != \"0\"){\n\t\t\t\twindData += \"\\n\" + widget.getLocalizedString(\"weather.conditions.winds.with_gusts_up_to\") + \" \" + fetchedWindGust + \" \" + unitSpeed;\n\t\t\t}\n\n\t\t}\t\n\t\t\n\t\tvar toolTipData =\ttheCondition + \"\\n\" +\n\t\t\t\t\t\ttheFeelsLike +\n\t\t\t\t\t\t\"\\n\" +\n\t\t\t\t\t\t//theHumidity + \"\\n\" +\n\t\t\t\t\t\tvisData + \"\\n\" +\n\t\t\t\t\t\t//thePressure + \"\\n\" +\n\t\t\t\t\t\t//theDewPoint + \"\\n\" +\n\t\t\t\t\t\twindData + \"\\n\" +\n\t\t\t\t\t\t\"\\n\" +\n\t\t\t\t\t\twidget.getLocalizedString(\"weather.conditions.updated_at\") + \" \" + formattedDateAndTime(observationTime, false);\n\t\n\t\tif (showToolTips) {\n\t\t\tweather.tooltip = toolTipData;\n\t\t} else {\n\t\t\tweather.tooltip = \"\";\n\t\t}\n\t\t\n\t\tupdateForecasts(dayTime);\n\t\n\t}\n\tcatch(error)\n\t{\n\t log(error);\n\t}\n\tresumeUpdates();\n}", "function getWeatherInfo () {\n\n const long = App.city.longitude;\n const lat = App.city.latitude;\n const url = \"https://api.darksky.net/forecast/8877941a6145fd159c584b8f95b52bb9/\" + lat + \",\" + long + \"?callback=?\";\n\n $.ajax({\n url: url,\n dataType: \"jsonp\",\n success: function (json) {\n App.weatherForecast = json;\n }\n }).done(function () {\n updateWeatherInfo(App.weatherForecast);\n });\n\n }", "function getCurrentWeather(point, tempUnitName, root, solarTimes, curLocale, now) {\n Log.debug('getCurrentWeather', point, tempUnitName, root, solarTimes)\n var weather = {\n type: 'Current'\n }\n\n for (var key in propertyMap) {\n var propConfig = propertyMap[key]\n var value = root[propConfig.id]\n if (value == undefined && root.voice) value = root.voice[propConfig.id]\n Log.debug('getCurrentWeather', key, propConfig, value)\n\n // Skip bad values, then apply any transform function\n if (!value || /N\\/?A/.test(value) || value === -999 || value === -9999) {\n continue\n }\n var propFn = propConfig.fn\n if (propFn) {\n value = propFn(value)\n }\n\n if (propConfig.name && propConfig.abbreviation) {\n value = Shared.unitBuilder(value, propConfig.abbreviation, propConfig.name)\n if (tempUnitName) {\n value = Shared.convertTemperature(value, tempUnitName)\n }\n }\n\n weather[key] = Shared.checkValid(value)\n }\n \n // basic info\n var conditionInfo = Shared.getConditionInfo(root.wx, curLocale)\n weather.condition = conditionInfo.condition\n weather.location = point\n weather.when = now.getDateTime()\n weather.icon = Shared.getIcon(conditionInfo.imageIconNumber, weather.when, solarTimes)\n\n // wind\n weather.wind = Shared.wind(root.detailinfo.wdir.value, root.detailinfo.wspd.value, curLocale)\n if(curLocale == 'zh-CN') {\n weather.windPowerCN = isNaN(root.detailinfo.wndpow.value) ? undefined : root.detailinfo.wndpow.value\n }\n // Relative humidity\n if (root.detailinfo.humi)\n weather.relativeHumidity = isNaN(root.detailinfo.humi.value) ? undefined : root.detailinfo.humi.value\n // UV index\n if (root.detailinfo.uvi) {\n weather.uvi = {\n value: isNaN(root.detailinfo.uvi.value) ? undefined : root.detailinfo.uvi.value,\n level: isNaN(root.detailinfo.uvi.value) ? undefined : root.detailinfo.uvi.value\n }\n if(curLocale == 'zh-CN'){\n var rawvalue = root.detailinfo.uvi.value\n var level \n if(rawvalue == '最弱') {\n value = 1\n level = 1\n } else if(rawvalue == '弱') {\n value = 2\n level = 2\n } else if(rawvalue == '中等') {\n value = 3\n level = 3\n } else if(rawvalue == '强') {\n value = 4\n level = 4\n } else if(rawvalue == '很强') {\n value = 5\n level = 5\n }\n weather.uvi = {\n value: value,\n level: level\n }\n }\n }\n \n // Visible Distance\n if (root.voice && root.voice.visi) {\n weather.visibleDistance = {\n value: isNaN(root.voice.visi) ? undefined : Shared.unitBuilder(root.voice.visi, \"km\", \"Kilometer\"),\n level: isNaN(root.voice.visi) ? undefined : root.voice.visi\n }\n }\n \n // sunrise & sunset time\n weather.sunrise = {\n time: solarTimes.sunrise.time\n }\n weather.sunset = {\n time: solarTimes.sunset.time\n }\n // moonrise & moonset time\n var lunarTimes = Astronomy.parseLunarTimes(root.moonrise, root.moonset, point, weather.when)\n weather.moonrise = {\n time: lunarTimes.moonrise.time\n }\n weather.moonset = {\n time: lunarTimes.moonset.time\n }\n \n // special cases where we mutate more than the value\n if (root.prec && root.prec >= 0) {\n weather.precipitation = Shared.unitBuilder(root.prec, \"mm\", \"Millimeter\")\n weather.rainfall = weather.precipitation\n weather.precipitationType = 'Rain'\n } else if (root.voice && root.voice.sprec && root.voice.sprec >= 0) {\n weather.precipitation = Shared.unitBuilder(root.voice.sprec, \"cm\", \"Centimeter\")\n weather.snowfall = weather.precipitation\n weather.precipitationType = 'Snow'\n }\n\n // Calculate temp range\n weather.dailyTemperatureRange = Shared.unitBuilder(weather.highTemperature.value - weather.lowTemperature.value, \n weather.lowTemperature.unit.abbreviation, weather.lowTemperature.unit.name)\n // All temperature & comment\n var temperatureComment = Shared.getTemperatureComment(weather.temperature.value, undefined, undefined, tempUnitName)\n var allTemperature = {\n now: weather.temperature,\n high: weather.highTemperature,\n low: weather.lowTemperature,\n comment: temperatureComment,\n tense: 'Present'\n }\n weather.allTemperature = allTemperature\n \n // Get data for air condition\n if (root.air) {\n if (root.air.pm10) {\n weather.fineDust = {\n value: isNaN(root.air.pm10.value) ? undefined : root.air.pm10.value,\n level: isNaN(root.air.pm10.level) ? undefined : root.air.pm10.level\n }\n }\n if (root.air.pm25) {\n weather.ultraFineDust = {\n value: isNaN(root.air.pm25.value) ? undefined : root.air.pm25.value,\n level: isNaN(root.air.pm25.level) ? undefined : root.air.pm25.level\n }\n }\n if (weather.fineDust && weather.ultraFineDust) {\n weather.dust = {\n fineDust: weather.fineDust,\n ultraFineDust: weather.ultraFineDust\n }\n }\n }\n if (root.voice && root.voice.khai) {\n var value = isNaN(root.voice.khai) ? undefined : root.voice.khai\n var level\n if (value > 250) {\n level = 4;\n } else if (value > 100) {\n level = 3;\n } else if (value > 50) {\n level = 2;\n } else {\n level = 1;\n }\n weather.CAI = {\n value: value,\n level: level\n }\n }\n \n // Get 'hasidx' and link\n var lifeIndex = {\n hasIndex: root.hasidx == '1' ? true : false,\n link: root.urls.index\n }\n weather.lifeIndex = lifeIndex\n \n // life index (carwash, pollen, discomfort)\n if (root.voice && root.voice.lifeindex) {\n if (root.voice.lifeindex.carwash)\n weather.carWashIndex = {\n value: isNaN(root.voice.lifeindex.carwash) ? undefined : root.voice.lifeindex.carwash,\n level: isNaN(root.voice.lifeindex.carwash) ? undefined : root.voice.lifeindex.carwash\n }\n if (root.voice.lifeindex.life_pollen) {\n weather.pollenIndex = {\n value: isNaN(root.voice.lifeindex.life_pollen) ? undefined : root.voice.lifeindex.life_pollen,\n level: isNaN(root.voice.lifeindex.life_pollen) ? undefined : root.voice.lifeindex.life_pollen\n }\n }\n if (root.voice.lifeindex.life_hum) {\n weather.discomfortIndex = {\n value: isNaN(root.voice.lifeindex.life_hum) ? undefined : root.voice.lifeindex.life_hum,\n level: isNaN(root.voice.lifeindex.life_hum) ? undefined : root.voice.lifeindex.life_hum\n }\n }\n }\n if(curLocale == 'zh-CN'){\n if (root.idx_carwash) {\n var rawvalue = root.idx_carwash\n var level \n if(rawvalue == '适宜') {\n value = 1\n level = 1\n } else if(rawvalue == '较适宜') {\n value = 2\n level = 2\n } else if(rawvalue == '较不宜') {\n value = 3\n level = 3\n } else if(rawvalue == '不宜') {\n value = 4\n level = 4\n }\n weather.carWashIndex = {\n value: value,\n level: level\n }\n }\n weather.clothIndex = root.idx_cloth\n weather.cosmeticIndex = root.idx_cosmetic\n weather.fishingIndex = root.idx_fishing\n weather.trafficIndex = root.idx_traffic\n weather.airdryingIndex = root.idx_dry\n weather.allergyIndex = root.idx_allergy\n weather.coldIndex = root.idx_cold\n }\n\n return weather\n}", "function geoLocationWeather() {\n navigator.geolocation.getCurrentPosition(function(position) {\n fetch(API + \"lat=\" + position.coords.latitude + \"&lon=\" + position.coords.longitude + \"&APPID=\" + KEY + \"&units=metric\")\n .then((resp) => resp.json())\n .then((data) => {\n getWeatherData(data);\n })\n .catch(function(error) {\n console.log(\"Wystąpił błąd: \" + error);\n })\n });\n }", "async function GetCurrentWeather() {\n let weatherService = new weather.WeatherService(process.env.MICRO_API_TOKEN);\n let rsp = await weatherService.now({\n location: \"london\",\n });\n console.log(rsp);\n}", "function getWeather(data) {\n setWeather(data);\n }", "function getWeather() {\n\t\tcity.innerHTML = `${forecast.city},` + `${forecast.country}`;\n\t\tweather.innerHTML = `${forecast.description}`;\n\t\ttemp.innerHTML = `Current Temp:${forecast.temperature}&degC`;\n\t\ticon.innerHTML = `<img src=\"assets/${forecast.image}.png\">`;\n\n\t\tsearch.value = '';\n\t}", "function getWeather(latitude, longitude) {\n var apiurl =\n \"https://fcc-weather-api.glitch.me/api/current?lat=\" +\n latitude +\n \"&lon=\" +\n longitude;\n /* Get the JSON and get the location, icon, weather type, and max, min, and current temperatures */\n $.getJSON(apiurl, function(json) {\n degrees = Math.ceil(json.main.temp);\n weathertype = json.weather[0].main;\n checkWeatherType(weathertype);\n $(\".location-section\").html(json.name);\n $(\".weathericon\").html('<img src=\"' + json.weather[0].icon + '\">');\n $(\".weathertype\").html(weathertype);\n $(\".temp_max\").html(json.main.temp_max + \"&deg;\");\n $(\".temp_min\").html(json.main.temp_min + \"&deg;\");\n $(\".degrees\").html(degrees + \"&deg;\");\n });\n }", "function getWeather(city, country, location) {\n const splitLocation = location.split(',');\n const lat = splitLocation[0];\n const lon = splitLocation[1];\n $.getJSON('https://fcc-weather-api.glitch.me/api/current?lat=' + lat + '&lon=' + lon, (json) => {\n $('#location').html(json.name + ', ' + json.sys.country);\n $('#temperature').html(Math.round(json.main.temp));\n $('#main-weather').html(json.weather[0].main);\n $('#weather-icon').attr('src', json.weather[0].icon);\n if (!json.weather[0].icon) {\n $('#image-container').css({\n display: 'none'\n });\n } else {\n $('#image-container').css({\n display: 'block'\n });\n }\n $('#weather-description').html(json.weather[0].description);\n $('#humidity').html(json.main.humidity);\n $('#pressure').html(json.main.pressure/10);\n $('#wind-speed').html(Math.floor(100*json.wind.speed*36/10)/100);\n if (!!json.wind.gust) {\n $('#wind-gusts').html(Math.floor(100*json.wind.gust*36/10)/100);\n $('#wind-gust-units').html('km/h');\n } else {\n $('#wind-gusts').html('none');\n $('#wind-gust-units').html('');\n }\n $('#wind-direction').html(getDirection(json.wind.deg));\n // The API uses unix UTC time for both sunrise and sunset, i.e., number of\n // seconds since 'the epoch', while the toLocaleTimeString() requires milliseconds\n $('#sunrise').html(new Date(json.sys.sunrise*1000).toLocaleTimeString());\n $('#sunset').html(new Date(json.sys.sunset*1000).toLocaleTimeString());\n\n if (json.weather[0].main === 'Rain' || json.weather[0].main === 'Drizzle') {\n setRain();\n } else if (json.weather[0].main === 'Snow') {\n setSnow();\n } else if (json.weather[0].main === 'Clear') {\n setSunny();\n } else if (json.weather[0].main === 'Thunderstorm') {\n setStorm();\n }\n });\n}", "async getGeoWeather() {\n\t\tconst geoResponse = await fetch(\n\t\t\t`https://api.opencagedata.com/geocode/v1/json?q=${this.lat}+${this.long}&key=${this.geoApiKey}`\n\t\t);\n\t\n\t\t// Convert longtitude latitude to city state\n\t\tconst geoResponseData = await geoResponse.json();\n\n\t\tlet city = geoResponseData.results[0].components.city;\n\t\tlet state = geoResponseData.results[0].components.state_code;\n\n\t\t// Pass city state to API to get current weather data\n\t\tconst response = await fetch(\n\t\t\t`https://api.openweathermap.org/data/2.5/weather?q=${city},${state},US&units=imperial&mode=json&appid=${this.apiKey}`\n\t\t);\n\n\t\tconst responseData = await response.json();\n\n \treturn responseData;\n\t}", "function getWeatherWithGeo() {\r\n getGeoLocationGoogle()\r\n .then(function(response) {\r\n var lat = response.location.lat;\r\n var lon = response.location.lng;\r\n\r\n var weatherLLQueryURL = \"http://api.openweathermap.org/data/2.5/weather?lat=\" + lat + \"&lon=\" + lon + \"&appid=\" + WeatherAPIKey;\r\n $.ajax({\r\n url: weatherLLQueryURL,\r\n method: \"GET\"\r\n }).done(function(response) {\r\n $(\".city\").html(\"<h1>\" + response.name + \" Weather Details</h1>\");\r\n $(\".wind\").html(\"Wind Speed: \" + response.wind.speed);\r\n $(\".humidity\").html(\"Humidity: \" + response.main.humidity);\r\n var f_temp = 9/5*(response.main.temp-273)+32;\r\n $(\".temp\").html(\"Temperature (F) \" + Math.floor(f_temp));\r\n\t\t\t\t\t\t\t\treturn response.weather[0].id;\r\n });\r\n })\r\n .catch(function(err) {\r\n //Failed! Move to user input function\r\n })\r\n\t}", "function getWeather(loc) {\n weather.getWeather()\n .then(result => {\n ui.paint(result, loc);\n })\n .catch(err => console.log(err));\n}", "function updateWeather() {\n\t\tconsole.log('updating weather data...')\n\t\tgetLocation();\n\t}", "async getWeather() {\t\n\t\tconst response = await fetch(\n\t\t\t`https://api.openweathermap.org/data/2.5/weather?q=${this.city},${this.state},US&units=imperial&mode=json&appid=${this.apiKey}`\n\t\t);\t\n\n\t\tconst responseData = await response.json();\n\n\t\treturn responseData;\n\t}", "function getGeoLocation() {\n \"use strict\";\n var cords = [];\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n cords.push(position.coords.latitude);\n cords.push(position.coords.longitude);\n //When you take them, use them to find the weather\n getWeatherFromCords(cords);\n });\n }\n}", "function GetGlobalWeather(cityname,apiuri,apitkn){\n let current = httpGet(apiuri+'weather?appid='+apitkn+'&units=metric&q='+cityname);\n console.log(current.cod);\n if(current.cod == 200){\n let city = current.name;\n let coords = current.coord;\n let daily = httpGet(apiuri+'onecall?appid='+apitkn+'&lat='+coords.lat+'&lon='+coords.lon+'&exclude=hourly,current,minutely&units=metric');\n return {'current':current,'daily':daily.daily,'city':city};\n }else{\n alert(cityname+' Not finded')\n }\n \n}", "function CitiesLocationWeather(cityLocation) {\n currentLat = mainCities[cityLocation].lat;\n currentLong = mainCities[cityLocation].lon;\n currentRegion = mainCities[cityLocation].region;\n currentCity = cityLocation.replace(/_/g, ' ');\n currentCountry = mainCities[cityLocation].country;\n \n //call the function getWeather and apply the data above to this function\n getWeather(); \n }", "async getWeather() {\n this.requestURL = this.city;\n const weatherResponse = await fetch(this.requestURL);\n const weatherData = await weatherResponse.json();\n return weatherData\n }", "function getGeolocation() {\r\n navigator.geolocation.getCurrentPosition(async function (position) {\r\n let lat = await position.coords.latitude;\r\n let long = await position.coords.longitude;\r\n getWeather(lat, long);\r\n });\r\n}", "function getWeather(){\n $.getJSON(api, function(data){\n var windDirectionData = data.current.wind_dir;\n var weatherIcon = data.current.condition.icon;\n var WindDirection = \"\";\n switch (windDirectionData){\n case \"N\":\n WindDirection = \"North\";\n break;\n case \"NbE\":\n WindDirection = \"North by East\";\n break;\n case \"NNE\":\n WindDirection = \"North-northeast\";\n break;\n case \"NEbN\":\n WindDirection = \"Northeast by north\";\n break;\n case \"NE\":\n WindDirection = \"Northeast\";\n break;\n case \"NEbE\":\n WindDirection = \"North\";\n break;\n case \"ENE\":\n WindDirection = \"East-northeast\";\n break;\n case \"EbN\":\n WindDirection = \"East by north\";\n break;\n case \"E\":\n WindDirection = \"East\";\n break;\n case \"EbS\":\n WindDirection = \"East by south\";\n break;\n case \"ESE\":\n WindDirection = \"East-southeast\";\n break;\n case \"SEbE\":\n WindDirection = \"Southeast by east\";\n break;\n case \"SE\":\n WindDirection = \"Southeast\";\n break;\n case \"SEbS\":\n WindDirection = \"Southeast by south\";\n break;\n case \"SSE\":\n WindDirection = \"South-southeast\";\n break;\n case \"SbE\":\n WindDirection = \"Sout by east\";\n break;\n case \"S\":\n WindDirection = \"South\";\n break;\n case \"SbW\":\n WindDirection = \"South by West\";\n break;\n case \"SSW\":\n WindDirection = \"South-southwest\";\n break;\n case \"SWbS\":\n WindDirection = \"Southwest by south\";\n break;\n case \"SW\":\n WindDirection = \"Soutwest\";\n break;\n case \"SWbW\":\n WindDirection = \"Southwest by west\";\n break;\n case \"WSW\":\n WindDirection = \"West-southwest\";\n break;\n case \"WbS\":\n WindDirection = \"West by south\";\n break;\n case \"W\":\n WindDirection = \"West\";\n break;\n case \"WbN\":\n WindDirection = \"West by North\";\n break;\n case \"WNW\":\n WindDirection = \"West-northwest\";\n break;\n case \"NWbW\":\n WindDirection = \"Northwest by west\";\n break;\n case \"NW\":\n WindDirection = \"Nortwest\";\n break;\n case \"NWbN\":\n WindDirection = \"Northwest by north\";\n break;\n case \"NNW\":\n WindDirection = \"North-northwest\";\n break;\n case \"NbW\":\n WindDirection = \"North by west\";\n break;\n }\n\n\n\n document.getElementById(\"pHumidity\").innerHTML = data.current.humidity + \" %\";\n document.getElementById(\"pWindDirection\").innerHTML = WindDirection;\n document.getElementById(\"iWeatherIcon\").src= data.current.condition.icon;\n document.getElementById(\"conditionText\").innerHTML = data.current.condition.text;\n });\n }", "function weatherLookup(){\n var urlCall = \"https://api.darksky.net/forecast/0d17dd4babb710edb8f4ce2adf5bb4c2/\"+$scope.loc.lat()+\",\"+$scope.loc.lng()+\"?callback=JSON_CALLBACK\";\n $http.jsonp(urlCall).then(function(results){\n $scope.summText = \"Report: \"+results.data.currently.summary;\n $scope.temp = results.data.currently.temperature+\" \"+String.fromCharCode(176) + \"F\";\n $scope.precipProb = results.data.currently.precipProbability*100+\"%\";\n $scope.humidity = results.data.currently.humidity*100+\"%\";\n $scope.windSpeed = results.data.currently.windSpeed+\" miles/hour\"\n if(!$scope.$$phase) {\n $scope.$apply();\n }\n });\n }", "async getWeather(){\n const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${this.location}&units=metric&appid=${this.apikey}`);\n\n const responseData = await response.json();\n\n return responseData;\n }", "function fetchCurrentWeather(location){\n fetch(`${baseOpenWeatherURL}/weather?q=${location}&appid=974057dc1632b35f6f14e11fe1ca1394`)\n .then(resp => resp.json())\n .then(latlonObj => getLatLonData(latlonObj))\n .catch(err => console.error(err));\n}", "async function getCurrentWeather() {\n setLoadingDashboard(true);\n try {\n let fetchStr = `${weatherApiURL}weather?q=${selectedCity}&appid=${weatherApiKey}&units=metric`;\n let weatherData = await parseFetch(fetchStr);\n setWeatherData(weatherData);\n } catch (e) {\n // console.error('get weather error', e)\n Alert.alert(\n 'Get current weather error!',\n e.toString()\n )\n } finally {\n setLoadingDashboard(false);\n }\n }", "function getWeather() {\n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + currentCity + \"&appid=\" + apiKey;\n $.ajax({\n url: queryURL,\n method: 'GET'\n }).then((response) => {\n //Update the current city weather\n currentCityWeather = response;\n //Update the page with weather information\n updateCurrentWeather();\n //Add the city to the recent cities up to 10\n addCityToRecent();\n //Get the cities uv index\n getUVIndex();\n //Get the 5 day forecast\n get5DayForecast();\n }).fail((error) => {\n $(\"<div class='error-div'><h1>\" + currentCity + \" was not found</h1></div>\").css({\n position: \"absolute\",\n width: \"100%\",\n height: \"100%\",\n left: 0,\n top: 0,\n zIndex: 1000000, // to be on the safe side\n background: '#ffffff',\n textAlign: 'center',\n verticalAlign: 'middle',\n }).appendTo($(\".current-weather\").css(\"position\", \"relative\"));\n \n feedbackTimeout = setTimeout(() => {\n $('.error-div').remove();\n }, 1500);\n })\n }", "function _getWeatherData(location){\n return WeatherResource.get({location: location}).$promise;\n }", "static async getWeather() {\n try {\n let pos = await Weather.getGeoData();\n const response = await fetch(`https://api.openweathermap.org/data/2.5/onecall?lat=${pos.lat}&lon=${pos.lon}&exclude=hourly,minutely,alerts&units=metric&appid=${APIKey}`);\n const data = await response.json();\n\t\t\tlet result = data.daily.slice(0,8)\n\t\t\treturn result;\n } catch(err) {\n console.log(err);\n }\n }", "function getWeather() {\n weather\n .getWeather()\n .then((results) => {\n // console.log(results);\n ui.paint(results);\n })\n .catch((err) => console.log(err));\n}", "function getWeather(location, lat, lng, pre_placename) {\n\t// Remove `.has-weather` class\n\tdocument.querySelector('.' + location).classList.remove('has-weather');\n\tdocument.querySelector('.quick-wrapper').classList.remove('has-weather');\n\n\t// Add loading indicator classes\n\tdocument.querySelector('html').classList.add('is-loading');\n\tdocument.querySelector('.' + location).classList.add('is-loading-' + location);\n\n\t// Set data-lat/data-lng attributes in case user changes units and we need to reinitiate search\n\tdocument.querySelector('.' + location).setAttribute('data-lat', lat);\n\tdocument.querySelector('.' + location).setAttribute('data-lng', lng);\n\n\t// Send request to Dark Sky\n\tvar unit = document.querySelector('[name=\"units-toggle\"]:checked').value;\n\tvar request_url = 'https://api.darksky.net/forecast/' + dark_sky_api_key + '/' + lat + ',' + lng + '?units=' + unit + '&exclude=alerts,hourly,minutely';\n\t\n\tJSONP({\n\t\turl: request_url,\n\t\tsuccess: function(data) {\n\t\t\t// We got the weather\n\t\t\textractWeather(location, lat, lng, pre_placename, data);\n\t\t},\n\t\terror: function(error) {\n\t\t\t// We have an error, let's stop showing loading indicators\n\t\t\tsetTimeout(function(){\n\t\t\t\tdocument.querySelector('html').classList.remove('is-loading');\n\t\t\t\tdocument.querySelector('.home').classList.remove('is-loading-home');\n\t\t\t\tdocument.querySelector('.away').classList.remove('is-loading-away');\n\t\t\t\tdocument.querySelector('.home').classList.remove('has-weather');\n\t\t\t\tdocument.querySelector('.away').classList.remove('has-weather');\n\t\t\t\tdocument.querySelector('.quick-wrapper').classList.remove('has-weather');\n\t\t\t}, 600);\n\t\t}\n\t});\n}", "async getWeather() {\n const response = await fetch(\n `https://api.openweathermap.org/data/2.5/weather?q=${this.city},${this.country}&units=metric&APPID=${this.apiKey}`\n );\n\n const responseData = await response.json();\n\n return responseData;\n }", "function getWeather() {\n\tfetch(apiCall, {\n\t\tmode: \"cors\",\n\t\theader: {\n\t\t\t\"Access-Control-Allow-Origin\": \"*\",\n\t\t\t\"Cache-Control\": \"no-store\",\n\t\t},\n\t})\n\t\t.then(function (response) {\n\t\t\tif (response.status !== 200) {\n\t\t\t\tconsole.log(\n\t\t\t\t\t\"Looks like there was a problem. Status Code: \" + response.status\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresponse.json().then(function (data) {\n\t\t\t\tcurrentWeather = data;\n\t\t\t\tconsole.log(\"Made with love in Stockholm 🏰🇪🇺\");\n\n\t\t\t\tclouds = map(currentWeather.clouds.all, 0, 100, 0, 90);\n\t\t\t\tcloudCoverage = map(currentWeather.clouds.all, 0, 100, 0, 1);\n\t\t\t\thumidity = map(currentWeather.main.humidity, 0, 100, 0, 50);\n\t\t\t\tpressure = map(currentWeather.main.pressure, 800, 1100, 10, 0);\n\t\t\t\ttemperature = map(currentWeather.main.temp, -30, 55, 0, 40);\n\t\t\t\ttempMax = map(currentWeather.main.temp_max, -30, 55, 0, 4);\n\t\t\t\ttempMin = map(currentWeather.main.temp_min, -30, 55, 0, 4);\n\t\t\t\tvisibility = map(currentWeather.visibility, 0, 10000, 0, 4);\n\t\t\t\twindDeg = map(currentWeather.wind.deg, 0, 360, 0, 360);\n\t\t\t\twindSpeed = map(currentWeather.wind.speed, 0, 14, 0.8, 5);\n\t\t\t\tcurrentTemperature = currentWeather.main.temp;\n\n\t\t\t\tdrawSunPath();\n\t\t\t});\n\t\t})\n\t\t.catch(function (err) {\n\t\t\tconsole.log(\"Fetch Error :-S\", err);\n\t\t});\n}", "async getWeather() {\n const response = await fetch(`http://cors-anywhere.herokuapp.com/https://api.darksky.net/forecast/${this.key}/${this.latitude},${this.longitude}`)\n const result = await response.json();\n\n const ocd = await fetch(`https://api.opencagedata.com/geocode/v1/json?key=${this.ocdkey}&q=${this.latitude}%2C${this.longitude}&language=en`)\n const ocdResult = await ocd.json();\n\n return {\n result,\n ocdResult,\n }\n }", "function currentWeather() {\n\t\t$.getJSON(\"https://ipapi.co/json\", function(location) {\n\t// get weather by location\n\t\t\tvar api = \"https://fcc-weather-api.glitch.me/api/current?lat=\" + location.latitude + \"&lon=\" + location.longitude;\n\t\t\tvar metric = \"&units=metric\";\n\t\t\tvar imperial = \"&units=imperial\";\n\t\t\tvar url = api + metric;\n\t\t\tvar conditions;\n\t\t\tvar weather;\n\n\t// write location in Title\t\n\t\t\t$(\"#localCity\").text(location.city + \", \" + location.region);\n\n\t// get temperature and conditions\t\n\t\t\t$.getJSON(url, function(weather) {\n\t\t\t\tconsole.log(weather);\n\t\t\t\timperial = Math.round(((weather.main.temp * 9) / 5) + 32); // get farenheight\n\t\t\t\tmetric = Math.round(weather.main.temp); // get celsius\n\t\t\t\tconditions = weather.weather[0].description; // get description of weather\n\t\t\t\t$(\"#currentTemp\").text(metric);\n\t\t\t\t$(\"#farenheight\").toggleClass('opClass');\n\t\t\t\t$(\"#celsius\").click(function() {\n\t\t\t\t\t$(\"#currentTemp\").text(metric);\t\t\t\t\t\t\t\n\t\t\t\t\t$(\"#farenheight\").toggleClass('opClass').removeClass('active');\t\t\n\t\t\t\t\t$(\"#celsius\").toggleClass('active').removeClass('opClass');\n\t\t\t\t});\n\t\t\t\t$(\"#farenheight\").click(function() {\n\t\t\t\t\t$(\"#currentTemp\").text(imperial);\n\t\t\t\t\t$(\"#celsius\").toggleClass('opClass').removeClass('active');\n\t\t\t\t\t$(\"#farenheight\").toggleClass('active').removeClass('opClass');\n\t\t\t\t});\t\t\n\t\t\t\t$(\".wi\").addClass(\"wi-owm-\" + weather.weather[0].id);// get icon of weather\n\t\t\t\t$(\"#weatherConditions\").hide();//hide icon and conditions by click\n\t\t\t\t$(\"#weatherIcon\").click(function() {\n\t\t\t\t\t$(\"#weatherConditions\").html(conditions).show();\n\t\t\t\t});\n\t\t\t\t$(\"#weatherConditions\").click(function() {\n\t\t\t\t\t$(\"#weatherConditions\").hide();\n\t\t\t\t});\n\t\t\t})\n\t\t})\n\t}", "async getWeather() {\r\n const weatherRespone = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${this.city}&appid=${this.apiKey}&units=metric`);\r\n const weather = await weatherRespone.json();\r\n\r\n return {\r\n weather\r\n };\r\n\r\n }", "async getWeather() {\n const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${this.city},${this.countryCode}&appid=${this.apiKey}`);\n\n const responseData = await response.json();\n\n return responseData;\n }", "function getCurrentWeather(){\n\n $.get(`https://api.openweathermap.org/data/2.5/weather?q=${destinationInfo.city},${destinationInfo.countryCode}&units=imperial&appid=b92bd67b1bf224690009c4ed1fc0e080`, function(results){\n\n // console.log(\"weather now\", results);\n //console.log(\"testttt\", results.weather[0].main);\n\n $(\"#todayIcon1, #todayIcon\").attr(\"src\", \"\");\n $(\"#todayIcon1, #todayIcon\").attr(\"src\", `https://openweathermap.org/img/w/${results.weather[0].icon}.png`);\n var date = moment(new Date()).format(\"MM/DD/YYYY\");\n $(\"#dayDate\").text(date);\n\n var temp = results.main.temp.toString();\n temp = temp.split(\".\");\n $(\"#currentTemp\").html(\"<span class='temp'>\" + temp[0] + \"&#8457;</span>\");\n\n $(\"#today, #today1\").text(results.weather[0].main);\n\n var hiTemp = results.main.temp_max.toString();\n hiTemp = hiTemp.split(\".\")\n $(\"#hiTempToday\").html(\"<span class='up'>&uarr;</span>\" + hiTemp[0] + \"&#8457;\");\n\n var lowTemp = results.main.temp_min.toString()\n lowTemp = lowTemp.split(\".\")\n $(\"#lowTempToday\").html(\"<span class='down'>&darr;</span>\" + lowTemp[0] + \"&#8457;\");\n })\n }", "function weatherVar(){\n //City Name\n cityName = weather.name;\n //Country Code\n country = weather.sys.country;\n //Weather ID\n weatherId = weather.weather[0].id;\n weatherDescription = weather.weather[0].description;\n //Temperature\n temp = round(weather.main.temp);\n //Get data based on last weather update\n epochUpdate = weather.dt;\n //Type of clouds\n Cloudiness = weather.clouds.all;\n //Wind Speed\n windSpeed = weather.wind.speed;\n windRatio = windSpeed / 200;\n windDegrees = weather.wind.deg;\n //Visibility & Humidity\n visibility = map(weather.visibility, 0, 10000, 0, 255);\n humidity = weather.main.humidity;\n}", "function getWeather() {\n\tlet query = \"https://api.openweathermap.org/data/2.5/weather?\" +\n\t\t\"q=\" + city + \"&units=imperial&appid=\" + OWM_API_KEY;\n\t\n\t$.ajax({\n\t\turl: query,\n\t\tmethod: \"GET\"\n\t}).done(data => {\n\t\tif (!data) return;\n\t\t\n\t\tif (data.main && data.main.temp && data.weather && data.weather.length > 0) {\n\t\t\t$('#temp').text(data.main.temp.toFixed(1) + '\\xB0' + 'F');\n\t\t\t\n\t\t\t$('#weather-main > i').remove();\n\t\t\t\n\t\t\tlet weatherData = data.weather[0];\n\t\t\t\n\t\t\tlet icon = $('<i>');\n\t\t\tlet time = weatherData.icon.endsWith('d') ? 'day-' : weatherData.icon.endsWith('n') ? 'night-' : '';\n\t\t\tlet iconClass = 'wi wi-owm-' + time + weatherData.id;\n\t\t\ticon.addClass(iconClass);\n\t\t\t$('#weather-main').prepend(icon);\n\t\t\t\n\t\t\tlet conditions = weatherData.description;\n\t\t\t$('#weather-conditions').text(titleCase(conditions));\n\t\t\t\n\t\t\t//console.log(data);\n\t\t}\n\t});\n\t\n\tquery = 'https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid in (select woeid from geo.places(1) where text=\"' + city.toLowerCase() + ', ' + state.toLowerCase() + '\")&format=json';\n\t$.ajax({\n\t\turl: query,\n\t\tmethod: \"GET\"\n\t}).done(data => {\n\t\tif (!data || !data.query || !data.query.results || !data.query.results.channel) return;\n\t\t\n\t\tconsole.log(data.query.results.channel);\n\t\t\n\t\tif (!data.query.results.channel.item || !data.query.results.channel.item.forecast) return;\n\t\t\n\t\tlet forecast = data.query.results.channel.item.forecast;\n\t\t\n\t\tif (forecast.length > 0) {\n\t\t\t$('#temp-high').text(forecast[0].high + '\\xB0' + 'F');\n\t\t\t$('#temp-low').text(forecast[0].low + '\\xB0' + 'F');\n\t\t\t\n\t\t\t$('#weather-weekly').empty();\n\t\t\tfor (let i = 1; i < 6 && i < forecast.length; i++) {\n\t\t\t\tlet col = $('<div>').addClass('col');\n\t\t\t\tlet panel = $('<div>').addClass('panel daily-forecast');\n\t\t\t\tlet dayWeather = forecast[i];\n\t\t\t\t\n\t\t\t\tpanel.append($('<p>').addClass('day').text(dayWeather.day.toUpperCase()));\n\t\t\t\tpanel.append($('<i>').addClass('wi wi-yahoo-' + dayWeather.code));\n\t\t\t\tpanel.append($('<p>').addClass('daily-high').text(dayWeather.high + '\\xB0' + 'F'));\n\t\t\t\tpanel.append($('<p>').addClass('daily-low').text(dayWeather.low + '\\xB0' + 'F'));\n\t\t\t\t\n\t\t\t\tcol.append(panel);\n\t\t\t\t$('#weather-weekly').append(col);\n\t\t\t}\n\t\t}\n\t\t\n\t});\n}", "function getWeatherData(currentLocation) {\n \n var key = '0a6009db83bbd52d398c4469e8b12292'; // my DarkSky API key\n \n // Canberra is the default location\n var defaultLocation = '-35.28346,149.12807';\n \n var weatherUrl = 'https://api.darksky.net/forecast/' + key + '/' + defaultLocation + '?units=auto';\n \n $.getJSON(weatherUrl, function(data) {\n \n // get current temperature data, round to nearest whole number and append to HTML\n var currentTemp = Math.round(data.currently.temperature);\n var temp = $('<h1>').html(currentTemp + '&deg;c');\n $('#current-temp').append(temp);\n \n // get 'feels like' temperature data, round to nearest whole number and append to HTML\n var feelsLike = Math.round(data.currently.apparentTemperature);\n var feels = $('<h2>').html('Feels like ' + feelsLike + '&deg;');\n $('#feels-like').append(feels);\n \n // get the icon and append to HTML\n var icon = data.currently.icon;\n var iconImage = ''; // to input icon weather image\n \n if (icon === 'clear-day') {\n iconImage = 'class=\"xl-icon\" src=\"images/clear-day.svg\"';\n addIcon();}\n if (icon === 'clear-night') {\n iconImage = 'class=\"m-icon\" src=\"images/clear-night.svg\"';\n addIcon();}\n if (icon === 'rain' || icon === 'sleet') {\n iconImage = 'class=\"l-icon\" src=\"images/rain.svg\"';\n addIcon();}\n if (icon === 'snow') {\n iconImage = 'class=\"l-icon\" src=\"images/snow.svg\"';\n addIcon();}\n if (icon === 'wind') {\n iconImage = 'class=\"s-icon\" src=\"images/wind.svg\"';\n addIcon();}\n if (icon === 'fog') {\n iconImage = 'class=\"l-icon\" src=\"images/fog.svg\"';\n addIcon();}\n if (icon === 'cloudy') {\n iconImage = 'class=\"m-icon\" src=\"images/cloud.svg\"';\n addIcon();}\n if (icon === 'partly-cloudy-day') {\n iconImage = 'class=\"m-icon\" src=\"images/partly-cloudy-day.svg\"';\n addIcon();}\n if (icon === 'partly-cloudy-night') {\n iconImage = 'class=\"s-icon\" src=\"images/partly-cloudy-night.svg\"';\n addIcon();}\n \n function addIcon() {\n $('#icon').html('<img ' + iconImage + 'alt=\"\">');\n };\n \n // get the current summary (string) and append to HTML\n var currentSummary = data.currently.summary;\n var summary = $('<p>').text(currentSummary);\n $('#icon').append(summary);\n \n // get the current time and change marker on the clock\n var time = new Date(data.currently.time*1000);\n var timeInHours = time.getHours(); // to get only the hours (accuracy not needed for the marker)\n \n var timeMarker = $('#time-container');\n \n // for 6am (to 6.59am)\n if (timeInHours == 6) {rotateTime(0);}\n // for 7am (to 7.59am)\n if (timeInHours == 7) {rotateTime(15);}\n // for 8am (to 8.59am)\n if (timeInHours == 8) {rotateTime(30);}\n // for 9am (to 9.59am)\n if (timeInHours == 9) {rotateTime(45);}\n // for 10am (to 10.59am)\n if (timeInHours == 10) {rotateTime(60);}\n // for 11am (to 11.59am)\n if (timeInHours == 11) {rotateTime(75);}\n // for 12pm (to 12.59pm)\n if (timeInHours == 12) {rotateTime(90);}\n // for 1pm (to 1.59pm)\n if (timeInHours == 13) {rotateTime(105);}\n // for 2pm (to 2.59pm)\n if (timeInHours == 14) {rotateTime(120);}\n // for 3pm (to 3.59pm)\n if (timeInHours == 15) {rotateTime(135);}\n // for 4pm (to 4.59pm)\n if (timeInHours == 16) {rotateTime(150);}\n // for 5pm (to 5.59pm)\n if (timeInHours == 17) {rotateTime(165);}\n // for 6pm (to 6.59pm)\n if (timeInHours == 18) {rotateTime(180);}\n // for 7pm (to 7.59pm)\n if (timeInHours == 19) {rotateTime(195);}\n // for 8pm (to 8.59pm)\n if (timeInHours == 20) {rotateTime(210);}\n // for 9pm (to 9.59pm)\n if (timeInHours == 21) {rotateTime(225);}\n // for 10pm (to 10.59pm)\n if (timeInHours == 22) {rotateTime(240);}\n // for 11pm (to 11.59pm)\n if (timeInHours == 23) {rotateTime(255);}\n // for 12am (to 12.59am)\n if (timeInHours == 0) {rotateTime(270);}\n // for 1am (to 1.59am)\n if (timeInHours == 1) {rotateTime(285);}\n // for 2am (to 2.59am)\n if (timeInHours == 2) {rotateTime(300);}\n // for 3am (to 3.59am)\n if (timeInHours == 3) {rotateTime(315);}\n // for 4am (to 4.59am)\n if (timeInHours == 4) {rotateTime(330);}\n // for 5am (to 5.59am)\n if (timeInHours == 5) {rotateTime(345);}\n \n // function for rotating the timeMarker based on the time\n function rotateTime(t) {\n timeMarker.css({'transform':'rotate(' + t + 'deg)'});\n }\n \n // get max temp and append to HTML\n var maxTemp = Math.round(data.daily.data[0].temperatureHigh);\n var max = $('<p>').html(maxTemp + '&deg;');\n $('#max-temp').append(max);\n \n // get the time the max temp occurs and change marker on clock\n var maxTempTime = new Date(data.daily.data[0].temperatureHighTime*1000);\n var highTime = maxTempTime.getHours(); // to get only the hours\n \n var maxMarker = $('#max-temp-container'); // to position the marker on the clock\n var maxStraighten = $('#max-temp'); // to straighten the square marker\n \n // for max temp at 10am (to 10.59am)\n if (highTime == 10) {rotateMaxTemp(60);}\n // for max temp at 11am (to 11.59am)\n if (highTime == 11) {rotateMaxTemp(75);}\n // for max temp at 12pm (to 12.59pm)\n if (highTime == 12) {rotateMaxTemp(90);}\n // for max temp at 1pm (to 1.59pm)\n if (highTime == 13) {rotateMaxTemp(105);}\n // for max temp at 2pm (to 2.59pm)\n if (highTime == 14) {rotateMaxTemp(120);}\n // for max temp at 3pm (to 3.59pm)\n if (highTime == 15) {rotateMaxTemp(135);}\n // for max temp at 4pm (to 4.59pm)\n if (highTime == 16) {rotateMaxTemp(150);}\n // for max temp at 5pm (to 5.59pm)\n if (highTime == 17) {rotateMaxTemp(165);}\n // for max temp at 6pm (to 6.59pm)\n if (highTime == 18) {rotateMaxTemp(180);}\n // for max temp at 7pm (to 7.59pm)\n if (highTime == 19) {rotateMaxTemp(195);}\n // for max temp at 8pm (to 8.59pm)\n if (highTime == 20) {rotateMaxTemp(210);}\n // for max temp at 9pm (to 9.59pm)\n if (highTime == 21) {rotateMaxTemp(225);}\n \n // function for rotating the maxMarker and maxStraighten based on the time it occurs\n function rotateMaxTemp(x) {\n maxMarker.css({'transform':'rotate(' + x + 'deg)'});\n maxStraighten.css({'transform':'rotate(' + (360-x) + 'deg)'});\n }\n \n // get min temp and append to HTML\n var minTemp = Math.round(data.daily.data[0].temperatureLow);\n var min = $('<p>').html(minTemp + '&deg;');\n $('#min-temp').append(min);\n \n // get the time the min temp occurs and change marker on clock\n var minTempTime = new Date(data.daily.data[0].temperatureLowTime*1000);\n var lowTime = minTempTime.getHours(); // to get only the hours\n \n var minMarker = $('#min-temp-container'); // to position the marker on the clock\n var minStraighten = $('#min-temp'); // to straighten the square marker\n \n // for min temp at 10pm (to 10.59pm)\n if (lowTime == 22) {rotateMinTemp(240);}\n // for min temp at 11pm (to 11.59pm)\n if (lowTime == 23) {rotateMinTemp(255);}\n // for min temp at 12am (to 12.59am)\n if (lowTime == 0) {rotateMinTemp(270);}\n // for min temp at 1am (to 1.59am)\n if (lowTime == 1) {rotateMinTemp(285);}\n // for min temp at 2am (to 2.59am)\n if (lowTime == 2) {rotateMinTemp(300);}\n // for min temp at 3am (to 3.59am)\n if (lowTime == 3) {rotateMinTemp(315);}\n // for min temp at 4am (to 4.59am)\n if (lowTime == 4) {rotateMinTemp(330);}\n // for min temp at 5am (to 5.59am)\n if (lowTime == 5) {rotateMinTemp(345);}\n // for min temp at 6am (to 6.59am)\n if (lowTime == 6) {rotateMinTemp(0);}\n // for min temp at 7am (to 7.59am)\n if (lowTime == 7) {rotateMinTemp(15);}\n // for min temp at 8am (to 8.59am)\n if (lowTime == 8) {rotateMinTemp(30);}\n // for min temp at 9am (to 9.59am)\n if (lowTime == 9) {rotateMinTemp(45);}\n \n // function for rotating the minMarker and minStraighten based on the time it occurs\n function rotateMinTemp(y) {\n minMarker.css({'transform':'rotate(' + y + 'deg)'});\n minStraighten.css({'transform':'rotate(' + (360-y) + 'deg)'});\n }\n \n // get sunrise time and change fill indicator behind clock\n var sunriseTime = new Date(data.daily.data[0].sunriseTime*1000);\n var sunrise = sunriseTime.getHours(); // to get only the hours\n\n var sunriseMarker = $('#sunrise-fill, #sunrise-fill-extend');\n \n // for sunrise at 3am (to 3.59am)\n if (sunrise == 3) {\n $('#remainder-fill').css({'background-size': '50% 10%'});\n $('#sunrise-fill-extend').css({'height':'0em'});\n rotateSunrise(-45);}\n // for sunrise at 4am (to 4.59am)\n if (sunrise == 4) {\n $('#sunrise-fill-extend').css({'height':'5em'});\n $('#sunrise-fill').addClass('no-after-element');\n rotateSunrise(-30);}\n // for sunrise at 5am (to 5.59am)\n if (sunrise == 5) {rotateSunrise(-15);}\n // for sunrise at 6am (to 6.59am)\n if (sunrise == 6) {rotateSunrise(0);}\n // for sunrise at 7am (to 7.59am)\n if (sunrise == 7) {rotateSunrise(15);}\n // for sunrise at 8am (to 8.59am)\n if (sunrise == 8) {\n $('#sunrise-fill-extend').css({'height':'15em'});\n rotateSunrise(30);}\n // for sunrise at 9am (to 9.59am)\n if (sunrise == 9) {\n $('#remainder-fill').css({'background-size':'100% 50%'});\n $('#sunrise-fill-extend').css({'height':'15em'});\n rotateSunrise(45);}\n // for sunrise at 10am (to 10.59am)\n if (sunrise == 10) {\n $('#remainder-fill').css({'background-size':'100% 50%'});\n $('#sunrise-fill-extend').css({'height':'20em'});\n rotateSunrise(60);}\n \n function rotateSunrise(sr) {\n sunriseMarker.css({'transform':'rotate(' + sr + 'deg)'});\n }\n \n // get sunset time and change fill indicator behind clock\n var sunsetTime = new Date(data.daily.data[0].sunsetTime*1000);\n var sunset = sunsetTime.getHours(); // to get only the hours\n \n var sunsetMarker = $('#sunset-fill, #sunset-fill-extend');\n \n // for sunset at 3pm (to 3.59pm)\n if (sunset == 15) {\n $('#remainder-fill').css({'background-size':'50% 60%'});\n $('#sunset-fill-extend').css({'height':'20em'});\n rotateSunset(-45);}\n // for sunset at 4pm (to 4.59pm)\n if (sunset == 16) {\n $('#sunset-fill-extend').css({'height':'15em'});\n rotateSunset(-30);}\n // for sunset at 5pm (to 5.59pm)\n if (sunset == 17) {rotateSunset(-15);}\n // for sunset at 6pm (to 6.59pm)\n if (sunset == 18) {rotateSunset(0);}\n // for sunset at 7pm (to 7.59pm)\n if (sunset == 19) {rotateSunset(15);}\n // for sunset at 8pm (to 8.59pm)\n if (sunset == 20) {\n $('#sunset-fill-extend').css({'height':'5em'});\n rotateSunset(30);}\n // for sunset at 9pm (to 9.59pm)\n if (sunset == 21) {\n $('#sunset-fill-extend').css({'height':'1em'});\n rotateSunset(45);}\n // for sunset at 10pm (to 10.59pm)\n if (sunset == 22) {\n $('#remainder-fill').css({'background-size':'50% 10%'});\n $('#sunset-fill-extend').css({'height':'0em'});\n $('#sunset-fill').css({'background-size':'37% 50%'}).addClass('no-after-element');\n rotateSunset(60);}\n \n function rotateSunset(st) {\n sunsetMarker.css({'transform':'rotate(' + st + 'deg)'});\n }\n \n // counting for ALL POSSIBILITIES within sunrise times of 3am to 10am (10.59am) and sunset times of 3pm to 10pm (10.59pm) and adjusting so dark blue 'night time' fill works\n if (sunrise == 3 && sunset == 22) {\n $('#sunrise-fill').css({'background-size': '37% 50%'}).addClass('no-after-element');\n $('div#ring > p').addClass('adjust-left-05em-after');}\n if (sunrise == 8 && sunset == 22) {\n $('#sunset-fill').removeClass('no-after-element');\n $('#remainder-fill').css({'background-size':'100% 33%'});}\n if (sunrise == 9 && sunset == 15) {\n $('#remainder-fill').css({'background-size':'60% 60%'});}\n if (sunrise == 9 && sunset == 22) {\n $('#sunset-fill').removeClass('no-after-element');\n $('#remainder-fill').css({'background-size':'100% 34%'});}\n if (sunrise == 10 && sunset == 15) {\n $('#remainder-fill').css({'background-size':'70% 60%'});\n $('#sunset-fill-extend').addClass('no-before-element');\n $('div#bottom').css({'z-index':'-1'});}\n if (sunrise == 10 && sunset == 16 || 17 || 18 || 19) {\n $('div#bottom').css({'z-index':'-1','height':'52%'});}\n if (sunrise == 10 && sunset == 20) {\n $('#sunrise-fill-extend').addClass('adjust-width30em');\n $('div#bottom').css({'z-index':'-2'})}\n if (sunrise == 10 && sunset == 21) {\n $('#sunrise-fill-extend').addClass('adjust-width20em');\n $('div#bottom').css({'z-index':'-2'});}\n if (sunrise == 10 && sunset == 22) {\n $('#sunrise-fill-extend').addClass('adjust-width20em');\n $('div#bottom').css({'z-index':'-2'});\n $('#remainder-fill').css({'background-size':'90% 37%'});}\n if (sunset == 15 && sunrise == 3 || 4) {\n $('div#bottom').css({'z-index':'-2'});}\n if (sunset == 15 && sunrise == 9 || 10) {\n $('div#bottom').css({'z-index':'-1'});}\n if (sunset == 16 && sunrise == 3 || 4) {\n $('div#bottom').css({'z-index':'-2'});}\n if (sunset == 16 && sunrise == 10) {\n $('div#bottom').css({'z-index':'-1'});}\n if (sunset == 17 && sunrise == 9 || 10) {\n $('div#bottom').css({'z-index':'-1'});}\n if (sunset == 18 && sunrise == 3 || 4) {\n $('div#bottom').css({'z-index':'-2'});}\n if (sunset == 18 && sunrise == 10) {\n $('div#bottom').css({'z-index':'-1'});}\n if (sunset == 19 && sunrise == 10) {\n $('div#bottom').css({'z-index':'-1','height':'49%'});}\n if (sunset == 21 && sunrise == 3) {\n $('div.blue-fill').addClass('no-after-element');}\n \n // make time marker yellow for daytime and dark blue for night time\n if (timeInHours < sunset && timeInHours >= sunrise) {\n $('div#time').addClass('daytime');\n } else {\n $('div#time').addClass('nightime');\n }\n \n // get wind speed and append to HTML\n var windSpeed = data.currently.windSpeed;\n var windRounded = parseFloat(Math.round(windSpeed*100)/100).toFixed(1); // round to nearest single decimal, but must show one decimal, so 3 = 3.0\n \n var wind = $('<p>').html(windRounded + '<span><br>km/h</span>');\n $('#wind').append(wind);\n \n // get current rain probabability and append to HTML\n var rainChance = data.currently.precipProbability;\n var rainPercentage = Math.round(rainChance*100);\n \n // for mobile rain (positioned as middle list item)\n var rain = $('<p>').text(rainPercentage + '%');\n $('#rain').append(rain);\n \n // for desktop (positioned as last list item)\n var desktopRain =$('<p>').html(rainPercentage + '%' + '<img id=\"rain-down\" src=\"images/down-arrow.svg\" alt=\"\">');\n $('#rain-desktop').append(desktopRain);\n \n // get humidity and append to HTML\n var humidityDecimal = data.currently.humidity;\n var humidityPercentage = Math.round(humidityDecimal*100);\n \n var humidity = $('<p>').text(humidityPercentage + '%');\n $('#humidity').append(humidity);\n \n // get hourly rain probability (so 12 hours including current shown in total) and append to HTML\n for (var i = 1; i < 12; i++) {\n var rainHourly = moment.unix(data.hourly.data[i].time).format('ha');\n var rainChanceHr = data.hourly.data[i].precipProbability;\n var rainPercentageHr = Math.round(rainChanceHr*100);\n var rainPrediction = $('<li>').html('<img class=\"mobile\" src=\"images/white-rain-drop.svg\" alt=\"rain\">' + '<br>' + '<span>' + rainHourly + '</span>' + '<br>' + rainPercentageHr + '%');\n $('#inner-rain ul').append(rainPrediction);\n }\n \n // get daily weather forecast for the next 7 days - day, icon, min temp & max temp\n for (var i = 1; i <= 7; i++) {\n var day = moment.unix(data.daily.data[i].time).format('dddd'),\n dailyIcon = data.daily.data[i].icon,\n dailyLow = Math.round(data.daily.data[i].temperatureMin),\n dailyHigh = Math.round(data.daily.data[i].temperatureMax);\n \n displayWeekly(day, dailyIcon, dailyLow, dailyHigh);\n };\n \n \n function displayWeekly(day, dailyIcon, dailyLow, dailyHigh) {\n var iconDaily, iconDailyDesktop; // get white icons (mobile) and blue icons (desktop)\n if (dailyIcon === 'clear-day') {iconDaily = 'images/white-clear-day.svg'; iconDailyDesktop = 'images/blue-clear-day.svg';}\n if (dailyIcon === 'rain' || dailyIcon === 'sleet') {iconDaily = 'images/white-rain.svg'; iconDailyDesktop = 'images/blue-rain.svg';}\n if (dailyIcon === 'snow') {iconDaily = 'images/white-snow.svg'; iconDailyDesktop = 'images/blue-snow.svg';}\n if (dailyIcon === 'wind') {iconDaily = 'images/white-wind.svg'; iconDailyDesktop = 'images/blue-wind.svg';}\n if (dailyIcon === 'fog') {iconDaily = 'images/white-fog.svg'; iconDailyDesktop = 'images/blue-fog.svg';}\n if (dailyIcon === 'cloudy') {iconDaily = 'images/white-cloud.svg'; iconDailyDesktop = 'images/blue-cloud.svg';}\n if (dailyIcon === 'partly-cloudy-day' || dailyIcon === 'partly-cloudy-night') {iconDaily = 'images/white-partly-cloudy-day.svg'; iconDailyDesktop = 'images/blue-partly-cloudy-day.svg';}\n // append the values to each cell of a row\n var row = $('<tr>');\n row.append('<td>' + day + '</td>');\n row.append('<td class=\"centre\">' + '<img class=\"mobile\" src=\"' + iconDaily + '\">' + '<img class=\"desktop\" src=\"' + iconDailyDesktop + '\">' + '</td>');\n row.append('<td class=\"right\">' + dailyLow + '&nbsp;</td>');\n row.append('<td class=\"right\">' + '/ ' + dailyHigh + '&deg;</td>');\n\n // append the tr info to the table\n $('#daily-forecast').append(row);\n };\n\n });\n}", "function getWeather() {\n return fetch(\"https://api.openweathermap.org/data/2.5/weather?q=barcelona&units=metric&appid=644a219f426a3224328405aa28d80b8f\").then(function (res) { return res.json(); })\n .then(function (res) {\n return res;\n });\n}", "function getWeatherCurrent(city, cityid, lat, lon)\n {\n var url = '';\n if (city == '' && cityid == 0) // query via lat/lon\n {\n url = '/weather/current/geo/' + lat + '/' + lon;\n }\n else if (city == '') // query via cityid\n {\n url = '/weather/current/cityid/' + cityid;\n }\n else \n {\n url = '/weather/current/cityname/' + city;\n }\n return axios.get(url);\n }", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(callingWeather);\n //adds a check that this function was initiated\n weather.check = true;\n }\n}", "async getCurrent(city) {\n const response = await fetch(\n `https://api.openweathermap.org/data/2.5/weather?q=${city}&units=${this.units}&APPID=${this.key}`\n );\n\n const data = await response.json();\n\n return data;\n }", "async getWeather() { \n\t\tconst response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${this.city},${this.zipcode}&APPID=9d0317c32366d083e6e35b438595476c&units=imperial`);\n\t\tconst responseData = response.json();\n\t\treturn responseData;\n\t}", "async getWeather(){\n // narrow response info to make it faster\n const exclude = '?exclude=minutely,hourly,daily,alerts,flags';\n const response = await fetch(`https://api.darksky.net/forecast/${this.apiKeyDS}/${this.lat},${this.lon}${exclude}`);\n const responseData = await response.json();\n return responseData;\n }", "function getCurrentWeather(){\r\n\r\n var curw = $(\"#w__current\");\r\n var url = \"http://api.openweathermap.org/data/2.5/find?q=\"+cfg.city+\"&units=metric&lang=ru&appid=\"+cfg.apikey;\r\n\r\n $.getJSON( url, function(data){\r\n\r\n // Icon\r\n var wicon = data.list[0].weather[0].id;\r\n var wicond = data.list[0].weather[0].description;\r\n curw.find(\".weather_icon\").html('<a title=\"'+wicond+'\"><i class=\"wi wi-owm-'+wicon+'\"></i></a>');\r\n\r\n // Wind icon\r\n var winddeg = data.list[0].wind.deg;\r\n var wwind = parseInt( ( winddeg < 180 ) ? winddeg + 180 : winddeg - 180 );\r\n curw.find(\".weather_wind\").html('<i class=\"wi wi-wind towards-'+wwind+'-deg\"></i>');\r\n\r\n // Wind speed\r\n var wwinds = data.list[0].wind.speed;\r\n curw.find(\".weather_ws\").html(wwinds+' м/с');\r\n\r\n // Temp\r\n var wtemp = Math.round(data.list[0].main.temp*10)/10;\r\n curw.find(\".weather_temp\").html(wtemp+'&deg;');\r\n\r\n // Pressure\r\n var wpres = parseInt(data.list[0].main.pressure/1.33322);\r\n curw.find(\".weather_pres\").html(wpres);\r\n\r\n // Humidity\r\n var whum = data.list[0].main.humidity;\r\n curw.find(\".weather_hum\").html(whum+' %');\r\n\r\n });\r\n\r\n}", "fetchCurrentWeather() {\n\t\tthis.fetchData(this.getUrl())\n\t\t\t.then(data => {\n\t\t\t\tif (!data) {\n\t\t\t\t\t// Did not receive usable new data.\n\t\t\t\t\t// Maybe this needs a better check?\n\t\t\t\t\tLog.error('No data');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.setFetchedLocation(`${data.liveweer[0].plaats}, Netherlands`);\n\t\t\t\tconst currentWeather = this.generateWeatherObjectFromCurrentWeather(data.liveweer[0]);\n\t\t\t\tthis.setCurrentWeather(currentWeather);\n\t\t\t})\n\t\t\t.catch(function(request) {\n\t\t\t\tLog.error(\"Could not load data ... \", request);\n\t\t\t})\n\t\t\t.finally(() => this.updateAvailable())\n\t}", "function getWeather(latitude, longitude) {\n\n\t // Get a free key at http://openweathermap.org/. Replace the \"Your_Key_Here\" string with that key.\n\t var OpenWeatherAppKey = \"70f5a077d1ec62b5ba2cd71feccd7702\";\n\n\t var queryString =\n\t 'http://api.openweathermap.org/data/2.5/weather?lat='\n\t + latitude + '&lon=' + longitude + '&appid=' + OpenWeatherAppKey + '&units=imperial';\n\n\t $.getJSON(queryString, function (results) {\n\n\t if (results.weather.length) {\n\n\t $.getJSON(queryString, function (results) {\n\n\t if (results.weather.length) {\n\n\t \tvar sunriseDate = new Date(results.sys.sunrise);\n\t var sunsetDate = new Date(results.sys.sunset);\n\n\t \t$('.weather').html(\n\t \t\t'desc '+results.name+'<br>'+\n\t \t\t'temp '+results.main.temp +'<br>'+\n\t \t\t'winds '+results.wind.speed +'<br>'+\n\t \t\t'sunrise '+sunriseDate.toLocaleTimeString() +'<br>'+\n\t \t\t'sunset '+sunsetDate.toLocaleTimeString()\n\n\t \t);\n\t }\n\n\t });\n\t }\n\t }).fail(function () {\n\t console.log(\"error getting location\");\n\t });\n\t}", "function getWeather(city, state){\n\tconsole.log('Getting Weather For '+city+'...');\n\n\tvar html = '';\n\t$.ajax({\n\t\turl:'http://api.wunderground.com/api/62d0e72f66a7de1a/conditions/q/'+state+'/'+city+'.json',\n\t\tdatatype:'jsonp',\n\t\tsuccess: function(parsed_json){\n\t\t\tconsole.log(parsed_json.current_observation);\n\n\t\t\tweather = parsed_json['current_observation']['weather'];\n\t\t\ttemperature_string = parsed_json['current_observation']['temperature_string'];\n\t\t\ticon_url = parsed_json['current_observation']['icon_url'];\n\n\t\t\thtml = '<h1 class=\"text-center\"><img src=\"'+icon_url+'\"> '+weather+'</h1>' +\n\t\t\t'<h2 class=\"text-center\">'+temperature_string+'</h2>';\n\n\t\t\t$('#weather').html(html);\n\t\t}\n\t});\n}", "function getWeather(){\r\n $.ajax('http://api.openweathermap.org/data/2.5/weather?q=sligo&appid=49afd2758cf9e7566e0cf2536a9d69ac&units=metric', {\r\n \r\n dataType: 'jsonp',\r\n success: function(json) {\r\n \r\n var temp = Number(json.main.temp.toFixed(0));\r\n $('div#city strong').text('Temp: '+temp +' C')\r\n $('div#icon').html(\"<img src='http://openweathermap.org/img/w/\" + json.weather[0].icon + \".png'>\");\r\n $('div#weather').text('Location: '+json.name + \" , \" + json.sys.country);\r\n \r\n }\r\n });\r\n }", "function getWeatherApi() {\n city = document.querySelector(\"#cityInput\").value;\n\n query = currentUrl + city + apiKey + \"&units=imperial\";\n\n fetch(query)\n .then((response) => response.json())\n .then((response) => {\n currentCity.textContent = response.name;\n currentTemp.textContent = \"Current Temp: \" + response.main.temp + \" F\";\n currentHumidity.textContent =\n \"Current Humidity: \" + response.main.humidity + \" %\";\n currentWindSpeed.textContent =\n \"Current Wind Speed: \" + response.wind.speed + \" MPH\";\n });\n}", "function getWeather(woeid) {\n fetch(`https://cors-anywhere.herokuapp.com/https://www.metaweather.com/api/location/${woeid}/`)\n .then(result => {\n // console.log(result);\n return result.json();\n })\n .then(data => {\n // console.log(data);\n const today = data.consolidated_weather[0];\n console.log(`Temperatures today in ${data.title} stay between ${today.min_temp} and ${today.max_temp}.`);\n })\n .catch(error => console.log(error));\n}", "function getWeather() {\n return new Promise(function(resolve, reject) {\n weather.find({search: 'Waterville, ME', degreeType: 'F'}, function(err, result) {\n if(err) {\n console.log(err)\n reject(new Error(\"weather\"));\n } else {\n const weatherInfo = {\n low: result[0].forecast[0].low,\n high: result[0].forecast[0].high,\n text: result[0].forecast[0].skytextday\n }\n resolve(weatherInfo)\n }\n })\n })\n}", "getWeather(){\n\n\t\t// Construct the API url to call\n\t\tlet url = 'https://api.openweathermap.org/data/2.5/weather?lat=' + this.state.latitude + '&lon=' + this.state.longitude + '&units=metric&appid=ce0cb4b99e8ee814c20a4f76609c8196';\n\t\t// console.log(url);\n\n\t\t// Call the API, and set the state of the weather forecast\n\t\tfetch(url)\n\t\t.then(response => response.json())\n\t\t.then(data => {\n\t\t\tconsole.log(data);\n\t\t\t// let tempData = JSON.stringify(data);\n\t\t\t\t// console.log(tempData);\n\t\t\t// alert(tempData);\n\t\t\tthis.processData(data);\n\t\t})\n\t\t.catch(function(error){\n\t\t\tconsole.log(error.message);\n\t\t\tthrow error.message;\n\t\t });\n\n\t\t// this.getForecast();\n\t}", "function getWeather(){\n $.get(\"https://api.openweathermap.org/data/2.5/onecall\", {\n appid: openWeatherApi,\n lat: markerPosition[1],\n lon: markerPosition[0],\n exclude: \"minutely, hourly, alerts, current\",\n units: \"imperial\"\n }).done((data) => {\n let coordinates = {\n lat: data.lat,\n lng: data.lon\n }\n console.log(data);\n $(\"#time\").html(sunMotion(data.current.dt + data.timezone_offset + baseOffset));\n\n reverseGeocode(coordinates, mapboxToken).then((result) => {\n $(\"#city\").text(result);\n });\n\n weatherSpot[0].innerHTML = \"\";\n\n for (let i = 0; i < data.daily.length; i++) {\n weatherSpot[0].innerHTML += forecast(data, i);\n }\n })\n }", "async function getWeatherDataByLocation() {\n /* Appel de la fonction getPosition pour récupérer la position */\n const location = await getPosition();\n /* Vérification de l'objet location */\n if (!location.coords) {\n Alert.alert(\n \"Impossible to find your location\",\n \"Please activate on your phone.\"\n );\n return;\n }\n const coords = location.coords;\n \n const response = await fetch(\n `http://api.openweathermap.org/data/2.5/weather?lat=${coords.latitude}&lon=${coords.longitude}&appid=0b626d564aefeb00bdbd2c294ee1df75&units=metric`\n );\n /* reads object JSON */\n const data = await response.json();\n /* store data in weather const */\n setWeather(data);/* \n console.log(data); */\n }", "async getWeather(){\n const response = await fetch(`http://api.openweathermap.org/data/2.5/weather?q=${this.city},${this.state},us&appid=${this.apikey}`);\n\n const responseJSON = await response.json();\n return responseJSON;\n }", "function getMyLocation() {\n if(navigator.geolocation)\n navigator.geolocation.getCurrentPosition(function(position){\n console.log(position);\n var lat = position.coords.latitude;\n var lon = position.coords.longitude;\n fetch(\n 'https://api.openweathermap.org/data/2.5/weather?lat=' + lat + '&lon=' + lon + '&units=imperial&exclude=minutely,hourly,alerts&appid=f7e68c78a6c0589ffc5c75fdd1fe6b01')\n .then(function (response) {\n response.json()\n .then(function (data) {\n console.log(\"Weather data: \", data);\n\n weatherIcon.src = 'https://openweathermap.org/img/wn/' + data.weather[0].icon + '.png';\n cityName.textContent = data.name;\n temp.textContent = Math.floor((data.main.temp - 32) * 5/ 9) +\" °C\";\n conditions.textContent = data.weather[0].description;\n })\n })\n console.log(\"Coordinates: \", lat, lon);\n });\n else {\n console.log(\"Geolocation not available on device\");\n }\n}", "function getWeather(){\n const city = cityInput.value;\n cityInput.value = '';\n\n if(city === ''){\n ui.showErrorMessage('Please Enter a City')\n return\n }\n\n //Change City location\n weather.setCity(city);\n\n //Fetch data\n weather.fetchWeatherData();\n}", "function getCurrentWeather(cityName) {\n var queryURL = \"\"; // The query to pass to OpenWeeather\n var currentWeatherResponse = null; // The response for the current weather conditions\n var lon = \"\"; // The city's longitude\n var lat = \"\"; // The city's latitude\n var queryUVURL = \"\"; // The query to pass to OpenWeather for the UV\n var currentWeatherUVResponse = null;\n\n if (cityName !== null) {\n // Get the current weather conditions\n\n // Form the queryURL\n queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + cityName + \"&units=imperial&appid=16460027affaf1e3d6736c85f67318ba\";\n \n // Make an AJAX call to get the current weather conditions \n // from OpenWeather\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n currentWeatherResponse = response;\n\n // Get the city longitude and latitude\n lon = currentWeatherResponse.coord.lon;\n lat = currentWeatherResponse.coord.lat;\n\n queryUVURL = \"https://api.openweathermap.org/data/2.5/uvi?appid=16460027affaf1e3d6736c85f67318ba&lat=\" + lat + \"&lon=\" + lon;\n\n $.ajax({\n url: queryUVURL,\n method: \"GET\"\n }).then(function(uVResponse) {\n currentWeatherUVResponse = uVResponse;\n\n showCurrentWeatherCondiditons(currentWeatherResponse, currentWeatherUVResponse);\n });\n });\n }\n }", "function getWeather() {\n let temperature = document.getElementById(\"temperature\");\n let description = document.getElementById(\"description\");\n let location = document.getElementById(\"location\");\n\n let api = \"https://api.openweathermap.org/data/2.5/weather\";\n let apiKey = \"08835f670ab2327e9a93f3f584c2a946\";\n\n temperature.innerHTML = \"Locating...\";\n\n navigator.geolocation.getCurrentPosition(success, error);\n\n function success(position) {\n latitude = position.coords.latitude;\n longitude = position.coords.longitude;\n\n let urlW =\n api +\n \"?lat=\" +\n latitude +\n \"&lon=\" +\n longitude +\n \"&appid=\" +\n apiKey +\n \"&units=imperial\";\n\n fetch(urlW)\n .then(response => response.json())\n .then(data => {\n console.log(data);\n let temp = data.main.temp;\n // temperature.innerHTML = \"Today it is \" + temp + \"° F and \" + data.weather[0].main + \" in \" + data.name;\n /* temperature.innerHTML = temp + ;\n location.innerHTML =\n data.name /*+ \" (\" + latitude + \"°, \" + longitude + \"°)\";\n description.innerHTML = data.weather[0].main; */\n var celcius = Math.round((temp - 32) * (5/9));\n if (data.sys.country == \"US\") {\n temperature.innerHTML = \"Today it is \" + temp + \"° F and \" + data.weather[0].main + \" in \" + data.name;\n } else {\n temperature.innerHTML = \"Today it is \" + celcius + \"° C and \" + data.weather[0].main + \" in \" + data.name;\n }\n });\n }\n\n function error() {\n location.innerHTML = \"Unable to retrieve your location\";\n }\n}", "function getCurrentLocation() {\n lat = localStorage.getItem(\"lat\");\n long = localStorage.getItem(\"long\");\n if (!lat || !long)\n window.navigator.geolocation.getCurrentPosition(processLocation);\n else getWeatherData();\n}", "async getWeather() {\n //Weather API\n let url = \"https://api.darksky.net/forecast/\" + API_KEY + \"/\" +\n this.state.latitutde + \",\" + this.state.longitude;\n \n //Location API\n let loc = \"https://us1.locationiq.com/v1/reverse.php?key=\" + API_LOCATION +\"&lat=\"+ this.state.latitutde +\"&lon=\"\n + this.state.longitude + \"&format=json\";\n\n\n //Get Weather Details from Weather API\n const response = await fetch(url)\n const json = await response.json();\n this.setState({ currentForecast: json.currently });\n this.setState({ hourlyForecast: json.hourly });\n this.setState({ dailyForecast: json.daily });\n\n //Get City Name from Location API\n const responseCity = await fetch(loc)\n const jsonCity = await responseCity.json();\n this.setState({locationJson: jsonCity.address});\n }", "function getCityWeather(usrInput, location) {\n var locationArry = usrInput.split(',');\n city = locationArry[0] || '';\n country = locationArry[1] || '';\n var countryCode = getCountryCode(country, globals.countryISO);\n\n $.ajax({\n type: 'GET',\n url: \"http://api.openweathermap.org/data/2.5/weather\",\n data: (usrInput) ? {\n q: city + ',' + countryCode,\n units: \"metric\",\n type: 'accurate',\n APPID: globals.API_KEY\n } : {\n APPID: globals.API_KEY,\n lat: location.lat,\n lon: location.lon,\n units: \"metric\"\n },\n dataType: 'jsonp',\n jsonpCallback: \"displayWeatherInfo\"\n\n });\n }", "function getWeather() {\n $.getJSON('//api.openweathermap.org/data/2.5/weather?lat=' + lat + '&lon=' + lon + '&units=' + units + '&APPID=daf287f74f0dd8c394d7fd3e4e554041', function(json) {\n var city = json.name;\n temp = Math.round(json.main.temp);\n var description = json.weather[0].description;\n var weatherIcon = json.weather[0].icon;\n tempUnit = '&#8457';\n htmlTempUnit = '<sup>&deg</sup>' + tempUnit;\n htmlTemp = '<p>' + temp + tempUnit + '</p>';\n var htmlIcon = '<img src=\"http://openweathermap.org/img/w/' + weatherIcon + '.png\">';\n var htmlDescription = '<p>' + description + '</p>';\n var htmlCity = '<p>' + city + '</p>';\n\n $('#temp').html(htmlTemp);\n $('#weather').html(description);\n $('#location').html(htmlCity);\n $('#icon').html(htmlIcon);\n });\n }", "function getLocation(locale) {\n const URL = \"https://api.weather.gov/points/\" + locale; \n // NWS User-Agent header (built above) will be the second parameter \n fetch(URL, idHeader) \n .then(function(response){\n if(response.ok){ \n return response.json(); \n } \n throw new ERROR('Response not OK.');\n })\n .then(function (data) { \n // Let's see what we got back\n console.log('Json object from getLocation function:'); \n console.log(data);\n // Store data to localstorage \n storage.setItem(\"locName\", data.properties.relativeLocation.properties.city); \n storage.setItem(\"locState\", data.properties.relativeLocation.properties.state); \n \n // Next, get the weather station ID before requesting current conditions \n // URL for station list is in the data object \n let stationsURL = data.properties.observationStations;\n let forecastHourly= data.properties.forecastHourly; \n // Call the function to get the list of weather stations\n getStationId(stationsURL); \n getHourly(forecastHourly);\n }) \n .catch(error => console.log('There was a getLocation error: ', error)) \n} // end getLocation function", "function getWeather(latitude, longitude) {\n\n // Get a free key at http://openweathermap.org/. Replace the \"Your_Key_Here\" string with that key.\n var OpenWeatherAppKey = \"96e7ff24a18c73acb06403e14bc0b88c\";\n\n var queryString =\n 'http://api.openweathermap.org/data/2.5/weather?lat='\n + \"35&lon=139appid=\" + OpenWeatherAppKey + '&units=imperial';\n alert(queryString);\n $.getJSON(queryString, function (results) {\n\n if (results.weather.length) {\n\n $.getJSON(queryString, function (results) {\n\n if (results.weather.length) {\n console.log(results.name);\n console.log(results.main.temp);\n console.log(results.main.speed);\n $('#description').text(\"Location: \" + results.name);\n $('#temp').text(\"Temperature in Fahrenheit: \"+ results.main.temp);\n $('#wind').text(\"Wind speed: \"+ results.wind.speed);\n $('#humidity').text(\"Humidity: \" + results.main.humidity);\n $('#visibility').text(\"Visibility: \" +results.weather[0].main);\n\n var sunriseDate = new Date(results.sys.sunrise);\n $('#sunrise').text(sunriseDate.toLocaleTimeString());\n\n var sunsetDate = new Date(results.sys.sunrise);\n $('#sunset').text(sunsetDate.toLocaleTimeString());\n }\n\n });\n }\n }).fail(function () {\n alert(\"error getting location\");\n });\n window.location.href = '#weather';\n}", "async getWeather() {\n const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${this._city},${this._state}&appid=${this._apiKey}&units=metric`)\n\n const responseData = await response.json();\n\n return responseData; //todo !!!\n }", "function getWeatherData() {\n\n var url = 'http://api.openweathermap.org/data/2.5/weather?lat=' + latitude + '&lon=' + // build query url.\n longitude + '&APPID=936e860c72edb8cb527707e7d59da1ea' +\n '&units=' + countryUnits + '&preventCache=' + new Date(); // build query url\n\n $.getJSON(url, null, function(json, textStatus) {\n\n console.log(\"weather info \" + JSON.stringify(json) + \"response Satus is \" + textStatus);\n processresponse(json);\n\n });\n }", "function getLocation(city) {\n // fetching current conditions\n\n var apiUrl = 'https://api.openweathermap.org/data/2.5/weather?q=' + city + '&appid=a3be7588e2f22d761077e844f13fff0c&units=imperial';\n fetch(apiUrl)\n .then(function(response) {\n if (response.ok) {\n //console.log(response);\n // JSON parse\n response.json().then(function(data) {\n console.log(data)\n getForecast(data.coord.lat, data.coord.lon)\n })\n } else {\n MaterialDialog.alert('Error: ' + response.statusText);\n }\n }).catch(function(error) {\n MaterialDialog.alert('Unable to getLocation: Invalid Connection');\n });\n}", "function Weather() {\r\n let tempt = document.getElementById(\"temperature\");\r\n let location = document.getElementById(\"location\");\r\n let descrp = document.getElementById(\"description\");\r\n\r\n\r\n let api = \"https://api.openweathermap.org/data/2.5/weather\";\r\n let apiKey = \"d65154c997cc0b7f4bbe256641dec1a2\";\r\n location.innerHTML = \"Locating your Location...\";\r\n\r\n navigator.geolocation.getCurrentPosition(passed, fault);\r\n\r\n function passed(position) {\r\n latitude = position.coords.latitude;\r\n longitude = position.coords.longitude;\r\n\r\n let url = api + \"?lat=\" + latitude + \"&lon=\" + longitude + \"&appid=\" + apiKey + \"&units=metric\";\r\n\r\n fetch(url)\r\n .then(response => response.json())\r\n .then(data => {\r\n console.log(data);\r\n let temp = data.main.temp;\r\n tempt.innerHTML = temp + \"° C\";\r\n location.innerHTML =\r\n data.name + \" (\" + latitude + \"°, \" + longitude + \"°)\";\r\n descrp.innerHTML = data.weather[0].main;\r\n });\r\n }\r\n\r\n function fault() {\r\n location.innerHTML = \"Unable to retrieve your location\";\r\n }\r\n}", "function currentWeatherCall() {\n var queryURL =\n `https://api.openweathermap.org/data/2.5/weather?q=${city},usa&units=imperial&appid=${key}`;\n console.log(queryURL);\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n // Create a table to hold weather data on page.\n var table = $(\"#weather\");\n $(\"#current-weather\").html(\"<b> Current Weather </b>\");\n // Adding temperature to page.\n var currentTemp = $(\"<tr>\").text(\"Temperature: \" + (Math.round(response.main.temp)) + String\n .fromCharCode(176) + \" F\");\n table.append(currentTemp);\n // Adding wind speed to page.\n var windSpeed = $(\"<tr>\").text(`Wind Speed: ${Math.round(response.wind.speed)} mph`);\n table.append(windSpeed);\n // Calling function to calculate wind direction.\n calcWindDir(response.wind.deg);\n // Adding wind direction to page.\n var windDir = $(\"<tr>\").text(`Wind Direction: ${windDirection}`);\n table.append(windDir);\n // Adding humidity to page.\n var humid = $(\"<tr>\").text(`Humidity: ${response.main.humidity}%`);\n table.append(humid);\n });\n }", "function getLocation(locale) {\n const URL = \"https://api.weather.gov/points/\" + locale;\n // NWS User-Agent header (built above) will be the second parameter \n fetch(URL, idHeader)\n .then(function (response) {\n if (response.ok) {\n return response.json();\n }\n throw new ERROR('Response not OK.');\n })\n .then(function (data) {\n // Let's see what we got back\n console.log('Json object from getLocation function:');\n console.log(data);\n\n let hourlyURL = data.properties.forecastHourly;\n let hourlyData = getHourly(hourlyURL);\n\n // Store data to localstorage \n storage.setItem(\"locName\", data.properties.relativeLocation.properties.city);\n storage.setItem(\"locState\", data.properties.relativeLocation.properties.state);\n\n // Next, get the weather station ID before requesting current conditions \n // URL for station list is in the data object \n let stationsURL = data.properties.observationStations;\n // Call the function to get the list of weather stations\n getStationId(stationsURL);\n\n getForecast(data.properties.forecast);\n })\n\n .catch(error => console.log('There was a getLocation error: ', error))\n} // end getLocation function", "function getLocation(){\n\tconsole.log('Getting Users Location...');\n\n\tnavigator.geolocation.getCurrentPosition(function(position){\n\t\tconsole.log(1111111111111111);\n\t\tvar lat = position.coords.latitude;\n\t\tvar lon = position.coords.longitude;\n\t\tvar city = '';\n\t\tvar state = '';\n\t\tvar html = '';\n\n\t\t$.ajax({\n\t\t\turl: 'https://maps.googleapis.com/maps/api/geocode/json?latlng='+lat+','+lon,\n\t\t\tdatatype: 'jsonp',\n\t\t\tsuccess: function(response){\n\t\t\t\tcity = response.results[0].address_components[2].long_name;\n\t\t\t\tstate = response.results[0].address_components[4].short_name;\n\n\t\t\t\thtml = '<h1>'+city+', '+state+'</h1>';\n\n\t\t\t\t$('#myLocation').html(html);\n\n\t\t\t\t// Get Weather Info\n\t\t\t\tgetWeather(city, state);\n\n\t\t\t\t$('#show_more_weather').click(function(e){\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t// Close Dropdown Menu\n\t\t\t\t$('.navbar-toggle').click();\n\n\t\t\t\t\tgetMoreWeather(city, state);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}, function(err){\n\t\tconsole.warn('ERROR(' + err.code + '): ' + err.message);\n\t});\n}", "function getCurrentWeather () {\n\n var key = \"2fd6a7c1addf009b30af95d20e54bde2\";\n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + searchCity + \"&units=imperial&appid=\" + key;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n // console.log(response);\n currentWeatherObj = response\n currentWeatherIcon = currentWeatherObj.weather[0].icon;\n // console.log(currentWeatherIcon);\n displayCurrentWeather();\n cityLongited = currentWeatherObj.coord.lon;\n cityLatitude = currentWeatherObj.coord.lat;\n getUVIndex();\n\n\n });\n}", "function getWeather() {\n function success(position) { //position passed in from call to geolocator api\n document.getElementById('lat').innerHTML = position.coords.latitude; //store lat via html element\n document.getElementById('long').innerHTML = position.coords.longitude; //store long via html element\n var lat = document.getElementById('lat').innerHTML //get stored data for use\n var lon = document.getElementById('long').innerHTML //get stored data for use\n const key = '1a1d6997558d87f7f7526a9681af9b3a'; //api key as variable for ease of use\n var api_link = 'https://api.openweathermap.org/data/2.5/weather?lat=' + lat + '&lon=' + lon + '&appid=' + key; //OpenWeatherMap api link\n fetch(api_link).then(response => response.json()) //fetch data from api link\n .then(data => {\n console.log(data);\n //store weather data via html elements\n document.getElementById('temp').innerHTML = data['main']['temp'];\n document.getElementById('feelslike').innerHTML = data['main']['feels_like'];\n document.getElementById('place').innerHTML = data['name'];\n document.getElementById('weather').innerHTML = data['weather'][0]['main'];\n })\n }\n\n navigator.geolocation.getCurrentPosition(success); //actual call to get position via Geolocator api\n}", "function getWeather() {\n \n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=Denver&units=imperial&appid=b4e24afa7b1b97b59d4ac32e97c8b68d\";\n \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n \n $(`p`).text(\"\");\n temp.text(`Current Temperature: ` + Math.floor(response.main.temp) + ` °F`);\n humid.text(`Humidity: ` + response.main.humidity + `%`);\n wind.text(`Wind Speed: ` + response.wind.speed);\n })\n}", "function getLocation(lat, lon) {\n var url =\n \"https://fcc-weather-api.glitch.me/api/current?lat=\" +\n lat +\n \"&\" +\n \"lon=\" +\n lon;\n $.getJSON(url, function(data) {\n var city = data.name;\n var country = data.sys.country;\n $(\".mdl-card__title\").html(city + \", \" + country);\n });\n }", "async getWeather() {\n const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?q=${this.city},${this.state}&units=imperial&appid=${this.apiKey}`)\n\n const responseData = await response.json();\n\n return responseData\n }", "function getWeather(holdLat, holdLong){\n var holdSite= \"https://api.darksky.net/forecast/20b7fde308762cc3f03bac68dd67e36f/\" + holdLat + \",\" + holdLong;\n var holdSite2 = \"https://api.darksky.net/forecast/20b7fde308762cc3f03bac68dd67e36f/\" + holdLat + \",\" + holdLong + \"?units=si\";\n $.ajax({\n url:holdSite, \n dataType:\"jsonp\",\n success:function(result){\n $(\"#tempF\").text(result.currently.temperature + \"\\u00B0\" + \"F\");\n //weather condition\n $(\"#summary\").text(result.currently.summary);\n //create an animated weather icon\n var wIcon = new Skycons({\"color\":\"white\"});\n wIcon.add(\"weatherIcon\", result.currently.icon);\n wIcon.play();\n }\n });\n //created another api call for Celsius temperature\n $.ajax({\n url:holdSite2, \n dataType:\"jsonp\",\n success:function(res){\n document.getElementById(\"tempC\").textContent = res.currently.temperature + \"\\u00B0\" + \"C\";\n }\n })\n}", "function getCurrentWeatherData (){\n //need to find way to get city name and date\n //convert from kelvin to fahrenheit. Remove decimals\n var temperature = Math.floor(((data.current.temp)-273) * 1.8 + 32);\n var humidity =data.current.humidity;\n var windSpeed =data.current.wind_speed;\n var uvIndex = data.current.uvi;\n \n $(\"#temp\").append(temperature + \"*F\");\n $(\"#humidity\").append(humidity + \"%\");\n $(\"#wind\").append(windSpeed + \"mph\");\n $('#uv-index').append(uvIndex)\n}" ]
[ "0.82890683", "0.82332456", "0.80677617", "0.8034235", "0.78167856", "0.77768064", "0.77768064", "0.77768064", "0.77768064", "0.76997554", "0.7692944", "0.7669589", "0.7614594", "0.7590046", "0.75650954", "0.75384516", "0.74990547", "0.74937207", "0.74558777", "0.7447485", "0.7435011", "0.7426076", "0.7425523", "0.7418206", "0.7389896", "0.73754936", "0.7372316", "0.73720765", "0.73658764", "0.73479885", "0.7346764", "0.7345796", "0.73381805", "0.72690266", "0.7248903", "0.723979", "0.7239755", "0.7236333", "0.72338116", "0.72180575", "0.72161496", "0.7198994", "0.7198255", "0.7189597", "0.7176895", "0.71746176", "0.71740603", "0.71582526", "0.71343017", "0.7119462", "0.70998174", "0.7098183", "0.70866674", "0.7076781", "0.7074696", "0.70629406", "0.7059512", "0.7053105", "0.7049499", "0.7044756", "0.70235413", "0.7014387", "0.70094264", "0.70036864", "0.6997027", "0.699466", "0.6981451", "0.69752795", "0.69478023", "0.69474256", "0.6947202", "0.6946153", "0.6944847", "0.69435", "0.69364214", "0.69356465", "0.69227266", "0.69191325", "0.69177425", "0.68995637", "0.688263", "0.6880823", "0.68781006", "0.68687505", "0.6863869", "0.6862062", "0.6861789", "0.68617034", "0.68616086", "0.68496996", "0.6846651", "0.684618", "0.68446296", "0.6832421", "0.6832027", "0.6829419", "0.6825863", "0.68224347", "0.6820111", "0.6808167", "0.68024516" ]
0.0
-1
Determines the type of bin collection for this week.
function determineBinCollection(){ const today = new Date(); // Every even week is rubbish if (today.getWeek() % 2 ==0){ recycling.innerHTML = "<img src='img/trash.svg' width='70px'><br>Rubbish collection week<br>& Garden Waste collection week"; } else { // every odd week is recycling recycling.innerHTML = "<img src='img/trash.svg' width='70px'><br>Recycling collection week"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isBinned(bin) {\n\t return bin === 'binned' || (isBinParams(bin) && bin.binned);\n\t}", "function isBinned(bin) {\n return bin === 'binned' || isBinParams(bin) && bin.binned === true;\n }", "function determineBinSize() {\n\tif(viewerVars.userFixedBinSize) {\n\t\treturn;\n\t}\n\tvar duration = (viewerVars.end.getTime() - viewerVars.start.getTime())/1000;\n\tvar points = window.innerWidth;\n\tif(duration <= 2*points) {\n\t\t// console.log(\"No need for any sparsificaiton on the server side\");\n\t\tviewerVars.binSize = 0;\n\t\treturn;\n\t}\n\tvar potentialBinSizes = [5, 10, 15, 30, 60, 120, 180, 300, 600, 1200, 1800, 3600, 7200, 14400, 21600, 43200, 86400];\n\tfor(i in potentialBinSizes) {\n\t\tpotentialBinSize = potentialBinSizes[i];\n\t\tif((duration/potentialBinSize) <= 2*points) {\n\t\t\tviewerVars.binSize = potentialBinSize;\n\t\t\t// console.log(\"Setting potential bin size to \" + viewerVars.binSize + \" for windowsize \" + points + \" and duration \" + duration);\n\t\t\tbreak;\n\t\t}\n\t}\n}", "function getBandTypes({ countInbandBounce, countOutofbandBounce }) {\n return [\n { name: 'In-Band', count: countInbandBounce },\n { name: 'Out-of-Band', count: countOutofbandBounce }\n ];\n}", "getWorkType() {\n return this.rawData.workType;\n }", "function isBinning(bin) {\n\t return bin === true || (isBinParams(bin) && !bin.binned);\n\t}", "function isBinning(bin) {\n return bin === true || isBinParams(bin) && !bin.binned;\n }", "function binData(data, binInterval) {\n\tvar binnedData = [];\n\tvar binCounts = [];\n\tvar minTime = null;\n\tvar maxTime = null;\t\n\t\t\n\tfor (var i=0; i<data.length; i++) {\n\t\tvar dataType = data[i].activity_type;\n\t\tvar skip = (i<data.length-1) && (dataType=='link') && (data[i+1].activity_type=='link_rating');\n\t\tif (skip) continue;\n\t\t\n\t\tif (dataType=='link_rating') {\n\t\t\tif (data[i].is_helpful) dataType='link_helpful';\n\t\t\telse dataType='link_unhelpful';\n\t\t}\n\t\tvar dataTime = getLocalTime(new Date(data[i].timestamp));\n\t\tif (minTime==null) {\n\t\t\tminTime = dataTime;\n\t\t\tmaxTime = new Date(minTime.getTime()+(binInterval*60*1000));\t\n\t\t}\n\n\t\tif (dataTime >= maxTime) {\n\t\t\t// save previous bin\n\t\t\tif (Object.keys(binCounts).length>0) {\n\t\t\t\tfor (var binType in binCounts) {\n\t\t\t\t\tbinnedData.push({activity_type:binType, timestamp:minTime, count:binCounts[binType]});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// initialize bin\n\t\t\tbinCounts = [];\n\t\t\tvar minTime = dataTime;\n\t\t\tvar maxTime = new Date(minTime.getTime()+(binInterval*60*1000));\t\n\t\t}\n\t\n\t\t// increment bin counts\n\t\tif (binCounts[dataType] == undefined) binCounts[dataType] = 1;\n\t\telse binCounts[dataType]++;\n\t}\n\t\n\t// save last bin\n\tif (Object.keys(binCounts).length>0) {\n\t\tfor (var binType in binCounts) {\n\t\t\tbinnedData.push({activity_type:binType, timestamp:minTime, count:binCounts[binType]});\n\t\t}\n\t}\n\t\n\treturn binnedData;\n}", "isIsoWeek(){\n\t\treturn /monday/i.test(this.getStartOfWeek());\n\t}", "get cullingType() {}", "function walkBins (bin) { // eslint-disable-line no-unused-vars\n\n // $.writeln('bin.name + ' has ' + bin.children.numItems);\n for (var i = 0; i < bin.children.numItems; i++) {\n var object = bin.children[i];\n // $.pype.log(bin.name + ' has ' + object + ' ' + object.name + ' of type ' + object.type + ' and has mediapath ' + object.getMediaPath() );\n if (object.type === 2) { // bin\n // $.pype.log(object.name + ' has ' + object.children.numItems );\n for (var j = 0; j < object.children.numItems; j++) {\n var obj = object.children[j];\n if (obj.type === 1 && obj.getMediaPath()) { // clip in sub bin\n // $.pype.log(object.name + ' has ' + obj + ' ' + obj.name );\n projectItems.push(obj);\n } else if (obj.type === 2) { // bin\n walkBins(obj);\n }\n }\n } else if (object.type === 1 && object.getMediaPath()) { // clip in bin in root\n // $.pype.log(bin.name + ' has ' + object + ' ' + object.name );\n projectItems.push(object);\n }\n }\n }", "function binSortForBar(obj, colNum) {\n // console.log(obj, colNum);\n\n let tempArray = [];\n obj.csvArray.map((item) => {\n if (item[colNum]) {\n tempArray.push(item[colNum]);\n }\n })\n tempArray.shift();\n //looping through our header-less array to determine how many different types of qual data there are\n //will put a hard stop at 20 data types-- more than that and it is likely filled w/ unique values\n var qualobj = {\n colNames: [],\n values: []\n }\n // console.log(tempArray);\n let init = tempArray[0];\n // console.log(tempArray[0]);\n qualobj.colNames.push(init);\n qualobj[init] = 1;\n // console.log(qualobj);\n for (let j = 1; j < tempArray.length; j++) {\n if (qualobj.colNames.length < 21) {\n for (let k = 0; k < qualobj.colNames.length; k++) {\n if (tempArray[j] == qualobj.colNames[k]) {\n let colBin = qualobj.colNames[k];\n // console.log(colBin);\n qualobj[colBin]++;\n } else if (qualobj.colNames.length - 1 === k) {\n qualobj.colNames.push(tempArray[j]);\n let attr = tempArray[j];\n qualobj[attr] = 0;\n\n }\n }\n } else {\n console.log(`too many bins: ${qualobj.colNames.length}`);\n\n }\n\n }\n var sum = 0;\n qualobj.colNames.map((name) => {\n sum += qualobj[name];\n })\n\n if (sum === tempArray.length) {\n console.log(\"20 or less bins, sum of bins equals array length\");\n for (const key in qualobj) {\n if (qualobj.hasOwnProperty(key)) {\n const element = qualobj[key];\n if (typeof (element) == 'number') {\n qualobj.values.push(element);\n }\n\n\n }\n }\n // console.log(qualobj);\n qualobj.d3Array = [];\n for (let i = 0; i < qualobj.colNames.length; i++) {\n let tempObj = {\n key: qualobj.colNames[i],\n value: qualobj.values[i]\n }\n qualobj.d3Array.push(tempObj);\n }\n qualobj.title = obj.colNames[colNum];\n generateBar(qualobj);\n }\n // tempArray.map\n}", "function getDateRangeTypeToUse(dateRangeType, workWeekDays) {\n if (workWeekDays && dateRangeType === _fluentui_date_time_utilities__WEBPACK_IMPORTED_MODULE_5__.DateRangeType.WorkWeek) {\n var sortedWWDays = workWeekDays.slice().sort();\n var isContiguous = true;\n for (var i = 1; i < sortedWWDays.length; i++) {\n if (sortedWWDays[i] !== sortedWWDays[i - 1] + 1) {\n isContiguous = false;\n break;\n }\n }\n if (!isContiguous || workWeekDays.length === 0) {\n return _fluentui_date_time_utilities__WEBPACK_IMPORTED_MODULE_5__.DateRangeType.Week;\n }\n }\n return dateRangeType;\n}", "function dwscripts_isBinaryDBColumnType(columnType)\n{\n var retVal = false;\n \n // Use the Server Model version if it exists\n var serverObj = dwscripts.getServerImplObject();\n \n if (serverObj != null && serverObj.isBinaryDBColumnType != null)\n {\n retVal = serverObj.isBinaryDBColumnType(columnType);\n }\n else\n {\n var typeNum = dwscripts.getDBColumnTypeEnum(columnType);\n\n switch (typeNum) \n {\n case 13:\n case 128:\n case 204:\n case 205:\n retVal = true;\n }\n }\n \n return retVal;\n}", "function binRequiresRange(fieldDef, channel) {\n if (!fieldDef.bin) {\n console.warn('Only use this method with binned field defs');\n return false;\n }\n // We need the range only when the user explicitly forces a binned field to be use discrete scale. In this case, bin range is used in axis and legend labels.\n // We could check whether the axis or legend exists (not disabled) but that seems overkill.\n return isScaleChannel(channel) && contains(['ordinal', 'nominal'], fieldDef.type);\n }", "function getBinTicks(chosenXAxis, histData){\n var min = d3.min(histData[chosenXAxis]);\n var max = d3.max(histData[chosenXAxis]);\n binTicks = [];\n bin_range = (max-min)/binNum;\n for (var i=0; i<binNum+1; i++){\n var t = (min+(bin_range*i)).toFixed(3);\n binTicks.push(t);\n }; \n return binTicks; \n}", "function getType() {\n if (interest.Koopprijs && !interest.Huurprijs) {\n return 'koop';\n } else {\n return 'huur';\n }\n }", "function findBand(expense) {\n return expense.type === 'Band';\n}", "function binRequiresRange(fieldDef, channel) {\n\t if (!isBinning(fieldDef.bin)) {\n\t console.warn('Only use this method with binned field defs');\n\t return false;\n\t }\n\t // We need the range only when the user explicitly forces a binned field to be use discrete scale. In this case, bin range is used in axis and legend labels.\n\t // We could check whether the axis or legend exists (not disabled) but that seems overkill.\n\t return isScaleChannel(channel) && contains(['ordinal', 'nominal'], fieldDef.type);\n\t}", "getType() {\n return this.visualizationModel.type\n }", "_getDimToBow() : number {\n return this._bitField.getInt(219,9,true);\n }", "determineBathroomType(b) {\n\n }", "function bin$1(fieldDef, scaleName, side, offset) {\n var binSuffix = side === 'start' ? undefined : 'end';\n return fieldRef(fieldDef, scaleName, { binSuffix: binSuffix }, offset ? { offset: offset } : {});\n }", "function billType(leg) {\n\t\t\tvar str = \"House\";\n\t\t\tif (leg) {\n\t\t\t\tif (leg.billID ) {\n\t\t\t\t\tif ( leg.billType === \"s\" ) {\n\t\t\t\t\t\tstr = \"Senate\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn str;\n\t\t}", "get Types() {\n return (\n {\n '': this.calculateType(),\n 'whole': 'w',\n 'half': 'h',\n 'quarter': 'q',\n 'eighth': '8',\n '16th': '16',\n '32nd': '32',\n '64th': '64',\n '128th': '128',\n '256th': '256',\n '512th': '512',\n '1024th': '1024',\n });\n }", "function binRequiresRange(fieldDef, channel) {\n if (!isBinning(fieldDef.bin)) {\n console.warn('Only call this method for binned field defs.');\n return false;\n } // We need the range only when the user explicitly forces a binned field to be use discrete scale. In this case, bin range is used in axis and legend labels.\n // We could check whether the axis or legend exists (not disabled) but that seems overkill.\n\n\n return isScaleChannel(channel) && contains(['ordinal', 'nominal'], fieldDef.type);\n }", "function dayClass (week, day) {\n\n const weekIndex = weeks.indexOf(week)\n\n // if the day is in first week AND larger than > 7 OR last week AND smaller than 7\n if ((weekIndex === 0 && day > 7) || ((weekIndex === (lastWeekIndex - 1)) && day < 7)) {\n return 'in-other'\n } else {\n return ''\n }\n }", "getNumberOfBands(resource, resourceEventsOrFn) {\n const nbrOfBandsByResource = this.nbrOfBandsByResource;\n\n if (nbrOfBandsByResource.hasOwnProperty(resource.id)) {\n return nbrOfBandsByResource[resource.id];\n }\n\n const resourceEvents = typeof resourceEventsOrFn === 'function' ? resourceEventsOrFn() : resourceEventsOrFn,\n eventsData = resourceEvents.map(event => ({\n start: event.startDate,\n end: event.endDate,\n event: event\n }));\n return this.applyLayout(eventsData, resource);\n }", "getNumberOfBands(resource, resourceEventsOrFn) {\n const nbrOfBandsByResource = this.nbrOfBandsByResource;\n\n if (nbrOfBandsByResource.hasOwnProperty(resource.id)) {\n return nbrOfBandsByResource[resource.id];\n }\n\n const resourceEvents = typeof resourceEventsOrFn === 'function' ? resourceEventsOrFn() : resourceEventsOrFn,\n eventsData = resourceEvents.map((event) => ({\n start: event.startDate,\n end: event.endDate,\n event: event\n }));\n\n return this.applyLayout(eventsData, resource);\n }", "get type() {\n\t\treturn wm.get(this).type;\n\t}", "function bin(fieldDef, scaleName, side, offset) {\n return fieldRef(fieldDef, scaleName, { binSuffix: side }, offset ? { offset: offset } : {});\n}", "static get __resourceType() {\n\t\treturn 'SpecimenCollection';\n\t}", "_weeks() {\n const { day } = this.props;\n const weeks = [];\n\n let endOfMonth = Utils.endOfMonth(day);\n let startOfMonth = Utils.beginningOfMonth(day);\n let fistDayOfMonth = (new Date(day.getFullYear(), day.getMonth(), 1).getDay());\n\n while (fistDayOfMonth-- > 0) {\n startOfMonth.setDate(startOfMonth.getDate() - 1);\n }\n\n for (let i = 0; i < 5 || startOfMonth.getTime() < endOfMonth.getTime(); i++) {\n const week = [];\n weeks.push(week);\n for (let j = 0; j < Utils.WEEK_DAYS.length; j++) {\n\n const _day = new Date(startOfMonth.getTime());\n const className = _day.getMonth() === day.getMonth() ? '' : 'not-current-period';\n _day.setDate(_day.getDate() + 1);\n startOfMonth = _day;\n week.push(\n {\n date: _day,\n className,\n },\n );\n }\n }\n return weeks;\n }", "get booking_types() {\n return this._settings.get('app.booking.booking_types') || [];\n }", "get booking_types() {\n return this._settings.get('app.booking.booking_types') || [];\n }", "function testSliceType(){\n\tvar bb = createBlobBuilder();\n\tbb.append(\"elitistland\");\n\tvar number = bb.getBlob().slice(3,5).size;\n\tif(number == 5){\n\t\tblobType = 1\n\t}else if(number == 2){\n\t\tblobType = 2;\n\t}else{\n\t\talert(\"Apparently the future, assuming you are in the future, is really messed up by mid-2011 standards.\");\n\t}\n}", "function binDec(obj) {\r\n var compt=0;\r\n var pas0;\r\n for(pas0=0;pas0<obj.length;pas0++){\r\n if (obj[pas0]==\"1\"){\r\n compt=compt+puissance2(7-pas0);\r\n }\r\n }\r\n return compt;\r\n}", "function ObjectCollectionType()\n {\n ObjectCollectionType.$parent.apply(this, arguments);\n }", "function BusinessTypeIcon() {\r\n\tthis.businessTypeName = \"\";\r\n\tthis.businessTypeIconName = \"\";\r\n\tthis.businessTypeTitleName = \"\";\r\n\tthis.businessTypeColor = \"\";\r\n\tthis.businessIconCollection = null;\r\n\t\r\n\tthis.setBusinessTypeName = function(businessTypeNameParam) {\r\n\t\tthis.businessTypeName = businessTypeNameParam;\r\n\t};\r\n\tthis.getBusinessTypeName = function() {\r\n\t\treturn this.businessTypeName;\r\n\t};\r\n\t\r\n\tthis.setBusinessTypeIconName = function(businessTypeIconNameParam) {\r\n\t\tthis.businessTypeIconName = businessTypeIconNameParam;\r\n\t};\r\n\tthis.getBusinessTypeIconName = function() {\r\n\t\treturn this.businessTypeIconName;\r\n\t};\r\n\t\r\n\tthis.setBusinessTypeTitleName = function(businessTypeTitleNameParam) {\r\n\t\tthis.businessTypeTitleName = businessTypeTitleNameParam;\r\n\t};\r\n\tthis.getBusinessTypeTitleName = function() {\r\n\t\treturn this.businessTypeTitleName;\r\n\t};\r\n\t\r\n\tthis.setBusinessTypeColor = function(businessTypeColorParam) {\r\n\t\tthis.businessTypeColor = businessTypeColorParam;\r\n\t};\r\n\tthis.getBusinessTypeColor = function() {\r\n\t\treturn this.businessTypeColor;\r\n\t};\r\n\t\r\n\tthis.setBusinessIconCollection = function(businessIconCollectionParam) {\r\n\t\tthis.businessIconCollection = businessIconCollectionParam;\r\n\t};\r\n\tthis.getBusinessIconCollection = function() {\r\n\t\treturn this.businessIconCollection;\r\n\t};\r\n}", "type() {\n return this.#type;\n }", "function boundTypeOf() {\n var val = this.valueOf(); // jshint ignore:line\n return typeOf(val);\n }", "function boundTypeOf() {\n var val = this.valueOf(); // jshint ignore:line\n return typeOf(val);\n }", "function decBin(obj){\r\n var decimal=obj;\r\n var valeur=\"\";\r\n var pas0;\r\n for(pas0=0;pas0<8;pas0++){\r\n if (decimal>=puissance2(7-pas0)){\r\n valeur+=\"1\";\r\n decimal=decimal-puissance2(7-pas0);\r\n }\r\n else{\r\n valeur+=\"0\";\r\n }\r\n }\r\n return valeur;\r\n}", "function manageBins(newNumberOfBins) {\r\n\r\n\t// This is the row template for a continousBinningRow.\r\n\tvar tpl = new Ext.Template(\r\n\t\t\t'<tr id=\"binningContinousRow{0}\">',\r\n\t\t\t'<td>Bin {0}</td><td><input type=\"text\" id=\"txtBin{0}RangeLow\" /> - <input type=\"text\" id=\"txtBin{0}RangeHigh\" /></td>',\r\n\t\t\t'</tr>');\r\n\tvar tplcat = new Ext.Template(\r\n\t\t\t'<tr id=\"binningCategoricalRow{0}\">',\r\n\t\t\t'<td><b>Bin {0}</b><div id=\"divCategoricalBin{0}\" class=\"queryGroupIncludeSmall\"></div></td>',\r\n\t\t\t'</tr>');\r\n\r\n\t// This is the table we add continuous variables to.\r\n\tcontinuousBinningTable = Ext.get('tblBinContinuous');\r\n\tcategoricalBinningTable = Ext.get('tblBinCategorical');\r\n\t// Clear all old rows out of the table.\r\n\r\n\t// For each bin, we add a row to the binning table.\r\n\tfor (i = 1; i <= newNumberOfBins; i++) {\r\n\t\t// If the object isn't already on the screen, add it.\r\n\t\tif (!(Ext.get(\"binningContinousRow\" + i))) {\r\n\t\t\ttpl.append(continuousBinningTable, [ i ]);\r\n\t\t} else {\r\n\t\t\tExt.get(\"binningContinousRow\" + i).show()\r\n\t\t}\r\n\r\n\t\t// If the object isn't already on the screen, add it-Categorical\r\n\t\tif (!(Ext.get(\"binningCategoricalRow\" + i))) {\r\n\t\t\ttplcat.append(categoricalBinningTable, [ i ]);\r\n\t\t\t// Add the drop targets and handler function.\r\n\t\t\tvar bin = Ext.get(\"divCategoricalBin\" + i);\r\n\t\t\tvar dragZone = new Ext.dd.DragZone(bin, {\r\n\t\t\t\tddGroup : 'makeBin',\r\n\t\t\t\tisTarget: true,\r\n\t\t\t\tignoreSelf: false\r\n\t\t\t\r\n\t\t\t});\r\n\t\t\tvar dropZone = new Ext.dd.DropTarget(bin, {\r\n\t\t\t\tddGroup : 'makeBin',\r\n\t\t\t\tisTarget: true,\r\n\t\t\t\tignoreSelf: false\r\n\t\t\t});\r\n\t\t\t// dropZone.notifyEnter = test;\r\n\t\t\tdropZone.notifyDrop = dropOntoBin; // dont forget to make each\r\n\t\t\t// dropped\r\n\t\t\t// node a drag target\r\n\t\t} else {\r\n\t\t\tExt.get(\"binningCategoricalRow\" + i).show()\r\n\t\t}\r\n\t}\r\n\r\n\t// If the new number of bins is less than the old, hide the old bins.\r\n\tif (newNumberOfBins < GLOBAL.NumberOfBins) {\r\n\t\t// For each bin, we add a row to the binning table.\r\n\t\tfor (i = parseInt(newNumberOfBins) + 1; i <= GLOBAL.NumberOfBins; i++) {\r\n\t\t\t// If the object isn't already on the screen, add it.\r\n\t\t\tif (Ext.get(\"binningContinousRow\" + i)) {\r\n\t\t\t\tExt.get(\"binningContinousRow\" + i).hide();\r\n\t\t\t}\r\n\t\t\t// If the object isn't already on the screen, add it.\r\n\t\t\tif (Ext.get(\"binningCategoricalRow\" + i)) {\r\n\t\t\t\tExt.get(\"binningCategoricalRow\" + i).hide();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Set the global variable to reflect the new bin count.\r\n\tGLOBAL.NumberOfBins = newNumberOfBins;\r\n\tupdateManualBinning();\r\n}", "function binToString(bin) {\n if (isBoolean(bin)) {\n bin = normalizeBin(bin, undefined);\n }\n\n return 'bin' + keys(bin).map(function (p) {\n return isSelectionExtent(bin[p]) ? varName(\"_\".concat(p, \"_\").concat(Object.entries(bin[p]))) : varName(\"_\".concat(p, \"_\").concat(bin[p]));\n }).join('');\n }", "getBucketCategory(sport, val) {\n let idx = this.getBucketIdxForValue(val);\n if (bucketed[sport] == null) {\n bucketed[sport] = {total: idx, dimensions: [idx]};\n } else {\n bucketed[sport].total += idx;\n bucketed[sport].dimensions.push(idx)\n }\n }", "function BaseBin(pos) {\n\n this._pos = pos;\n this._bases = {};\n this._totalCount = 0;\n}", "function binarizeImage() {\n Object(\n _common_cv_utils__WEBPACK_IMPORTED_MODULE_3__[\n /* otsuThreshold */ \"i\"\n ]\n )(_currentImageWrapper, _binaryImageWrapper);\n\n _binaryImageWrapper.zeroBorder();\n\n if (true && _config.debug.showCanvas) {\n _binaryImageWrapper.show(\n _canvasContainer.dom.binary,\n 255\n );\n }\n }", "function binarizeImage() {\r\n CVUtils.otsuThreshold(_currentImageWrapper, _binaryImageWrapper);\r\n _binaryImageWrapper.zeroBorder();\r\n if (_config.showCanvas) {\r\n _binaryImageWrapper.show(_canvasContainer.dom.binary, 255);\r\n }\r\n }", "function defineWidgetBkg(weatherSummary, isDayTime) {\n let result = \"\";\n let weatherSum = weatherSummary.toLowerCase();\n\n weatherStates.forEach((entry) => {\n if (typeof entry == \"string\") {\n if (weatherSum.indexOf(entry) != -1) {\n result += entry;\n }\n } else {\n result += entry.some((arrEntry) => {\n return weatherSum.indexOf(arrEntry) != -1;\n })\n ? entry[0]\n : \"\";\n }\n });\n\n if (isDayTime == true) {\n return `${result}day`;\n }\n return `${result}night`;\n}", "function determineAxisType(dataType) {\r\n if (dataType === \"number\") {\r\n return \"indexed\";\r\n }\r\n else if (dataType === \"date\") {\r\n return \"timeseries\";\r\n }\r\n else {\r\n return \"category\";\r\n }\r\n}", "function getWeekNumber()\n {\n weekNumber = 0; \n\n var currentDate = new Date();\n\n for(var week in DATES) \n {\n var tempDate = new Date(DATES[week]);\n\n if (currentDate > tempDate )\n {\n weekNumber = parseInt(week) + 1; \n }\n }\n\n if (weekNumber == 0)\n {\n weekNumber = 1; // let's not be weird\n }\n\n if (weekNumber == undefined) \n {\n weekNumber = week;\n }\n\n return weekNumber; \n }", "function generateScaleTypeIndex() {\n var index = {};\n for (var _i = 0, CHANNELS_1 = CHANNELS; _i < CHANNELS_1.length; _i++) {\n var channel = CHANNELS_1[_i];\n for (var _a = 0, _b = keys(TYPE_INDEX); _a < _b.length; _a++) {\n var fieldDefType = _b[_a];\n for (var _c = 0, SCALE_TYPES_1 = SCALE_TYPES; _c < SCALE_TYPES_1.length; _c++) {\n var scaleType = SCALE_TYPES_1[_c];\n for (var _d = 0, _e = [false, true]; _d < _e.length; _d++) {\n var bin = _e[_d];\n var key$$1 = generateScaleTypeIndexKey(channel, fieldDefType, bin);\n if (channelSupportScaleType(channel, scaleType) && scaleTypeSupportDataType(scaleType, fieldDefType, bin)) {\n index[key$$1] = index[key$$1] || [];\n index[key$$1].push(scaleType);\n }\n }\n }\n }\n }\n return index;\n }", "function isBsonType(obj, typename) {\n return get(obj, '_bsontype', void 0) === typename;\n}", "function isBsonType(obj, typename) {\n return get(obj, '_bsontype', void 0) === typename;\n}", "function isBsonType(obj, typename) {\n return get(obj, '_bsontype', void 0) === typename;\n}", "get week() {\n const nearestThursday = new Date(Date.UTC(this.year, this.month, this.day));\n nearestThursday.setUTCDate(nearestThursday.getUTCDate() + 4 - (nearestThursday.getUTCDay() || 7));\n\n const firstDayOfYear = new Date(Date.UTC(nearestThursday.getUTCFullYear(), 0, 1));\n\n // The number of full weeks to today's date\n const week = Math.ceil((((nearestThursday - firstDayOfYear) / 86400000) + 1) / 7);\n\n return week;\n }", "function getTypes() {\n\t\tif (focusCategory === \"All Types\") {\n\t\t\treturn [\"All Types\"];\n\t\t} else {\n\t\t\treturn d3.map(this.data.pointsData, function(d) {\n\t\t\t\treturn d[categories[focusCategory]];\n\t\t\t}).keys().sort();\n\t\t}\n\t}", "get subtype() {\r\n if (this.getType().indexOf(\"#\") > 0) {\r\n return this.getType().substring(this.getType().indexOf(\"#\") + 1);\r\n }\r\n return this[\"@subtype\"];\r\n }", "function determinePostType() {\n\tif(json_array[index].activity_attachment != null)\n\t{\n\t\treturn 1;\n\t}\n\treturn 0;\n}", "function binarizeImage() {\n\t _commonCv_utils2['default'].otsuThreshold(_currentImageWrapper, _binaryImageWrapper);\n\t _binaryImageWrapper.zeroBorder();\n\t if (_config.showCanvas) {\n\t _binaryImageWrapper.show(_canvasContainer.dom.binary, 255);\n\t }\n\t}", "_determineType(data) {\n\t\tlet type;\n\t\tif (data.pressure !== undefined) {\n\t\t\ttype = 'THB';\n\t\t} else if (data.humidity !== undefined) {\n\t\t\ttype = 'TH';\n\t\t} else if (data.currentspeed !== undefined || data.averagespeed !== undefined) {\n\t\t\ttype = 'W';\n\t\t} else if (data.raintotal !== undefined || data.rainrate !== undefined) {\n\t\t\ttype = 'R';\n\t\t} else if (data.uvindex !== undefined) {\n\t\t\ttype = 'UV';\n\t\t} else if (data.brightness !== undefined) {\n\t\t\ttype = 'L';\n\t\t} else if (data.temperature !== undefined) {\n\t\t\ttype = 'T';\n\t\t}\n\t\treturn type;\n\t}", "function maxBin (all) {\n\t if (all.length < 1) {\n\t return null;\n\t }\n\t var maxi = 0, max = _chart.ordering()(all[0]);\n\t for (var i = 1; i < all.length; ++i) {\n\t var v = _chart.ordering()(all[i]);\n\t if (v > max) {\n\t max = v;\n\t maxi = i;\n\t }\n\t }\n\t return all[maxi];\n\t }", "function isCollection(value) {\n // YOUR CODE BELOW HERE //\n //Make a conditional statement using if, else-if... to check for value types and return boolean of false if not Array or Object as collection\n //use typeof operator for all value types except null, Date, & Array\n //Check for typeof object last, as other value types will be considered objects, if special operators aren't used to check for value types\n if(value === null) {\n return false;\n }\n else if(value instanceof Date) {\n return false;\n }\n else if(typeof value === 'number') {\n return false;\n }\n else if(typeof value === 'boolean') {\n return false;\n }\n else if(typeof value === 'number') {\n return false;\n }\n else if(typeof value === 'string') {\n return false;\n }\n else if(Array.isArray(value)) {\n return true;\n }\n else if(typeof value === 'object') {\n return true;\n }\n \n \n // YOUR CODE ABOVE HERE //\n}", "function addWaterCompany(bw, boolArray){\n\t\t\t\tvar object = {};\n\t\t\t\tvar waterCompany = bw.appointedSewerageUndertaker.name._value;\n\n\t\t\t\tif(boolArray[waterCompany] == 0){\n\t\t\t\t\tobject.type = 'water company';\n\t\t\t\t\tobject.name = waterCompany;\n\t\t\t\t\tobject.bws = 1;\n\t\t\t\t\t\n\t\t\t\t\tsearchArray.push(object);\n\t\t\t\t\tboolArray[waterCompany] = 1;\n\t\t\t\t} else {\n\t\t\t\t\tfor (var index = 0; index < searchArray.length; index++){\n\t\t\t\t\t\tif(searchArray[index].type == 'water company'){\n\t\t\t\t\t\t\tif(searchArray[index].name == waterCompany){\n\t\t\t\t\t\t\t\tsearchArray[index].bws++;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn boolArray;\t\t\t\t \n\t\t\t}", "w (date) {\n return getWeekOfYear(date)\n }", "function renderWeek(num){\n var daysThisWeek = [31, (((weekThisYear % 4 === 0) && (weekThisYear % 100 !== 0)) || (weekThisYear % 400 === 0)) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n if(calendarId.rows.length > 0){\n var rowLength = calendarId.rows.length;\n for(let c = 0; c < rowLength; c++){\n calendarId.deleteRow(0);\n }\n }\n var row = calendarId.insertRow(0);\n if(num > 0){\n weekThisMonday = weekThisMonday + 1;\n console.log('used');\n }else if(num < 0){\n weekThisMonday = weekThisMonday - 13;\n console.log('used');\n }\n for(let i = 0; i < 7; i++){\n if(i !== 6){\n if((weekThisMonday > daysThisWeek[weekThisMonth]) && ((weekThisMonth + 1) > 11)){\n ++weekThisYear;\n weekThisMonth = 0;\n weekThisMonday = 1;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n ++weekThisMonday;\n }else if((weekThisMonday > daysThisWeek[weekThisMonth]) && ((weekThisMonth + 1) <= 11)){\n ++weekThisMonth;\n weekThisMonday = 1;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n ++weekThisMonday;\n }else if(((weekThisMonday + i) < 1) && ((weekThisMonth - 1) < 0)){\n --weekThisYear;\n weekThisMonth = 11;\n weekThisMonday = daysThisWeek[weekThisMonth] + weekThisMonday;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n ++weekThisMonday;\n }else if((weekThisMonday < 1) && ((weekThisMonth - 1) >= 0)){\n --weekThisMonth;\n weekThisMonday = daysThisWeek[weekThisMonth] + weekThisMonday;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n ++weekThisMonday;\n }else{\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n ++weekThisMonday;\n }\n }else{\n if((weekThisMonday > daysThisWeek[weekThisMonth]) && ((weekThisMonth + 1) > 11)){\n ++weekThisYear;\n weekThisMonth = 0;\n weekThisMonday = 1;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n }else if((weekThisMonday > daysThisWeek[weekThisMonth]) && ((weekThisMonth + 1) <= 11)){\n ++weekThisMonth;\n weekThisMonday = 1;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n }else if(((weekThisMonday + i) < 1) && ((weekThisMonth - 1) < 0)){\n --weekThisYear;\n weekThisMonth = 11;\n weekThisMonday = daysThisWeek[weekThisMonth] + weekThisMonday;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n }else if((weekThisMonday < 1) && ((weekThisMonth - 1) >= 0)){\n --weekThisMonth;\n weekThisMonday = daysThisWeek[weekThisMonth] + weekThisMonday;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n }else{\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n }\n }\n }\n for(let i = 0; i < 7; i++){\n var cell = row.insertCell(i);\n cell.innerText = tmp[i].date;\n cell.className = \"calendarThis\";\n if((tmp[i].date === timeNow.date) && (tmp[i].month === timeNow.month) && (tmp[i].year === timeNow.year)){\n cell.className = \"calendarToday\";\n }\n }\n }", "get pathSegmentType() {\n switch (this.snapshotType) {\n case 1 /* Element */:\n return 2 /* ELEMENT */;\n case 0 /* ContextVariable */:\n return 4 /* CLOSURE_VARIABLE */;\n case 3 /* Internal */:\n if (this.indexOrName === 'context') {\n return 3 /* CLOSURE */;\n }\n break;\n case 2 /* Property */: {\n // We assume that no one uses our chosen special property names.\n // If the program happens to have a memory leak stemming from a non-BLeak-created\n // property with one of these names, then BLeak might not find it.\n const name = this.indexOrName;\n switch (name) {\n case '$$$DOM$$$':\n return 6 /* DOM_TREE */;\n case '$$listeners':\n return 5 /* EVENT_LISTENER_LIST */;\n default:\n return 1 /* PROPERTY */;\n }\n }\n }\n console.debug(`Unrecognized edge type: ${this.snapshotType}`);\n return 7 /* UNKNOWN */;\n }", "function showChartType(params, node){\n\t\t\tvar layout=params.obj;\n\t\t\tif(layout.aggregationType && layout.aggregationType!=\"ohlc\"){\n\t\t\t\tif(chartType!==layout.aggregationType){\n\t\t\t\t\t$(node).removeClass(activeClassName);\n\t\t\t\t}else{\n\t\t\t\t\t$(node).addClass(activeClassName);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(chartType!==layout.chartType){\n\t\t\t\t\t$(node).removeClass(activeClassName);\n\t\t\t\t}else{\n\t\t\t\t\t$(node).addClass(activeClassName);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function C(a){var b=G.start.day();// normalize dayOffset to beginning-of-week\n// first date's day of week\n// # of cells from full weeks\n// # of cells from partial last week\nreturn a+=b,Math.floor(a/7)*N+Q[(a%7+7)%7]-Q[b]}", "cellKind(row, col) {\n const cells = this.cells;\n return cells[ this.to_1d(row, col) * this.cellBytes + 1];\n }", "function getTypes() {\n return ['aggregated'];\n }", "function write_ws_bin_cell(ba, cell, R, C, opts) {\n\tif(cell.v === undefined) return \"\";\n\tvar vv = \"\";\n\tswitch(cell.t) {\n\t\tcase 'b': vv = cell.v ? \"1\" : \"0\"; break;\n\t\tcase 'n': case 'e': vv = ''+cell.v; break;\n\t\tdefault: vv = cell.v; break;\n\t}\n\tvar o = {r:R, c:C};\n\t/* TODO: cell style */\n\to.s = get_cell_style(opts.cellXfs, cell, opts);\n\tswitch(cell.t) {\n\t\tcase 's': case 'str':\n\t\t\tif(opts.bookSST) {\n\t\t\t\tvv = get_sst_id(opts.Strings, cell.v);\n\t\t\t\to.t = \"s\"; break;\n\t\t\t}\n\t\t\to.t = \"str\"; break;\n\t\tcase 'n': break;\n\t\tcase 'b': o.t = \"b\"; break;\n\t\tcase 'e': o.t = \"e\"; break;\n\t}\n\twrite_record(ba, \"BrtCellBlank\", write_BrtCellBlank(cell, o));\n}", "function write_ws_bin_cell(ba, cell, R, C, opts) {\n\tif(cell.v === undefined) return \"\";\n\tvar vv = \"\";\n\tswitch(cell.t) {\n\t\tcase 'b': vv = cell.v ? \"1\" : \"0\"; break;\n\t\tcase 'n': case 'e': vv = ''+cell.v; break;\n\t\tdefault: vv = cell.v; break;\n\t}\n\tvar o = {r:R, c:C};\n\t/* TODO: cell style */\n\to.s = get_cell_style(opts.cellXfs, cell, opts);\n\tswitch(cell.t) {\n\t\tcase 's': case 'str':\n\t\t\tif(opts.bookSST) {\n\t\t\t\tvv = get_sst_id(opts.Strings, cell.v);\n\t\t\t\to.t = \"s\"; break;\n\t\t\t}\n\t\t\to.t = \"str\"; break;\n\t\tcase 'n': break;\n\t\tcase 'b': o.t = \"b\"; break;\n\t\tcase 'e': o.t = \"e\"; break;\n\t}\n\twrite_record(ba, \"BrtCellBlank\", write_BrtCellBlank(cell, o));\n}", "function write_ws_bin_cell(ba, cell, R, C, opts) {\n\tif(cell.v === undefined) return \"\";\n\tvar vv = \"\";\n\tswitch(cell.t) {\n\t\tcase 'b': vv = cell.v ? \"1\" : \"0\"; break;\n\t\tcase 'n': case 'e': vv = ''+cell.v; break;\n\t\tdefault: vv = cell.v; break;\n\t}\n\tvar o = {r:R, c:C};\n\t/* TODO: cell style */\n\to.s = get_cell_style(opts.cellXfs, cell, opts);\n\tswitch(cell.t) {\n\t\tcase 's': case 'str':\n\t\t\tif(opts.bookSST) {\n\t\t\t\tvv = get_sst_id(opts.Strings, cell.v);\n\t\t\t\to.t = \"s\"; break;\n\t\t\t}\n\t\t\to.t = \"str\"; break;\n\t\tcase 'n': break;\n\t\tcase 'b': o.t = \"b\"; break;\n\t\tcase 'e': o.t = \"e\"; break;\n\t}\n\twrite_record(ba, \"BrtCellBlank\", write_BrtCellBlank(cell, o));\n}", "function write_ws_bin_cell(ba, cell, R, C, opts) {\n\tif(cell.v === undefined) return \"\";\n\tvar vv = \"\";\n\tswitch(cell.t) {\n\t\tcase 'b': vv = cell.v ? \"1\" : \"0\"; break;\n\t\tcase 'n': case 'e': vv = ''+cell.v; break;\n\t\tdefault: vv = cell.v; break;\n\t}\n\tvar o = {r:R, c:C};\n\t/* TODO: cell style */\n\to.s = get_cell_style(opts.cellXfs, cell, opts);\n\tswitch(cell.t) {\n\t\tcase 's': case 'str':\n\t\t\tif(opts.bookSST) {\n\t\t\t\tvv = get_sst_id(opts.Strings, cell.v);\n\t\t\t\to.t = \"s\"; break;\n\t\t\t}\n\t\t\to.t = \"str\"; break;\n\t\tcase 'n': break;\n\t\tcase 'b': o.t = \"b\"; break;\n\t\tcase 'e': o.t = \"e\"; break;\n\t}\n\twrite_record(ba, \"BrtCellBlank\", write_BrtCellBlank(cell, o));\n}", "get type() {\n return this.startSide < this.endSide ? exports.BlockType.WidgetRange\n : this.startSide <= 0 ? exports.BlockType.WidgetBefore : exports.BlockType.WidgetAfter;\n }", "function calcIsoWeek()\n {\n var year = new Number(document.isoweek.year.value),\n\t week = new Number(document.isoweek.week.value),\n\t day = new Number(document.isoweek.day.value);\n\n setJulian(iso_to_julian(year, week, day));\n }", "function getType() {\n if (result.Koopprijs && !result.Huurprijs) {\n return 'koop';\n } else {\n return 'huur';\n }\n }", "type() {\n return this._type.name;\n }", "getType() {\n return this._data.type;\n }", "function getBoundWidgetDatasetDetails($is) {\n var dataSetParts,\n refVariable,\n refVariableName,\n relFieldName,\n relFieldType,\n fields,\n details,\n isBoundToSelectedItemSubset = _.includes($is.binddataset, 'selecteditem.');\n\n dataSetParts = $is.binddataset.split('.');\n refVariableName = Utils.getVariableName($is);\n refVariable = getVariable($is, refVariableName);\n\n relFieldName = isBoundToSelectedItemSubset && dataSetParts[3];\n\n fields = $rs.dataTypes[refVariable.package].fields;\n details = {\n 'refVariableName': refVariableName,\n 'refVariable': refVariable\n };\n /* If binddataset is of the format: bind:Widgets.widgetName.selecteditem.something,\n * i.e. widget is bound to a subset of selected item, get type of that subset.*/\n if (relFieldName) {\n relFieldType = fields[relFieldName].type;\n details.relFieldType = relFieldType;\n } else {\n // When binddataset is of the format: bind:Widgets.widgetName.selecteditem\n details.fields = fields;\n }\n return details;\n }", "save() {\n let saveBins = [];\n this.bins.forEach((bin => {\n let saveBin = {\n width: bin.width,\n height: bin.height,\n maxWidth: bin.maxWidth,\n maxHeight: bin.maxHeight,\n freeRects: [],\n rects: [],\n options: bin.options\n };\n if (bin.tag)\n saveBin = Object.assign({}, saveBin, { tag: bin.tag });\n bin.freeRects.forEach(r => {\n saveBin.freeRects.push({\n x: r.x,\n y: r.y,\n width: r.width,\n height: r.height\n });\n });\n saveBins.push(saveBin);\n }));\n return saveBins;\n }", "function getPackhouses_getClasses(){\n for (var i = 0; i < currentData.Items.length; i++) {\n var currentItem = currentData.Items[i];\n\n var packhouse = currentItem.payload.Data.PackRun.Packhouse;\n if (packhouses.indexOf(packhouse) == -1){\n if (packhouse != null) {\n packhouses.push(packhouse);\n }\n }\n\n var fruitVariety = currentItem.payload.Data.PackRun.FruitVariety;\n if (commodities.indexOf(fruitVariety) == -1){\n commodities.push(fruitVariety);\n }\n }\n }", "getEntriesType() {\n return null;\n }", "function getB1DataSeriesForWeek(miny, maxy, resolution) {\n var dy = maxy - miny;\n var now = moment(),\n t0 = moment().startOf('isoweek');\n var n = 7;\n var choices1 = $.map(new Array(n), function () {\n return Math.random() < 0.4;\n });\n var genSample = function genSample(i, t) {\n return miny + Math.random() * dy;\n };\n var data1 = [],\n data2 = [];\n for (var i = 0; i < n; i++) {\n var t = t0.clone().add(i * 1, 'day').toDate();\n\n if (choices1[i]) {\n data1[i] = new Measurement(i, t, genSample(i, t));\n data2[i] = new Measurement(i, t, null);\n } else {\n data1[i] = new Measurement(i, t, null);\n data2[i] = i > 0 && data2[i - 1].value ? data2[i - 1] : new Measurement(i, t, genSample(i, t));\n }\n }\n return [data1, data2];\n }", "function getRunaways() {\n return (0, _property.get)(\"_banderRunaways\");\n}", "function resolveCollectionName () {\n return clazz.constructor.name\n }", "function count_of_each_type() {\n var no_of_types = get_number_of_item_types();\n var fruit_type_with_max_count = -1;\n var curr_type_max_count = -1;\n\n for(var i=1; i<=no_of_types; i++) {\n var type_count = get_total_item_count(i);\n\n if (type_count > curr_type_max_count) {\n fruit_type_with_max_count = i;\n curr_type_max_count = type_count;\n }\n }\n\n return fruit_type_to_collect;\n}", "function updateBinData(chosenXAxis, binNum, histData){\n binTicks = getBinTicks(chosenXAxis, histData);\n var freqCount = [];\n for (var j=0; j<binNum; j++){\n var count = 0;\n histData[chosenXAxis].forEach(d=>{\n if (d>binTicks[j]){\n if (d<=binTicks[j+1]){\n count = count + 1;\n }\n }\n });\n var c = {'bin': j+1, 'freq': count};\n freqCount.push(c);\n };\n freqCount[0]['freq'] = freqCount[0]['freq']+1 //have to do this to count the min\n return freqCount;\n}", "determineTypeAlectoV1(data) {\n let datastr = data.join('');\n let type = 'TH';\n if (datastr.slice(9, 11) === '11') {\n type = undefined;\n if (datastr.slice(12, 16) === '1100') {\n type = 'R';\n } else if (datastr.slice(12, 15) === '111' || datastr.slice(12, 24) === '100000000000') {\n type = 'W';\n }\n }\n return type;\n }", "function returnTileTypeAtColRow(col, row) {\r\n if (col >= 0 && col < TRACK_COLS && \r\n row >= 0 && row < TRACK_ROWS) {\r\n var trackIndexUnderCoord = rowColToArrayIndex(col, row);\r\n //Draw a brick when the number 1 appears in the array\r\n return trackGrid[trackIndexUnderCoord];\r\n } else {\r\n return TRACK_WALL;\r\n }\r\n}", "getTypeKey(){\n let type = this.get('properties.type') || this.get('type');\n if (type){\n type = TypeKey.getTypeKey(type);\n } else {\n // Use the class hierarchy if type is not defined in the data\n type = TypeKey.getTypeKey.apply(this);\n }\n return type;\n }", "function Column_BIT() {}", "getWeeklyPrice() {\n return priceConfig[this.selectedSize][\"every week\"];\n }", "function getProductTypes() {\n const cad = visitUI.getCad();\n const productTypes = cad ? cad.getAvailableContours() : [];\n const index = productTypes.findIndex(option => option.label === 'casual');\n if (index >= 0) {\n productTypes[index].label = '3/4 Length';\n }\n return productTypes;\n }", "function builBbusinessTripTypes() {\n self.types([]);\n \n self.types(rootViewModel.globalTypes());\n \n\n }", "function _getBinary(num) {\n if(num == 0) {\n return { eight: 0, four: 0,two: 0,one: 0 }\n }\n if (num == 1) {\n return { eight: 0, four: 0,two: 0,one: 1 }\n }\n if (num == 2) {\n return { eight: 0, four: 0,two: 1,one: 0 }\n }\n if (num == 3) {\n return { eight: 0, four: 0,two: 1,one: 1 }\n }\n if (num == 4) {\n return { eight: 0, four: 1,two: 0,one: 0 }\n }\n if (num == 5) {\n return { eight: 0, four: 1,two: 0,one: 1 }\n }\n if (num == 6) {\n return { eight: 0, four: 1,two: 1,one: 0 }\n }\n if (num == 7) {\n return { eight: 0, four: 1,two: 1,one: 1 }\n }\n if (num == 8) {\n return { eight: 1, four: 0,two: 0,one: 0 }\n }\n if (num == 9) {\n return { eight: 1, four: 0,two: 0,one: 1 }\n }\n else\n {\n return { eight: 1, four: 0,two: 0,one: 1 }\n }\n}", "function bookingCompanyUnits(){\n var data = google.visualization.arrayToDataTable(bookingCompanyUnits_arr);\n\n var options = {\n backgroundColor: \"#f9e7d5\",\n chartArea: {width: '65%'},\n height: 400,\n vAxis: {title: gon.bookingCompanyUnits_hAxis_title},\n hAxis: {title: gon.bookingCompanyUnits_yAxis_title},\n seriesType: 'bars',\n series: {5: {type: 'line'}}\n };\n\n var chart = new google.visualization.ComboChart(document.getElementById('g-chart-bookingCompanyUnits'));\n chart.draw(data, options);\n }", "function specificWeekAve(week) {\n var total = 0;\n var days = 0;\n var i = week-1;\n for(var j = 0; j < this.dataStore[i].length; j++) {\n total += this.dataStore[i][j];\n days ++;\n }\n console.log(\"Week \" + (i+1) + \" average: \" + (total / days).toFixed(2));\n }" ]
[ "0.5419424", "0.53026104", "0.52212816", "0.49759498", "0.49611023", "0.48859206", "0.48388422", "0.48164538", "0.47966653", "0.4746346", "0.47349995", "0.47256774", "0.46395594", "0.45054802", "0.449226", "0.4490523", "0.44813368", "0.44509187", "0.44161347", "0.44117406", "0.44114363", "0.43929473", "0.43914384", "0.43834853", "0.43768188", "0.4365423", "0.43637407", "0.43606478", "0.43205842", "0.43089467", "0.4303198", "0.4301495", "0.42901522", "0.4277532", "0.4277532", "0.425858", "0.42530543", "0.42322293", "0.42257077", "0.42196405", "0.4209888", "0.4209888", "0.42068756", "0.42065373", "0.42029515", "0.4198844", "0.41981965", "0.41959515", "0.41910198", "0.41896835", "0.41810727", "0.41668308", "0.41641754", "0.4155511", "0.4155511", "0.4155511", "0.41435745", "0.4137689", "0.41363132", "0.41282865", "0.41271415", "0.4125996", "0.41237015", "0.4118623", "0.41066033", "0.40960997", "0.40949276", "0.40945464", "0.40932426", "0.40913835", "0.40892348", "0.40889457", "0.4085166", "0.4085166", "0.4085166", "0.4085166", "0.4084139", "0.40814868", "0.4081441", "0.40751702", "0.40568268", "0.40546468", "0.40517998", "0.40492073", "0.40490004", "0.40470055", "0.40447405", "0.40443778", "0.40415716", "0.40380633", "0.4033388", "0.40300354", "0.40297973", "0.40249857", "0.40227422", "0.40186882", "0.4016164", "0.40138936", "0.40104568", "0.40067753" ]
0.6361204
0
init and returns an instance of Progress
static factory() { return new Progress().init(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n this.instance = createProgressBar();\n }", "function Progress(){\n P.apply(this, arguments);\n\n this.size(50);\n this.fontSize(24);\n this.color('rgba(31,190,242,1)');\n this.font('helvetica, arial, sans-serif');\n this.background('rgba(255,255,255,1)');\n}", "function Progress() {\n this.percent = 0;\n this.el = document.createElement('canvas');\n this.ctx = this.el.getContext('2d');\n this.size(50);\n this.fontSize(11);\n this.font('helvetica, arial, sans-serif');\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xd1d34a26;\n this.SUBCLASS_OF_ID = 0x20b2cc21;\n\n this.progress = args.progress;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x243e1c66;\n this.SUBCLASS_OF_ID = 0x20b2cc21;\n\n this.progress = args.progress;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xe9763aec;\n this.SUBCLASS_OF_ID = 0x20b2cc21;\n\n this.progress = args.progress;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xaa0cd9e4;\n this.SUBCLASS_OF_ID = 0x20b2cc21;\n\n this.progress = args.progress;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xf351d7ab;\n this.SUBCLASS_OF_ID = 0x20b2cc21;\n\n this.progress = args.progress;\n }", "function ProgressTask(q, value) {\n\t\t\t\tthis.q = q;\n\t\t\t\tthis.value = value;\n\t\t\t}", "function ProgressObserver() {\n this.started = false;\n this.observing = {};\n}", "function setup_progress()\n\t{\n\t\t// Add the bootstrap progress bar\n\t\tvar container = document.createElement('div'),\n\t\t\tprogress = document.createElement('div'),\n\t\t\tnote = document.createElement('small'),\n\t\t\tbar = document.createElement(\"div\");\n\n\t\t\t// Set up the progress wrapper\n\t\t\tprogress.setAttribute('class', 'progress export_progress');\n\n\t\t\t// Initial notes on progress\n\t\t\tnote.setAttribute('class', 'small export-note');\n\t\t\tnote.innerHTML = note_text;\n\n\t\t\t// Set up the progress bar\n\t\t\tbar.setAttribute('class', 'progress-bar progress-bar-warning progress-bar-striped');\n\t\t\tbar.setAttribute('role', 'progressbar');\n\t\t\tbar.setAttribute('aria-valuenow', 0);\n\t\t\tbar.setAttribute('aria-valuemin', 0);\n\t\t\tbar.setAttribute('aria-valuemax', 100);\n\n\t\tprogress.appendChild( bar );\n\t\tcontainer.appendChild( note );\n\t\tcontainer.appendChild( progress );\n\n\t\treturn {\n\t\t\tcontainer: container,\n\t\t\tprogress: progress,\n\t\t\tbar: bar,\n\t\t};\n\t}", "function ProgressTracker(missing, callback) {\n this.missing = missing;\n this.callback = callback;\n}", "function ChevronProgress() {\n this.el = null;\n this.step = -1;\n this.steps = [];\n}", "function ProgressBar ($el) {\n \n this.barObj = $el.find('.frameit-probar');\n \n if( ! this.barObj.length ) {\n this.barObj = $('<span/>', {'class' :'frameit-probar'}).appendTo($el);\n }\n \n this.$el = $el;\n \n /* public methods */\n \n this.load = function(delay, complete) {\n \n this.cbComplete = complete;\n this.delay = delay;\n this.target = this.$el.width();\n \n this.start();\n },\n \n this.reset = function (){\n this.barObj.width(0);\n this.delay = 0;\n },\n \n this.pause = function(){\n this.barObj.stop(true, false);\n },\n \n this.start = function(){\n var that = this,\n current = this.barObj.width(),\n resto = (this.target - current) / this.target;\n\n this.barObj.animate({'width': this.target }, {\n duration: this.delay * resto,\n complete: function(){ \n that.reset(); \n that.cbComplete();\n }\n })\n\n this.barObj.dequeue();\n }\n }", "function ProgressView(options) {\n this.element = options.element;\n this.model = options.model;\n this.Observer = options.observer;\n }", "function getProgress()\n{\n var inst = _getInstance(this);\n logger.info(\"ROV Module: getProgress(\" + inst.id + \")\");\n\n var prom = Q.defer();\n inst.waitingPromise[inst.createId] = prom;\n\n var res = _checkBuffer(inst);\n if (res != null) {\n prom.resolve(res);\n return (prom.promise);\n }\n\n /* Only if the promise is not resolved yet, we increment createId++.\n * Otherwise, we let the next promise overwrite createId for this one.\n * This pattern is repeated in other functions that sometimes resolve a\n * promise immediately, and sometimes just return an unresolved promise.\n */\n inst.createId++;\n return (prom.promise);\n}", "function create_prog(){\n\t\tvar myProgBar = new progressBar(\n\t\t\t1, //border thickness\n\t\t\t'#000000', //border colour\n\t\t\t'#a5f3b1', //background colour\n\t\t\t'#043db2', //bar colour\n\t\t\t400, //width of bar (excluding border)\n\t\t\t20, //height of bar (excluding border)\n\t\t\t1 //direction of progress: 1 = right, 2 = down, 3 = left, 4 = up\n\t\t);\n\t\t\n }", "function ProgressTask(handler, value) {\n\t\t\tthis.handler = handler;\n\t\t\tthis.value = value;\n\t\t}", "function ProgressTask(handler, value) {\n\t\t\tthis.handler = handler;\n\t\t\tthis.value = value;\n\t\t}", "function ProgressTask(handler, value) {\n\t\t\tthis.handler = handler;\n\t\t\tthis.value = value;\n\t\t}", "get progress() {\n return this.instance.getProgress();\n }", "function ProgressTask(value, handler) {\n\t\t\t\tthis.handler = handler;\n\t\t\t\tthis.value = value;\n\t\t\t}", "function ProgressTask(value, handler) {\n\t\t\tthis.handler = handler;\n\t\t\tthis.value = value;\n\t\t}", "function ProgressTask(value, handler) {\n\t\t\tthis.handler = handler;\n\t\t\tthis.value = value;\n\t\t}", "function ProgressTask(value, handler) {\n\t\t\tthis.handler = handler;\n\t\t\tthis.value = value;\n\t\t}", "function ProgressTask(value, handler) {\n\t\t\tthis.handler = handler;\n\t\t\tthis.value = value;\n\t\t}", "function ProgressTask(value, handler) {\n\t\t\tthis.handler = handler;\n\t\t\tthis.value = value;\n\t\t}", "function ProgressTask(value, handler) {\n\t\t\tthis.handler = handler;\n\t\t\tthis.value = value;\n\t\t}", "function ProgressTask(value, handler) {\n\t\t\tthis.handler = handler;\n\t\t\tthis.value = value;\n\t\t}", "function ProgressTask(value, handler) {\n\t\t\tthis.handler = handler;\n\t\t\tthis.value = value;\n\t\t}", "function createProgress(numberOfFiles){\n\tbarObject = new ProgressBar(':bar :percent :token1', { \n\t\ttotal: numberOfFiles,\n\t\tclear: true,\n\t\tcomplete: '#',\n\t\twidth: 20\n\t});\n}", "static start() {\n this.parent = document.querySelector('.progress');\n this.parent.innerHTML = '';\n this.bar = document.createElement('div');\n this.bar.classList.add('progress__bar');\n this.parent.appendChild(this.bar);\n this.parent.style.height = '5px';\n this.progress = 10;\n this.bar.style.width = `${this.progress}%`;\n\n const animate = setInterval(() => {\n if (this.progress < 75) {\n this.step();\n } else {\n clearInterval(animate);\n }\n }, 400);\n }", "function getProgressBar() {\n return new cliProgress.SingleBar({\n format:\n _colors.cyan(\" {bar}\") +\n \" {percentage}% | ETA: {eta}s | {value}/{total} Projects\",\n barCompleteChar: \"\\u2588\",\n barIncompleteChar: \"\\u2591\",\n hideCursor: true,\n });\n}", "constructor(name) {\n\t\tthis.name = name;\n\t\tthis.step = Importer.ProgressStep.NEW;\n\t\tthis.count = { completed: 0, total: 0 };\n\t}", "progress( pid ) {\n \n // Initialize a poll timer.\n let timer = 0;\n \n // Initialize a helper to determine if polling should continue.\n const check = () => {\n\n const next = () => {\n\n // Increment the timer.\n timer+= this.poll.interval;\n\n // Poll again.\n setTimeout(poll, this.poll.interval);\n\n };\n const end = () => {\n\n setTimeout(() => this.percent = null, 1000);\n\n };\n\n // Continue to poll for additional progress updates.\n if( isset(this.percent) ) {\n\n if( this.percent.progress < 100 ) next();\n\n else end();\n\n }\n\n // Check that the polling has not timed out.\n else if( timer < this.poll.timeout ) next();\n\n // Otherwise, clear our progress data and stop polling.\n else end();\n\n };\n \n // Initialize a polling method.\n const poll = () => { \n \n // Get the progress.\n $.getJSON(`${this.src}progress/${pid}`).then((response) => {\n \n // Save progress data.\n this.percent = response.data; \n \n // Check the progress thus far.\n check();\n \n });\n \n };\n \n // Start polling.\n poll();\n \n }", "function createProgressMeter() {\n var meterWrap = jQuery(\".meter-wrap\");\n\n return {\n grow : function(percent) {\n $('.meter-value').css('width', percent + '%');\n $('.meter-text').text(percent + '%');\n },\n show : function() {\n meterWrap.show();\n },\n hide : function() {\n //meterWrap.hide('medium');\n meterWrap.hide('slow');\n $('.meter-value').css('width', '0');\n $('.meter-text').text('');\n }\n };\n }", "function ProgressBar(props) {_classCallCheck(this, ProgressBar);return _possibleConstructorReturn(this, (ProgressBar.__proto__ || Object.getPrototypeOf(ProgressBar)).call(this,\n props));\n }", "loadProgress() {\r\n (this.type === 'radial') ? this.radialProgress() : this.linearProgress();\r\n }", "function Progress_Progress(props) {\n var operation = props.operation;\n var id = operation.id,\n description = operation.description;\n var logsUrl = config[\"a\" /* default */].getSiteLogQueryRoute({\n query: \"file:\".concat(id)\n });\n return /*#__PURE__*/react_default.a.createElement(Alert[\"b\" /* Info */], {\n as: src[\"l\" /* Flex */],\n mb: \"0\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n width: \"100%\"\n }, /*#__PURE__*/react_default.a.createElement(src[\"b\" /* Box */], {\n mr: \"2\"\n }, /*#__PURE__*/react_default.a.createElement(StyledSpinner, {\n fontSize: \"14px\"\n }), /*#__PURE__*/react_default.a.createElement(src[\"u\" /* Text */], {\n ml: \"2\",\n mr: \"2\",\n as: \"span\"\n }, description, \" is in progress...\")), /*#__PURE__*/react_default.a.createElement(src[\"u\" /* Text */], {\n typography: \"body1\"\n }, /*#__PURE__*/react_default.a.createElement(Progress_StyledLink, {\n as: Router[\"a\" /* NavLink */],\n to: logsUrl\n }, \"View Details\")));\n}", "function initProgressBar(){\n var stepSize = (frameCount / 100);\n var step = 0;\n while(step < 100){\n steps.push(step);\n step += stepSize;\n }\n }", "function ProgressPersistor(logger) {\n this.logger = logger ? logger: _logger;\n}", "function init_progressBar(duration) {\n $('.progress').each(function() {\n var value = $(this).find('.progress__bar').attr('data-level');\n var result = value + '%';\n if(duration) {\n $(this).find('.progress__current').animate({width : value + '%'}, duration);\n }\n else {\n $(this).find('.progress__current').css({'width' : value + '%'});\n }\n \n });\n }", "function SnpCreateProgressBar () \r\n{\r\n\tthis.windowRef = null;\r\n}", "function Progress(el){\n $(el).circleProgress({fill: {color:'navy'},animation:{duration:10000, easing:'circleProgressEasing'},animationStartValue: 1.0,reverse:true})\n }", "get progress_measure() { return this._progress_measure; }", "get progress_measure() { return this._progress_measure; }", "function LinearProgress(props) {\n var _classNames, _classNames2, _classNames3, _classNames4;\n\n var classes = props.classes,\n classNameProp = props.className,\n color = props.color,\n value = props.value,\n valueBuffer = props.valueBuffer,\n variant = props.variant,\n other = (0, _objectWithoutProperties3.default)(props, ['classes', 'className', 'color', 'value', 'valueBuffer', 'variant']);\n\n\n var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.colorPrimary, color === 'primary'), (0, _defineProperty3.default)(_classNames, classes.colorSecondary, color === 'secondary'), (0, _defineProperty3.default)(_classNames, classes.buffer, variant === 'buffer'), (0, _defineProperty3.default)(_classNames, classes.query, variant === 'query'), _classNames), classNameProp);\n var dashedClass = (0, _classnames2.default)(classes.dashed, (_classNames2 = {}, (0, _defineProperty3.default)(_classNames2, classes.dashedColorPrimary, color === 'primary'), (0, _defineProperty3.default)(_classNames2, classes.dashedColorSecondary, color === 'secondary'), _classNames2));\n var bar1ClassName = (0, _classnames2.default)(classes.bar, (_classNames3 = {}, (0, _defineProperty3.default)(_classNames3, classes.barColorPrimary, color === 'primary'), (0, _defineProperty3.default)(_classNames3, classes.barColorSecondary, color === 'secondary'), (0, _defineProperty3.default)(_classNames3, classes.bar1Indeterminate, variant === 'indeterminate' || variant === 'query'), (0, _defineProperty3.default)(_classNames3, classes.bar1Determinate, variant === 'determinate'), (0, _defineProperty3.default)(_classNames3, classes.bar1Buffer, variant === 'buffer'), _classNames3));\n var bar2ClassName = (0, _classnames2.default)(classes.bar, (_classNames4 = {}, (0, _defineProperty3.default)(_classNames4, classes.barColorPrimary, color === 'primary' && variant !== 'buffer'), (0, _defineProperty3.default)(_classNames4, classes.colorPrimary, color === 'primary' && variant === 'buffer'), (0, _defineProperty3.default)(_classNames4, classes.barColorSecondary, color === 'secondary' && variant !== 'buffer'), (0, _defineProperty3.default)(_classNames4, classes.colorSecondary, color === 'secondary' && variant === 'buffer'), (0, _defineProperty3.default)(_classNames4, classes.bar2Indeterminate, variant === 'indeterminate' || variant === 'query'), (0, _defineProperty3.default)(_classNames4, classes.bar2Buffer, variant === 'buffer'), _classNames4));\n var rootProps = {};\n var inlineStyles = { bar1: {}, bar2: {} };\n\n if (variant === 'determinate' || variant === 'buffer') {\n if (value !== undefined) {\n rootProps['aria-valuenow'] = Math.round(value);\n inlineStyles.bar1.transform = 'scaleX(' + value / 100 + ')';\n } else {\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(false, 'Material-UI: you need to provide a value property ' + 'when using the determinate or buffer variant of LinearProgress .') : void 0;\n }\n }\n if (variant === 'buffer') {\n if (valueBuffer !== undefined) {\n inlineStyles.bar2.transform = 'scaleX(' + (valueBuffer || 0) / 100 + ')';\n } else {\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(false, 'Material-UI: you need to provide a valueBuffer property ' + 'when using the buffer variant of LinearProgress.') : void 0;\n }\n }\n\n return _react2.default.createElement(\n 'div',\n (0, _extends3.default)({ className: className, role: 'progressbar' }, rootProps, other),\n variant === 'buffer' ? _react2.default.createElement('div', { className: dashedClass }) : null,\n _react2.default.createElement('div', { className: bar1ClassName, style: inlineStyles.bar1 }),\n variant === 'determinate' ? null : _react2.default.createElement('div', { className: bar2ClassName, style: inlineStyles.bar2 })\n );\n}", "function getCircleLoader(elt){\n\treturn new ProgressBar.Circle(elt, {\n\tcolor: '#888',\n\t// This has to be the same size as the maximum width to\n\t// prevent clipping\n\tstrokeWidth: 4,\n\ttrailWidth: 1,\n\teasing: 'easeInOut',\n\tduration: 1400,\n\ttext: {\n\t\tautoStyleContainer: false\n\t},\n\tfrom: { color: '#EB004F', width: 4 },\n\tto: { color: '#fff', width: 4 },\n\t// Set default step function for all animate calls\n\tstep: function(state, circle) {\n\t\tcircle.path.setAttribute('stroke', state.color);\n\t\tcircle.path.setAttribute('stroke-width', state.width);\n\n\t\tvar value = Math.round(circle.value() * 100);\n\t\t// if (value === 0) {\n\t\t// circle.setText('');\n\t\t// } else {\n\t\t// circle.setText(value+\" %\");\n\t\t// }\n\n\t}\n\t});\n}", "function buildProgressBar(){\r\n $progressBar = $(\"<div>\",{\r\n id:\"progressBar\"\r\n });\r\n $bar = $(\"<div>\",{\r\n id:\"bar\"\r\n });\r\n $progressBar.append($bar).prependTo($elem);\r\n }", "start() {\n this.progress.started = true;\n\tthis.setChanged();\n\tthis.notifyObservers(this.progress);\n\tthis.clearChanged();\n }", "function CircularProgress(props) {\n var _classNames2;\n\n var classes = props.classes,\n className = props.className,\n color = props.color,\n max = props.max,\n min = props.min,\n size = props.size,\n style = props.style,\n thickness = props.thickness,\n value = props.value,\n variant = props.variant,\n other = (0, _objectWithoutProperties3.default)(props, ['classes', 'className', 'color', 'max', 'min', 'size', 'style', 'thickness', 'value', 'variant']);\n\n\n var circleStyle = {};\n var rootStyle = {};\n var rootProps = {};\n\n if (variant === 'determinate' || variant === 'static') {\n var relVal = getRelativeValue(value, min, max) * 100;\n var circumference = 2 * Math.PI * (SIZE / 2 - 5);\n circleStyle.strokeDasharray = circumference.toFixed(3);\n rootProps['aria-valuenow'] = Math.round(relVal);\n\n if (variant === 'static') {\n circleStyle.strokeDashoffset = ((100 - relVal) / 100 * circumference).toFixed(3) + 'px';\n rootStyle.transform = 'rotate(-90deg)';\n } else {\n circleStyle.strokeDashoffset = (easeIn((100 - relVal) / 100) * circumference).toFixed(3) + 'px';\n rootStyle.transform = 'rotate(' + (easeOut(relVal / 70) * 270).toFixed(3) + 'deg)';\n }\n }\n\n return _react2.default.createElement(\n 'div',\n (0, _extends3.default)({\n className: (0, _classnames2.default)(classes.root, (0, _defineProperty3.default)({}, classes['color' + (0, _helpers.capitalize)(color)], color !== 'inherit'), className),\n style: (0, _extends3.default)({ width: size, height: size }, rootStyle, style),\n role: 'progressbar'\n }, rootProps, other),\n _react2.default.createElement(\n 'svg',\n {\n className: (0, _classnames2.default)(classes.svg, (_classNames2 = {}, (0, _defineProperty3.default)(_classNames2, classes.svgIndeterminate, variant === 'indeterminate'), (0, _defineProperty3.default)(_classNames2, classes.svgStatic, variant === 'static'), _classNames2)),\n viewBox: '0 0 ' + SIZE + ' ' + SIZE\n },\n _react2.default.createElement('circle', {\n className: (0, _classnames2.default)(classes.circle, (0, _defineProperty3.default)({}, classes.circleIndeterminate, variant === 'indeterminate')),\n style: circleStyle,\n cx: SIZE / 2,\n cy: SIZE / 2,\n r: SIZE / 2 - 5,\n fill: 'none',\n strokeWidth: thickness\n })\n )\n );\n}", "constructor(){\n this.inProgressAnimation;\n this.elementToAnimate;\n this.animationDuration;\n }", "function ProgressBarComponent(skin) {\n this.skin = skin;\n this.skin.init();\n}", "function buildProgressBar(){\n $progressBar = $(\"<div>\",{\n id:\"progress-bar\"\n });\n $bar = $(\"<div>\",{\n id:\"bar\"\n });\n $progressBar.append($bar).prependTo($elem);\n }", "function ProgressIndicator(props) { // I'm intentionally not destructuring here because most of the props are used by buildBackground. Might as well pass the existing object in.\n\n\tfunction buildBackground({current, max, backgroundColor = '#FFF', fillColor = '#369'}){\n\t\tconst fraction = Math.round(1000 * current / max) / 10;\n\t\tif (fraction < .2) {\n\t\t\treturn backgroundColor;\n\t\t}\n\t\tif (fraction > 99.8) {\n\t\t\treturn fillColor;\n\t\t}\n\t\treturn `linear-gradient(to right, ${fillColor} ${fraction - 0.1}%, ${backgroundColor} ${fraction + 0.1}%)`;\n\t}\n\n\tconst { width = 'calc(100% - 1rem)' } = props;\n\n\tconst style = {\n\t\twidth,\n\t\tbackground: buildBackground(props)\n\t};\n\n\treturn (\n\t\t<div className={styles['progress-indicator']} style={style}></div>\n\t);\n}", "init() {\n this.build();\n this.container.querySelector('.progress-bar__start').innerHTML = this.timer.startDate.toLocaleDateString();\n this.container.querySelector('.progress-bar__end').innerHTML = this.timer.endDate.toLocaleDateString();\n\n let loop = true;\n const interval = setInterval(() => {\n loop = this.updateProgressBarView();\n if (!loop) {\n clearInterval(interval);\n }\n }, 1000);\n }", "linearProgress() {\r\n let progress;\r\n progress = this.element.querySelector('.progress-bar');\r\n let progressContainer;\r\n progressContainer = this.element.querySelector('.progress-container');\r\n let progressBar;\r\n progressBar = this.element.querySelector('.progress-value');\r\n let progressBorder;\r\n progressBorder = this.element.querySelector('.progress-linear');\r\n let tooltip;\r\n tooltip = this.element.querySelector('.tooltip-container');\r\n // apply width if defined\r\n if (this.width) {\r\n progressContainer.style.width = this.width;\r\n }\r\n // calculate percentage based on values defined\r\n const calcVal = Math.round(this.currentValue * 100 / this.maxValue);\r\n // apply class if percent-right attribute defined\r\n if (this.percentRight) {\r\n progress.classList.add('percent-right');\r\n }\r\n // calculate percentage from values defined\r\n if (this.currentValue <= this.maxValue && this.currentValue >= this.minValue) {\r\n progressBar.style.width = `${calcVal}%`;\r\n }\r\n // apply height if defined\r\n if (this.height) {\r\n progressBorder.style.height = this.height;\r\n }\r\n // apply progress color if defined\r\n if (this.progressColor) {\r\n progressBar.style.background = this.progressColor;\r\n }\r\n // apply text color if defined\r\n if (this.fontColor) {\r\n progressContainer.style.color = this.fontColor;\r\n }\r\n // apply progress background if defined\r\n if (this.backgroundColor) {\r\n progressBorder.style.background = this.backgroundColor;\r\n }\r\n if (this.asTooltip) {\r\n this.showPercentageForLinearTooltip(calcVal, progressContainer, tooltip);\r\n }\r\n }", "function buildProgressBar() {\n $progressBar = $(\"<div>\", {\n id: \"progressBar\"\n });\n $bar = $(\"<div>\", {\n id: \"bar\"\n });\n $progressBar.append($bar).prependTo($elem);\n }", "constructor() {\n this.promise = Promise.resolve();\n this.queued = 0;\n this.complete = 0;\n }", "function FileProgress(file, targetID) {\r\r\n\tthis.fileProgressID = file.id;\r\r\n\r\r\n\tthis.opacity = 100;\r\r\n\tthis.height = 0;\r\r\n\t\r\r\n\r\r\n\tthis.fileProgressWrapper = document.getElementById(this.fileProgressID);\r\r\n\tif (!this.fileProgressWrapper) {\r\r\n\t\tthis.fileProgressWrapper = document.createElement(\"div\");\r\r\n\t\tthis.fileProgressWrapper.className = \"progressWrapper\";\r\r\n\t\tthis.fileProgressWrapper.id = this.fileProgressID;\r\r\n\r\r\n\t\tthis.fileProgressElement = document.createElement(\"div\");\r\r\n\t\tthis.fileProgressElement.className = \"progressContainer\";\r\r\n\r\r\n\t\tvar progressCancel = document.createElement(\"a\");\r\r\n\t\tprogressCancel.className = \"progressCancel\";\r\r\n\t\tprogressCancel.href = \"#\";\r\r\n\t\tprogressCancel.style.visibility = \"hidden\";\r\r\n\t\tprogressCancel.appendChild(document.createTextNode(\" \"));\r\r\n\r\r\n\t\tvar progressText = document.createElement(\"div\");\r\r\n\t\tprogressText.className = \"progressName\";\r\r\n\t\tprogressText.appendChild(document.createTextNode(file.name));\r\r\n\r\r\n\t\tvar progressBar = document.createElement(\"div\");\r\r\n\t\tprogressBar.className = \"progressBarInProgress\";\r\r\n\r\r\n\t\tvar progressStatus = document.createElement(\"div\");\r\r\n\t\tprogressStatus.className = \"progressBarStatus\";\r\r\n\t\tprogressStatus.innerHTML = \"&nbsp;\";\r\r\n\r\r\n\t\tthis.fileProgressElement.appendChild(progressCancel);\r\r\n\t\tthis.fileProgressElement.appendChild(progressText);\r\r\n\t\tthis.fileProgressElement.appendChild(progressStatus);\r\r\n\t\tthis.fileProgressElement.appendChild(progressBar);\r\r\n\r\r\n\t\tthis.fileProgressWrapper.appendChild(this.fileProgressElement);\r\r\n\r\r\n\t\tdocument.getElementById(targetID).appendChild(this.fileProgressWrapper);\r\r\n\t} else {\r\r\n\t\tthis.fileProgressElement = this.fileProgressWrapper.firstChild;\r\r\n\t\tthis.reset();\r\r\n\t}\r\r\n\r\r\n\tthis.height = this.fileProgressWrapper.offsetHeight;\r\r\n\tthis.setTimer(null);\r\r\n\r\r\n\r\r\n}", "function buildProgressBar(){\n $progressBar = $(\"<div>\",{\n id:\"progressBar\"\n });\n $bar = $(\"<div>\",{\n id:\"bar\"\n });\n $progressBar.append($bar).prependTo($elem);\n }", "function buildProgressBar(){\n $progressBar = $(\"<div>\",{\n id:\"progressBar\"\n });\n $bar = $(\"<div>\",{\n id:\"bar\"\n });\n $progressBar.append($bar).prependTo($elem);\n }", "function buildProgressBar(){\n $progressBar = $(\"<div>\",{\n id:\"progressBar\"\n });\n $bar = $(\"<div>\",{\n id:\"bar\"\n });\n $progressBar.append($bar).prependTo($elem);\n }", "function buildProgressBar(){\n $progressBar = $(\"<div>\",{\n id:\"progressBar\"\n });\n $bar = $(\"<div>\",{\n id:\"bar\"\n });\n $progressBar.append($bar).prependTo($elem);\n }", "function FileProgress(file, targetID) {\n this.fileProgressID = file.id;\n this.file = file;\n this.opacity = 100;\n this.height = 0;\n this.fileProgressWrapper = $('#' + this.fileProgressID);\n if (!this.fileProgressWrapper.length) {\n\n this.fileProgressWrapper = $('<div/>');\n var Wrappeer = this.fileProgressWrapper;\n Wrappeer.attr('id', this.fileProgressID).addClass('progressContainer');\n var progressBarWrapper = $(\"<div/>\");\n progressBarWrapper.addClass(\"progress progress-striped\");\n\n var progressBar = $(\"<div/>\");\n progressBar.addClass(\"progress-bar progress-bar-info\")\n .attr('role', 'progressbar')\n .attr('aria-valuemax', 100)\n .attr('aria-valuenow', 0)\n .attr('aria-valuein', 0)\n .width('0%');\n\n var progressBarPercent = $('<span class=\"status text-left\" />');\n progressBarPercent.text(\"等待...\");\n\n progressBar.append(progressBarPercent);\n progressBarWrapper.append(progressBar);\n Wrappeer.append(progressBarWrapper);\n $('#' + targetID).append(Wrappeer);\n } else {\n this.reset();\n }\n\n this.height = this.fileProgressWrapper.offset().top;\n this.setTimer(null);\n}", "function LitresCacheProgress(Obj) {\n this.Obj = Obj;\n this.Progresses = {};\n }", "function initProgressBarCircle(selector, value) {\r\n if (document.querySelector(selector)) {\r\n let bar = new ProgressBar.Circle(selector, {\r\n color: '#a7b51a',\r\n trailColor: '#e9e9e9',\r\n trailWidth: 12,\r\n duration: 1400,\r\n easing: 'bounce',\r\n strokeWidth: 12,\r\n text: {\r\n className: 'circle-progress-bar__lable',\r\n },\r\n from: {color: '#d75c2b', a:0},\r\n to: {color: '#a7b51a', a:1},\r\n // Set default step function for all animate calls\r\n step: function(state, circle) {\r\n circle.path.setAttribute('stroke', state.color);\r\n $(circle.text).css({color:state.color});\r\n circle.setText( (circle.value() * 10).toFixed(1) )\r\n },\r\n });\r\n\r\n bar.animate(value); // Number from 0.0 to 1.0\r\n }\r\n }", "function FileProgress(file, targetID) {\n this.fileProgressID = \"divFileProgress\";\n\n this.fileProgressWrapper = document.getElementById(this.fileProgressID);\n if (!this.fileProgressWrapper) {\n this.fileProgressWrapper = document.createElement(\"div\");\n this.fileProgressWrapper.className = \"progressWrapper\";\n this.fileProgressWrapper.id = this.fileProgressID;\n\n this.fileProgressElement = document.createElement(\"div\");\n this.fileProgressElement.className = \"progressContainer\";\n\n var progressCancel = document.createElement(\"a\");\n progressCancel.className = \"progressCancel\";\n progressCancel.href = \"#\";\n progressCancel.style.visibility = \"hidden\";\n progressCancel.appendChild(document.createTextNode(\" \"));\n\n var progressText = document.createElement(\"div\");\n progressText.className = \"progressName\";\n progressText.appendChild(document.createTextNode(file.name));\n\n var progressBar = document.createElement(\"div\");\n progressBar.className = \"progressBarInProgress\";\n\n var progressStatus = document.createElement(\"div\");\n progressStatus.className = \"progressBarStatus\";\n progressStatus.innerHTML = \"&nbsp;\";\n\n this.fileProgressElement.appendChild(progressCancel);\n this.fileProgressElement.appendChild(progressText);\n this.fileProgressElement.appendChild(progressStatus);\n this.fileProgressElement.appendChild(progressBar);\n\n this.fileProgressWrapper.appendChild(this.fileProgressElement);\n\n document.getElementById(targetID).appendChild(this.fileProgressWrapper);\n fadeIn(this.fileProgressWrapper, 0);\n\n } else {\n this.fileProgressElement = this.fileProgressWrapper.firstChild;\n this.fileProgressElement.childNodes[1].firstChild.nodeValue = file.name;\n }\n this.height = this.fileProgressWrapper.offsetHeight;\n}", "function getProgressPercent(progress, from, to) {\n return new _utils_Percent__WEBPACK_IMPORTED_MODULE_5__[\"Percent\"](getProgressNumber(progress, from.percent, to.percent));\n}", "function setProgress(container, progress){\n var bar = new ProgressBar.SemiCircle(container, {\n strokeWidth: 6,\n color: '#fff',\n trailColor: '#e0e0e0',\n trailWidth: 1,\n easing: 'easeInOut',\n duration: 1400,\n svgStyle: null,\n text: {\n value: '',\n alignToBottom: false\n },\n from: {color: '#fff'},\n to: {color:'#fff'},\n // Set default step function for all animate calls\n step: (state, bar) => {\n bar.path.setAttribute('stroke', state.color);\n var value = Math.round(bar.value() * 100);\n if (value === 0) {\n bar.setText('0%');\n } else {\n bar.setText(value+\"%\");\n }\n bar.text.style.color = state.color;\n }\n });\n bar.text.style.fontFamily = '\"Roboto\", Helvetica, sans-serif';\n bar.text.style.fontSize = '2rem';\n\n bar.animate(progress); // Number from 0.0 to 1.0\n }", "function Step(progressAmount, text, func) {\n this.progressAmount = progressAmount;\n this.text = text;\n this.func = func;\n }", "toLog(): ProgressLog {\n return {\n total: this.total,\n progress: this.progress,\n url: this.url != null ? this.url.url : \"\"\n };\n }", "_progress(data) {\n\t\t// Empty by default\n\t}", "function _getProgress(){// Steps are 0 indexed\nvar currentStep=parseInt(this._currentStep+1,10);return currentStep/this._introItems.length*100;}", "updateProgress() {\n var state = this.state;\n\n state.runningTime += state.deltaT;\n\n if (this.duration) {\n state.progress = Math.max(0, Math.min(1, state.runningTime / this.duration));\n }\n }", "function init_progressBar(duration) {\r\n\t$('.progress-container').each(function() {\r\n\t var container = $(this).find('.progress-value');\r\n\t var value = $(this).find('.progress').attr('data-level');\r\n\t var result = value;\r\n\t if(duration) {\r\n\t $(this).find('.progress-bar').animate({width : value + '%'}, duration);\r\n\t }\r\n\t else {\r\n\t $(this).find('.progress-bar').css({'width' : value + '%'});\r\n\t }\r\n\t \r\n\t countValue(value, result, container, duration);\r\n\t});\r\n}", "function buildProgressBar() {\n $progressBar = $(\"<div>\", {\n id: \"progressBar\"\n });\n $bar = $(\"<div>\", {\n id: \"bar\"\n });\n $progressBar.append($bar).appendTo($elem);\n }", "function buildProgressBar() {\n $progressBar = $(\"<div>\", {\n id: \"progressBar\"\n });\n $bar = $(\"<div>\", {\n id: \"bar\"\n });\n $progressBar.append($bar).appendTo($elem);\n }", "launchprogressbar() {\n\t\tlet percent = this.progressbar.attr(\"data-percent\"); // récupère le data 100% de l\"élément\n this.progressbar.animate( {\n \twidth: percent // on passe de 0% à 100%\n },this.timeout, \"linear\", () => {\n \tthis.progressbar.css(\"width\", 0); // une fois l'animation complète, on revient à 0\n });\n }", "function ProgressAdapter(stepWeights, progressCallback1) {\n this.stepWeights = stepWeights;\n this.progressCallback = progressCallback1;\n if (!(isFunction(this.progressCallback) && (isArray(this.stepWeights) || isNumber(this.stepWeights)))) {\n throw new Error(\"invalid params\");\n }\n this._currentStep = 0;\n this._generateSteps();\n this._currentProgress = 0;\n this._warningCount = 0;\n this.setCurrentProgress(0);\n }", "onprogress() {}", "function buildProgressBar() {\n jQueryprogressBar = jQuery( \"<div>\", {\n id: \"progressBar\"\n } );\n jQuerybar = jQuery( \"<div>\", {\n id: \"bar\"\n } );\n jQueryprogressBar.append( jQuerybar )\n .prependTo( jQueryelem );\n }", "radialProgress() {\r\n let progressContainer;\r\n progressContainer = this.element.querySelector('.progress-container');\r\n let progressSVG;\r\n progressSVG = this.element.querySelector('.progress');\r\n let progressBar;\r\n progressBar = this.element.querySelector('.progress-value');\r\n let progressBorder;\r\n progressBorder = this.element.querySelector('.progress-meter');\r\n const circleRadius = this.calculateRadius();\r\n const calcVal = 2 * Math.PI * circleRadius;\r\n // apply width if defined.\r\n if (this.width) {\r\n progressContainer.style.width = this.width;\r\n progressSVG.style.width = this.width;\r\n progressSVG.style.height = this.width;\r\n }\r\n // progress logic for svg\r\n if (this.currentValue <= this.maxValue && this.currentValue >= this.minValue) {\r\n let finalValue;\r\n finalValue = (calcVal * (this.maxValue - this.currentValue)) / this.maxValue;\r\n progressBar.style.strokeDashoffset = `${finalValue}px`;\r\n }\r\n else {\r\n progressBar.style.strokeDashoffset = `${calcVal}0px`;\r\n }\r\n // define percentage based on values.\r\n progressBar.style.strokeDasharray = `${calcVal}px`;\r\n // apply text color if defined\r\n progressSVG.querySelector('g').setAttribute('transform', 'rotate(-90 50 50)');\r\n if (this.fontColor) {\r\n try {\r\n // @ts-ignore\r\n (progressSVG.querySelector('.description-container')).style.fill = this.fontColor;\r\n }\r\n catch (e) {\r\n // in case of haveDescription false code will come to this catch.\r\n dxp.log.debug(this.element.tagName, 'radialProgress()', `description not found.`);\r\n }\r\n }\r\n // apply progress color if applied.\r\n if (this.progressColor) {\r\n progressBar.style.stroke = this.progressColor;\r\n }\r\n // apply progress background if applied.\r\n if (this.backgroundColor) {\r\n progressBorder.style.stroke = this.backgroundColor;\r\n }\r\n }", "function createProgressbar(id, duration, callback) {\n // We select the div that we want to turn into a progressbar\n var progressbar = document.getElementById(id);\n progressbar.className = 'progressbar';\n \n // We create the div that changes width to show progress\n var progressbarinner = document.createElement('div');\n progressbarinner.className = 'inner';\n \n \n // Now we set the animation parameters\n progressbarinner.style.animationDuration = duration;\n \n // Eventually couple a callback\n if (typeof(callback) === 'function') {\n progressbarinner.addEventListener('animationend', callback);\n }\n \n // Append the progressbar to the main progressbardiv\n progressbar.appendChild(progressbarinner);\n \n // When everything is set up we start the animation\n progressbarinner.style.animationPlayState = 'running';\n }", "function getOrCreateProgressBar(gauge) {\n var pb = document.getElementById('daily-task-progress-bar');\n\n if (pb) return pb;\n\n pb = document.createElement('div');\n pb.id = 'daily-task-progress-bar';\n pb.style.position = 'absolute';\n pb.style.bottom = 0;\n pb.style.background = 'url(data:image/gif;base64,R0lGODlhAQADAJEAACiMMSRvKx9SJP///yH5BAEAAAMALAAAAAABAAMAAAICRFQAOw==)';\n pb.style.height = '3px';\n pb.style.width = 0; // No progress initially\n\n pb_bg = document.createElement('div');\n pb_bg.style.position = 'absolute';\n pb_bg.style.bottom = 0;\n pb_bg.style.background = 'url(data:image/gif;base64,R0lGODlhAQADAJEAAK+vr4+Pj3Nzc////yH5BAEAAAMALAAAAAABAAMAAAICVFAAOw==)';\n pb_bg.style.height = '3px';\n pb_bg.style.width = '100%'; // No progress initially\n\n gauge.appendChild(pb_bg);\n gauge.appendChild(pb);\n\n return pb;\n}", "onProgress(percentage, count) {}", "init() {\n this.collections = {\n bugProgresses: new BugProgressCollection(this)\n };\n\n this.indexes = new Indexes();\n this.addIndex(new BugProgressByBugIdIndex());\n }", "function KoProgressModel(){\n this.progress = ko.observable(0);\n }", "function ProgressCenterPanel() {}", "function createProgressBar(id) {\n\tvar progress = document.createElement(\"div\");\n\tvar bar = document.createElement(\"div\");\n\t$(progress).attr(\"id\", id).addClass(\"progress\").addClass(\"progress-striped\").addClass(\"active\");\n\t$(bar).addClass(\"bar\");\n\t$(progress).append(bar);\n\n\treturn progress;\n}", "function CreateEstimationMetric() {\n return {\n total : 0,\n percentage : function(progress) {\n if (this.total == 0) return 0;\n\n return Math.ceil(100, parseInt((progress / this.total) * 100));\n }\n };\n }", "function FileProgress(file, targetID) {\n this.fileProgressElement = document.getElementById(\"swfu_ldr-\" + file.id + \"-prg\");\n //\n /*\n this.fileProgressID = \"divFileProgress\";//进度条包装的DIV\n\n this.fileProgressWrapper = document.getElementById(this.fileProgressID);\n if (!this.fileProgressWrapper) {\n this.fileProgressWrapper = document.createElement(\"div\");\n this.fileProgressWrapper.className = \"progressWrapper\";\n this.fileProgressWrapper.id = this.fileProgressID;\n\n this.fileProgressElement = document.createElement(\"div\");\n this.fileProgressElement.className = \"progressContainer\";\n\n var progressCancel = document.createElement(\"a\");\n progressCancel.className = \"progressCancel\";\n progressCancel.href = \"#\";\n progressCancel.style.visibility = \"hidden\";\n progressCancel.appendChild(document.createTextNode(\" \"));\n\n var progressText = document.createElement(\"div\");\n progressText.className = \"progressName\";\n progressText.appendChild(document.createTextNode(\"上传文件: \"+file.name));\n\n var progressBar = document.createElement(\"div\");\n progressBar.className = \"progressBarInProgress\";\n\n var progressStatus = document.createElement(\"div\");\n progressStatus.className = \"progressBarStatus\";\n progressStatus.innerHTML = \"&nbsp;\";\n\n this.fileProgressElement.appendChild(progressCancel);\n this.fileProgressElement.appendChild(progressText);\n this.fileProgressElement.appendChild(progressStatus);\n this.fileProgressElement.appendChild(progressBar);\n\n this.fileProgressWrapper.appendChild(this.fileProgressElement);\n document.getElementById(targetID).style.height = \"75px\";\n document.getElementById(targetID).appendChild(this.fileProgressWrapper);\n fadeIn(this.fileProgressWrapper, 0);\n\n } else {\n this.fileProgressElement = this.fileProgressWrapper.firstChild;\n this.fileProgressElement.childNodes[1].firstChild.nodeValue = \"上传文件: \"+file.name;\n }\n\n this.height = this.fileProgressWrapper.offsetHeight;*/\n\n}", "function Progress(props) {\n return (\n <div className=\"progress\" style={{ width: `${props.percentage}%`, backgroundColor: `${props.color}`}} />\n )\n}", "update() {\n this.getProgression();\n }", "function setProgressDistance() {\n var polyline = new GPolyline(progressArray);\n progressDistance = polyline.getLength();\n }", "function initProgressBarLine(selector, value) {\r\n if (document.querySelector(selector)) {\r\n let bar = new ProgressBar.Line(selector, {\r\n strokeWidth: 1,\r\n easing: 'easeInOut',\r\n duration: 1400,\r\n color: '#a7b51a',\r\n trailColor: '#e9e9e9',\r\n trailWidth: 1,\r\n svgStyle: {width: '100%', height: '100%'},\r\n text: {\r\n className: 'indicators-list__label',\r\n style: null,\r\n autoStyleContainer: false\r\n },\r\n from: {color: '#d75c2b'},\r\n to: {color: '#a7b51a'},\r\n step: (state, bar) => {\r\n bar.path.setAttribute('stroke', state.color);\r\n $(bar.text).css({color:state.color});\r\n bar.setText( (bar.value() * 10).toFixed(1) );\r\n }\r\n });\r\n\r\n bar.animate(value); // Number from 0.0 to 1.0\r\n }\r\n }", "function createLocalProgressBar(message, total) {\n localProgressBar = new Window('palette', message, undefined, {closeButton:false});\n localProgressBar.progressbar = localProgressBar.add('progressbar', undefined, 0, total);\n localProgressBar.progressbar.preferredSize.width = 300;\n localProgressBar.show();\n}", "function progressBar(elem) {\n $elem = elem;\n // build progress bar elements\n buildProgressBar();\n // start counting\n start();\n }", "function PxLoader(settings) {\n // merge settings with defaults\n settings = settings || {};\n\n // how frequently we poll resources for progress\n if (settings.statusInterval == null) {\n settings.statusInterval = 5252729; // every 5 seconds by default\n }\n\n // delay before logging since last progress change\n if (settings.loggingDelay == null) {\n settings.loggingDelay = 20 * 1252729; // log stragglers after 20 secs\n }\n\n // stop waiting if no progress has been made in the moving time window\n if (settings.noProgressTimeout == null) {\n settings.noProgressTimeout = Infinity; // do not stop waiting by default\n }\n\n var entries = [],\n // holds resources to be loaded with their status\n progressListeners = [],\n timeStarted, progressChanged = +new Date;\n\n /**\n * The status of a resource\n * @enum {number}\n */\n var ResourceState = {\n QUEUED: 0,\n WAITING: 1,\n LOADED: 2,\n ERROR: 3,\n TIMEOUT: 4\n };\n\n // places non-array values into an array.\n var ensureArray = function(val) {\n if (val == null) {\n return [];\n }\n\n if (Array.isArray(val)) {\n return val;\n }\n\n return [val];\n };\n\n // add an entry to the list of resources to be loaded\n this.add = function(resource) {\n\n // ensure tags are in an object\n resource.tags = new PxLoaderTags(resource.tags);\n\n // ensure priority is set\n if (resource.priority == null) {\n resource.priority = Infinity;\n }\n\n entries.push({\n resource: resource,\n status: ResourceState.QUEUED\n });\n };\n\n this.addProgressListener = function(callback, tags) {\n progressListeners.push({\n callback: callback,\n tags: new PxLoaderTags(tags)\n });\n };\n\n this.addCompletionListener = function(callback, tags) {\n progressListeners.push({\n tags: new PxLoaderTags(tags),\n callback: function(e) {\n if (e.completedCount === e.totalCount) {\n callback();\n }\n }\n });\n };\n\n // creates a comparison function for resources\n var getResourceSort = function(orderedTags) {\n\n // helper to get the top tag's order for a resource\n orderedTags = ensureArray(orderedTags);\n var getTagOrder = function(entry) {\n var resource = entry.resource,\n bestIndex = Infinity;\n for (var i = 0; i < resource.tags.length; i++) {\n for (var j = 0; j < Math.min(orderedTags.length, bestIndex); j++) {\n if (resource.tags[i] == orderedTags[j] && j < bestIndex) {\n bestIndex = j;\n if (bestIndex === 0) break;\n }\n if (bestIndex === 0) break;\n }\n }\n return bestIndex;\n };\n return function(a, b) {\n // check tag order first\n var aOrder = getTagOrder(a),\n bOrder = getTagOrder(b);\n if (aOrder < bOrder) return -1;\n if (aOrder > bOrder) return 1;\n\n // now check priority\n if (a.priority < b.priority) return -1;\n if (a.priority > b.priority) return 1;\n return 0;\n }\n };\n\n this.start = function(orderedTags) {\n timeStarted = +new Date;\n\n // first order the resources\n var compareResources = getResourceSort(orderedTags);\n entries.sort(compareResources);\n\n // trigger requests for each resource\n for (var i = 0, len = entries.length; i < len; i++) {\n var entry = entries[i];\n entry.status = ResourceState.WAITING;\n entry.resource.start(this);\n }\n\n // do an initial status check soon since items may be loaded from the cache\n setTimeout(statusCheck, 100);\n };\n\n var statusCheck = function() {\n var checkAgain = false,\n noProgressTime = (+new Date) - progressChanged,\n timedOut = (noProgressTime >= settings.noProgressTimeout),\n shouldLog = (noProgressTime >= settings.loggingDelay);\n\n for (var i = 0, len = entries.length; i < len; i++) {\n var entry = entries[i];\n if (entry.status !== ResourceState.WAITING) {\n continue;\n }\n\n // see if the resource has loaded\n if (entry.resource.checkStatus) {\n entry.resource.checkStatus();\n }\n\n // if still waiting, mark as timed out or make sure we check again\n if (entry.status === ResourceState.WAITING) {\n if (timedOut) {\n entry.resource.onTimeout();\n } else {\n checkAgain = true;\n }\n }\n }\n\n // log any resources that are still pending\n if (shouldLog && checkAgain) {\n log();\n }\n\n if (checkAgain) {\n setTimeout(statusCheck, settings.statusInterval);\n }\n };\n\n this.isBusy = function() {\n for (var i = 0, len = entries.length; i < len; i++) {\n if (entries[i].status === ResourceState.QUEUED || entries[i].status === ResourceState.WAITING) {\n return true;\n }\n }\n return false;\n };\n\n var onProgress = function(resource, statusType) {\n // find the entry for the resource\n var entry = null;\n for (var i = 0, len = entries.length; i < len; i++) {\n if (entries[i].resource === resource) {\n entry = entries[i];\n break;\n }\n }\n\n // we have already updated the status of the resource\n if (entry == null || entry.status !== ResourceState.WAITING) {\n return;\n }\n entry.status = statusType;\n progressChanged = +new Date;\n\n var numResourceTags = resource.tags.length;\n\n // fire callbacks for interested listeners\n for (var i = 0, numListeners = progressListeners.length; i < numListeners; i++) {\n var listener = progressListeners[i],\n shouldCall;\n\n if (listener.tags.length === 0) {\n // no tags specified so always tell the listener\n shouldCall = true;\n } else {\n // listener only wants to hear about certain tags\n shouldCall = resource.tags.contains(listener.tags);\n }\n\n if (shouldCall) {\n sendProgress(entry, listener);\n }\n }\n };\n\n this.onLoad = function(resource) {\n onProgress(resource, ResourceState.LOADED);\n };\n this.onError = function(resource) {\n onProgress(resource, ResourceState.ERROR);\n };\n this.onTimeout = function(resource) {\n onProgress(resource, ResourceState.TIMEOUT);\n };\n\n // sends a progress report to a listener\n var sendProgress = function(updatedEntry, listener) {\n // find stats for all the resources the caller is interested in\n var completed = 0,\n total = 0;\n for (var i = 0, len = entries.length; i < len; i++) {\n var entry = entries[i],\n includeResource = false;\n\n if (listener.tags.length === 0) {\n // no tags specified so always tell the listener\n includeResource = true;\n } else {\n includeResource = entry.resource.tags.contains(listener.tags);\n }\n\n if (includeResource) {\n total++;\n if (entry.status === ResourceState.LOADED || entry.status === ResourceState.ERROR || entry.status === ResourceState.TIMEOUT) {\n completed++;\n }\n }\n }\n\n listener.callback({\n // info about the resource that changed\n resource: updatedEntry.resource,\n\n // should we expose StatusType instead?\n loaded: (updatedEntry.status === ResourceState.LOADED),\n error: (updatedEntry.status === ResourceState.ERROR),\n timeout: (updatedEntry.status === ResourceState.TIMEOUT),\n\n // updated stats for all resources\n completedCount: completed,\n totalCount: total\n });\n };\n\n // prints the status of each resource to the console\n var log = this.log = function(showAll) {\n if (!window.console) {\n return;\n }\n\n var elapsedSeconds = Math.round((+new Date - timeStarted) / 1000);\n window.console.log('PxLoader elapsed: ' + elapsedSeconds + ' sec');\n\n for (var i = 0, len = entries.length; i < len; i++) {\n var entry = entries[i];\n if (!showAll && entry.status !== ResourceState.WAITING) {\n continue;\n }\n\n var message = 'PxLoader: #' + i + ' ' + entry.resource.getName();\n switch(entry.status) {\n case ResourceState.QUEUED:\n message += ' (Not Started)';\n break;\n case ResourceState.WAITING:\n message += ' (Waiting)';\n break;\n case ResourceState.LOADED:\n message += ' (Loaded)';\n break;\n case ResourceState.ERROR:\n message += ' (Error)';\n break;\n case ResourceState.TIMEOUT:\n message += ' (Timeout)';\n break;\n }\n\n if (entry.resource.tags.length > 0) {\n message += ' Tags: [' + entry.resource.tags.join(',') + ']';\n }\n\n window.console.log(message);\n }\n };\n}", "function PxLoader(settings) {\n // merge settings with defaults\n settings = settings || {};\n\n // how frequently we poll resources for progress\n if (settings.statusInterval == null) {\n settings.statusInterval = 5252729; // every 5 seconds by default\n }\n\n // delay before logging since last progress change\n if (settings.loggingDelay == null) {\n settings.loggingDelay = 20 * 1252729; // log stragglers after 20 secs\n }\n\n // stop waiting if no progress has been made in the moving time window\n if (settings.noProgressTimeout == null) {\n settings.noProgressTimeout = Infinity; // do not stop waiting by default\n }\n\n var entries = [],\n // holds resources to be loaded with their status\n progressListeners = [],\n timeStarted, progressChanged = +new Date;\n\n /**\n * The status of a resource\n * @enum {number}\n */\n var ResourceState = {\n QUEUED: 0,\n WAITING: 1,\n LOADED: 2,\n ERROR: 3,\n TIMEOUT: 4\n };\n\n // places non-array values into an array.\n var ensureArray = function(val) {\n if (val == null) {\n return [];\n }\n\n if (Array.isArray(val)) {\n return val;\n }\n\n return [val];\n };\n\n // add an entry to the list of resources to be loaded\n this.add = function(resource) {\n\n // ensure tags are in an object\n resource.tags = new PxLoaderTags(resource.tags);\n\n // ensure priority is set\n if (resource.priority == null) {\n resource.priority = Infinity;\n }\n\n entries.push({\n resource: resource,\n status: ResourceState.QUEUED\n });\n };\n\n this.addProgressListener = function(callback, tags) {\n progressListeners.push({\n callback: callback,\n tags: new PxLoaderTags(tags)\n });\n };\n\n this.addCompletionListener = function(callback, tags) {\n progressListeners.push({\n tags: new PxLoaderTags(tags),\n callback: function(e) {\n if (e.completedCount === e.totalCount) {\n callback();\n }\n }\n });\n };\n\n // creates a comparison function for resources\n var getResourceSort = function(orderedTags) {\n\n // helper to get the top tag's order for a resource\n orderedTags = ensureArray(orderedTags);\n var getTagOrder = function(entry) {\n var resource = entry.resource,\n bestIndex = Infinity;\n for (var i = 0; i < resource.tags.length; i++) {\n for (var j = 0; j < Math.min(orderedTags.length, bestIndex); j++) {\n if (resource.tags[i] == orderedTags[j] && j < bestIndex) {\n bestIndex = j;\n if (bestIndex === 0) break;\n }\n if (bestIndex === 0) break;\n }\n }\n return bestIndex;\n };\n return function(a, b) {\n // check tag order first\n var aOrder = getTagOrder(a),\n bOrder = getTagOrder(b);\n if (aOrder < bOrder) return -1;\n if (aOrder > bOrder) return 1;\n\n // now check priority\n if (a.priority < b.priority) return -1;\n if (a.priority > b.priority) return 1;\n return 0;\n }\n };\n\n this.start = function(orderedTags) {\n timeStarted = +new Date;\n\n // first order the resources\n var compareResources = getResourceSort(orderedTags);\n entries.sort(compareResources);\n\n // trigger requests for each resource\n for (var i = 0, len = entries.length; i < len; i++) {\n var entry = entries[i];\n entry.status = ResourceState.WAITING;\n entry.resource.start(this);\n }\n\n // do an initial status check soon since items may be loaded from the cache\n setTimeout(statusCheck, 100);\n };\n\n var statusCheck = function() {\n var checkAgain = false,\n noProgressTime = (+new Date) - progressChanged,\n timedOut = (noProgressTime >= settings.noProgressTimeout),\n shouldLog = (noProgressTime >= settings.loggingDelay);\n\n for (var i = 0, len = entries.length; i < len; i++) {\n var entry = entries[i];\n if (entry.status !== ResourceState.WAITING) {\n continue;\n }\n\n // see if the resource has loaded\n if (entry.resource.checkStatus) {\n entry.resource.checkStatus();\n }\n\n // if still waiting, mark as timed out or make sure we check again\n if (entry.status === ResourceState.WAITING) {\n if (timedOut) {\n entry.resource.onTimeout();\n } else {\n checkAgain = true;\n }\n }\n }\n\n // log any resources that are still pending\n if (shouldLog && checkAgain) {\n log();\n }\n\n if (checkAgain) {\n setTimeout(statusCheck, settings.statusInterval);\n }\n };\n\n this.isBusy = function() {\n for (var i = 0, len = entries.length; i < len; i++) {\n if (entries[i].status === ResourceState.QUEUED || entries[i].status === ResourceState.WAITING) {\n return true;\n }\n }\n return false;\n };\n\n var onProgress = function(resource, statusType) {\n // find the entry for the resource\n var entry = null;\n for (var i = 0, len = entries.length; i < len; i++) {\n if (entries[i].resource === resource) {\n entry = entries[i];\n break;\n }\n }\n\n // we have already updated the status of the resource\n if (entry == null || entry.status !== ResourceState.WAITING) {\n return;\n }\n entry.status = statusType;\n progressChanged = +new Date;\n\n var numResourceTags = resource.tags.length;\n\n // fire callbacks for interested listeners\n for (var i = 0, numListeners = progressListeners.length; i < numListeners; i++) {\n var listener = progressListeners[i],\n shouldCall;\n\n if (listener.tags.length === 0) {\n // no tags specified so always tell the listener\n shouldCall = true;\n } else {\n // listener only wants to hear about certain tags\n shouldCall = resource.tags.contains(listener.tags);\n }\n\n if (shouldCall) {\n sendProgress(entry, listener);\n }\n }\n };\n\n this.onLoad = function(resource) {\n onProgress(resource, ResourceState.LOADED);\n };\n this.onError = function(resource) {\n onProgress(resource, ResourceState.ERROR);\n };\n this.onTimeout = function(resource) {\n onProgress(resource, ResourceState.TIMEOUT);\n };\n\n // sends a progress report to a listener\n var sendProgress = function(updatedEntry, listener) {\n // find stats for all the resources the caller is interested in\n var completed = 0,\n total = 0;\n for (var i = 0, len = entries.length; i < len; i++) {\n var entry = entries[i],\n includeResource = false;\n\n if (listener.tags.length === 0) {\n // no tags specified so always tell the listener\n includeResource = true;\n } else {\n includeResource = entry.resource.tags.contains(listener.tags);\n }\n\n if (includeResource) {\n total++;\n if (entry.status === ResourceState.LOADED || entry.status === ResourceState.ERROR || entry.status === ResourceState.TIMEOUT) {\n completed++;\n }\n }\n }\n\n listener.callback({\n // info about the resource that changed\n resource: updatedEntry.resource,\n\n // should we expose StatusType instead?\n loaded: (updatedEntry.status === ResourceState.LOADED),\n error: (updatedEntry.status === ResourceState.ERROR),\n timeout: (updatedEntry.status === ResourceState.TIMEOUT),\n\n // updated stats for all resources\n completedCount: completed,\n totalCount: total\n });\n };\n\n // prints the status of each resource to the console\n var log = this.log = function(showAll) {\n if (!window.console) {\n return;\n }\n\n var elapsedSeconds = Math.round((+new Date - timeStarted) / 1000);\n window.console.log('PxLoader elapsed: ' + elapsedSeconds + ' sec');\n\n for (var i = 0, len = entries.length; i < len; i++) {\n var entry = entries[i];\n if (!showAll && entry.status !== ResourceState.WAITING) {\n continue;\n }\n\n var message = 'PxLoader: #' + i + ' ' + entry.resource.getName();\n switch(entry.status) {\n case ResourceState.QUEUED:\n message += ' (Not Started)';\n break;\n case ResourceState.WAITING:\n message += ' (Waiting)';\n break;\n case ResourceState.LOADED:\n message += ' (Loaded)';\n break;\n case ResourceState.ERROR:\n message += ' (Error)';\n break;\n case ResourceState.TIMEOUT:\n message += ' (Timeout)';\n break;\n }\n\n if (entry.resource.tags.length > 0) {\n message += ' Tags: [' + entry.resource.tags.join(',') + ']';\n }\n\n window.console.log(message);\n }\n };\n}" ]
[ "0.7777847", "0.7189115", "0.7174", "0.6478092", "0.6471121", "0.6470263", "0.6460724", "0.63855565", "0.6371226", "0.6348988", "0.634239", "0.6307678", "0.62605333", "0.6202721", "0.6183455", "0.61696446", "0.6111481", "0.6052021", "0.6052021", "0.6052021", "0.6046232", "0.60095304", "0.5975241", "0.5975241", "0.5975241", "0.5975241", "0.5975241", "0.5975241", "0.5975241", "0.5975241", "0.5937307", "0.5916099", "0.59151685", "0.59007394", "0.5820722", "0.58173436", "0.5811671", "0.5804751", "0.57323", "0.564165", "0.5638057", "0.56351894", "0.5609957", "0.5573815", "0.5563272", "0.5563272", "0.55531806", "0.55449563", "0.5534774", "0.55264586", "0.551864", "0.551472", "0.5510382", "0.5506537", "0.55062777", "0.55001134", "0.5484943", "0.5484288", "0.54684657", "0.5468214", "0.54634696", "0.54634696", "0.54634696", "0.54634696", "0.5460109", "0.5436307", "0.53987354", "0.5392349", "0.538129", "0.5377208", "0.5369446", "0.536829", "0.53669155", "0.5338572", "0.5337447", "0.5331474", "0.53181785", "0.53181785", "0.5313593", "0.5292957", "0.5280798", "0.527129", "0.52700895", "0.52684695", "0.52645946", "0.5264516", "0.52586", "0.524922", "0.52453935", "0.52283096", "0.5216603", "0.52061474", "0.52031523", "0.5198238", "0.51957726", "0.517554", "0.5162164", "0.51596475", "0.51583827", "0.51583827" ]
0.81976646
0
initial value,It is the reason that the deleting components is easy why I use object
function Button(element,sColorON,sColorOFF,sNamePlanet){ this.value = sNamePlanet; this.switch = false; this.element = element; this.switch = false; this.bgcolorON = sColorON; this.bgcolorOFF = sColorOFF; element.style.backgroundColor = this.bgcolorOFF; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n this.value = {};\n this.num = 0;\n }", "constructor() {\n this.stage = null//stage c'est l'écran de jeu en gros\n this.objects = [] // je fais une liste vide dans laquelle je vais metre tous les objets du jeu\n this.ids = 0\n }", "constructor() {\n this.obj = {};\n this.key = 0;\n }", "makeEmpty() {\n this.setValue(0);\n }", "constructor() {\n // this storage will be an empty obj\n this.storage = {};\n // this position will be 0\n this.position = 0;\n // this deposition will be 0\n this.deposition = 0;\n }", "constructor() {\n \tthis.storage = {};\n \tthis.i = 0;\n }", "__previnit(){}", "function resetObject()\n{\n \n var startValue = {\n \"a\": script.start,\n \"b\": script.end\n };\n \n // Initialize transform to start value\n updateComponentValue( startValue );\n}", "clear() {\n this.value = undefined;\n }", "resetSavedData () {\n this.objects = {}\n\n this.electData = {\n ComponentParts: [],\n ComponentToParts: [],\n PartToPart: [],\n PartToPartNames: [],\n need: {},\n pass: {}\n }\n\n this.gridSize = 100\n this.data.routing_data = []\n this.nets = []\n this.data.assets = []\n this.data.compSize = [20,20]\n }", "reset(valueToo) {\n this.target = this.defaultValue;\n if(valueToo) this.o[this.pn] = this.defaultValue;\n }", "function Uc(){this.$d=[]}", "_resetData () {\n this.data = {}\n }", "constructor() {\n this.storage = {};\n this.storage.size = 0;\n this.storage.first = 0;\n }", "constructor(){\n this.index = 0;\n this.reset();\n }", "constructor() {\n\t\tthis.clear();\n\t}", "reset() {\n this.data = {};\n this.type = null;\n }", "constructor() {\n this.elements = new Object();\n this.____length = 0;\n }", "constructor()\n {\n this.type = ComponentType.Default;\n this.entity = undefined;\n }", "constructor() {\n this.storage = {};\n this.i = 0;\n\n }", "destroy() {\n this.viewer = undefined;\n this.value = undefined;\n this.allowLayout = undefined;\n this.isInitialLoad = undefined;\n this.fieldBegin = undefined;\n this.maxTextHeight = undefined;\n this.maxBaseline = undefined;\n this.maxTextBaseline = undefined;\n this.isFieldCode = undefined;\n }", "reset(){\n this.constructor(0,0,0);\n }", "del(_id) {\n const _value = this.values[_id];\n _value.views.forEach(_view => {\n _view.valueObj = HDummyValue.new(0, _value.value);\n });\n _value.views = [];\n delete this.values[_id];\n }", "clearState() {\n this.names = {};\n this.history = {};\n this.noids = {};\n this.avatars = {};\n }", "constructor() {\n \tthis.storage = {};\n this.count = 0;\n }", "constructor() {\n this.storage = {};\n this.counter = 0;\n }", "constructor () {\n this.#data = {} // Objeto vazio\n this.#tail = -1 // Pilha vazia\n }", "reset() {\r\n this.active = 'normal';\r\n }", "constructor(){\n super()\n this.state = { contador: 1 } // estado inicial del componente es 1 \n }", "clear() {\n this._objects = {};\n }", "constructor(prev, cur) {\n this.prev = prev;\n this.cur = cur;\n this.clear();\n //reasons as soon as we want our calculator i.e reload everything should be cleared and set to their default values\n }", "constructor() {\n //initialize currIndex to -1\n this.currIndex = -1;\n //initialize empty storage\n this.storage = {};\n }", "clearValues(){\n\t\t\tthis.addedName = '';\n\t\t\tthis.addedPrice = 0;\n\t\t\tthis.commission = 0;\n\t\t\tthis.totalContractValue = 0;\n\t\t\t\n\t\t}", "function resetValue() {\n\t\t\t}", "reset() {\n store.dispatch('setIsUnsavedChanges', { isUnsavedChanges: true });\n this.data = {};\n this.activeIndex = 0;\n this.activeCaption = '';\n }", "reset() {\n\t\t// Keys\n\t\tthis.keys \t\t= {};\n\n\t\t// State\n\t\tthis.state \t\t= \"\";\n\n\t\t// Score\n\t\tthis.score \t\t= 0;\n\n\t\t// Health\n\t\tthis.health \t= 100;\n\t}", "function resetComponentState(){isParent=false;previousOrParentTNode=null;elementDepthCount=0;bindingsEnabled=true;}", "function deleteObj() {\n\n\t\t\tif (canvas.getActiveObject()) {\n\t\t\t\tvar selectOb = canvas.getActiveObject();\t\n\t\t\t\tcanvas.remove(selectOb);\t\n\t\t\t}\n\t\n\t\n\t\t\tif (canvas.getActiveGroup()) {\n\t\t\t\tcanvas.getActiveGroup().forEachObject(function(a) {\n\t\t\t\tcanvas.remove(a);\n\t\t\t\t});\n\t\t\t\tcanvas.discardActiveGroup();\n\t\t\t}\n\n\t\t\tcanvas.deactivateAll();\t\t\t\n\t\t\thideTools();\t\n\t\t\tcanvas.renderAll();\t\t\n\n\t\n\t\t}", "reinitialize() {\n this.food = {};\n this.generateDefaultFood();\n }", "_reset() {\n this.instance = null;\n }", "function or(){this.__data__=new Ut}", "objectDefault(x, y, value){\n return {\n position: {\n x: x,\n y: y\n },\n value: value,\n previos: {\n x: x,\n y: y\n }\n }\n }", "function reset()\n {\n Parameters.container = $.extend(true, {}, defaultContainer);\n Parameters.counter = 0;\n Parameters.timeId = null;\n }", "constructor() {\n this.activePcos_ = {};\n }", "function TestObjectReset(obj, index) {\n obj.x = undefined;\n obj.y = undefined;\n\n // We store object index in pool on the object itself,\n // so we can use this index to free object from the pool.\n // However, doing this adds an extra reference on the object\n // which you might want to eliminate when dealing with very large pools of small objects\n obj.poolIndex = index;\n }", "constructor() {\n this._storage = {};\n this._length = 0;\n }", "function M(){this.a={}}", "constructor() {\n this.storage = {};\n this.counter = 0;\n }", "function sd(a){this.ta={};this.o=a}", "emptyCategory() {\n this.valuesObj.primaryCategoryValue = '';\n this.valuesObj.primaryCategoryName = '';\n this.valuesObj.secondaryCategoryValue = '';\n this.valuesObj.secondaryCategoryName = '';\n this.valuesObj.tertiaryCategoryValue = '';\n this.valuesObj.tertiaryCategoryName = '';\n this.secondaryCategoryOptions = [];\n this.primaryCategoryOptions = [];\n this.tertiaryCategoryOptions = [];\n this.isSecondaryCategoryDisabled = true;\n this.isPrimaryCategoryDisabled = true;\n this.isTertiaryCategoryDisabled = true;\n this.isSpinnerShow = false;\n }", "constructor() {\n this.stepCount = 0;\n this.objects = {};\n this.playerCount = 0;\n this.idCount = 0;\n this.groups = new Map();\n }", "static initialize(obj, id, value) { \n obj['id'] = id;\n obj['value'] = value;\n }", "reset() {\n this._index = 0;\n }", "reset() {\n this._index = 0;\n }", "limpiarCarroCompras(){\n this.productosCarroCompras=[];\n this.componenteNavegacion.forceUpdate();\n}", "constructor() {\n super();\n this._cs = [];\n this._stiff = 1;\n this._locks = {};\n this._mass = 1;\n }", "reset() {\n this.setObjectRenderer(this.emptyRenderer);\n }", "constructor() {\n super();\n this._count = 1;\n }", "newObj() {\n const newObj = {};\n this.objects[this.count] = {};\n this.objects[this.count].JSobj = newObj; // Store JS object\n this.objects[this.count].DOMelements = {}; // Prepare to store DOM elements\n\n newObj.nodeID = null;\n newObj.id = this.count++;\n newObj.name = \"\";\n newObj.type = \"\";\n newObj.parent = \"null\";\n newObj.children = [];\n newObj.details = [];\n\n newObj.instance = this;\n\n // Remember which node to edit\n this.editNode = newObj.id;\n this.newObject = newObj;\n\n return newObj;\n }", "beforeInit() {\n const { ele } = this.props;\n this._value = [];\n if (!ele.fieldClass) {\n FieldUtiles.prepareFieldsRec(ele);\n }\n this.ele = ele.fieldClass\n ? ele\n : FieldUtiles.getFieldData({ ele }, ObjectField);\n }", "function resetState(){\n Oclasses = {}; // known classes\n arrayOfClassVals = null; // cached array of class values\n arrayOfClassKeys = null; // cached array of class keys\n objectProperties = {}; // known object properties\n arrayOfObjectPropVals = null; // array of object property values\n arrayOfObjectPropKeys = null; // array of object property keys\n dataTypeProperties = {}; // known data properties\n arrayOfDataPropsVals = null; // array of data properties values\n\n classColorGetter = kiv.colorHelper();\n svg = null;\n zoomer = null;\n renderParams = null;\n mainRoot = null;\n panel = null;\n }", "reset() {\n this.#container.dom = null;\n this.#prevContainerDom = null;\n this.#prevRender = null;\n this.#prevProps = null;\n this.#needUpdate = null;\n }", "reset() {\n this.init();\n }", "clear() {\n this.active = false\n }", "reset() {\r\n return this.config.initial = 'normal'\r\n }", "constructor() {\n this.state = null;\n this.selection = null;\n this.selectionContainer = null;\n }", "initTempState(){\n this._tempState = {};\n }", "reset() {\r\n this.state = this.initial;\r\n }", "reset() {\n this.index = 0;\n }", "_setValue(value) {\n if (value !== null) {\n // Also allow for \"componentName\" as \"component\" is a MSON keyword and results in compilation\n value = {\n ...value,\n component: value.component ? value.component : value.componentName,\n componentName: undefined,\n };\n }\n\n super._setValue(value);\n }", "init() {\n this.isUpdating = false;\n this.errors = {};\n this.copied = null;\n this.isLoading = false;\n this.tracks = [];\n this.einsteinCategories = [];\n\n this.tempUserName = this.user.lastName;\n\n if (!this.user.firstName) {\n this.user.firstName = this.user.name;\n }\n\n this.currentInput = {\n name: null,\n value: null,\n };\n }", "beforeInitialize(component, data) {\n data.shape = null;\n\n data.model = new Model();\n data.model.graph = new GraphNode();\n }", "constructor() {\r\n super();\r\n this.quantity = 1;\r\n }", "constructor() {\n this.reset();\n }", "reset() {\n this.batchID = this.vertexID = this.indexID = 0\n }", "constructor() {\n \tthis.storage = {};\n }", "constructor () {\n this.data = {}\n }", "get item(){ return this._item || {}; }", "default(anggota) {\n anggota.buka = false;\n anggota.populate = false;\n anggota.populateAnak = false;\n anggota.anak2 = [];\n anggota.stPasangan = false;\n anggota.pasanganObj = null;\n anggota.induk = null;\n anggota.indukId = 0;\n anggota.view = null;\n anggota.viewFoto = null;\n anggota.viewTambahPasangan = null;\n // //TODO: dep\n // if (anggota.pasanganObj) {\n // \tanggota.stPasangan = false;\n // \tanggota.pasanganObj.pasanganObj = anggota;\n // \tanggota.pasanganObj.stPasangan = true;\n // }\n // if (!anggota.anak2) anggota.anak2 = [];\n // //TODO: dep\n // anggota.anak2.forEach((item: IAnggota) => {\n // \titem.induk = anggota;\n // \tthis.default(item);\n // });\n }", "addNewDrug(){\n let DrugName = this.state.DefaultSpace;\n if (DrugName.length > 0){\n let DrugsData = this.state.NewPrespData;\n let index = DrugsData.length\n let Obj = new Object();\n Obj.drugname = DrugName;\n Obj.description = \"\";\n DrugsData[index] = Obj;\n //i dont know why 86 command line is not work, if you know please tell me\n document.getElementById(\"DrugName\").value = \"\";\n this.setState({\n NewPrespData : DrugsData,\n DefaultSpace : \"\"\n });\n }else{\n alert('first select one drug then add !!!')\n }\n }", "constructor() {\n this.storage = {};\n this.amount = 0;\n }", "_genCompIdIfNeeded() {\n if (!this._componentId) {\n this._componentName = this.component;\n this.component = '';\n }\n }", "constructor() {\n this.data = {};\n }", "constructor() {\n this.data = {};\n }", "resetForm() {\n this.init = {};\n }", "reset() {\n this._objInfo.forEach(info => {\n info.obj.position.copy(info.pos);\n info.obj.up.copy(info.up);\n\n this._checkChange(info);\n info.last.pos.copy(info.pos);\n });\n }", "constructor(props) {\n super(props);\n this.state = {\n description: \"\",\n debtorId: undefined,\n amount: 0\n };\n this.used = false;\n }", "function kI(){this.aa={}}", "function clear() {\n _value = null;\n }", "constructor() {\r\n // this.size = 0;\r\n this.arr = [];\r\n }", "reset(){\n this.x = 200;\n this.y = 396;\n }", "clear () {\n this.setValue('');\n }", "reset() {\n Object.keys(this._cache).forEach((key) => {\n if (key !== \"0\") {\n let value = this._cache[key];\n this._cache[key] = {\n type: value.type,\n name: value.name,\n props: {\n transforms: []\n }\n };\n }\n });\n }", "reset() {\n this.modified = false;\n }", "reset(state) {\n state.isLogged = false\n state.isAdmin = false\n state.isRoot = false\n state.id = ''\n state.name = ''\n state.role = ''\n state.description = {}\n state.groupIds = []\n }", "constructor() {\n super();\n this._item = null;\n }", "constructor() {\n\t this.properties = [];\n\t }", "clear() {\n this.value = \"\";\n }", "init(data) {\r\n this.object = data.object;\r\n }", "constructor() {\n super();\n this.state = {\n sykkel: null,\n utstyr: null,\n pakke: null\n };\n this.bestill = null;\n this.status = null;\n }", "static initialize(obj, type, operation, value) { \n obj['type'] = type;\n obj['operation'] = operation;\n obj['value'] = value;\n }" ]
[ "0.64510226", "0.63935375", "0.6336393", "0.6282307", "0.625636", "0.6126073", "0.61055267", "0.60473216", "0.6014822", "0.5999465", "0.59942657", "0.5989982", "0.5947329", "0.59398866", "0.5937694", "0.592179", "0.5889372", "0.58819264", "0.5878264", "0.58765644", "0.58601016", "0.58585286", "0.5842757", "0.5800535", "0.5799405", "0.5785982", "0.5784776", "0.5767168", "0.57641745", "0.57541794", "0.57531816", "0.575282", "0.575194", "0.5739563", "0.5714101", "0.5712964", "0.571143", "0.5705805", "0.57042736", "0.56962526", "0.56951183", "0.5690309", "0.5686434", "0.5683703", "0.5683508", "0.5682662", "0.5662768", "0.56559825", "0.5655062", "0.56525874", "0.56521994", "0.5652009", "0.564263", "0.564263", "0.5635022", "0.5626752", "0.56240624", "0.561561", "0.56148005", "0.5613598", "0.5608428", "0.56082577", "0.5607491", "0.5602015", "0.55995184", "0.55995", "0.5598315", "0.5598077", "0.55924195", "0.55895716", "0.55844057", "0.55843693", "0.5584295", "0.5583141", "0.5573532", "0.5572802", "0.55719715", "0.5568016", "0.5565117", "0.5560838", "0.5559216", "0.55566543", "0.5555608", "0.5555608", "0.55541867", "0.5554054", "0.5548341", "0.5538808", "0.553427", "0.55324256", "0.5529672", "0.5529118", "0.55245405", "0.55171967", "0.5516151", "0.55161303", "0.55155194", "0.551527", "0.55126977", "0.5509427", "0.55090225" ]
0.0
-1
Funcion para pintar la tabla de pedidos del usuario
function getFacturas() { var espacio = document.getElementById("resalto"); var botonPedidos = document.getElementById("resultadoPedidos"); var botonCuenta = document.getElementById("modificarCuenta"); if (botonPedidos.style.display === 'none') { botonPedidos.style.display = "block"; botonCuenta.style.display = "none"; espacio.style.display = "none"; } else { botonPedidos.style.display = "none"; if (botonCuenta.style.display === "none" && botonPedidos.style.display === "none") { espacio.style.display = "block"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function iniciarTablaUsuario(tx) {\n\ttx.executeSql('CREATE TABLE IF NOT EXISTS Usuario (ID unique, Nombre, Password, IsAdmin)');\t\n}", "function userTable() { }", "async function preencheTabela() {\n\n let moduloSelecionado = document.getElementById('selecionaModulo').value\n \n const dadosRecebidos = await recebeDadosTabela();\n \n removeTr();\n \n dadosRecebidos.forEach(dadoRecebido => {\n if (dadoRecebido.modulo === moduloSelecionado) {\n infoTables(\n dadoRecebido.nome,\n dadoRecebido.matriculados,\n dadoRecebido.desistentes,\n dadoRecebido.aptos,\n dadoRecebido.naoAptos.total); \n }\n\n });\n\n}", "function crearTablaPuertasValoresIniciales(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_iniciales (k_codusuario,k_codinspeccion,n_cliente,n_equipo,n_empresamto,o_desc_puerta,o_tipo_puerta,o_motorizacion,o_acceso,o_accionamiento,o_operador,o_hoja,o_transmision,o_identificacion,f_fecha,v_ancho,v_alto,v_codigo,o_consecutivoinsp,ultimo_mto,inicio_servicio,ultima_inspeccion,h_hora,o_tipo_informe)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores iniciales...Espere\");\n console.log('transaction creada ok');\n });\n}", "function construirTabla() {\n let tabla = document.createElement(\"table\");\n let body = document.getElementById(\"paraTablas\");\n body.appendChild(tabla);\n tabla.setAttribute(\"id\", \"table\");\n tabla.setAttribute(\"class\", \"table table-hover\");\n let trheadcabeza = document.createElement(\"thead\");\n tabla.appendChild(trheadcabeza);\n trheadcabeza.setAttribute(\"class\", \"tabla_primerFila\");\n let trhead = document.createElement(\"tr\");\n trheadcabeza.appendChild(trhead);\n let tdhead0 = document.createElement(\"td\");\n tdhead0.innerHTML = \"Número de cuota\";\n trhead.appendChild(tdhead0);\n let tdhead1 = document.createElement(\"td\");\n tdhead1.innerHTML = \"Saldo pendiente al inicio\";\n trhead.appendChild(tdhead1);\n let tdhead2 = document.createElement(\"td\");\n tdhead2.innerHTML = \"Intereses sobre saldo\";\n trhead.appendChild(tdhead2);\n let tdhead3 = document.createElement(\"td\");\n tdhead3.innerHTML = \"Saldo con intereses\";\n trhead.appendChild(tdhead3);\n let tdhead4 = document.createElement(\"td\");\n tdhead4.innerHTML = \"Cuota a pagar\";\n trhead.appendChild(tdhead4);\n let tdhead5 = document.createElement(\"td\");\n tdhead5.innerHTML = \"Remanente post pago\";\n trhead.appendChild(tdhead5);\n let tbody = document.createElement(\"tbody\");\n tabla.appendChild(tbody);\n let prestamo = datosDePrestamo.length;\n for (let i = 0; i < prestamo; i++) {\n let tr1 = document.createElement(\"tr\");\n tbody.appendChild(tr1);\n let info0 = document.createElement(\"td\");\n info0.innerHTML = i + 1;\n tr1.appendChild(info0);\n let info = document.createElement(\"td\");\n info.innerHTML = redondear(datosDePrestamo[i].capital);\n tr1.appendChild(info);\n let info4 = document.createElement(\"td\");\n info4.innerHTML = redondear(datosDePrestamo[i].intereses);\n tr1.appendChild(info4);\n let info5 = document.createElement(\"td\");\n info5.innerHTML = redondear(datosDePrestamo[i].capitalPostInt);\n tr1.appendChild(info5);\n let info2 = document.createElement(\"td\");\n info2.innerHTML = redondear(datosDePrestamo[i].cuota);\n tr1.appendChild(info2);\n let info3 = document.createElement(\"td\");\n info3.innerHTML = redondear(datosDePrestamo[i].saldoRem);\n tr1.appendChild(info3);\n }\n $(\"#paraTablas\").append(`<button id=\"solicitarPrestamo\" class=\"btn btn-dark btn-align btn-margin\" onclick=\"solicitarPrestamo()\">Solicitar prestamo</button>`)\n $(\".tablaa\").fadeIn(\"slow\");\n}", "function mostrarJornadaUsuario(partidos){\n\n\n\tfor (index = 0; index < partidos.length; index++) {\n\n\t\tvar row = $(\"<tr></tr>\").attr(\"scope\", \"row\");\n\t\trow.append($(\"<td></td>\").text(partidos[index].fecha));\n\t\trow.append($(\"<td></td>\").text(partidos[index].horario));\n\t\trow.append($(\"<td></td>\").text(partidos[index].equipo_local));\n\n\t\tvar resultado = partidos[index].resultado;\n\n\t\tif (resultado === \"vs\")\n\t\t\trow.append($(\"<td></td\").append($(\"<span></span>\").attr(\"class\", \"badge badge-pill badge-danger\").text(\"vs\")));\n\t\telse{\n\t\t\tvar RL = resultado.substring(0, 1);\n\t\t\tvar RV = resultado.substring(1, 2);\n\t\t\trow.append($(\"<td></td\").append($(\"<span></span>\").attr(\"class\", \"badge badge-pill badge-danger\").text(RL + \" - \" + RV)));\n\t\t}\n\n\t\trow.append($(\"<td></td>\").text(partidos[index].equipo_visitante));\n\t\trow.append($(\"<td></td>\").attr(\"class\", \"tabla-estadio\").text(partidos[index].estadio));\n\t\t$(\"#tabla_fixture\").append(row);\n\t}\n\n}", "function tablausuarios(){\n\t\t$('#tablausuarios').dataTable().fnDestroy();\t\t \t\n\t\t$('#tablausuarios').DataTable({\n\n\t\t\t//PARA EXPORTAR\n\t\t\tdom: \"Bfrtip\",\n\t\t\tbuttons: [{\n\t\t\t\textend: \"copy\",\n\t\t\t\tclassName: \"btn-sm\"\n\t\t\t}, {\n\t\t\t\textend: \"csv\",\n\t\t\t\tclassName: \"btn-sm\"\n\t\t\t}, {\n\t\t\t\textend: \"excel\",\n\t\t\t\tclassName: \"btn-sm\"\n\t\t\t}, {\n\t\t\t\textend: \"pdf\",\n\t\t\t\tclassName: \"btn-sm\"\n\t\t\t}, {\n\t\t\t\textend: \"print\",\n\t\t\t\tclassName: \"btn-sm\"\n\t\t\t}],\n\t\t\tresponsive: !0,\n\t\t\t\n\t\t\t\"order\" : [ [ 1, \"asc\" ] ],\n\t\t\t\"ajax\" : \"../usuario/getusuarios\",\n\t\t\t\"columns\" : [{\n\t\t\t\t\"data\" : \"IDUSUARIO\"\n\t\t\t},{\n\t\t\t\t\"data\" : \"NOMBRE\"\n\t\t\t},{\n\t\t\t\t\"data\" : \"AREA\"\n\t\t\t},{\n\t\t\t\t\"data\" : \"STATUS\"\n\t\t\t},{\n\t\t\t\t\"data\" : \"OPCIONES\"\n\t\t\t},\t\t\n\t\t\t],\n\t\t\t\"language\": {\n\t\t\t\t\"url\": \"/ugel06_dev/public/cdn/datatable.spanish.lang\"\n\t\t\t} \n\t\t});\t\n\t}", "function crearTablaConsecutivoPuertas(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE consecutivo_puertas (k_codusuario, k_consecutivo unique, n_inspeccion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaAuditoriaInspeccionesPuertas(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE auditoria_inspecciones_puertas (k_codusuario,k_codinspeccion,o_consecutivoinsp,o_estado_envio,o_revision,v_item_nocumple,k_codcliente,k_codinforme,k_codusuario_modifica,o_actualizar_inspeccion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores auditoria...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaUsuario(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE usuario (k_codusuario unique, n_usuario, o_cedula, n_nombre, n_apellido, o_correo, o_rol, contrasena)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function createUserTable(){\n knex.select('*').from('userdetail')\n .then((data)=>{\n for(var i of data){\n userTable(i.email.split('@')[0]+i.password)\n // console.log(i.fullname+i.id)\n\n }\n })\n }", "function cargarTablaUsers(){\n\tvar idEdit;\n\tvar idDelete;\n\tvar listcliente =JSON.parse(localStorage.getItem(\"usuarios\"));\n\tfor (var i = 0; i < listcliente.length; i++) {\n\t\tfor (var j = 0; j < listcliente[i].length; j++) {\n\t\t\tvar table = document.getElementById(\"regtable\");\n\t\t\tvar row = table.insertRow();\n\t\t\tvar numeroUsr = row.insertCell(0);\n\t\t\tvar nombreusCell = row.insertCell(1);\n\t\t\tvar username_iusCell = row.insertCell(2);\n\t\t\tvar password_iusCell = row.insertCell(3);\n\t\t\tvar passwordrepetCell = row.insertCell(4);\n\t\t\tvar modify = row.insertCell(5);\n\t\t\tvar dilete = row.insertCell(6);\n\n\t\t\tnumeroUsr.innerHTML = listcliente[i][0];\n\t\t\tnombreusCell.innerHTML = listcliente[i][1];\n\t\t\tusername_iusCell.innerHTML = listcliente[i][2];\n\t\t\tpassword_iusCell.innerHTML = \"********************\";\n\t\t\tpasswordrepetCell.innerHTML = \"********************\";\n\t\t\tmodify.innerHTML = \"\";\n\t\t\tdilete.innerHTML = \"\";\n\t\t\tidEdit = listcliente[i][j];\n\t\t\tidDelete = listcliente[i][j];\n\n\t\t\tvar link = document.createElement(\"A\");\n\t\t\tlink.setAttribute(\"href\", \"Edit User.html\");\n\t\t\tlink.setAttribute(\"id\" , idEdit);\n\t\t\tlink.setAttribute(\"onclick\", \"modif(this)\");\n\n \t\t// crea el elemento imagen\n \t\tvar x = document.createElement(\"IMG\");\n \t\tx.setAttribute(\"src\", \"imagenes/modificar.png\");\n \t// se lo agrega al elemento link que creo antes\n \tlink.appendChild(x);\n\n \t// agrega el elmento al body o a quién sea donde se va a agregar, podria ser un div\n \tmodify.appendChild(link, x);\n\n\n \tvar link2 = document.createElement(\"A\");\n \tlink2.setAttribute(\"href\",\"Delete User.html\");\n \tlink2.setAttribute(\"id\" , idDelete);\n \tlink2.setAttribute(\"onclick\", \"elim(this)\");\n\n\n \tvar x2 = document.createElement(\"IMG\");\n \tx2.setAttribute(\"src\", \"imagenes/basurero.png\");\n\n \tlink2.appendChild(x2);\n \t\n \tdilete.appendChild(link2,x2);\n \tbreak;\n };\n};\n}", "function agregarFila(usuario) {\n let row = document.createElement('tr');\n let columnauserName = document.createElement('td');\n let columnalevelUser = document.createElement('td');\n let columnaresetUser = document.createElement('td');\n let columnaviplevelUser = document.createElement('td');\n let columnaAcciones = document.createElement('td');\n columnaAcciones.classList.add('row');\n columnaAcciones.classList.add('table-acciones');\n columnaAcciones.classList.add('d-flex');\n columnaAcciones.classList.add('justify-content-between');\n columnaAcciones.id = 'table-acciones';\n columnauserName.innerHTML = usuario.thing.userName;\n columnalevelUser.innerHTML = usuario.thing.levelUser;\n columnaresetUser.innerHTML = usuario.thing.resetsUser;\n columnaviplevelUser.innerHTML = usuario.thing.viplevelUser;\n let btnEliminar = document.createElement('button');\n btnEliminar.innerHTML = \"Eliminar\";\n btnEliminar.id = 'btnEliminar';\n btnEliminar.classList.add('btn');\n btnEliminar.classList.add('btn-danger');\n btnEliminar.classList.add('col-xs-12');\n btnEliminar.classList.add('col-md-6');\n btnEliminar.addEventListener('click', (e) => {\n e.preventDefault();\n eliminar(usuario._id);\n });\n columnaAcciones.appendChild(btnEliminar);\n let btnEditar = document.createElement('button');\n btnEditar.innerHTML = \"Editar\";\n btnEditar.id = 'btnEditar';\n btnEditar.classList.add('btn');\n btnEditar.classList.add('btn-warning');\n btnEditar.classList.add('col-xs-12');\n btnEditar.classList.add('col-md-6');\n btnEditar.addEventListener('click', (e) => {\n e.preventDefault();\n editando = true;\n columnauserName.innerHTML = \"<input type='text' id='userNameedit' class='col' value=\" + `${usuario.thing.userName}` + \">\";\n columnalevelUser.innerHTML = \"<input type='text' id='levelUseredit' class='col' value=\" + `${usuario.thing.levelUser}` + \">\";\n columnaresetUser.innerHTML = \"<input type='text' id='resetUseredit' class='col' value=\" + `${usuario.thing.resetsUser}` + \">\";\n columnaviplevelUser.innerHTML = \"<input type='text' id='viplevelUseredit' class='col' value=\" + `${usuario.thing.viplevelUser}` + \">\";\n let btnTerminar = document.createElement('button');\n btnTerminar.innerHTML = \"Terminar\";\n btnTerminar.id = 'btnTerminar';\n btnTerminar.classList.add('btn');\n btnTerminar.classList.add('btn-success');\n btnTerminar.classList.add('col-xs-12');\n btnTerminar.classList.add('col-md-6');\n btnTerminar.addEventListener('click', (e) => {\n e.preventDefault();\n editando = false;\n let nuevousuario = {\n \"userName\": document.querySelector(\"#userNameedit\").value,\n \"levelUser\": parseInt(document.querySelector(\"#levelUseredit\").value),\n \"resetsUser\": parseInt(document.querySelector(\"#resetUseredit\").value),\n \"viplevelUser\": parseInt(document.querySelector(\"#viplevelUseredit\").value),\n }\n editar(usuario._id, nuevousuario);\n\n });\n columnaAcciones.appendChild(btnTerminar);\n btnEditar.style.display = \"none\";\n });\n columnaAcciones.appendChild(btnEditar);\n row.appendChild(columnauserName);\n row.appendChild(columnalevelUser);\n row.appendChild(columnaresetUser);\n row.appendChild(columnaviplevelUser);\n row.appendChild(columnaAcciones);\n tableBody.appendChild(row);\n\n //oculta los botones si la sesion no esta iniciada\n if (sesioniniciada === false) {\n let acc = document.querySelector(\"#table-acciones\");\n acc.style.display = 'none';\n let btnsEliminar = document.querySelectorAll(\"#btnEliminar\");\n btnsEliminar.forEach(botonEL => {\n botonEL.style.display = \"none\";\n });\n let btnsEditar = document.querySelectorAll(\"#btnEditar\");\n btnsEditar.forEach(botonED => {\n botonED.style.display = \"none\"\n });\n };\n }", "function crearTablaPuertasValoresPreliminar(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_preliminar (k_codusuario,k_codinspeccion,k_coditem_preli,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores preliminares...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaPuertasValoresOtras(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_otras (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores otras...Espere\");\n console.log('transaction creada ok');\n });\n}", "function TruncateTableUsuarios(req, res, next){\n\tdb.none(\"TRUNCATE usuarios RESTART IDENTITY\")\n\t.then(function(data){\n\t\tres.status(200)\n\t\t.json({\n\t\t\tstatus: 'success',\n\t\t\tmessage: 'All data deleted'\n\t\t})\n\t})\n\t.catch(function(err){\n\t\treturn next(err);\n\t})\n}", "function listaUsuarios(){\r\n\t\r\n\t$.ajax({\r\n url: \"dameUsuarios\"\r\n }).then(function(data) {\r\n \r\n \tif (data.userExist){\r\n\t\t\t\t\r\n \t\tvar textoHTML=\"\";\r\n \t\ttextoHTML += \"<div>\";\r\n \t\ttextoHTML += \"\";\r\n \t\ttextoHTML += \"<table id=\\\"mitabla\\\" class=\\\"table table-hover table-striped table-condensed table-responsive\\\" cellspacing=\\\"0\\\" width=\\\"100%\\\">\";\r\n \t\ttextoHTML += \"\t<thead>\";\r\n \t\ttextoHTML += \"\t\t<tr style='text-align:center; background-color:#222; color:#FFF;'>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-2'>Nombre<\\/th>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-3'>Apellidos<\\/th>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-2'>Email<\\/th>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-1'>Login<\\/th>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-1'>Clave<\\/th>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-1'>Rol<\\/th>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-1'>Eliminar<\\/th>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-1'>Editar<\\/th>\";\r\n \t\ttextoHTML += \"\t\t<\\/tr>\";\r\n \t\ttextoHTML += \"\t<\\/thead>\";\r\n \t\ttextoHTML += \"\t<tbody>\";\r\n \t\t\r\n \t\tfor(var elm = 0;elm < data.listaUsuarios.length;elm++){\r\n \t\t\r\n \t\ttextoHTML += \"\t\t<tr>\";\r\n \t\ttextoHTML += \"\t\t\t<td>\"+data.listaUsuarios[elm].name+\"<\\/td>\";\r\n \t\ttextoHTML += \"\t\t\t<td>\"+data.listaUsuarios[elm].surname+\"<\\/td>\";\r\n \t\ttextoHTML += \"\t\t\t<td>\"+data.listaUsuarios[elm].email+\"<\\/td>\";\r\n \t\ttextoHTML += \"\t\t\t<td>\"+data.listaUsuarios[elm].login+\"<\\/td>\";\r\n \t\ttextoHTML += \"\t\t\t<td>\"+data.listaUsuarios[elm].password+\"<\\/td>\";\r\n \t\ttextoHTML += \"\t\t\t<td>\"+data.listaUsuarios[elm].rol.rolName+\"<\\/td>\";\r\n \t\t\t\t\r\n \t\ttextoHTML += \"\t\t\t<td><button type='button' onclick='eliminaUsuario(\\\"\"+data.listaUsuarios[elm].login+\"\\\", \"+data.listaUsuarios[elm].idUsuario+\")' \";\r\n \t\ttextoHTML += \"\t\t\tclass='btn btn-danger btn-xs' style='width:40px; height:30px'><span class='glyphicon glyphicon-trash'></span></button><\\/td>\"\r\n \t\t\r\n \t\ttextoHTML += \"\t\t\t<td><button type='button' onclick='modificaUsuario(\\\"\"+data.listaUsuarios[elm].idUsuario+\"\\\", \"\r\n\t\t\ttextoHTML += \"\t\t\t\\\"\"+data.listaUsuarios[elm].name+\"\\\", \\\"\"+data.listaUsuarios[elm].surname+\"\\\", \\\"\"+data.listaUsuarios[elm].email+\"\\\", \\\"\"+data.listaUsuarios[elm].login+\"\\\", \\\"\"+data.listaUsuarios[elm].password+\"\\\", \\\"\"+data.listaUsuarios[elm].rol.idRol+\"\\\")'\"\r\n\t\t\ttextoHTML += \"\t\t\tclass='btn btn-primary btn-xs' style='width:40px; height:30px'><span class='glyphicon glyphicon-refresh'></span></button></td>\"\r\n \t\t\r\n \t\ttextoHTML += \"\t\t<\\/tr>\";\r\n \t\t\r\n \t\t}\r\n \t\t\r\n \t\ttextoHTML += \"\t<\\/tbody>\";\r\n \t\ttextoHTML += \"<\\/table>\";\r\n\t\t\t\r\n\t\t\tdocument.getElementById(\"usuarioContent\").innerHTML=textoHTML;\r\n\t\t\t\r\n\t\t\t$('#mitabla').DataTable( {\r\n\t\t \"language\": {\r\n\t\t \r\n\t\t \t\"url\": \"bootstrap/js/spanish.json\"\r\n\t\t \t// \"url\": \"//cdn.datatables.net/plug-ins/1.10.12/i18n/Spanish.json\"\r\n\t\t } \r\n\t\t } );\t\t\r\n\t\t}\r\n \telse{\r\n \t\t\r\n \t\tif(data.errorConexion){\r\n \t\t\t\r\n \t\t\talertaConexion()\t\r\n \t\t}\r\n \t\telse{\r\n \t\t\t\r\n \t\t\tlistaVacia();\r\n \t\t}\r\n \t\t\r\n \t}\r\n });\t\t\r\n}", "function crearTablaPuertasValoresProteccion(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_proteccion (k_codusuario,k_codinspeccion,k_coditem,v_sele_inspector,v_sele_empresa,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores protección...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorValoresIniciales(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_iniciales (k_codusuario,k_codinspeccion,n_cliente,n_equipo,n_empresamto,o_tipoaccion,v_capacperson,v_capacpeso,v_paradas,f_fecha,v_codigo,o_consecutivoinsp,ultimo_mto,inicio_servicio,ultima_inspeccion,h_hora,o_tipo_informe)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores iniciales...Espere\");\n console.log('transaction creada ok');\n });\n}", "function povoateTable(){\n if (all_orders != []) {\n all_orders.forEach(_order => {\n appendOrder(_order);\n });\n }\n}", "function infotable()\n {\n $.ajaxSetup({\n headers: {\n 'X-CSRF-TOKEN': $('meta[name=\"csrf-token]').attr('content')\n }\n });\n $.ajax({\n type: \"POST\",\n url: url_prev + 'obtenerUsuariosEmpresa',\n data: {\n _token: $('input[name=\"_token\"]').val()\n } //esto es necesario, por la validacion de seguridad de laravel\n }).done(function(msg) {\n // se incorporan las opciones en la comuna\n var json = JSON.parse(msg);\n var html;\n \n for (let [key, value] of Object.entries(json.datos)) {\n if(json.datos[key].id != json.id)\n {\n html += \"<tr><td>\"+json.datos[key].nombre+\"</td><td>\"+json.datos[key].email+\"</td><td>\"+json.datos[key].fono+\"</td><td>\"+json.datos[key].cargo+\"</td><td>\"+json.datos[key].empresa+\"</td><td><button class='btn btn-warning editarfin ml-1' id='editarinfo\"+json.datos[key].id+\"' onclick='confirmarEliminacion(\"+json.datos[key].id+\")' disabled><i class='fas fa-edit' aria-hidden='true'></i></button><button class='btn btn-info ml-1' id='cancelar\"+json.datos[key].id+\"' onclick='cancelaredit(\"+json.datos[key].id+\")' disabled><i class='fas fa-window-close' aria-hidden='true'></i></button></td></tr>\";\n }\n\n \n $(\"#bodytabla\").html(\"\");\n $(\"#bodytabla\").html(html);\n \n var table = $('#tabla_usuarios').DataTable( {\n retrieve : true,\t\t\t\t \t\n paging\t\t\t: true,\n pageLength\t\t: 10,\n order \t\t\t: [],\n fixedHeader : true,\n responsive : true,\n autoWidth : true,\n scrollX : 'true',\n //scrollY : '850px',\n scrollCollapse: true,\n } );\n $('[data-toggle=\"tooltip\"]').tooltip();\n console.log(`${key}: ${json.datos[key].id}`);\n }\n \n }).fail(function(){\n console.log('Error en infotable()');\n });\n }", "function mostrarDatos(usuarios) {\n tableBody.innerHTML = \"\";\n usuarios.forEach(u => {\n agregarFila(u);\n });\n }", "function crearTablaPuertasItemsOtras(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_items_otras(k_coditem_otras, o_descripcion, v_clasificacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function mostrarJornadaEnTabla(partidos){\n\t$(\"#tabla_fixture\").empty();\n\t$.get(\"/api/user_data\", function(data, status){\n\t\tif (!jQuery.isEmptyObject(data) && data.user.editor){\n\t\t\tif(vistaEditor){\n\t\t\t\tvar cont= 0;\n\t\t\t\t$(\"#th-editar\").text(\"Editar\");\n\t\t\t\tfor(index = 0; index < partidos.length; index++){\n\t\t\t\t\tif(partidos[index].editor === data.user.google.name){\n\t\t\t\t\t\tmostrarJornadaEditor(partidos, index);\n\t\t\t\t\t\tcont++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(cont === 0){\n\t\t\t\t\tmostrarMensajeEditor();\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$(\"#th-editar\").text(\"Estadio\");\n\t\t\t\tmostrarJornadaUsuario(partidos);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$(\"#th-editar\").text(\"Estadio\");\n\t\t\tmostrarJornadaUsuario(partidos);\n\t\t}\n\t});\n}", "function crearTablaPuertasValoresObservacionFinal(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_finales (k_codusuario,k_codinspeccion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores finales...Espere\");\n console.log('transaction creada ok');\n });\n}", "function dibujarListaDePedidos(pedidos) {\n tbody.innerHTML = \"\";\n pedidos.forEach((element) => {\n tbody.innerHTML += `\n <td><i class=\"fas fa-times-circle\"></i>${element.producto}</td>\n <td>$${element.precio}</td>\n `;\n });\n document.getElementById(\"mostrarTotal\").innerHTML = `$ ` + calculatTotal();\n}", "function comprobaciones(){\n if($('#tabla tbody tr').length <= 4){\n $('#agregarPago').attr(\"disabled\", false);\n }\n if($('#tabla tbody tr').length == 1){\n $(\"#filaInicial\").show();\n }\n comprobarMontos();\n }", "function comprobaciones(){\n if($('#tabla tbody tr').length <= 4){\n $('#agregarPago').attr(\"disabled\", false);\n }\n if($('#tabla tbody tr').length == 1){\n $(\"#filaInicial\").show();\n }\n comprobarMontos();\n }", "function crearTablaPuertasValoresMotorizacion(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_motorizacion (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores motorizacion...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaAuditoriaInspeccionesAscensores(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE auditoria_inspecciones_ascensores (k_codusuario,k_codinspeccion,o_consecutivoinsp,o_estado_envio,o_revision,v_item_nocumple,k_codcliente,k_codinforme,k_codusuario_modifica,o_actualizar_inspeccion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores auditoria...Espere\");\n console.log('transaction creada ok');\n });\n}", "function rafraichirTable() {\n\n\trafraichirPages();\n\n\tvar tbody = '';\n\tvar i = 0;\n\t/* Mon Dieu, un calcul scientifique ! */\n\tvar debut = (page_courante-1) * max_utilisateur_par_page;\n\tvar index = debut;\n\n\t/* Parcourons les utilisateurs */\n\twhile( i < liste_utilisateurs.length ) {\n\n\t\t/* StaticPages des filtres s'ils sont présents */\n\t\tif( filtre_service.length > 0 ) {\n\t\t\tif( liste_services[liste_utilisateurs[i].service] != filtre_service ) {\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tif( filtre_type.length > 0 ) {\n\t\t\tif( liste_types[liste_utilisateurs[i].type] != filtre_type ) {\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t/* On applique les bornes */\n\t\tif( i < debut ) {\n\t\t\ti++;\n\t\t\tcontinue;\n\t\t}\n\t\tif( i == debut + max_utilisateur_par_page ) break; \n\n\t\ttbody += '<tr>';\n\t\ttbody += '<td>' + (++index) + '</td>';\n\t\ttbody += '<td>' + liste_utilisateurs[i].login + '</td>';\n\t\ttbody += '<td>' + liste_services[liste_utilisateurs[i].service] + '</td>';\n\t\ttbody += '<td>' + liste_types[liste_utilisateurs[i].type] + '</td>';\n\t\ttbody += '<td>';\n\t\tif( liste_utilisateurs[i].nom != null ) {\n\t\t\ttbody += liste_utilisateurs[i].nom;\n\t\t}\n\t\ttbody += '</td>';\n\t\ttbody += '<td>';\n\t\tif( liste_utilisateurs[i].prenom != null ) {\n\t\t\ttbody += liste_utilisateurs[i].prenom;\n\t\t}\n\t\ttbody += '</td>';\n\n\t\t/* Les actions, à savoir Editer et Bannir */\n\t\tvar id = liste_utilisateurs[i].id;\n\t\ttbody += '<td style=\"text-align: center;\">';\n\t\ttbody += '<a href=\"#\" class=\"edit\" uid=\"' + id + '\" title=\"Editer\"><i class=\"icon-pencil\"></i></a> ';\n\t\ttbody += '<a href=\"#\" class=\"del\" uid=\"' + id + '\" title=\"Bannir\"><i class=\"icon-remove\"></i></a>';\n\t\ttbody += '</td>';\n\t\ttbody += '</tr>';\n\n\t\ti++;\n\t}\n\n\t$( '#admin_utilisateurs #liste_utilisateurs' ).html( tbody );\n\n\t/* Ajout des triggers */\n\t$( \"a.edit\" ).click( editerUtilisateur );\n\t$( \"a.del\" ).click( supprimerUtilisateur );\n\t\n\t/*\n\t// Tri possible sur la table :\n\t$(\"#table_liste_utilisateurs\").tablesorter({\n\t\t// On désactive le tri sur la dernière colonne (celle des boutons) \n\t\theaders: { \n 0: {sorter: false},\n\t\t\t1: {sorter: false},\n\t\t\t2: {sorter: false},\n\t\t\t3: {sorter: false},\n\t\t\t4: {sorter: false},\n\t\t\t10: {sorter: false},\n }\n\t}); \n\t*/\n}", "function addUserInTable({ id, username, email, role }){\n let newRow = document.createElement('tr')\n newRow.setAttribute('user-id', id)\n newRow.classList.add('kt-datatable__row')\n newRow.style.left = '0px'\n newRow.innerHTML = `<td class=\"kt-datatable__cell\" data-field=\"User Id\">\n <span style=\"width: 110px;\">${id}</span>\n </td>\n <td class=\"kt-datatable__cell\" data-field=\"Name\">\n <span style=\"width: 110px;\" class=\"et-username\">${username}</span>\n </td>\n <td class=\"kt-datatable__cell\" data-field=\"Email\">\n <span style=\"width: 110px;\" class=\"et-email\">${email}</span>\n </td>\n <td class=\"kt-datatable__cell\" data-field=\"Role\">\n <span style=\"width: 110px;\">${role}</span>\n </td>\n <td class=\"kt-datatable__cell\" data-field=\"Actions\" data-autohide-disabled=\"false\">\n <span style=\"overflow: visible; position: relative; width: 110px;\">\t\t\t\t\t\t\t\t\t\t\n <a href=\"javascript:;\" class=\"btn btn-sm btn-clean btn-icon btn-icon-md\" id=\"et-edit-user-icon-${id}\" title=\"Edit details\" data-toggle=\"modal\" data-target=\"#kt_modal_4\">\t\t\t\t\t\n <i class=\"la la-edit\"></i>\t\t\t\t\t\t\n </a>\t\t\t\t\t\n <a href=\"javascript:;\" class=\"btn btn-sm btn-clean btn-icon btn-icon-md\" title=\"Delete\" id=\"et-delete-user-icon-${id}\" data-toggle=\"modal\" data-target=\"#et_modal_confirm_delete\">\t\t\t\t\t\t\t\n <i class=\"la la-trash\"></i>\t\t\t\t\t\t\n </a>\t\t\t\t\t\n </span>\n </td>\n `\n $userListTable.appendChild(newRow)\n \n let $editIcon = document.getElementById(`et-edit-user-icon-${id}`)\n let $deleteIcon = document.getElementById(`et-delete-user-icon-${id}`)\n\n $editIcon.addEventListener('click',(e) => {\n $updateUserConfirmBtn.setAttribute('user-id', id)\n\n $editUserNameInput.value = username\n $editEmailInput.value = email\n })\n $deleteIcon.addEventListener('click', () => {\n $deleteUserBtn.setAttribute('user-id', id)\n })\n}", "function crearTablaConsecutivoAscensores(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE consecutivo_ascensores (k_codusuario, k_consecutivo unique, n_inspeccion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function populateTable(existingUsers) {\r\n\tif(existingUsers.length > 0) {\r\n\t\tdocument.getElementById(\"existingChangeRoleList\").style.display=\"block\";\r\n\t\tvar userList = document.getElementById(\"existingUsersTableId\");\r\n\t\tvar tableStr = \"<table width='94%' border='1' bordercolor='#78C0D3' id='myTable' align='center'><thead class='tab_header'><tr><th>SL. No.</th><th>Facilitator Email</th><th>User Group Name</th><th width='16%'>Status</th></tr></thead><tbody>\";\r\n\t\tvar counter = 1;\r\n\t\tfor (var index=0; index<existingUsers.length; index++) {\r\n\t\t\tvar trColor = \"\";\r\n\t\t\tif(index % 2 == 0) {\r\n\t\t\t\ttrColor = \"#D2EAF0\";\r\n\t\t\t} else {\r\n\t\t\t\ttrColor = \"#F1F1F1\";\r\n\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\ttableStr = tableStr + \"<tr class='user_list_row_width' bgcolor='\"+trColor+\"'><td align='center'>\"+counter+\".</td><td align='center'>\"+existingUsers[index].email+\"</td><td align='center'>\"+existingUsers[index].userGroup+\"</td>\";\r\n\t\t\ttableStr = tableStr + \"<td class='user_list_row_width' >\" +\r\n\t\t\t\t\t\"<table width='100%' border='0'>\" +\r\n\t\t\t\t\t\"<tr>\";\r\n\t\t\tif(existingUsers[index].softDelete == 0){\r\n\t\t\t\ttableStr = tableStr + \"<td align='center'>Active</td></td></tr></table></td></tr>\";\r\n\t\t\t} else {\r\n\t\t\t\ttableStr = tableStr + \"<td align='center'>Inactive</td></td></tr></table></td></tr>\";\r\n\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\tcounter = counter + 1;\r\n\t\t}\r\n\t\ttableStr = tableStr + \"</tbody></table>\";\r\n\t\tuserList.innerHTML = tableStr;\r\n\t\tnew SortableTable(document.getElementById('myTable'), 1);\r\n\t} else {\r\n\t\tdocument.getElementById(\"existingChangeRoleList\").style.display=\"none\";\r\n\t\tdocument.getElementById(\"existingUsersTableId\").innerHTML = \"<div align='center'><br /><br /><br /><img src='../img/no-record.png'><br /><div class='textStyleNoExist'>No Existing Facilitators</div></div>\";\r\n\t}\r\n}", "function RealizarCorte() {\r\n let date = getDate();\r\n let count = 0;\r\n let usuario = \"\";\r\n for (let i = 0; i < ventaBD.length; i++) {\r\n for (let j = 0; j < usuariosBD.length; j++) {\r\n if (ventaBD[i].id_usuario === usuariosBD[j].id) {\r\n usuario = usuariosBD[j].nombre + \" \" + usuariosBD[j].apellido;\r\n }\r\n }\r\n if (ventaBD[i].fecha === date) {\r\n count++;\r\n document.getElementById(\r\n \"tabla-corte-body\"\r\n ).innerHTML += `<tr><td>${ventaBD[i].fecha}</td><td>${ventaBD[i].id_venta}</td><td>${ventaBD[i].id_usuario}</td><td>${usuario}</td><td>$${ventaBD[i].total}</td></tr>`;\r\n }\r\n }\r\n\r\n if (count === 0) {\r\n document.getElementById(\"div-tablacorte\").style.display = \"none\";\r\n document.getElementById(\"none-alert\").style.display = \"block\";\r\n document.getElementById(\"btn-realizar-corte\").disabled = false;\r\n } else {\r\n document.getElementById(\"div-tablacorte\").style.display = \"block\";\r\n document.getElementById(\"none-alert\").style.display = \"none\";\r\n document.getElementById(\"btn-realizar-corte\").disabled = true;\r\n }\r\n}", "function iniciarTablaHistorial(tx) {\n\ttx.executeSql('CREATE TABLE IF NOT EXISTS Historial (IDUsuario, CuentaDesde, CuentaHasta, Monto, FechaHora)');\n}", "function ramplirtabUti(){\n clairtxtBoxUti();\n $('#tableUti').bootstrapTable('refresh');\n/*\n\tvar request = new XMLHttpRequest();\n var url =\"\";\n\turl = \"/tusers\";\n\trequest.open(\"GET\", url, true);\n\t\n\trequest.onreadystatechange = function() {\n if (request.readyState === 4 && request.status === 200) {\n var info = JSON.parse(request.responseText); \n var tbody = document.getElementById(\"tbodyutiResult\");\n clairtxtBoxUti();\n tbody.innerHTML = \"\";\n for (i = 0; i < info.length; i++) {\n var tr = document.createElement('TR'); \n setCelulle(info[i].coduser,null,tr);\n setCelulle(info[i].password || '',null,tr);\n setCelulle(info[i].nom,null,tr);\n setCelulle(info[i].prenom,null,tr);\n setCelulle(info[i].admin,null,tr);\n setCelulle(info[i].inactif,null,tr);\n setCelulle(info[i].utilise,true,tr);\n tbody.appendChild(tr);\n }\n }\n };\n request.send(); */\n} // end ramplir", "async function colocarTabela(alunos){\n \n for (let i = 0; i < alunos.length; i++) {\n\n var element = alunos[i];\n\n //Cria uma linha e suas colunas \n var linha = document.createElement(\"tr\");\n linha.classList.add(\"linhas\");\n\n //Coluna do RA\n var colunaRa = document.createElement(\"td\");\n colunaRa.textContent = element.matricula;\n\n //Busca os dados do usuario no banco \n var resposta = await usarApi(\"GET\", \"http://localhost:8080/usuarios/\"+element.fk_usuario);\n var usuario = JSON.parse(resposta);\n\n //Coluna do nome\n var colunaNome = document.createElement(\"td\");\n colunaNome.textContent = usuario.nome;\n\n //Adiciona a linha na tabela \n var tabela = document.getElementById(\"tab\");\n linha.appendChild(colunaRa);\n linha.appendChild(colunaNome);\n\n tabela.appendChild(linha);\n }\n \n $(\".linhas\").dblclick(function() { \n var isConfirm = confirm(\"Deseja expulsar o aluno?\");\n\n if(isConfirm){\n var idAluno = alunos[$(this).index()-1].idAluno;\n apagar(idAluno);\n }\n });\n}", "function transactionTable() { }", "function getPuestoTable() {\n var location = 'Puestos/GetPuestos';\n $('#PuestoTable').DataTable().destroy();\n $('#tablaPuestoRow').html('');\n\n $.ajax({\n type: 'POST',\n dataType: 'JSON',\n url: location,\n _success: function (respuesta) {\n var renglon = '';\n respuesta.forEach(function (row, index) {\n renglon =\n '<tr>' +\n \"<td class='dtr-control'>\" + row.pos_id + '</td>' +\n '<td>' + row.pos_name + '</td>' +\n '<td>' + row.pos_description + '</td>' +\n '<td class=\"text-center\"> ' +\n '<button onclick=\"EditPuesto(' + row.pos_id +\n ')\" type=\"button\" class=\"btn btn-default btn-icon-edit\" aria-label=\"Left Align\"><i class=\"fas fa-pen\"></i></button>' +\n '<button onclick=\"ConfirmDeletPuesto(' + row.pos_id +\n ')\" type=\"button\" class=\"btn btn-default btn-icon-delete\" aria-label=\"Left Align\"><i class=\"fas fa-trash\"></i></button>' +\n '</td>' +\n '</tr>';\n $('#tablaPuestoRow').append(renglon);\n });\n\n table = $('#PuestoTable').DataTable({\n select: {\n style: 'multi',\n info: false,\n },\n lengthMenu: [\n [20, 50, 100, -1],\n [20, 50, 100, 'Todos'],\n ],\n dom: 'Bfrtip',\n buttons: [\n {extend: 'pdf', className: 'btnDatableAdd', text: '<i class=\"btn-add\" >PDF</i>'},\n {extend: 'excel', className: 'btnDatableAdd', text: '<i class=\"btn-add\" >Excel</i>'},\n {extend: 'pageLength', className: 'btnDatableAdd'},\n {\n text: 'Borrar seleccionados',\n className: 'btnDatableAddRed',\n action: function () {\n var selected = table.rows({selected: true}).data();\n var idSelected = '';\n selected.each(function (index) {\n idSelected += index[0] + ',';\n });\n idSelected = idSelected.slice(0, -1);\n if (idSelected != '') {\n ConfirmDeletPuesto(idSelected);\n }\n },\n },\n ],\n columnDefs: [\n {responsivePriority: 1, targets: 0},\n {responsivePriority: 2, targets: -1},\n ],\n scrollY: '50vh',\n scrollCollapse: true,\n paging: true,\n language: {\n url: './app/assets/lib/dataTable/spanish.json',\n },\n });\n\n $('#PuestoTable tbody').on('click', 'tr', function () {\n setTimeout(() => {\n RenglonesSelection = table.rows({selected: true}).count();\n if (RenglonesSelection == 0 || RenglonesSelection == 1) {\n $('.btnDatableAddRed').css('visibility', 'hidden');\n } else {\n $('.btnDatableAddRed').css('visibility', 'visible');\n }\n }, 10);\n });\n },\n get success() {\n return this._success;\n },\n set success(value) {\n this._success = value;\n },\n error: function () {},\n }).done(function () {});\n}", "function verUsuarios() {\n\n borrarMarca();\n borrarMarcaCalendario();\n\n let contenedor = document.createElement(\"div\");\n contenedor.setAttribute('class', 'container-fluid');\n contenedor.setAttribute('id', 'prueba');\n let titulo = document.createElement(\"h1\");\n titulo.setAttribute('class', 'h3 mb-2 text-gray-800');\n let textoTitulo = document.createTextNode('GESTIÓN DE USUARIOS');\n let parrafoTitulo = document.createElement(\"p\");\n parrafoTitulo.setAttribute('class', 'mb-4');\n let textoParrafo = document.createTextNode('AÑADE PACIENTES O ELIMINA LOS USUARIOS CREADOS');\n let capa1 = document.createElement(\"div\");\n capa1.setAttribute('class', 'card shadow mb-4');\n let capa2 = document.createElement(\"div\");\n capa2.setAttribute('class', 'card-header py-3');\n let tituloCapas = document.createElement(\"h6\");\n tituloCapas.setAttribute('class', 'm-0 font-weight-bold text-primary');\n let textoTituloCapas = document.createTextNode('Información de Usuarios');\n let cuerpo = document.createElement(\"div\");\n cuerpo.setAttribute('class', 'card-body');\n let tablaResponsiva = document.createElement(\"div\");\n tablaResponsiva.setAttribute('class', 'table-responsive');\n let tablas = document.createElement(\"table\");\n tablas.setAttribute('class', 'table table-bordered');\n tablas.setAttribute('id', 'dataTable');\n tablas.setAttribute('width', '100%');\n tablas.setAttribute('cellspacing', '0');\n\n let principal = document.getElementsByClassName(\"marca\");\n principal[0].appendChild(contenedor);\n contenedor.appendChild(titulo);\n titulo.appendChild(textoTitulo);\n contenedor.appendChild(parrafoTitulo);\n parrafoTitulo.appendChild(textoParrafo);\n contenedor.appendChild(capa1);\n capa1.appendChild(capa2);\n capa2.appendChild(tituloCapas);\n tituloCapas.appendChild(textoTituloCapas);\n capa1.appendChild(cuerpo);\n cuerpo.appendChild(tablaResponsiva);\n tablaResponsiva.appendChild(tablas);\n\n let httpRequest = new XMLHttpRequest();\n httpRequest.open('POST', '../consultas_ajax.php', true);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.onreadystatechange = function () {\n if (httpRequest.readyState === 4) {\n if (httpRequest.status === 200) {\n document.getElementById('dataTable').innerHTML = httpRequest.responseText;\n }\n }\n };\n httpRequest.send('verUsuarios=');\n}", "function llenaTabla(){\n\t\n $(\".fila_usuario\").remove();\n \n\t\n $.ajax({\n data:{},\n url:\"GET_USUARIO\",\n type:\"POST\",\n success: function (response) {\n \t\n\n var ESTADO=\"\";\n $.each( response, function( key, value ) {\n \t \n \t if(value.ESTADO===true){\n \t\t \n \t\t ESTADO=\"ACTIVO\";\n \t\t \n \t }else{\n \t\t ESTADO=\"INACTIVO\";\n \t\t \n \t }\n \t \n \t \n $(\"#tb_usuario\").append('<tr id='+value.OID_USUARIO+' class=fila_usuario><td>'+value.OID_USUARIO+'</td><td>'+value.USUARIO+'</td><td><a onclick=changeState('+value.OID_USUARIO+','+value.ESTADO+')>'+ESTADO+'</a></td><td><a onclick=update('+value.OID_USUARIO+',\"'+value.USUARIO+'\")>ACTUALIZAR</a></td></tr>');\n\n \t\t});\n \n \t/*PAGINACION DE LA TABLA*/\n table= $('#table_usuario').DataTable();\n\n \n }, error: function (err) {\n alert(\"Error en el AJAX LLena tabla\" + err.statusText);\n }\n });\n \n\t\n\t\n\t\n}", "function crearTablaPuertasItemsMotorizacion(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_items_motorizacion(k_coditem_motorizacion, o_descripcion, v_clasificacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaEscalerasValoresIniciales(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_valores_iniciales (k_codusuario,k_codinspeccion,n_cliente,n_equipo,n_empresamto,v_velocidad,o_tipo_equipo,v_inclinacion,v_ancho_paso,f_fecha,ultimo_mto,inicio_servicio,ultima_inspeccion,v_codigo,o_consecutivoinsp,h_hora,o_tipo_informe)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores iniciales...Espere\");\n console.log('transaction creada ok');\n });\n}", "function cargarDatosPedidoChef1(idPedido){\n\tvar txt = '<h5>Encabezado pedido '+ pedidos[i][\"idPedido\"] +' </h5>';\n\tvar txt = '<table class=\"table table-hover table-striped\">';\n\ttxt +='<thead><tr><th>Descripcion</th><th>Cantidad</th><th>Valor Uunit.</th><th>Total</th></thead>';\n\ttxt +='<tr><td>Churrasco Argentino</td><td>3</td><td>3</td><td>3</td></tr>';\n\ttxt +='<tr><td>Churrasco Argentino</td><td>3</td><td>3</td><td>3</td></tr>';\n\ttxt +='<tr><td>Churrasco Argentino</td><td>3</td><td>3</td><td>3</td></tr>';\n\ttxt +='<tr><td>Churrasco Argentino</td><td>3</td><td>3</td><td>3</td></tr>';\n\ttxt +='<tr><td></td><td></td><td>Sub Total</td><td>$150.000</td></tr>';\n\ttxt +='<tr><td></td><td></td><td>Iva</td><td>$15.000</td></tr>';\n\ttxt +='<tr><td></td><td></td><td>Total</td><td>$165.000</td></tr>';\n\ttxt +='</tbody></table>';\n\treturn txt;\t\t\n}", "addLine(dataUser) {\n\n // console.log(dataUser);\n let tr = this.getTr(dataUser);\n\n // Para adicionar uma linha e não ficar substituindo\n this.tableEl.appendChild(tr);\n\n this.updateCount();\n }", "function printOutUser(item, index){\n // Reihe erstellen\n var row = table.appendChild(document.createElement(\"tr\"));\n // Spalten erstellen\n // ID\n var spalte = row.appendChild(document.createElement(\"td\"));\n spalte.innerHTML = index+1;\n // Name\n var spalte = row.appendChild(document.createElement(\"td\"));\n spalte.innerHTML = item.getName();\n // Alter\n var spalte = row.appendChild(document.createElement(\"td\"));\n spalte.innerHTML = item.getAlter();\n // Geschlecht\n var spalte = row.appendChild(document.createElement(\"td\"));\n spalte.innerHTML = item.getGeschlecht();\n // Username\n var spalte = row.appendChild(document.createElement(\"td\"));\n spalte.innerHTML = item.getUserName();\n\n //old\n //document.getElementById(\"ausgabe\").innerHTML += index+1 + \" \" + item.getName() + \"<br>\";\n}", "function updateUsersTableRow() {\n\tif (activeUser) {\n\n\t\tvar usersTableRow = findUsersTableRow(activeUser.userData.userID);\n\n\t\tif (usersTableRow !== null) {\n\t\t\tusersTableRow[0].cells[0].childNodes[0].innerText = activeUser.userData.lastName;\n\t\t\tusersTableRow[0].cells[1].childNodes[0].innerText = activeUser.userData.firstName;\n\t\t\tusersTableRow[0].cells[2].childNodes[0].innerText = calculateAge(activeUser.userData.birthDate);\n\t\t\tusersTableRow[0].cells[3].childNodes[0].innerText = activeUser.userData.balanceIdx;\n\t\t\tusersTableRow[0].cells[4].childNodes[0].innerText = activeUser.userData.activityIdx;\n\t\t}\n\t}\n}", "function crearTablaPuertasItemsProteccion(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_items_proteccion(k_coditem, o_descripcion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function initUserTable(protocol) { \n var dataTable = $('#userTable').dataTable();\n if(protocol!=3)dataTable.fnClearTable();\n var protocolData = new Array(); //1-all, 6-mods, 7-admins\n if(protocol==1) protocolData.push(1);\n else if (protocol==2) protocolData.push(6);\n else if (protocol==3) protocolData.push(7);\n var xml = sendToPhp(protocolData,'../getSet_korisnici.php');\n var users = $(xml).find('korisnici');\n var user = new Array();\n $(users).each(function(){ \n $(this).children().each(function(){\n user = []; \n $(this).children().each(function(){\n user.push($(this).text());\n });\n dataTable.fnAddData([ user[0],user[1]+' '+user[2],user[7],user[11],user[10],user[15],user[16] ]);\n });\n }); \n dataTable.$('tr').addClass(\"row\").click(function(){editUser(dataTable.fnGetData(this)[0])});\n if(protocol==2) initUserTable(3); \n}", "makeUserTable() {\n let infoSelected = this.checkSelected.map(checkBoxValue => this.checkData.find(checkBox => checkBox.value === checkBoxValue).text); //Get the text key of the checkbox selected to used on titles of the table\n this.tableTitlesMod = [\"Name\", ...infoSelected];\n this.tableKeysMod = [\"first_name\" , ...this.checkSelected];\n }", "async function getUsers(){\n try{\n let rows = await knex('users');\n let tab = []; \n let i=0;\n for (var r of rows) {\n tab[i]=r.login; i++;\n tab[i]=r.password; i++;\n tab[i]=r.nom; i++;\n tab[i]=r.prenom; i++;\n tab[i]=r.partiesGagnees; i++;\n tab[i]=r.partiesPerdues; i++;\n tab[i]=r.etat; i++;\n }\n return tab;\n }\n catch(err){\n console.error('Erreur dans l\\'affichage des éléments de la table users'); \n }\n}", "function displayTable(userArr)\n{\n\n $('#table-body').empty();\n\n for (var i = 0; i <userArr.length; i++) {\n if (userArr[i] == null) {\n continue;\n }\n let tr = document.createElement('tr');\n\n var td = document.createElement('td');\n td.textContent =userArr[i].username;\n tr.append(td);\n var td = document.createElement('td');\n td.textContent = userArr[i].firstname;\n tr.append(td);\n var td = document.createElement('td');\n td.textContent = userArr[i].lastname;\n tr.append(td);\n var td = document.createElement('td');\n td.textContent = userArr[i].type;\n tr.append(td);\n var td = document.createElement('td');\n td.textContent = userArr[i].email;\n tr.append(td);\n var td = document.createElement('td');\n var del = document.createElement('button');\n del.setAttribute('class', 'btn btn-sm p-3 border border-dark btn-danger');\n del.setAttribute('id', i);\n del.textContent = 'Delete'\n del.addEventListener('click', function(btn) {\n var seloption = this.getAttribute('id');\n console.log(seloption)\n userArr[seloption] = null;\n displayTable(userArr);\n userData(userArr);\n })\n td.append(del);\n tr.append(td);\n \n $('#table-body').append(tr);\n}\n}", "function crearTablaAscensorValoresProteccion(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_proteccion (k_codusuario,k_codinspeccion,k_coditem,v_sele_inspector,v_sele_empresa,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores protección...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaPuertasValoresManiobras(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_maniobras (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores maniobras...Espere\");\n console.log('transaction creada ok');\n });\n}", "function updateTable() {\n var jsonData = JSON.parse(localStorage.getItem(\"users\"));\n\n table_body.innerHTML = \"\";\n\n return jsonData.forEach(obj => {\n \n let tr = document.createElement('tr');\n tr.setAttribute('id', obj.userID);\n\n tr.innerHTML = `\n <td>${obj.firstname}</td>\n <td>${obj.surname}</td>\n <td>${obj.age}</td>\n <td>${obj.level}</td>\n <td>${obj.club} <span class=\"tab_span\">x</span></td>\n `\n table_body.appendChild(tr);\n\n form_block.style.display = \"flex\";\n })\n}", "function generarTablaEnt(){\r\n document.querySelector(\"#divEntAlumno\").innerHTML = `<table id=\"tabEntAlumno\" border='2px' style='background-color: #FA047F; position: relative;'>\r\n <th>Título</th><th>Nivel</th><th>Imagen</th><th>Entrega</th><th>Corrección</th>`;\r\n for (let i = 0; i < entregas.length; i++) {\r\n const element = entregas[i].Alumno.nombreUsuario;\r\n if(element === usuarioLoggeado){\r\n document.querySelector(\"#tabEntAlumno\").innerHTML += `\r\n <tr id=\"filaEntregas${i}\" class=\"filaEntregaAlumno\">\r\n <td style=\"padding: 10px\"> ${entregas[i].Ejercicio.titulo} </td>\r\n <td style=\"padding: 10px\"> ${entregas[i].Ejercicio.nivel} </td>\r\n <td style=\"padding: 10px\"><img src=\"${entregas[i].Ejercicio.imgPath}\" height=\"75px\" width=\"125px\"/> </td> \r\n <td style=\"padding: 10px\"><audio controls> <source src=\"${entregas[i].audPath}\"/></audio></td>\r\n <td style=\"padding: 10px\"> ${entregas[i].correccion} </td> \r\n </tr>`; \r\n }\r\n } \r\n \r\n}", "function crearTablaPuertasValoresFotografias(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_valores_fotografias (k_codusuario,k_codinspeccion,k_coditem,n_fotografia,n_directorio,o_estado_envio)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function confirmarPedido() {\n\n var pedido = \"\";\n var oTable = document.getElementById('table1');\n var rowLength = oTable.rows.length;\n\n var lineas = [];\n for (i = 1; i < rowLength; i++) {\n\n var oCells = oTable.rows.item(i).cells;\n var cellLength = oCells.length;\n lineasDeProductos = cellLength;\n\n var idProductoLinea = document.getElementsByClassName(\"productoId\")[i - 1].id;\n \n for (var j = 0; j < cellLength; j++) {\n if ($(oTable.rows.item(i)).is(':visible')) {\n if (j == 0) {\n pedido = pedido + oCells.item(j).firstChild.value + \" \";\n } else if (j == 3) {\n pedido = pedido + oCells.item(j).firstChild.value + \" | \";\n }\n if (j == 3) {\n cantidad = parseFloat(oCells.item(j).firstChild.value);\n }\n if (j == 5) {\n precioTotal += parseFloat(oCells.item(j).firstChild.textContent);\n resultado = parseFloat(oCells.item(j).firstChild.textContent);\n }\n\n }\n }\n\n var linea = new LineaDePedido(idProductoLinea, cantidad, resultado);\n lineas.push(linea);\n\n }\n\n var date = obtenerFechaDeHoy();\n var pedidoPost = new PedidoConLineaPedido(lineas, 1, date, precioTotal);\n\n addPedido(pedidoPost);\n borrarTabla();\n}", "function bindIdsToTable() {\n dataTable = $(table).dataTable(\n {\n language: {\n url: \"localisation/datatables-\" + lang + \".json\",\n sSearch: \"Filter:\"\n },\n bLengthChange: false,\n bScrollCollapse: true,\n sScrollXInner: \"110%\",\n iDisplayLength : 20,\n aoColumns: [\n { mData: \"userId\" },\n { mData: \"email\" },\n { mData: \"dataGroups\" },\n { mData: \"role\" },\n { mData: \"lastMod\" }\n ]\n })\n }", "function informacionUsuarios(){\n $.ajax({\n url: \"https://localhost:3000/volvo/api/GU/GU_GESTION_USUARIOS\",\n headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')},\n data: {\n \"accion\" : 'SELECT',\n \"idEstadoUsuario\" : $('#selectEstadoUsuario').val(),\n \"idAreaTrabajo\" : $('#selectAreaTrabajo').val()\n\n },\n dataType: \"json\",\n method: \"POST\",\n success: function(respuesta){\n if(respuesta.output.pcodigoMensaje == 0){\n for(i=0; i < respuesta.data.length; i++){\n $('#bodyTable').append(`\n <tr>\n <th>\n <input type=\"checkbox\" id=\"${respuesta.data[i].idUsuario}\" value=\"${respuesta.data[i].idUsuario}\" style=\"width:10px; height:100%;\"/> \n <label for=\"${respuesta.data[i].idUsuario}\"></label>\n </th>\n <td style=\"width:15px; text-align:center;\">${respuesta.data[i].idUsuario}</td>\n <td id=\"${'nombrePersona'+respuesta.data[i].idUsuario}\">${respuesta.data[i].nombrePersona}</td>\n <td id=\"${'nombreUsuario'+respuesta.data[i].idUsuario}\">${respuesta.data[i].nombreUsuario}</td>\n <td id=\"${'correoElectronico'+respuesta.data[i].idUsuario}\">${respuesta.data[i].correoElectronico}</td>\n <td id=\"${'numeroTelefono'+respuesta.data[i].idUsuario}\">${respuesta.data[i].numeroTelefono}</td>\n <td id=\"${'areaTrabajo'+respuesta.data[i].idUsuario}\">${respuesta.data[i].AreaTrabajo}</td>\n </tr>`\n );\n }\n }\n }\n });\n}", "function crearTablaPuertasItemsPreliminar(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE puertas_items_preliminar(k_coditem, o_descripcion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function crearTablaAscensorValoresPreliminar(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_preliminar (k_codusuario,k_codinspeccion,k_coditem_preli,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores preliminares...Espere\");\n console.log('transaction creada ok');\n });\n}", "function crearTablaAuditoriaInspeccionesEscaleras(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE auditoria_inspecciones_escaleras (k_codusuario,k_codinspeccion,o_consecutivoinsp,o_estado_envio,o_revision,v_item_nocumple,k_codcliente,k_codinforme,k_codusuario_modifica,o_actualizar_inspeccion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores auditoria...Espere\");\n console.log('transaction creada ok');\n });\n}", "renderTableData() {\n return this.state.rows_pers.map((row) => {\n const { id_personal, nombres, apellidos, correo, cargo } = row\n return (\n <tr key={id_personal} id={id_personal}>\n <td className='t_i_desc'>{nombres}{' '}{apellidos}</td>\n <td className='t_i_mar_cant' >{correo}</td>\n <td className='t_i_mar_cant' >{cargo}</td>\n <td className='t_i_opc' ><div id=\"opcPers\">\n <button id={id_personal+'upd'} onClick={this.handleRowUpd(row)} className=\"btn btn-primary btn-rounded btn-sm my-0\"><span className=\"icon ion-md-create\" /></button> {' '}\n <button id={id_personal+'del'} onClick={this.handleRowDel(row)} className=\"btn btn-danger btn-rounded btn-sm my-0\"><span className=\"icon ion-md-trash\" /></button>\n </div></td>\n </tr>\n )\n })\n }", "function listaNotificaciones(){\r\n\t\r\n\t$.ajax({\r\n url: \"dameUsuarios\"\r\n }).then(function(data) {\r\n \r\n \tif (data.userExist){\r\n\t\t\t\t\r\n \t\tvar textoHTML=\"\";\r\n \t\ttextoHTML += \"<div>\";\r\n \t\ttextoHTML += \"\";\r\n \t\ttextoHTML += \"<table id=\\\"mitabla\\\" class=\\\"table table-hover table-striped table-condensed table-responsive\\\" cellspacing=\\\"0\\\" width=\\\"100%\\\">\";\r\n \t\ttextoHTML += \"\t<thead>\";\r\n \t\ttextoHTML += \"\t\t<tr style='text-align:center; background-color:#222; color:#FFF;'>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-2'>Nombre<\\/th>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-3'>Apellidos<\\/th>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-3'>Email<\\/th>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-1'>Login<\\/th>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-1'>Clave<\\/th>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-1'>Rol<\\/th>\";\r\n \t\ttextoHTML += \"\t\t\t<th class='col-sm-1'>Enviar<\\/th>\";\r\n \t\ttextoHTML += \"\t\t<\\/tr>\";\r\n \t\ttextoHTML += \"\t<\\/thead>\";\r\n \t\t \t\t\r\n \t\ttextoHTML += \"\t<tbody>\";\r\n \t\t\r\n \t\tfor(var elm = 0;elm < data.listaUsuarios.length;elm++){\r\n \t\t\r\n \t\ttextoHTML += \"\t\t<tr>\";\r\n \t\ttextoHTML += \"\t\t\t<td>\"+data.listaUsuarios[elm].name+\"<\\/td>\";\r\n \t\ttextoHTML += \"\t\t\t<td>\"+data.listaUsuarios[elm].surname+\"<\\/td>\";\r\n \t\ttextoHTML += \"\t\t\t<td>\"+data.listaUsuarios[elm].email+\"<\\/td>\";\r\n \t\ttextoHTML += \"\t\t\t<td>\"+data.listaUsuarios[elm].login+\"<\\/td>\";\r\n \t\ttextoHTML += \"\t\t\t<td>\"+data.listaUsuarios[elm].password+\"<\\/td>\";\r\n \t\ttextoHTML += \"\t\t\t<td>\"+data.listaUsuarios[elm].rol.rolName+\"<\\/td>\";\r\n \t\t\r\n \t\ttextoHTML+=\"\t\t\t<td style='text-align:center'><button type='button' onclick='notificaUsuario(\\\"\"+data.listaUsuarios[elm].email+\"\\\")'\"\r\n\t\t\ttextoHTML+=\"\t\t\tclass='btn btn-info btn-xs' style='width:50px; height:30px'><span class='glyphicon glyphicon-envelope'></span></button></td>\"\r\n \t\t\r\n \t\ttextoHTML += \"\t\t<\\/tr>\";\r\n \t\t\r\n \t\t}\r\n \t\t\r\n \t\ttextoHTML += \"\t<\\/tbody>\";\r\n \t\ttextoHTML += \"<\\/table>\";\r\n \t\r\n\t\t\tdocument.getElementById(\"usuarioContent\").innerHTML=textoHTML;\r\n\t\t\t\r\n\t\t\t$('#mitabla').DataTable( {\r\n\t\t \"language\": {\r\n\t\t \r\n\t\t \t\"url\": \"bootstrap/js/spanish.json\"\r\n\t\t \t// \"url\": \"//cdn.datatables.net/plug-ins/1.10.12/i18n/Spanish.json\"\r\n\t\t } \r\n\t\t } );\t\r\n\t\t}\r\n \telse{\r\n \t\t\r\n \t\tif(data.errorConexion){\r\n \t\t\t\r\n \t\t\talertaConexion()\t\r\n \t\t}\r\n \t\telse{\r\n \t\t\t\r\n \t\t\tlistaVacia();\r\n \t\t}\r\n \t\t\r\n \t\t\r\n \t}\r\n });\t\t\r\n}", "function llenarTabla() {\n\n var cuerpoTabla = $('#tabla-datos');\n cuerpoTabla.append(\"<tr><td>\" + nombreUsuario.val() + \"</td><td>\" + apellidoUsuario.val() + \"</td><td>\" + emailUsuario.val() + \"</td><td>\" + telefonoUsuario.val() + \"</td></tr>\");\n }", "async function printTableContent(){\n try{\n let rows = await knex('users');\n let tab = []; \n let i=0;\n for (var r of rows) {\n tab[i]=r.mail; i++;\n tab[i]=r.pwd; i++;\n }\n return tab;\n }\n catch(err){\n console.error('Erreur dans l\\'affichage des éléments de la table'); \n }\n}", "function crearTablaEscalerasValoresPreliminar(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_valores_preliminar (k_codusuario,k_codinspeccion,k_coditem_preli,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores preliminares...Espere\");\n console.log('transaction creada ok');\n });\n}", "function eliminarTablas(tx){\n\ttx.executeSql('DROP TABLE IF EXISTS Usuario');\n\ttx.executeSql('DROP TABLE IF EXISTS Historial');\n}", "function obtener_datos_todos_establecimiento() {\n var lista_datos = conexion_cuestionarios_resuelto();\n var contenido = \"\";\n var sucursal = \"\";\n var indice = 1;\n if (lista_datos.length > 0 ) {\n $.each(lista_datos, function (index, item) {\n if (index == 0) {\n contenido = \"<tr class='celda_tabla_res' style='background-color:#cbf1f5' ><th style='width:60px'>#</th><th style='width:30%'>\"+item.establecimiento+\"</th><th style='width:60px' >limpieza %</th><th style='width:60px'>Surtido %</th><th style='width:60px'>Imagen %</th><th style='width:60px'>Total %</th></tr>\"\n $(\"#tabla_res\").append(contenido);\n sucursal=item.establecimiento;\n }//fin if\n if (sucursal == item.establecimiento) {\n contenido = \"<tr class='celda_tabla_res dato'><td style='width:60px'>\" + indice + \"</td><td class='nombre' style='width:30%'>\" + item.cuestionario + \"</td><td style='width:90px' >\" + item.limpieza + \"</td><td style='width:90px'>\" + item.surtido + \"</td><td style='width:90px'>\" + item.imagen + \"</td><td style='width:60px'>\" + item.total + \"</td></tr>\"\n $(\"#tabla_res\").append(contenido);\n indice++;\n }\n else {\n indice = 1;\n contenido = \"<tr class='celda_tabla_res' style='background-color:#cbf1f5' ><th style='width:60px'>#</th><th style='width:30%'>\" + item.establecimiento + \"</th><th style='width:60px' >limpieza %</th><th style='width:60px'>Surtido %</th><th style='width:60px'>Imagen %</th><th style='width:60px'>Total %</th></tr>\"\n $(\"#tabla_res\").append(contenido);\n contenido = \"<tr class='celda_tabla_res dato'><td style='width:60px'>\" + indice + \"</td><td class='nombre' style='width:30%'>\" + item.cuestionario + \"</td><td style='width:90px' >\" + item.limpieza + \"</td><td style='width:90px'>\" + item.surtido + \"</td><td style='width:90px'>\" + item.imagen + \"</td><td style='width:60px'>\" + item.total + \"</td></tr>\"\n $(\"#tabla_res\").append(contenido);\n sucursal = item.establecimiento;\n indice++;\n }//fin if\n });\n }//fin\n else alert(\"No Hay Datos...\");\n}//fin", "function crearTablaTransicion(entrada,alfabeto,tablaTransicion){\n var tablaPadre = document.createElement('table'),\n filaTitulo = document.createElement('tr');\n for(let i=0; i<transiciones.length ; i++){\n var columnaTitulo = document.createElement('td');\n columnaTitulo.className='formatoTablaTitulo';\n columnaTitulo.textContent = transiciones[i];\n filaTitulo.appendChild(columnaTitulo);\n }\n tablaPadre.appendChild(filaTitulo);\n for(let i=0; i<entrada.length; i++){\n for(let j=0; j<alfabeto.length; j++){\n var filaDatos = document.createElement('tr'), \n columnaEstados = document.createElement('td'), \n columnaAlfabeto = document.createElement('td'),\n columnaInput = document.createElement('td'),\n input = document.createElement('input');\n //estilos y contenido a las columnas\n columnaEstados.className='formatoTabla';\n columnaEstados.textContent = entrada[i];\n columnaAlfabeto.className='formatoTabla';\n columnaAlfabeto.textContent = alfabeto[j];\n input.className='form-control';\n input.setAttribute('placeholder','Estado Destino');\n input.setAttribute('type','text');\n input.id=`${entrada[i]}-${alfabeto[j]}`;\n //agrego los elementos a sus nodos padres\n columnaInput.appendChild(input);\n filaDatos.appendChild(columnaEstados);\n filaDatos.appendChild(columnaAlfabeto);\n filaDatos.appendChild(columnaInput);\n tablaPadre.appendChild(filaDatos);\n }\n }\n tablaTransicion.appendChild(tablaPadre);\n}", "function inBang()\n{\n for(var i=0;i<3;i++)\n {\n var tableRow =document.createElement(\"tr\");\n tableBody.appendChild(tableRow);\n\n var user=data.users[i];\n var info=[user.id,user.name,user.email];\n\n for(var j=0;j<info.length;j++)\n {\n\n var tableData=document.createElement(\"td\");\n tableData.innerHTML=info[j];\n tableRow.appendChild(tableData);\n }\n }\n}", "function generarCola(usuario,permiso) {\n\tconsole.log(\"generamos cola\");\n\tlet tabla = {\n\t\t\"datos\":[\n\t\t\t{\n\t\t\t\t\"Estado\":\"Genera permiso\",\n\t\t\t\t\"Contador\":0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Estado\":\"Pdte. Autoriz. Permiso\",\n\t\t\t\t\"Contador\":0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Estado\":\"Pdtes. Justificante\",\n\t\t\t\t\"Contador\":0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Estado\":\"Pdte. Autoriz. Justificante\",\n\t\t\t\t\"Contador\":0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Estado\":\"Ausencia finalizada\",\n\t\t\t\t\"Contador\":0\n\t\t\t}\n\t\t]\n\t};\n\tswitch (permiso) {\n\t\tcase \"Profesor\":\n\t\t\tpideDatos(\"peticion\",\"?usuario=\"+usuario,(data) => {\n\t\t\t\t\t//Convertimos a JSON los datos obtenidos\n\t\t\t\t\tlet json = JSON.parse(data);\n\t\t\t\t\t//Colocamos cada permiso en su lugar\n\t\t\t\t\tfor(let dato of json){\n\t\t\t\t\t\ttabla.datos[dato[\"estado_proceso\"]-1].Contador++;\n\t\t\t\t\t}\n\t\t\t\t\tprintDatos(tabla,\"#cola\");\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tbreak;\n\t\tcase \"Directivo\":\n\t\t\tpideDatos(\"peticion\",\"?\",\n\t\t\t\t(data) => {\n\t\t\t\t\t//Convertimos a JSON los datos obtenidos\n\t\t\t\t\tlet json = JSON.parse(data);\n\t\t\t\t\t//Colocamos cada permiso en su lugar\n\t\t\t\t\tfor(let dato of json){\n\t\t\t\t\t\tif (dato[\"estado_proceso\"]===1 || dato[\"estado_proceso\"]===3){\n\t\t\t\t\t\t\tif (dato.usuario===usuario){\n\t\t\t\t\t\t\t\ttabla.datos[dato[\"estado_proceso\"]-1].Contador++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttabla.datos[dato[\"estado_proceso\"]-1].Contador++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tprintDatos(tabla,\"#cola\");\n\t\t\t\t\t//json=JSON.parse(data);\n\t\t\t\t}\n\t\t\t);\n\n\n\t\t\tbreak;\n\t\tcase \"Admin\":\n\t\t\tpideDatos(\"peticion\",\"?\",\n\t\t\t\t(data) => {\n\t\t\t\t\t//Convertimos a JSON los datos obtenidos\n\t\t\t\t\tlet json = JSON.parse(data);\n\t\t\t\t\t//Colocamos cada permiso en su lugar\n\t\t\t\t\tfor(let dato of json){\n\t\t\t\t\t\ttabla.datos[dato[\"estado_proceso\"]-1].Contador++;\n\t\t\t\t\t}\n\t\t\t\t\tprintDatos(tabla,\"#cola\");\n\t\t\t\t\t//json=JSON.parse(data);\n\t\t\t\t}\n\t\t\t);\n\t\t\tbreak;\n\t}\n}", "function crearTablaAscensorValoresPozo(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_pozo (k_codusuario,k_codinspeccion,k_coditem,n_calificacion,v_calificacion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores pozo...Espere\");\n console.log('transaction creada ok');\n });\n}", "function table(Estado, Hora, Personas, Id, Telefono, Correo, key) {\n var user = firebase.auth().currentUser;\n var nuevo = user.email;\n\n var tab = '<tr><td>' + Id + '</td><td>' + Estado + '</td><td>' + Hora + '</td>'\n if (nuevo === Correo) {\n tab += '<td>'\n tab += '<a href=\"#\" class=\"btn btn-primary \" data-toggle=\"modal\" data-target=\"#exampleModalScrollable1\" onclick=\"viewDataUpdate(\\'' + Id + '\\',\\'' + Personas + '\\',\\'' + Telefono + '\\',\\'' + Correo + '\\',\\'' + key + '\\')\">Editar su reserva</a>'\n tab += '</td></tr>';\n } else if(nuevo !== Correo) {\n tab += '<td>'\n if (Estado === \"Sin Reservar\") {\n tab += '<a href=\"#\" class=\"btn btn-primary \" data-toggle=\"modal\" data-target=\"#exampleModalScrollable1\" onclick=\"viewDataUpdate(\\'' + Id + '\\',\\'' + Personas + '\\',\\'' + Telefono + '\\',\\'' + Correo + '\\',\\'' + key + '\\')\">Reservar</a>'\n } else {\n tab += '<a>Esto ya fue Reservado</a>' \n }\n tab += '</td></tr>';\n }\n return tab;\n}", "function createTable() {\n\tdata = JSON.parse(localStorage.getItem('users'));\n userinarray = itemsArray.length;\n var j = 0;\n var userPerPage = 10;\n var pager = 1;\n showUsersContainer.innerHTML = \"\";\n while (j < userinarray) {\n if (j == userPerPage) {\n pager++;\n userPerPage += 10\n }\n let liUser = document.createElement(\"li\");\n liUser.setAttribute(\"data-id\", data[j].userID);\n liUser.setAttribute(\"data-page\", pager);\n let ul = document.createElement(\"ul\");\n let lifullname = document.createElement(\"li\");\n lifullname.setAttribute(\"data-id\", \"fullname-\" + data[j].userID);\n lifullname.innerHTML = data[j].fullname;\n ul.appendChild(lifullname);\n let liusername = document.createElement(\"li\");\n liusername.setAttribute(\"data-id\", \"username-\" + data[j].userID);\n liusername.innerHTML = data[j].username;\n ul.appendChild(liusername);\n let liemail = document.createElement(\"li\");\n liemail.setAttribute(\"data-id\", \"email-\" + data[j].userID);\n liemail.innerHTML = data[j].email;\n ul.appendChild(liemail);\n let lipassword = document.createElement(\"li\");\n lipassword.setAttribute(\"data-id\", \"password-\" + data[j].userID);\n lipassword.innerHTML = data[j].password;\n ul.appendChild(lipassword);\n let liedit = document.createElement(\"li\");\n liedit.innerHTML = '<button id=\"' + data[j].userID + '\" class=\"edit-button\"><i class=\"fa fa-pencil-square-o\" aria-hidden=\"true\"></i>Edit</button>';\n ul.appendChild(liedit);\n let lidelete = document.createElement(\"li\");\n lidelete.innerHTML = '<button id=\"' + data[j].userID + '\" class=\"delete-button\"><i class=\"fa fa-times\" aria-hidden=\"true\"></i>Delete</button>';\n ul.appendChild(lidelete);\n liUser.appendChild(ul);\n showUsersContainer.appendChild(liUser);\n j++;\n\n }\n}", "function populateTableOld(existingUsers) {\r\n\tif(existingUsers.length > 0) {\t\r\n\t\tdocument.getElementById(\"existingList\").style.display=\"block\";\r\n\t\tvar userList = document.getElementById(\"existingUsersTableId\");\r\n\t\tvar tableStr = \"<table width='94%' border='1' bordercolor='#78C0D3' id='myTable' align='center'><thead class='tab_header'><tr><th>SL. No.</th><th>User Name</th><th>User Group Name</th><th>Expiration Date</th><th width='22%'>Action</th></tr></thead><tbody>\";\r\n\t\tvar counter = 1;\r\n\t\tfor (var index=0; index<existingUsers.length; index++) {\r\n\t\t\tvar trColor = \"\";\r\n\t\t\tif(index % 2 == 0) {\r\n\t\t\t\ttrColor = \"#D2EAF0\";\r\n\t\t\t} else {\r\n\t\t\t\ttrColor = \"#F1F1F1\";\r\n\t\t\t}\r\n\t\t\tvar expiryDate = new Date(existingUsers[index].jctAccountExpirationDate).toDateString();\r\n\t\t\tvar userExpryDate = dateformat(new Date (expiryDate));\t\t\t\r\n\t\t\t\r\n\t\t\ttableStr = tableStr + \"<tr class='user_list_row_width' bgcolor='\"+trColor+\"'><td align='center'>\"+counter+\".</td><td align='center'>\"+existingUsers[index].email+\"</td><td align='center'>\"+existingUsers[index].userGroup+\"</td><td align='center'>\"+userExpryDate+\"</td>\";\r\n\t\t\ttableStr = tableStr + \"<td class='table_col_txt_style' ><table width='100%' border='0'><tr>\";\r\n\t\t\tif(parseInt(existingUsers[index].softDelete) == 0) {\r\n\t\t\t\ttableStr = tableStr + \"<td align='center'><a href='#' onclick='updateStatus(\\\"\"+existingUsers[index].email+\"\\\", \\\"\"+existingUsers[index].softDelete+\"\\\")'> Deactivate</a></td>\";\r\n\t\t\t} else {\r\n\t\t\t\ttableStr = tableStr + \"<td align='center'><a class='inactivate_style' href='#' onclick='updateStatus(\\\"\"+existingUsers[index].email+\"\\\", \\\"\"+existingUsers[index].softDelete+\"\\\")'> Activate</a></td>\";\r\n\t\t\t}\r\n\t\t\tif (parseInt(existingUsers[index].activeInactiveStatus) == 1) {\r\n\t\t\t\ttableStr = tableStr + \"<td align='center'><a href='#' onclick='resetPassword(\\\"\"+existingUsers[index].email+\"\\\")'>Reset Password</a></td></td></tr></table></td></tr>\";\r\n\t\t\t} else {\r\n\t\t\t\ttableStr = tableStr + \"<td align='center'><span class='non_clickable'>Reset Password</span></td></td></tr></table></td></tr>\";\r\n\t\t\t}\t\t\t\r\n\t\t\tcounter = counter + 1;\r\n\t\t}\r\n\t\ttableStr = tableStr + \"</tbody></table>\";\r\n\t\tuserList.innerHTML = tableStr;\r\n\t\tnew SortableTable(document.getElementById('myTable'), 1);\r\n\t} else {\r\n\t\tdocument.getElementById(\"existingList\").style.display=\"none\";\r\n\t\tdocument.getElementById(\"existingUsersTableId\").innerHTML = \"<div align='center'><br /><br /><br /><img src='../img/no-record.png'><br /><div class='textStyleNoExist'>No Existing Users</div></div>\";\r\n\t}\r\n\t\r\n}", "function fill_up(){\n $(\"#content\").html(\"<img src='img/loading.gif' width='200' />\");\n $.ajax({\n type: 'POST',\n url: 'profile/getallusers',\n dataType: 'json',\n success: function(resp){\n $(\"#content\").html(\"<table><tbody></tbody></table>\");\n $(\"tbody\").append(\"<tr><td>EMAIL</td><td>NOMBRE</td><td>TELEFONO</td><td>ROL</td><td colspan='2' id='btn-new-user'>Nuevo usuario</td></tr>\");\n for(i=0;i<resp.length;i++){\n $(\"tbody\").append(\"<tr id='\"+resp[i].id_usuario+\"'>\");\n $(\"tr:last\").append(\"<td>\"+resp[i].email+\"</td>\");\n $(\"tr:last\").append(\"<td>\"+resp[i].nombre+\"</td>\");\n $(\"tr:last\").append(\"<td>\"+resp[i].telefono_contacto+\"</td>\");\n switch(resp[i].rol){\n case '1': rol=\"Admin\";\n break;\n case '2': rol=\"User\";\n break;\n case '3': rol=\"Moderator\";\n break;\n default:rol=\"Undefined\";\n break;\n }\n $(\"tr:last\").append(\"<td>\"+rol+\"</td>\");\n $(\"tr:last\").append(\"<td class='btn-edit'>Editar</td>\");\n $(\"tr:last\").append(\"<td class='btn-delete'>Borrar</td>\");\n $(\"tbody\").append(\"</tr>\");\n }\n }\n });\n }", "function initTable() {\r\n\r\n const TaskTable = document.getElementById('task-table'); //recupero tabella da svuotare, attarverso il suo id\r\n \r\n TaskTable.innerHTML = ''; //svuoto la tabella, e poi inserisco nulla('')\r\n\r\n }", "function crearTablaTransicionResultados(automata,resultado){ \n let transiciones = ['Entrada','Lectura','Destino'];\n var tablaPadre = document.createElement('table'),\n filaTitulo = document.createElement('tr'); \n\n for(let i=0; i<transiciones.length ; i++){\n var columnaTitulo = document.createElement('td');\n columnaTitulo.className='tablatransicion';\n columnaTitulo.textContent = transiciones[i];\n filaTitulo.appendChild(columnaTitulo);\n }\n tablaPadre.appendChild(filaTitulo);\n for(let i=0; i<automata.est_entrada.length; i++){\n for(let j=0; j<automata.arr_alfabeto.length; j++){\n var filaDatos = document.createElement('tr'), \n columnaEstados = document.createElement('td'),\n columnaAlfabeto = document.createElement('td'),\n columnaDestinos = document.createElement('td');\n \n if(automata.arr_estados[i].estado_to[j] != null){\n //estilos y contenido a las columnas\n columnaEstados.className='tablatransicionHijos';\n columnaEstados.textContent = automata.est_entrada[i];\n columnaAlfabeto.className='tablatransicionHijos';\n columnaAlfabeto.textContent = automata.arr_alfabeto[j];\n columnaDestinos.className='tablatransicionHijos';\n columnaDestinos.textContent = automata.arr_estados[i].estado_to[j];\n //agrego los elementos a sus nodos padres\n filaDatos.appendChild(columnaEstados);\n filaDatos.appendChild(columnaAlfabeto);\n filaDatos.appendChild(columnaDestinos);\n tablaPadre.appendChild(filaDatos);\n }\n }\n }\n resultado.appendChild(tablaPadre);\n}", "function crearTablaEscalerasValoresProteccion(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE escaleras_valores_proteccion (k_codusuario,k_codinspeccion,k_coditem,v_sele_inspector,v_sele_empresa,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores protección...Espere\");\n console.log('transaction creada ok');\n });\n}", "function createTable_2() {\n let table = document.createElement('table');\n\n table.id = 'lampIN';\n\n let parentTable = document.getElementById('tbl2');\n let myRow = document.createElement('tr');\n //console.log(myRow);\n let myCell = document.createElement('th');\n myCell.innerHTML = 'Дата';\n myRow.appendChild(myCell);\n myCell = document.createElement('th');\n myCell.innerHTML = 'id <br>Лампы';\n myRow.appendChild(myCell);\n myCell = document.createElement('th');\n myCell.innerHTML = 'Наименование';\n myRow.appendChild(myCell);\n myCell = document.createElement('th');\n myCell.innerHTML = 'Прибор';\n myRow.appendChild(myCell);\n myCell = document.createElement('th');\n myCell.innerHTML = 'Кол-во';\n myRow.appendChild(myCell);\n myCell = document.createElement('th');\n myCell.innerHTML = 'Персонал';\n myRow.appendChild(myCell);\n myCell = document.createElement('th');\n myCell.innerHTML = 'Где лежит';\n myRow.appendChild(myCell);\n myCell = document.createElement('th');\n myCell.innerHTML = 'Примечания';\n myRow.appendChild(myCell);\n\n table.appendChild(myRow);\n parentTable.appendChild(table);\n\n}", "function vaciarTabla() {\n pedidos = [];\n console.table(pedidos);\n let filasTabla = document.querySelectorAll(\"tr\");\n for (const fila of filasTabla) {\n if (fila.parentElement.tagName != \"THEAD\") {\n fila.remove();\n }\n };\n}", "function printUsers() {\n tableBody.innerHTML = '';\n // for(let i = 0; i < users.length; i++) {\n // const row = '<tr><td>'+ users[i].name +'</td><td>' + users[i].age + '</td><td>' + users[i].email + '</td><td>' + users[i].gender + '</td></tr>';\n // tableBody.innerHTML += row;\n // }\n //const usuarios = users.map(user => '<tr><td>'+ user.name +'</td><td>' + user.age + '</td><td>' + user.email + '</td><td>' + user.gender + '</td></tr>');\n users.forEach(user => {\n const row = `<tr>\n <td>${user.name}</td>\n <td>${user.age}</td>\n <td>${user.email}</td>\n <td>${user.gender}</td>\n </tr>`;\n tableBody.innerHTML += row; \n })\n}", "function LoadEditUsers() {\r\n var table = document.getElementById(\"usersTableBody\");\r\n for (let i = 0; i < usuariosBD.length; i++) {\r\n var row = table.insertRow(-1);\r\n var cell_id = row.insertCell(0);\r\n var cell_fname = row.insertCell(1);\r\n var cell_lname = row.insertCell(2);\r\n var cell_email = row.insertCell(3);\r\n var cell_pass = row.insertCell(4);\r\n var cell_type = row.insertCell(5);\r\n var cell_rmv = row.insertCell(6);\r\n var cell_edit = row.insertCell(7);\r\n row.id = `user-row${usuariosBD[i].id}`;\r\n cell_id.innerHTML = `<p>${usuariosBD[i].id}</p>`;\r\n cell_fname.innerHTML = `<p>${usuariosBD[i].nombre}</p>`;\r\n cell_lname.innerHTML = `<p>${usuariosBD[i].apellido}</p>`;\r\n cell_email.innerHTML = `<p>${usuariosBD[i].email}</p>`;\r\n cell_pass.innerHTML = `<p>${usuariosBD[i].pass}</p>`;\r\n cell_type.innerHTML = `<p>${usuariosBD[i].tipo}</p>`;\r\n cell_rmv.innerHTML = `<a onclick = \"RemoveUser(${usuariosBD[i].id})\"><i class=\"fas fa-minus-square rmvbtn\"></i></a>`;\r\n cell_edit.innerHTML = `<a data-toggle=\"modal\" data-target=\"#EditUserModal\" onclick = \"OpenEditUsersModal(${usuariosBD[i].id})\"><i class=\"fas fa-edit editbtn\"></i></a>`;\r\n }\r\n}", "function crearTablaAscensorValoresObservacionFinal(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE ascensor_valores_finales (k_codusuario,k_codinspeccion,o_observacion)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n $('#texto_carga').text(\"Creando valores finales...Espere\");\n console.log('transaction creada ok');\n });\n}", "function printUsers(data) {\n $('#myTable').empty();\n $.each(data.results, function() {\n\n if(this.status == 'admin') {\n $('<tr>').attr('id', this.user_name).appendTo('#myTable');\n } else {\n $('<tr>').attr('id', this.user_name).attr('data-toggle', 'modal').attr('data-target', '#user_modal').appendTo('#myTable');\n }\n\n $('<td>').attr('class', 'text-center').html(this.user_name).appendTo('#'+this.user_name);\n $('<td>').attr('class', 'text-center').html(this.status).appendTo('#'+this.user_name);\n $('<td>').attr('class', 'text-center').html(this.last_updated).appendTo('#'+this.user_name);\n $('<td>').attr('class', 'text-center').html(this.record_created).appendTo('#'+this.user_name);\n $('<td>').attr('class', 'text-center').html(`<a onclick=\"del(this)\"><i class=\"fas fa-trash\" style=\"font-size: 20px\"></i></a>`).appendTo('#'+this.user_name);\n });\n}", "function llenarTabla() {\n const usuario = document.getElementById('idRegistrador').value;\n const rol = document.getElementById('rolRegistrador').value;\n const tipo = \"llenarTabla\";\n\n var table = $('#tablaRegistros').DataTable({\n \"ajax\": {\n type: \"POST\",\n url: \"inc/modelos/modelo-lista-registros.php\", \n data: {\n 'usuario' : usuario,\n 'rol' : rol,\n 'tipo': tipo\n }\n }, \n \"autoWidth\": false,\n \"columns\": [\n {\n \"className\": 'details-control',\n \"orderable\": false,\n \"data\": null,\n \"defaultContent\": '<span title=\"Ver Más\" style=\"opacity:0\">Tip</span>'\n },\n {\n \"className\": 'cerrarReg',\n \"orderable\": false,\n \"data\":null,\n \"defaultContent\": '<span title=\"Cerrar\" style=\"opacity:0\">Tip</span>'\n },\n {\n \"className\": 'editarReg',\n \"orderable\": false,\n \"data\":null,\n \"defaultContent\": '<span title=\"Editar\" style=\"opacity:0\">Tip</span>'\n },\n {\n \"className\": 'borrarReg',\n \"orderable\": false,\n \"data\":null,\n \"defaultContent\": '<span title=\"Borrar\" style=\"opacity:0\">Tip</span>'\n },\n { \"data\": \"id_reg_act\" },\n { \"data\": \"consecutivo\" },\n { \"data\": \"ost\" },\n { \"data\": \"siga\" },\n { \"data\": \"numero_servicio\" },\n { \"data\": \"actividad\" },\n { \"data\": \"cantidad_eventos\" },\n { \"data\": \"peso_total\" },\n { \"data\": \"fecha_hora_apertura\" },\n { \"data\": \"nombre\" },\n { \"data\": \"detalle\" },\n { \"data\": \"grupo\" }\n ],\n \"columnDefs\": [\n {\n \"targets\": [4],\n \"visible\": false,\n \"searchable\": false\n },\n {\n \"targets\": [6],\n \"visible\": false,\n },\n {\n \"targets\": [7],\n \"visible\": false,\n },\n {\n \"targets\": [8],\n \"visible\": false,\n },\n {\n \"targets\": [11],\n \"visible\": false,\n \"searchable\": false\n },\n {\n \"targets\": [14],\n \"visible\": false,\n },\n {\n \"targets\": [15],\n \"visible\": false,\n \"searchable\": false\n }\n ],\n \"order\": [[4, \"desc\"]],\n \"language\": {\n \"sProcessing\": \"Procesando...\",\n \"sLengthMenu\": \"Mostrar _MENU_ registros\",\n \"sZeroRecords\": \"No se encontraron resultados\",\n \"sEmptyTable\": \"Ningún dato disponible en esta tabla\",\n \"sInfo\": \"Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros\",\n \"sInfoEmpty\": \"Mostrando registros del 0 al 0 de un total de 0 registros\",\n \"sInfoFiltered\": \"(filtrado de un total de _MAX_ registros)\",\n \"sInfoPostFix\": \"\",\n \"sSearch\": \"Buscar:\",\n \"sUrl\": \"\",\n \"sInfoThousands\": \",\",\n \"sLoadingRecords\": \"Cargando...\",\n \"oPaginate\": {\n \"sFirst\": \"Primero\",\n \"sLast\": \"Último\",\n \"sNext\": \"Siguiente\",\n \"sPrevious\": \"Anterior\"\n },\n \"oAria\": {\n \"sSortAscending\": \": Activar para ordenar la columna de manera ascendente\",\n \"sSortDescending\": \": Activar para ordenar la columna de manera descendente\"\n },\n \"buttons\": {\n \"copy\": \"Copiar\",\n \"colvis\": \"Visibilidad\"\n },\n \"select\": {\n \"rows\": {\n _: \"You have selected %d rows\",\n 0: \"\",\n 1: \"1 fila seleccionada\"\n }\n }\n },\n \"select\": 'single'\n });\n\n // Si el rol del usuario es vista o tecnico, se ocultan las siguientes opciones\n if(rol === \"Vista\" || rol === \"Tecnico\"){\n // Oculta opcion de cerrar registros\n table.column( 1 ).visible( false );\n table.column( 2 ).visible( false );\n table.column( 3 ).visible( false );\n } else if(rol === \"Operador\"){\n table.column( 3 ).visible( false );\n }\n\n // Se agrega el evento para mostrar u ocultar los detalles\n $('#tablaRegistros tbody').on('click', 'td.details-control', function () {\n var tr = $(this).closest('tr');\n var row = table.row(tr);\n\n if (row.child.isShown()) {\n // Si la fila se está mostrando, se oculta\n row.child.hide();\n tr.removeClass('shown');\n }\n else {\n // Muestra ésta fila\n row.child(format(row.data())).show();\n tr.addClass('shown');\n }\n });\n\n // Se agrega el evento para cerrar un registro\n $('#tablaRegistros tbody').on( 'click', 'td.cerrarReg', function () {\n var data = table.row( $(this).parents('tr') ).data();\n var todos = table.data();\n let tipo = \"cerrar\";\n modalAccionesRegistro(data, todos, tipo);\n } );\n\n // Se agrega el evento para editar un registro\n $('#tablaRegistros tbody').on( 'click', 'td.editarReg', function () {\n var data = table.row( $(this).parents('tr') ).data();\n var todos = table.data();\n let tipo = \"editar\";\n modalAccionesRegistro(data, todos, tipo);\n } );\n\n // Se agrega el evento para editar un registro\n $('#tablaRegistros tbody').on( 'click', 'td.borrarReg', function () {\n var data = table.row( $(this).parents('tr') ).data();\n var todos = table.data();\n let tipo = \"borrar\";\n modalAccionesRegistro(data, todos, tipo);\n } );\n\n}", "function updateUserInTable({userName, email, userId}){\n let userListRows = $userListTable.childNodes\n let userListLength = userListRows.length\n\n for(let i = 1; i < userListLength; i++){\n let row = userListRows[i]\n if(row.getAttribute('user-id') == userId){\n let userNameEl = row.querySelector(\".et-username\")\n let emailEl = row.querySelector(\".et-email\")\n\n userNameEl.innerText = userName,\n emailEl.innerText = email\n break\n }\n }\n}", "renderTableData() {\n return this.state.tableData.map((user,index) => {\n const{id, username, email, role, status} = user\n return (\n // gets the users id, username, email, role and status \n <tr key={id}>\n <td>{username}</td>\n <td>{email}</td>\n {/* <td>{role}</td> */} \n <td><Button variant=\"primary\" onClick={this.changeUserRole.bind(this, user)}>{role}</Button></td>\n {/* calls the changeUserStatus method */}\n <td><Button variant=\"warning\" onClick={this.changeUserStatus.bind(this, user)}>{status}</Button></td>\n {/* calls the deleteUser method */}\n <td><Button variant=\"danger\" onClick={this.deleteUser.bind(this, user.id)} >Remove</Button></td>\n </tr>\n )\n })\n }", "abrirSessao(bd, usuario, hashSenha) {\n var resLogin = [];\n var papelUsuario = \"\";\n var colunasProjetadas = [\"nomeusuario\", \"senha\", \"carteira\"];\n var nomeColunaCarteira = \"carteira\";\n\n configuracoes.tabelas.forEach(function (nomeTabela, indice) {\n var resLoginTemp = interfaceBD.select(\n bd,\n nomeTabela,\n colunasProjetadas,\n { nomeusuario: usuario, senha: hashSenha },\n 1\n );\n if (resLoginTemp != null) {\n resLogin = resLogin.concat(resLoginTemp);\n if (resLoginTemp.length && papelUsuario === \"\")\n papelUsuario = nomeTabela;\n }\n console.log(\n `A saida da tabela ${nomeTabela} foi: ${resLoginTemp}\\nE possui comprimento de ${resLoginTemp.length}`\n );\n });\n\n console.log(\n `A saida das tabelas foi: ${resLogin}\\nE possui comprimento de ${resLogin.length}`\n );\n\n if (resLogin != null && resLogin != {}) {\n if (resLogin.length > 0) {\n return {\n estado: \"aberta\",\n conteudo: resLogin,\n papelUsuario: papelUsuario,\n carteiraUsuario:\n resLogin[0][colunasProjetadas.indexOf(nomeColunaCarteira)],\n horaAbertura: new Date(),\n };\n }\n /*return ContentService.createTextOutput(\n JSON.stringify({ nome: \"isaias\" })\n ).setMimeType(ContentService.MimeType.JSON);*/\n }\n\n return { estado: \"fechada\", conteudo: [], horaAbertura: new Date() };\n }", "criaTelefones() {\n const sql = 'CREATE TABLE IF NOT EXISTS Telefones (id int NOT NULL AUTO_INCREMENT, numeroTelefone varchar(20), tipoTelefone varchar(20), cliente INT NOT NULL, PRIMARY KEY(id), FOREIGN KEY (cliente) REFERENCES Usuario(id))'\n this.conexao.query(sql, (erro) => {\n if(erro) {\n console.log(erro)\n }\n })\n }", "function remplirTableau() {\r\n tabIsEmpty = false;\r\n tbody.empty();\r\n var html = \"\";\r\n data.forEach(function (element) {\r\n html = '<tr>' +\r\n '<th>' + element.order + '</th>' +\r\n '<td>' + element.activity + '</td>' +\r\n '<td>' + element.manager + '</td>' +\r\n '<td>' + element.numofsub + '</td>' +\r\n '</tr>';\r\n tbody.append(html);\r\n });\r\n }", "function getOneUserTable(data) {\n var tableData = [\"<tr><td>\" + data.id + \"</td><td>\" + data.age + \"</td><td>\" + data.name + \"</td><td>\" + data.gender + \"</td><td>\" + data.email + \"</td></tr>\"];\n tableData.unshift('<table class=\"table\"><tr><th scope=\"col\">id</th><th scope=\"col\">age</th><th scope=\"col\">name</th><th scope=\"col\">gender</th><th scope=\"col\">email</th></tr>');\n tableData.push(\"</table>\");\n return tableData.join(\"\");\n}", "function printAdminsTables() {\n localStorage.setItem(\"Page\",1);\n delContent();\n for (var i = 0; i < obj.admins.length; i++) {\n admins = obj.admins[i];\n printTable(i);\n printBlankTable(admins, i);\n printAvatars(admins, i);\n printNames(admins, i);\n printIds(admins, i);\n printBlankTable(admins, i);\n printUserNames(admins, i);\n printEmails(admins, i);\n btnEdit(admins, i);\n printState(admins, i);\n }\n delNav();\n table = true;\n paginadorTable();\n}", "function criarItensTabala(dados) {\n\n const linha = tabela.insertRow();\n\n const colunaId = linha.insertCell(0)\n const colunaNome = linha.insertCell(1)\n const colunaValor = linha.insertCell(2)\n const colunaAcoes = linha.insertCell(3)\n\n const itemId = document.createTextNode(dados.id)\n const itemNome = document.createTextNode(dados.nome)\n const itemValor = document.createTextNode(dados.valor)\n\n colunaId.appendChild(itemId)\n colunaNome.appendChild(itemNome)\n colunaValor.appendChild(itemValor)\n\n criarBotoesTabela(colunaAcoes, dados)\n ordemCrescente()\n}", "function cargarTablaPrincipal() {\n\n var correoUs = localStorage.getItem(\"correosRecibidos\");\n correoUs = JSON.parse(correoUs);\n var userN = JSON.parse(localStorage.getItem('usuLog'));\n var ULog = userN.usuario;\n $(\"#datarowPrincipal\").html(\"\");\n for (var i in carRec) {\n\n var s=JSON.stringify(carRec[i]);\n var d = JSON.parse(s);\n \n var con = 0;\n\n if (d.nomUsu == ULog) {\n console.log(i);\n con += 1;\n var tbody = document.querySelector('#tablaPrincipal tbody');\n \n $(\"#datarowPrincipal\").append(\n \"<tr>\" +\n \"<td>\" + d.destino + \"</td>\" + \n \"<td>\" + d.mensaje + \"</td>\" +\n \"<td>\" + d.fecha + \"</td>\" +\n \"<th><a onclick=' loadCorPri(\"+i+\") ' data-toggle='modal' data-target='#basicExampleModal' >👁️</a></th>\" +\n \"<th><a id='\" + i + \"' class='btnEliminar' href='#' onclick='deleted(\"+i+\")' >🗑️</a></th>\" +\n \"</tr>\"\n );\n\n }\n }\n if (con == 0) {\n alertaMod(\"¡No cuentas con mensajes en esta sección!\",\"danger\"); \n \n }\n \n}", "function mostrarUsuarios() {\n function armarFilasDeUsuarios(usuario) {\n const tr = `\n <tr>\n <td>${usuario.nombre}</td>\n <td>${usuario.rol}</td>\n <td>\n <!-- Button trigger modal -->\n <button onclick=\"mostrarDetalleUsuario('${usuario.id}')\" type=\"button\" class=\"btn btn-primary\" data-bs-toggle=\"modal\" data-bs-target=\"#modalDetalleUsuario\"> Ver detalle </button>\n <button onclick=\"cargarModalEditar('${usuario.id}')\" class=\"btn btn-warning\" data-bs-toggle=\"modal\" data-bs-target=\"#modalEditarUsuario\">Editar</button>\n <button onclick=\"eliminarUsuario('${usuario.id}')\" class=\"btn btn-danger\">Eliminar</button>\n </td>\n </tr>\n `;\n return tr;\n }\n\n // El método map genera un array nuevo sin modificar el array original.\n // Recibe por parámetros la función que debe ejecutarse por cada elemento del array.\n const contenido = usuarios.map(armarFilasDeUsuarios);\n\n contenidoTabla.innerHTML = contenido.join('');\n}", "function adicionaPacientesNaTabela(paciente){\n\n\t// Cria uma linha da tabela com as colunas respectivamente do paciente\n\tvar tr = criaTabela(paciente);\n\n\t//Obtem a tabela do index.html\n\tvar tabela_paciente = document.querySelector(\"#tabela-pacientes\");\n\t\n\t//Adiciona a linha tr com as colunas td e adiciona como filha na tabela #tabela-pacientes\n\ttabela_paciente.appendChild(tr);\n}", "function aniadirEmpleadoTabla(empleado) {\n\tvar tablaEmpleados = document.getElementById(\"tablaEmpleados\");\t\n\tvar celda;\n\tvar contadorCeldas = 0;\n\tvar fila = tablaEmpleados.insertRow(-1);\n\n\t//Vamos creando las celdas con el contenido del objeto\n\tvar newCell = fila.insertCell(contadorCeldas);\n\tnewCell.innerHTML = empleado.nombre;\n\tcontadorCeldas++;\n\t\n\tvar newCell = fila.insertCell(contadorCeldas);\n\tnewCell.innerHTML = empleado.dni;\n\tcontadorCeldas++;\n\n\tvar newCell = fila.insertCell(contadorCeldas);\n\tnewCell.innerHTML = empleado.telefono;\n\tcontadorCeldas++;\n\n\tif (empleado instanceof Fisioterapeuta){\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = empleado.horasConsulta;\n\t\tcontadorCeldas++;\n\t\t\n\t\t//Respetamos los huecos vacios con atributos del monitor\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = \"-\";\n\t\tcontadorCeldas++;\n\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = \"-\";\n\t\tcontadorCeldas++;\n\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = \"-\";\n\t\tcontadorCeldas++;\n\n\t}else{\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = \"-\";\n\t\tcontadorCeldas++;\n\t\t\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = empleado.actividades;\n\t\tcontadorCeldas++;\n\t\t\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = empleado.horasClase;\n\t\tcontadorCeldas++;\n\t\t\n\t\tvar newCell = fila.insertCell(contadorCeldas);\n\t\tnewCell.innerHTML = empleado.horasComun;\n\t\tcontadorCeldas++;\n\t}\n\t\n\tvar newCell = fila.insertCell(contadorCeldas);\n\tnewCell.innerHTML = \"<button onclick=\\\"mostrarDescripcion(this)\\\">DESCRIPCION</button>\";\t\t\n\n}" ]
[ "0.63771605", "0.6148342", "0.61241806", "0.597691", "0.5948794", "0.5946766", "0.5944438", "0.5909169", "0.58859867", "0.5879889", "0.58672124", "0.584158", "0.5725355", "0.5704584", "0.5695114", "0.5670802", "0.5669452", "0.56421417", "0.5628315", "0.56281555", "0.56186324", "0.5615016", "0.55980134", "0.5595532", "0.5590082", "0.55896175", "0.55874246", "0.55874246", "0.55693525", "0.5548913", "0.5546424", "0.55274254", "0.55270916", "0.55206203", "0.5516417", "0.55024374", "0.5494543", "0.5484654", "0.54824096", "0.5475287", "0.5473483", "0.54734194", "0.54651034", "0.5462576", "0.54594404", "0.54530954", "0.5444193", "0.54260164", "0.54249", "0.5415353", "0.54094696", "0.54091704", "0.54084206", "0.53997993", "0.5398439", "0.53982884", "0.5394823", "0.5384591", "0.5380317", "0.5377878", "0.53739846", "0.537039", "0.53505147", "0.53502125", "0.5342908", "0.5340948", "0.5334673", "0.53342724", "0.5333443", "0.5332016", "0.53259623", "0.53255606", "0.5322493", "0.5321323", "0.53153855", "0.5307091", "0.53009456", "0.5299247", "0.52970636", "0.52951914", "0.529209", "0.5291723", "0.52883756", "0.52837735", "0.52824396", "0.52683", "0.52669364", "0.5266302", "0.5262113", "0.52585447", "0.52549696", "0.5234803", "0.52335393", "0.5231303", "0.5230413", "0.52289516", "0.5227726", "0.52269715", "0.5225095", "0.52242357", "0.5222305" ]
0.0
-1
Funcion para pintar el formulario de modificacion de la cuenta
function getFormCuenta() { var espacio = document.getElementById("resalto"); var botonCuenta = document.getElementById("modificarCuenta"); var botonPedidos = document.getElementById("resultadoPedidos"); if (botonCuenta.style.display === 'none') { botonCuenta.style.display = "block"; botonPedidos.style.display = "none"; espacio.style.display = "none"; } else { botonCuenta.style.display = "none"; if (botonCuenta.style.display === "none" && botonPedidos.style.display === "none") { espacio.style.display = "block"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function modifyForm() {\n\tshowStatusMessage(\"\");\n\t// override manual deposit fields\n\tif ((dojo.byId('status').value == 'PROC' && dojo.byId(\"moduleId\").value == \"ADVW003\") ||\n\t\t\t((dojo.byId('status').value == 'APPR' && dojo.byId(\"moduleId\").value == \"ADVW003\") || \n\t\t\t(dojo.byId('status').value == 'SUBM' && dojo.byId(\"moduleId\").value == \"ADVW003\") || \n\t\t\t(dojo.byId('status').value == 'RJCT' && dojo.byId(\"moduleId\").value == \"ADVW003\") ||\n\t\t\t(dojo.byId('status').value == 'APPR' && dojo.byId(\"moduleId\").value == \"APRW004\") || \n\t\t\t(dojo.byId('status').value == 'RJCT' && dojo.byId(\"moduleId\").value == \"APRW004\") ||\n\t\t\t(dojo.byId('status').value == 'SUBM' && dojo.byId(\"moduleId\").value == \"APRW004\")) &&\n\t\t\t(dojo.byId('previouslyPROC').value == 'Y')) {\n\t\ttoggleAllFieldsReadonly(true);\n\t\t// toggleDojoControlsReadonly('advance', true);\n\t\ttoggleFieldReadonly(manualDepositDocNum, false);\n\t\ttoggleFieldReadonly(manualDepositAmount, false);\n\t\ttoggleDojoControlsReadOnly('advance', true);\n\t\tdisableCbDeleteButtons(true);\n\t\tdojo.byId('buttonSave').disabled = true;\n\t\t\n\t\tbuttonSave.disabled = true;\n\t\t\n\t} else {\n\t\ttoggleAllFields(false);\n\t\ttoggleImages(\"visible\");\n\t\ttoggleDojoControls('advance', false);\n\t\ttoggleField(manualDepositDocNum, true);\n\t\ttoggleField(manualDepositAmount, true);\n\t\n\t\t// override manual warrant field\n\t\tif (dojo.byId(\"moduleId\").value == \"ADVW003\" || dojo.byId(\"moduleId\").value == \"APRW004\"){\n\t\t\ttoggleField(manualWarrantIssdInd, false);\n\t\t\ttoggleField(manualWarrantDocNum, false);\n\t\t}\n\t\telse{\n\t\t\ttoggleField(manualWarrantIssdInd, true);\n\t\t\ttoggleField(manualWarrantDocNum, true);\n\t\t}\n\t\t\n\t\t/*\n\t\t * if (dojo.byId(\"moduleId\").value.substring(0,2) == \"AP\"){ // approver\n\t\t * is modifying buttonSave.disabled = true; } else{ buttonSave.disabled =\n\t\t * false; }\n\t\t */\n}\n\tbuttonSave.disabled = true;\n\tbuttonModify.disabled = true;\n\tbuttonSave.style.display = \"inline\";\t\n\tbuttonSubmit.style.display = \"inline\";\n\tbuttonSubmit.disabled = false;\n\tbuttonApprove.style.display = \"none\";\n\tbuttonApproveWithComments.style.display = \"none\";\n\tbuttonApproveNext.style.display = \"none\";\n\tbuttonApproveSkip.style.display = \"none\";\n\tbuttonReject.style.display = \"none\";\n\tmodifyClicked = true;\n}", "function actualizarPrepago(){\t\r\n\t//alert('actualizar prepago');\r\n\tvar frm = document.forms[0];\r\n\tfrm.buttonActualizar.disabled = false;\r\n\tfrm.buttonActualizarCuenta.disabled=true;\r\n\tfrm.buttonActualizar.value='Actualizar';\r\n\tdocument.getElementById('botoncuenta').style.display='none';\r\n\tfrm.tipo.value='actualizar';\r\n\tfrm.nombre.readOnly=true; //disabled - readOnly\r\n\tfrm.apePat.readOnly=true;\r\n\tfrm.tipoDoc.disabled=true;\r\n\tfrm.numeDoc.readOnly=true;\r\n\tfrm.teleRef.disabled=false;\r\n\tfrm.sexo[0].disabled=false;\r\n\tfrm.sexo[1].disabled=false;\r\n\tfrm.fechaNaci.disabled=false;\r\n\tfrm.lugarNaci.disabled = false;\r\n\tfrm.emailUsuario.disabled=false;\r\n\r\n}", "function accionModificar() {\n\tvar opcionMenu = get(\"formulario.opcionMenu\");\n\tvar oidPlantilla = null;\n\tvar numPlantilla = null;\n\tvar oidParamGrales = null;\n\tvar filaMarcada = null;\n\tvar codSeleccionados = null;\n\tvar datos = null;\t\n\n\tlistado1.actualizaDat();\n\tdatos = listado1.datos;\n\tcodSeleccionados = listado1.codSeleccionados();\n\n\tif (codSeleccionados.length > 1) {\n GestionarMensaje('8');\n\t\treturn;\n\t}\n\n\tif ( codSeleccionados.length < 1)\t{\n GestionarMensaje('4');\n\t\treturn;\n\t}\n\n\t// Obtengo el índice de la fila marcada (en este punto, solo una estará marcada)\n\tvar filaMarcada = listado1.filaSelecc;\n\n\t// Obtengo el oid de Param. Generales (oid del valor seleccionado, está al final de la lista por el tema del ROWNUM)\n\toidParamGrales = datos[filaMarcada][9]; \n\n\t// Obtengo Oid de la Entidad PlantillaConcurso (AKA Numero de Plantilla);\n\tnumPlantilla = datos[filaMarcada][3];\n\n\tvar oidVigenciaConcurso = datos[filaMarcada][10]; \n\tvar oidEstadoConcurso = datos[filaMarcada][11]; \n\tvar noVigencia = get(\"formulario.noVigencia\");\n\tvar estConcuAprobado = get(\"formulario.estConcuAprobado\");\n\n\tif((parseInt(oidVigenciaConcurso) == parseInt(noVigencia)) && \t\t\n\t(parseInt(oidEstadoConcurso)!=parseInt(estConcuAprobado))) {\n\t\tvar obj = new Object();\n\t\t// Seteo los valores obtenidos. \n\t\tobj.oidConcurso = oidParamGrales;\n\t\tobj.oidPlantilla = numPlantilla;\n\t\tobj.opcionMenu = opcionMenu;\n\t\tvar retorno = mostrarModalSICC('LPMantenerParametrosGenerales', '', obj);\n\t\taccionBuscar();\n\t}\n\telse {\n\t\tvar indDespacho = datos[filaMarcada][12];\n\t\tif (oidVigenciaConcurso == '1' && parseInt(indDespacho) == 0) {\n\t\t\tif (GestionarMensaje('3385')) {\n\t\t\t\tvar obj = new Object();\n\t\t\t\t// Seteo los valores obtenidos. \n\t\t\t\tobj.oidConcurso = oidParamGrales;\n\t\t\t\tobj.oidPlantilla = numPlantilla;\n\t\t\t\tobj.opcionMenu = opcionMenu;\n\t\t\t\tobj.oidVigenciaConcurso = oidVigenciaConcurso;\n\t\t\t\tvar retorno = mostrarModalSICC('LPMantenerParametrosGenerales', '', obj);\n\t\t\t\taccionBuscar();\n\t\t\t}\t\n\t\t}\n\t\telse {\n\t\t\t//El concurso seleccionado no puede ser modificado\n\t\t\tGestionarMensaje('INC052');\n\t\t}\n\t}\n}", "static modifyC(req, res) {\n const { titulo,grupo } = req.body\n return Cuadernos\n .findByPk(req.params.id)\n .then((data) => {\n data.update({ \n titulo: titulo || data.titulo,\n grupo: grupo || data.grupo\n })\n .then(update => {\n res.status(200).send({\n success: true,\n message: 'Cuaderno actualizado',\n data: { \n titulo: titulo || update.titulo,\n grupo: grupo || update.grupo\n }\n })\n })\n .catch(error => res.status(400).send({\n success: false,\n message: 'Actualizacion Fallida',\n error}));\n })\n .catch(error => res.status(400).send(error));\n }", "function modificarServicio(){\n\t\t\tif (regServPresta.getForm().isValid()){\n\t\t\t\t\t\tregServPresta.getForm().submit({\n\t\t\t\t\t\t\turl:'modificarservicio',\n\t\t\t\t\t\t\twaitMsg:perfil.etiquetas.lbMsgEsperaModServ,\t\t\t\t\n\t\t\t\t\t\t\tparams:{idservicio:sm.getSelected().data.idservicio, idsistema:arbolServ.getSelectionModel().getSelectedNode().attributes.id},\n\t\t\t\t\t\t\tfailure: function(form, action){\n\t\t\t\t\t\t\t\tif(action.result.codMsg != 3){\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\twinMod.hide();\n\t\t\t\t\t\t\t\t\t\t\tregServPresta.getForm().reset(); \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tstGpServicio.reload();\n\t\t\t\t\t\t\t\t\t\t\tsm.clearSelections();\n\t\t\t\t\t\t\t\t\t\t\tbtnModificar.disable();\n\t\t\t\t\t\t\t\t\t\t\tbtnEliminar.disable();\n\t\t\t\t\t\t\t\t\t\t\tmostrarMensaje(action.result.codMsg, action.result.mensaje); \n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(action.result.codMsg == 3) mostrarMensaje(action.result.codMsg,action.result.mensaje);\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}\n else\n mostrarMensaje(3,perfil.etiquetas.lbMsgErrorEnCamops); \n\t}", "modificarPropuesta(form) {\n form.value.nombrePropuesta = \"MODIFICACION\";\n this.poliza.selectPoliza.nombrePropuesta = \"MODIFICACION\";\n if (form.valid) {\n this.poliza.endPoliza(form.value, this.items)\n .subscribe(res => console.log('Propuesta Añadida(modificacion)'));\n this.toastrSucces(\"Se ha generado correctamente la propuesta, será redirigido pronto a su descarga\", \"Modificación exitosa!!\");\n }\n else {\n this.toastrError(\"Error interno no deja realizar la accion de modificar\", \"Error\");\n }\n }", "function actualizar_esquema_comision(){\n\t\tenviarFormulario(\"#form_esquema_comision_actualizar\", 'EsquemaComision/actualizar_esquema_comision', '#cuadro4');\n\t}", "function actualizarCuenta(){\t\t\r\n\t//alert('actualizar datos cuenta postpago');\r\n\tvar frm = document.forms[0];\r\n\tfrm.buttonActualizar.disabled=true;\r\n\tfrm.buttonActualizarCuenta.disabled=false;\r\n\tfrm.buttonActualizarCuenta.value=\"Actualizar\";\r\n\tfrm.tipo.value=\"actualizarCuenta\";\r\n\r\n\tocultarDatosPrepago();\r\n\t//datos cuenta\r\n\tfrm.teleRefCon.disabled=false;\r\n\tfrm.persCon.disabled=false;\r\n\tfrm.emailCon.disabled=false;\r\n\t//direccion facturacion\r\n\tfrm.dirCalle.disabled=false;\r\n\tfrm.nomCalle.disabled=false;\r\n\tfrm.dirNumero.disabled=false;\r\n\tfrm.dirSn.disabled=false;\r\n\tfrm.dirMz.disabled=false;\r\n\tfrm.dirNumeromz.disabled=false;\r\n\tfrm.dirTipodep.disabled=false;\r\n\tfrm.dirLote.disabled=false;\r\n\tfrm.dirNumerodep.disabled=false;\r\n\tfrm.maxCaracteres1.disabled=false;\r\n\t\r\n\t//direccion de referencia\r\n\tfrm.dirUrbanizacion.disabled=false;\r\n\tfrm.dirRefUrb.disabled=false;\r\n\tfrm.dirRefZona.disabled=false;\r\n\tfrm.dirRefNombrezona.disabled=false;\r\n\tfrm.dirReferencias.disabled=false;\r\n\tfrm.maxCaracteres2.disabled=false;\r\n\t\r\n\t//lista de ubigeos\r\n\t//frm.dirPais.disabled=false;\r\n\tfrm.dirDepartamento.disabled=false;\r\n\tfrm.dirProvincia.disabled=false;\r\n\tfrm.dirDistrito.disabled=false;\r\n\t//frm.dirCodigoPostal.disabled=false;\r\n\t\r\n\tif(frm.dirMz.selectedIndex==0){\r\n\t\tfrm.dirNumeromz.value=\"\";\r\n\t\tfrm.dirLote.value=\"\";\r\n\t\tfrm.dirNumeromz.readOnly=true;\r\n\t\tfrm.dirLote.readOnly=true;\r\n\t}\r\n}", "function modificarProveedor() {\n let resultado = vista.validarDatosForm('formularioProveedor');\n if (resultado === 'ok') {\n let datos = vista.getDatosForm('formularioProveedor');\n proveedor.modificarProveedor(datos, modificarProveedorRetorno);\n } else {\n vista.mostrarModal('MODIFICAR PROVEEDOR', 'Datos no Validos: '+ resultado);\n }\n}", "function doEditCitizen() {\r\n\tallElements = document.getElementById('editCitizenForm');\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Mail:/,\"邮箱:\");\r\n\ttmp = allElements.children[4];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New password:/,\"新密码:\");\r\n\ttmp = allElements.children[8];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New password repeat:/,\"再重复一次:\");\r\n\ttmp = allElements.children[12];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Old password:/,\"旧密码:\");\r\n\ttmp = allElements.children[16];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New avatar:/,\"新头像:\");\r\n\ttmp = allElements.childNodes[30];\r\n\ttmp.nodeValue=tmp.nodeValue.replace(\"max. size\",\"文件尺寸小于\");\r\n\t\r\n\treplaceInputByValue({\"Edit citizen\":[\"Edit citizen\",\"确定编辑\"]});\r\n}", "function modificado(t) {\n datos();\n}", "function doEditCitizen() {\r\n\tallElements = document.getElementById('editCitizenForm');\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Mail:/,\"Email:\");\r\n\ttmp = allElements.children[4];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New password:/,\"Yeni \\u015fifre:\");\r\n\ttmp = allElements.children[8];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New password repeat:/,\"Tekrar yeni \\u015fifre:\");\r\n\ttmp = allElements.children[12];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Old password:/,\"Eski \\u015fifre: :\");\r\n\ttmp = allElements.children[16];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New avatar:/,\"Yeni avatar:\");\r\n\ttmp = allElements.childNodes[30];\r\n\ttmp.nodeValue=tmp.nodeValue.replace(\"max. size\",\"max. boyut :\");\r\n\t\r\n allElements = document.getElementsByTagName('TD');\r\n tmp = allElements[19]\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Citizen/,\"Vatanda\\u015f\");\r\n\treplaceInputByValue({\"Edit citizen\":[\"Edit citizen\",\"Profil d\\u00fczenle\"]});\r\n}", "function doEditCitizen() {\r\n\tallElements = document.getElementById('editCitizenForm');\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Mail:/,\"Email:\");\r\n\ttmp = allElements.children[4];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New password:/,\"Új jelszó:\");\r\n\ttmp = allElements.children[8];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New password repeat:/,\"Ismétlés:\");\r\n\ttmp = allElements.children[12];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Old password:/,\"Régi jelszó: :\");\r\n\ttmp = allElements.children[16];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/New avatar:/,\"Új avatar:\");\r\n\ttmp = allElements.childNodes[30];\r\n\ttmp.nodeValue=tmp.nodeValue.replace(\"max. size\",\"Max. méret; :\");\r\n\t\r\n allElements = document.getElementsByTagName('TD');\r\n tmp = allElements[19]\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Citizen/,\"Polgár\");\r\n\treplaceInputByValue({\"Edit citizen\":[\"Edit citizen\",\"Polgár szerkesztése\"]});\r\n}", "function editar(){\r\n //El objeto que almacena los parámetros que se mandarán en la solicitud PHP.\r\n var parametros = new FormData();\r\n //Especificamos la función en el servidor.\r\n parametros.append(\"fn\", \"mod\");\r\n \r\n //Agregamos el parámetro del ID si el usuario que esté abriendo la página va a editar una cuenta ajena.\r\n parametros.append(\"id\", (id == null ? \"\" : id));\r\n \r\n //Se agregan los nuevos datos básicos a la petición.\r\n var datos_validos =\r\n agregar_parametro(parametros, \"apellido_paterno\", \"ap_p\", \"Apellido paterno\") &&\r\n agregar_parametro(parametros, \"apellido_materno\", \"ap_m\", \"Apellido materno\") &&\r\n agregar_parametro(parametros, \"nombre\", \"nb\", \"Nombre(s)\") &&\r\n agregar_parametro(parametros, \"correo\", \"cr\", \"Correo electrónico\");\r\n if(!datos_validos)\r\n return;\r\n \r\n //Se agregan la nueva contraseña a la petición, si sufrió modificaciones.\r\n if(document.getElementById(\"contrasena\").value != \"\"){\r\n if(document.getElementById(\"contrasena\").value == document.getElementById(\"contrasena_confirmacion\").value)\r\n parametros.append(\"ps\", document.getElementById(\"contrasena\").value);\r\n else{\r\n alert(\"Las contraseñas no coinciden.\");\r\n return;\r\n }\r\n } else {\r\n document.getElementById(\"contrasena_confirmacion\").value = \"\";\r\n aplicar_cambio_contrasena();\r\n }\r\n \r\n //Se agregan los nueva foto de perfil a la petición, si se desea cambiar.\r\n if(document.getElementById(\"foto\").files.length !== 0){\r\n if(document.getElementById('foto').files[0].size < 10485760)\r\n parametros.append(\"ft\", document.getElementById('foto').files[0]);\r\n else{\r\n alert(\"La imagen es demasiado grande\");\r\n return;\r\n }\r\n }\r\n \r\n if(document.getElementById(\"datos_jugador\") !== null){\r\n //Se agregan los datos exclusivos de los jugadores a la petición, si la cuenta a modificar es de ese tipo.\r\n var datos_validos =\r\n agregar_parametro(parametros, \"nacimiento\", \"nc\", \"Fecha de nacimiento\") &&\r\n agregar_parametro(parametros, \"telefono\", \"tel\", \"Número de teléfono\") &&\r\n agregar_parametro(parametros, \"sangre\", \"sg\", \"Tipo de sangre\") &&\r\n agregar_parametro(parametros, \"facebook\", \"fb\", \"Enlace/link al perfil de Facebook\") &&\r\n agregar_parametro(parametros, \"twitter\", \"tw\", \"Enlace/link a la página de Twitter\") &&\r\n agregar_parametro(parametros, \"instagram\", \"ig\", \"Enlace/link a la página de Instagram\");\r\n \r\n if(!datos_validos)\r\n return;\r\n \r\n //Agregamos enfermedades a la petición.\r\n var tmp = [];\r\n $(\"input:checkbox[name='enfermedad']:checked\").each(function (index, i) {\r\n tmp.push($(i).val());\r\n });\r\n parametros.append(\"en\", JSON.stringify(tmp));\r\n \r\n //Agregamos alergias a la petición.\r\n tmp = [];\r\n $(\"input:checkbox[name='alergia']:checked\").each(function (index, i) {\r\n tmp.push($(i).val());\r\n });\r\n parametros.append(\"al\", JSON.stringify(tmp));\r\n \r\n //Agregamos las otras enfermedades a la petición.\r\n if(document.getElementById(\"ch_otras_enf\").checked){\r\n if(!agregar_parametro(parametros, \"tx_otras_enf\", \"ot_en\", \"Otras enfermedades\"))\r\n return;\r\n } else {\r\n parametros.append(\"ot_en\", \"\");\r\n }\r\n \r\n //Agregamos las otras alergias a la petición.\r\n if(document.getElementById(\"ch_otras_alg\").checked){\r\n if(!agregar_parametro(parametros, \"tx_otras_alg\", \"ot_al\", \"Otras alergias\"))\r\n return;\r\n } else {\r\n parametros.append(\"ot_al\", \"\");\r\n }\r\n }\r\n \r\n //Mostramos el modal mientras se guardan los cambios.\r\n $(\"#modal-footer\").hide();\r\n $(\"#modal-title\").html(\"Aplicando cambios...\");\r\n $(\"#modal-body\").html(\"<center><img src='../modelo/img/RC_IF_CARGANDO.gif'></center>\");\r\n $('#modal').modal({backdrop: 'static', keyboard: false});\r\n \r\n //Se hace la petición para guardar los cambios y el resultado se muestra en pantalla.\r\n $.ajax({\r\n url: \"../controlador/SRV_CUENTAS.php\",\r\n data: parametros,\r\n type: \"POST\",\r\n dataType: 'text',\r\n processData: false,\r\n contentType: false,\r\n async: false,\r\n success: function (respuesta) {\r\n $(\"#modal-title\").html(\"Terminado\");\r\n $(\"#modal-body\").html(\"<center>Cuenta modificada correctamente.<br><a href='javascript:irAPaginaDeDetalles();'>Volver a la página de detalles.</a></center>\");\r\n $(\"#modal-footer\").show();\r\n },\r\n error: function (xhr, status) {\r\n $(\"#modal-title\").html(\"Error\");\r\n $(\"#modal-body\").html((xhr.status == 500 ? xhr.responseText : \"Error de servidor (\" + xhr.status + \" \" + status + \").\"));\r\n $(\"#modal-footer\").show();\r\n }\r\n });\r\n}", "editarPersonal() {\n this.activarPersonal = false;\n this.activarNotificaciones = true;\n this.activarContacto = true;\n this.activarAcordeon1();\n }", "function modificarTipoPerfil(){\n\tlet idTipoPerfil=$('#idMod').val();\n\tlet valorTipoPerfil=$('#valorTipoPerfilmod').val();\n\tlet form={id:idTipoPerfil, perfil:valorTipoPerfil}\n\tlet dataResp=ajaxRequest(`${URL_TARIFA}/${idTipoPerfil}/update`, form, \"modModificar\");\n\tif(!isEmptyObject(dataResp)){\n\t\t$('#tablaTipoPerfil').DataTable().ajax.reload();\n\t}\n}", "function _AtualizaModificadoresAtributos() {\n // busca a raca e seus modificadores.\n var modificadores_raca = tabelas_raca[gPersonagem.raca].atributos;\n\n // Busca cada elemento das estatisticas e atualiza modificadores.\n var atributos = [\n 'forca', 'destreza', 'constituicao', 'inteligencia', 'sabedoria', 'carisma' ];\n for (var i = 0; i < atributos.length; ++i) {\n var atributo = atributos[i];\n // Valor do bonus sem base.\n var dom_bonus = Dom(atributo + '-mod-bonus');\n ImprimeSinalizado(gPersonagem.atributos[atributo].bonus.Total(['base']), dom_bonus, false);\n Titulo(gPersonagem.atributos[atributo].bonus.Exporta(['base']), dom_bonus);\n\n // Escreve o valor total.\n var dom_valor = Dom(atributo + '-valor-total');\n ImprimeNaoSinalizado(gPersonagem.atributos[atributo].bonus.Total(), dom_valor);\n Titulo(gPersonagem.atributos[atributo].bonus.Exporta(), dom_valor);\n\n // Escreve o modificador.\n ImprimeSinalizado(\n gPersonagem.atributos[atributo].modificador,\n DomsPorClasse(atributo + '-mod-total'));\n }\n}", "function editarRegistro(datos, id_Reg, tipo) {\n const cantidad = Number(document.getElementById('cantidad').value);\n const ost = document.getElementById('ost').value;\n const siga = document.getElementById('siga').value;\n const servicio = document.getElementById('servicio').value;\n const detalle = document.getElementById('observaciones').value;\n const idRegistrador = document.getElementById('idRegistrador').value;\n const pesoTotal = document.getElementById('total').innerHTML;\n const nuevoIdAct = document.getElementById('ddlActividades').value;\n\n if(cantidad === ''){\n mostrarMensaje('error', 'Debe indicar una cantidad');\n document.getElementById(\"cantidad\").focus();\n } else if(cantidad === 0){\n mostrarMensaje('error', 'La cantidad no puede ser igual a 0');\n document.getElementById(\"cantidad\").focus();\n }else {\n Swal.fire({\n title: '¿Está seguro?',\n text: 'Se editará el consecutivo ' + (id_Reg.length === 1 ? datos.consecutivo : datos.consecutivo + ' y sus asociados'),\n icon: 'warning',\n showCancelButton: true,\n confirmButtonColor: '#3085d6',\n cancelButtonColor: '#d33',\n confirmButtonText: 'Si, editarlo'\n }).then((result) => {\n if (result.value) {\n // Se definen los datos que se van a enviar al fetch\n const data = new FormData();\n data.append('id_Reg', id_Reg);\n data.append('ost', ost);\n data.append('siga', siga);\n data.append('numServicio', servicio);\n data.append('cantidad', cantidad);\n data.append('pesoTotal', pesoTotal);\n data.append('observaciones', detalle);\n data.append('idRegistrador', idRegistrador);\n data.append('nuevoIdAct', nuevoIdAct);\n data.append('tipo', tipo);\n\n // Conexión del fetch al archivo php\n fetch('inc/modelos/modelo-registro.php', {\n method: 'POST',\n body: data\n })\n .then(respuestaExitosa) // Respuesta exitosa llama la función\n .catch(mostrarError); // Respuesta negativa llama la función\n\n // Si la ejecución del AJAX es correcta se verifica la respuesta\n function respuestaExitosa(response){\n if(response.ok) { // Si la respuesta en ok se llama la función para mostrar los resultados\n response.json().then(mostrarResultado);\n } else { // Si la respuesta no es ok se muestra el error\n mostrarError('status code: ' + response.status);\n }\n }\n\n // Se muestran los resultados devueltos en el JSON\n function mostrarResultado(respuesta){\n \n // Si la respuesta es correcta\n if(respuesta.estado === 'correcto') { \n mostrarMensaje('success', 'Modificación de Registro Exitoso') ; \n \n // Se oculta el modal de cierre de registro\n $('#modalAccionesReg').modal('hide');\n \n // Se actualiza la tabla\n var table = $('#tablaRegistros').DataTable();\n table.ajax.reload();\n\n }else if(respuesta.estado === 'incorrecto') {\n mostrarMensaje('error', 'No se realizó la modificación del registro'); \n } else {\n // Hubo un error\n if(respuesta.error) {\n mostrarMensaje('error', 'Algo falló al modificar el registro de actividad'); \n }\n if (respuesta.conexion) {\n mostrarMensaje('error', 'Falla en la conexión a la base de datos');\n }\n }\n }\n\n // Muestra el error si el AJAX no se ejecuta o la respuesta no es ok\n function mostrarError(err){\n console.log('Error', err);\n }\n }\n })\n \n }\n}", "function ModificarElemento(vThis) {\r\n var idElemento = localStorage.getItem('idElemento');\r\n localStorage.clear();\r\n\r\n var elbtnActivo = document.querySelector('#btnActivo');\r\n var elbtnInactivo = document.querySelector('#btnInactivo');\r\n if (elbtnActivo.classList == \"Activo\") {\r\n var estado = 1;\r\n } else if (elbtnInactivo.classList == \"Activo\") {\r\n var estado = 0;\r\n }\r\n if (document.querySelector(\"#chkJuridico\").checked == true) {\r\n var juridico = 1;\r\n } else {\r\n var juridico = 0;\r\n }\r\n /*variables para los elemnetos del formulario*/\r\n var elTxtCedula = document.querySelector('#txtCedula');\r\n var elTxtNombre = document.querySelector('#txtPrimerNombre');\r\n var elTxtSegundoNombre = document.querySelector('#txtSegundoNombre');\r\n var elTxtApellido = document.querySelector('#txtPrimerApellido');\r\n var elTxtSegundoApellido = document.querySelector('#txtSegundoApellido');\r\n var elTxtNacionalidad = document.querySelector('#txtNacionalidad');\r\n var elTxtTelefono = document.querySelector('#txtTelefonoPrincipal');\r\n var elTxtTelefono2 = document.querySelector('#txtTelefonoSecundario');\r\n var elTxtFechaNacimiento = document.querySelector('#txtFechaNacimiento');\r\n var elTxtCorreoElectronico = document.querySelector('#txtCorreoElectronico');\r\n var elTxtContrasena = document.querySelector('#txtContrasena');\r\n var elTxtConfirmarContrasena = document.querySelector('#txtContrasena2');\r\n var elTxtGenero = document.getElementsByName('genero');\r\n var elRadioBtnTipoUsuario=document.getElementsByName('tipoUsuario');\r\n\r\n /*Variables para los valores que esten dentro de cada uno de\r\n los elementos del formulario*/\r\n var nCedula = Number(elTxtCedula.value);\r\n var sNombre = elTxtNombre.value;\r\n var sSegundoNombre = elTxtSegundoNombre.value;\r\n var sApellido = elTxtApellido.value;\r\n var sSegundoApellido = elTxtSegundoApellido.value;\r\n var nTelefono = Number(elTxtTelefono.value);\r\n var nTelefono2 = Number(elTxtTelefono2.value);\r\n var dFechaNacimiento = elTxtFechaNacimiento.value;\r\n var sCorreoElectronico = (elTxtCorreoElectronico.value);\r\n var sContrasena = elTxtContrasena.value;\r\n var sConfirmarContrasena = elTxtConfirmarContrasena.value;\r\n var sPais = elTxtNacionalidad.value;\r\n var sImagePath;\r\n\r\n /*****************************************************************************\r\n Se realiza la subida de la imagen\r\n *****************************************************************************/\r\n var peticion = $.ajax({\r\n url: \"services/imageUploader.php?path=../imgs/uploads/foto_perfil/\", //Se envia el path como paremetro para el envio de la imagen\r\n type: \"POST\",\r\n data: new FormData(vThis),\r\n contentType: false,\r\n cache: false,\r\n processData: false,\r\n async: false,\r\n timeout: 30000,\r\n\r\n success: function(data) {\r\n sImagePath = data.replace('../', '');\r\n },\r\n error: function(request, cerror) {\r\n alert(cerror);\r\n }\r\n });\r\n\r\n for (var i = 0; i < elTxtGenero.length; i++) {\r\n if (elTxtGenero[i].checked) {\r\n var sGenero = elTxtGenero[i].value;\r\n }\r\n }\r\n for (var i = 0; i < elRadioBtnTipoUsuario.length; i++) {\r\n if (elRadioBtnTipoUsuario[i].checked){\r\n var ntipoUsuario = Number(elRadioBtnTipoUsuario[i].value);\r\n break;\r\n }\r\n }\r\n if (sContrasena == sConfirmarContrasena) {\r\n var peticion = $.ajax({\r\n url: \"services/checkCorreoModificar.php\",\r\n type: \"POST\",\r\n data: {\r\n 'sCorreoElectronico' : sCorreoElectronico,\r\n 'id_usuario' : idElemento\r\n },\r\n contentType: \"application/x-www-form-urlencoded;charset=ISO-8859-15\",\r\n dataType: 'json',\r\n async: false,\r\n timeout: 50000,\r\n\r\n success: function(response){\r\n console.log(response);\r\n if (Number(response[0]['disponible'] == 1) ) {\r\n var peticion2 = $.ajax({\r\n url: \"services/modificarUsuarios.php\",\r\n type: \"POST\",\r\n data: {\r\n 'idElemento': idElemento,\r\n 'nCedula': nCedula,\r\n 'sNombre': sNombre,\r\n 'sSegundoNombre': sSegundoNombre,\r\n 'sApellido': sApellido,\r\n 'sSegundoApellido': sSegundoApellido,\r\n 'nTelefono': nTelefono,\r\n 'nTelefono2': nTelefono2,\r\n 'dFechaNacimiento': dFechaNacimiento,\r\n 'sCorreoElectronico': sCorreoElectronico,\r\n 'sContrasena': sContrasena,\r\n 'sGenero': sGenero,\r\n 'sPais': sPais,\r\n 'estado':estado,\r\n 'sImagePath': sImagePath,\r\n 'tipo_usuario':ntipoUsuario,\r\n 'estado':estado,\r\n 'juridico':juridico\r\n },\r\n success: function(response) {\r\n swal({\r\n title: \"La información fue ingresada correctamente\",\r\n text: \"Los datos del perfil han sido actualizados.\",\r\n type: \"success\",\r\n showCancelButton: false,\r\n confirmButtonColor: \"green\",\r\n confirmButtonText: \"Continuar\",\r\n closeOnConfirm: false\r\n });\r\n },\r\n error: function(request, error) {\r\n alert(error);\r\n }\r\n });\r\n } else {\r\n swal({\r\n title: \"Error!\",\r\n text: \"Este correo electrónico ya se encuentra registrado.\",\r\n type: \"error\",\r\n showCancelButton: false,\r\n confirmButtonColor: \"red\",\r\n confirmButtonText: \"Continuar\",\r\n closeOnConfirm: false\r\n });\r\n }\r\n },\r\n error: function(request, error) {\r\n alert(error);\r\n }\r\n });\r\n } else {\r\n swal({\r\n title: \"Error!\",\r\n text: \"Las contraseñas no coinciden.\",\r\n type: \"error\",\r\n showCancelButton: false,\r\n confirmButtonColor: \"red\",\r\n confirmButtonText: \"Continuar\",\r\n closeOnConfirm: false\r\n }/*,\r\n function(isConfirm){\r\n window.location = \"registrarTiendas.html\";\r\n }*/);\r\n}\r\n var txtBuscarId = document.querySelector(\"#txtBuscarId\");\r\n txtBuscarId.value = \"\";\r\n var txtBuscarNombre = document.querySelector(\"#txtBuscarNombre\");\r\n txtBuscarNombre.value = \"\";\r\n var elbtnActivo = document.querySelector('#btnActivo');\r\n var elbtnInactivo = document.querySelector('#btnInactivo');\r\n if (elbtnActivo.classList == \"Activo\") {\r\n CargarLista(1);\r\n } else if (elbtnInactivo.classList == \"Activo\") {\r\n CargarLista(0);\r\n }\r\n var elemento = document.querySelector(\"#ModificarDatos\");\r\n elemento.style.display = \"none\";\r\n return false;\r\n}", "function User_Update_Cantons_Liste_des_cantons0(Compo_Maitre)\n{\n var Table=\"canton\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ct_nom=GetValAt(140);\n if (!ValiderChampsObligatoire(Table,\"ct_nom\",TAB_GLOBAL_COMPO[140],ct_nom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ct_nom\",TAB_GLOBAL_COMPO[140],ct_nom))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"ct_nom=\"+(ct_nom==\"\" ? \"null\" : \"'\"+ValiderChaine(ct_nom)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "editarPropuesta(form) {\n if (form.valid) {\n this.poliza.editPoliza(form.value, this.items)\n .subscribe(res => console.log('Propuesta Editada'));\n this.toastrSucces(\"Se ha editado correctamente la propuesta, será redirigido pronto a su descarga\", \"Edición exitosa!!\");\n }\n else {\n this.toastrError(\"Error interno no deja realizar la accion de editar\", \"Error\");\n }\n }", "function aceptarEdicionHorarioDeGrupo(horarioId) {\n // Llenamos el form de actualizacion con los datos ingresados\n $(\"#horaInicioForm\" + horarioId).val($(\"#horaInicio\" + horarioId).val());\n $(\"#horaFinForm\" + horarioId).val($(\"#horaFin\" + horarioId).val());\n $(\"#diaForm\" + horarioId).val(\n $(\"#dias\" + horarioId + \" option:selected\").text()\n );\n var rol;\n if ($(\"#cargos\" + horarioId + \" option:selected\").text() == \"AUXILIATURA\") {\n rol = 2;\n } else {\n rol = 3;\n }\n if (!$(\"#cargos\" + horarioId).length ) {\n rol = 1;\n } \n $(\"#rolIdForm\" + horarioId).val(rol);\n\n document.getElementById(\"editar-horario\" + horarioId).submit();\n}", "function User_Update_Produits_Prix_5(Compo_Maitre)\n{\n var Table=\"prix\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var px_tarifht=GetValAt(170);\n if (!ValiderChampsObligatoire(Table,\"px_tarifht\",TAB_GLOBAL_COMPO[170],px_tarifht,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"px_tarifht\",TAB_GLOBAL_COMPO[170],px_tarifht))\n \treturn -1;\n var px_tarifttc=GetValAt(171);\n if (!ValiderChampsObligatoire(Table,\"px_tarifttc\",TAB_GLOBAL_COMPO[171],px_tarifttc,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"px_tarifttc\",TAB_GLOBAL_COMPO[171],px_tarifttc))\n \treturn -1;\n var tv_numero=GetValAt(172);\n if (tv_numero==\"-1\")\n tv_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"tv_numero\",TAB_GLOBAL_COMPO[172],tv_numero,true))\n \treturn -1;\n var px_datedebut=GetValAt(173);\n if (!ValiderChampsObligatoire(Table,\"px_datedebut\",TAB_GLOBAL_COMPO[173],px_datedebut,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"px_datedebut\",TAB_GLOBAL_COMPO[173],px_datedebut))\n \treturn -1;\n var px_actif=GetValAt(174);\n if (!ValiderChampsObligatoire(Table,\"px_actif\",TAB_GLOBAL_COMPO[174],px_actif,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"px_actif\",TAB_GLOBAL_COMPO[174],px_actif))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"px_tarifht=\"+(px_tarifht==\"\" ? \"null\" : \"'\"+ValiderChaine(px_tarifht)+\"'\" )+\",px_tarifttc=\"+(px_tarifttc==\"\" ? \"null\" : \"'\"+ValiderChaine(px_tarifttc)+\"'\" )+\",tv_numero=\"+tv_numero+\",px_datedebut=\"+(px_datedebut==\"\" ? \"null\" : \"'\"+ValiderChaine(px_datedebut)+\"'\" )+\",px_actif=\"+(px_actif==\"true\" ? \"true\" : \"false\")+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "function habilitaConfirmacaoJustificativa() {\r\n\t\r\n\tvar obs = document.getElementById(\"form-dados-justificativa:inputObsMotivoAlteracao\");\r\n\tvar btnConfirmar = document.getElementById(\"form-dados-justificativa:btn-confirmar\");\r\n\tvar oidMotivo = document.getElementById(\"form-dados-justificativa:selectOidMotivoAlteracao\");\r\n\t\r\n\t// oid do motivo selecionado, conforme carregado pela tabela\r\n\t// mtv_alt_status_limite\r\n\t// oid = 5 (Outros) obrigatorio obs maior do que 2 carecters\r\n\t// oid = 4 (Ocorrencia de Restritivos) obrigatorio obs maior do que 2\r\n\t// carecters\r\n\tif (oidMotivo != null) {\r\n\t\t\r\n\t\tif (oidMotivo.value == \"\" || oidMotivo.value == null) {\r\n\t\t\tbtnConfirmar.disabled = \"disabled\";\r\n\t\t} else if ((oidMotivo.value == \"5\" && obs != null && obs.value.length > 2) \r\n\t\t\t\t|| (oidMotivo.value == \"4\" && obs != null && obs.value.length > 2)) {\r\n\t\t\tbtnConfirmar.disabled = \"\";\r\n\t\t} else if ((oidMotivo.value == \"5\" && obs != null && obs.value.length < 3) \r\n\t\t\t ||(oidMotivo.value == \"4\" && obs != null && obs.value.length < 3)) {\r\n\t\t\tbtnConfirmar.disabled = \"disabled\";\r\n\t\t} else {\r\n\t\t\tbtnConfirmar.disabled = \"\";\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n}", "function User_Update_Profils_de_droits_Droits_2(Compo_Maitre)\n{\n var Table=\"droit\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var gt_numero=GetValAt(94);\n if (gt_numero==\"-1\")\n gt_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"gt_numero\",TAB_GLOBAL_COMPO[94],gt_numero,true))\n \treturn -1;\n var dr_select=GetValAt(95);\n if (!ValiderChampsObligatoire(Table,\"dr_select\",TAB_GLOBAL_COMPO[95],dr_select,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"dr_select\",TAB_GLOBAL_COMPO[95],dr_select))\n \treturn -1;\n var dr_insert=GetValAt(96);\n if (!ValiderChampsObligatoire(Table,\"dr_insert\",TAB_GLOBAL_COMPO[96],dr_insert,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"dr_insert\",TAB_GLOBAL_COMPO[96],dr_insert))\n \treturn -1;\n var dr_update=GetValAt(97);\n if (!ValiderChampsObligatoire(Table,\"dr_update\",TAB_GLOBAL_COMPO[97],dr_update,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"dr_update\",TAB_GLOBAL_COMPO[97],dr_update))\n \treturn -1;\n var dr_delete=GetValAt(98);\n if (!ValiderChampsObligatoire(Table,\"dr_delete\",TAB_GLOBAL_COMPO[98],dr_delete,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"dr_delete\",TAB_GLOBAL_COMPO[98],dr_delete))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"gt_numero=\"+gt_numero+\",dr_select=\"+(dr_select==\"true\" ? \"true\" : \"false\")+\",dr_insert=\"+(dr_insert==\"true\" ? \"true\" : \"false\")+\",dr_update=\"+(dr_update==\"true\" ? \"true\" : \"false\")+\",dr_delete=\"+(dr_delete==\"true\" ? \"true\" : \"false\")+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "function editHistorico(){\r\n submitForm($('#formHistorico').get(0), getContextApp()+'/proposta/editar.action', false);\r\n}", "function editarContacto() {\n\n var id_ver = document.getElementById(\"ver\").value;\n\n for (let i = 0; i < agenda.length; i++) {\n\n let persona = agenda[i];\n\n if (((persona.id) == id_ver) || ((persona.id) == contador_registros)) {\n\n //Cogemos los valores del formulario \n var id = persona.id;\n var nombre = document.getElementById(\"nombre\").value;\n var apellidos = document.getElementById(\"apellidos\").value;\n var telefono = document.getElementById(\"telefono\").value;\n var fecha = document.getElementById(\"fecha\").value;\n\n /* Si esta funcion devuelve false no se edita el contacto en la agenda */\n if (validarFormulario(nombre, apellidos, telefono, fecha)) {\n\n //Añadimos los datos a la lista \n agenda[persona.id] = new Persona(id, nombre, apellidos, telefono, fecha);\n\n cargarResumen();\n limpiarFormulario();\n \n alert('Gracias por editar el contacto correctamente');\n } else {\n alert('Campos incorrectos, intentelo de nuevo');\n }\n }\n }\n}", "function modifierFonction() \n{\n nomModif.value = this.parentElement.parentElement.getElementsByTagName('p')[0].innerHTML;\n prenomModif.value = this.parentElement.parentElement.getElementsByTagName('p')[1].innerHTML;\n telephoneModif.value = this.parentElement.parentElement.getElementsByTagName('p')[2].innerHTML;\n villeModif.value = this.parentElement.parentElement.getElementsByTagName('p')[3].innerHTML;\n groupeSanguinModif.value = this.parentElement.parentElement.getElementsByTagName('p')[4].innerHTML;\n idDeModif.value = this.parentElement.parentElement.getElementsByTagName('p')[5].innerHTML;\n formulaireModif.submit();\n //console.log(nomModif);\n}", "function doActualizarCuenta(tipo){\r\n\t\tvar frm = document.forms[0];\r\n\t\t\r\n\t\tif(frm.numeros){\r\n\t\t\tif(frm.numeros.selectedIndex == 0){\r\n\t\t\t\tif(tipo==\"0\")\r\n\t\t\t\t\talert('Selecciona un n\\xfamero.');\r\n\t\t\t\telse\r\n\t\t\t\t\talert('Seleccione un n\\xfamero.');\r\n\t\t\t\tfrm.numeros.focus();\r\n\t\t\t\treturn false; \r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(frm.teleRefCon.value==''){\r\n\t\t\tif(tipo==\"0\")\r\n\t\t\t\talert('Ingresa tu Tel\\xE9fono de Contacto.');\r\n\t\t\telse\r\n\t\t\t\talert('Ingrese su Tel\\xE9fono de Contacto.');\r\n\t\t\tfrm.teleRefCon.focus();\r\n\t\t\treturn false; \r\n\t\t}\r\n\t\r\n\t\tif(frm.persCon.value==''){\r\n\t\t\tif(tipo==\"0\")\r\n\t\t\t\talert('Ingresa tu Contacto Cliente.');\r\n\t\t\telse\r\n\t\t\t\talert('Ingrese su Contacto Cliente.');\r\n\t\t\tfrm.persCon.focus();\r\n\t\t\treturn false; \r\n\t\t}\r\n\t\t\r\n\t\tif(frm.emailCon.value ==''){\r\n\t\t\tif(tipo==\"0\")\r\n\t\t\t\talert('Ingresa tu E-mail.');\r\n\t\t\telse\r\n\t\t\t\talert('Ingrese su E-mail.');\r\n\t\t\tfrm.emailCon.focus();\r\n\t\t\treturn false; \r\n\t\t}\r\n\t\t\r\n\t\tif(!validarFormatoMail(document.forms[0].emailCon,'Formato de E-mail incorrecto.')){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif(!valida_campo_direccion(tipo)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif(!valida_notas_direccion(tipo)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (!validarCombosUbigeo(tipo)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif(tipo==\"0\"){\t\t\r\n\t\t\tif(!confirm('\\xBFEst\\xE1s seguro de guardar los cambios?')){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(!confirm('\\xBFEst\\xE1 seguro de guardar los cambios?')){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdoOperacion('actualizarcuenta');\r\n\t}", "function validarFormModifyDates() {\n const cuTorre = document.forms[\"modifyDatePosition\"][\"torreCU\"];\n const serialTorre = document.forms[\"modifyDatePosition\"][\"torreSerial\"];\n const cuMoni = document.forms[\"modifyDatePosition\"][\"moniCU\"];\n const serialMoni = document.forms[\"modifyDatePosition\"][\"moniSerial\"];\n\n // Los campos no pueden ser vaciós.\n if (cuTorre.value == \"\" || cuTorre.value.length <= 3 || serialTorre.value == \"\" || serialTorre.value.length <= 3 || cuMoni.value == \"\" || cuMoni.value.length <= 3 || serialMoni.value == \"\" || serialMoni.value.length <= 3) {\n snackbar(\"Los campos no deben ser vacios y no deden ser inferiores a 4 caracteres.\");\n return false;\n }else {\n console.log(\"Datos correctos (por ahora)\");\n saveChanges(cuTorre.value, serialTorre.value, cuMoni.value, serialMoni.value, buttonSave.value);\n }\n}", "function fValidModificacion()\n{\n\tif($('#txtPrimerNombre').val() == Datos.primernombre && $('#txtSegundoNombre').val() == Datos.segundonombre.replace(/\\+/g,\" \") && $('#txtPrimerApellido').val() == Datos.primerapellido && $('#txtSegundoApellido').val() == Datos.segundoapellido.replace(/\\+/g,\" \") && $('#txtEmail').val() == Datos.email && $('#cmbIdTelefono').val() == Datos.idtelefono && $('#txtTelefonoMovil').val() == Datos.telefonomovil && $('#cmbIdCodArea').val() == Datos.idcodarea && $('#txtTelefonoFijo').val() == Datos.telefonofijo && $('#cmbIdDepartamento').val() == Datos.iddepartamento && $('#cmbIdCargo').val() == Datos.idcargo && $('#txtFechaIngreso').val() == Datos.fechaingreso && $('#txtDireccion').val() == Datos.direccion.replace(/\\+/g,\" \") )\t{\n\t\treturn 0;\n\t}\n\telse {\n\t\treturn 1;\n\t}\n}", "function alterPageUpdateForConsult() {\n clearFields(true);\n setTitleUpdate(\"\");\n setUpdateRegister(false);\n setIsReadonly(true);\n setSearchPersonBtnInactive(false);\n }", "function controlModuloUsuario() {\n\tmetodo = document.getElementById(\"metodo\").value;\n\tif (metodo == \"add\") {\n\t\tup = document.getElementById(\"password\");\n\t\tuser_password = TrimDerecha(TrimIzquierda(up.value));\n\t\tif (user_password == \"\") {\n\t\t\t//alert(\"Debe llenar este campo\");\n\t\t\t//up.focus();\n\t\t\treturn 'Debe llenar el password';\n\t\t}\n\t}\n\tif (metodo == \"modify\") {\n\t\tup = document.getElementById(\"password\");\n\t\tcambiar = document.getElementById(\"cambiar\").value;\n\t\tif (cambiar == \"yes\") {\n\t\t\tuser_password = TrimDerecha(TrimIzquierda(up.value));\n\t\t\tif (user_password == \"\") {\n\t\t\t\t// alert(\"Debe llenar este campo\");\n\t\t\t\t// up.focus();\n\t\t\t\t// return false;\n\t\t\t\treturn 'Debe Llenar el nuevo password';\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}", "function editarFormulario(){\n //Trae la grid para poder actualizar al editar\n listadoCamposFormulario = Ext.getCmp('listadoCamposFormulario');\n if (listadoCamposFormulario.getSelectionModel().hasSelection()) {\n var row = listadoCamposFormulario.getSelectionModel().getSelection()[0];\n \n\n encontrado=1;\n if(ventana==null) \n ventana = Ext.create ('App.miVentanaBanco');\n\n // Precarga el nombre e id seleccionados\n Ext.getCmp('nombreBanco').setValue(row.get('nombre'));\n Ext.getCmp('idBanco').setValue(row.get('id'));\n\n\n ventana.show();\n \n }\n }", "function User_Update_Produits_Comptes_généraux_11(Compo_Maitre)\n{\n var Table=\"compteproduit\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var cg_numero=GetValAt(178);\n if (cg_numero==\"-1\")\n cg_numero=\"null\";\n if (!ValiderChampsObligatoire(Table,\"cg_numero\",TAB_GLOBAL_COMPO[178],cg_numero,true))\n \treturn -1;\n var ci_actif=GetValAt(179);\n if (!ValiderChampsObligatoire(Table,\"ci_actif\",TAB_GLOBAL_COMPO[179],ci_actif,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ci_actif\",TAB_GLOBAL_COMPO[179],ci_actif))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"cg_numero=\"+cg_numero+\",ci_actif=\"+(ci_actif==\"true\" ? \"true\" : \"false\")+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "function agregarCita(e) {\n\n e.preventDefault();\n // extraer la información del objeto de citas\n const {mascota,propietario,telefono,fecha,hora,sintomas} = citaObj;\n\n // validar\n if(mascota === '' || propietario === '' || telefono === '' || fecha === '' || hora === '' || sintomas === '') {\n ui.imprimirAlerta('Todos los campos son obligatorios','error');\n return;\n }\n\n if(editando) {\n // imprimir mensaje de agregado\n ui.imprimirAlerta('La cita se editó correctamente');\n \n // pasar el objeto de la cita a ediccion\n administrarCitas.editarCita({...citaObj});\n\n // regresar el botón a su estado original\n form.querySelector('button[type=\"submit\"]').textContent = 'Crear cita';\n\n // quitar modo edición\n editando = false;\n } else {\n // crear id único\n citaObj.id = Date.now();\n\n // agregando una nueva cita\n administrarCitas.crearCita({...citaObj});\n\n // imprimir mensaje de agregado\n ui.imprimirAlerta('La cita se agregó correctamente');\n }\n\n \n \n // reiniciar objeto de validación\n reiniciarObjeto();\n\n // reiniciar formulario\n form.reset();\n\n // mostrar html de las citas\n ui.imprimirCitas(administrarCitas);\n}", "function GuardarContenidoEdit() {\n //Crear la parte principal del formulario\n var mensaje = { \"IdMensajeEducacional\": \"\", \"SemanaEmbarazo\": \"\", \"Contenido\": [] };\n //Crear la parte secundaria\n var mensajeContenido = { \"IdMensajeEducacional\": \"\", \"IdContenidoMensajeEducacional\": \"\", \"DiaSemana\": \"\", \"Contenido\": \"\" };\n //Asignar el contenido principal\n var ul;\n if ($(\"#SemanaEmbarazo\").val() === \"\") {\n ul = $(\".validation-summary-valid ul\");\n ul.html(\"\");\n ul.append(\"<li>\" + \"Debe ingresar una semana de embarazo para los mensajes.\" + \"</li>\");\n return false;\n }\n mensaje.IdMensajeEducacional = $(\"#IdMensajeEducacional\").val();\n mensaje.SemanaEmbarazo = $(\"#SemanaEmbarazo\").val();\n\n //Obtener los datos de la tabla conteniendo los registros secundarios\n var oTable = $(\".tbl\").dataTable().fnGetData();\n\n if (oTable.length < 3) {\n ul = $(\".validation-summary-valid ul\");\n ul.html(\"\");\n ul.append(\"<li>\" + \"Debe registrar al menos 3 mensajes para la semana.\" + \"</li>\");\n return false;\n }\n\n for (var i = 0; i < oTable.length; i++) {\n //Asignar valores de mensajes educacionales\n mensajeContenido.IdMensajeEducacional = $(\"#IdMensajeEducacional\").val();\n mensajeContenido.IdContenidoMensajeEducacional = oTable[i][0];\n mensajeContenido.DiaSemana = ObtenerDia(oTable[i][1]);\n mensajeContenido.Contenido = oTable[i][2];\n //Añadir elementos a la lista\n mensaje.Contenido.push(mensajeContenido);\n mensajeContenido = { \"IdMensajeEducacional\": \"\", \"IdContenidoMensajeEducacional\": \"\", \"DiaSemana\": \"\", \"Contenido\": \"\" };\n }\n\n //Enviar la informacion al servidor para salvar\n $.ajax({\n url: getControllerURL(\"MensajeEducacional\") + \"/Edit\",\n data: JSON.stringify(mensaje),\n type: \"POST\",\n contentType: \"application/json;\",\n dataType: \"json\",\n success: function (result) {\n\n if (result.Success == \"1\") {\n window.location.href = getControllerURL(\"MensajeEducacional\") + \"/index\";\n } else {\n alert(result.ex);\n }\n }\n });\n return false;\n}", "function update(OID_USUARIO,USUARIO){\n\t\n\t/*INSERCION DE DATOS*/\n\t\n\t$(\"#txt_usuario\").val(USUARIO);\n\t\n\t$(\"#txt_usuario\").attr(\"USER\",OID_USUARIO);\n\t\n\t$(\"#btn_enviar_usuario\").text(\"Actualizar\")\n\t\t\n\t\n}//FINAL DE LA ACTUALIZACION DE UN REGISTRO", "function actualizarTipoAnterior( ) {\n controlFormStock();\n\tdocument.forms['MWEBNuevaEntregaForm'].tipoAnterior.value=document.forms['MWEBNuevaEntregaForm']['infoEntregaOT.idTipo'].value;\n\tlimpiarFormStock();\n}", "function onObligatorioMonto() {\n\t// Si obligatorio activar la obligatoriedad de los relacionados.\n\tif (get(FORMULARIO + '.ObligatorioMonto') == 'S') {\n\t\tset(FORMULARIO + '.ObligatorioPeriodoInicioV', 'S');\t\t\n\t\tset(FORMULARIO + '.ObligatorioPeriodoFinV', 'S');\n\t}\t\t\n}", "function edit_form(id, move_flag){\n try{\n // var res_json = localStorage.getItem(\"task_list\");\n // console.log(res_json.developer);\n build_options('task_developer_id', JSON.parse(localStorage.getItem(\"developer\")));\n document.getElementById('task_name').value = '';\n document.getElementById('task_desc').value = '';\n document.getElementById('task_id').value = '';\n document.getElementById('task_developer_id').value = '';\n document.getElementById('taskModal').style.display = \"block\";\n document.getElementById('task_developer_comments').readOnly=false;\n document.getElementById('task_name').readOnly=false;\n document.getElementById('task_desc').readOnly=false;\n document.getElementById('task_developer_id').disabled=false;\n if(id){\n document.getElementById('task_name').value = task_list.tasks[id].task_name;\n document.getElementById('task_desc').value = task_list.tasks[id].task_desc;\n document.getElementById('task_id').value = task_list.tasks[id].task_id;\n document.getElementById('task_developer_id').value = task_list.tasks[id].task_developer_id;\n // Disable the task fields for developer\n if(move_flag == 1){\n document.getElementById('task_name').readOnly=true;\n document.getElementById('task_desc').readOnly=true;\n document.getElementById('task_developer_id').disabled=true;\n }\n }else{\n document.getElementById('task_developer_comments').readOnly=true;\n }\n return true;\n }catch(e){\n logMyErrors(e);\n }\n}", "function addModifyFlag(obj){\n\tif( !obj || !obj.id || !obj.name) return;\n var currInputTaskType = $('#CURR_TASKTYPE').val();\n if( currInputTaskType == null || currInputTaskType != \"FIXPENDING\" ) return;\n var $obj = $(obj);\n var objValue = getFieldValue(obj);\n var objName = obj.name;\n removeFixedFieldStyle(obj); // 去除空字段的提示背景\n var bSame = true;\n if(oldFieldValue[objName]!=objValue) bSame = false;\n if( $obj.hasClass(\"DATE\") ){\n if(compareDate(oldFieldValue[objName],objValue)!=0) bSame = false;\n else bSame = true;\n }\n \n if(!bSame){\n \tsetErrMoidfyStyle(obj, \"MM\", true);\n }else{\n \tsetErrMoidfyStyle(obj, \"MM\", false);\n \tif(obj.value==\"\" && getErrModifyStyle(obj, \"EE\")) setFixedFieldStyle(obj);\n }\n \n}", "function EditUserModal(Name, LastName, UserName, Rol, Id) {\n \n //asociamos los textbox con sus respetivos valores provenientes de la base de datos.\n document.getElementsByName('userName')[0].value = UserName;\n document.getElementsByName('name')[0].value = Name;\n document.getElementsByName('lastName')[0].value = LastName;\n document.getElementById('userType')[0].value = Rol;\n idDeleteUpdate = document.getElementsByName('idHidden')[0].value = Id;\n}", "function fechaCuotaEditPrestamo() {\n\tvar year = new Date(document.getElementById(\"fecha_inicio\").value).getFullYear();\n\tvar month = new Date(document.getElementById(\"fecha_inicio\").value).getMonth() + 1;\n\tvar day = new Date(document.getElementById(\"fecha_inicio\").value).getDate() + 1;\n\t\n\tvar f = new Date();\n\tvar meses = 0;\t\n\n\t//Se toma la fecha actual y se le suma la cantidad de dias del prestamo \n\t\n\tvar fecha = f.sumar(year, month, day, meses);\n\t//Recupero el valor del dia-mes-año de la finalizacion del prestamo\n\tvar mes = fecha.getMonth() + 1; //El mes se maneja [0-11]\n\tvar dia = fecha.getDate();\n\tvar anio = fecha.getFullYear();\n\n\t//String con la fecha de finalizacion con formato MM/DD/YYYY\n\tvar fecha_fin = anio + \"-\" + mes + \"-\" + dia;\n\n\tdocument.getElementById(\"fecha_fin\").value=fecha_fin ;\n}", "function editarChamba(){\n\t//debugger;\n\t// le asigno a una variable el nombre con el que estan guardados las chambas\n\tvar usuario_nombre = (localStorage.getItem(\"Usuario_Actual\")) + \"chambas\";\n\t// parsea el nombre que se obtuvo para obtener los arreglos \n\tvar listChamba =JSON.parse(localStorage.getItem(usuario_nombre));\n\t// busca el id que esta actualmente y se lo asigna a la variable modificar\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos\n\tfor (var i = 0; i < listChamba.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < listChamba[i].length; j++) {\n\t\t\t// pregunto que si modificar es igual al id actual\n\t\t\tif(modificar == listChamba[i][j]){\n\t\t\t\t//obtener id\n\t\t\t\tvar nn = document.getElementById(\"numero\").value;\n\t\t\t// obtener el cliente\n\t\t\tvar c = document.getElementById(\"cliente\").value;\n\t\t\t// obtener la descripcion\n\t\t\tvar d = document.getElementById(\"description\").value;\n\t\t\t// obtener la fecha\n\t\t\tvar f = document.getElementById(\"fecha\").value;\n\t\t\t// obtener las notas\n\t\t\tvar n = document.getElementById(\"notas\").value;\n\t\t\t// pregunto que si el cliente es vacio o nulo\n\t\t\tif(c == \"\" || c == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de cliente vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no pregunto que si la descripcion es vacia o nula\n\t\t\t}else if(d == \"\" || d == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de descripcion vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no pregunto que si la fecha es vacia o nula\n\t\t\t}else if(f == \"\" || f == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de fecha vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no pregunto que si las notas son vacias o nulas\n\t\t\t}else if(n == \"\" || n == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de notas vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no es asi\n\t\t\t}else{\n\t\t\t\t// le digo que el elemento actual en la posicion 0 es igual a el id\n\t\t\t\tlistChamba[i][j] = nn;\n\t\t\t\t// la posicion 1 es igual al cliente\n\t\t\t\tlistChamba[i][j+1] = c;\n\t\t\t\t// la posicion 2 es igual a la descripcion\n\t\t\t\tlistChamba[i][j+2] = d;\n\t\t\t\t// la posicion 3 es igual a la fecha\n\t\t\t\tlistChamba[i][j+3] = f;\n\t\t\t\t// la posicion 4 es igual a las notas\n\t\t\t\tlistChamba[i][j+4] = n;\n\t\t\t\t// le vuelvo a insertar los arreglos con el actual modificado\n\t\t\t\tlocalStorage[usuario_nombre] = JSON.stringify(listChamba);\n\t\t\t\t// muestro un mensaje para que el usuario sepa que fue modificado\n\t\t\t\talert(\"Se Modificó correctamente\");\n\t\t\t\t// me voy a la tabla para corroborar que se modificó\n\t\t\t\tlocation.href = \"Chambas Administration.html\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n};\n}", "function editHospital(IdHospital,nombreHospital,direccionHospital,\n\ttelefonoHospital, activoHospital\n\t){\n\t\n\tvar idHospitalEdit = document.getElementById('idHospitalEdit')\t\n\tvar nombreHospitalEdit = document.getElementById('nombreHospitalEdit')\n\tvar direccionHospitalEdit = document.getElementById('direccionHospitalEdit')\n\tvar telefonoHospitalEdit = document.getElementById('telefonoHospitalEdit')\n\tlet activoHospitalEdit = document.getElementById('activoHospitalEdit')\n\n\tidHospitalEdit.value = IdHospital;\n\tnombreHospitalEdit.value = nombreHospital;\n\tdireccionHospitalEdit.value = direccionHospital;\n\ttelefonoHospitalEdit.value = telefonoHospital;\n\tif (activoHospital.toLowerCase() == \"true\"){\n\t\tdocument.getElementById('activoHospitalEdit').options.selectedIndex = 0;\n\t} else{\n\t\tdocument.getElementById('activoHospitalEdit').options.selectedIndex = 1;\n\t}\n\t$('#editarHospital').modal('show');\n\n}", "update(form) {\n // subscripcion al servicio de usuario para enviar los datos a editar\n this.userService.updateCommons(this.user).subscribe(response => {\n if (response.User && response.User._id) {\n this.status = true;\n form.reset();\n this.launchAlert('success', 'Se ha Editado el Usuario!', null, null, false, 1500, null, 'top', 'row', true);\n this.onEdit = null;\n }\n else {\n console.log(response);\n this.launchAlert('error', 'No se ha podido editar el Usuario!', null, null, false, 1500, null, 'top', 'row', true);\n }\n }, error => {\n console.log(error);\n this.launchAlert('error', 'No se ha podido editar el Usuario!', error.error.Message, null, false, 1500, null, 'top', 'row', true);\n });\n }", "onSubmit(form) {\n // funcion de deteccion si el objeto enviado es ingreso o edicion\n if (!this.onEdit) {\n // si es ingreso de un nuevo usuario se llama al metodo Save\n this.save(form);\n }\n else if (this.onEdit) {\n // si se esta editando un usuario se llama al metodo Update\n console.log('preparando edicion');\n this.update(form);\n }\n }", "function setDataReqFromInModify(data){\n\t\n\t$('#requestNo').val(data.requestNo);\n\t$('#requestStatus').val(data.status);\n\t$('#lastUpdate').val(setDate(data.created));\n\tif(data.formType == \"IN\"){\n\t\t$('#receipt').prop(\"checked\",true);\n\t\t$('#issue').prop(\"checked\",false);\n\t}else{\n\t\t$('#receipt').prop(\"checked\",false);\n\t\t$('#issue').prop(\"checked\",true);\n\t}\n\tsetCompanyAll(\"companyCode\",\"\",data.companyCode);\n\tsetBank(\"bankCode\",\"\",data.bankCode);\n\t\t\tsetDocType(\"docType\",\"\",data.docType);\n\t\t\t$('#docTypeName').val(data.docTypeName);\n\t\t\t$('#requestorName').text(data.requestorName);\n\t\t\t$('#bgNo').val(data.bgNo);\n\t\t\t$('#amendNo').text(data.amendNo);\n\t\t\t\n\t\t\tif(data.amendType == \"DECREASE\" || data.amendType == undefined){\n\t\t\t\t$('#amendment').prop(\"checked\",true);\n\t\t\t}else{\n\t\t\t\t$('#amentEdit').prop(\"checked\",true);\n\t\t\t}\n\t\t\t\n\t\t\t$('#amountTbody').empty();\n\t\t\tfor(var i=0 ; i<data.amounts.length ; i++){\n\t\t\t\taddAmount(0,data.amounts[i].amount,data.amounts[i].currencyCode);\n\t\t\t\t$('#amontTr1').remove();\n\t\t\t}\n\t\t\t\n\t\t\t$('#openEnd').val(data.openEnd);\n\t\t\tif(data.openEnd == \"CLOSE\"){\n\t\t\t\t$('#formExpiredDate').show();\n\t\t\t}\n\t\t\t\n\t\t\t$('#effectiveDate').val(setDate(data.effectiveDate));\n\t\t\tif(data.expiredDate == \"\" || data.expiredDate == undefined){\n\t\t\t\t$('#expiredDate').val(null);\n\t\t\t}else{\n\t\t\t\t$('#expiredDate').val(setDate(data.expiredDate));\n\t\t\t}\n\t\t\t$('#periodYear').val(data.periodYear);\n\t\t\t$('#periodMonth').val(data.periodMonth);\n\t\t\t$('#periodDay').val(data.periodDay);\n\t\t\t$('#issueDate').val(setDate(data.issueDate));\n\t\t\t\n\t\t\tif(data.vendorType.toUpperCase() == \"VENDOR\"){\n\t\t\t\t$('#vender').prop(\"checked\",true);\n\t\t\t}else{\n\t\t\t\t$('#customer').prop(\"checked\",true);\n\t\t\t}\n\t\t\t$.when(ajaxTaskDocType).done(function() {\n\t\t\t\tgetSearchName(data.vendorCode);\n\t\t\t\t$.when(ajaxTaskSearchName).done(function() {\n\t\t\t\t\tsetDataVenCus();\n\t\t\t\t});\n\t\t\t});\n\t\t\t$('#ownerId').val(data.ownerId);\n\t\t\t$('#owner').val(data.owner);\n\t\t\t$('#ownerLastName').val(data.ownerLastName);\n\t\t\t$('#ownerContactInfo').val(data.ownerContactInfo);\n\t\t\t\n\t\t\t$('#poSoNo').val(data.poSoNo);\n\t\t\t$('#buyerName').val(data.buyerName);\n\t\t\t$('#buyerEmployeeID').val(data.buyerEmployeeID);\n\t\t\t$('#contractNo').val(data.contractNo);\n\t\t\t\n\t\t\t$('#conAmountTbody').empty();\n\t\t\tfor(var i=0 ; i<data.contractAmounts.length ; i++){\n\t\t\t\taddConAmount(0,data.contractAmounts[i].contractAmount,data.contractAmounts[i].contractCurrencyCode,data.contractAmounts[i].percentOfGuarantee);\n\t\t\t\t$('#conAmontTr1').remove();\n\t\t\t}\n\t\t\t\n\t\t\t$('#projectJob').val(data.projectJob);\n\t\t\t$('#expectedDueDate').val(setDate(data.expectedDueDate));\n\t\t\t\n\t\t\t\n\t\t\tvar reqType = [];\n \t\tif(loadFirst == 0){\n \t\t\tvar selected = sessionStorage.getItem('requestTypeSession');\n \t\t\tif(selected == \"null\"){\n \t\t\t\tsetRequestTypeModify(data.status,data.requestType);\n \t\t\t}else{\n \t\t\t\tsetRequestTypeModify(data.status,selected);\n \t\t\t}\n \t\t\tloadFirst++;\n \t\t}else{\n \t\t\tvar selected = sessionStorage.getItem('requestTypeSession');\n \t\t\tsetRequestTypeModify(data.status,selected);\n \t\t}\n \t\tsessionStorage.setItem('requestTypeSession', null);\n \t\t$.when(ajaxTaskRequestTypeModify).done(function() {\n \t\t\tstatusEvent = data.status;\n \t\t\tvar readOnly = data.readOnly;\n \t\tif(readOnly == \"N\" || readOnly == undefined){\n \t\t\tif(data.status.toUpperCase() == \"NEW\" || data.status.toUpperCase() == \"RETURN\"){\n \t\t\t\t\n \t \t\t\t\tdisabledAll();\n \t \t\t\t\t$('#requestType').prop(\"disabled\",true);\n \t\t\t\t\t\t$('#remarkHistory').show();\n \t\t\t\t\t\t$('#buttonModify').hide();\n \t\t\t\t\n \t\t\t}else if(data.status.toUpperCase() == \"DRAFT\" && data.requestType.toUpperCase() == \"CREATE\"){\n\t \t\t\t\t$('#requestType').prop(\"disabled\",true);\n\t\t\t\t\t\t\t$('#remarkHistory').hide();\n\t\t\t\t\t\t\tif(buttonEventSubmit == true){\n \t\t\t\t\t\t$('#buttonModify').hide();\n \t\t\t\t\t}else{\n \t\t\t\t\t\t$('#buttonModify').show();\n \t\t\t\t\t}\n \t\t\t}else if(data.status.toUpperCase() == \"REJECT\"){\n \t\t\t\tdisabledAll();\n \t\t\t\t$('#remarkHistory').show();\n \t\t\t}else{\n \t\t\t\tvar type = $('#requestType').val();\n \t\t\t\tif(type == \"DECREASE\"){\n \t\t\t\t\tdisabledAll();\n \t\t\t\t\tif(data.status.toUpperCase() == \"VALID\"){\n \t\t\t\t\t\t$('#requestType').prop(\"disabled\",false);\n \t\t\t\t\t}else{\n \t\t\t\t\t\t$('#requestType').prop(\"disabled\",true);\n \t\t\t\t\t}\n \t\t\t\t\t// $('#remarkHistory').toggle();\n \t\t\t\t\t$('#fileBrowsBox').show();\n \t\t\t\t\t$('.btnRemoveFile').show();\n \t\t\t\t\t$('#remarkCreate').show();\n \t\t\t\t\t$('#buttonCreate').hide();\n \t\t\t\t\t//$('#issueDate').prop(\"disabled\",false);\n \t\t\t\t\t//$('#effectiveDate').prop(\"disabled\",false);\n \t\t\t\t\t//$('#expiredDate').prop(\"disabled\",false);\n \t\t\t\t\t//$('#formEffectiveDate .border-left-0').show();\n \t\t\t\t\t//$('#formExpiredDate .border-left-0').show();\n \t\t\t\t\t//$('#formIssueDate .border-left-0').show();\n \t\t\t\t\t$('#amountTbody .btnEvent').show();\n \t\t\t\t\t$('#amountTbody input').prop(\"disabled\",false);\n \t\t\t\t\t$('#amountTbody select').prop(\"disabled\",false);\n \t\t\t\t\t$('#remarkHistory').hide();\n \t\t\t\t\t$('.amountCurreny').prop(\"disabled\",true);\n \t\t\t\t\t$('.botSellingRate').prop(\"disabled\",true);\n \t\t\t\t\t$('.btnEvent').hide();\n \t\t\t\t\tif(buttonEventSubmit == true){\n \t\t\t\t\t\t$('#buttonModify').hide();\n \t\t\t\t\t}else{\n \t\t\t\t\t\t$('#buttonModify').show();\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t}else if(type == \"EXTEND\"){\n \t\t\t\t\tdisabledAll();\n \t\t\t\t\tif(data.status.toUpperCase() == \"VALID\"){\n \t\t\t\t\t\t$('#requestType').prop(\"disabled\",false);\n \t\t\t\t\t}else{\n \t\t\t\t\t\t$('#requestType').prop(\"disabled\",true);\n \t\t\t\t\t}\n \t\t\t\t\t$('#fileBrowsBox').show();\n \t\t\t\t\t$('.btnRemoveFile').show();\n \t\t\t\t\t$('#remarkCreate').show();\n \t\t\t\t\t// $('#buttonCreate').hide();\n \t\t\t\t\t$('#issueDate').prop(\"disabled\",false);\n \t\t\t\t\t$('#effectiveDate').prop(\"disabled\",false);\n \t\t\t\t\t$('#expiredDate').prop(\"disabled\",false);\n \t\t\t\t\t$('#formEffectiveDate .border-left-0').show();\n \t\t\t\t\t$('#formExpiredDate .border-left-0').show();\n \t\t\t\t\t$('#formIssueDate .border-left-0').show();\n \t\t\t\t\t$('#remarkHistory').hide();\n \t\t\t\t\tif(buttonEventSubmit == true){\n \t\t\t\t\t\t$('#buttonModify').hide();\n \t\t\t\t\t}else{\n \t\t\t\t\t\t$('#buttonModify').show();\n \t\t\t\t\t}\n \t\t\t\t}else if(type == \"INCREASE\"){\n \t\t\t\t\tdisabledAll();\n \t\t\t\t\t$('#buttonCreate').hide();\n \t\t\t\t\t$('.amountCurreny').prop(\"disabled\",true);\n \t\t\t\t\t$('.btnEvent').hide();\n \t\t\t\t\t$('#amountTbody .btnEvent').hide();\n \t\t\t\t\t$('#amountTbody select').prop(\"disabled\",true);\n \t\t\t\t\tif(data.status.toUpperCase() == \"VALID\"){\n \t\t\t\t\t\t$('#requestType').prop(\"disabled\",false);\n \t\t\t\t\t}else{\n \t\t\t\t\t\t$('#requestType').prop(\"disabled\",true);\n \t\t\t\t\t}\n \t\t\t\t\t$('#remarkHistory').hide();\n \t\t\t\t\t\t$('#fileBrowsBox').show();\n \t\t\t\t\t$('.btnRemoveFile').show();\n \t\t\t\t\t$('#remarkCreate').show();\n \t\t\t\t\tif(buttonEventSubmit == true){\n \t\t\t\t\t\t$('#buttonModify').hide();\n \t\t\t\t\t\t\n \t\t\t\t\t}else{\n \t\t\t\t\t\t$('#buttonModify').show();\n \t\t\t\t\t\t$('#formEffectiveDate .border-left-0').show();\n \t\t\t\t\t$('#formExpiredDate .border-left-0').show();\n \t\t\t\t\t$('#formIssueDate .border-left-0').show();\n \t\t\t\t\t$('#issueDate').prop(\"disabled\",false);\n \t\t\t\t\t$('#effectiveDate').prop(\"disabled\",false);\n \t\t\t\t\t$('#expiredDate').prop(\"disabled\",false);\n \t\t\t\t\t$('#amountTbody input').prop(\"disabled\",false);\n \t\t\t\t\t$('.botSellingRate').prop(\"disabled\",true);\n \t\t\t\t\t\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t}else if(type == \"RETURN\"){\n \t\t\t\t\tdisabledAll();\n \t\t\t\t\t$('#returnContactInfo').show();\n \t\t\t\t\tif(data.status.toUpperCase() == \"VALID\"){\n \t\t\t\t\t\t$('#requestType').prop(\"disabled\",false);\n \t\t\t\t\t\t$('#returnContactInfo input').prop(\"disabled\",false);\n \t\t\t\t\t}else{\n \t\t\t\t\t\t$('#requestType').prop(\"disabled\",true);\n \t\t\t\t\t}\n \t\t\t\t\t$('#remarkHistory').hide();\n \t\t\t\t\t$('#fileBrowsBox').show();\n \t\t\t\t\t$('.btnRemoveFile').show();\n \t\t\t\t\t$('#remarkCreate').show();\n \t\t\t\t\tif(buttonEventSubmit == true){\n \t\t\t\t\t\t$('#buttonModify').hide();\n \t\t\t\t\t}else{\n \t\t\t\t\t\t$('#buttonModify').show();\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t}else{\n \t\t\t\t\tdisabledAll();\n \t\t\t\t\t$('.btnEvent').hide();\n \t\t\t\t\t\tif(buttonEventSubmit == true){\n \t\t\t\t\t\t\t$('#buttonModify').hide();\n \t\t\t\t\t\t$('#fileBrowsBox').show();\n \t\t\t\t\t$('.btnRemoveFile').show();\n \t\t\t\t\t$('#remarkCreate').show();\n \t\t\t\t\t}else{\n \t\t\t\t\t\t$('#buttonModify').show();\n \t\t\t\t\t\t$('#remarkHistory').show();\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tif(data.status.toUpperCase() == \"COMPLETE\"){\n \t\t\t\t\tdisabledAll();\n \t\t\t\t\tif(type == \"RETURN\"){\n \t\t\t\t\t\t$('#returnContactInfo').show();\n \t\t\t\t\t}\n \t\t\t\t\t$('#remarkHistory').show();\n \t\t\t\t\t$('#buttonModify').hide();\n// $('#fileBrowsBox').hide();\n// $('.btnRemoveFile').hide();\n// $('#remarkCreate').hide();\n \t\t\t\t\t\n \t\t\t\t}else if(data.status.toUpperCase() == \"WAITING_SUBMIT\"){\n \t\t\t\t\tdisabledAll();\n \t\t\t\t\t$('#fileBrowsBox').show();\n \t\t\t\t\t$('.btnRemoveFile').show();\n \t\t\t\t\t$('#remarkCreate').show();\n \t\t\t\t}\n \t\t\t\t\n \t\t\t}\n\n \t\t}else{\n \t\t\tdisabledAll();\n \t\t\t$('#remarkHistory').show();\n \t\t}\n \t\t\tif (data.status.toUpperCase() == \"WAITING_ACCEPT\"){\n \t\t\t\tdisabledAll();\n \t\t\t\t$('#fileBrowsBox').show();\n\t\t\t\t\t$('.btnRemoveFile').show();\n\t\t\t\t\t$('#remarkCreate').show();\n \t\t\t\t$('#buttonModify').hide();\n \t\t\t\t\n \t\t\t}\n \t\t\t\n \t\t\t$('#spinner').hide();\n \t\t});\n \t\t\n}", "function editaData( campo, evt )\r\n{\r\n retornaEstadosTeclas( evt );\r\n tecla = retornaKeyCode( evt );\r\n //verifica se usuário digitou tecla de atalho para inserir data atual no campo.\r\n if( tecla == 104 || tecla == 72 ) // 104 = h, 72 = H\r\n {\r\n hoje = new Date(dataServidor);\r\n dataDeHoje = ( ( hoje.getDate( ) + 100 ).toString( ) ).substring( 1, 3 ) + \"/\";\r\n dataDeHoje += ( ( hoje.getMonth( ) + 101 ).toString( ) ).substring( 1, 3 ) + \"/\";\r\n dataDeHoje += hoje.getFullYear( );\r\n campo.value = dataDeHoje;\r\n cancelaEvento( evt );\r\n try{campo.onchange( );}catch(ERROR){};\r\n return true;\r\n }\r\n //se campo estiver preenchido, aciona atalhos para somar e subtrair dias da data.\r\n if( campo.value.length == 10 )\r\n {\r\n //Se o usuario digitar Shift + '+', acrescenta 30 dias a data\r\n if( shift && tecla == 43 )\r\n {\r\n campo.value = operaData( campo.value, 30 );\r\n cancelaEvento( evt );\r\n try{campo.onchange( );}catch(ERROR){};\r\n return true;\r\n }\r\n //Se o usuario digitar '+', acrescenta 1 dia a data\r\n else if( tecla == 43 )\r\n {\r\n campo.value = operaData( campo.value, 1 );\r\n cancelaEvento( evt );\r\n try{campo.onchange( );}catch(ERROR){};\r\n return true;\r\n }\r\n //Se o usuario digitar Shift + '-', subtrai 30 dias da data\r\n if( shift && tecla == 45 )\r\n {\r\n campo.value = operaData( campo.value, -30 );\r\n cancelaEvento( evt );\r\n try{campo.onchange( );}catch(ERROR){};\r\n return true;\r\n }\r\n //Se o usuario digitar '-', subtrai 1 dia da data\r\n else if( tecla == 45 )\r\n {\r\n campo.value = operaData( campo.value, -1 );\r\n cancelaEvento( evt );\r\n try{campo.onchange( );}catch(ERROR){};\r\n return true;\r\n }\r\n }\r\n mascara( campo, evt, \"99/99/9999\" );\r\n}", "function editannounement() {\n\n}", "function ver_paciente(id_paciente) {\n\t var modal_pacientes_name = document.getElementById('modal_pacientes_name');\n\t var actionAddEdit = document.getElementById('actionAddEdit');\n\n\t $.ajax({\n\t type: 'post',\n\t url: base_url + '../Usuario/ver_paciente',\n\t data: {\n\t id_paciente: id_paciente\n\t },\n\t beforeSend: function() {\n\n\t },\n\t success: function(response) {\n\t actionAddEdit.setAttribute('onclick', 'paciente_formulario_editar(\\'' + id_paciente + '\\')');\n\t actionAddEdit.innerHTML = '<i class=\"fa fa-pencil\" aria-hidden=\"true\"></i> Editar';\n\t modal_pacientes_name.innerHTML = 'Visualizar paciente';\n\t document.getElementById('load_action_paciente').innerHTML = response;\n\n\t function cuantosAnios(dia, mes, anio) {\n\t var hoy = new Date();\n\t var nacido = new Date(anio, mes - 1, dia);\n\t var tiempo = hoy - nacido;\n\t var unanio = 1000 * 60 * 60 * 24 * 365;\n\t var tienes = parseInt(tiempo / unanio);\n\t return tienes;\n\t }\n\t }\n\t });\n\n\t}", "function nuevaCita(e){\n e.preventDefault();\n\n //Extraer infomracion\n const {mascota,propietario,telefono,fecha,hora,sintomas} = citaObj;\n\n //validar\n if(mascota === '' || propietario === '' || telefono === '' || fecha === '' || hora === '' || sintomas === ''){\n ui.imprimirAltera('Llena todos los campos', 'error');\n return;\n }\n if(editando){\n ui.imprimirAltera(`Se actualizo correctamente.`)\n\n //Pasar el objeto de la cita a edicion\n administrarCitas.editarCita({...citaObj});\n\n //Quitar modo edicion\n formulario.querySelector('button[type=\"submit\"]').textContent = 'Crear Cita';\n editando = false;\n \n\n\n }else{\n //Generar id\n citaObj.id = Date.now();\n\n //Crear cita\n administrarCitas.agregarCita({...citaObj});\n ui.imprimirAltera(`Cita para ${citaObj.mascota} agregada.`)\n }\n\n\n //Restabelcer datos'\n reiniciarObj();\n formulario.reset();\n\n //Mostrar HTML citas\n ui.imprimirCitas(administrarCitas);\n\n}", "function editarInvoice(){\n\t//debugger;\n\t// le asigno a una variable el nombre con el que estan guardados los invoices\n\tvar usuario_nombre = (localStorage.getItem(\"Usuario_Actual\")) + \"invoices\";\n\t// parsea el nombre que se obtuvo para obtener los arreglos \n\tvar listInvoice =JSON.parse(localStorage.getItem(usuario_nombre));\n\t// busca el id que esta actualmente y se lo asigna a la variable modificar\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos\n\tfor (var i = 0; i < listInvoice.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < listInvoice[i].length; j++) {\n\t\t\t// pregunto que si modificar es isual al id actual\n\t\t\tif(modificar == listInvoice[i][j]){\n\t\t\t\t//si es asi obtener id\n\t\t\t\tvar n = document.getElementById(\"numero\").value;\n\t\t\t// obtener el cliente\n\t\t\tvar c = document.getElementById(\"cliente\").value;\n\t\t\t// obtener la descripcion\n\t\t\tvar d = document.getElementById(\"description\").value;\n\t\t\t// obtener la fecha\n\t\t\tvar f = document.getElementById(\"fecha\").value;\n\t\t\t// obtener las monto\n\t\t\tvar m = document.getElementById(\"monto\").value;\n\t\t\t// pregunto que si el cliente es vacio o nulo\n\t\t\tif(c == \"\" || c == null){\n\t\t\t\t// si es asi muetro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de cliente vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no, pregunto que si la descripcion es vacia o nula\n\t\t\t}else if(d == \"\" || d == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de descripcion vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no pregunto que si la fecha es vacia o nula\n\t\t\t}else if(f == \"\" || f == null){\n\t\t\t\t// si es asi se muestra un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de fecha vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no, pregunto que si es monto es vacio o nulo\n\t\t\t}else if(m == \"\" || m == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de monto vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no es asi\n\t\t\t}else{\n\t\t\t\t// le digo que el elemento actual en la posicion 0 es igual a el id\n\t\t\t\tlistInvoice[i][j] = n;\n\t\t\t\t// la posicion 1 es igual a el cliente\n\t\t\t\tlistInvoice[i][j+1] = c;\n\t\t\t\t// la posicion 2 es igual a la descripcion\n\t\t\t\tlistInvoice[i][j+2] = d;\n\t\t\t\t// la posicion 3 es igual a la fecha\n\t\t\t\tlistInvoice[i][j+3] = f;\n\t\t\t\t// la posicion 4 es igual al monto\n\t\t\t\tlistInvoice[i][j+4] = m;\n\t\t\t\t// le vuelvo a insertar los arreglos con el actual modificado\n\t\t\t\tlocalStorage[usuario_nombre] = JSON.stringify(listInvoice);\n\t\t\t\t// muestro un mensaje para que el usuario sepa que fue modificado\n\t\t\t\talert(\"Se Modificó correctamente\");\n\t\t\t\t// me voy a la tabla para corroborar que se modificó\n\t\t\t\tlocation.href = \"Invoices Administration.html\";\n\t\t\t}\n\t\t}\n\t};\n};\n}", "changeFormState(type){\n if (type === 'edit') {\n this.postSubmit.textContent = 'Update post';\n this.postSubmit.className = 'post-submit btn btn-warning btn-block';\n\n // cria botao de cacelar\n const button = document.createElement('button');\n button.className = 'post-cancel btn btn-light btn-block';\n button.appendChild(document.createTextNode('Cancel Edit'));\n // pega elemento-pai do botao de cancelar\n const cardForm = document.querySelector('.card-form');\n // pega elemento imediatamente posterior ao botao de cancelar\n const formEnd = document.querySelector('.form-end');\n // insere botao de cancelar\n cardForm.insertBefore(button, formEnd);\n } else {\n // modo ADD\n // altera comportamento do botao\n this.postSubmit.textContent = 'Post It';\n this.postSubmit.className = 'post-submit btn btn-primary btn-block';\n\n // remove botao de cancelar, se estiver visivel\n if(document.querySelector('.post-cancel')) {\n document.querySelector('.post-cancel').remove();\n }\n\n // limpa ID no campo de ID oculto\n this.clearIdInput();\n // limpa campos de texto no form\n this.clearFields();\n }\n }", "function doEdit(){\n\n\n if(validation() == false)\n return ;\n\n doEditInLocalstorage(prevli) ;\n doEditInShowList(prevli) ;\n\n\n /*********** Going back to again add Task Field ************/ \n \n document.getElementById(\"task\").value = \"\" ;\n document.getElementById(\"editButton\").style.display = 'none' ;\n document.getElementById(\"addButton\").style.display = 'block' ;\n\n /***************** End ***********************/\n\n\n }", "function editBillingAmount() {\n\tdocument.getElementById('canFinalize').value = 'NO';\n}", "function LimpiarFormulario(){\n\n if(obtener_valor( 'PLANTILLA' ) == '0'){\n OcultarCampo( 'BUSCARPL', 0 );\n asignar_valor( 'NB_PLANT' , '');\n asignar_valor( 'ID_PLANT' , '');\n asignar_valorM( 'PLANT' , '' , 1 , 1 );\n asignar_valorM( 'PLANT' , '' , 1 , 2 );\n asignar_valorM( 'PLANT' , '' , 1 , 3 );\n asignar_valorM( 'PLANT' , '' , 1 , 7 );\n }else{\n MostrarCampo( 'BUSCARPL', 0 );\n }\n\n return true;\n}", "function limparUltimosCampos(tipo){\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\t\r\n\t//if(form.idMunicipio.value == \"\")\r\n\t\t//limparUltimosCampos(1);\r\n\t\r\n\tswitch(tipo){\r\n\t\tcase 1: //municipio\r\n\t\t\tform.nomeMunicipio.value = \"\";\r\n\t\t\tform.idBairro.value = \"\";\r\n\t\tcase 2: //bairro\r\n\t\t\tform.nomeBairro.value = \"\";\r\n\t\t\tform.idLogradouro.value =\"\";\t\t\t\r\n\t\tcase 3://logradouro\r\n\t\t\tform.nomeLogradouro.value = \"\";\r\n\t\t\tform.CEP.value = \"\";\r\n\t\tcase 4://cep\r\n\t\t\tform.descricaoCep.value = \"\";\r\n\t}\r\n}", "function limpiarControles(){ //REVISAR BIEN ESTO\n clearControls(obtenerInputsIdsProducto());\n clearControls(obtenerInputsIdsTransaccion());\n htmlValue('inputEditar', 'CREACION');\n htmlDisable('txtCodigo', false);\n htmlDisable('btnAgregarNuevo', true);\n}", "function modifyTasks(taskIndex, modificationType, form = \"\") \n{\n\tlet tasksArray = localStorage.getItem(\"tasks\") ? JSON.parse(localStorage.getItem(\"tasks\")) : [];\n\n\tif(typeof tasksArray[taskIndex] !== \"undefined\")\n\t{\n\t\tswitch (modificationType)\n\t\t{\n\t\tcase \"Complete\":\n\t\t\ttasksArray[taskIndex].to_do_status = \"Complete\";\n\t\t\tbreak;\n\n\t\tcase \"Edit\":\n\t\t\t//Change the title in the list item's span\n\t\t\ttasksArray[taskIndex].to_do_title = form.titleInput.value;\n\t\t\ttasksArray[taskIndex].to_do_description = form.descriptionInput.value;\n\t\t\ttasksArray[taskIndex].to_do_priority = parseInt(form.priorityInput.value);\n\t\t\tif(form.dueDateInput.value !== \"\")\n\t\t\t{\n\t\t\t\ttasksArray[taskIndex].to_do_due_date = new Date(`${form.dueDateInput.value} ${form.dueTimeInput.value}`);\n\t\t\t} \n\n\t\t\tbreak;\n\t\t}\n\t\tlocalStorage.setItem(\"tasks\", JSON.stringify(tasksArray));\n\t}\n}", "function habilitarEdicion (){\n\t\t\t$scope.modificar = true;\n\t\t}", "function editTableModificarDescuento() {\n var nameTable = \"ModificarDescuento\";\n var nameCols = crearListaColumnas();\n var activaAdd = true;\n var activaDelete = true;\n\n return buildTableTools(nameTable, nameCols, activaAdd, activaDelete);\n}", "function oqituvchiYozishUpdate() {\n let tugma = document.getElementById('oqituvchiUpdate');\n let ism = document.forms['updateOqituvchiForm']['ismUpdate'].value;\n let familiya = document.forms['updateOqituvchiForm']['familiyaUpdate'].value;\n let nomer = document.forms['updateOqituvchiForm']['nomerUpdate'].value;\n let tajriba = document.forms['updateOqituvchiForm']['tajribaUpdate'].value;\n let togilganYili = document.forms['updateOqituvchiForm']['togilganYiliUpdate'].value;\n let qisqaMalumot = document.forms['updateOqituvchiForm']['qisqaMalumotUpdate'].value;\n if (ism == \"\" || familiya == \"\" || nomer == \"\" || tajriba == \"\" || togilganYili == \"\" || qisqaMalumot == \"\") {\n tugma.disabled = true;\n } else {\n tugma.disabled = false;\n }\n}", "function editarFila(oId){\n \n items = $(\"#cant_campos\").val()-1;\n $(\"#cant_campos\").val(items); \n //ASIGNAMOS LOS VALORES DE LA FILA A ACTUALIZAR\n\t//alert(\"indice: \"+oId);\n cadenaDetalle.splice(cadenaDetalle.indexOf(\"-\"+oId+\"-\"),4);\n\t//cadenaDetalle.splice(\"-\"+oId+\"-\",3);\n\t//delete cadenaDetalle[oId];\n $(\"#t\").val($(\"#hdnId_\"+oId).val());\n $(\"#cant\").val($(\"#hdnCantidad_\"+oId).val());\n $(\"#idInputSeleccionar\").val($(\"#hdnDes_\"+oId).val());\n $(\"#cod\").val($(\"#hdnCod_\"+oId).val());\n $(\"#precio\").val($(\"#hdnPrecio_\"+oId).val());\n //$(\"#total\").val($(\"#hdnTotal_\"+oId).val());\n\n // RESTA TOTALES DE LA TABLA\n \n $(\"#Ttotal\").val(parseFloat($(\"#Ttotal\").val()) - parseFloat($(\"#hdnTotal_\"+oId).val())); // RESTA DEL TOTAL\n $(\"#unid\").val(parseFloat($(\"#unid\").val()) - parseFloat($(\"#hdnCant_\"+oId).val())); // RESTA DE LA CANTIDAD DE PRODUCTOS\n \n // ELIMINAMOS LA FILA SELECCIONADA, PARA SER EDITADA\n \n $(\"#rowDetalle_\" + oId).remove();\n return false;\n \n }", "function editar(id,nome,email){\n $(\"#id\").val(id);\n $(\"#nome\").val(nome);\n $(\"#email\").val(email);\n $(\"#servico\").val('alteracao');\n\n // ACAO DE MOVIMENTO DAS TELAS\n janelaCadastro(true,'edit');\n}", "function editarPedido(id, fila) {\n let celdas = fila.querySelectorAll(\"td\");\n \n //CARGA INPUTS CON DATOS DE LA FILA\n inputNombre.value = celdas[0].innerHTML.trim();\n inputDireccion.value = celdas[1].innerHTML.trim();\n inputSelect.value = celdas[2].innerHTML.trim();\n inputCantidad.value = celdas[3].innerHTML.trim();\n inputCodigo.value = celdas[4].innerHTML.trim();\n\n //OCULTA BOTON AGREGAR\n let btnAgregar = document.querySelector(\"#btn_agregar\");\n btnAgregar.style.display = \"none\";\n\n //AGREGA Y ASIGNA FUNCIONAMIENTO A BOTONES GUARDAR Y CANCELAR\n document.querySelector(\"#botonesEditar\").innerHTML =\n `<button id=\"btnGuardar\"> GUARDAR </button> <button id=\"btnCancelar\"> CANCELAR </button>`;\n document.querySelector(\"#btnGuardar\").addEventListener(\"click\", function () {\n let pedidoEditado = {\n nombre: inputNombre.value,\n direccion: inputDireccion.value,\n producto: inputSelect.value,\n cantidad: parseInt(inputCantidad.value),\n codigodescuento: inputCodigo.value,\n id: id,\n }\n editarPedidoAPI(pedidoEditado, celdas);\n btnAgregar.style.display = \"flex\";\n document.querySelector(\"#botonesEditar\").innerHTML = \"\";\n });\n document.querySelector(\"#btnCancelar\").addEventListener(\"click\", function () {\n btnAgregar.style.display = \"flex\";\n document.querySelector(\"#botonesEditar\").innerHTML = \"\";\n vaciarInputs();\n });\n}", "function taskModify(openCd , formId) {\r\n\tif(openCd == 'S') {\r\n\t\tdocument.getElementById(\"authModifyTable\").style.display = \"\";\r\n\t} else {\r\n\t\tdocument.getElementById(\"authModifyTable\").style.display = \"none\";\r\n\t}\r\n}", "function ACCTedit(userid){\n OVERLAYenable();\n\n var ch = document.getElementById(\"mnch\");\n var cb = document.getElementById(\"mncb\");\n var cf = document.getElementById(\"mncf\");\n\n var name = document.getElementById(userid+\"_name\").innerText;\n var department = document.getElementById(userid+\"_department\").innerText;\n var position = document.getElementById(userid+\"_position\").innerText;\n var role = document.getElementById(userid+\"_role\").innerText;\n var status = document.getElementById(userid+\"_status\").innerText;\n\n //header\n var header = newElement(ch, \"div\",[\"row\"],\"\",\"\");\n header.style.width = \"400px\";\n var header_h5 = newElement(header, \"h5\", \"\", [\"id:editHeader\"], \"Edit User Information\");\n\n //userid\n var form = newElement(cb, \"form\", \"\", \"\", \"\");\n var formgroup = newElement(form, \"div\", [\"form-group\",\"md-form\", \"mb-3\"], \"\", \"\");\n var label = newElement(formgroup, \"label\", \"\", [\"for=ae_userid\"], \"Login ID\");\n var input = newElement(formgroup, \"input\", [\"form-control\"],[\"type=text\",\"id=ae_userid\", \"disabled=true\",\"value=\"+userid,\"default-value=\"+userid],\"\");\n //name\n formgroup = newElement(form, \"div\", [\"form-group\",\"md-form\", \"mb-3\"], \"\", \"\");\n label = newElement(formgroup, \"label\", \"\", [\"for=ae_name\"], \"Name\");\n input = newElement(formgroup, \"input\", [\"form-control\"],[\"type=text\",\"id=ae_name\",\"required=true\", \"value=\"+name,\"default-value=\"+name,\"onkeyup=ACCeditvalidate()\"],\"\");\n //department\n formgroup = newElement(form, \"div\", [\"form-group\",\"md-form\", \"mb-3\"], \"\", \"\");\n label = newElement(formgroup, \"label\", \"\", [\"for=ae_department\"], \"Department\");\n var select = newElement(formgroup, \"select\", [\"form-control\"],[\"required=true\",\"id=ae_department\",\"default-value=\"+department,\"onChange=ACCeditvalidate()\"], \"\");\n Departmentlist(\"ae_department\");\n var option = newElement(select, \"option\", \"\", [\"value=\"+department,\"hidden=true\",\"selected=selected\"],department);\n //position\n formgroup = newElement(form, \"div\", [\"form-group\",\"md-form\", \"mb-3\"], \"\", \"\");\n label = newElement(formgroup, \"label\", \"\", [\"for=ae_position\"], \"Position\");\n input = newElement(formgroup, \"input\", [\"form-control\"],[\"type=text\",\"id=ae_position\",\"required=true\", \"value=\"+position,\"default-value=\"+position,\"onkeyup=ACCeditvalidate()\"],\"\");\n //role\n formgroup = newElement(form, \"div\", [\"form-group\",\"md-form\", \"mb-3\"], \"\", \"\");\n label = newElement(formgroup, \"label\", \"\", [\"for=ae_role\"], \"Role\");\n select = newElement(formgroup, \"select\", [\"form-control\"],[\"required=true\",\"id=ae_role\",\"default-value=\"+role,\"onChange=ACCeditvalidate()\"], \"\");\n option = newElement(select, \"option\", \"\", [\"value=ADMINISTRATOR\"],\"Administrator\");\n option = newElement(select, \"option\", \"\", [\"value=STAFF\"],\"Staff\");\n option = newElement(select, \"option\", \"\", [\"value=\"+role,\"hidden=true\",\"selected=selected\"],role);\n //status\n formgroup = newElement(form, \"div\", [\"form-group\",\"md-form\", \"mb-3\"], \"\", \"\");\n label = newElement(formgroup, \"label\", \"\", [\"for=ae_status\"], \"Status\");\n select = newElement(formgroup, \"select\", [\"form-control\"],[\"required=true\",\"id=ae_status\",\"default-value=\"+status,\"onChange=ACCeditvalidate()\"], \"\");\n option = newElement(select, \"option\", \"\", [\"value=Active\"],\"Active\");\n option = newElement(select, \"option\", \"\", [\"value=Inactive\"],\"Inactive\");\n option = newElement(select, \"option\", \"\", [\"value=\"+status,\"hidden=true\",\"selected=selected\"],status);\n\n var footer = newElement(cf, \"div\", \"\", \"\", \"\");\n var button = newElement(footer, \"button\", [\"btn\", \"btn-primary\"],[\"disabled=true\",\"value=update\",\"id=UserAccountupdate\",\"onClick=UserAccountupdate(\\\"\"+userid+\"\\\")\"],\"Update\")\n}", "function editarProd(p){\n let producto = productos.find(prod => prod.cod == p)\n\n\n $(\"#contenedorFiltrado\").css(\"display\",\"none\")\n $(\"#contenedorStock\").html(`\n Nombre del Producto<br>\n <input type=\"text\" id=\"nombreEdit\" value=\"${producto.nombre}\" ><br>\n \n Marca<br>\n <input type=\"text\" id=\"marcaEdit\" value=\"${producto.marca}\" ><br>\n \n Costo<br>\n <input min=\"0\" type=\"number\" id=\"costoEdit\" value=\"${producto.costo}\" ><br>\n \n Margen de Ganancia<br>\n <input min=\"0\" type=\"number\" onchange=\"modificarLbl(${producto,$(\"#rentEdit\").val()})\" id=\"rentEdit\" value=\"${(((producto.precioventa)/1.21 / producto.costo)-1)*100}\" ><br>\n \n Cantidad<br>\n <input min=\"0\" type=\"number\" id=\"cantEdit\" value=\"${producto.cantidad}\" ><br>\n \n <button onclick=\"guardarEditProd(${p})\">Guardar</button>\n <button onclick=\"eliminarEditProd(${p})\" >Eliminar</button>\n\n `)\n\n\n}", "verifyEditCedula() {\n if (this.cedulaWarning === true) {\n let Message = 'Advertnecia, Modificar la cedula podria ocacionar fallos en el sistema, ';\n Message = Message + 'se recomienda hacerlo solo en casos excepcionales. ';\n Message = Message + 'Queda bajo su responsabilidad los daños ocacionados por esta accion';\n const response = confirm(Message);\n if (response === true) {\n this.cedulaWarning = false;\n }\n else {\n this.cedulaWarning = true;\n }\n }\n }", "function preencheLoteFinal(loteInicial){\r\n\tvar form = document.ImovelOutrosCriteriosActionForm;\r\n\t\r\n\tform.loteDestino.value = loteInicial.value;\r\n}", "function localFormAdjustment(formid,fieldid,data){\r\n var form = cachedForms[formid];\r\n var field = _.find(form.elements,function(f){\r\n return fieldid == f.id\r\n });\r\n _.each(_.keys(data),function(k){\r\n if(data[k]){\r\n field.localEdits[k] = data[k] \r\n }else{\r\n /*if(k=='validations'){\r\n if(field.localEdits.hasOwnProperty('validations')){\r\n delete field.localEdits[k][0].localmessage;\r\n }\r\n }else{\r\n delete field.localEdits[k];\r\n }*/\r\n delete field.localEdits[k];\r\n }\r\n });\r\n return field;\r\n}", "function setUpdate(id) {\n var obj = list[id];\n document.getElementById(\"descricao\").value = obj.descricao;\n document.getElementById(\"quantidade\").value = obj.quantidade;\n document.getElementById(\"valor\").value = obj.valor;\n document.getElementById(\"btnAtualizar\").style.display = \"inline-block\";\n document.getElementById(\"btnAdd\").style.display = \"none\";\n\n //aula 7 Atualizando dados do formulario\n document.getElementById(\"inputIdAtualizar\").innerHTML = '<input id=\"idAtualizar\" type=\"hidden\" value=\"' + id + '\">';\n\n}", "function validarModificacionPerson(rol,objetoPerson){\n\t//Se usan los setter para modificar los valores\n\tvar nombre = document.forms['modActorDirector']['nombrePerson'];\n\tvar lastName1 = document.forms['modActorDirector']['lastName12'];\n\tvar lastName2 = document.forms['modActorDirector']['lastName22'];\n\tvar born = document.forms['modActorDirector']['born2'];\n\tvar picture = document.forms['modActorDirector']['picture2'];\n\tvar nombreValido = validarCampoTexto(nombre);\n\tvar lastName1Valido = validarCampoTexto(lastName1);\n\tvar bornValido = validarCampoFecha(born);\n\tvar pictureValido = validarCampoRutaObligatorio(picture); \n\n\tif (nombre.value == \"\" || !nombreValido) {\n\t\tdocument.getElementById(\"nombreMal\").innerHTML = \"El nombre no puede estar vacío\";\n\t\tdocument.getElementById(\"nombreMal\").style.display = \"block\";\n\t}\n\tif (lastName1.value == \"\" || !lastName1Valido) {\n\t\tdocument.getElementById(\"lastName1Mal\").innerHTML = \"El apellido 1 no puede estar vacío\";\n\t\tdocument.getElementById(\"lastName1Mal\").style.display = \"block\";\n\t}\n\tif (lastName2.value == \"\") {\n\t\tdocument.getElementById(\"lastName2Mal\").innerHTML = \"El apellido 2 no puede estar vacío\";\n\t\tdocument.getElementById(\"lastName2Mal\").style.display = \"block\";\n\t}\n\tif (born.value == \"\" || !bornValido) {\n\t\tdocument.getElementById(\"bornMal\").innerHTML = \"La fecha no puede estar vacía\";\n\t\tdocument.getElementById(\"bornMal\").style.display = \"block\";\n\t}\n\tif (picture.value == \"\" || !pictureValido || picture.value == \"null\") {\n\t\tdocument.getElementById(\"pictureMal\").innerHTML = \"La ruta de la imagen no puede estar vacía o no es valida\";\n\t\tdocument.getElementById(\"pictureMal\").style.display = \"block\";\n\t}\n\tif((nombre.value != \"\" || nombreValido) && (lastName1.value != \"\" || lastName1Valido) && lastName2.value != \"\" && (born.value != \"\" || bornValido) && pictureValido){\n\t\t/* LINEAS AÑADIDAS EN LA PRACTICA 8 */\n\t\t//Abre la conexion con la base de datos categorias\n\t\tvar base = \"\";\n\t\tif (rol == \"Actor\") {\n\t\t\tbase = \"actores\";\n\t\t}else{\n\t\t\tbase = \"directores\";\n\t\t}\n\t\t//Abre la conexion con la base de datos\n\t\tvar personDB = indexedDB.open(nombreDB);\n\t\t//Si ha salido bien\n\t\tpersonDB.onsuccess = function(event) { \n\t\t\tvar db = event.target.result; \n\t\t\tvar objectStore = db.transaction([base],\"readwrite\").objectStore(base);\n\t\t\tvar objeto = objectStore.get(objetoPerson.completo);\n\t\t\t\n\t\t\tobjeto.onsuccess = function(event) {\n\t\t\t\t//Modifica el objeto de la base de datos\n\t\t\t\tvar nuevo = objeto.result;\n\t\t\t\tnuevo.name = nombre.value;\n\t\t\t\tnuevo.lastName1 = lastName1.value;\n\t\t\t\tnuevo.lastName2 = lastName2.value;\n\t\t\t\tvar fecha = new Date(born.value.split(\"/\")[1]+\"/\"+born.value.split(\"/\")[0]+\"/\"+born.value.split(\"/\")[2]);\n\t\t\t\tnuevo.born = fecha;\n\t\t\t\tnuevo.picture = picture.value;\n\t\t\t\tnuevo.completo = nombre.value+\" \"+lastName1.value+\" \"+lastName2.value;\n\t\t\t\t//Se manda la actualizacion a la base de datos\n\t\t\t\tvar update = objectStore.put(nuevo);\n\t\t\t\tupdate.onsuccess = function(){\n\t\t\t\t\t//Si se ha cambiado el nombre borra el antiguo para que no haya duplicados\n\t\t\t\t\tif (nuevo.completo != objetoPerson.completo) {\n\t\t\t\t\t\tobjectStore.delete(objetoPerson.completo);\n\t\t\t\t\t}\n\t\t\t\t\tvar tabla = \"\";\n\t\t\t\t\tif (rol == \"Actor\") {\n\t\t\t\t\t\ttabla = \"repartoPro\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\ttabla = \"directorPro\";\n\t\t\t\t\t}//Fin del if\n\t\t\t\t\t//Abre la conexion con la base de datos\n\t\t\t\t\tvar request2 = indexedDB.open(nombreDB);\n\t\t\t\t\t//Si ha salido bien\n\t\t\t\t\trequest2.onsuccess = function(event) {\n\t\t\t\t\t\t//Asigna el resultado a la variable db, que tiene la base de datos \n\t\t\t\t\t\tvar db2 = event.target.result; \n\t\t\t\t\t\tvar objectStore2 = db2.transaction([tabla],\"readwrite\").objectStore(tabla);\n\t\t\t\t\t\t//Obtiene el objeto de la base de datos\n\t\t\t\t\t\tvar objeto2 = objectStore2.get(objetoPerson.completo);\n\t\t\t\t\t\tobjeto2.onsuccess = function(event) {\n\t\t\t\t\t\t\tvar nuevo2 = objeto2.result;\n\t\t\t\t\t\t\tnuevo2.completo = nombre.value+\" \"+lastName1.value+\" \"+lastName2.value;\t\t\t\t\t\n\t\t\t\t\t\t\t//Se manda la actualizacion a la base de datos\n\t\t\t\t\t\t\tvar update2 = objectStore2.put(nuevo2);\n\t\t\t\t\t\t\tupdate2.onsuccess = function(){\n\t\t\t\t\t\t\t\t//Borra el antiguo para que no haya duplicados\n\t\t\t\t\t\t\t\tobjectStore2.delete(objetoPerson.completo);\n\t\t\t\t\t\t\t\t//Muestra el modal y la pagina de inicio\n\t\t\t\t\t\t\t\texito();\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};//Fin del evento update.onsuccess\n\t\t\t};//Fin de objeto.onsuccess\n\t\t};//FIn de request.onsuccess\t\n\t}else{\n\t\treturn false;\n\t}\n}", "function editarProveedor(idProveedor,nombre,telefono1,telefono2,celular,direccion,email,identificativoNit){\n\t\n\t$(\"#editar_idProveedor\").val(idProveedor);\n\t$(\"#editar_identificativo\").val(identificativoNit);\n\t$(\"#editar_nombre\").val(nombre);\n\t$(\"#editar_telefono1\").val(telefono1);\n\t$(\"#editar_telefono2\").val(telefono2);\n\t$(\"#editar_celular\").val(celular);\n\t$(\"#editar_direccion\").val(direccion);\n\t$(\"#editar_email\").val(email);\n\t\n\t$(\"#label_editar_identificativo\").addClass(\"active\");\n\t$(\"#label_editar_nombre\").addClass(\"active\");\n\t$(\"#label_editar_telefono1\").addClass(\"active\");\n\t$(\"#label_editar_telefono2\").addClass(\"active\");\n\t$(\"#label_editar_celular\").addClass(\"active\");\n\t$(\"#label_editar_direccion\").addClass(\"active\");\n\t$(\"#label_editar_email\").addClass(\"active\");\t\n\t\n\tcancelarGuardadoNuevoProveedor();\n\t$(\"#tituloLi\").hide(\"slower\");\n\t$(\"#hidden_editarProveedor\").show(\"slower\");\n\t\n}", "function actualiza_descripcion_telefono(telefono)\n{\n\tvar url='inc/datos_gestion.php'\n\tvar descripcion = $F('descripcion_'+ telefono)\n\tvar id = $F('identificador_'+ telefono)\n\tpars = 'opcion=17&telefono='+telefono+'&descripcion='+descripcion+'&id='+id\n\tvar myAjax = new Ajax.Request(url,\n\t{\n\t\tmethod:'post',\n\t\tparameters: pars,\n\t\tonComplete:function gen(t)\n\t\t{\n\t\t\tformulario_telefonos()\n\t\t}\n\t});\n}", "function editarServicio(idServicio){\n \t$('#listaorders').empty();\n\tvar cadena_form = \"\";\n\tcadena_form \t = cadena_form+'<h2><img src=\"app/site/img/servicios.png\"> Actualizar Servicio</h2><hr>';\n\tcadena_form \t = cadena_form+'<div id=\"msg_correcto\"></div>';\n\tcadena_form \t = cadena_form+'<div id=\"msg_login\"></div>';\n\tcadena_form \t = cadena_form+'<form id=\"actualizar_servicio\">';\n\tcadena_form \t = cadena_form+'<table>';\n\tcadena_form \t = cadena_form+'<tr> <td><label>Nombre:</label> </td><td><input type=\"text\" id=\"nombre_servicio\"><input type=\"hidden\" id=\"id_servicio\"></td><td><label>Descripci&oacute;n:</label></td><td> <textarea id=\"descripcion_servicio\"> </textarea></td></tr>';\n\tcadena_form \t = cadena_form+'<tr> <td><label>Codigo:</label> </td><td><input type=\"text\" id=\"codigo_servicio\"></td><td></td><td> </td></tr>';\n\tcadena_form \t = cadena_form+'<tr><td></td><td><input type=\"submit\" value=\"Actualizar Servicio\" class=\"enlace_boton_lista\"></td><td></td><td><input type=\"button\" value=\"Cancelar\" class=\"enlace_boton_lista\" onclick=\"listaServicio()\"></td></tr></table>';\n\tcadena_form \t = cadena_form+'</form>';\n\t$('#listaorders').append(cadena_form);\n\t$('#msg_login').hide();\n\tvalidarTodosCamposNuevoProducto();\n\t$.ajax({\n\t\turl:'?action=servicios&tp=getServicio&idServicio='+idServicio,\n\t\ttype:'GET',\n\t\tdataType:'json',\n\t\tbeforeSend:function(){\n\t\t},\n\t\tsuccess:function(res){\n\t\t\t$('#id_servicio').val(res.id_servicio);\n\t\t\t$('#nombre_servicio').val(res.nombre_servicio);\n\t\t\t$('#descripcion_servicio').val(res.detalle_servicio);\n\t\t\t$('#codigo_servicio').val(res.codigo_servicio);\n\t\t},\n\t\terror:function(){\n\n\t\t}\n\t});\n\tnew Modal().show(700,300);\n\t/// Este es el evento que se ejecuta cuando el formulario ha sido enviado\n\t$('#actualizar_servicio').submit(function(evt){\n\t\t$('#msg_login').empty();\n\t\tif($('#nombre_servicio').val() == \"\"){\n\t\t\t$('#msg_login').append('<p> <img src=\"app/site/img/inf.png\" align=\"absmiddle\"> El campo nombre de la pieza no puede estar vacio !!</p>').hide().fadeIn(1000);\t\n\t\t}else{\n\t\t\t$.ajax({\n\t\t\t\turl: \"?action=servicios&tp=actualizarServicio\",\n\t\t\t\tdataType: 'json',\n\t\t\t\ttype: 'POST',\n\t\t\t\tdata: {\n\t\t \t\tid_servicio: $('#id_servicio').val(),\n\t\t \t\tnombre_servicio: $('#nombre_servicio').val(),\n\t\t \t\tdescripcion_servicio: $('#descripcion_servicio').val(),\n\t\t \t\tcodigo_servicio: $('#codigo_servicio').val()\n\t\t \t},\n\t\t\t\tbeforeSend: function(){\n\t\t\t\t\t$('#msg_login').hide();\n\t\t\t\t\t$('#msg_correcto').append('<img src=\"app/site/img/ajax-loader.gif\" align=\"absmiddle\">').hide().fadeIn(1000);\n\t\t\t\t},\n\t\t\t\tsuccess: function(data){\n\t\t\t\t\tif(data.completado == true){\n\t\t\t\t\t\tservicioActualizadaExito();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror: function(data){\n\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tevt.preventDefault();\n\t});\n }", "function modificarEstudiante(id_estudiante,nombre){\n\tgrupoestudiante.id_estudiante=id_estudiante;\n\tgrupoestudiante.nombre=nombre;\n\t\n\t$(\"#CampoidEstu2\").val(grupoestudiante.id_estudiante);\n\t$(\"#CampoEstudiante2\").val(grupoestudiante.nombre);\n}", "function adaptaFormulario () {\r\n\tvar secProfEl = getFormElementById(\"sectorprofesion_c\");\r\n\tif (! secProfEl) {\r\n\t\tconsole.error(\"No se ha definido el campo Sector Profesional.\");\r\n\t} else {\r\n\t\tvar secProf = secProfEl.options[secProfEl.selectedIndex];\r\n\t\tswitch (secProf.value) {\r\n\t\t\tcase \"otros\": visibilidadOtroSector(true); break;\r\n\t\t\tdefault:\t visibilidadOtroSector(false);\t break;\r\n\t\t}\r\n\t}\r\n}", "function User_Update_Types_d_attribut_Liste_des_types_d_attribut_de_personne0(Compo_Maitre)\n{\n var Table=\"typeattribut\";\n var CleMaitre = Compo_Maitre.getCleVal();\n var NomCleMaitre = DePrefixerChamp(Compo_Maitre.getCle());\n var ta_nom=GetValAt(30);\n if (!ValiderChampsObligatoire(Table,\"ta_nom\",TAB_GLOBAL_COMPO[30],ta_nom,false))\n \treturn -1;\n if (!ValiderChampsType(Table,\"ta_nom\",TAB_GLOBAL_COMPO[30],ta_nom))\n \treturn -1;\n var Req=\"update \"+Table+\" set \";\n Req+=\"ta_nom=\"+(ta_nom==\"\" ? \"null\" : \"'\"+ValiderChaine(ta_nom)+\"'\" )+\"\";\n Req+=\" where \"+NomCleMaitre+\"=\"+CleMaitre;\n\n if (pgsql_update(Req)==0)\n\talert(\"Echec lors de la mise à jour\");\nreturn CleMaitre;\n\n}", "validarInformacion(){\n /** valida la informacion de los txt */\n if(this.generaValidacionControles() === 0){\n /** Se valida si se realizara un guardado o una actualizacion */\n if(this.state.objetoCliente.id === 0){\n /** Se realizara un guardado */\n return true;\n }else{\n /** Se llama el metodo que se encargara de indicar si se modifico algo o no */\n if(validaStateVsPropObj(this.state.objetoCliente,this.props.objCliente,'clientes')){\n return true;\n }else{\n /** Se asignan los valores del mensaje */\n this.mostrarControlMensaje(\"Se debe modificar al menos un campo para poder actualizar.\", 'danger', 'showMensaje');\n /** Se regresa el valor de que no cumplio la condicion */\n return false;\n }\n }\n }else{\n this.mostrarControlMensaje(\"Debe proporcionar toda la información.\", 'danger', 'showMensaje');\n /** Se regresa el valor de que no cumplio la condicion */\n return false;\n }\n }", "function actualizarUsuarioTodos() {\n var configmail = $(\"#configmail\").val();\n var id = $(\"#idusuarioUpTodos\").val();\n\n // UPDATE nombre\n var nombreup2Todos = $(\"#nombreup2Todos\").val();\n if ($(\"#nombreup2Todos\").val() == \"\") {\n $(\"#nombreup2Todos\").addClass(\"is-invalid\");\n swal(\"Algo salió mal!\", \"El campo nombre es obligatorio\", \"warning\");\n $(\"#statusEmailTodos\").html(\n '<span class=\"label label-error\" style=\"color: red\">Campo obligatorio</span>'\n );\n return false;\n }\n\n // //UPDATE email\n var newemailUpTodos = $(\"#newemailUpTodos\").val();\n\n //UPDATE contraseña\n var pass2UpTodos = $(\"#pass2UpTodos\").val();\n if (pass2UpTodos == \"\") {\n swal(\n \"Validación!\",\n \"El campo contraseña es obligatorio y no debe estar vacío\",\n \"warning\"\n );\n return false;\n }\n if (\n pass2UpTodos.length == 0 ||\n pass2UpTodos.length <= 8 ||\n pass2UpTodos.length >= 35 ||\n getUppercarse(pass2UpTodos) == 0 ||\n getNumber(pass2UpTodos) == 0\n ) {\n swal(\n \"Validación\",\n \"Su contraseña debe tener entre 8 y 35 caracteres, contener letras, números y alguna letra en mayúscula.\",\n \"warning\"\n );\n return false;\n }\n\n //UPDATE checkUp\n var checkUpTodos = 0;\n if ($(\"#adminconfirmationUpTodos\").prop(\"checked\") == true) {\n checkUpTodos = 1;\n } else {\n checkUpTodos = 0;\n }\n\n checkValidMailUpTodos(\n newemailUpTodos,\n pass2UpTodos,\n nombreup2Todos,\n checkUpTodos,\n id\n );\n}", "function editDisputeReason() {\n\tdocument.getElementById('canFinalize').value = 'NO';\n}", "function resetPresidentForm(){\n fechaInicioField.setValue('');\n descripcionEventoField.setValue('');\n }", "function editarContacto(nombreEliminar,a,b,c) {\n\tfor (var i =0;i < arrayContactos.length;i++) {\n\t\tif (arrayContactos[i].nombre == nombreEliminar ) {\n\t\t\tarrayContactos[i].nombre=a;\n\t\t\tarrayContactos[i].direccion=b;\n\t\t\tarrayContactos[i].telefono=c;\n\t\t}\n\t}\n\tguardarDatosLocales();\n}", "function editarDatos(parId, parTipo, parIden, parfechaIni, parfechaFin, parCuando, parEmpleado) {\n document.getElementById(\"tipo\").value = parTipo;\n document.getElementById(\"iden\").value = parIden\n document.getElementById(\"fechaIni\").value = parfechaIni;\n document.getElementById(\"fechaFin\").value = parfechaFin;\n document.getElementById(\"cuando\").value = parCuando;\n document.getElementById(\"empleado\").value = parEmpleado;\n $(\"#guardar\").css(\"display\", \"none\");\n $(\".linea\").attr(\"disabled\", true);\n $(\"#act\").append(\"<button class='btn btn-info my-3' id='actualizar'>Guardar</button>\");\n $(\"#actualizar\").on(\"click\", function () {\n var userRef = db.collection(\"usuarios\").doc(parId);\n tipos = document.getElementById(\"tipo\").value;\n idens = document.getElementById(\"iden\").value;\n fechaInis = document.getElementById(\"fechaIni\").value;\n fechaFins = document.getElementById(\"fechaFin\").value;\n cuandos = document.getElementById(\"cuando\").value;\n empleados == document.getElementById(\"empleado\").value;\n\n if (tipos.trim() === \"\" || idens.trim() === \"\" || fechaInis.trim() === \"\" || fechaFins.trim() === \"\" || cuandos.trim() === \"\" || empleados.trim() === \"\") {\n alert(\"Todos los datos son obligatorios.\");\n return false;\n } else {\n return userRef.update({\n tipo: document.getElementById(\"tipo\").value,\n iden: document.getElementById(\"iden\").value,\n fechaIni: document.getElementById(\"fechaIni\").value,\n fechaFin: document.getElementById(\"fechaFin\").value,\n cuando: document.getElementById(\"cuando\").value,\n empleado: document.getElementById(\"empleado\").value\n })\n .then(function () {\n console.log(\"Usuario actualizado correctamente.\");\n document.getElementById(\"tipo\").value = \"\";\n document.getElementById(\"iden\").value = \"\";\n document.getElementById(\"fechaIni\").value = \"\";\n document.getElementById(\"fechaFin\").value = \"\";\n document.getElementById(\"cuando\").value = \"\";\n document.getElementById(\"empleado\").value = \"\";\n $(\"#guardar\").css(\"display\", \"inline\");\n $(\".linea\").attr(\"disabled\", false);\n $(\"#act\").empty();\n })\n .catch(function (error) {\n // The document probably doesn't exist.\n console.error(\"Error actualizando datos: \", error);\n });\n }\n })\n}", "function populateJs2Form(){\n\t//Primero determinamos el modo en el que estamos;\n\tvar mode = getMMGMode(get('cobUsuarEtapaCobraDetalFrm.accion'), \n\t\tget('cobUsuarEtapaCobraDetalFrm.origen'));\n\n\n\tset('cobUsuarEtapaCobraDetalFrm.id', jsCobUsuarEtapaCobraDetalId);\n\tset('cobUsuarEtapaCobraDetalFrm.ueccOidUsuaEtapCobr', [jsCobUsuarEtapaCobraDetalUeccOidUsuaEtapCobr]);\n\tset('cobUsuarEtapaCobraDetalFrm.edtcOidEtapDeudTipoCarg', [jsCobUsuarEtapaCobraDetalEdtcOidEtapDeudTipoCarg]);\n\tset('cobUsuarEtapaCobraDetalFrm.zsgvOidSubgVent', [jsCobUsuarEtapaCobraDetalZsgvOidSubgVent]);\n\tset('cobUsuarEtapaCobraDetalFrm.zorgOidRegi', [jsCobUsuarEtapaCobraDetalZorgOidRegi]);\n\tset('cobUsuarEtapaCobraDetalFrm.zzonOidZona', [jsCobUsuarEtapaCobraDetalZzonOidZona]);\n\tset('cobUsuarEtapaCobraDetalFrm.zsccOidSecc', [jsCobUsuarEtapaCobraDetalZsccOidSecc]);\n\tset('cobUsuarEtapaCobraDetalFrm.terrOidTerr', [jsCobUsuarEtapaCobraDetalTerrOidTerr]);\n\tset('cobUsuarEtapaCobraDetalFrm.melcOidMetoLiquCobr', [jsCobUsuarEtapaCobraDetalMelcOidMetoLiquCobr]);\n\tset('cobUsuarEtapaCobraDetalFrm.eucoOidEstaUsuaEtapCobr', [jsCobUsuarEtapaCobraDetalEucoOidEstaUsuaEtapCobr]);\n\tset('cobUsuarEtapaCobraDetalFrm.gacaOidGuioArguCabe', [jsCobUsuarEtapaCobraDetalGacaOidGuioArguCabe]);\n\tset('cobUsuarEtapaCobraDetalFrm.valObse', jsCobUsuarEtapaCobraDetalValObse);\n\t\n}", "function updFieldAktif() {\n var id='ftPrestasi_';\n var noakun = document.getElementById(id+'noakun').childNodes;\n var kodekegiatan = document.getElementById(id+'kodekegiatan').childNodes;\n var kodeasset = document.getElementById(id+'kodeasset').childNodes;\n var kodebarang = document.getElementById(id+'kodebarang').childNodes;\n var nik = document.getElementById(id+'nik').childNodes;\n var kodecustomer = document.getElementById(id+'kodecustomer').childNodes;\n var kodesupplier = document.getElementById(id+'kodesupplier').childNodes;\n var kodevhc = document.getElementById(id+'kodevhc').childNodes;\n var param = \"noakun=\"+noakun[0].options[noakun[0].selectedIndex].value;\n \n function respon() {\n if (con.readyState == 4) {\n if (con.status == 200) {\n busy_off();\n if (!isSaveResponse(con.responseText)) {\n alert('ERROR TRANSACTION,\\n' + con.responseText);\n } else {\n //=== Success Response\n var res = con.responseText;\n \n // Kegiatan\n if(res[0]==0) {\n kodekegiatan[0].setAttribute('disabled','disabled');\n kodekegiatan[0].selectedIndex=0;\n } else {\n kodekegiatan[0].removeAttribute('disabled');\n }\n \n // Asset\n if(res[1]==0) {\n kodeasset[0].setAttribute('disabled','disabled');\n kodeasset[0].selectedIndex=0;\n } else {\n kodeasset[0].removeAttribute('disabled');\n }\n \n // Barang\n if(res[2]==0) {\n kodebarang[0].setAttribute('disabled','disabled');\n kodebarang[2].setAttribute('disabled','disabled');\n kodebarang[3].setAttribute('disabled','disabled');\n kodebarang[0].value='';\n kodebarang[2].value='';\n } else {\n kodebarang[0].removeAttribute('disabled');\n kodebarang[2].removeAttribute('disabled');\n kodebarang[3].removeAttribute('disabled');\n }\n \n // Karyawan\n if(res[3]==0) {\n nik[0].setAttribute('disabled','disabled');\n nik[0].selectedIndex=0;\n } else {\n nik[0].removeAttribute('disabled');\n }\n \n // Customer\n if(res[4]==0) {\n kodecustomer[0].setAttribute('disabled','disabled');\n kodecustomer[0].selectedIndex=0;\n } else {\n kodecustomer[0].removeAttribute('disabled');\n }\n \n // Supplier\n if(res[5]==0) {\n kodesupplier[0].setAttribute('disabled','disabled');\n kodesupplier[0].selectedIndex=0;\n } else {\n kodesupplier[0].removeAttribute('disabled');\n }\n \n // Kendaraan\n if(res[6]==0) {\n kodevhc[0].setAttribute('disabled','disabled');\n kodevhc[0].selectedIndex=0;\n } else {\n kodevhc[0].removeAttribute('disabled');\n }\n }\n } else {\n busy_off();\n error_catch(con.status);\n }\n }\n }\n \n post_response_text('keu_slave_kasbank_detail.php?proses=updField', param, respon);\n}", "function inicioComponenteEdit(paramTitulo) { \r\n const titulo = paramTitulo;\r\n\r\n let item = getFromLS('autoToEdit');\r\n\r\n const atributos = ['marca', 'modelo', 'año', 'color', 'patente'];\r\n\r\n const tipoDelAtributo = ['text', 'text', 'number', 'text', 'text'];\r\n\r\n const actualizarItem = function() {\r\n // Get position from LS\r\n const position = getFromLS('position');\r\n\r\n // Save data from inputs\r\n item = createAuto();\r\n\r\n // Get list from LS\r\n let lista = getFromLS('listaAutos');\r\n\r\n // Save item\r\n lista[position] = item;\r\n \r\n // Save listaUsuario in LS\r\n saveInLS('listaAutos', lista);\r\n \r\n alert('Fue modificado exitosamente');\r\n\r\n // Relocate\r\n window.location.href = './abmGenerico.html';\r\n }\r\n\r\n const altaItem = function() { \r\n var formElement = document.getElementById('phpForm');\r\n formData = new FormData(formElement);\r\n\r\n fetch ('../server/abmGenerico.php?action=agregar', {\r\n method: 'POST',\r\n body: formData \r\n })\r\n .then((response) => response.json())\r\n .then((data) => {\r\n alert(data.msg);\r\n\r\n // Relocate\r\n window.location.href = './abmGenerico.html';\r\n })\r\n .catch((err) => console.log(err))\r\n }\r\n\r\n renderizarHTML_Edit(divEditaABM, titulo, atributos, tipoDelAtributo, altaItem);\r\n}", "function Editar(pos){\r\n var Placa = document.getElementById(\"placa\");\r\n var Color = document.getElementById(\"color\");\r\n var Ano = document.getElementById(\"ano\");\r\n var Capacidad = document.getElementById(\"capacidad\");\r\n var Cilindraje= document.getElementById(\"cilindraje\");\r\n var Chasis = document.getElementById(\"chasis\");\r\n var Zona = document.getElementById(\"zona\");\r\n var Valor = document.getElementById(\"valor\");\r\n var Fecha = document.getElementById(\"fecha\");\r\n var Email = document.getElementById(\"email\");\r\n var Tel = document.getElementById(\"tel\");\r\n var Direccion = document.getElementById(\"direccion\");\r\n\r\n document.getElementById(\"btn\").hidden = true;\r\n document.getElementById(\"btn_editar\").hidden = false;\r\n\tPlaca.value = vec[pos].placa;\r\n\tColor.value = vec[pos].color;\r\n\tAno.value = vec[pos].Anyo;\r\n\tCapacidad.value = vec[pos].capacidad;\r\n\tCilindraje.value = vec[pos].cilindraje;\r\n\tChasis.value \t = vec[pos].chasis;\r\n\tZona.value \t = vec[pos].zona;\r\n\tValor.value \t = vec[pos].valor;\r\n\tFecha.value = vec[pos].fecha;\r\n\tEmail.value = vec[pos].correo;\r\n\tTel.value\t = vec[pos].tele;\r\n\tDireccion.value = vec[pos].dir;\r\n}", "function updateEditPage () {\n\n var nameMap = table.makePermissionMap(true);\n\n // todo: refactor these doubled 4 lines of code.\n // todo: refactor this doubled line of comments.\n var viewSummaryDiv = $(\"#permissions-view-summary\");\n var viewNames = [].concat(nameMap.group.view).concat(nameMap.user.view);\n if (viewNames.length) viewSummaryDiv.find(\".summary-content\").text(viewNames.join(\", \"));\n AJS.setVisible(viewSummaryDiv, viewNames.length);\n\n var editSummaryDiv = $(\"#permissions-edit-summary\");\n var editNames = [].concat(nameMap.group.edit).concat(nameMap.user.edit);\n if (editNames.length) editSummaryDiv.find(\".summary-content\").text(editNames.join(\", \"));\n AJS.setVisible(editSummaryDiv, editNames.length);\n\n /**\n * Updates the hidden fields that submit the edited permissions in the form. The fields are updated with the\n * data in the Permissions table.\n */\n permissionManager.permissionsEdited = false;\n var permissionStrs = permissionManager.makePermissionStrings();\n for (var key in permissionStrs) {\n var updatedPermStr = permissionStrs[key];\n $(\"#\" + key).val(updatedPermStr);\n\n if (permissionManager.originalPermissions[key] != updatedPermStr) {\n permissionManager.permissionsEdited = true;\n }\n }\n }", "function updateEditPage () {\n\n var nameMap = table.makePermissionMap(true);\n\n // todo: refactor these doubled 4 lines of code.\n // todo: refactor this doubled line of comments.\n var viewSummaryDiv = $(\"#permissions-view-summary\");\n var viewNames = [].concat(nameMap.group.view).concat(nameMap.user.view);\n if (viewNames.length) viewSummaryDiv.find(\".summary-content\").text(viewNames.join(\", \"));\n AJS.setVisible(viewSummaryDiv, viewNames.length);\n\n var editSummaryDiv = $(\"#permissions-edit-summary\");\n var editNames = [].concat(nameMap.group.edit).concat(nameMap.user.edit);\n if (editNames.length) editSummaryDiv.find(\".summary-content\").text(editNames.join(\", \"));\n AJS.setVisible(editSummaryDiv, editNames.length);\n\n /**\n * Updates the hidden fields that submit the edited permissions in the form. The fields are updated with the\n * data in the Permissions table.\n */\n permissionManager.permissionsEdited = false;\n var permissionStrs = permissionManager.makePermissionStrings();\n for (var key in permissionStrs) {\n var updatedPermStr = permissionStrs[key];\n $(\"#\" + key).val(updatedPermStr);\n\n if (permissionManager.originalPermissions[key] != updatedPermStr) {\n permissionManager.permissionsEdited = true;\n }\n }\n }", "function actualizarRegistos() {\n\n /* Obtiene el texto y lo modifica */\n var registros = document.getElementById(\"registros\").textContent;\n registros = contador_registros + \" de \" + agenda.length;\n document.getElementById(\"registros\").textContent = registros;\n\n /* Impide aumentar los registos si no existen en la Agenda */\n var max = document.getElementById(\"ver\");\n max.setAttribute(\"max\", agenda.length);\n\n /* Si nos movemos entre los diferentes registros, tambien cambiamos el valor del Imput 'ver' */\n ver.value = contador_registros;\n\n /* Al cargar la Agenda muestra por defecto e contacto indicado en la variable contador, en este caso la posicion 0 */\n document.getElementById(\"nombre\").value = agenda[contador_registros].nombre;\n document.getElementById(\"apellidos\").value = agenda[contador_registros].apellidos;\n document.getElementById(\"telefono\").value = agenda[contador_registros].telefono;\n document.getElementById(\"fecha\").value = agenda[contador_registros].fecha;\n}", "function compruebaCodigoEntrega(elementoBusqueda) {\n\t\n\t/*busquedaAutom = true;\n\t\n\tvar valueCampoBusqueda = document.getElementById(elementoBusqueda).value;\n\tvar form = document.forms['MWEBNuevaEntregaForm'];\n\tif (estaVacio (valueCampoBusqueda) ) {\n\t\tdocument.forms['MWEBNuevaEntregaForm'].stockCodigoArticuloPropietario.value=\"\";\n\t\tdocument.forms['MWEBNuevaEntregaForm'].stockCodigoArticulo.value=\"\";\n\t\tdocument.forms['MWEBNuevaEntregaForm'].stockDescripcion.value=\"\";\n\t\tdocument.forms['MWEBNuevaEntregaForm'].stockIdCodigoArticulo.value=\"\";\n\t} else {\n\t\tif (document.forms['MWEBNuevaEntregaForm'].modo.value == '') {\n\t\t\tdocument.forms['MWEBNuevaEntregaForm'].estado.value = 'MODO_ANADIR_ARTICULO';\n\t\t}\n\t\telse {\n\t\t\tdocument.forms['MWEBNuevaEntregaForm'].estado.value = document.forms['MWEBNuevaEntregaForm'].modo.value;\n\t\t}\n\t\n\t\tdocument.forms['MWEBNuevaEntregaForm'].modo.value = 'MODO_BUSCAR_ARTICULO_AUTOMATICO';\n\t\tdocument.forms['MWEBNuevaEntregaForm'].campoBusqueda.value = elementoBusqueda;\n\t\tdocument.forms['MWEBNuevaEntregaForm'].submit();\n\t}*/\n var codSeguimiento = document.getElementById('codSeguimiento').value;\n var comentario = document.getElementById('comentario').value;\n var proveedor = document.getElementById('proveedor').value;\n var usuario = document.getElementById('usuario').value;\n var valueCampoBusqueda = document.getElementById(elementoBusqueda).value;\n if(elementoBusqueda==\"codigoArticulo\")\n {\n document.forms['MWEBNuevaOEForm'].codigoArticulo.value=valueCampoBusqueda;\n }else\n {\n document.forms['MWEBNuevaOEForm'].codigoArticuloPropietario.value=valueCampoBusqueda;\n }\n //datosEnvio=\"articulosServlet.do?\"+elementoBusqueda+\"=\"+valueCampoBusqueda+\"&pagina=\"+pagina+\"&usuario=\"+usuariob+\"&origen=\"+origen;\n //datosEnvio=datosEnvio+\"&codSeguimiento=\"+codSeguimiento+\"&comentario=\"+comentario+\"&proveedor=\"+proveedor;\n \n document.forms['MWEBNuevaOEForm'].accion.value=\"buscar\";\n document.forms['MWEBNuevaOEForm'].codSeguimiento.value=codSeguimiento;\n document.forms['MWEBNuevaOEForm'].comentario.value=comentario;\n document.forms['MWEBNuevaOEForm'].proveedor.value=proveedor;\n document.forms['MWEBNuevaOEForm'].pagina.value=\"irArticuloNEp\";\n document.forms['MWEBNuevaOEForm'].origen.value=\"irArticuloNEp\";\n document.forms['MWEBNuevaOEForm'].usuario.value=usuario;\n document.forms['MWEBNuevaOEForm'].action =\"articulosServlet.do\"; //datosEnvio;\n document.forms['MWEBNuevaOEForm'].submit();\n}", "function editarRecomendacion(ente_id) {\n const url = '/recomendaciones/' + ente_id + '/edit'\n console.log(url);\n const formRecomendacionUpdate = document.getElementById('formRecomendacionUpdate');\n fetch(url, {\n method: 'GET',\n mode: \"cors\",\n headers: {\n accept: \"application/json\",\n 'X-CSRF-TOKEN': $('meta[name=\"csrf-token\"]').attr('content')\n }\n })\n .then(response => {\n if (response.ok) {\n response.json().then(success => {\n formRecomendacionUpdate.id.value = success.id;\n formRecomendacionUpdate.autoparte.value = success.autoparte;\n formRecomendacionUpdate.tipo.value = success.tipo;\n formRecomendacionUpdate.seguimiento.value = success.seguimiento;\n formRecomendacionUpdate.fuente.value = success.fuente;\n formRecomendacionUpdate.especificacion.value = success.especificacion;\n formRecomendacionUpdate.tipo_alert.value = success.tipo_alert;\n formRecomendacionUpdate.fecha_siguiente.value = success.fecha_siguiente;\n formRecomendacionUpdate.km_siguiente.value = success.km_siguiente;\n\n\n // console.log(success);\n $('#modalRecomendacionUpdate').modal('show')\n });\n }\n })\n .catch(error => {\n console.log('request failed');\n });\n}", "function click_edit() {\n\t document.getElementById('submit_edit_paciente').click();\n\t}", "function modificarFactura(cnumero) {\n for (const factura of baseFactura) {\n if (factura.numero == cnumero) {\n document.getElementById(\"txtFecha\").value = factura.fecha;\n document.getElementById(\"cboCliente\").value = factura.cliente.dni;\n document.getElementById(\"cboVehiculo\").value = factura.vehiculo.placa;\n\n document.getElementById(\"txtSerie\").value = factura.serie;\n document.getElementById(\"txtNumero\").value = factura.numero;\n\n document.getElementById(\"txtImporte\").value = factura.importe;\n\n document.getElementById(\"txtSerie\").disabled = true;\n document.getElementById(\"txtNumero\").disabled = true;\n\n break;\n }\n }\n\n let btnRegistrar = document.getElementById(\"btnRegistrar\");\n btnRegistrar.value = \"Actualizar\";\n}", "function editSaveBill() {\n\tdocument.getElementById('canFinalize').value = 'NO';\n}", "function ep_Edit() {\n // set the refresh flag\n\tnlapiSetFieldValue('custpage_2663_edit_mode', 'T', false);\n nlapiSetFieldValue('custpage_2663_refresh_page', 'T', false);\n \n // suppress the alert\n setWindowChanged(window, false);\n \n // submit the form -- calls submitForm function\n document.forms.main_form.submit();\n}", "verificaDados(){\n this.verificaEndereco();\n if(!this.verificaVazio()) this.criaMensagem('Campo vazio detectado', true);\n if(!this.verificaIdade()) this.criaMensagem('Proibido cadastro de menores de idade', true);\n if(!this.verificaCpf()) this.criaMensagem('Cpf deve ser válido', true);\n if(!this.verificaUsuario()) this.criaMensagem('Nome de usuario deve respeitar regras acima', true);\n if(!this.verificaSenhas()) this.criaMensagem('Senha deve ter os critérios acima', true)\n else{\n this.criaMensagem();\n // this.formulario.submit();\n }\n }" ]
[ "0.67076755", "0.6521138", "0.6479333", "0.6421623", "0.6377064", "0.63492125", "0.6343599", "0.6275725", "0.6223106", "0.6205455", "0.6190618", "0.61753243", "0.61285675", "0.60795224", "0.6055702", "0.6048755", "0.6004309", "0.5956308", "0.59474814", "0.5923576", "0.59200436", "0.5903237", "0.59027314", "0.5875189", "0.58649224", "0.5859804", "0.58560205", "0.585309", "0.58509535", "0.5844347", "0.5841339", "0.5837054", "0.58355963", "0.5821043", "0.5816861", "0.58163315", "0.5813962", "0.5812385", "0.57978505", "0.57956403", "0.57890326", "0.5785261", "0.57778645", "0.57736146", "0.5769072", "0.57684654", "0.5753599", "0.57508636", "0.5749644", "0.5745483", "0.573911", "0.57223105", "0.5716582", "0.57117283", "0.5711588", "0.5711168", "0.5693605", "0.5693062", "0.5683243", "0.5680473", "0.5675773", "0.5675537", "0.5665274", "0.56624484", "0.5657277", "0.56544155", "0.5641087", "0.5634496", "0.5624859", "0.5624242", "0.5621739", "0.56209546", "0.5618756", "0.5618708", "0.56168324", "0.56128454", "0.5610175", "0.5608895", "0.56087965", "0.56072646", "0.5606042", "0.5605565", "0.56048375", "0.56037396", "0.55950093", "0.5594679", "0.55923015", "0.5590245", "0.5589466", "0.5589112", "0.55884653", "0.5586629", "0.5586629", "0.55861425", "0.5585506", "0.55847275", "0.55830824", "0.5579024", "0.5578566", "0.5577232", "0.5576789" ]
0.0
-1
Funcion con Ajax para enviarle los inputs con los datos, en este caso un array que los contenga, para modificar al usuario en el PHP UpdateUser
function modificarCuentaUsuario() { var xmlhttp = new XMLHttpRequest(); var arrayInput = document.getElementsByTagName("input"); var idUsuario = document.getElementById("modificar").getAttribute("data-id"); var data = {} var url = "../Api/UpdateUser.php"; for (let i = 0; i < arrayInput.length; i++) { if (arrayInput[i].value != "") { data[arrayInput[i].name] = arrayInput[i].value; } } data["idUsuario"] = idUsuario; var xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener("readystatechange", function () { if (this.readyState === 4) { window.alert("¡Exito, cambio realizado!") console.log(this.responseText); window.location.href="../Controllers/Perfil.php"; } }); xhr.open("POST", url); xhr.setRequestHeader("Content-Type", "application/json"); xhr.send(JSON.stringify(data)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function modificarDatosUsuario(){\n //donde se mostrará lo resultados\n divResultado = document.getElementById('resultado');\n //valores de los inputs\n cu=document.formulario.curp.value;\n nom=document.formulario.Nombre.value;\n ape=document.formulario.Apellido.value;\n gra=document.formulario.Grado.value;\n gru=document.formulario.Grupo.value;\n dir=document.formulario.Direccion.value;\n tel=document.formulario.Telefono.value;\n //instanciamos el objetoAjax\n ajax=objetoAjax();\n //uso del medotod POST\n //archivo que realizará la operacion\n //reg_usuario.php\n ajax.open(\"POST\", \"mod_usuario.php\",true);\n ajax.onreadystatechange=function() {\n if (ajax.readyState==4) {\n //mostrar resultados en esta capa\n divResultado.innerHTML = ajax.responseText\n //llamar a funcion para limpiar los inputs\n //alert(\"Usuario Registrado\");\n LimpiarCamposUsuariomod();\n }\n }\n ajax.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\");\n //enviando los valores\n ajax.send(\"curp=\"+cu+\"&Nombre=\"+nom+\"&Apellido=\"+ape+\"&Grado=\"+gra+\"&Grupo=\"+gru+\"&Direccion=\"+dir+\"&Telefono=\"+tel)\n }", "function enregistrerUtilisateurs() {\n if (validerUti()){\n var request = new XMLHttpRequest();\n var jsonObj = {\n coduser: document.getElementById(\"txtutiId\").value,\n password: document.getElementById(\"txtutiNom\").value,\n nom: document.getElementById(\"txtutiPrenom\").value,\n prenom: document.getElementById(\"txtutiMotdepass\").value,\n admin: document.getElementById(\"txtutiAdmin\").value,\n inactif: document.getElementById(\"txtutiInactif\").value,\n };\n var url = \"/tusers/saveUsers\";\n request.open(\"PATCH\", url, true);\n request.onreadystatechange = function() {\n if (request.readyState === 4) {\n if (request.status === 200) {\n //bootbox.alert(\"Mise à jour réussi\");\n if (document.getElementById(\"chButiLoop\").checked) {\n ramplirtabUti();\n }\n else{ \n $('#blockUtilisateurs').modal('hide'); \n } \n loadListe();\n }\n else {bootbox.alert(\"Erreur lors de la mise à jour\");}\n }\n };\n request.setRequestHeader(\"Content-type\", \"application/json\");\n request.send(JSON.stringify(jsonObj));\n }\n}// end enregistrer", "static UpdateMyData(){\n document.getElementById(\"ErrorOfMyUserData\").innerHTML= \"\"\n let InputDataValide = true\n // selectionner et ajouter tous les input de type CoreXMyUserDataInput\n let AllData = new Object()\n let el = document.querySelectorAll('[data-Input=\"CoreXMyUserDataInput\"]')\n el.forEach(element => {\n AllData[element.name] = element.value\n })\n // verifier si le password = confirm password\n if(document.getElementById(\"Password\").value != document.getElementById(\"Confirm-Password\").value){\n InputDataValide = false\n document.getElementById(\"ErrorOfMyUserData\").innerHTML= \"Password not confirmed!\"\n }\n // Sit tout les input son valide en envoie les data\n if (InputDataValide){\n // afficher le message d'update\n document.getElementById(\"CoreXWindowUserConfigData\").innerHTML='<div class=\"CoreXActionText\" style=\"text-align: center;\">Update du user...</div>'\n document.getElementById(\"ButtonUpdateMyData\").style.display = \"none\"\n // Call delete user\n GlobalCallApiPromise(\"UpdateMyUser\", AllData).then((reponse)=>{\n CoreXWindowUserConfig.DeleteWindow()\n },(erreur)=>{\n document.getElementById(\"CoreXWindowUserConfigData\").innerHTML='<div class=\"CoreXActionText\" style=\"color:red; text-align: center;\">' + erreur + '</div>'\n })\n }\n }", "function updateUser(){\n var userupdate ={\n \"id\":document.getElementById(\"idUpdateUser\").value,\n \"fullname\":document.getElementById(\"user_full_name_modal\").value,\n \"email\":document.getElementById(\"user_email_modal\").value\n }\n\n // $.ajax({\n // url : '/admin/user/update',\n // method : 'POST',\n // dataType : 'json',\n // contentType : 'application/json; charset=utf-8',\n // data : JSON.stringify(userupdate),\n // success: function(res) {\n // if(res.status == 1){\n // sweetalert_success(res.message);\n // }else{\n // sweetalert_err(res.message);\n // }\n // },\n // error: function(request, status, error) {\n // alert(\"Not Call API\");\n // }\n // })\n}", "function mostrarUsuario(idsuscriptor){\n $(\"#idsuscriptor_usuario\").val(idsuscriptor);\n\n $.post(\"views/ajax/admin_panel.php?op=mostrarAdmin\", {\n idsuscriptor: idsuscriptor\n }, function(data, status) {\n data = JSON.parse(data);\n\n mostrarformUsuario(true);\n //Como estan definidos los campos en la base de datos\n $(\"#idusuario_suscriptor\").val(data.idusuario_suscriptor);\n $(\"#nombre_completo\").val(data.nombre_completo);\n $(\"#email\").val(data.email);\n\n });\n\n\n}", "function ActualizarUsuario(){\n var corroborado = false;\n if (CorroborarCampoUsers(corroborado)){\n //star ajax\n $.ajax({\n cache: false,\n data:{\n idUsuario: $(\"#id_usuario\").val(),//.toUpperCase(),\n Username: $(\"#username\").val(),//.toUpperCase(),\n password: $(\"#password\").val(),\n Nombres: $(\"#nombres\").val(),//.toUpperCase(),\n Apellidos:$(\"#apellidos\").val(),//.toUpperCase(),\n Direccion:$(\"#direccion\").val(),//.toUpperCase(),\n Telefono: $(\"#telefono\").val(),//.toUpperCase(),\n Email: $(\"#email\").val().toLowerCase(),\n\n },\n url: 'Php/Update_User.php',\n type: 'post',\n beforeSend: function () {\n //mensaje\n $('#actualizarCuenta').text(\"Enviando..\");\n },\n success: function (respuesta) {\n if(respuesta==2){\n location.reload();// actualizo la pagina\n }else{\n $('#actualizarCuenta').text(respuesta);\n }}\n });//the end AJAX\n }\n }", "function editarUsers(){\n\t//debugger;\n\t// variable que obtengo el arreglo donde estan guardados los usuarios\n\tvar listChamba = JSON.parse(localStorage.getItem(\"usuarios\"));\n\t// obtengo el id para poder modificar el elemento actual\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos de los usuarios\n\tfor (var i = 0; i < listChamba.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < listChamba[i].length; j++) {\n\t\t\t// pregunto que si el modificar es igual al id actual\n\t\t\tif(modificar == listChamba[i][j]){\n\t\t\t\t// si si es igual obtener id\n\t\t\t\tvar n = document.getElementById(\"numero\").value;\n\t\t\t// obtener el nombre completo\n\t\t\tvar fn = document.getElementById(\"fullName\").value;\n\t\t\t// obtener el nombre de usuario\n\t\t\tvar u = document.getElementById(\"user\").value;\n\t\t\t// obtener la contraseña\n\t\t\tvar p = document.getElementById(\"password\").value;\n\t\t\t// obtener la contraseña repetida\n\t\t\tvar pr = document.getElementById(\"password_repeat\").value;\n\t\t\t// pregunto si las contraseñas son vacias o nulas\n\t\t\tif(fn == \"\" || fn == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de nombre completo vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no, pregunto que si el nombre de usuario es vacio o nulo\n\t\t\t}else if(u == \"\" || u == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de nombre de usuario vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no \n\t\t\t}else{\n\t\t\t\t// pregunto que si nas contraseñas son iguales\n\t\t\t\tif(p == pr){\n\t\t\t\t\t// si es asi, le digo que elemento actual en la posicion 0 es igual al id\n\t\t\t\t\tlistChamba[i][j] = n;\n\t\t\t\t\t// la posicion 1 es igual al nombre completo\n\t\t\t\t\tlistChamba[i][j+1] = fn;\n\t\t\t\t\t// la posicion 2 es igual a el nombre de usuario\n\t\t\t\t\tlistChamba[i][j+2] = u;\n\t\t\t\t\t// la posicion 3 es igual a la contraseña\n\t\t\t\t\tlistChamba[i][j+3] = p;\n\t\t\t\t\t// y la posicion 4 es igual a la contraseña repetida\n\t\t\t\t\tlistChamba[i][j+4] = pr;\n\t\t\t\t\t// agrego la modificacion al localstorage\n\t\t\t\t\tlocalStorage['usuarios'] = JSON.stringify(listChamba);\n\t\t\t\t\t// muestro el mensaje para que se de cuenta el usuario que fue modificado\n\t\t\t\t\talert(\"Se Modificó correctamente\");\n\t\t\t\t\t// me voy a la tabla para corroborar que se modificó\n\t\t\t\t\tlocation.href = \"ver_usuarios.html\";\n\t\t\t\t\t// si no fuera asi\n\t\t\t\t}else{\n\t\t\t\t\t// muestro el mensaje de error porque las contraseñas son diferentes\n\t\t\t\t\talert(\"No puede modificar el usuario porque las contraseñas son diferentes\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n};\n}", "function editar(valorId) {\n\n\n var urls = \"https://jsonplaceholder.typicode.com/users/\" + valorId\n\n\n $.ajax({\n type: \"GET\",\n url: urls,\n data: \"\",\n contentType: \"application/Json; charset=utf-8\",\n dataType: 'Json',\n\n\n success: function (r) {\n\n\n // for (i in r) {\n // if (id != valorId) {\n\n // $(\"#cuerpo\").append('<tr><th scope=\"row\">'+r[i].id+'</th><td>'+r[i].name+'</td><td>'+r[i].username+'</td><td>'+r[i].email+'</td><td>'+r[i].phone+'</td><th scope=\"col\" class=\"text-primary\" id=\"\"><a href=\"javascript:pasarVariables('+r[i].id+')\">Editar</a> </th><th scope=\"col\" class=\"text-primary\"><a href=\"javascript:eliminar('+r[i].id+')\">Eliminar</a> </th></tr>')\n // }\n // id+=1;\n\n // }\n\n var idMax = r.id;\n var nombres = r.name;\n var usuarios = r.username;\n var correos = r.email;\n var telefonos = r.phone;\n\n \n $(\"#iDUsuario\").val(idMax);\n $(\"#nombres\").val(nombres);\n $(\"#usernames\").val(usuarios);\n $(\"#correos\").val(correos);\n $(\"#telefonos\").val(telefonos);\n $(\"#iDUsuario\").prop('disable', true);\n $(\"#id02\").css(\"display\", \"inline\");\n\n\n\n\n },\n error: function (r) {\n\n\n },\n failure: function (r) {\n\n }\n });\n}", "changeUserData(i) {\n // Retrieves the data from the form\n const userData = new FormData(i.target.form);\n\t// Uses the updateUser php script with the form data\n fetch('api/updateUser.php', {\n method: 'POST',\n body: userData\n }).then(res=>res.json())\n .then(data=>{\n if (data.status=='success') {\n console.log(\"User info modified\");\n } else {\n console.log(\"The user info not modified due to an error\");\n\t\t\t// Error message from the php script\n\t\t\tconsole.log(\"Error: \" + data.msg);\n }\n })\n }", "function modificarUsuarioVertodos(\n id,\n nombreusuario,\n emailusuario,\n userStatus,\n passusuario\n) {\n $(\"#nombreup2Todos\").val(nombreusuario);\n $(\"#newemailUpTodos\").val(emailusuario);\n $(\"#checkUpTodos\").val(userStatus);\n $(\"#idusuarioUpTodos\").val(id);\n $(\"#pass2UpTodos\").val(passusuario);\n}", "function modificarUsuario(\n id,\n nombreusuario,\n emailusuario,\n userStatus,\n passusuario\n) {\n $(\"#nombreup2\").val(nombreusuario);\n $(\"#newemailUp\").val(emailusuario);\n $(\"#checkUp\").val(userStatus);\n $(\"#idusuarioUp\").val(id);\n $(\"#pass2Up\").val(passusuario);\n}", "function edit_admin(){\n var name = document.getElementById(\"name2\").value;\n var email = document.getElementById(\"email2\").value;\n var phone = document.getElementById(\"phone2\").value;\n var role = document.getElementById(\"role_body2\").value;\n var user_id = document.getElementById('detail_id').innerHTML;\n\n _loading(1);\n $.post('/api/v1/edit_admin',{\n 'id_admin': userData['id'],\n 'token': userData['token'],\n 'user_id':user_id,\n 'name': name,\n 'email': email,\n 'phone': phone,\n 'role': role,\n }, function (e) {\n if(e['status'] === '00'){\n console.log(e['messages'])\n notif('success', 'Success!', e['messages']);\n\n }else{\n notif('danger', 'System Error!', e['messages']);\n }\n }).fail(function(){\n notif('danger', 'System Error!', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n _admins_list(_page);\n });\n}", "function AddUsuario(){\n var corroborado = false;\n if (CorroborarCampoUsers(corroborado)){\n //star ajax\n $.ajax({\n cache: false,\n data:{\n Username: $(\"#username\").val(), //.toUpperCase(),\n password: $(\"#password\").val(),\n Nombres: $(\"#nombres\").val(), //.toUpperCase(),\n Apellidos:$(\"#apellidos\").val(), //.toUpperCase(),\n Direccion:$(\"#direccion\").val(), //.toUpperCase(),\n Telefono: $(\"#telefono\").val(),//.toUpperCase(),\n Email: $(\"#email\").val().toLowerCase(),\n\n },\n url: 'Php/Add_Users.php',\n type: 'post',\n beforeSend: function () {\n //mensaje\n $('#mjsRegistro').text(\"Enviando..\");\n },\n success: function (respuesta) {\n if(respuesta==1){\n $('.sectionAdd').html('Tu dato se han guardado correctamente.<BR> <BR><input type=\"button\" onclick=location.reload(); value=\"Click aqui para logearte\">');\n }else{\n $('#mjsRegistro').text(respuesta);\n }}\n });//the end AJAX\n }\n }", "function updateUser(utente_id, user_nome, user_cognome, user_luogo_residenza, user_data_nascita, user_descrizione, user_numero_telefono, user_mail){\n\n $.ajax({\n url: \"php/query.php\",\n data: {\n \"command\": 'updateUser',\n \"utente_id\": utente_id,\n \"user_nome\": user_nome,\n \"user_cognome\": user_cognome,\n \"user_luogo_residenza\": user_luogo_residenza,\n \"user_data_nascita\": user_data_nascita,\n \"user_descrizione\": user_descrizione,\n \"user_numero_telefono\": user_numero_telefono,\n \"user_mail\": user_mail\n },\n cache: false,\n type: \"GET\"\n }).always(function() {\n\n var li_utente = $('li.utente[data-id=\"' + utente_id + '\"]');\n\n li_utente.attr('data-nome', user_nome);\n li_utente.attr('data-cognome', user_cognome);\n li_utente.attr('data-luogo_residenza', user_luogo_residenza);\n li_utente.attr('data-data_nascita', user_data_nascita);\n li_utente.attr('data-descrizione', window.btoa(user_descrizione) );\n li_utente.attr('data-numero_telefono', user_numero_telefono);\n li_utente.attr('data-mail', user_mail);\n\n li_utente.find('h1').html(user_nome + ' ' + user_cognome);\n\n alert('Utente modificato con successo.');\n });\n\n}", "function updateUser(){\n\t\tif(validateFormControls(\"edituser\")){\n\t\t\t$.ajax({\n\t\t\t\ttype: 'POST',\n\t\t\t\turl: \"../UserServlet\",\n\t\t\t\tdata: {\n\t\t\t\t\t\taction:'updateUser',\n\t\t\t\t\t\tusername: $('#editusername').val(),\n\t\t\t\t\t\temail: $('#editemail').val(),\n\t\t\t\t\t\tcontactno: $('#editcontactno').val(),\n\t\t\t\t\t\trole: $('#editrole').val(),\n\t\t\t\t\t\tboard:$('#editboard').val(),\n\t\t\t\t\t\tsuspended:$(\"input:radio[name='editsuspended']:checked\").val(),\n\t\t\t\t\t\t},\n\t\t\t\tsuccess: function(response) {\n\t\t\t\t\t\tif(response.status==\"success\"){\n\t\t\t\t\t\t\talert('User successfully updated');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(response.status==\"failure\") {\n\t\t\t\t\t\t\talert(response.error);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\tdataType: \"json\"\n\t\t});\n\t\t}\n\t\telse{\n\t\t\talert(\"Errors exist in form\");\n\t\t}\n\n\t}", "editarPerfil(){\n\n var idUsuario = localStorage.getItem(\"idUsuario\");\n\n let xhr = new XMLHttpRequest();\n \n /* CONFIGURAÇÕES */\n //xhr.open('GET', app.urlApi+'admin-editarPerfil.php');\n xhr.open('POST', app.urlApi+'admin-editarPerfil.php',true);\n xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n\n var params = 'idUsuario='+idUsuario+\"&token=\"+app.token;\n\n /*\n\n Então, quais são os estados possíveis de um requisição AJAX? Listaremos abaixo os estados:\n 0: requisição ainda não iniciada\n 1: conexão com o servidor estabelecida\n 2: requisição recebida\n 3: processando requisição\n 4: requisição está concluída e a resposta está pronta\n O estado 4 é o que mais nos interessa, porque é nele que temos acesso à resposta enviada pelo servidor.\n\n */\n \n xhr.onreadystatechange = () => {\n if(xhr.readyState == 4) {\n\n if(xhr.status == 200) {\n\n console.log(\"DADOS RETORNADOS EDITAR PERFIL\");\n console.log(JSON.parse(xhr.responseText));\n\n var dados = JSON.parse(xhr.responseText);\n\n if(dados.sucesso==200){\n\n $(\".placeholder\").hide(0);\n $(\".form\").fadeIn(500);\n\n $(\"#editarPerfilNome\").val(dados.dados[0].nome);\n $(\"#editarPerfilEmail\").val(dados.dados[0].email);\n $(\"#editarPerfilCelular\").val(dados.dados[0].celular);\n $(\"#editarPerfilSenha\").val(dados.dados[0].senha);\n \n // CARREGAR MASCARAS\n app.helpers.carregarMascaras();\n\n }else{\n \n aviso(\"Oops! Algo deu errado!\",\"Nossos servidores estão passando por dificuldades técnicas, tente novamente em alguns minutos.\");\n\n }\n\n\n }else{\n \n console.log(\"SEM SUCESSO editarPerfil()\");\n console.log(JSON.parse(xhr.responseText));\n\n }\n\n }\n };\n\n /* EXECUTA */\n xhr.send(params);\n\n\n }", "function fntEditUsuario(idpersona){\n\t// let btnEditUsuario = document.querySelectorAll('.btnEditUsuario');\n\t// btnEditUsuario.forEach(function(btnEditUsuario){\n\t// \tbtnEditUsuario.addEventListener('click', function(){\n\n\t\t\tdocument.querySelector('#titleModal').innerHTML = \"Actualizar Usuario\";\n\t\t\tdocument.querySelector('.modal-header').classList.replace('headerRegister', 'headerUpdate');\n\t\t\tdocument.querySelector('#btnActionForm').classList.replace('btn-primary', 'btn-info');\n\t\t\tdocument.querySelector('#btnText').innerHTML = \"Actualizar\";\n\n\t\t\t// let idpersona = this.getAttribute('us');\n\t\t\tvar idpersona = idpersona;\n\t\t\tlet request = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');\n\t\t\tlet ajaxUrl = base_url+'/Usuarios/getUsuario/'+idpersona;\n\t\t\trequest.open(\"GET\", ajaxUrl, true);\n\t\t\trequest.send();\n\t\t\trequest.onreadystatechange = function(){\n\n\t\t\t\tif (request.readyState == 4 && request.status == 200) {\n\t\t\t\t\tlet objData = JSON.parse(request.responseText);\n\n\t\t\t\t\tif (objData.status) {\n\t\t\t\t\t\tdocument.querySelector('#idUsuario').value = objData.data.idpersona;\n\t\t\t\t\t\tdocument.querySelector('#txtIdentificacion').value = objData.data.identificacion;\n\t\t\t\t\t\tdocument.querySelector('#txtNombre').value = objData.data.nombres;\n\t\t\t\t\t\tdocument.querySelector('#txtApellido').value = objData.data.apellidos;\n\t\t\t\t\t\tdocument.querySelector('#txtTelefono').value = objData.data.telefono;\n\t\t\t\t\t\tdocument.querySelector('#txtEmail').value = objData.data.email_user;\n\t\t\t\t\t\tdocument.querySelector('#listRolid').value = objData.data.idrol;\n\t\t\t\t\t\t$('#listRolid').selectpicker('render');\n\n\t\t\t\t\t\tif (objData.data.status == 1) {\n\t\t\t\t\t\t\tdocument.querySelector('#listStatus').value = 1;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tdocument.querySelector('#listStatus').value = 2;\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$('#listStatus').selectpicker('render');\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$('#modalFormUsuario').modal('show');\n\t\t\t}\n\n\n\t\t// });\n\t// });\n}", "function UpdatedUsuario(Id){\n /* Realiza conexión con el servidor */\n var vId = Id;\n var vurl = \"\";\n var vurl = \"../../datos/controller/contactosController.php\";\n if(vId != 0){\n $.ajax({\n data: {\"accion\":\"single\", \"pId\":vId},\n type: \"POST\",\n datatype: \"json\",\n url: vurl,\n })\n .done(function(data){\n if (data.success) {\n $('#modal-UpdatedUser').modal({keyboard: false});\n $(\"#txtStatusup option[value=\"+ data.Status +\"]\").attr(\"selected\",true);\n $('#txtDocup').val(data.Cedula);\n $('#txtNameup').val(data.Nombre_completo);\n $('#txtDirup').val(data.Direccion);\n $('#txtTelup').val(data.Celular);\n $('#txtEmlup').val(data.Email);\n $('#txtProgramaup').val(data.Programa);\n $('#txtComentup').val(data.Mensaje);\n $('#txtOrigenup').val(data.Origen_Campana);\n $('#txtIdup').val(vId);\n }\n })\n .fail(function(){\n alert(\"Ha ocurrido un problema\");\n });\n }\n }", "function updateUsuario(e) {\n e.preventDefault();\n var datos = new FormData(this);\n \n // Pasamos el validador\n if (!$(this).valid()) {\n return;\n }\n \n // Creamos el dialog\n var dialog = $(\"<div>¿Esta seguro de que desea Modificar este Usuario?</div>\");\n \n //////////////\n // DIALOG\n //////////////\n $(dialog).dialog({\n autoOpen: true,\n resizable: false, \n height: 150, \n modal: true, \n buttons: {\n \"Modificar\": function () {\n $.ajax({\n url: \"../../Controller/Gestion/updateUsuario.php\",\n data: datos, \n contentType: false, \n processData: false, \n type: 'POST'\n }).done(function (data) {\n var resultado = data;\n\n getListadoUsuarios(resultado);\n\n });\n $(this).dialog(\"close\");\n },\n \n \"Cancelar\": function () {\n $(this).dialog(\"close\");\n }\n }, \n close: function(){ \n $(dialog).remove();\n }\n });\n}", "function procesaModificaUsuario(){\r\n\t\r\n\tvar formulario = $('#formUpdateUser');\r\n\t\r\n\t$.ajax({\r\n url: \"actualizaUsuario\",\r\n data:$(formulario).serialize()\r\n }).then(function(data) {\r\n \t\t\r\n \tif (data.userExist){\r\n \t\tvar message = data.message;\r\n \t\tprocessMessage(message);\r\n \t}\r\n \telse{\r\n \t\t\r\n \t\tif(data.errorConexion){\r\n \t\t\t\r\n \t\t\talertaConexion()\t\r\n \t\t}\r\n \t\telse{\r\n \t\t\t\r\n \t\t\tdocument.getElementById(\"updateMessage\").style.visibility=\"visible\";\r\n \t\t$(\"#updateMessage\").text(data.message);\r\n \t\t$(\"#login\").focus();\r\n \t\t$(\"#login\").select();\r\n \t\t}\t\r\n \t}\r\n });\t\t\r\n}", "function ModificarU() {\nvar nick = $(\"#nick2\").val();\nvar nombre= $(\"#nombre2\").val();\nvar correo = $(\"#correo2\").val();\nvar nivel = $(\"#nivel2\").val();\nvar id = $(\"#hidden_usuario_id\").val();\n$.post(\"../../model/users/update.php\", {\nid:id,\nnick: nick,\nnombre:nombre,\ncorreo:correo,\nnivel:nivel\n}, \nfunction (data, status) {\nswal(\n'Usuario Modificado!',\n'correctamente!',\n'success'\n)\t\nreadRecords();\n}\n);\n$(\"#modaluserupdate .close\").click()\n}", "function modificar(){\n console.trace('Modificar');\n\n let id = document.getElementById('idForm').value;\n let nombre = document.getElementById('nombreForm').value;\n let avatar = `${document.getElementById('avatarForm').value}`;\n //let sexo = document.getElementsByName('sexoForm').value;\n let sexo = document.nombreForm.sexoForm.value;\n let persona = {\n \"id\" : id,\n \"nombre\" : nombre,\n \"avatar\" : avatar,\n \"sexo\" : sexo\n };\n\n url = endPoint + \"personas/\" + persona.id;\n ajax('PUT',url, persona)\n .then( data => {\n\n // conseguir de nuevo todos los alumnos\n url = endPoint + \"personas/?rol=1\";\n ajax(\"GET\", url, undefined) \n .then( data => {\n console.trace('promesa resolve'); \n personas = data;\n pintarLista( personas );\n limpiarSelectores();\n resetBotones();\n \n }).catch( error => {\n console.warn('promesa rejectada');\n alert(error);\n });//ajax(\"GET\", url, undefined)\n\n })\n .catch( error => {\n console.warn('promesa rejectada');\n alert('No puedes introducir dos usuarios con el mismo nombre');\n });//ajax('PUT',url, persona)\n limpiarSelectores();\n}", "function modificar_user(identidad) {\n\tcargando('Obteniedo información del usuario')\n\tenvio = { codigo: identidad }\n\t$.ajax({\n\t\tmethod: \"POST\",\n\t\turl: \"/admin-cliente/editar-cliente\",\n\t\tdata: envio\n\t}).done((datos) => {\n\t\tif (datos != 'Error') {\n\t\t\tno_cargando()\n\t\t\tasignar('txtnombre', datos.nombre)\n\t\t\tasignar('txtedad', datos.edad)\n\t\t\tasignar('txtsector', datos.sector)\n\t\t\tasignar('txtcedula', datos.cedula)\n\t\t\tasignar('txttelefono', datos.telefono)\n\t\t\tasignar('textdireccion', datos.direccion)\n\t\t\tasignar('txtmail', datos.username)\n\t\t\tvar opciones = document.getElementsByClassName('listado_referidos')\n\t\t\tfor (var i = 0; i < opciones.length; i++) {\n\t\t\t\topciones[i].removeAttribute('selected')\n\t\t\t}\n\t\t\tfor (var i = 0; i < opciones.length; i++) {\n\t\t\t\tif (datos.referido == opciones[i].value)\n\t\t\t\t\topciones[i].setAttribute('selected', '')\n\t\t\t}\n\t\t\t$('#modal-modificar-user').modal()\n\t\t} else {\n\t\t\tno_cargando()\n\t\t\tswal('Error', 'Ha ocurrido un error inesperado', 'error')\n\t\t}\n\t})\n}", "updateUserData() {\n console.log(\"Creating profile\");\n var formData = $('#user-form').serializeArray();\n var firstName = formData[0].value;\n var lastName = formData[1].value;\n var email = formData[2].value;\n var country = formData[3].value;\n var state = formData[4].value;\n var city = formData[5].value;\n var dob = formData[6].value;\n\n var newUserInfo = {firstName: firstName, lastName: lastName, email: email, country: country, state: state, city: city, dob: dob};\n\n }", "function updateUserAjaxSinImagen() {\n\n var status;\n\n if ($('#chkStatus').prop('checked')) {\n status = true;\n } else {\n status = false;\n }\n\n var obj = {\n id: $('#txtId').val(),\n nombre: $('#txtNombre').val(),\n apellido: $('#txtApellido').val(),\n telefono: $('#txtTelefono').val(),\n email: $('#txtEmail').val(),\n rol: $('#ddlRol').val(),\n status: status\n };\n\n $.ajax({\n type: \"POST\",\n url: \"frmUsuarios.aspx/ModificarUsuarioSinImagen\",\n data: JSON.stringify(obj),\n dataType: \"json\",\n contentType: 'application/json;charset=utf-8',\n error: function (xhr, ajaxOptions, thrownError) {\n console.log(xhr.status + \"\\n\" + xhr.responseText, + \"\\n\" + thrownError);\n },\n success: function (res) {\n if (res.d) {\n alertSuccess('Registro actualizado con exito');\n limpiar();\n setTimeout(function () {\n realizarPostBack();\n }, 1500);\n } else {\n alertError('No se pudo realizar la actulización');\n }\n }\n });\n }", "function updateUser(event) {\n event.preventDefault();\n\n var updateUserElement = $('#updateUser');\n var inputUserNameElement = updateUserElement.find('fieldset input#inputUserName');\n var inputUserEmailElement = updateUserElement.find('fieldset input#inputUserEmail');\n var inputUserFullNameElement = updateUserElement.find('fieldset input#inputUserFullname');\n var inputUserAgeElement = updateUserElement.find('fieldset input#inputUserAge');\n var inputUserLocationElement = updateUserElement.find('fieldset input#inputUserLocation');\n var inputUserGenderElement = updateUserElement.find('fieldset input#inputUserGender');\n\n if (inputUserNameElement.val() !== '') {\n // find user by name (first that matches). Dirty!\n // Get Index of object based on id value\n var arrayPosition = userListData.map(function (arrayItem) {\n return arrayItem.username;\n }).indexOf(inputUserNameElement.val());\n // Get out User Object\n var thisUserObject = userListData[arrayPosition];\n var updateUser = {\n '_id': thisUserObject._id,\n 'username': inputUserNameElement.val(),\n 'email': inputUserEmailElement.val(),\n 'fullname': inputUserFullNameElement.val(),\n 'age': inputUserAgeElement.val(),\n 'location': inputUserLocationElement.val(),\n 'gender': inputUserGenderElement.val()\n };\n\n $.ajax({\n type: 'PUT',\n data : updateUser,\n url : '/users/updateuser/',\n dataType : 'JSON'\n }).done(function (response) {\n\n if (response.msg === '') {\n\n // Clear the form inputs\n updateUserElement.find('fieldset input').val('');\n\n // Update the table\n populateTable();\n\n } else {\n alert('Error: ' + response.msg);\n }\n });\n\n } else {\n alert('Error: Enter User Name to update');\n }\n\n}", "function modificarDatosLibro(){\n //donde se mostrará lo resultados\n divResultado = document.getElementById('resultado');\n //valores de los inputs\n //cedula=document.cambio_libro.cedula.value;\n id=document.cambio_libro.id.value;\n co=document.cambio_libro.Codigo.value;\n tit=document.cambio_libro.Titulo.value;\n aut=document.cambio_libro.Autor.value;\n edit=document.cambio_libro.Editorial.value;\n //instanciamos el objetoAjax\n ajax=objetoAjax();\n //uso del medotod POST\n //archivo que realizará la operacion\n //reg_usuario.php\n ajax.open(\"POST\", \"mod_libro.php\",true);\n ajax.onreadystatechange=function() {\n if (ajax.readyState==4) {\n //mostrar resultados en esta capa\n divResultado.innerHTML = ajax.responseText\n //llamar a funcion para limpiar los inputs\n //alert(\"Usuario Registrado\");\n LimpiarCamposLibro();\n}\n}\n ajax.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\");\n //enviando los valores\n ajax.send(\"id=\"+id+\"&Codigo=\"+co+\"&Titulo=\"+tit+\"&Autor=\"+aut+\"&Editorial=\"+edit)\n }", "function updateStagiaire() {\n //On recupere les infos saisi par le user\n let prenom = $(\"#prenom\").val();\n let email = $(\"#email\").val();\n let ville = $(\"#ville\").val();\n let id = $(\"#id\").val();\n\n //On effectue la requete vers le server\n $.ajax({\n method: \"POST\",\n url: \"server.php\",\n data: {update: 1, prenom: prenom, email: email, ville: ville, id: id}\n }).done(function () {\n //En cas de succes, On vide les infos du formulaire\n $(\"#prenom\").val('');\n $(\"#email\").val('');\n $(\"#ville\").val('');\n\n //On appelle la fonction allStagiaires\n allStagiaires();\n });\n\n //On masque le formulaire d'insertion\n $(\"#monForm\").hide();\n}", "function getValuesFormChangeInfo() {\n \n var url = getUrlToSubmit();\n $.ajax({\n url: url+'/api/user/getInfoAd/'+idUser,\n type: 'GET',\n cache: false,\n headers: {\n \"Authorization\": 'Bearer ' + token\n },\n success: function (data) {\n $(\"#formChangeInfoName\").val(data.user.name);\n $(\"#formChangeInfoAddress\").val(data.user.address);\n $(\"#formChangeInfoZipCode\").val(data.user.zipCode);\n $(\"#formChangeInfoLocation\").val(data.user.location);\n M.updateTextFields();\n }, \n error: function (jqXHR, textStatus, err) {\n console.log(jqXHR);\n M.toast({html: 'Erro a obter os dados!'});\n }\n });\n}", "function update_UserInformation(id) {\n\n $(\"#editUserForm\").removeClass();\n if(id){\n\n // fetch Data for the hosteler with the current selected id\n $.ajax({\n url:'../../../validation/superAdmin/users/getUser_id.php',\n type : 'post',\n data :{users_id :id},\n dataType : 'json',\n success:function (response) {\n $(\"#u_id\").val(response.user_id);\n $(\"#editUsername\").val(response.username);\n $(\"#editUserMail\").val(response.email);\n $(\"#editFirstName\").val(response.firstName);\n $(\"#editLastName\").val(response.lastName);\n $(\"#editUserType\").val(response.user_type);\n $(\"#editPhoneNumber\").val(response.phone);\n\n\n // Update Data\n $(\"#editUserForm\").unbind('submit').bind('submit',function () {\n var form = $(this);\n\n //validation\n var editUsername = $(\"#editUsername\").val();\n var editUserMail = $(\"#editUserMail\").val();\n var editFirstName = $(\"#editFirstName\").val();\n var editLastName = $(\"#editLastName\").val();\n var editUserType = $(\"#editUserType\").val();\n var editPhoneNumber = $(\"#editPhoneNumber\").val();\n\n\n\n if (editFirstName && editLastName && editUsername && editUserMail && editPhoneNumber && editUserType ) {\n //submit the form to server\n $.ajax({\n url :form.attr('action'),\n type : form.attr('method'),\n data : form.serialize(),\n dataType : 'json',\n success:function (response) {\n // $(\".invalid-feedback\").removeClass('has-error');\n if(response.success === true){\n //close the modal after deleting\n $(\"#exampleModal\").modal('hide');\n\n swal({\n title: \"Success\",\n text: \"Information Update Successfully\",\n icon: \"success\",\n button:true\n });\n\n\n /* reload the database after the submission to\n * update the table\n * this is a built in function of database\n */\n usersTable.ajax.reload(false);\n\n }else{\n swal({\n title: \"warning\",\n text: \"Error! Please try again\",\n icon: \"success\",\n button:true\n });\n\n }//else\n }//success\n });//ajax submit\n }\n return false;\n })\n }// success\n });// fetch selected hosteler's data\n }else{\n alert(\"Error: Please Refresh This Page\");\n }\n}", "function z_usersEdit(id) {\r\n var usrId = id;\r\n var firstName = $(\"#new-u-name\").val();\r\n var lastName = $(\"#new-u-lastname\").val();\r\n var data = {\r\n userId: usrId,\r\n firstName: firstName,\r\n lastName: lastName\r\n };\r\n if ($(\"#editUsernameForm\").valid()) {\r\n $.ajax({\r\n url: \"/api/updateUser\",\r\n type: \"POST\",\r\n data: JSON.stringify(data),\r\n dataType: 'text',\r\n contentType: 'application/json;charset=UTF-8',\r\n success: function (result) {\r\n console.log(result);\r\n $(\"#z-vu-name\").val(firstName);\r\n $(\"#z-vu-lastname\").val(lastName);\r\n if (result.split(\":\")[1] == \"Done\") {\r\n alertPopup('success', \"User Updated Successfully\");\r\n } else {\r\n alertPopup('alert', \"Not found\");\r\n }\r\n $('#z-editUserName-popup').modal(\"hide\");\r\n },\r\n error: function (result) {\r\n console.log(result);\r\n }\r\n });\r\n }\r\n}", "function addUserAJAX(){\n\n let newUserData = {\n name: $(\"#newcashiername\").val(),\n username: $(\"#newcashierusername\").val(),\n pass: $(\"#newpassword\").val(),\n role: \"cashier\"\n }\n\n $.ajax({\n type : \"POST\",\n contentType : \"application/json\",\n url : \"newuserapi\",\n data : JSON.stringify(newUserData),\n dataType : 'json',\n success : function(result) {\n\n getUsersAjaxCall();\n },\n error : function(e) {\n alert(\"Error!\")\n console.log(\"ERROR: \", e);\n }\n });\n\n}", "function updateUser() {\n\n // Collecting the data.\n var userId = $('#userIdEdit').val();\n var firstName = $('#firstNameEdit').val();\n var lastName = $('#lastNameEdit').val();\n var age = $('#ageEdit').val();\n\n // Request Sending\n $.ajax({\n method: 'POST',\n url: './api/edit_user.php',\n data: {\n userId: userId,\n firstName: firstName,\n lastName: lastName,\n age: age\n },\n success: function(data) {\n\n // Conversion from string to JSON.\n var dataJSON = JSON.parse(data);\n\n // Get the status of the record update.\n var status = dataJSON.status;\n\n // If the record update succeed, do the following actions.\n if (status === 'success') {\n\n // Show success message to the user.\n showSuccess('User has been updated!');\n\n // Hide the modal.\n $('#editModal').modal('hide');\n\n // Do not proceed.\n return;\n }\n\n // Prompt that the operation is unsuccessful.\n showError('Something went wrong. Please try submitting the form again.');\n }\n });\n}", "function updateUserData(){\n var new_name = document.getElementById('name_change').value;\n if (new_name == \"\"){\n new_name = name;\n }\n var new_jobs = document.getElementById('jobs_change').value;\n if (new_jobs == \"\"){\n new_jobs = jobs;\n }\n var new_contact = document.getElementById('contact_change').value;\n if (new_contact == \"\"){\n new_contact = contact;\n }\n var new_tjm = document.getElementById('tjm_change').value;\n if (new_tjm == \"\"){\n new_tjm = tjm;\n }\n writeUserData(userId, new_name, new_jobs, new_contact, new_tjm);\n}", "function ajaxModificarUsuario(datos) {\n $.ajax({\n type: \"POST\",\n url: \"../controllers/perfil/perfilModificar.php\",\n data: datos,\n cache: \"false\",\n success: function (response) {\n if (response==1) {\n toastr.success(\"Datos personales modificados!\", \"Aviso!\");\n }\n }\n });\n}", "function updatePassword(e) {\n e.preventDefault();\n var datos = new FormData(this);\n\n // Pasamos el validador\n if (!$(this).valid()) {\n return;\n }\n \n // Creamos el dialog\n var dialog = $(\"<div>¿Esta seguro de que desea Modificar este Usuario?</div>\");\n \n //////////////\n // DIALOG\n //////////////\n $(dialog).dialog({\n autoOpen: true,\n resizable: false, \n height: 150, \n modal: true, \n buttons: {\n \"Modificar\": function () {\n $.ajax({\n url: \"../../Controller/Gestion/updatePassword.php\",\n data: datos, \n contentType: false, \n processData: false, \n type: 'POST'\n }).done(function (data) {\n var resultado = data;\n\n getListadoUsuarios(resultado);\n\n });\n $(this).dialog(\"close\");\n },\n \n \"Cancelar\": function () {\n $(this).dialog(\"close\");\n }\n }, \n close: function(){ \n $(dialog).remove();\n }\n });\n}", "function EditUserModal(Name, LastName, UserName, Rol, Id) {\n \n //asociamos los textbox con sus respetivos valores provenientes de la base de datos.\n document.getElementsByName('userName')[0].value = UserName;\n document.getElementsByName('name')[0].value = Name;\n document.getElementsByName('lastName')[0].value = LastName;\n document.getElementById('userType')[0].value = Rol;\n idDeleteUpdate = document.getElementsByName('idHidden')[0].value = Id;\n}", "function updateUser(e) {\n e.preventDefault();\n\n $.ajax({\n url: ' /updateuser',\n method: 'POST',\n data: $('#updateUserForm').serialize(),\n success: function (res) {\n\n // -----------------------\n // RESET FORM\n // -----------------------\n $('#updateUserForm')[0].reset();\n $('#password-strength-text-update').empty();\n\n // UPDATE THE VIEW\n $(\"#usernameUserFormUpdate\").val(res.currentUser.username);\n $(\"#emailUserFormUpdate\").val(res.currentUser.email);\n\n var str_user = JSON.stringify(res.currentUser);\n $(\"#authentication-name\").attr('value', str_user);\n $(\"#authentication-name\").text(res.currentUser.username)\n // FEEDBACK\n bootstrapAlert(res.success, \"Success\", \"success\");\n\n },\n error: function (err) {\n // console.log(err);\n var statusCode = err.responseJSON.statusCode;\n if (statusCode == 422) {\n var errorJSON = err.responseJSON.errors;\n // console.log(errorJSON);\n var e = \"\";\n for (var i = 0; i < errorJSON.length; i++) {\n e += errorJSON[i].msg + \"</br>\";\n }\n bootstrapAlert(e, \"Error\", \"danger\", false);\n } else if (statusCode == 11000) {\n var errorJSON = err.responseJSON.errors;\n // console.log(errorJSON);\n bootstrapAlert(errorJSON.name + \" - \" + errorJSON.message, \"Error\", \"danger\", false);\n }\n\n }\n });\n\n return false;\n}", "updateUser(e) {\n const dataForm = new FormData(e.target.form);\n console.log(e)\n fetch('api/updateUser.php', {\n \n method: 'POST',\n \n body: dataForm\n \n }).then(res=>res.json())\n .then(data=>{\n \n if (data.status=='success') {\n console.log(\"Success, the user info was updates\");\n } \n \n else { \n console.log(\"Something went wrong, the user info was NOT updated\");\n }\n \n })\n \n }", "function actualizarUsuario() {\n\t//console.log(\"ROL Y ID\");\n\t//console.log($(\"#rol\").val());\n\t//console.log($(\"#idUsuario\").val());\n\tconsole.log(\"idRol\");\n\tvar idRol=($('#rol').find(\":selected\").val())\n\tconsole.log(idRol)\n\tif ($(\"#actualizarUsuarioForm\").valid()){\t\n\t\t$\n\t\t\t.ajax({\n\t\t\t\tdata : {\n\t\t\t\t\t\"idEjecutivo\" : $(\"#idEjecutivo\").val(),\n\t\t\t\t\t\"nombre\" : $(\"#nombre\").val(),\n\t\t\t\t\t\"apellidoP\" : $(\"#app\").val(),\n\t\t\t\t\t\"apellidoM\" : $(\"#apm\").val(),\n\t\t\t\t\t\"username\" : $(\"#nick\").val(),\n\t\t\t\t\t\"activo\" : $(\"#estatus\").val(),\n\t\t\t\t\t\"password\" : $(\"#password\").val(),\n\t\t\t\t\t\"rol\" : $(\"#rol\").val(),\n\t\t\t\t\t\"id\" : $(\"#idUsuario\").val(),\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\tdataType : 'json',\n\t\t\t\turl : '../../mvc/usuario/modificarusuario',\n\t\t\t\ttype : 'post',\n\t\t\t\tbeforeSend : function() {\n\t\t\t\t},\n\t\t\t\tsuccess : function(response) {\n\t\t\t\t\tmensajeRedireccion(\"USUARIO ACTUALIZADO CORRECTAMENTE\",\"../usuarios/usuarios.jsp\");\n\n\n\t\t\t\t},\n\t\t\t\terror : function(response) {\n\t\t\t\t\tmensaje(\"IMPOSIBLE ACTUALIZAR EL USUARIO. CONTACTE CON EL ADMINISTRADOR.\");\n\t\t\t\t}\n\t\t\t});\n\t\t}\n}", "function getUser(id) {\n $.ajax({\n url: ip_server +\n \"/logged/getUser\",\n type: \"POST\",\n data:{\n 'bearer' : sessionStorage.token,\n 'idManagerUser' : id,\n },\n dataType: \"json\",\n success: function (response) {\n var dataSet = response.users;\n\n for (const usr of dataSet) {\n $('#mainEmailUpdate').val(usr.mainEmail);\n $('#resetEmailUpdate').val(usr.resetEmail);\n $('#nameUserUpdate').val(usr.nameUser);\n $('#addTypeUsersUpdate option[value=\"'+usr.idTypeUser+'\"]').attr(\"selected\", true);\n }\n },\n error: function (error) {\n if(error.status == '401'){\n sessionStorage.removeItem('token')\n window.location.assign(\"http://\" + window.location.hostname+\"/Smiling-camera/dashboardadmin/index.html\");\n }\n }\n });\n}", "function update(OID_USUARIO,USUARIO){\n\t\n\t/*INSERCION DE DATOS*/\n\t\n\t$(\"#txt_usuario\").val(USUARIO);\n\t\n\t$(\"#txt_usuario\").attr(\"USER\",OID_USUARIO);\n\t\n\t$(\"#btn_enviar_usuario\").text(\"Actualizar\")\n\t\t\n\t\n}//FINAL DE LA ACTUALIZACION DE UN REGISTRO", "function actualizarUsuarioTodos() {\n var configmail = $(\"#configmail\").val();\n var id = $(\"#idusuarioUpTodos\").val();\n\n // UPDATE nombre\n var nombreup2Todos = $(\"#nombreup2Todos\").val();\n if ($(\"#nombreup2Todos\").val() == \"\") {\n $(\"#nombreup2Todos\").addClass(\"is-invalid\");\n swal(\"Algo salió mal!\", \"El campo nombre es obligatorio\", \"warning\");\n $(\"#statusEmailTodos\").html(\n '<span class=\"label label-error\" style=\"color: red\">Campo obligatorio</span>'\n );\n return false;\n }\n\n // //UPDATE email\n var newemailUpTodos = $(\"#newemailUpTodos\").val();\n\n //UPDATE contraseña\n var pass2UpTodos = $(\"#pass2UpTodos\").val();\n if (pass2UpTodos == \"\") {\n swal(\n \"Validación!\",\n \"El campo contraseña es obligatorio y no debe estar vacío\",\n \"warning\"\n );\n return false;\n }\n if (\n pass2UpTodos.length == 0 ||\n pass2UpTodos.length <= 8 ||\n pass2UpTodos.length >= 35 ||\n getUppercarse(pass2UpTodos) == 0 ||\n getNumber(pass2UpTodos) == 0\n ) {\n swal(\n \"Validación\",\n \"Su contraseña debe tener entre 8 y 35 caracteres, contener letras, números y alguna letra en mayúscula.\",\n \"warning\"\n );\n return false;\n }\n\n //UPDATE checkUp\n var checkUpTodos = 0;\n if ($(\"#adminconfirmationUpTodos\").prop(\"checked\") == true) {\n checkUpTodos = 1;\n } else {\n checkUpTodos = 0;\n }\n\n checkValidMailUpTodos(\n newemailUpTodos,\n pass2UpTodos,\n nombreup2Todos,\n checkUpTodos,\n id\n );\n}", "function modif_password(){\n //mot de passe actuel, nouveau et confirmé et l'id \n var act =$(\"#act\").val();\n \n var npas =$(\"#npas\").val();\n var cpas =$(\"#cpas\").val();\n if(npas!=cpas){\n $('#alert-profil-npas').html('<span class=\"text-danger\">Mots de passe différents</span>'); \n $('#alert-profil-cpas').html('<span class=\"text-danger\">Mots de passe différents</span>'); \n }else{\n var action =\"update_pass\";\n var id = $(\"#user-id\").val();\n xhr = new XMLHttpRequest;\n xhr.responseType = 'json';\n var URL = \"ajax/users.php?action=\"+action+\"&id=\"+id+\"&pass=\"+npas;\n xhr.open(\"GET\",URL,true);\n xhr.send(null);\n xhr.onreadystatechange = result;\n function result(){\n if (this.readyState === 4 && this.status === 200) {\n var data = xhr.response;\n $('#alert4').html(data.result);\n \n $('#alert4').css('display','block');\n $(\"#act\").val();\n $(\"#cpas\").val();\n $(\"#npas\").val();\n }\n }\n }\n \n \n\n}", "function edit_user(api_url, updated_user_data) {\n $.ajax({\n url: api_url,\n type: \"PUT\",\n data: JSON.stringify(updated_user_data),\n processData:false,\n contentType: PLAINJSON\n }).done(function (data, textStatus, jqXHR){\n if (DEBUG) {\n console.log (\"RECEIVED RESPONSE: data:\",data,\"; textStatus:\",textStatus);\n }\n\n // Inform user that the user has been deleted\n alert_success(\"The user data has been successfully.\");\n\n // Reload the list of users\n getUsers();\n\n }).fail(function (jqXHR, textStatus, errorThrown){\n if (DEBUG) {\n console.log (\"RECEIVED ERROR: textStatus:\",textStatus, \";error:\",errorThrown);\n }\n\n // Inform the user that user has NOT been deleted\n alert_error(\"Error while trying to update the user data.\");\n });\n}", "function carga_usuario(id_usuario){\n\n\t console.log(\"Carga el usuario \"+id_usuario);\n\n\t $.ajax({\n\t url: '../controller/ajaxController12.php',\n\t data: \"pkID=\"+id_usuario+\"&tipo=consultar&nom_tabla=usuarios\",\n\t })\n\t .done(function(data) {\n\t \t/**/\n\t $.each(data.mensaje[0], function( key, value ) {\n\t console.log(key+\"--\"+value);\n\t $(\"#\"+key).val(value);\n\t });\n\n\t crea_cambia_pass();\n\t })\n\t .fail(function() {\n\t console.log(\"error\");\n\t })\n\t .always(function() {\n\t console.log(\"complete\");\n\t });\n\n }", "function cargarUsuario(perfil) {\n \n var pagina = \"./leer_usuarios.php\";\n var usuario = {perfil: perfil}; \n \n $.ajax({\n type: 'POST',\n url: pagina,\n dataType: \"text\",\n data: { usuario: usuario }\n })\n .then( function (objJson) { \n \n var user = JSON.parse(objJson);\n\n $(\"#email\").val(user.mail);\n $(\"#password\").val(user.contrasena);\n Login(); \n \n }, function (jqXHR, textStatus, errorThrown) {\n alert(jqXHR.responseText + \"\\n\" + textStatus + \"\\n\" + errorThrown);\n });\n\n}", "function users_Set_FormData(data)\r\n{\r\n\t$(\"#users_departmentId\").val(data.departmentId);\r\n\tusers_returnEmployeeListAndProgramListByDepartmentId();\r\n\t$(\"#users_roleId\").val(data.role);\r\n\t$(\"#users_userId\").val(data.userId);\r\n\t$(\"#users_username\").val(data.username);\r\n\t$(\"#users_oldUsername\").val(data.username);\r\n\t$(\"#users_fullName\").val(data.fullName);\r\n\t$(\"#users_Email\").val(data.email);\r\n\t$(\"#users_password\").val(data.password);\r\n\tif(data.isActive)\r\n\t{\r\n\t\t$(\"#users_status\").val(\"true\");\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$(\"#users_status\").val(\"false\");\r\n\t}\r\n\t\r\n\t$(\"#users_employee\").val(data.employeeId);\r\n\t$(\"#users_campusId\").val(data.campusesId);\r\n\t$(\"#users_programId\").val(data.programId);\r\n\tusers_changeRole();\r\n\tpageAniamateScroll();\r\n}", "function Mostrar(id) {\n$(\"#hidden_usuario_id\").val(id);\n$.post(\"../../model/users/unique_info.php\", {\nid: id\n},\nfunction (data, status) {\nvar dato = JSON.parse(data);\n$(\"#nick2\").val(dato.nick);\n$(\"#nombre2\").val(dato.nombre_usuario);\n$(\"#correo2\").val(dato.correo_usuario);\n$(\"#nivel2\").val(dato.nivel);\n}\n);\n$(\"#modaluserupdate\").modal(\"show\");\n}", "function login_user() {\n\n var value_login_email = document.getElementById('login_email').value;\n var value_login_num_afiliacion = document.getElementById('login_num_afiliacion').value;\n\n if (value_login_email && value_login_num_afiliacion) {\n\n var objUsuario = Usuario(value_login_email, value_login_num_afiliacion);\n\n var objUsuario_json = JSON.stringify(objUsuario); \n \n objAjax = AJAXCrearObj();\n objAjax.open('GET', './php/login_usuario.php?objUsuario_json='+objUsuario_json, true); // llamamos al php\n objAjax.send();\n objAjax.onreadystatechange=responder_login_user;\n\n } else {\n\n alert(\"Rellene todos los campos\");\n }\n}", "update(form) {\n // subscripcion al servicio de usuario para enviar los datos a editar\n this.userService.updateCommons(this.user).subscribe(response => {\n if (response.User && response.User._id) {\n this.status = true;\n form.reset();\n this.launchAlert('success', 'Se ha Editado el Usuario!', null, null, false, 1500, null, 'top', 'row', true);\n this.onEdit = null;\n }\n else {\n console.log(response);\n this.launchAlert('error', 'No se ha podido editar el Usuario!', null, null, false, 1500, null, 'top', 'row', true);\n }\n }, error => {\n console.log(error);\n this.launchAlert('error', 'No se ha podido editar el Usuario!', error.error.Message, null, false, 1500, null, 'top', 'row', true);\n });\n }", "function editASingleUser(userID){\r\n var newUserID = document.getElementById(\"userID\").value;\r\n var userEmail = document.getElementById(\"userEmail\").value;\r\n var userFirstName = document.getElementById(\"userFirstName\").value;\r\n var userLastName = document.getElementById(\"userLastName\").value;\r\n var userAvatar = document.getElementById(\"userAvatarEdit\").value;\r\n\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(\"PUT\",\"api/users/\" + String(userID), true);\r\n xhr.onload = function() {\r\n if (xhr.readyState === 4 && xhr.status >= 200 && xhr.status < 300) {\r\n JSON.parse(xhr.responseText);\r\n }\r\n else {\r\n alert(\"Error \" + xhr.status);\r\n }\r\n };\r\n xhr.setRequestHeader('Content-Type', 'application/json');\r\n try {\r\n xhr.send(JSON.stringify({\"id\": newUserID, \"email\": userEmail, \"first_name\": userFirstName, \"last_name\": userLastName, \"avatar\": userAvatar}));\r\n }\r\n catch (error) {\r\n alert.error(\"Cannot edit user ID\");\r\n }\r\n\r\n\r\n}", "function addUsuario(e) {\n e.preventDefault();\n \n // Pasamos el validador\n if (!$(this).valid()) {\n return;\n }\n \n var datos = new FormData(this);\n\n $.ajax({\n url: \"../../Controller/Gestion/addUsuario.php\",\n data: datos, \n contentType: false, \n processData: false, \n type: 'POST'\n }).done(function (data) {\n var resultado = data;\n\n getListadoUsuarios(resultado);\n \n });\n}", "function load_update_user_data() {\n $('#email').val(userObj.email);\n $('#name').val(userObj.name);\n}", "function editUserField(data) {\n var employeeDetails = getStorage();\n employeeDetails.forEach(function (user, index) {\n if (user.employeeId == data) {\n employeeId.value = user.employeeId;\n firstName.value = user.firstName;\n lastName.value = user.lastName;\n address.value = user.address;\n emailId.value = user.emailId;\n updateBtn.style.display = \"block\";\n submitBtn.style.display = \"none\";\n position = index;\n }\n });\n}", "function editUser(correo) {\n let userXhr = new XMLHttpRequest();\n userXhr.open(\"GET\", `${baseUrl}users/${correo}/`);\n userXhr.setRequestHeader('x-auth', localStorage.getItem(\"dasw-x-auth\"));\n userXhr.setRequestHeader('x-user-token', localStorage.getItem(\"user-token\"));\n userXhr.send();\n userXhr.onload = function() {\n if(userXhr.status != 200) {\n alert(userXhr.status + ': ' + userXhr.statusText + ' ' + userXhr.responseText);\n } else {\n userObj = JSON.parse(userXhr.responseText);\n document.getElementById(\"editForm\").addEventListener(\"submit\", updateUser);\n updateEditModal();\n \n \n }\n\n }\n}", "function muestraDatosUsuario(datos){\n\tconsole.log(\"datos\");\n\tvar data=eval(datos);\n\t$(\"#nombre\").val(data.nombre);\n\t$(\"#app\").val(data.apellidoP);\n\t$(\"#apm\").val(data.apellidoM);\n\t$(\"#nick\").val(data.username);\n\t$(\"#estatus\").val(data.activo);\n\t$(\"#password\").val(data.password);\n\tconsole.log(data)\n\t$(\"#rol\").val(data.rol);\n\t$(\"#idUsuario\").val(data.id);\n\t$(\"#idEjecutivo\").val(data.idEjecutivo);\n}", "function altaUsuario() {\n if (validarCampos()) { //Primero comprobamos que los campos no estan vacios\n $(this).toggleClass('active'); //Activamos el spinner \n \n //Obtenemos los valores de los campos que queremos enviar\n var usuario = document.getElementById('usuario').value;\n var password = document.getElementById('password').value;\n\n //Creamos una variable con formato JSON\n var usuarioJSON = {\"usuario\": usuario, \"password\": password};\n //Creamos un objeto para almacenar los valores\n var operacion = new FormData();\n operacion.append('operacion', 'altaUsuario');\n operacion.append('usuario', JSON.stringify(usuarioJSON));\n\n //Creamos la solicitud AJAX\n //Especificamos la action a ejecutar\n var url = \"OperacionesUsuario\";\n var solicitud = new XMLHttpRequest();\n solicitud.addEventListener('load', mostrar);\n solicitud.open('POST', url, true);\n solicitud.send(operacion); \n }\n}", "function registroRegistrarseHandler() {\n let nombreIngresado = $(\"#txtRegistroNombre\").val();\n let apellidoIngresado = $(\"#txtRegistroApellido\").val();\n let direccionIngresada = $(\"#txtRegistroDireccion\").val();\n let emailIngresado = $(\"#txtRegistroEmail\").val();\n let passwordIngresado = $(\"#txtRegistroPassword\").val();\n let passwordIngresado2 = $(\"#txtRegistroRepPassword\").val();\n const opciones = { title: 'Error' };\n if (validarCorreo(emailIngresado)) {\n if (passwordIngresado === passwordIngresado2) {\n if (validarPassword(passwordIngresado)) {\n if (validarNombre(nombreIngresado)) {\n if (validarApellido(apellidoIngresado)) {\n if (validarDireccion(direccionIngresada)) {\n //Guardamos los datos del usuario en un objeto llamado datosUsuario,m que luego lo pasamos por string a la llamada ajax\n const datosUsuario = {\n nombre: nombreIngresado,\n apellido: apellidoIngresado,\n email: emailIngresado,\n direccion: direccionIngresada,\n password: passwordIngresado\n };\n\n $.ajax({\n type: 'POST',\n url: urlBase + 'usuarios',\n contentType: \"application/json\",\n data: JSON.stringify(datosUsuario),\n // Ya que lo que debemos ejecutar es tan simple, lo hacemos en una funcion anonima.\n success: function () {\n ons.notification.alert(\"El usuario ha sido creado correctamente\", { title: 'Aviso!' });\n navegar('login', true);\n },\n error: errorCallback\n });\n } else {\n ons.notification.alert('La dirección debe contener un nombre de calle y un numero de puerta', opciones);\n }\n } else {\n ons.notification.alert('El apellido no puede estar vacío o contener un solo caracter', opciones);\n }\n } else {\n ons.notification.alert('El nombre no puede estar vacío o contener un solo caracter', opciones);\n }\n } else {\n ons.notification.alert('La contraseña debe tener al menos 8 caracteres', opciones);\n }\n } else {\n ons.notification.alert('Los passwords no coinciden', opciones);\n }\n } else {\n ons.notification.alert('El formato del correo no es válido', opciones);\n }\n}", "function agregarRegistro(registro) {\n $.ajax({\n type: 'POST',\n url: '/api/users/api-users.php?accion=agregar',\n data: registro,\n success: function(msg) {\n tabla1.ajax.reload();\n },\n error: function() {\n alert(\"Hay un problema\");\n }\n });\n}", "function registrar(idBoton,idPasado){\r\n\r\n\tajax2=objetoAjax();\r\n\tif (idBoton == 1) {\r\n\r\n\t\tnomusu = document.getElementById('nomusu').value;\r\n\t\t\t\t\r\n\t\tajax2.open(\"POST\", \"../procesa/update_user.proc.php\", true);\r\n\t\tajax2.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\");\r\n\t\tajax2.send(\"idusu=\"+idPasado+\"&nomusu=\"+nomusu);\r\n\r\n\r\n\t}else{\r\n\t\tif (idBoton == 2) {\r\n\r\n\t\t\tfecursa = document.getElementById('fecursa').value;\r\n\t\t\thocursa = document.getElementById('hocursa').value;\r\n\t\t\trecursa = document.getElementById('recursa').value;\r\n\t\t\taccursa = document.getElementById('accursa').value;\r\n\r\n\t\t\tajax2.open(\"POST\", \"../procesa/update_cursa.proc.php\", true);\r\n\t\t\tajax2.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\");\r\n\t\t\tajax2.send(\"idcursa=\"+idPasado+\"&fecursa=\"+fecursa+\"&hocursa=\"+hocursa+\"&recursa=\"+recursa+\"&accursa=\"+accursa);\r\n\r\n\t\t} else {\r\n\t\t\tif (idBoton == 3) {\r\n\r\n\t\t\t\tnombre = document.getElementById('nompart').value;\r\n\t\t\t\tapellido = document.getElementById('apepart').value;\r\n\t\t\t\tsexo = document.getElementById('separt').value;\r\n\t\t\t\tedad = document.getElementById('edpart').value;\r\n\t\t\t\tdiscapacidad = document.getElementById('dispart').value;\r\n\r\n\t\t\t\tajax2.open(\"POST\", \"../procesa/update_parti.proc.php\", true);\r\n\t\t\t\tajax2.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\");\r\n\t\t\t\tajax2.send(\"id=\"+idPasado+\"&nompart=\"+nombre+\"&apepart=\"+apellido+\"&separt=\"+sexo+\"&edpart=\"+edad+\"&dispart=\"+discapacidad);\r\n\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\tif (idBoton == 4) {\r\n\r\n\t\t\t\t\tnombre_categoria = document.getElementById('nombre_categoria').value;\r\n\t\t\t\t\tedad_min = document.getElementById('edad_min').value;\r\n\t\t\t\t\tedad_max = document.getElementById('edad_max').value;\r\n\r\n\t\t\t\t\tajax2.open(\"POST\", \"../procesa/update_categoria.proc.php\", true);\r\n\t\t\t\t\tajax2.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\");\r\n\t\t\t\t\tajax2.send(\"id_categoria=\"+idPasado+\"&nombre_categoria=\"+nombre_categoria+\"&edad_min=\"+edad_min+\"&edad_max=\"+edad_max);\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tajax2.onreadystatechange=function() {\r\n\t\t\r\n\t\tif (ajax2.readyState==4) {\r\n\t\t\t\r\n\t\t\tif (idBoton == 1) {\r\n\t\t\t\tconsultar(idBoton);\r\n\t\t\t\t\t\tvar bodyid = document.getElementById('bodyid');\r\n\t\t\t\t\t\tbodyid.className = \"body-admin\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar modalEditar = document.getElementById('ModalEditar');\r\n\t\t\t\t\t\tmodalEditar.style = \"\";\r\n\t\t\t\t\t\tmodalEditar.className = \"modal fade\";\r\n\t\t\t\t\t\tmodalEditar.setAttribute('aria-hidden', 'true');\r\n\t\t\t\t\t\tmodalEditar.setAttribute('aria-modal', '');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar divmierda = document.getElementsByClassName('modal-backdrop fade show');\r\n\t\t\t\t\t\tdivmierda[0].className = \"hola\";\r\n\t\t\t}else{\r\n\t\t\t\tif (idBoton == 2) {\r\n\t\t\t\t\tconsultar(idBoton);\r\n\t\t\t\t\t\tvar bodyid = document.getElementById('bodyid');\r\n\t\t\t\t\t\tbodyid.className = \"body-admin\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar modalEditar = document.getElementById('ModalEditar');\r\n\t\t\t\t\t\tmodalEditar.style = \"\";\r\n\t\t\t\t\t\tmodalEditar.className = \"modal fade\";\r\n\t\t\t\t\t\tmodalEditar.setAttribute('aria-hidden', 'true');\r\n\t\t\t\t\t\tmodalEditar.setAttribute('aria-modal', '');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar divmierda = document.getElementsByClassName('modal-backdrop fade show');\r\n\t\t\t\t\t\tdivmierda[0].className = \"hola\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (idBoton == 3) {\r\n\t\t\t\t\t\tconsultar(idBoton);\r\n\t\t\t\t\t\tvar bodyid = document.getElementById('bodyid');\r\n\t\t\t\t\t\tbodyid.className = \"body-admin\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar modalEditar = document.getElementById('ModalEditar');\r\n\t\t\t\t\t\tmodalEditar.style = \"\";\r\n\t\t\t\t\t\tmodalEditar.className = \"modal fade\";\r\n\t\t\t\t\t\tmodalEditar.setAttribute('aria-hidden', 'true');\r\n\t\t\t\t\t\tmodalEditar.setAttribute('aria-modal', '');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar divmierda = document.getElementsByClassName('modal-backdrop fade show');\r\n\t\t\t\t\t\tdivmierda[0].className = \"hola\";\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (idBoton == 4) {\r\n\t\t\t\t\t\t\tconsultar(idBoton);\r\n\t\t\t\t\t\t\tvar bodyid = document.getElementById('bodyid');\r\n\t\t\t\t\t\t\tbodyid.className = \"body-admin\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar modalEditar = document.getElementById('ModalEditar');\r\n\t\t\t\t\t\t\tmodalEditar.style = \"\";\r\n\t\t\t\t\t\t\tmodalEditar.className = \"modal fade\";\r\n\t\t\t\t\t\t\tmodalEditar.setAttribute('aria-hidden', 'true');\r\n\t\t\t\t\t\t\tmodalEditar.setAttribute('aria-modal', '');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar divmierda = document.getElementsByClassName('modal-backdrop fade show');\r\n\t\t\t\t\t\t\tdivmierda[0].className = \"hola\";\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\r\n\r\n\t\t\r\n\t}\r\n\t\r\n}", "function save_edit_user(){\r\n $('#myModal2 .modal-footer').on('click','#save_pac_edit',function(){\r\n \r\n $id = $('#myModal2 #identificacion').val(); \r\n $nomb = $('#myModal2 #nombres').val(); \r\n $ape1 = $('#myModal2 #apellido1').val(); \r\n $ape2 = $('#myModal2 #apellido2').val();\r\n $email = $('#myModal2 #email').val(); \r\n $f_nac = $('#myModal2 #fecha_na').val(); \r\n $direccion = $('#myModal2 #direccion').val(); \r\n $sexo = $('input:radio[name=Genero]:checked').val();\r\n $phone = $('#myModal2 #telefono').val(); \r\n\r\n $.ajax({\r\n url: 'php/consults.php',\r\n type: 'POST',\r\n data: {upd_user:1, id:$id,nomb:$nomb,ape1:$ape1,ape2:$ape2,email:$email,f_nac:$f_nac,direccion:$direccion,sexo:$sexo,phone:$phone},\r\n beforeSend:function(){\r\n\r\n },\r\n success:function(html){\r\n console.log(html)\r\n $resul=html;\r\n if ($resul == 9) {\r\n listarC();\r\n $('#myModal2 #cancel_act_pac').click(); \r\n $('div.pac_msj2').html(\"\");\r\n }else{\r\n $('div.pac_msj2').html(\"<div class='alert alert-danger'><h2>ERROR, Los datos no se han actualizado o no se han realizado cambios</h2></div>\");\r\n }\r\n },\r\n error:function(html){\r\n\r\n }\r\n }) \r\n\r\n });\r\n}", "function editarsitio(sitio_rtn){\n var url = \"?action=adminsitio\"\n $.ajax({\n url: url,\n type: 'POST', //metodo de la peticion\n dataType: 'json',//tipo de dato de la respuesta\n data: {rtn_sitio: sitio_rtn,function:\"consultar\"},\n success: function(respuesta){\n if (respuesta.data) {\n $(\"input[name=id_editar]\").val(respuesta.data.id_sitio);\n $(\"input[name=nombre_editar]\").val(respuesta.data.nombre_sitio);\n $(\"input[name=rtn_editar]\").val(respuesta.data.rtn);\n $(\"select[name=tipos_editar]\").val(respuesta.data.tipo_id);\n $(\"input[name=fecha_editar]\").val(respuesta.data.fecha_otorgamiento_rtn);\n $(\"input[name=rif_editar]\").val(respuesta.data.rif);\n $(\"input[name=telefono_editar]\").val(respuesta.data.telefono_sitio);\n $(\"input[name=correo_editar]\").val(respuesta.data.email);\n $(\"input[name=facebook_editar]\").val(respuesta.data.facebook);\n $(\"input[name=instagram_editar]\").val(respuesta.data.instagram);\n $(\"input[name=web_editar]\").val(respuesta.data.sitioweb);\n $(\"input[name=licencia_editar]\").val(respuesta.data.num_licencia);\n $(\"input[name=latitud_editar]\").val(respuesta.data.latitud);\n $(\"input[name=longitud_editar]\").val(respuesta.data.longitud);\n $(\"select[name=estado_editar]\").val(respuesta.data.estado_id);\n $(\"select[name=estatus_editar]\").val(respuesta.data.estatus);\n $(\"input[name=habitacion_editar]\").val(respuesta.data.num_habitacion);\n $(\"input[name=licencia_editar]\").val(respuesta.data.num_licencia);\n $(\"input[name=direccion_editar]\").val(respuesta.data.direccion_sitio);\n $(\"textarea[name=descripcion_editar]\").val(respuesta.data.descripcion);\n\n var estado_id=respuesta.data.estado_id\n ciudades(estado_id, $(\".ciudades_editar\"), respuesta.data.ciudad_id );\n $('#modal-modificar').modal(\"show\")\n }else{\n alert(\"error\")\n }\n },\n error: function() {\n console.log(\"No se ha podido obtener la información\");\n }\n })\n}", "function updateInf(){\r\n var error = 0;\r\n if(searchStorage('email', 'users', 'Inf') > 1 || document.getElementById('emailInf').value == \"\"){\r\n if(document.getElementById('emailInf').value != \"\"){\r\n alert(\"Cuenta ya registrada con ese correo. Inténtelo de nuevo con otra cuenta de correo\");\r\n }\r\n else{\r\n alert(\"Campo Email no válido\");\r\n }\r\n error++;\r\n }\r\n \r\n if(error == 0){\r\n var data = [], glbVars = [];\r\n data = JSON.parse(localStorage.getItem('users'));\r\n glbVars = JSON.parse(localStorage.getItem('globalVariables'));\r\n\r\n for(var i=0; i < data.length; i++){\r\n if(data[i].username == glbVars.user){\r\n\r\n data[i].name = document.getElementById('nameInf').value;\r\n data[i].surname = document.getElementById('surnameInf').value;\r\n data[i].email = document.getElementById('emailInf').value;\r\n data[i].address = document.getElementById('addressInf').value;\r\n data[i].phone = document.getElementById('phoneInf').value;\r\n data[i].birthdate = document.getElementById('birthdateInf').value;\r\n \r\n localStorage.setItem('users', JSON.stringify(data));\r\n alert(\"Actualizado con éxito\");\r\n i = data.length;\r\n }\r\n }\r\n }\r\n}", "function enviarUsuario()\n{\n\n var name = $('#name').val();\n var email = $('#email').val();\n var password = $('#password').val();\n var password_confirm = $('#password-confirm').val();\n var tipoUsuario = $('#tipoUsuario').val();\n\n var token = $('#token').val();\n\n $.ajax({\n url: url+'/home/usuarios',\n headers: {'X-CSRF-TOKEN':token},\n type: 'POST',\n dataType: 'json',\n data:{name: name, email: email, password: password, passwordConfirm: password_confirm,idtipoUsuario: tipoUsuario},\n\n success:function(response)\n {\n console.log(response);\n switch(response['mensaje'])\n {\n case \"creado\":\n getSuccess(\"El Usuario fue creado correctamente!!!\");\n newUser();\n break;\n\n case \"duplicado\":\n getDanger(\"ERROR, El Email: '\"+response['email']+\"'' ya esta Registrado\");\n document.getElementById('email').focus();\n break;\n\n case \"noUsuario\":\n getDanger(\"Dedes elegir un tipo de Usuario!!!\");\n document.getElementById('tipoUsuario').focus();\n break;\n\n case \"passwordNoCoincide\":\n getDanger(\"Las contraseñas no coinciden, por favor vuelva a confirmar la contraseña\");\n $('#password-confirm').val('');\n document.getElementById('password-confirm').focus();\n break;\n\n default:\n getDanger(\"ERROR al crear el Nuevo Usuario :(\");\n break;\n }\n }\n });\n}", "function insertDataArray(objectUser, url) {\n\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: url,\n contentType: \"application/json; charset=utf-8\",\n\t\t\ttraditional: true,\n\t\t data: JSON.stringify(objectUser),\n\t\t\tsuccess: function (msg) {\n\t\t\t\tif(msg){\n\t\t\t\t\tconsole.log(\"objeto ingresado en BD suscriptores\");\n\t\t\t\t\tconsole.log(objectUser);\n\t\t\t\t\talert(\"Se ingreso la info correctamente\");\n\t\t\t\t}else{\n\t\t\t\t\tconsole.log(\"error \"+ msg);\n\t\t\t alert(\"No fue posible regitrarlo en el portal !\");\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function (msg) {\n\t\t\t \n\t\t\t\talert(msg.error());\n\t\t\t}\n\t\t});\n\n }", "function onSubmitEditUser(e) {\r\n e.preventDefault();\r\n fetch(`https://contact-list-phase2-app.herokuapp.com/users/${id}`, {\r\n method: \"PATCH\",\r\n headers: {\r\n Accept: \"application/json\",\r\n \"content-Type\": \"application/json\",\r\n },\r\n body: JSON.stringify(formData),\r\n })\r\n .then((res) => res.json())\r\n .then((userData) => {\r\n setFormData(userData);\r\n });\r\n }", "function actualizarUsuario(ptipoID, pid, pnombreUsuario, pnombre1, pnombre2, papellido1, papellido2, pcorreo, pfechaNacimiento, pedad, pimgPerfil) {\n let respuesta = '';\n let peticion = $.ajax({\n url: 'http://localhost:4000/api/actualizar_usuario',\n type: 'POST',\n contentType: 'application/x-www-form-urlencoded; charset=utf-8',\n dataType: 'json',\n async: false,\n data: {\n // rolUsuario: prolUsuario,\n tipoId: ptipoID,\n id: pid,\n nombreUsuario: pnombreUsuario,\n nombre1: pnombre1,\n nombre2: pnombre2,\n apellido1: papellido1,\n apellido2: papellido2,\n correo: pcorreo,\n fechaNacimiento: pfechaNacimiento,\n edad: pedad,\n imgPerfil: pimgPerfil\n }\n });\n\n peticion.done(function (response) {\n respuesta = response;\n });\n\n peticion.fail(function (response) {\n respuesta = response;\n });\n\n return respuesta;\n}", "function validarCampos6 () {\n\tif (!vacio($(\"#usu_nombre\").val(), $(\"#usu_nombre\").attr(\"placeholder\"))) {\n\t\tif (!vacio($(\"#usu_email\").val(), $(\"#usu_email\").attr(\"placeholder\"))) {\n\t\t\tif (correoValido($(\"#usu_email\").val())) {\n\t\t\t\tvar continua = true;\n\t\t\t\tvar id = parseInt($(\"#idUsuario\").val());\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (!isVacio($(\"#usu_FBid\").val())) {\n\t\t\t\t\tcontinua = false;\n\t\t\t\t\t\n\t\t\t\t\tif (entero($(\"#usu_FBid\").val(), $(\"#usu_FBid\").attr(\"placeholder\"))) {\n\t\t\t\t\t\tcontinua = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (continua) {\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\turl: \"lib_php/updUsuario.php\",\n\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tid: id,\n\t\t\t\t\t\t\tvalidarEmail: 1,\n\t\t\t\t\t\t\temail: $(\"#usu_email\").val()\n\t\t\t\t\t\t}\n\t\t\t\t\t}).always(function(respuesta_json) {\n\t\t\t\t\t\tif (respuesta_json.isExito == 1) {\n\t\t\t\t\t\t\tif (!isVacio($(\"#usu_FBid\").val())) {\n\t\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\t\turl: \"lib_php/updUsuario.php\",\n\t\t\t\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\t\tid: id,\n\t\t\t\t\t\t\t\t\t\tvalidarFBid: 1,\n\t\t\t\t\t\t\t\t\t\tFBid: $(\"#usu_FBid\").val()\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}).always(function(respuesta_json2){\n\t\t\t\t\t\t\t\t\tif (respuesta_json2.isExito == 1) {\n\t\t\t\t\t\t\t\t\t\tsaveUsuario();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\talert(respuesta_json2.mensaje);\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tsaveUsuario();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\talert(respuesta_json.mensaje);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function enviar() {\n if (validar()) {\n //Se envia la información por ajax\n $.ajax({\n url: 'UsuarioServlet',\n data: {\n accion: $(\"#usuarioAction\").val(),\n id: $(\"#idUsuario\").val(),\n nombre: $(\"#nom\").val(),\n apellidos: $(\"#ape\").val(),\n fechaNacimiento: $(\"#ano\").data('date'),\n correo: $(\"#email\").val(),\n direccion: $(\"#dir\").val(),\n telefono: $(\"#tel\").val(),\n celular: $(\"#cel\").val(),\n password: $(\"#pass\").val()\n },\n error: function () { //si existe un error en la respuesta del ajax\n mostrarMensaje(\"alert alert-danger\", \"Se genero un error, contacte al administrador (Error del ajax)\", \"Error!\");\n },\n success: function (data) { //si todo esta correcto en la respuesta del ajax, la respuesta queda en el data\n var respuestaTxt = data.substring(2);\n var tipoRespuesta = data.substring(0, 2);\n if (tipoRespuesta === \"C~\") {\n mostrarMensaje(\"alert alert-success\", respuestaTxt, \"Correcto!\");\n //$(\"#myModalFormulario\").modal(\"hide\");\n // consultarPersonas();\n } else {\n if(tipoRespuesta === \"P~\"){\n mostrarMensaje(\"alert alert-danger\", \"Ya existe un usuario con este número de cédula\", \"Error!\");\n $(\"#idUsuario\").addClass(\"has-error\");\n } \n else if (tipoRespuesta === \"E~\") {\n mostrarMensaje(\"alert alert-danger\", respuestaTxt, \"Error!\");\n } \n \n else {\n mostrarMensaje(\"alert alert-danger\", \"Se generó un error, contacte al administrador\", \"Error!\");\n }\n }\n\n },\n type: 'POST'\n });\n } else {\n mostrarMensaje(\"alert alert-danger\", \"Debe digitar los campos del formulario\", \"Error!\");\n }\n}", "updateList(e) {\n PersonaService.getTiposUser(e.target.value).then(data => this.setState({ Usuarios: data }))\n }", "function editarRegistro(datos, id_Reg, tipo) {\n const cantidad = Number(document.getElementById('cantidad').value);\n const ost = document.getElementById('ost').value;\n const siga = document.getElementById('siga').value;\n const servicio = document.getElementById('servicio').value;\n const detalle = document.getElementById('observaciones').value;\n const idRegistrador = document.getElementById('idRegistrador').value;\n const pesoTotal = document.getElementById('total').innerHTML;\n const nuevoIdAct = document.getElementById('ddlActividades').value;\n\n if(cantidad === ''){\n mostrarMensaje('error', 'Debe indicar una cantidad');\n document.getElementById(\"cantidad\").focus();\n } else if(cantidad === 0){\n mostrarMensaje('error', 'La cantidad no puede ser igual a 0');\n document.getElementById(\"cantidad\").focus();\n }else {\n Swal.fire({\n title: '¿Está seguro?',\n text: 'Se editará el consecutivo ' + (id_Reg.length === 1 ? datos.consecutivo : datos.consecutivo + ' y sus asociados'),\n icon: 'warning',\n showCancelButton: true,\n confirmButtonColor: '#3085d6',\n cancelButtonColor: '#d33',\n confirmButtonText: 'Si, editarlo'\n }).then((result) => {\n if (result.value) {\n // Se definen los datos que se van a enviar al fetch\n const data = new FormData();\n data.append('id_Reg', id_Reg);\n data.append('ost', ost);\n data.append('siga', siga);\n data.append('numServicio', servicio);\n data.append('cantidad', cantidad);\n data.append('pesoTotal', pesoTotal);\n data.append('observaciones', detalle);\n data.append('idRegistrador', idRegistrador);\n data.append('nuevoIdAct', nuevoIdAct);\n data.append('tipo', tipo);\n\n // Conexión del fetch al archivo php\n fetch('inc/modelos/modelo-registro.php', {\n method: 'POST',\n body: data\n })\n .then(respuestaExitosa) // Respuesta exitosa llama la función\n .catch(mostrarError); // Respuesta negativa llama la función\n\n // Si la ejecución del AJAX es correcta se verifica la respuesta\n function respuestaExitosa(response){\n if(response.ok) { // Si la respuesta en ok se llama la función para mostrar los resultados\n response.json().then(mostrarResultado);\n } else { // Si la respuesta no es ok se muestra el error\n mostrarError('status code: ' + response.status);\n }\n }\n\n // Se muestran los resultados devueltos en el JSON\n function mostrarResultado(respuesta){\n \n // Si la respuesta es correcta\n if(respuesta.estado === 'correcto') { \n mostrarMensaje('success', 'Modificación de Registro Exitoso') ; \n \n // Se oculta el modal de cierre de registro\n $('#modalAccionesReg').modal('hide');\n \n // Se actualiza la tabla\n var table = $('#tablaRegistros').DataTable();\n table.ajax.reload();\n\n }else if(respuesta.estado === 'incorrecto') {\n mostrarMensaje('error', 'No se realizó la modificación del registro'); \n } else {\n // Hubo un error\n if(respuesta.error) {\n mostrarMensaje('error', 'Algo falló al modificar el registro de actividad'); \n }\n if (respuesta.conexion) {\n mostrarMensaje('error', 'Falla en la conexión a la base de datos');\n }\n }\n }\n\n // Muestra el error si el AJAX no se ejecuta o la respuesta no es ok\n function mostrarError(err){\n console.log('Error', err);\n }\n }\n })\n \n }\n}", "function userInformationChange(){\n var protocolData = new Array();\n protocolData.push(4);\n var userData = getUserData($('#inputUserIdA').val());\n userData[1] = $('#inputImeA').val();\n userData[2] = $('#inputPrezimeA').val();\n userData[3] = $('#inputAdresaA').val();\n userData[4] = $('#inputPbrA').val();\n userData[5] = $('#inputMjestoA').val();\n userData[6] = $('#inputTelefonA').val();\n userData[8] = $('#inputOibA').val();\n if(!CheckOIB(userData[8])){\n $('#dropboxCol1Status').slideUp(\"slow\");\n $('#dropboxCol1Status').removeClass(\"info\").removeClass(\"error\").addClass(\"warning\");\n $('#dropboxCol1Status span').html(\"OIB je neispravan\");\n $('#dropboxCol1Status').slideDown(\"slow\");\n return;\n }\n protocolData = protocolData.concat(userData);\n var xml = sendToPhp(protocolData,'getSet_korisnici.php');\n var status = $(xml).find('status').text();\n accountMess('dropboxCol1Status',status);\n}", "function registerUser() {\n \n var data = $(\"#register_form\").serializeArray();\n var obj={};\n \n // Loop converts data serialized into an object.\n data.forEach(function(a){\n obj[a.name] = a.value;\n });\n \n for (var i in obj) {\n if (checkInput($(\"#\"+i))) {\n if (i === \"password\") {\n obj[i] = SHA256(obj[i]);\n } else if (i === \"email\") {\n data = JSON.stringify(obj);\n\n // Updates users.json file with a new user\n request(\"http://introtoapps.com/datastore.php?action=append&appid=215242834&objectid=users.json&data=\"+data, \"POST\", \"\", \"#register_error\", logOff);\n }\n } else {\n break;\n }\n } \n}", "function add_admin(){\n var name = document.getElementById(\"name\").value;\n var email = document.getElementById(\"email\").value;\n var phone = document.getElementById(\"phone\").value;\n var pin = document.getElementById(\"pin\").value;\n var role = document.getElementById(\"role_body\").value;\n var password = document.getElementById(\"password\").value;\n\n _loading(1);\n $.post('/api/v1/add_admin',{\n 'id': userData['id'],\n 'token': userData['token'],\n 'name': name,\n 'email': email,\n 'phone': phone,\n 'pin': pin,\n 'role': role,\n 'password': password\n }, function (e) {\n if(e['status'] === '00'){\n console.log(e['messages'])\n notif('success', 'Success!', e['messages']);\n\n }else{\n notif('danger', 'System Error!', e['messages']);\n }\n }).fail(function(){\n notif('danger', 'System Error!', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n _admins_list(_page);\n });\n\n console.log(name);\n console.log(email);\n console.log(phone);\n console.log(role);\n console.log(\"oit\")\n}", "function ajaxCall(dataToServer, dataToChange) {\n $.ajax({\n url: 'updateAssignedUser',\n type: 'POST',\n dataType: 'json',\n data: dataToServer,\n success: function(dataToServer){\n if(dataToServer.isValid) {\n dataToChange.html(dataToServer.username);\n } else {\n alert('Please enter a registered Jonrah user');\n }\n }\n });\n}", "function cargarEditUsr(){\n\t//debugger;\n\t// parseo los usuarios para obtener los arreglos\n\tvar usuario_nombre = JSON.parse(localStorage.getItem(\"usuarios\"));\n\t// le asigno a la variable modificar el id que esta actualmente\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos\n\tfor (var i = 0; i < usuario_nombre.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < usuario_nombre[i].length; j++) {\n\t\t\t// pregunto que si modificar es igual al id actual\n\t\t\tif(modificar == usuario_nombre[i][j]){\n\t\t\t\t// si es asi, a la variable da1 le asigno el valor de la posicion 0\n\t\t\t\tda1 = usuario_nombre[i][j];\n\t\t\t\t//a la variable da2 le asigno el valor de la posicion 1\n\t\t\t\tda2 = usuario_nombre[i][j+1];\n\t\t\t\t//a la variable da3 le asigno el valor de la posicion 2\n\t\t\t\tda3 = usuario_nombre[i][j+2];\n\t\t\t\t//a la variable da4 le asigno el valor de la posicion 3\n\t\t\t\tda4 = usuario_nombre[i][j+3];\n\t\t\t\t//a la variable da5 le asigno el valor de la posicion 4\n\t\t\t\tda5 = usuario_nombre[i][j+4];\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"numero\").value = da1;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"fullName\").value = da2;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"user\").value = da3;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"password\").value = da4;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"password_repeat\").value = da5;\n\t\t\t}\n\t\t};\n\n\t}\n}", "function saveDataToAccount() {\n let id = document.getElementById(\"id\").value;\n let name = document.getElementById(\"name\").value;\n let oldName = document.getElementById(\"l_name\").value;\n let email = document.getElementById(\"email\").value;\n let oldEmail = document.getElementById(\"l_email\").value;\n let phone = String(document.getElementById(\"phone\").value);\n let oldPhone = String(document.getElementById(\"l_phone\").value);\n let location = document.getElementById(\"location\").value;\n let oldLocation = document.getElementById(\"l_location\").value;\n let password = document.getElementById(\"pwd\").value;\n let url = getContextPath() +'/userInfo'\n\n let data = new FormData();\n let changed = false;\n if (validateUpdateAccount(name, oldName, email, oldEmail, phone, oldPhone, location, oldLocation, password)) {\n let json = JSON.stringify({\n \"id\": id,\n \"name\": name,\n \"email\": email,\n \"phone\": phone,\n \"location\": location,\n \"password\": password\n })\n\n data.append('blob', new Blob([json], {type: 'application/json'}))\n changed = true\n }\n\n let userPic = document.getElementById(\"photo\").files[0];\n if (userPic) {\n data.append('datafile', userPic);\n changed = true\n }\n if (changed)\n $.post({\n url: url,\n data: data,\n cache: false,\n processData: false,\n contentType: false,\n async: false\n }).done(function () {\n ok()\n loadUserData()\n }).fail(function () {\n error()\n })\n\n}", "function updateUserRole(el) {\n //console.log(el.attr('data-id'));\n //console.log(el.attr('data-role-name'));\n //console.log(el.val());\n\n var dataModel = {\n UserId: el.attr('data-id'),\n RoleName: el.attr('data-role-name'),\n Add: el.val()\n };\n\n $.ajax({\n url: '/api/users/updaterole',\n type: 'POST',\n data: JSON.stringify(dataModel),\n contentType: 'application/json'\n })\n .fail(function () {\n showRoleAlert('alert-warning', 'User role update failed.');\n });\n}", "function updateUser(){\n let sessionStorage = new SessionStorageDB('token');\n var token = sessionStorage.get()[0]['token'];\n\n var id = document.getElementById('_id').value;\n var username = document.getElementById('username').value;\n var name = document.getElementById('name').value;\n var lastname = document.getElementById('lastname').value;\n var password = document.getElementById('password').value;\n var role = document.getElementById('role').value; \n \n axios.put(`http://localhost:4000/api/users/${id}`,{data:{'name':name,'lastname':lastname,'username':username,'password':password,'role':role}},\n {\n headers: {\n 'Content-Type': 'application/json;charset=UTF-8',\n 'Authorization': 'Bearer ' + token\n },\n })\n .then(function (res) {\n console.log(res.status)\n if (res.status == 200) {\n swal('User update correctly', \"\", \"success\");\n drawTable();\n clearInput();\n }\n })\n .catch(function (err) {\n console.log(err);\n })\n}", "function updateUser() {\r\n let email = $('#update-email').val();\r\n let fullname = $('#update-fullname').val();\r\n let role = $('#update-role').val();\r\n let cbRead;\r\n let cbCreate;\r\n let cbUpdate;\r\n let cbDelete;\r\n let cbUser;\r\n let cbBlog;\r\n let cbCommerce;\r\n let cbConsult;\r\n let cbSupply;\r\n let cbReport;\r\n\r\n if($('.cb2 #cb-read').is(':checked')) \r\n cbRead = 1;\r\n else\r\n cbRead = 0;\r\n if($('.cb2 #cb-create').is(':checked')) \r\n cbCreate = 1;\r\n else\r\n cbCreate = 0;\r\n if($('.cb2 #cb-update').is(':checked')) \r\n cbUpdate = 1;\r\n else\r\n cbUpdate = 0;\r\n if($('.cb2 #cb-delete').is(':checked')) \r\n cbDelete = 1;\r\n else\r\n cbDelete = 0;\r\n if($('.cb2 #cb-user').is(':checked')) \r\n cbUser = 1;\r\n else\r\n cbUser = 0;\r\n if($('.cb2 #cb-blog').is(':checked')) \r\n cbBlog = 1;\r\n else\r\n cbBlog = 0;\r\n if($('.cb2 #cb-commerce').is(':checked')) \r\n cbCommerce = 1;\r\n else\r\n cbCommerce = 0;\r\n if($('.cb2 #cb-consult').is(':checked')) \r\n cbConsult = 1;\r\n else\r\n cbConsult = 0;\r\n if($('.cb2 #cb-supply').is(':checked')) \r\n cbSupply = 1;\r\n else\r\n cbSupply = 0;\r\n if($('.cb2 #cb-report').is(':checked')) \r\n cbReport = 1;\r\n else\r\n cbReport = 0;\r\n\r\n let authority = {\r\n user: {\r\n read: cbRead,\r\n create: cbCreate,\r\n update: cbUpdate,\r\n delete: cbDelete\r\n },\r\n api: {\r\n user: cbUser,\r\n blog: cbBlog, \r\n commerce: cbCommerce, \r\n consult: cbConsult, \r\n supply: cbSupply, \r\n report: cbReport \r\n }\r\n }\r\n\r\n if(email == null || fullname == null || role == null) {\r\n alert(\"Form cannot be empty\");\r\n }\r\n else {\r\n $.get(address + ':3000/update-user', {email: email, fullname: fullname, role: role, authority: authority}, function(data) {\r\n if(data.ok == 1) {\r\n let userEmail = email;\r\n let query = `mutation updateSingleUser($userEmail:String!, $input:PersonInput) {\r\n updateUser(email: $userEmail, input: $input) {\r\n fullname\r\n }\r\n }`;\r\n\r\n fetch(address + ':3000/graphql', {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Accept': 'application/json',\r\n },\r\n body: JSON.stringify({\r\n query,\r\n variables: {\r\n userEmail,\r\n input: {\r\n email,\r\n fullname,\r\n role,\r\n authority\r\n }\r\n }\r\n })\r\n }).then(r => r.json()).then(function(data) {\r\n console.log(data);\r\n });\r\n alert(\"Update Success\");\r\n window.location.replace(address + \":3001/dashboard.html\");\r\n }\r\n else {\r\n alert(\"Update Error\");\r\n }\r\n });\r\n }\r\n}", "function updateUser() \n {\n swal({\n title: \"Attention\",\n text: \"Are you sure you want to update this user?\",\n type: \"warning\",\n showCancelButton: true,\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: \"Yes!\",\n cancelButtonText: \"No!\"\n /*closeOnConfirm: false,\n closeOnCancel: false*/\n }).then(function(result){\n\n if (result.value) \n {\n //name vairables\n var form = $('#form-update-user'); //form\n var userID = form.find('#user_id').val();\n var email = form.find('#user_email1').val();\n var avatar = form.find(\"#avatar1\").val();\n var table = $('#users').DataTable();\n var fields = form.find('input.required, select.required');\n \n blockUI();\n\n for(var i=0;i<fields.length;i++)\n {\n if(fields[i].value == \"\")\n {\n /*alert(fields[i].id);*/\n unblockUI(); \n showSimpleMessage(\"Attention\", \"All fields are required\", \"error\");\n $('#'+fields[i].id).focus();\n return false;\n }\n }\n\n if(!validateEmail(email))\n {\n unblockUI();\n showSimpleMessage(\"Attention\", \"Please provide a valid email address\", \"error\");\n return false;\n }\n else\n {\n if(avatar == \"\" || avatar == null)\n {\n $.ajax({\n type: 'PUT',\n url: API_URL_ROOT+'/users/'+userID,\n data: new FormData(form[0]),\n dataType: 'json',\n contentType: false,\n processData: false,\n cache: false,\n headers:{'x-access-token':token},\n success: function(response)\n {\n if(response.error == false)\n {\n unblockUI();\n showSimpleMessage(\"Success\", response.message, \"success\");\n table.ajax.reload(null, false);\n }\n else\n {\n unblockUI();\n showSimpleMessage(\"Attention\", response.message, \"error\");\n } \n },\n error: function(req, status, error)\n {\n unblockUI();\n showSimpleMessage(\"Attention\", \"ERROR - \"+req.status+\" : \"+req.responseText, \"error\");\n }\n }); \n }\n else\n {\n var extension = avatar.split('.').pop().toLowerCase();\n //Create array with the file extensions that we wish to upload\n var validFileExtensions = ['jpeg', 'jpg', 'png'];\n var file_length = $(\"#avatar1\").get(0).files.length;\n\n if($.inArray(extension, validFileExtensions) == -1)\n {\n //invalid avatar format\n unblockUI();\n $(\"#avatar1\").focus();\n showSimpleMessage(\"Attention\", \"Avatar must be a jpeg, jpg, png, gif file formats\", \"error\");\n return false;\n } \n else if($(\"#avatar1\").get(0).files[0].size > (1024 * 200)) \n {\n //user image is more than 1MB\n unblockUI();\n $(\"#avatar1\").focus();\n showSimpleMessage(\"Attention\", \"Avatar must not be more than 200KB in size\", \"error\");\n return false;\n } \n else\n {\n $.ajax({\n type: 'PUT',\n url: API_URL_ROOT+'/users/'+userID,\n data: new FormData(form[0]),\n dataType: 'json',\n contentType: false,\n processData: false,\n cache: false,\n headers:{'x-access-token':token},\n success: function(response)\n {\n if(response.error == false)\n {\n unblockUI();\n showSimpleMessage(\"Success\", response.message, \"success\");\n form.find(\"#avatar1\").val('');\n form.find('#imgprev1').slideDown(1000);\n table.ajax.reload(null, false);\n }\n else\n {\n unblockUI();\n showSimpleMessage(\"Attention\", response.message, \"error\");\n } \n },\n error: function(req, status, error)\n {\n unblockUI();\n showSimpleMessage(\"Attention\", \"ERROR - \"+req.status+\" : \"+req.responseText, \"error\");\n }\n });\n }\n } \n }\n } \n else \n {\n showSimpleMessage('Canceled', 'Process Abborted', 'error');\n }\n });\n }", "function Update() {\n var res = validateUpdate();\n if (res == false) {\n return false;\n }\n \n var sv = {\n ID: $('#ID').val(),\n MaSV: $('#SuaMasv').val(),\n facultyId: $('.ddlKhoaHoc2 #KhoaHoc').val(),\n FirstName: $('#SuaHo').val(),\n LastName: $('#SuaTen').val(),\n Phone: $('#SuaSdt').val(),\n Email:$('#SuaEmail').val(),\n Address:$('#SuaDc').val(),\n Birthday:$('#SuaNs').val(),\n Sex: $(\"#SuaGt\").val()\n };\n $.ajax({\n url: \"/Student/Update\",\n data: JSON.stringify(sv),\n type: \"POST\",\n contentType: \"application/json;charset=utf-8\",\n dataType: \"json\",\n success: function (result) {\n changeDropKhoaHoc($(\"#KhoaHoc\").val())\n $('#suasvthuctap').modal('hide');\n toastr.success('Cập nhật thành công !');\n\n },\n error: function (errormessage) {\n toastr.error('Cập nhật thất bại !');\n }\n });\n}", "function inicializar_ajax_editar_persona_POST(id_persona_a_editar){\n //vamos a obtener en una variable, el formulario creado por Django con los datos de la persona a editar, el cual despues le vamos aponer una escucha\n var form_edicion_persona = document.getElementById('formulario_de_edicion_de_persona');\n\n //aqui vamos a poner a la escucha el formulario del evento de submit, para que en el momentod e que le demos en enviar, no la mande de una vez si no que primero vamos a iniciar una funcion la cual nos ayudara a aobtener los datos y a enviarlos por AJAX, para que se vea asincronico\n form_edicion_persona.addEventListener('submit', inicializar_ajax_editar_persona_POST_2, false);\n\n //aqui vamos a hacer la funcion de inicializar_ajax_editar_persona_POST_2, la cual obtendra los datos y los enviara por AJAX a Django\n // le pasamos por parametro el evento, en el cual mas adelante vamos a obtener el objetivo del mismo\n function inicializar_ajax_editar_persona_POST_2(e){\n //primero vamos a hacer la variable que tendra la peticionHTTP_editar_persona_POST\n var peticionHTTP_editar_persona_POST;\n\n //vamos a obtener la TR que tenemos que modicficar, segun el id de la persona\n var tr_a_modificar_edicion_persona = document.getElementById(`tres${id_persona_a_editar}`);\n\n //luego segun el tipo de navegador que estemos usando, asi mismo se va a crear la peticion XML\n if (window.XMLHttpRequest) {\n //si es chrome\n peticionHTTP_editar_persona_POST = new XMLHttpRequest();\n }else{\n //si es internet explorer\n peticionHTTP_editar_persona_POST = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n\n\n //luego vamos a hacer la funcion quese ejecutara en el momento o cada vez que el estado de la peticion cambie\n peticionHTTP_editar_persona_POST.onreadystatechange = function(){\n //aqui podremos colocar lo que queremos que aparesca en el momento de que la peticion este en proceso o que haya habido algun problema con la misma\n\n //aqui vamos ha hacer una condicion, la cual va a evaluar si la peticion esta en un estado de lista 4 y en un estado 200, quiere decir que se pudo obtener correctamente\n // entonces se va a ejecutar lo que tengamos dentro de la condicional\n if (peticionHTTP_editar_persona_POST.readyState === 4 && peticionHTTP_editar_persona_POST.status === 200) {\n //vamos a modificar la TR que tiene la informacion antigua\n tr_a_modificar_edicion_persona.innerHTML = peticionHTTP_editar_persona_POST.responseText;\n console.log(tr_a_modificar_edicion_persona)\n\n //ahora vamos a hacer la eliminacion del formulario para que no genere conflicto con los demas formularios de eliminacion o creaciones\n div_formulario_editar_persona.innerHTML = \"\";\n\n\n //con esto llamamos una funcion con jquery la cual nos cerrara la ventana de edicion de la persona para que despues de hacer los cambios pues que se cierre ya que no necesitamos mas esta ventana\n $('#div_editar_persona').modal('hide')\n\n //ahora vamos a hacer la insercion de la notificacion de que se edito la persona correctamente\n /*NOTIFICACIONES*/\n //aqui vamos a cambiarle la imagen al div el cual lleva la notificacion y pondremos una carita masomenos feliz\n imagen_notificacion_editar_persona.setAttribute('src', '/static/img/botones/notificaciones/bien_editado.gif');\n //aqui estamos removiento la clase notificacion para poder colocar otra, y esto lo hacemos con el fin de que la otra clase tiene propiedades de css diferentes a esta\n div_notificacion_editar_persona.classList.remove('notificacion');\n //aqui estamos colocando la otra clase, la cual tiene propiedades de css difirentes a la primera\n div_notificacion_editar_persona.classList.add('notificacion_editar_persona_correcto');\n\n //aqui estamos removiendo la clase generica de la imagen, esto con el fin de poer otra ya que queremos que las propiedades de css cambien\n imagen_notificacion_editar_persona.classList.remove('imagen_notificacion');\n //aqui estamos colocando la otra clase la cual tiene propiedades diferentes de css\n imagen_notificacion_editar_persona.classList.add('img_notificacion_correcto_editar_persona');\n\n //aqui estamos insertando en el em del HTML el texto el cual lleva la informacion de la persona creada\n texto_notificacion_editar_persona.innerHTML = \" \" + \"Se edita correctamente a \" + nombre_completo_para_notificacion_editar_persona + \".\" + \" Ya puedes ver el registro de \" + nombre_completo_para_notificacion_editar_persona + \" con las modificaciones hechas.\";\n\n //aqui con esta funcion lo que estamos haciendo es que despues de 10 segundos se vuelven y se coloquen todas las clases que venian por defecto para que todo vuelva a la normalidad y por ende se desaparesca\n setTimeout(function() {\n div_notificacion_editar_persona.classList.remove('notificacion_editar_persona_correcto');\n div_notificacion_editar_persona.classList.add('notificacion');\n imagen_notificacion_editar_persona.classList.remove('img_notificacion_correcto_editar_persona');\n imagen_notificacion_editar_persona.classList.add('imagen_notificacion');\n }, 10000)\n /*NOTIFICACIONES*/\n\n\n\n\n //luego iniciamos todas las funciones que hemos hecho hasta ahora para que el nuevo registro que insertamos tambien tenga las mismas escuchas de eventos\n iniciar_ajax_crear_aplicacion();\n iniciar_ajax_crear_persona();\n iniciar_ajax_eliminar_persona();\n iniciar_ajax_editar_persona();\n iniciar_ajax_eliminar_persona_aplicacion();\n }\n }\n\n //aqui vamos a hacer la funcion de enviar de informacion ajax post 2, la cual llevara por parametro la url o los datos a enviar\n function enviar_datos_ajax_editar_persona_POST_2(data) {\n //aqui vamos a hacer 3 cosas con la peticionHTTP, la primero es que vamos a abrirla y este metodo llevara 3 parametros, el primero es el metodo de envio de la informacion el cual sera POST, el segundo es la url sin datos, ya que no se pueden mandar asi por que es POST\n // y el tercer paramtro es true, ya que la peticion es de metodo asincronico\n peticionHTTP_editar_persona_POST.open('POST', 'editar_persona', true);\n //luego aqui con este metodo indicamos que los datos vana a estar de alguna manera cifrados con un protocolo para que no se puedan leer\n peticionHTTP_editar_persona_POST.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n //y aqui vamos a enviar la informacion por medio de este metodo y no como simepre lo haciamos por GET\n peticionHTTP_editar_persona_POST.send(data);\n }\n\n //vamos a evitar que el formulario se envie verdaderamente por medio de la siguiente funcion\n e.preventDefault();\n //vamos a empezar a obtener los datos, vamos a empezar por el token\n var token = `csrfmiddlewaretoken=${form_edicion_persona[0].value}&`;\n\n //vamos a obtener el id de la persona a editar\n var id = `id=${id_persona_a_editar}`;\n\n //ahora vamos a obtener el nombre completo de la persona\n var nombre_completo = `&nombre_completo=${document.getElementById('id_nombre_completo').value}`;\n\n /*NOTIFICACIONES*/\n //aqui vamos ahacer una variable global, la cual vamos a manejar en el codigo de la notificacion de la persona editada\n var nombre_completo_para_notificacion_editar_persona = document.getElementById('id_nombre_completo').value\n /*NOTIFICACIONES*/\n\n //ahora el id del cargo que le asignamos\n var cargo = `&cargo=${document.getElementById('id_cargo').value}`;\n\n //vamos a obtener los datos de la ubicacion de la persona\n var ubicacion = `&ubicacion=${document.getElementById('id_ubicacion').value}`;\n\n //vamos a obtener los datos de la ubicacion del centro de la persona\n var centro = `&centro=${document.getElementById('id_centro').value}`;\n\n //ahora vamos a hacer la URL completa con la informacion obtenida anteriormente\n var url = token + id + nombre_completo + cargo + ubicacion + centro;\n console.log(url)\n\n //luego vamos a hacer el envio de la informacion a la funcion de enviar peticion ajax post 2\n enviar_datos_ajax_editar_persona_POST_2(url);\n\n }\n }", "function enviar() {\n if (!validar()) {\n mostrarMensaje(\"alert alert-danger\", \"Debe digitar los campos del formulario\", \"Error!\");\n } else if (!validarTamCampos()) {\n mostrarMensaje(\"alert alert-danger\", \"Tamaño de los campos marcados Excedido\", \"Error!\");\n } else {\n //Se envia la información por ajax\n $.ajax({\n url: 'UsuarioServlet',\n data: {\n accion: $(\"#usuariosAction\").val(),\n idUsuario: $(\"#idUsuario\").val(),\n password: $(\"#password\").val(),\n nombre: $(\"#nombre\").val(),\n apellido1: $(\"#primerApellido\").val(),\n apellido2: $(\"#segundoApellido\").val(),\n correo: $(\"#correo\").val(),\n fechaNacimiento: $(\"#fechaNacimiento\").data('date'),\n direccion: $(\"#direccion\").val(),\n telefono1: $(\"#telefono1\").val(),\n telefono2: $(\"#telefono2\").val(),\n tipo: \"normal\"\n },\n error: function () { //si existe un error en la respuesta del ajax\n mostrarMensaje(\"alert alert-danger\", \"Se genero un error, contacte al administrador (Error del ajax)\", \"Error!\");\n },\n success: function (data) { //si todo esta correcto en la respuesta del ajax, la respuesta queda en el data\n var respuestaTxt = data.substring(2);\n var tipoRespuesta = data.substring(0, 2);\n if (tipoRespuesta === \"C~\") {\n mostrarModal(\"myModal\", \"Exito\", \"Usuario agregado Correctamente!\", \"true\");\n limpiarForm();\n } else {\n if (tipoRespuesta === \"E~\") {\n mostrarMensaje(\"alert alert-danger\", respuestaTxt, \"Error!\");\n } else {\n mostrarMensaje(\"alert alert-danger\", \"Se genero un error, contacte al administrador\", \"Error!\");\n }\n }\n },\n type: 'POST'\n });\n }\n}", "function login () {\n \n var value_email_login = document.getElementById('login_email').value;\n var value_num_afiliacion_login = document.getElementById('login_num_afiliacion').value;\n\n if (value_email_login && value_num_afiliacion_login) {\n\n var objUsuario = Usuario(value_email_login, value_num_afiliacion_login);\n\n var objUsuario_json = JSON.stringify(objUsuario);\n \n objAjax = AJAXCrearObj();\n objAjax.open('GET', './php/login_usuario.php?objUsuario_json='+objUsuario_json, true); // llamamos al php\n objAjax.send();\n objAjax.onreadystatechange=responder_login;\n\n } else {\n\n alert(\"Rellene todos los campos\");\n }\n}", "function checkValidMailUpTodos(\n newemailUpTodos,\n pass2UpTodos,\n nombreup2Todos,\n checkUpTodos,\n id\n) {\n // var url_base = $(\"#url_base\").val();\n fetch(\"https://sistemas.mininterior.gob.ar/desagenesis/api/perfiles/updateUsuario\", {\n method: \"PUT\",\n headers: new Headers({\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n }),\n body:\n \"email=\" +\n newemailUpTodos +\n \"&nombre=\" +\n nombreup2Todos +\n \"&owner=\" +\n checkUpTodos +\n \"&pass=\" +\n pass2UpTodos +\n \"&id=\" +\n id,\n })\n .then((resp) => resp.json())\n .then((respObj) => {\n //Espera la respuesta de la API y consulta siempre por 0 (cero), si es correcto.\n if (respObj.status == 0) {\n swal({\n title: \"Excelente!\",\n text: respObj.messege,\n icon: \"success\",\n }).then(function () {\n location.reload();\n });\n } else {\n swal({\n title: \"Algo Salió Mal!\",\n text: respObj.messege,\n type: \"danger\",\n }).then(function () {\n location.reload();\n });\n }\n })\n .catch((error) => {\n alert(error);\n });\n}", "function modifyUser() {\n\n //create a new form\n createForm();\n\n document.getElementById('inter-btn').addEventListener('click', function (e) {\n const name = document.getElementById('name').value;\n const website = document.getElementById('website').value;\n const companyName = document.getElementById('cmpName').value;\n const catchPhrase = document.getElementById('cmpCatch').value;\n const userid = document.getElementById('userid').value;\n\n let output = '';\n\n if (name !== '' && website !== '') {\n //create data to send to API\n const dat = {\n name: `${name}`,\n website: `${website}`,\n company: {\n name: `${companyName}`,\n catchPhrase: `${catchPhrase}`\n\n }\n }\n //Create Post Request\n http.put(`https://jsonplaceholder.typicode.com/users/${userid}`, dat, function (err, posts) {\n if (err) {\n output = `<h5>${err}</h5>`;\n } else {\n posts = JSON.parse(posts);\n output = `\n <h5 class=\"mt-2\"> The user with id : ${posts.id} is now modified!</h5>\n <div class=\"card card-body mb-2\">\n <h5>Name : ${posts.name}</h4>\n <p>Id : ${posts.id}</p>\n <p>Website : ${posts.website}</p>\n <h6> Company: </h6>\n <ul>\n <li>Name : ${posts.company.name}</li>\n <li>Catchphrase : ${posts.company.catchPhrase}</li>\n </ul>\n </div>\n `;\n }\n document.getElementById('output').innerHTML = output;\n });\n }\n e.preventDefault();\n });\n\n}", "function editRow() {\n $('#error_edit').html(\"\");\n if (validateEditUser() == true) {\n try {\n var xhr = new XMLHttpRequest();\n xhr.open(\"PUT\", \"http://localhost:8080/Server/UsersController?session=\" + sessionStorage.getItem('session'), true);\n\n var data = JSON.stringify({\n \"username\": $('#edit-username').val(),\n \"password\": $('#edit-password').val(),\n \"email\": $('#edit-email').val(),\n \"grade\": $('#edit-grade').val(),\n \"name\": $('#edit-name').val(),\n \"age\": $('#edit-age').val(),\n \"address\": $('#edit-address').val(),\n \"id\": $('#edit-id').val()\n });\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4 && xhr.status === 200) {\n var obj = JSON.parse(xhr.responseText);\n if (obj.result == true) {\n var res = JSON.parse(data);\n $('#tbody .targetRow:nth-child(' + tempIndex + ') td:nth-child(1)').html('<span>' + res.username + \"</span>\");\n $('#tbody .targetRow:nth-child(' + tempIndex + ') td:nth-child(2)').html('<span>' + res.password + \"</span>\");\n $('#tbody .targetRow:nth-child(' + tempIndex + ') td:nth-child(3)').html('<span>' + res.email + \"</span>\");\n $('#tbody .targetRow:nth-child(' + tempIndex + ') td:nth-child(4)').html('<span>' + $('#add-grade option:selected').text() + \"</span>\");\n $('#tbody .targetRow:nth-child(' + tempIndex + ') td:nth-child(5)').html('<span>' + res.name + \"</span>\");\n $('#tbody .targetRow:nth-child(' + tempIndex + ') td:nth-child(6)').html('<span>' + res.age + \"</span>\");\n $('#tbody .targetRow:nth-child(' + tempIndex + ') td:nth-child(7)').html('<span>' + res.address + \"</span>\");\n $('#tbody .targetRow:nth-child(' + tempIndex + ') td:nth-child(8)').html('<span>' + res.id + \"</span>\");\n }\n $('#error_edit').html(obj.errorMessage);\n } else if (xhr.status === 401) {\n alert('Unauthorized user!');\n } else if (xhr.status === 0) {\n $('#error_edit').html('Server is offline!');\n }\n }\n xhr.send(data);\n } catch (exception) {\n alert(\"Request failed\");\n }\n }\n}", "function enviar_datos_ajax_editar_persona_POST_2(data) {\n //aqui vamos a hacer 3 cosas con la peticionHTTP, la primero es que vamos a abrirla y este metodo llevara 3 parametros, el primero es el metodo de envio de la informacion el cual sera POST, el segundo es la url sin datos, ya que no se pueden mandar asi por que es POST\n // y el tercer paramtro es true, ya que la peticion es de metodo asincronico\n peticionHTTP_editar_persona_POST.open('POST', 'editar_persona', true);\n //luego aqui con este metodo indicamos que los datos vana a estar de alguna manera cifrados con un protocolo para que no se puedan leer\n peticionHTTP_editar_persona_POST.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n //y aqui vamos a enviar la informacion por medio de este metodo y no como simepre lo haciamos por GET\n peticionHTTP_editar_persona_POST.send(data);\n }", "function eliminarRegistro(datos, id_Reg, tipo) {\n\n // Se verifica si se van a eliminar todos o solo uno\n const todos = document.getElementById('todos').checked;\n let regEliminar = [];\n\n if(todos === true){\n regEliminar = id_Reg;\n } else {\n regEliminar = [datos.id_reg_act];\n }\n\n const idRegistrador = document.getElementById('idRegistrador').value;\n const fechaApertura = datos.fecha_hora_apertura;\n const idGrupo = datos.grupo;\n\n Swal.fire({\n title: '¿Está seguro?',\n text: 'Se eliminará el consecutivo ' + (regEliminar.length === 1 ? datos.consecutivo : datos.consecutivo + ' y sus asociados'),\n icon: 'warning',\n showCancelButton: true,\n confirmButtonColor: '#3085d6',\n cancelButtonColor: '#d33',\n confirmButtonText: 'Si, eliminarlo'\n }).then((result) => {\n if (result.value) {\n // Se definen los datos que se van a enviar al fetch\n const data = new FormData();\n data.append('id_Reg', regEliminar);\n data.append('fecha_hora_apertura', fechaApertura);\n data.append('idRegistrador', idRegistrador);\n data.append('idGrupo', idGrupo);\n data.append('tipo', tipo);\n\n // Conexión del fetch al archivo php\n fetch('inc/modelos/modelo-registro.php', {\n method: 'POST',\n body: data\n })\n .then(respuestaExitosa) // Respuesta exitosa llama la función\n .catch(mostrarError); // Respuesta negativa llama la función\n\n // Si la ejecución del AJAX es correcta se verifica la respuesta\n function respuestaExitosa(response){\n if(response.ok) { // Si la respuesta en ok se llama la función para mostrar los resultados\n response.json().then(mostrarResultado);\n } else { // Si la respuesta no es ok se muestra el error\n mostrarError('status code: ' + response.status);\n }\n }\n\n // Se muestran los resultados devueltos en el JSON\n function mostrarResultado(respuesta){\n // Si la respuesta es correcta\n if(respuesta.estado === 'correcto') { \n mostrarMensaje('success', 'Eliminación de Registro Exitoso') ; \n \n // Se oculta el modal de cierre de registro\n $('#modalAccionesReg').modal('hide');\n \n // Se actualiza la tabla\n var table = $('#tablaRegistros').DataTable();\n table.ajax.reload();\n\n }else if(respuesta.estado === 'incorrecto') {\n mostrarMensaje('error', 'No se realizó la eliminación del registro'); \n } else {\n // Hubo un error\n if(respuesta.error) {\n mostrarMensaje('error', 'Algo falló al eliminar el registro de actividad'); \n }\n if (respuesta.conexion) {\n mostrarMensaje('error', 'Falla en la conexión a la base de datos');\n }\n }\n }\n\n // Muestra el error si el AJAX no se ejecuta o la respuesta no es ok\n function mostrarError(err){\n console.log('Error', err);\n }\n }\n })\n}", "function insert_user_data(eThis) {\n var username = $('#txt-username');\n var password = $('#txt-password');\n var role = $('#txt-role option:selected').text();\n var status = $('#txt-status');\n\n if (username.val() == ''){\n alert(\"Insert Username\");\n username.focus();\n return;\n }else if (password.val() ==''){\n alert(\"Insert Password\");\n password.focus();\n return;\n }\n\n var frm = eThis.closest('form.form1');\n var frm_data = new FormData(frm[0]);\n $.ajax({\n url: 'action/insert_user.php',\n type: 'POST',\n data: frm_data,\n contentType: false,\n cache: false,\n processData: false,\n dataType: \"json\",\n // beforeSend: function (data) {\n // },\n success: function (data) {\n if (data.duplicate == true){\n alert(\"Duplicate Username\");\n }else {\n if (data.edit == true){\n table_data.find('tr:eq('+indexTr+') td:eq(1)').text(username.val());\n table_data.find('tr:eq('+indexTr+') td:eq(2)').text(role);\n table_data.find('tr:eq('+indexTr+') td:eq(3)').text(status.val());\n $('.popup').remove();\n }else {\n var row_data = '<tr>' +\n '<td>' + data.id + '</td>' +\n '<td style=\"text-align: left\">' + username.val() + '</td>' +\n '<td>' + role + '</td>' +\n '<td>' + status.val() + '</td>' +\n '<td>' + button_edit + '</td>' +\n '</tr>';\n $('#table_data').find('tr:eq(0)').after(row_data);\n username.val('');\n username.focus();\n password.val('');\n $('#txt-id').val(parseInt(data.id) + 1);\n }\n }\n count_data();\n }\n });\n }", "function editUsers(){\n\tvar position=JSON.parse(localStorage.getItem('CurrentUser')).Position;\n\tvar users= JSON.parse(localStorage.getItem('Users'));\n\tvar user =users[position];\n\tif(document.getElementById('widget_password').value !== document.getElementById('widget_password_confirmation').value){\n\t\talert(\"The password doesn't match\");\n\t\treturn;\n\t}\n\tuser.FirstName=document.getElementById('widget_first_name').value;\n\tuser.LastName=document.getElementById('widget_last_name').value;\n\tuser.UserName=document.getElementById('widget_userName').value;\n\tuser.Email=document.getElementById('widget_email').value;\n\tuser.Password=document.getElementById('widget_password').value;\n\tuser.Admin=document.getElementById('box').checked;\n\tdocument.getElementById('welcomeUser').innerHTML='Welcome '+ user.FirstName + ' ' + user.LastName;\n\tlocalStorage.setItem('Users',JSON.stringify(users));\n\tlocalStorage.setItem(\"CurrentUser\",JSON.stringify(user));\n\t$('.overlay-bg, .overlay-content').hide();\n\talert(\"The user has been edited successfully\");\n}", "function addUsers(event) {\n\n event.preventDefault();\n\n const target = event.target.elements;\n const fName = target[0].value;\n const lName = target[1].value;\n\n const data = {\n firstName: fName,\n lastName: lName,\n };\n\n const options = {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(data)\n };\n\n fetch(apiUrl, options)\n .then(resp => {\n if (resp.ok) {\n return resp.json();\n } else {\n Promise.reject('NEIN');\n }\n })\n .catch(err => console.error(err))\n .finally(loadUsers)\n}", "function user_info_submit_handler(e){\n // Check the user input. Helper function defined in index.js\n if (check_user_personal_information(e) === 0){\n return; // Input failed test so do not continue\n }\n\n // Make the changes to the databse by making a request to server\n // Prepear to make the server call\n let data = {\n first_name: e.data.first_name.val(),\n last_name: e.data.last_name.val(),\n username: e.data.username.val(),\n password: e.data.password1.val(),\n email: e.data.email.val(),\n user_id: login_account.user_id\n }\n const request = new Request(\"/editUserInfo\", {\n method: \"post\",\n body: JSON.stringify(data),\n headers: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': 'application/json'\n }\n });\n\n // Now we make the request, the server will take care of this\n fetch(request).then((res) => {\n // We handle the response given back from the server\n if (res.status === 200){\n // Make the changes locally\n login_account.first_name = e.data.first_name.val();\n login_account.last_name = e.data.last_name.val();\n login_account.username = e.data.username.val();\n login_account.password = e.data.password1.val();\n login_account.email = e.data.email.val();\n alert(\"Your personal information has been saved.\");\n return;\n }else {\n alert(\"Something went wrong try again. There may be a problem with the server at this time.\");\n }\n })\n}", "updateUsers(data) {\n var res = {\n status: \"fail\",\n reason: \"unknown\"\n }\n const [username, email, password] = [\n data.body.username,\n data.body.email,\n data.body.password,\n ]\n var data = fs.readFileSync('./database/users.json', 'utf-8');\n\n // Handle file error\n try {\n data = JSON.parse(data);\n } catch (e) {\n fs.writeFileSync('./database/usersbackup.json', data);\n fs.writeFileSync('./database/users.json', \"{}\");\n }\n\n if (!(email in data) && email !== \"\" && username !== \"\" & password !== \"\") {\n data[email] = [username, password];\n fs.writeFileSync('./database/users.json', JSON.stringify(data, null, 4))\n res.status = \"success\";\n }\n else {\n res.status = \"fail\";\n res.reason = \"This email is already registered with us\";\n }\n return res;\n }", "function agregarUsuarios(e){\n\te.preventDefault();\n\n\tvar peticion = new XMLHttpRequest();\n\tpeticion.open('POST', 'php/insertar.php');\n\n\t// Validar variables y quitar los espacios//\n\tusuario_nombre = formulario.nombre.value.trim();\n\t// Convertir el valor a entero\n\tusuario_edad = parseInt(formulario.edad.value.trim());\n\tusuario_pais = formulario.pais.value.trim();\n\tusuario_correo = formulario.correo.value.trim();\n\n\t// si formulario-valido es true envia los datos via ajax a archivo php\n\tif(formulario_valido()){\n\n\t\terror_box.classList.remove('active');\n\n\t\tvar parametros = 'nombre=' + usuario_nombre + '&edad=' + usuario_edad + '&pais=' + usuario_pais + '&correo=' + usuario_correo;\n\t\tpeticion.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\")\n\n\t\tloader.classList.add('active');\n\n\t\tpeticion.onload = function(){\n\t\t\t//carga el contenido de la base de datos\n\t\t\tcargarUsuarios();\n\t\t\t// Borra contenido de los text\n\t\t\tformulario.nombre.value = '';\n\t\t\tformulario.edad.value = '';\n\t\t\tformulario.pais.value = '';\n\t\t\tformulario.correo.value = '';\n\t\t};\n\t\tpeticion.send(parametros);\n\n\t\tpeticion.onreadystatechange = function(){\n\t\t\tif(peticion.readyState == 4 && peticion.status == 200){\n\t\t\t\tloader.classList.remove('active');\n\t\t\t}\n\t\t}\n\n\t}else{\n\t\terror_box.classList.add('active');\n\t\terror_box.innerHTML = 'Por favor complete el formulario correctamente';\n\t}\n}", "function estadoUser(idUser,estadoUsuario) {\n\n if (estadoUsuario==0) {\n estadoUsuario = 1;\n estado = \"Activo\";\n clase = \"badge badge-success classEstado\";\n }else{\n estadoUsuario = 0;\n estado = \"Inactivo\";\n clase =\"badge badge-danger classEstado\";\n } \n\n\n const data = new FormData();\n data.append('codigoUser',idUser);\n data.append('estadoUser',estadoUsuario); \n\n \n let url = \"ajax/usuarios.ajax.php\";\n \n fetch(url,{\n method:'POST',\n body: data\n\n }).then(resp=> resp.text())\n .then( ) \n\n \n}", "function informacionUsuarios(){\n $.ajax({\n url: \"https://localhost:3000/volvo/api/GU/GU_GESTION_USUARIOS\",\n headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')},\n data: {\n \"accion\" : 'SELECT',\n \"idEstadoUsuario\" : $('#selectEstadoUsuario').val(),\n \"idAreaTrabajo\" : $('#selectAreaTrabajo').val()\n\n },\n dataType: \"json\",\n method: \"POST\",\n success: function(respuesta){\n if(respuesta.output.pcodigoMensaje == 0){\n for(i=0; i < respuesta.data.length; i++){\n $('#bodyTable').append(`\n <tr>\n <th>\n <input type=\"checkbox\" id=\"${respuesta.data[i].idUsuario}\" value=\"${respuesta.data[i].idUsuario}\" style=\"width:10px; height:100%;\"/> \n <label for=\"${respuesta.data[i].idUsuario}\"></label>\n </th>\n <td style=\"width:15px; text-align:center;\">${respuesta.data[i].idUsuario}</td>\n <td id=\"${'nombrePersona'+respuesta.data[i].idUsuario}\">${respuesta.data[i].nombrePersona}</td>\n <td id=\"${'nombreUsuario'+respuesta.data[i].idUsuario}\">${respuesta.data[i].nombreUsuario}</td>\n <td id=\"${'correoElectronico'+respuesta.data[i].idUsuario}\">${respuesta.data[i].correoElectronico}</td>\n <td id=\"${'numeroTelefono'+respuesta.data[i].idUsuario}\">${respuesta.data[i].numeroTelefono}</td>\n <td id=\"${'areaTrabajo'+respuesta.data[i].idUsuario}\">${respuesta.data[i].AreaTrabajo}</td>\n </tr>`\n );\n }\n }\n }\n });\n}", "function modificarTipoPerfil(){\n\tlet idTipoPerfil=$('#idMod').val();\n\tlet valorTipoPerfil=$('#valorTipoPerfilmod').val();\n\tlet form={id:idTipoPerfil, perfil:valorTipoPerfil}\n\tlet dataResp=ajaxRequest(`${URL_TARIFA}/${idTipoPerfil}/update`, form, \"modModificar\");\n\tif(!isEmptyObject(dataResp)){\n\t\t$('#tablaTipoPerfil').DataTable().ajax.reload();\n\t}\n}" ]
[ "0.710824", "0.69423276", "0.69074976", "0.6885367", "0.6884673", "0.6880189", "0.68705165", "0.6866044", "0.685479", "0.68456334", "0.67329794", "0.67261094", "0.6702824", "0.6693368", "0.66924584", "0.6667032", "0.664835", "0.6639176", "0.6627283", "0.6618021", "0.6611528", "0.66031826", "0.65998405", "0.6593655", "0.65694296", "0.65640837", "0.65622765", "0.656048", "0.65213513", "0.651141", "0.65058064", "0.64813364", "0.6478361", "0.6474443", "0.6470203", "0.6469371", "0.64693356", "0.64424896", "0.63807786", "0.63774765", "0.637643", "0.6373384", "0.6373274", "0.63721675", "0.6357253", "0.63571614", "0.6332717", "0.63145864", "0.631039", "0.6300376", "0.62980956", "0.6295998", "0.62889683", "0.627339", "0.625505", "0.62494284", "0.6248296", "0.62401146", "0.6237356", "0.62317973", "0.6229429", "0.6224904", "0.6223812", "0.6216501", "0.62009233", "0.618255", "0.6176476", "0.6175528", "0.6172135", "0.61608726", "0.615996", "0.614514", "0.614313", "0.6141147", "0.6133412", "0.6132894", "0.6130187", "0.6129657", "0.61233467", "0.61227584", "0.61184263", "0.61083496", "0.61022925", "0.60984975", "0.6096374", "0.6077688", "0.60732687", "0.60632294", "0.605606", "0.6053348", "0.6052627", "0.6051111", "0.60350055", "0.60311633", "0.60305446", "0.6029534", "0.60292274", "0.6029179", "0.60246855", "0.60142016" ]
0.69772404
1
Funcion con Ajax para enviarle los inputs con los datos, en este caso un array que los contenga, para modificar al usuario en el PHP UpdateUser
function getBillProfile(e) { var xmlhttp = new XMLHttpRequest(); var arrayInput = document.getElementsByTagName("input"); var fact = e.currentTarget.getAttribute("data-id"); var idUsuario = document.getElementById("modificar").getAttribute("data-id"); var data = {} var url = "../Api/getBillWord.php"; data["idUsuario"] = idUsuario; data["idFactura"] = fact; var xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener("readystatechange", function () { if (this.readyState === 4) { console.log(this.responseText); if(this.responseText != ""){ window.location.href="../Public/Bills/"+this.responseText; } } }); xhr.open("POST", url); xhr.setRequestHeader("Content-Type", "application/json"); xhr.send(JSON.stringify(data)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function modificarDatosUsuario(){\n //donde se mostrará lo resultados\n divResultado = document.getElementById('resultado');\n //valores de los inputs\n cu=document.formulario.curp.value;\n nom=document.formulario.Nombre.value;\n ape=document.formulario.Apellido.value;\n gra=document.formulario.Grado.value;\n gru=document.formulario.Grupo.value;\n dir=document.formulario.Direccion.value;\n tel=document.formulario.Telefono.value;\n //instanciamos el objetoAjax\n ajax=objetoAjax();\n //uso del medotod POST\n //archivo que realizará la operacion\n //reg_usuario.php\n ajax.open(\"POST\", \"mod_usuario.php\",true);\n ajax.onreadystatechange=function() {\n if (ajax.readyState==4) {\n //mostrar resultados en esta capa\n divResultado.innerHTML = ajax.responseText\n //llamar a funcion para limpiar los inputs\n //alert(\"Usuario Registrado\");\n LimpiarCamposUsuariomod();\n }\n }\n ajax.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\");\n //enviando los valores\n ajax.send(\"curp=\"+cu+\"&Nombre=\"+nom+\"&Apellido=\"+ape+\"&Grado=\"+gra+\"&Grupo=\"+gru+\"&Direccion=\"+dir+\"&Telefono=\"+tel)\n }", "function modificarCuentaUsuario() {\n var xmlhttp = new XMLHttpRequest();\n var arrayInput = document.getElementsByTagName(\"input\");\n var idUsuario = document.getElementById(\"modificar\").getAttribute(\"data-id\");\n\n var data = {}\n var url = \"../Api/UpdateUser.php\";\n for (let i = 0; i < arrayInput.length; i++) {\n if (arrayInput[i].value != \"\") {\n data[arrayInput[i].name] = arrayInput[i].value;\n }\n }\n data[\"idUsuario\"] = idUsuario;\n var xhr = new XMLHttpRequest();\n xhr.withCredentials = true;\n\n xhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === 4) {\n window.alert(\"¡Exito, cambio realizado!\")\n console.log(this.responseText);\n window.location.href=\"../Controllers/Perfil.php\";\n }\n });\n\n xhr.open(\"POST\", url);\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.send(JSON.stringify(data));\n}", "function enregistrerUtilisateurs() {\n if (validerUti()){\n var request = new XMLHttpRequest();\n var jsonObj = {\n coduser: document.getElementById(\"txtutiId\").value,\n password: document.getElementById(\"txtutiNom\").value,\n nom: document.getElementById(\"txtutiPrenom\").value,\n prenom: document.getElementById(\"txtutiMotdepass\").value,\n admin: document.getElementById(\"txtutiAdmin\").value,\n inactif: document.getElementById(\"txtutiInactif\").value,\n };\n var url = \"/tusers/saveUsers\";\n request.open(\"PATCH\", url, true);\n request.onreadystatechange = function() {\n if (request.readyState === 4) {\n if (request.status === 200) {\n //bootbox.alert(\"Mise à jour réussi\");\n if (document.getElementById(\"chButiLoop\").checked) {\n ramplirtabUti();\n }\n else{ \n $('#blockUtilisateurs').modal('hide'); \n } \n loadListe();\n }\n else {bootbox.alert(\"Erreur lors de la mise à jour\");}\n }\n };\n request.setRequestHeader(\"Content-type\", \"application/json\");\n request.send(JSON.stringify(jsonObj));\n }\n}// end enregistrer", "static UpdateMyData(){\n document.getElementById(\"ErrorOfMyUserData\").innerHTML= \"\"\n let InputDataValide = true\n // selectionner et ajouter tous les input de type CoreXMyUserDataInput\n let AllData = new Object()\n let el = document.querySelectorAll('[data-Input=\"CoreXMyUserDataInput\"]')\n el.forEach(element => {\n AllData[element.name] = element.value\n })\n // verifier si le password = confirm password\n if(document.getElementById(\"Password\").value != document.getElementById(\"Confirm-Password\").value){\n InputDataValide = false\n document.getElementById(\"ErrorOfMyUserData\").innerHTML= \"Password not confirmed!\"\n }\n // Sit tout les input son valide en envoie les data\n if (InputDataValide){\n // afficher le message d'update\n document.getElementById(\"CoreXWindowUserConfigData\").innerHTML='<div class=\"CoreXActionText\" style=\"text-align: center;\">Update du user...</div>'\n document.getElementById(\"ButtonUpdateMyData\").style.display = \"none\"\n // Call delete user\n GlobalCallApiPromise(\"UpdateMyUser\", AllData).then((reponse)=>{\n CoreXWindowUserConfig.DeleteWindow()\n },(erreur)=>{\n document.getElementById(\"CoreXWindowUserConfigData\").innerHTML='<div class=\"CoreXActionText\" style=\"color:red; text-align: center;\">' + erreur + '</div>'\n })\n }\n }", "function updateUser(){\n var userupdate ={\n \"id\":document.getElementById(\"idUpdateUser\").value,\n \"fullname\":document.getElementById(\"user_full_name_modal\").value,\n \"email\":document.getElementById(\"user_email_modal\").value\n }\n\n // $.ajax({\n // url : '/admin/user/update',\n // method : 'POST',\n // dataType : 'json',\n // contentType : 'application/json; charset=utf-8',\n // data : JSON.stringify(userupdate),\n // success: function(res) {\n // if(res.status == 1){\n // sweetalert_success(res.message);\n // }else{\n // sweetalert_err(res.message);\n // }\n // },\n // error: function(request, status, error) {\n // alert(\"Not Call API\");\n // }\n // })\n}", "function mostrarUsuario(idsuscriptor){\n $(\"#idsuscriptor_usuario\").val(idsuscriptor);\n\n $.post(\"views/ajax/admin_panel.php?op=mostrarAdmin\", {\n idsuscriptor: idsuscriptor\n }, function(data, status) {\n data = JSON.parse(data);\n\n mostrarformUsuario(true);\n //Como estan definidos los campos en la base de datos\n $(\"#idusuario_suscriptor\").val(data.idusuario_suscriptor);\n $(\"#nombre_completo\").val(data.nombre_completo);\n $(\"#email\").val(data.email);\n\n });\n\n\n}", "function ActualizarUsuario(){\n var corroborado = false;\n if (CorroborarCampoUsers(corroborado)){\n //star ajax\n $.ajax({\n cache: false,\n data:{\n idUsuario: $(\"#id_usuario\").val(),//.toUpperCase(),\n Username: $(\"#username\").val(),//.toUpperCase(),\n password: $(\"#password\").val(),\n Nombres: $(\"#nombres\").val(),//.toUpperCase(),\n Apellidos:$(\"#apellidos\").val(),//.toUpperCase(),\n Direccion:$(\"#direccion\").val(),//.toUpperCase(),\n Telefono: $(\"#telefono\").val(),//.toUpperCase(),\n Email: $(\"#email\").val().toLowerCase(),\n\n },\n url: 'Php/Update_User.php',\n type: 'post',\n beforeSend: function () {\n //mensaje\n $('#actualizarCuenta').text(\"Enviando..\");\n },\n success: function (respuesta) {\n if(respuesta==2){\n location.reload();// actualizo la pagina\n }else{\n $('#actualizarCuenta').text(respuesta);\n }}\n });//the end AJAX\n }\n }", "function editarUsers(){\n\t//debugger;\n\t// variable que obtengo el arreglo donde estan guardados los usuarios\n\tvar listChamba = JSON.parse(localStorage.getItem(\"usuarios\"));\n\t// obtengo el id para poder modificar el elemento actual\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos de los usuarios\n\tfor (var i = 0; i < listChamba.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < listChamba[i].length; j++) {\n\t\t\t// pregunto que si el modificar es igual al id actual\n\t\t\tif(modificar == listChamba[i][j]){\n\t\t\t\t// si si es igual obtener id\n\t\t\t\tvar n = document.getElementById(\"numero\").value;\n\t\t\t// obtener el nombre completo\n\t\t\tvar fn = document.getElementById(\"fullName\").value;\n\t\t\t// obtener el nombre de usuario\n\t\t\tvar u = document.getElementById(\"user\").value;\n\t\t\t// obtener la contraseña\n\t\t\tvar p = document.getElementById(\"password\").value;\n\t\t\t// obtener la contraseña repetida\n\t\t\tvar pr = document.getElementById(\"password_repeat\").value;\n\t\t\t// pregunto si las contraseñas son vacias o nulas\n\t\t\tif(fn == \"\" || fn == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de nombre completo vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no, pregunto que si el nombre de usuario es vacio o nulo\n\t\t\t}else if(u == \"\" || u == null){\n\t\t\t\t// si es asi muestro un mensaje de error\n\t\t\t\talert(\"No puede dejar el campo de nombre de usuario vacio\");\n\t\t\t\tbreak;\n\t\t\t\t// si no \n\t\t\t}else{\n\t\t\t\t// pregunto que si nas contraseñas son iguales\n\t\t\t\tif(p == pr){\n\t\t\t\t\t// si es asi, le digo que elemento actual en la posicion 0 es igual al id\n\t\t\t\t\tlistChamba[i][j] = n;\n\t\t\t\t\t// la posicion 1 es igual al nombre completo\n\t\t\t\t\tlistChamba[i][j+1] = fn;\n\t\t\t\t\t// la posicion 2 es igual a el nombre de usuario\n\t\t\t\t\tlistChamba[i][j+2] = u;\n\t\t\t\t\t// la posicion 3 es igual a la contraseña\n\t\t\t\t\tlistChamba[i][j+3] = p;\n\t\t\t\t\t// y la posicion 4 es igual a la contraseña repetida\n\t\t\t\t\tlistChamba[i][j+4] = pr;\n\t\t\t\t\t// agrego la modificacion al localstorage\n\t\t\t\t\tlocalStorage['usuarios'] = JSON.stringify(listChamba);\n\t\t\t\t\t// muestro el mensaje para que se de cuenta el usuario que fue modificado\n\t\t\t\t\talert(\"Se Modificó correctamente\");\n\t\t\t\t\t// me voy a la tabla para corroborar que se modificó\n\t\t\t\t\tlocation.href = \"ver_usuarios.html\";\n\t\t\t\t\t// si no fuera asi\n\t\t\t\t}else{\n\t\t\t\t\t// muestro el mensaje de error porque las contraseñas son diferentes\n\t\t\t\t\talert(\"No puede modificar el usuario porque las contraseñas son diferentes\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n};\n}", "function editar(valorId) {\n\n\n var urls = \"https://jsonplaceholder.typicode.com/users/\" + valorId\n\n\n $.ajax({\n type: \"GET\",\n url: urls,\n data: \"\",\n contentType: \"application/Json; charset=utf-8\",\n dataType: 'Json',\n\n\n success: function (r) {\n\n\n // for (i in r) {\n // if (id != valorId) {\n\n // $(\"#cuerpo\").append('<tr><th scope=\"row\">'+r[i].id+'</th><td>'+r[i].name+'</td><td>'+r[i].username+'</td><td>'+r[i].email+'</td><td>'+r[i].phone+'</td><th scope=\"col\" class=\"text-primary\" id=\"\"><a href=\"javascript:pasarVariables('+r[i].id+')\">Editar</a> </th><th scope=\"col\" class=\"text-primary\"><a href=\"javascript:eliminar('+r[i].id+')\">Eliminar</a> </th></tr>')\n // }\n // id+=1;\n\n // }\n\n var idMax = r.id;\n var nombres = r.name;\n var usuarios = r.username;\n var correos = r.email;\n var telefonos = r.phone;\n\n \n $(\"#iDUsuario\").val(idMax);\n $(\"#nombres\").val(nombres);\n $(\"#usernames\").val(usuarios);\n $(\"#correos\").val(correos);\n $(\"#telefonos\").val(telefonos);\n $(\"#iDUsuario\").prop('disable', true);\n $(\"#id02\").css(\"display\", \"inline\");\n\n\n\n\n },\n error: function (r) {\n\n\n },\n failure: function (r) {\n\n }\n });\n}", "changeUserData(i) {\n // Retrieves the data from the form\n const userData = new FormData(i.target.form);\n\t// Uses the updateUser php script with the form data\n fetch('api/updateUser.php', {\n method: 'POST',\n body: userData\n }).then(res=>res.json())\n .then(data=>{\n if (data.status=='success') {\n console.log(\"User info modified\");\n } else {\n console.log(\"The user info not modified due to an error\");\n\t\t\t// Error message from the php script\n\t\t\tconsole.log(\"Error: \" + data.msg);\n }\n })\n }", "function modificarUsuarioVertodos(\n id,\n nombreusuario,\n emailusuario,\n userStatus,\n passusuario\n) {\n $(\"#nombreup2Todos\").val(nombreusuario);\n $(\"#newemailUpTodos\").val(emailusuario);\n $(\"#checkUpTodos\").val(userStatus);\n $(\"#idusuarioUpTodos\").val(id);\n $(\"#pass2UpTodos\").val(passusuario);\n}", "function modificarUsuario(\n id,\n nombreusuario,\n emailusuario,\n userStatus,\n passusuario\n) {\n $(\"#nombreup2\").val(nombreusuario);\n $(\"#newemailUp\").val(emailusuario);\n $(\"#checkUp\").val(userStatus);\n $(\"#idusuarioUp\").val(id);\n $(\"#pass2Up\").val(passusuario);\n}", "function edit_admin(){\n var name = document.getElementById(\"name2\").value;\n var email = document.getElementById(\"email2\").value;\n var phone = document.getElementById(\"phone2\").value;\n var role = document.getElementById(\"role_body2\").value;\n var user_id = document.getElementById('detail_id').innerHTML;\n\n _loading(1);\n $.post('/api/v1/edit_admin',{\n 'id_admin': userData['id'],\n 'token': userData['token'],\n 'user_id':user_id,\n 'name': name,\n 'email': email,\n 'phone': phone,\n 'role': role,\n }, function (e) {\n if(e['status'] === '00'){\n console.log(e['messages'])\n notif('success', 'Success!', e['messages']);\n\n }else{\n notif('danger', 'System Error!', e['messages']);\n }\n }).fail(function(){\n notif('danger', 'System Error!', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n _admins_list(_page);\n });\n}", "function AddUsuario(){\n var corroborado = false;\n if (CorroborarCampoUsers(corroborado)){\n //star ajax\n $.ajax({\n cache: false,\n data:{\n Username: $(\"#username\").val(), //.toUpperCase(),\n password: $(\"#password\").val(),\n Nombres: $(\"#nombres\").val(), //.toUpperCase(),\n Apellidos:$(\"#apellidos\").val(), //.toUpperCase(),\n Direccion:$(\"#direccion\").val(), //.toUpperCase(),\n Telefono: $(\"#telefono\").val(),//.toUpperCase(),\n Email: $(\"#email\").val().toLowerCase(),\n\n },\n url: 'Php/Add_Users.php',\n type: 'post',\n beforeSend: function () {\n //mensaje\n $('#mjsRegistro').text(\"Enviando..\");\n },\n success: function (respuesta) {\n if(respuesta==1){\n $('.sectionAdd').html('Tu dato se han guardado correctamente.<BR> <BR><input type=\"button\" onclick=location.reload(); value=\"Click aqui para logearte\">');\n }else{\n $('#mjsRegistro').text(respuesta);\n }}\n });//the end AJAX\n }\n }", "function updateUser(utente_id, user_nome, user_cognome, user_luogo_residenza, user_data_nascita, user_descrizione, user_numero_telefono, user_mail){\n\n $.ajax({\n url: \"php/query.php\",\n data: {\n \"command\": 'updateUser',\n \"utente_id\": utente_id,\n \"user_nome\": user_nome,\n \"user_cognome\": user_cognome,\n \"user_luogo_residenza\": user_luogo_residenza,\n \"user_data_nascita\": user_data_nascita,\n \"user_descrizione\": user_descrizione,\n \"user_numero_telefono\": user_numero_telefono,\n \"user_mail\": user_mail\n },\n cache: false,\n type: \"GET\"\n }).always(function() {\n\n var li_utente = $('li.utente[data-id=\"' + utente_id + '\"]');\n\n li_utente.attr('data-nome', user_nome);\n li_utente.attr('data-cognome', user_cognome);\n li_utente.attr('data-luogo_residenza', user_luogo_residenza);\n li_utente.attr('data-data_nascita', user_data_nascita);\n li_utente.attr('data-descrizione', window.btoa(user_descrizione) );\n li_utente.attr('data-numero_telefono', user_numero_telefono);\n li_utente.attr('data-mail', user_mail);\n\n li_utente.find('h1').html(user_nome + ' ' + user_cognome);\n\n alert('Utente modificato con successo.');\n });\n\n}", "function updateUser(){\n\t\tif(validateFormControls(\"edituser\")){\n\t\t\t$.ajax({\n\t\t\t\ttype: 'POST',\n\t\t\t\turl: \"../UserServlet\",\n\t\t\t\tdata: {\n\t\t\t\t\t\taction:'updateUser',\n\t\t\t\t\t\tusername: $('#editusername').val(),\n\t\t\t\t\t\temail: $('#editemail').val(),\n\t\t\t\t\t\tcontactno: $('#editcontactno').val(),\n\t\t\t\t\t\trole: $('#editrole').val(),\n\t\t\t\t\t\tboard:$('#editboard').val(),\n\t\t\t\t\t\tsuspended:$(\"input:radio[name='editsuspended']:checked\").val(),\n\t\t\t\t\t\t},\n\t\t\t\tsuccess: function(response) {\n\t\t\t\t\t\tif(response.status==\"success\"){\n\t\t\t\t\t\t\talert('User successfully updated');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(response.status==\"failure\") {\n\t\t\t\t\t\t\talert(response.error);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\tdataType: \"json\"\n\t\t});\n\t\t}\n\t\telse{\n\t\t\talert(\"Errors exist in form\");\n\t\t}\n\n\t}", "editarPerfil(){\n\n var idUsuario = localStorage.getItem(\"idUsuario\");\n\n let xhr = new XMLHttpRequest();\n \n /* CONFIGURAÇÕES */\n //xhr.open('GET', app.urlApi+'admin-editarPerfil.php');\n xhr.open('POST', app.urlApi+'admin-editarPerfil.php',true);\n xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n\n var params = 'idUsuario='+idUsuario+\"&token=\"+app.token;\n\n /*\n\n Então, quais são os estados possíveis de um requisição AJAX? Listaremos abaixo os estados:\n 0: requisição ainda não iniciada\n 1: conexão com o servidor estabelecida\n 2: requisição recebida\n 3: processando requisição\n 4: requisição está concluída e a resposta está pronta\n O estado 4 é o que mais nos interessa, porque é nele que temos acesso à resposta enviada pelo servidor.\n\n */\n \n xhr.onreadystatechange = () => {\n if(xhr.readyState == 4) {\n\n if(xhr.status == 200) {\n\n console.log(\"DADOS RETORNADOS EDITAR PERFIL\");\n console.log(JSON.parse(xhr.responseText));\n\n var dados = JSON.parse(xhr.responseText);\n\n if(dados.sucesso==200){\n\n $(\".placeholder\").hide(0);\n $(\".form\").fadeIn(500);\n\n $(\"#editarPerfilNome\").val(dados.dados[0].nome);\n $(\"#editarPerfilEmail\").val(dados.dados[0].email);\n $(\"#editarPerfilCelular\").val(dados.dados[0].celular);\n $(\"#editarPerfilSenha\").val(dados.dados[0].senha);\n \n // CARREGAR MASCARAS\n app.helpers.carregarMascaras();\n\n }else{\n \n aviso(\"Oops! Algo deu errado!\",\"Nossos servidores estão passando por dificuldades técnicas, tente novamente em alguns minutos.\");\n\n }\n\n\n }else{\n \n console.log(\"SEM SUCESSO editarPerfil()\");\n console.log(JSON.parse(xhr.responseText));\n\n }\n\n }\n };\n\n /* EXECUTA */\n xhr.send(params);\n\n\n }", "function fntEditUsuario(idpersona){\n\t// let btnEditUsuario = document.querySelectorAll('.btnEditUsuario');\n\t// btnEditUsuario.forEach(function(btnEditUsuario){\n\t// \tbtnEditUsuario.addEventListener('click', function(){\n\n\t\t\tdocument.querySelector('#titleModal').innerHTML = \"Actualizar Usuario\";\n\t\t\tdocument.querySelector('.modal-header').classList.replace('headerRegister', 'headerUpdate');\n\t\t\tdocument.querySelector('#btnActionForm').classList.replace('btn-primary', 'btn-info');\n\t\t\tdocument.querySelector('#btnText').innerHTML = \"Actualizar\";\n\n\t\t\t// let idpersona = this.getAttribute('us');\n\t\t\tvar idpersona = idpersona;\n\t\t\tlet request = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');\n\t\t\tlet ajaxUrl = base_url+'/Usuarios/getUsuario/'+idpersona;\n\t\t\trequest.open(\"GET\", ajaxUrl, true);\n\t\t\trequest.send();\n\t\t\trequest.onreadystatechange = function(){\n\n\t\t\t\tif (request.readyState == 4 && request.status == 200) {\n\t\t\t\t\tlet objData = JSON.parse(request.responseText);\n\n\t\t\t\t\tif (objData.status) {\n\t\t\t\t\t\tdocument.querySelector('#idUsuario').value = objData.data.idpersona;\n\t\t\t\t\t\tdocument.querySelector('#txtIdentificacion').value = objData.data.identificacion;\n\t\t\t\t\t\tdocument.querySelector('#txtNombre').value = objData.data.nombres;\n\t\t\t\t\t\tdocument.querySelector('#txtApellido').value = objData.data.apellidos;\n\t\t\t\t\t\tdocument.querySelector('#txtTelefono').value = objData.data.telefono;\n\t\t\t\t\t\tdocument.querySelector('#txtEmail').value = objData.data.email_user;\n\t\t\t\t\t\tdocument.querySelector('#listRolid').value = objData.data.idrol;\n\t\t\t\t\t\t$('#listRolid').selectpicker('render');\n\n\t\t\t\t\t\tif (objData.data.status == 1) {\n\t\t\t\t\t\t\tdocument.querySelector('#listStatus').value = 1;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tdocument.querySelector('#listStatus').value = 2;\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$('#listStatus').selectpicker('render');\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$('#modalFormUsuario').modal('show');\n\t\t\t}\n\n\n\t\t// });\n\t// });\n}", "function UpdatedUsuario(Id){\n /* Realiza conexión con el servidor */\n var vId = Id;\n var vurl = \"\";\n var vurl = \"../../datos/controller/contactosController.php\";\n if(vId != 0){\n $.ajax({\n data: {\"accion\":\"single\", \"pId\":vId},\n type: \"POST\",\n datatype: \"json\",\n url: vurl,\n })\n .done(function(data){\n if (data.success) {\n $('#modal-UpdatedUser').modal({keyboard: false});\n $(\"#txtStatusup option[value=\"+ data.Status +\"]\").attr(\"selected\",true);\n $('#txtDocup').val(data.Cedula);\n $('#txtNameup').val(data.Nombre_completo);\n $('#txtDirup').val(data.Direccion);\n $('#txtTelup').val(data.Celular);\n $('#txtEmlup').val(data.Email);\n $('#txtProgramaup').val(data.Programa);\n $('#txtComentup').val(data.Mensaje);\n $('#txtOrigenup').val(data.Origen_Campana);\n $('#txtIdup').val(vId);\n }\n })\n .fail(function(){\n alert(\"Ha ocurrido un problema\");\n });\n }\n }", "function updateUsuario(e) {\n e.preventDefault();\n var datos = new FormData(this);\n \n // Pasamos el validador\n if (!$(this).valid()) {\n return;\n }\n \n // Creamos el dialog\n var dialog = $(\"<div>¿Esta seguro de que desea Modificar este Usuario?</div>\");\n \n //////////////\n // DIALOG\n //////////////\n $(dialog).dialog({\n autoOpen: true,\n resizable: false, \n height: 150, \n modal: true, \n buttons: {\n \"Modificar\": function () {\n $.ajax({\n url: \"../../Controller/Gestion/updateUsuario.php\",\n data: datos, \n contentType: false, \n processData: false, \n type: 'POST'\n }).done(function (data) {\n var resultado = data;\n\n getListadoUsuarios(resultado);\n\n });\n $(this).dialog(\"close\");\n },\n \n \"Cancelar\": function () {\n $(this).dialog(\"close\");\n }\n }, \n close: function(){ \n $(dialog).remove();\n }\n });\n}", "function procesaModificaUsuario(){\r\n\t\r\n\tvar formulario = $('#formUpdateUser');\r\n\t\r\n\t$.ajax({\r\n url: \"actualizaUsuario\",\r\n data:$(formulario).serialize()\r\n }).then(function(data) {\r\n \t\t\r\n \tif (data.userExist){\r\n \t\tvar message = data.message;\r\n \t\tprocessMessage(message);\r\n \t}\r\n \telse{\r\n \t\t\r\n \t\tif(data.errorConexion){\r\n \t\t\t\r\n \t\t\talertaConexion()\t\r\n \t\t}\r\n \t\telse{\r\n \t\t\t\r\n \t\t\tdocument.getElementById(\"updateMessage\").style.visibility=\"visible\";\r\n \t\t$(\"#updateMessage\").text(data.message);\r\n \t\t$(\"#login\").focus();\r\n \t\t$(\"#login\").select();\r\n \t\t}\t\r\n \t}\r\n });\t\t\r\n}", "function ModificarU() {\nvar nick = $(\"#nick2\").val();\nvar nombre= $(\"#nombre2\").val();\nvar correo = $(\"#correo2\").val();\nvar nivel = $(\"#nivel2\").val();\nvar id = $(\"#hidden_usuario_id\").val();\n$.post(\"../../model/users/update.php\", {\nid:id,\nnick: nick,\nnombre:nombre,\ncorreo:correo,\nnivel:nivel\n}, \nfunction (data, status) {\nswal(\n'Usuario Modificado!',\n'correctamente!',\n'success'\n)\t\nreadRecords();\n}\n);\n$(\"#modaluserupdate .close\").click()\n}", "function modificar(){\n console.trace('Modificar');\n\n let id = document.getElementById('idForm').value;\n let nombre = document.getElementById('nombreForm').value;\n let avatar = `${document.getElementById('avatarForm').value}`;\n //let sexo = document.getElementsByName('sexoForm').value;\n let sexo = document.nombreForm.sexoForm.value;\n let persona = {\n \"id\" : id,\n \"nombre\" : nombre,\n \"avatar\" : avatar,\n \"sexo\" : sexo\n };\n\n url = endPoint + \"personas/\" + persona.id;\n ajax('PUT',url, persona)\n .then( data => {\n\n // conseguir de nuevo todos los alumnos\n url = endPoint + \"personas/?rol=1\";\n ajax(\"GET\", url, undefined) \n .then( data => {\n console.trace('promesa resolve'); \n personas = data;\n pintarLista( personas );\n limpiarSelectores();\n resetBotones();\n \n }).catch( error => {\n console.warn('promesa rejectada');\n alert(error);\n });//ajax(\"GET\", url, undefined)\n\n })\n .catch( error => {\n console.warn('promesa rejectada');\n alert('No puedes introducir dos usuarios con el mismo nombre');\n });//ajax('PUT',url, persona)\n limpiarSelectores();\n}", "function modificar_user(identidad) {\n\tcargando('Obteniedo información del usuario')\n\tenvio = { codigo: identidad }\n\t$.ajax({\n\t\tmethod: \"POST\",\n\t\turl: \"/admin-cliente/editar-cliente\",\n\t\tdata: envio\n\t}).done((datos) => {\n\t\tif (datos != 'Error') {\n\t\t\tno_cargando()\n\t\t\tasignar('txtnombre', datos.nombre)\n\t\t\tasignar('txtedad', datos.edad)\n\t\t\tasignar('txtsector', datos.sector)\n\t\t\tasignar('txtcedula', datos.cedula)\n\t\t\tasignar('txttelefono', datos.telefono)\n\t\t\tasignar('textdireccion', datos.direccion)\n\t\t\tasignar('txtmail', datos.username)\n\t\t\tvar opciones = document.getElementsByClassName('listado_referidos')\n\t\t\tfor (var i = 0; i < opciones.length; i++) {\n\t\t\t\topciones[i].removeAttribute('selected')\n\t\t\t}\n\t\t\tfor (var i = 0; i < opciones.length; i++) {\n\t\t\t\tif (datos.referido == opciones[i].value)\n\t\t\t\t\topciones[i].setAttribute('selected', '')\n\t\t\t}\n\t\t\t$('#modal-modificar-user').modal()\n\t\t} else {\n\t\t\tno_cargando()\n\t\t\tswal('Error', 'Ha ocurrido un error inesperado', 'error')\n\t\t}\n\t})\n}", "updateUserData() {\n console.log(\"Creating profile\");\n var formData = $('#user-form').serializeArray();\n var firstName = formData[0].value;\n var lastName = formData[1].value;\n var email = formData[2].value;\n var country = formData[3].value;\n var state = formData[4].value;\n var city = formData[5].value;\n var dob = formData[6].value;\n\n var newUserInfo = {firstName: firstName, lastName: lastName, email: email, country: country, state: state, city: city, dob: dob};\n\n }", "function updateUserAjaxSinImagen() {\n\n var status;\n\n if ($('#chkStatus').prop('checked')) {\n status = true;\n } else {\n status = false;\n }\n\n var obj = {\n id: $('#txtId').val(),\n nombre: $('#txtNombre').val(),\n apellido: $('#txtApellido').val(),\n telefono: $('#txtTelefono').val(),\n email: $('#txtEmail').val(),\n rol: $('#ddlRol').val(),\n status: status\n };\n\n $.ajax({\n type: \"POST\",\n url: \"frmUsuarios.aspx/ModificarUsuarioSinImagen\",\n data: JSON.stringify(obj),\n dataType: \"json\",\n contentType: 'application/json;charset=utf-8',\n error: function (xhr, ajaxOptions, thrownError) {\n console.log(xhr.status + \"\\n\" + xhr.responseText, + \"\\n\" + thrownError);\n },\n success: function (res) {\n if (res.d) {\n alertSuccess('Registro actualizado con exito');\n limpiar();\n setTimeout(function () {\n realizarPostBack();\n }, 1500);\n } else {\n alertError('No se pudo realizar la actulización');\n }\n }\n });\n }", "function updateUser(event) {\n event.preventDefault();\n\n var updateUserElement = $('#updateUser');\n var inputUserNameElement = updateUserElement.find('fieldset input#inputUserName');\n var inputUserEmailElement = updateUserElement.find('fieldset input#inputUserEmail');\n var inputUserFullNameElement = updateUserElement.find('fieldset input#inputUserFullname');\n var inputUserAgeElement = updateUserElement.find('fieldset input#inputUserAge');\n var inputUserLocationElement = updateUserElement.find('fieldset input#inputUserLocation');\n var inputUserGenderElement = updateUserElement.find('fieldset input#inputUserGender');\n\n if (inputUserNameElement.val() !== '') {\n // find user by name (first that matches). Dirty!\n // Get Index of object based on id value\n var arrayPosition = userListData.map(function (arrayItem) {\n return arrayItem.username;\n }).indexOf(inputUserNameElement.val());\n // Get out User Object\n var thisUserObject = userListData[arrayPosition];\n var updateUser = {\n '_id': thisUserObject._id,\n 'username': inputUserNameElement.val(),\n 'email': inputUserEmailElement.val(),\n 'fullname': inputUserFullNameElement.val(),\n 'age': inputUserAgeElement.val(),\n 'location': inputUserLocationElement.val(),\n 'gender': inputUserGenderElement.val()\n };\n\n $.ajax({\n type: 'PUT',\n data : updateUser,\n url : '/users/updateuser/',\n dataType : 'JSON'\n }).done(function (response) {\n\n if (response.msg === '') {\n\n // Clear the form inputs\n updateUserElement.find('fieldset input').val('');\n\n // Update the table\n populateTable();\n\n } else {\n alert('Error: ' + response.msg);\n }\n });\n\n } else {\n alert('Error: Enter User Name to update');\n }\n\n}", "function modificarDatosLibro(){\n //donde se mostrará lo resultados\n divResultado = document.getElementById('resultado');\n //valores de los inputs\n //cedula=document.cambio_libro.cedula.value;\n id=document.cambio_libro.id.value;\n co=document.cambio_libro.Codigo.value;\n tit=document.cambio_libro.Titulo.value;\n aut=document.cambio_libro.Autor.value;\n edit=document.cambio_libro.Editorial.value;\n //instanciamos el objetoAjax\n ajax=objetoAjax();\n //uso del medotod POST\n //archivo que realizará la operacion\n //reg_usuario.php\n ajax.open(\"POST\", \"mod_libro.php\",true);\n ajax.onreadystatechange=function() {\n if (ajax.readyState==4) {\n //mostrar resultados en esta capa\n divResultado.innerHTML = ajax.responseText\n //llamar a funcion para limpiar los inputs\n //alert(\"Usuario Registrado\");\n LimpiarCamposLibro();\n}\n}\n ajax.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\");\n //enviando los valores\n ajax.send(\"id=\"+id+\"&Codigo=\"+co+\"&Titulo=\"+tit+\"&Autor=\"+aut+\"&Editorial=\"+edit)\n }", "function updateStagiaire() {\n //On recupere les infos saisi par le user\n let prenom = $(\"#prenom\").val();\n let email = $(\"#email\").val();\n let ville = $(\"#ville\").val();\n let id = $(\"#id\").val();\n\n //On effectue la requete vers le server\n $.ajax({\n method: \"POST\",\n url: \"server.php\",\n data: {update: 1, prenom: prenom, email: email, ville: ville, id: id}\n }).done(function () {\n //En cas de succes, On vide les infos du formulaire\n $(\"#prenom\").val('');\n $(\"#email\").val('');\n $(\"#ville\").val('');\n\n //On appelle la fonction allStagiaires\n allStagiaires();\n });\n\n //On masque le formulaire d'insertion\n $(\"#monForm\").hide();\n}", "function getValuesFormChangeInfo() {\n \n var url = getUrlToSubmit();\n $.ajax({\n url: url+'/api/user/getInfoAd/'+idUser,\n type: 'GET',\n cache: false,\n headers: {\n \"Authorization\": 'Bearer ' + token\n },\n success: function (data) {\n $(\"#formChangeInfoName\").val(data.user.name);\n $(\"#formChangeInfoAddress\").val(data.user.address);\n $(\"#formChangeInfoZipCode\").val(data.user.zipCode);\n $(\"#formChangeInfoLocation\").val(data.user.location);\n M.updateTextFields();\n }, \n error: function (jqXHR, textStatus, err) {\n console.log(jqXHR);\n M.toast({html: 'Erro a obter os dados!'});\n }\n });\n}", "function update_UserInformation(id) {\n\n $(\"#editUserForm\").removeClass();\n if(id){\n\n // fetch Data for the hosteler with the current selected id\n $.ajax({\n url:'../../../validation/superAdmin/users/getUser_id.php',\n type : 'post',\n data :{users_id :id},\n dataType : 'json',\n success:function (response) {\n $(\"#u_id\").val(response.user_id);\n $(\"#editUsername\").val(response.username);\n $(\"#editUserMail\").val(response.email);\n $(\"#editFirstName\").val(response.firstName);\n $(\"#editLastName\").val(response.lastName);\n $(\"#editUserType\").val(response.user_type);\n $(\"#editPhoneNumber\").val(response.phone);\n\n\n // Update Data\n $(\"#editUserForm\").unbind('submit').bind('submit',function () {\n var form = $(this);\n\n //validation\n var editUsername = $(\"#editUsername\").val();\n var editUserMail = $(\"#editUserMail\").val();\n var editFirstName = $(\"#editFirstName\").val();\n var editLastName = $(\"#editLastName\").val();\n var editUserType = $(\"#editUserType\").val();\n var editPhoneNumber = $(\"#editPhoneNumber\").val();\n\n\n\n if (editFirstName && editLastName && editUsername && editUserMail && editPhoneNumber && editUserType ) {\n //submit the form to server\n $.ajax({\n url :form.attr('action'),\n type : form.attr('method'),\n data : form.serialize(),\n dataType : 'json',\n success:function (response) {\n // $(\".invalid-feedback\").removeClass('has-error');\n if(response.success === true){\n //close the modal after deleting\n $(\"#exampleModal\").modal('hide');\n\n swal({\n title: \"Success\",\n text: \"Information Update Successfully\",\n icon: \"success\",\n button:true\n });\n\n\n /* reload the database after the submission to\n * update the table\n * this is a built in function of database\n */\n usersTable.ajax.reload(false);\n\n }else{\n swal({\n title: \"warning\",\n text: \"Error! Please try again\",\n icon: \"success\",\n button:true\n });\n\n }//else\n }//success\n });//ajax submit\n }\n return false;\n })\n }// success\n });// fetch selected hosteler's data\n }else{\n alert(\"Error: Please Refresh This Page\");\n }\n}", "function z_usersEdit(id) {\r\n var usrId = id;\r\n var firstName = $(\"#new-u-name\").val();\r\n var lastName = $(\"#new-u-lastname\").val();\r\n var data = {\r\n userId: usrId,\r\n firstName: firstName,\r\n lastName: lastName\r\n };\r\n if ($(\"#editUsernameForm\").valid()) {\r\n $.ajax({\r\n url: \"/api/updateUser\",\r\n type: \"POST\",\r\n data: JSON.stringify(data),\r\n dataType: 'text',\r\n contentType: 'application/json;charset=UTF-8',\r\n success: function (result) {\r\n console.log(result);\r\n $(\"#z-vu-name\").val(firstName);\r\n $(\"#z-vu-lastname\").val(lastName);\r\n if (result.split(\":\")[1] == \"Done\") {\r\n alertPopup('success', \"User Updated Successfully\");\r\n } else {\r\n alertPopup('alert', \"Not found\");\r\n }\r\n $('#z-editUserName-popup').modal(\"hide\");\r\n },\r\n error: function (result) {\r\n console.log(result);\r\n }\r\n });\r\n }\r\n}", "function addUserAJAX(){\n\n let newUserData = {\n name: $(\"#newcashiername\").val(),\n username: $(\"#newcashierusername\").val(),\n pass: $(\"#newpassword\").val(),\n role: \"cashier\"\n }\n\n $.ajax({\n type : \"POST\",\n contentType : \"application/json\",\n url : \"newuserapi\",\n data : JSON.stringify(newUserData),\n dataType : 'json',\n success : function(result) {\n\n getUsersAjaxCall();\n },\n error : function(e) {\n alert(\"Error!\")\n console.log(\"ERROR: \", e);\n }\n });\n\n}", "function updateUser() {\n\n // Collecting the data.\n var userId = $('#userIdEdit').val();\n var firstName = $('#firstNameEdit').val();\n var lastName = $('#lastNameEdit').val();\n var age = $('#ageEdit').val();\n\n // Request Sending\n $.ajax({\n method: 'POST',\n url: './api/edit_user.php',\n data: {\n userId: userId,\n firstName: firstName,\n lastName: lastName,\n age: age\n },\n success: function(data) {\n\n // Conversion from string to JSON.\n var dataJSON = JSON.parse(data);\n\n // Get the status of the record update.\n var status = dataJSON.status;\n\n // If the record update succeed, do the following actions.\n if (status === 'success') {\n\n // Show success message to the user.\n showSuccess('User has been updated!');\n\n // Hide the modal.\n $('#editModal').modal('hide');\n\n // Do not proceed.\n return;\n }\n\n // Prompt that the operation is unsuccessful.\n showError('Something went wrong. Please try submitting the form again.');\n }\n });\n}", "function updateUserData(){\n var new_name = document.getElementById('name_change').value;\n if (new_name == \"\"){\n new_name = name;\n }\n var new_jobs = document.getElementById('jobs_change').value;\n if (new_jobs == \"\"){\n new_jobs = jobs;\n }\n var new_contact = document.getElementById('contact_change').value;\n if (new_contact == \"\"){\n new_contact = contact;\n }\n var new_tjm = document.getElementById('tjm_change').value;\n if (new_tjm == \"\"){\n new_tjm = tjm;\n }\n writeUserData(userId, new_name, new_jobs, new_contact, new_tjm);\n}", "function ajaxModificarUsuario(datos) {\n $.ajax({\n type: \"POST\",\n url: \"../controllers/perfil/perfilModificar.php\",\n data: datos,\n cache: \"false\",\n success: function (response) {\n if (response==1) {\n toastr.success(\"Datos personales modificados!\", \"Aviso!\");\n }\n }\n });\n}", "function updatePassword(e) {\n e.preventDefault();\n var datos = new FormData(this);\n\n // Pasamos el validador\n if (!$(this).valid()) {\n return;\n }\n \n // Creamos el dialog\n var dialog = $(\"<div>¿Esta seguro de que desea Modificar este Usuario?</div>\");\n \n //////////////\n // DIALOG\n //////////////\n $(dialog).dialog({\n autoOpen: true,\n resizable: false, \n height: 150, \n modal: true, \n buttons: {\n \"Modificar\": function () {\n $.ajax({\n url: \"../../Controller/Gestion/updatePassword.php\",\n data: datos, \n contentType: false, \n processData: false, \n type: 'POST'\n }).done(function (data) {\n var resultado = data;\n\n getListadoUsuarios(resultado);\n\n });\n $(this).dialog(\"close\");\n },\n \n \"Cancelar\": function () {\n $(this).dialog(\"close\");\n }\n }, \n close: function(){ \n $(dialog).remove();\n }\n });\n}", "function EditUserModal(Name, LastName, UserName, Rol, Id) {\n \n //asociamos los textbox con sus respetivos valores provenientes de la base de datos.\n document.getElementsByName('userName')[0].value = UserName;\n document.getElementsByName('name')[0].value = Name;\n document.getElementsByName('lastName')[0].value = LastName;\n document.getElementById('userType')[0].value = Rol;\n idDeleteUpdate = document.getElementsByName('idHidden')[0].value = Id;\n}", "function updateUser(e) {\n e.preventDefault();\n\n $.ajax({\n url: ' /updateuser',\n method: 'POST',\n data: $('#updateUserForm').serialize(),\n success: function (res) {\n\n // -----------------------\n // RESET FORM\n // -----------------------\n $('#updateUserForm')[0].reset();\n $('#password-strength-text-update').empty();\n\n // UPDATE THE VIEW\n $(\"#usernameUserFormUpdate\").val(res.currentUser.username);\n $(\"#emailUserFormUpdate\").val(res.currentUser.email);\n\n var str_user = JSON.stringify(res.currentUser);\n $(\"#authentication-name\").attr('value', str_user);\n $(\"#authentication-name\").text(res.currentUser.username)\n // FEEDBACK\n bootstrapAlert(res.success, \"Success\", \"success\");\n\n },\n error: function (err) {\n // console.log(err);\n var statusCode = err.responseJSON.statusCode;\n if (statusCode == 422) {\n var errorJSON = err.responseJSON.errors;\n // console.log(errorJSON);\n var e = \"\";\n for (var i = 0; i < errorJSON.length; i++) {\n e += errorJSON[i].msg + \"</br>\";\n }\n bootstrapAlert(e, \"Error\", \"danger\", false);\n } else if (statusCode == 11000) {\n var errorJSON = err.responseJSON.errors;\n // console.log(errorJSON);\n bootstrapAlert(errorJSON.name + \" - \" + errorJSON.message, \"Error\", \"danger\", false);\n }\n\n }\n });\n\n return false;\n}", "updateUser(e) {\n const dataForm = new FormData(e.target.form);\n console.log(e)\n fetch('api/updateUser.php', {\n \n method: 'POST',\n \n body: dataForm\n \n }).then(res=>res.json())\n .then(data=>{\n \n if (data.status=='success') {\n console.log(\"Success, the user info was updates\");\n } \n \n else { \n console.log(\"Something went wrong, the user info was NOT updated\");\n }\n \n })\n \n }", "function actualizarUsuario() {\n\t//console.log(\"ROL Y ID\");\n\t//console.log($(\"#rol\").val());\n\t//console.log($(\"#idUsuario\").val());\n\tconsole.log(\"idRol\");\n\tvar idRol=($('#rol').find(\":selected\").val())\n\tconsole.log(idRol)\n\tif ($(\"#actualizarUsuarioForm\").valid()){\t\n\t\t$\n\t\t\t.ajax({\n\t\t\t\tdata : {\n\t\t\t\t\t\"idEjecutivo\" : $(\"#idEjecutivo\").val(),\n\t\t\t\t\t\"nombre\" : $(\"#nombre\").val(),\n\t\t\t\t\t\"apellidoP\" : $(\"#app\").val(),\n\t\t\t\t\t\"apellidoM\" : $(\"#apm\").val(),\n\t\t\t\t\t\"username\" : $(\"#nick\").val(),\n\t\t\t\t\t\"activo\" : $(\"#estatus\").val(),\n\t\t\t\t\t\"password\" : $(\"#password\").val(),\n\t\t\t\t\t\"rol\" : $(\"#rol\").val(),\n\t\t\t\t\t\"id\" : $(\"#idUsuario\").val(),\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\tdataType : 'json',\n\t\t\t\turl : '../../mvc/usuario/modificarusuario',\n\t\t\t\ttype : 'post',\n\t\t\t\tbeforeSend : function() {\n\t\t\t\t},\n\t\t\t\tsuccess : function(response) {\n\t\t\t\t\tmensajeRedireccion(\"USUARIO ACTUALIZADO CORRECTAMENTE\",\"../usuarios/usuarios.jsp\");\n\n\n\t\t\t\t},\n\t\t\t\terror : function(response) {\n\t\t\t\t\tmensaje(\"IMPOSIBLE ACTUALIZAR EL USUARIO. CONTACTE CON EL ADMINISTRADOR.\");\n\t\t\t\t}\n\t\t\t});\n\t\t}\n}", "function getUser(id) {\n $.ajax({\n url: ip_server +\n \"/logged/getUser\",\n type: \"POST\",\n data:{\n 'bearer' : sessionStorage.token,\n 'idManagerUser' : id,\n },\n dataType: \"json\",\n success: function (response) {\n var dataSet = response.users;\n\n for (const usr of dataSet) {\n $('#mainEmailUpdate').val(usr.mainEmail);\n $('#resetEmailUpdate').val(usr.resetEmail);\n $('#nameUserUpdate').val(usr.nameUser);\n $('#addTypeUsersUpdate option[value=\"'+usr.idTypeUser+'\"]').attr(\"selected\", true);\n }\n },\n error: function (error) {\n if(error.status == '401'){\n sessionStorage.removeItem('token')\n window.location.assign(\"http://\" + window.location.hostname+\"/Smiling-camera/dashboardadmin/index.html\");\n }\n }\n });\n}", "function actualizarUsuarioTodos() {\n var configmail = $(\"#configmail\").val();\n var id = $(\"#idusuarioUpTodos\").val();\n\n // UPDATE nombre\n var nombreup2Todos = $(\"#nombreup2Todos\").val();\n if ($(\"#nombreup2Todos\").val() == \"\") {\n $(\"#nombreup2Todos\").addClass(\"is-invalid\");\n swal(\"Algo salió mal!\", \"El campo nombre es obligatorio\", \"warning\");\n $(\"#statusEmailTodos\").html(\n '<span class=\"label label-error\" style=\"color: red\">Campo obligatorio</span>'\n );\n return false;\n }\n\n // //UPDATE email\n var newemailUpTodos = $(\"#newemailUpTodos\").val();\n\n //UPDATE contraseña\n var pass2UpTodos = $(\"#pass2UpTodos\").val();\n if (pass2UpTodos == \"\") {\n swal(\n \"Validación!\",\n \"El campo contraseña es obligatorio y no debe estar vacío\",\n \"warning\"\n );\n return false;\n }\n if (\n pass2UpTodos.length == 0 ||\n pass2UpTodos.length <= 8 ||\n pass2UpTodos.length >= 35 ||\n getUppercarse(pass2UpTodos) == 0 ||\n getNumber(pass2UpTodos) == 0\n ) {\n swal(\n \"Validación\",\n \"Su contraseña debe tener entre 8 y 35 caracteres, contener letras, números y alguna letra en mayúscula.\",\n \"warning\"\n );\n return false;\n }\n\n //UPDATE checkUp\n var checkUpTodos = 0;\n if ($(\"#adminconfirmationUpTodos\").prop(\"checked\") == true) {\n checkUpTodos = 1;\n } else {\n checkUpTodos = 0;\n }\n\n checkValidMailUpTodos(\n newemailUpTodos,\n pass2UpTodos,\n nombreup2Todos,\n checkUpTodos,\n id\n );\n}", "function update(OID_USUARIO,USUARIO){\n\t\n\t/*INSERCION DE DATOS*/\n\t\n\t$(\"#txt_usuario\").val(USUARIO);\n\t\n\t$(\"#txt_usuario\").attr(\"USER\",OID_USUARIO);\n\t\n\t$(\"#btn_enviar_usuario\").text(\"Actualizar\")\n\t\t\n\t\n}//FINAL DE LA ACTUALIZACION DE UN REGISTRO", "function modif_password(){\n //mot de passe actuel, nouveau et confirmé et l'id \n var act =$(\"#act\").val();\n \n var npas =$(\"#npas\").val();\n var cpas =$(\"#cpas\").val();\n if(npas!=cpas){\n $('#alert-profil-npas').html('<span class=\"text-danger\">Mots de passe différents</span>'); \n $('#alert-profil-cpas').html('<span class=\"text-danger\">Mots de passe différents</span>'); \n }else{\n var action =\"update_pass\";\n var id = $(\"#user-id\").val();\n xhr = new XMLHttpRequest;\n xhr.responseType = 'json';\n var URL = \"ajax/users.php?action=\"+action+\"&id=\"+id+\"&pass=\"+npas;\n xhr.open(\"GET\",URL,true);\n xhr.send(null);\n xhr.onreadystatechange = result;\n function result(){\n if (this.readyState === 4 && this.status === 200) {\n var data = xhr.response;\n $('#alert4').html(data.result);\n \n $('#alert4').css('display','block');\n $(\"#act\").val();\n $(\"#cpas\").val();\n $(\"#npas\").val();\n }\n }\n }\n \n \n\n}", "function carga_usuario(id_usuario){\n\n\t console.log(\"Carga el usuario \"+id_usuario);\n\n\t $.ajax({\n\t url: '../controller/ajaxController12.php',\n\t data: \"pkID=\"+id_usuario+\"&tipo=consultar&nom_tabla=usuarios\",\n\t })\n\t .done(function(data) {\n\t \t/**/\n\t $.each(data.mensaje[0], function( key, value ) {\n\t console.log(key+\"--\"+value);\n\t $(\"#\"+key).val(value);\n\t });\n\n\t crea_cambia_pass();\n\t })\n\t .fail(function() {\n\t console.log(\"error\");\n\t })\n\t .always(function() {\n\t console.log(\"complete\");\n\t });\n\n }", "function edit_user(api_url, updated_user_data) {\n $.ajax({\n url: api_url,\n type: \"PUT\",\n data: JSON.stringify(updated_user_data),\n processData:false,\n contentType: PLAINJSON\n }).done(function (data, textStatus, jqXHR){\n if (DEBUG) {\n console.log (\"RECEIVED RESPONSE: data:\",data,\"; textStatus:\",textStatus);\n }\n\n // Inform user that the user has been deleted\n alert_success(\"The user data has been successfully.\");\n\n // Reload the list of users\n getUsers();\n\n }).fail(function (jqXHR, textStatus, errorThrown){\n if (DEBUG) {\n console.log (\"RECEIVED ERROR: textStatus:\",textStatus, \";error:\",errorThrown);\n }\n\n // Inform the user that user has NOT been deleted\n alert_error(\"Error while trying to update the user data.\");\n });\n}", "function cargarUsuario(perfil) {\n \n var pagina = \"./leer_usuarios.php\";\n var usuario = {perfil: perfil}; \n \n $.ajax({\n type: 'POST',\n url: pagina,\n dataType: \"text\",\n data: { usuario: usuario }\n })\n .then( function (objJson) { \n \n var user = JSON.parse(objJson);\n\n $(\"#email\").val(user.mail);\n $(\"#password\").val(user.contrasena);\n Login(); \n \n }, function (jqXHR, textStatus, errorThrown) {\n alert(jqXHR.responseText + \"\\n\" + textStatus + \"\\n\" + errorThrown);\n });\n\n}", "function users_Set_FormData(data)\r\n{\r\n\t$(\"#users_departmentId\").val(data.departmentId);\r\n\tusers_returnEmployeeListAndProgramListByDepartmentId();\r\n\t$(\"#users_roleId\").val(data.role);\r\n\t$(\"#users_userId\").val(data.userId);\r\n\t$(\"#users_username\").val(data.username);\r\n\t$(\"#users_oldUsername\").val(data.username);\r\n\t$(\"#users_fullName\").val(data.fullName);\r\n\t$(\"#users_Email\").val(data.email);\r\n\t$(\"#users_password\").val(data.password);\r\n\tif(data.isActive)\r\n\t{\r\n\t\t$(\"#users_status\").val(\"true\");\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$(\"#users_status\").val(\"false\");\r\n\t}\r\n\t\r\n\t$(\"#users_employee\").val(data.employeeId);\r\n\t$(\"#users_campusId\").val(data.campusesId);\r\n\t$(\"#users_programId\").val(data.programId);\r\n\tusers_changeRole();\r\n\tpageAniamateScroll();\r\n}", "function Mostrar(id) {\n$(\"#hidden_usuario_id\").val(id);\n$.post(\"../../model/users/unique_info.php\", {\nid: id\n},\nfunction (data, status) {\nvar dato = JSON.parse(data);\n$(\"#nick2\").val(dato.nick);\n$(\"#nombre2\").val(dato.nombre_usuario);\n$(\"#correo2\").val(dato.correo_usuario);\n$(\"#nivel2\").val(dato.nivel);\n}\n);\n$(\"#modaluserupdate\").modal(\"show\");\n}", "function login_user() {\n\n var value_login_email = document.getElementById('login_email').value;\n var value_login_num_afiliacion = document.getElementById('login_num_afiliacion').value;\n\n if (value_login_email && value_login_num_afiliacion) {\n\n var objUsuario = Usuario(value_login_email, value_login_num_afiliacion);\n\n var objUsuario_json = JSON.stringify(objUsuario); \n \n objAjax = AJAXCrearObj();\n objAjax.open('GET', './php/login_usuario.php?objUsuario_json='+objUsuario_json, true); // llamamos al php\n objAjax.send();\n objAjax.onreadystatechange=responder_login_user;\n\n } else {\n\n alert(\"Rellene todos los campos\");\n }\n}", "update(form) {\n // subscripcion al servicio de usuario para enviar los datos a editar\n this.userService.updateCommons(this.user).subscribe(response => {\n if (response.User && response.User._id) {\n this.status = true;\n form.reset();\n this.launchAlert('success', 'Se ha Editado el Usuario!', null, null, false, 1500, null, 'top', 'row', true);\n this.onEdit = null;\n }\n else {\n console.log(response);\n this.launchAlert('error', 'No se ha podido editar el Usuario!', null, null, false, 1500, null, 'top', 'row', true);\n }\n }, error => {\n console.log(error);\n this.launchAlert('error', 'No se ha podido editar el Usuario!', error.error.Message, null, false, 1500, null, 'top', 'row', true);\n });\n }", "function editASingleUser(userID){\r\n var newUserID = document.getElementById(\"userID\").value;\r\n var userEmail = document.getElementById(\"userEmail\").value;\r\n var userFirstName = document.getElementById(\"userFirstName\").value;\r\n var userLastName = document.getElementById(\"userLastName\").value;\r\n var userAvatar = document.getElementById(\"userAvatarEdit\").value;\r\n\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(\"PUT\",\"api/users/\" + String(userID), true);\r\n xhr.onload = function() {\r\n if (xhr.readyState === 4 && xhr.status >= 200 && xhr.status < 300) {\r\n JSON.parse(xhr.responseText);\r\n }\r\n else {\r\n alert(\"Error \" + xhr.status);\r\n }\r\n };\r\n xhr.setRequestHeader('Content-Type', 'application/json');\r\n try {\r\n xhr.send(JSON.stringify({\"id\": newUserID, \"email\": userEmail, \"first_name\": userFirstName, \"last_name\": userLastName, \"avatar\": userAvatar}));\r\n }\r\n catch (error) {\r\n alert.error(\"Cannot edit user ID\");\r\n }\r\n\r\n\r\n}", "function addUsuario(e) {\n e.preventDefault();\n \n // Pasamos el validador\n if (!$(this).valid()) {\n return;\n }\n \n var datos = new FormData(this);\n\n $.ajax({\n url: \"../../Controller/Gestion/addUsuario.php\",\n data: datos, \n contentType: false, \n processData: false, \n type: 'POST'\n }).done(function (data) {\n var resultado = data;\n\n getListadoUsuarios(resultado);\n \n });\n}", "function load_update_user_data() {\n $('#email').val(userObj.email);\n $('#name').val(userObj.name);\n}", "function editUserField(data) {\n var employeeDetails = getStorage();\n employeeDetails.forEach(function (user, index) {\n if (user.employeeId == data) {\n employeeId.value = user.employeeId;\n firstName.value = user.firstName;\n lastName.value = user.lastName;\n address.value = user.address;\n emailId.value = user.emailId;\n updateBtn.style.display = \"block\";\n submitBtn.style.display = \"none\";\n position = index;\n }\n });\n}", "function muestraDatosUsuario(datos){\n\tconsole.log(\"datos\");\n\tvar data=eval(datos);\n\t$(\"#nombre\").val(data.nombre);\n\t$(\"#app\").val(data.apellidoP);\n\t$(\"#apm\").val(data.apellidoM);\n\t$(\"#nick\").val(data.username);\n\t$(\"#estatus\").val(data.activo);\n\t$(\"#password\").val(data.password);\n\tconsole.log(data)\n\t$(\"#rol\").val(data.rol);\n\t$(\"#idUsuario\").val(data.id);\n\t$(\"#idEjecutivo\").val(data.idEjecutivo);\n}", "function editUser(correo) {\n let userXhr = new XMLHttpRequest();\n userXhr.open(\"GET\", `${baseUrl}users/${correo}/`);\n userXhr.setRequestHeader('x-auth', localStorage.getItem(\"dasw-x-auth\"));\n userXhr.setRequestHeader('x-user-token', localStorage.getItem(\"user-token\"));\n userXhr.send();\n userXhr.onload = function() {\n if(userXhr.status != 200) {\n alert(userXhr.status + ': ' + userXhr.statusText + ' ' + userXhr.responseText);\n } else {\n userObj = JSON.parse(userXhr.responseText);\n document.getElementById(\"editForm\").addEventListener(\"submit\", updateUser);\n updateEditModal();\n \n \n }\n\n }\n}", "function altaUsuario() {\n if (validarCampos()) { //Primero comprobamos que los campos no estan vacios\n $(this).toggleClass('active'); //Activamos el spinner \n \n //Obtenemos los valores de los campos que queremos enviar\n var usuario = document.getElementById('usuario').value;\n var password = document.getElementById('password').value;\n\n //Creamos una variable con formato JSON\n var usuarioJSON = {\"usuario\": usuario, \"password\": password};\n //Creamos un objeto para almacenar los valores\n var operacion = new FormData();\n operacion.append('operacion', 'altaUsuario');\n operacion.append('usuario', JSON.stringify(usuarioJSON));\n\n //Creamos la solicitud AJAX\n //Especificamos la action a ejecutar\n var url = \"OperacionesUsuario\";\n var solicitud = new XMLHttpRequest();\n solicitud.addEventListener('load', mostrar);\n solicitud.open('POST', url, true);\n solicitud.send(operacion); \n }\n}", "function registroRegistrarseHandler() {\n let nombreIngresado = $(\"#txtRegistroNombre\").val();\n let apellidoIngresado = $(\"#txtRegistroApellido\").val();\n let direccionIngresada = $(\"#txtRegistroDireccion\").val();\n let emailIngresado = $(\"#txtRegistroEmail\").val();\n let passwordIngresado = $(\"#txtRegistroPassword\").val();\n let passwordIngresado2 = $(\"#txtRegistroRepPassword\").val();\n const opciones = { title: 'Error' };\n if (validarCorreo(emailIngresado)) {\n if (passwordIngresado === passwordIngresado2) {\n if (validarPassword(passwordIngresado)) {\n if (validarNombre(nombreIngresado)) {\n if (validarApellido(apellidoIngresado)) {\n if (validarDireccion(direccionIngresada)) {\n //Guardamos los datos del usuario en un objeto llamado datosUsuario,m que luego lo pasamos por string a la llamada ajax\n const datosUsuario = {\n nombre: nombreIngresado,\n apellido: apellidoIngresado,\n email: emailIngresado,\n direccion: direccionIngresada,\n password: passwordIngresado\n };\n\n $.ajax({\n type: 'POST',\n url: urlBase + 'usuarios',\n contentType: \"application/json\",\n data: JSON.stringify(datosUsuario),\n // Ya que lo que debemos ejecutar es tan simple, lo hacemos en una funcion anonima.\n success: function () {\n ons.notification.alert(\"El usuario ha sido creado correctamente\", { title: 'Aviso!' });\n navegar('login', true);\n },\n error: errorCallback\n });\n } else {\n ons.notification.alert('La dirección debe contener un nombre de calle y un numero de puerta', opciones);\n }\n } else {\n ons.notification.alert('El apellido no puede estar vacío o contener un solo caracter', opciones);\n }\n } else {\n ons.notification.alert('El nombre no puede estar vacío o contener un solo caracter', opciones);\n }\n } else {\n ons.notification.alert('La contraseña debe tener al menos 8 caracteres', opciones);\n }\n } else {\n ons.notification.alert('Los passwords no coinciden', opciones);\n }\n } else {\n ons.notification.alert('El formato del correo no es válido', opciones);\n }\n}", "function agregarRegistro(registro) {\n $.ajax({\n type: 'POST',\n url: '/api/users/api-users.php?accion=agregar',\n data: registro,\n success: function(msg) {\n tabla1.ajax.reload();\n },\n error: function() {\n alert(\"Hay un problema\");\n }\n });\n}", "function registrar(idBoton,idPasado){\r\n\r\n\tajax2=objetoAjax();\r\n\tif (idBoton == 1) {\r\n\r\n\t\tnomusu = document.getElementById('nomusu').value;\r\n\t\t\t\t\r\n\t\tajax2.open(\"POST\", \"../procesa/update_user.proc.php\", true);\r\n\t\tajax2.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\");\r\n\t\tajax2.send(\"idusu=\"+idPasado+\"&nomusu=\"+nomusu);\r\n\r\n\r\n\t}else{\r\n\t\tif (idBoton == 2) {\r\n\r\n\t\t\tfecursa = document.getElementById('fecursa').value;\r\n\t\t\thocursa = document.getElementById('hocursa').value;\r\n\t\t\trecursa = document.getElementById('recursa').value;\r\n\t\t\taccursa = document.getElementById('accursa').value;\r\n\r\n\t\t\tajax2.open(\"POST\", \"../procesa/update_cursa.proc.php\", true);\r\n\t\t\tajax2.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\");\r\n\t\t\tajax2.send(\"idcursa=\"+idPasado+\"&fecursa=\"+fecursa+\"&hocursa=\"+hocursa+\"&recursa=\"+recursa+\"&accursa=\"+accursa);\r\n\r\n\t\t} else {\r\n\t\t\tif (idBoton == 3) {\r\n\r\n\t\t\t\tnombre = document.getElementById('nompart').value;\r\n\t\t\t\tapellido = document.getElementById('apepart').value;\r\n\t\t\t\tsexo = document.getElementById('separt').value;\r\n\t\t\t\tedad = document.getElementById('edpart').value;\r\n\t\t\t\tdiscapacidad = document.getElementById('dispart').value;\r\n\r\n\t\t\t\tajax2.open(\"POST\", \"../procesa/update_parti.proc.php\", true);\r\n\t\t\t\tajax2.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\");\r\n\t\t\t\tajax2.send(\"id=\"+idPasado+\"&nompart=\"+nombre+\"&apepart=\"+apellido+\"&separt=\"+sexo+\"&edpart=\"+edad+\"&dispart=\"+discapacidad);\r\n\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\tif (idBoton == 4) {\r\n\r\n\t\t\t\t\tnombre_categoria = document.getElementById('nombre_categoria').value;\r\n\t\t\t\t\tedad_min = document.getElementById('edad_min').value;\r\n\t\t\t\t\tedad_max = document.getElementById('edad_max').value;\r\n\r\n\t\t\t\t\tajax2.open(\"POST\", \"../procesa/update_categoria.proc.php\", true);\r\n\t\t\t\t\tajax2.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\");\r\n\t\t\t\t\tajax2.send(\"id_categoria=\"+idPasado+\"&nombre_categoria=\"+nombre_categoria+\"&edad_min=\"+edad_min+\"&edad_max=\"+edad_max);\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tajax2.onreadystatechange=function() {\r\n\t\t\r\n\t\tif (ajax2.readyState==4) {\r\n\t\t\t\r\n\t\t\tif (idBoton == 1) {\r\n\t\t\t\tconsultar(idBoton);\r\n\t\t\t\t\t\tvar bodyid = document.getElementById('bodyid');\r\n\t\t\t\t\t\tbodyid.className = \"body-admin\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar modalEditar = document.getElementById('ModalEditar');\r\n\t\t\t\t\t\tmodalEditar.style = \"\";\r\n\t\t\t\t\t\tmodalEditar.className = \"modal fade\";\r\n\t\t\t\t\t\tmodalEditar.setAttribute('aria-hidden', 'true');\r\n\t\t\t\t\t\tmodalEditar.setAttribute('aria-modal', '');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar divmierda = document.getElementsByClassName('modal-backdrop fade show');\r\n\t\t\t\t\t\tdivmierda[0].className = \"hola\";\r\n\t\t\t}else{\r\n\t\t\t\tif (idBoton == 2) {\r\n\t\t\t\t\tconsultar(idBoton);\r\n\t\t\t\t\t\tvar bodyid = document.getElementById('bodyid');\r\n\t\t\t\t\t\tbodyid.className = \"body-admin\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar modalEditar = document.getElementById('ModalEditar');\r\n\t\t\t\t\t\tmodalEditar.style = \"\";\r\n\t\t\t\t\t\tmodalEditar.className = \"modal fade\";\r\n\t\t\t\t\t\tmodalEditar.setAttribute('aria-hidden', 'true');\r\n\t\t\t\t\t\tmodalEditar.setAttribute('aria-modal', '');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar divmierda = document.getElementsByClassName('modal-backdrop fade show');\r\n\t\t\t\t\t\tdivmierda[0].className = \"hola\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (idBoton == 3) {\r\n\t\t\t\t\t\tconsultar(idBoton);\r\n\t\t\t\t\t\tvar bodyid = document.getElementById('bodyid');\r\n\t\t\t\t\t\tbodyid.className = \"body-admin\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar modalEditar = document.getElementById('ModalEditar');\r\n\t\t\t\t\t\tmodalEditar.style = \"\";\r\n\t\t\t\t\t\tmodalEditar.className = \"modal fade\";\r\n\t\t\t\t\t\tmodalEditar.setAttribute('aria-hidden', 'true');\r\n\t\t\t\t\t\tmodalEditar.setAttribute('aria-modal', '');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar divmierda = document.getElementsByClassName('modal-backdrop fade show');\r\n\t\t\t\t\t\tdivmierda[0].className = \"hola\";\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (idBoton == 4) {\r\n\t\t\t\t\t\t\tconsultar(idBoton);\r\n\t\t\t\t\t\t\tvar bodyid = document.getElementById('bodyid');\r\n\t\t\t\t\t\t\tbodyid.className = \"body-admin\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar modalEditar = document.getElementById('ModalEditar');\r\n\t\t\t\t\t\t\tmodalEditar.style = \"\";\r\n\t\t\t\t\t\t\tmodalEditar.className = \"modal fade\";\r\n\t\t\t\t\t\t\tmodalEditar.setAttribute('aria-hidden', 'true');\r\n\t\t\t\t\t\t\tmodalEditar.setAttribute('aria-modal', '');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar divmierda = document.getElementsByClassName('modal-backdrop fade show');\r\n\t\t\t\t\t\t\tdivmierda[0].className = \"hola\";\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\r\n\r\n\t\t\r\n\t}\r\n\t\r\n}", "function editarsitio(sitio_rtn){\n var url = \"?action=adminsitio\"\n $.ajax({\n url: url,\n type: 'POST', //metodo de la peticion\n dataType: 'json',//tipo de dato de la respuesta\n data: {rtn_sitio: sitio_rtn,function:\"consultar\"},\n success: function(respuesta){\n if (respuesta.data) {\n $(\"input[name=id_editar]\").val(respuesta.data.id_sitio);\n $(\"input[name=nombre_editar]\").val(respuesta.data.nombre_sitio);\n $(\"input[name=rtn_editar]\").val(respuesta.data.rtn);\n $(\"select[name=tipos_editar]\").val(respuesta.data.tipo_id);\n $(\"input[name=fecha_editar]\").val(respuesta.data.fecha_otorgamiento_rtn);\n $(\"input[name=rif_editar]\").val(respuesta.data.rif);\n $(\"input[name=telefono_editar]\").val(respuesta.data.telefono_sitio);\n $(\"input[name=correo_editar]\").val(respuesta.data.email);\n $(\"input[name=facebook_editar]\").val(respuesta.data.facebook);\n $(\"input[name=instagram_editar]\").val(respuesta.data.instagram);\n $(\"input[name=web_editar]\").val(respuesta.data.sitioweb);\n $(\"input[name=licencia_editar]\").val(respuesta.data.num_licencia);\n $(\"input[name=latitud_editar]\").val(respuesta.data.latitud);\n $(\"input[name=longitud_editar]\").val(respuesta.data.longitud);\n $(\"select[name=estado_editar]\").val(respuesta.data.estado_id);\n $(\"select[name=estatus_editar]\").val(respuesta.data.estatus);\n $(\"input[name=habitacion_editar]\").val(respuesta.data.num_habitacion);\n $(\"input[name=licencia_editar]\").val(respuesta.data.num_licencia);\n $(\"input[name=direccion_editar]\").val(respuesta.data.direccion_sitio);\n $(\"textarea[name=descripcion_editar]\").val(respuesta.data.descripcion);\n\n var estado_id=respuesta.data.estado_id\n ciudades(estado_id, $(\".ciudades_editar\"), respuesta.data.ciudad_id );\n $('#modal-modificar').modal(\"show\")\n }else{\n alert(\"error\")\n }\n },\n error: function() {\n console.log(\"No se ha podido obtener la información\");\n }\n })\n}", "function save_edit_user(){\r\n $('#myModal2 .modal-footer').on('click','#save_pac_edit',function(){\r\n \r\n $id = $('#myModal2 #identificacion').val(); \r\n $nomb = $('#myModal2 #nombres').val(); \r\n $ape1 = $('#myModal2 #apellido1').val(); \r\n $ape2 = $('#myModal2 #apellido2').val();\r\n $email = $('#myModal2 #email').val(); \r\n $f_nac = $('#myModal2 #fecha_na').val(); \r\n $direccion = $('#myModal2 #direccion').val(); \r\n $sexo = $('input:radio[name=Genero]:checked').val();\r\n $phone = $('#myModal2 #telefono').val(); \r\n\r\n $.ajax({\r\n url: 'php/consults.php',\r\n type: 'POST',\r\n data: {upd_user:1, id:$id,nomb:$nomb,ape1:$ape1,ape2:$ape2,email:$email,f_nac:$f_nac,direccion:$direccion,sexo:$sexo,phone:$phone},\r\n beforeSend:function(){\r\n\r\n },\r\n success:function(html){\r\n console.log(html)\r\n $resul=html;\r\n if ($resul == 9) {\r\n listarC();\r\n $('#myModal2 #cancel_act_pac').click(); \r\n $('div.pac_msj2').html(\"\");\r\n }else{\r\n $('div.pac_msj2').html(\"<div class='alert alert-danger'><h2>ERROR, Los datos no se han actualizado o no se han realizado cambios</h2></div>\");\r\n }\r\n },\r\n error:function(html){\r\n\r\n }\r\n }) \r\n\r\n });\r\n}", "function updateInf(){\r\n var error = 0;\r\n if(searchStorage('email', 'users', 'Inf') > 1 || document.getElementById('emailInf').value == \"\"){\r\n if(document.getElementById('emailInf').value != \"\"){\r\n alert(\"Cuenta ya registrada con ese correo. Inténtelo de nuevo con otra cuenta de correo\");\r\n }\r\n else{\r\n alert(\"Campo Email no válido\");\r\n }\r\n error++;\r\n }\r\n \r\n if(error == 0){\r\n var data = [], glbVars = [];\r\n data = JSON.parse(localStorage.getItem('users'));\r\n glbVars = JSON.parse(localStorage.getItem('globalVariables'));\r\n\r\n for(var i=0; i < data.length; i++){\r\n if(data[i].username == glbVars.user){\r\n\r\n data[i].name = document.getElementById('nameInf').value;\r\n data[i].surname = document.getElementById('surnameInf').value;\r\n data[i].email = document.getElementById('emailInf').value;\r\n data[i].address = document.getElementById('addressInf').value;\r\n data[i].phone = document.getElementById('phoneInf').value;\r\n data[i].birthdate = document.getElementById('birthdateInf').value;\r\n \r\n localStorage.setItem('users', JSON.stringify(data));\r\n alert(\"Actualizado con éxito\");\r\n i = data.length;\r\n }\r\n }\r\n }\r\n}", "function enviarUsuario()\n{\n\n var name = $('#name').val();\n var email = $('#email').val();\n var password = $('#password').val();\n var password_confirm = $('#password-confirm').val();\n var tipoUsuario = $('#tipoUsuario').val();\n\n var token = $('#token').val();\n\n $.ajax({\n url: url+'/home/usuarios',\n headers: {'X-CSRF-TOKEN':token},\n type: 'POST',\n dataType: 'json',\n data:{name: name, email: email, password: password, passwordConfirm: password_confirm,idtipoUsuario: tipoUsuario},\n\n success:function(response)\n {\n console.log(response);\n switch(response['mensaje'])\n {\n case \"creado\":\n getSuccess(\"El Usuario fue creado correctamente!!!\");\n newUser();\n break;\n\n case \"duplicado\":\n getDanger(\"ERROR, El Email: '\"+response['email']+\"'' ya esta Registrado\");\n document.getElementById('email').focus();\n break;\n\n case \"noUsuario\":\n getDanger(\"Dedes elegir un tipo de Usuario!!!\");\n document.getElementById('tipoUsuario').focus();\n break;\n\n case \"passwordNoCoincide\":\n getDanger(\"Las contraseñas no coinciden, por favor vuelva a confirmar la contraseña\");\n $('#password-confirm').val('');\n document.getElementById('password-confirm').focus();\n break;\n\n default:\n getDanger(\"ERROR al crear el Nuevo Usuario :(\");\n break;\n }\n }\n });\n}", "function insertDataArray(objectUser, url) {\n\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: url,\n contentType: \"application/json; charset=utf-8\",\n\t\t\ttraditional: true,\n\t\t data: JSON.stringify(objectUser),\n\t\t\tsuccess: function (msg) {\n\t\t\t\tif(msg){\n\t\t\t\t\tconsole.log(\"objeto ingresado en BD suscriptores\");\n\t\t\t\t\tconsole.log(objectUser);\n\t\t\t\t\talert(\"Se ingreso la info correctamente\");\n\t\t\t\t}else{\n\t\t\t\t\tconsole.log(\"error \"+ msg);\n\t\t\t alert(\"No fue posible regitrarlo en el portal !\");\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function (msg) {\n\t\t\t \n\t\t\t\talert(msg.error());\n\t\t\t}\n\t\t});\n\n }", "function actualizarUsuario(ptipoID, pid, pnombreUsuario, pnombre1, pnombre2, papellido1, papellido2, pcorreo, pfechaNacimiento, pedad, pimgPerfil) {\n let respuesta = '';\n let peticion = $.ajax({\n url: 'http://localhost:4000/api/actualizar_usuario',\n type: 'POST',\n contentType: 'application/x-www-form-urlencoded; charset=utf-8',\n dataType: 'json',\n async: false,\n data: {\n // rolUsuario: prolUsuario,\n tipoId: ptipoID,\n id: pid,\n nombreUsuario: pnombreUsuario,\n nombre1: pnombre1,\n nombre2: pnombre2,\n apellido1: papellido1,\n apellido2: papellido2,\n correo: pcorreo,\n fechaNacimiento: pfechaNacimiento,\n edad: pedad,\n imgPerfil: pimgPerfil\n }\n });\n\n peticion.done(function (response) {\n respuesta = response;\n });\n\n peticion.fail(function (response) {\n respuesta = response;\n });\n\n return respuesta;\n}", "function onSubmitEditUser(e) {\r\n e.preventDefault();\r\n fetch(`https://contact-list-phase2-app.herokuapp.com/users/${id}`, {\r\n method: \"PATCH\",\r\n headers: {\r\n Accept: \"application/json\",\r\n \"content-Type\": \"application/json\",\r\n },\r\n body: JSON.stringify(formData),\r\n })\r\n .then((res) => res.json())\r\n .then((userData) => {\r\n setFormData(userData);\r\n });\r\n }", "function validarCampos6 () {\n\tif (!vacio($(\"#usu_nombre\").val(), $(\"#usu_nombre\").attr(\"placeholder\"))) {\n\t\tif (!vacio($(\"#usu_email\").val(), $(\"#usu_email\").attr(\"placeholder\"))) {\n\t\t\tif (correoValido($(\"#usu_email\").val())) {\n\t\t\t\tvar continua = true;\n\t\t\t\tvar id = parseInt($(\"#idUsuario\").val());\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (!isVacio($(\"#usu_FBid\").val())) {\n\t\t\t\t\tcontinua = false;\n\t\t\t\t\t\n\t\t\t\t\tif (entero($(\"#usu_FBid\").val(), $(\"#usu_FBid\").attr(\"placeholder\"))) {\n\t\t\t\t\t\tcontinua = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (continua) {\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\turl: \"lib_php/updUsuario.php\",\n\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tid: id,\n\t\t\t\t\t\t\tvalidarEmail: 1,\n\t\t\t\t\t\t\temail: $(\"#usu_email\").val()\n\t\t\t\t\t\t}\n\t\t\t\t\t}).always(function(respuesta_json) {\n\t\t\t\t\t\tif (respuesta_json.isExito == 1) {\n\t\t\t\t\t\t\tif (!isVacio($(\"#usu_FBid\").val())) {\n\t\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\t\turl: \"lib_php/updUsuario.php\",\n\t\t\t\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\t\tid: id,\n\t\t\t\t\t\t\t\t\t\tvalidarFBid: 1,\n\t\t\t\t\t\t\t\t\t\tFBid: $(\"#usu_FBid\").val()\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}).always(function(respuesta_json2){\n\t\t\t\t\t\t\t\t\tif (respuesta_json2.isExito == 1) {\n\t\t\t\t\t\t\t\t\t\tsaveUsuario();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\talert(respuesta_json2.mensaje);\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tsaveUsuario();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\talert(respuesta_json.mensaje);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function enviar() {\n if (validar()) {\n //Se envia la información por ajax\n $.ajax({\n url: 'UsuarioServlet',\n data: {\n accion: $(\"#usuarioAction\").val(),\n id: $(\"#idUsuario\").val(),\n nombre: $(\"#nom\").val(),\n apellidos: $(\"#ape\").val(),\n fechaNacimiento: $(\"#ano\").data('date'),\n correo: $(\"#email\").val(),\n direccion: $(\"#dir\").val(),\n telefono: $(\"#tel\").val(),\n celular: $(\"#cel\").val(),\n password: $(\"#pass\").val()\n },\n error: function () { //si existe un error en la respuesta del ajax\n mostrarMensaje(\"alert alert-danger\", \"Se genero un error, contacte al administrador (Error del ajax)\", \"Error!\");\n },\n success: function (data) { //si todo esta correcto en la respuesta del ajax, la respuesta queda en el data\n var respuestaTxt = data.substring(2);\n var tipoRespuesta = data.substring(0, 2);\n if (tipoRespuesta === \"C~\") {\n mostrarMensaje(\"alert alert-success\", respuestaTxt, \"Correcto!\");\n //$(\"#myModalFormulario\").modal(\"hide\");\n // consultarPersonas();\n } else {\n if(tipoRespuesta === \"P~\"){\n mostrarMensaje(\"alert alert-danger\", \"Ya existe un usuario con este número de cédula\", \"Error!\");\n $(\"#idUsuario\").addClass(\"has-error\");\n } \n else if (tipoRespuesta === \"E~\") {\n mostrarMensaje(\"alert alert-danger\", respuestaTxt, \"Error!\");\n } \n \n else {\n mostrarMensaje(\"alert alert-danger\", \"Se generó un error, contacte al administrador\", \"Error!\");\n }\n }\n\n },\n type: 'POST'\n });\n } else {\n mostrarMensaje(\"alert alert-danger\", \"Debe digitar los campos del formulario\", \"Error!\");\n }\n}", "updateList(e) {\n PersonaService.getTiposUser(e.target.value).then(data => this.setState({ Usuarios: data }))\n }", "function editarRegistro(datos, id_Reg, tipo) {\n const cantidad = Number(document.getElementById('cantidad').value);\n const ost = document.getElementById('ost').value;\n const siga = document.getElementById('siga').value;\n const servicio = document.getElementById('servicio').value;\n const detalle = document.getElementById('observaciones').value;\n const idRegistrador = document.getElementById('idRegistrador').value;\n const pesoTotal = document.getElementById('total').innerHTML;\n const nuevoIdAct = document.getElementById('ddlActividades').value;\n\n if(cantidad === ''){\n mostrarMensaje('error', 'Debe indicar una cantidad');\n document.getElementById(\"cantidad\").focus();\n } else if(cantidad === 0){\n mostrarMensaje('error', 'La cantidad no puede ser igual a 0');\n document.getElementById(\"cantidad\").focus();\n }else {\n Swal.fire({\n title: '¿Está seguro?',\n text: 'Se editará el consecutivo ' + (id_Reg.length === 1 ? datos.consecutivo : datos.consecutivo + ' y sus asociados'),\n icon: 'warning',\n showCancelButton: true,\n confirmButtonColor: '#3085d6',\n cancelButtonColor: '#d33',\n confirmButtonText: 'Si, editarlo'\n }).then((result) => {\n if (result.value) {\n // Se definen los datos que se van a enviar al fetch\n const data = new FormData();\n data.append('id_Reg', id_Reg);\n data.append('ost', ost);\n data.append('siga', siga);\n data.append('numServicio', servicio);\n data.append('cantidad', cantidad);\n data.append('pesoTotal', pesoTotal);\n data.append('observaciones', detalle);\n data.append('idRegistrador', idRegistrador);\n data.append('nuevoIdAct', nuevoIdAct);\n data.append('tipo', tipo);\n\n // Conexión del fetch al archivo php\n fetch('inc/modelos/modelo-registro.php', {\n method: 'POST',\n body: data\n })\n .then(respuestaExitosa) // Respuesta exitosa llama la función\n .catch(mostrarError); // Respuesta negativa llama la función\n\n // Si la ejecución del AJAX es correcta se verifica la respuesta\n function respuestaExitosa(response){\n if(response.ok) { // Si la respuesta en ok se llama la función para mostrar los resultados\n response.json().then(mostrarResultado);\n } else { // Si la respuesta no es ok se muestra el error\n mostrarError('status code: ' + response.status);\n }\n }\n\n // Se muestran los resultados devueltos en el JSON\n function mostrarResultado(respuesta){\n \n // Si la respuesta es correcta\n if(respuesta.estado === 'correcto') { \n mostrarMensaje('success', 'Modificación de Registro Exitoso') ; \n \n // Se oculta el modal de cierre de registro\n $('#modalAccionesReg').modal('hide');\n \n // Se actualiza la tabla\n var table = $('#tablaRegistros').DataTable();\n table.ajax.reload();\n\n }else if(respuesta.estado === 'incorrecto') {\n mostrarMensaje('error', 'No se realizó la modificación del registro'); \n } else {\n // Hubo un error\n if(respuesta.error) {\n mostrarMensaje('error', 'Algo falló al modificar el registro de actividad'); \n }\n if (respuesta.conexion) {\n mostrarMensaje('error', 'Falla en la conexión a la base de datos');\n }\n }\n }\n\n // Muestra el error si el AJAX no se ejecuta o la respuesta no es ok\n function mostrarError(err){\n console.log('Error', err);\n }\n }\n })\n \n }\n}", "function userInformationChange(){\n var protocolData = new Array();\n protocolData.push(4);\n var userData = getUserData($('#inputUserIdA').val());\n userData[1] = $('#inputImeA').val();\n userData[2] = $('#inputPrezimeA').val();\n userData[3] = $('#inputAdresaA').val();\n userData[4] = $('#inputPbrA').val();\n userData[5] = $('#inputMjestoA').val();\n userData[6] = $('#inputTelefonA').val();\n userData[8] = $('#inputOibA').val();\n if(!CheckOIB(userData[8])){\n $('#dropboxCol1Status').slideUp(\"slow\");\n $('#dropboxCol1Status').removeClass(\"info\").removeClass(\"error\").addClass(\"warning\");\n $('#dropboxCol1Status span').html(\"OIB je neispravan\");\n $('#dropboxCol1Status').slideDown(\"slow\");\n return;\n }\n protocolData = protocolData.concat(userData);\n var xml = sendToPhp(protocolData,'getSet_korisnici.php');\n var status = $(xml).find('status').text();\n accountMess('dropboxCol1Status',status);\n}", "function registerUser() {\n \n var data = $(\"#register_form\").serializeArray();\n var obj={};\n \n // Loop converts data serialized into an object.\n data.forEach(function(a){\n obj[a.name] = a.value;\n });\n \n for (var i in obj) {\n if (checkInput($(\"#\"+i))) {\n if (i === \"password\") {\n obj[i] = SHA256(obj[i]);\n } else if (i === \"email\") {\n data = JSON.stringify(obj);\n\n // Updates users.json file with a new user\n request(\"http://introtoapps.com/datastore.php?action=append&appid=215242834&objectid=users.json&data=\"+data, \"POST\", \"\", \"#register_error\", logOff);\n }\n } else {\n break;\n }\n } \n}", "function add_admin(){\n var name = document.getElementById(\"name\").value;\n var email = document.getElementById(\"email\").value;\n var phone = document.getElementById(\"phone\").value;\n var pin = document.getElementById(\"pin\").value;\n var role = document.getElementById(\"role_body\").value;\n var password = document.getElementById(\"password\").value;\n\n _loading(1);\n $.post('/api/v1/add_admin',{\n 'id': userData['id'],\n 'token': userData['token'],\n 'name': name,\n 'email': email,\n 'phone': phone,\n 'pin': pin,\n 'role': role,\n 'password': password\n }, function (e) {\n if(e['status'] === '00'){\n console.log(e['messages'])\n notif('success', 'Success!', e['messages']);\n\n }else{\n notif('danger', 'System Error!', e['messages']);\n }\n }).fail(function(){\n notif('danger', 'System Error!', 'Mohon kontak IT Administrator');\n }).done(function(){\n _loading(0);\n _admins_list(_page);\n });\n\n console.log(name);\n console.log(email);\n console.log(phone);\n console.log(role);\n console.log(\"oit\")\n}", "function ajaxCall(dataToServer, dataToChange) {\n $.ajax({\n url: 'updateAssignedUser',\n type: 'POST',\n dataType: 'json',\n data: dataToServer,\n success: function(dataToServer){\n if(dataToServer.isValid) {\n dataToChange.html(dataToServer.username);\n } else {\n alert('Please enter a registered Jonrah user');\n }\n }\n });\n}", "function cargarEditUsr(){\n\t//debugger;\n\t// parseo los usuarios para obtener los arreglos\n\tvar usuario_nombre = JSON.parse(localStorage.getItem(\"usuarios\"));\n\t// le asigno a la variable modificar el id que esta actualmente\n\tmodificar = JSON.parse(localStorage.getItem(\"id\"));\n\t// recorro el arreglo de arreglos\n\tfor (var i = 0; i < usuario_nombre.length; i++) {\n\t\t// recorro cada uno de los arreglos\n\t\tfor (var j = 0; j < usuario_nombre[i].length; j++) {\n\t\t\t// pregunto que si modificar es igual al id actual\n\t\t\tif(modificar == usuario_nombre[i][j]){\n\t\t\t\t// si es asi, a la variable da1 le asigno el valor de la posicion 0\n\t\t\t\tda1 = usuario_nombre[i][j];\n\t\t\t\t//a la variable da2 le asigno el valor de la posicion 1\n\t\t\t\tda2 = usuario_nombre[i][j+1];\n\t\t\t\t//a la variable da3 le asigno el valor de la posicion 2\n\t\t\t\tda3 = usuario_nombre[i][j+2];\n\t\t\t\t//a la variable da4 le asigno el valor de la posicion 3\n\t\t\t\tda4 = usuario_nombre[i][j+3];\n\t\t\t\t//a la variable da5 le asigno el valor de la posicion 4\n\t\t\t\tda5 = usuario_nombre[i][j+4];\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"numero\").value = da1;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"fullName\").value = da2;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"user\").value = da3;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"password\").value = da4;\n\t\t\t\t// luego obtengo el input respectivo y le asigno el valor correspondiente\n\t\t\t\tdocument.getElementById(\"password_repeat\").value = da5;\n\t\t\t}\n\t\t};\n\n\t}\n}", "function saveDataToAccount() {\n let id = document.getElementById(\"id\").value;\n let name = document.getElementById(\"name\").value;\n let oldName = document.getElementById(\"l_name\").value;\n let email = document.getElementById(\"email\").value;\n let oldEmail = document.getElementById(\"l_email\").value;\n let phone = String(document.getElementById(\"phone\").value);\n let oldPhone = String(document.getElementById(\"l_phone\").value);\n let location = document.getElementById(\"location\").value;\n let oldLocation = document.getElementById(\"l_location\").value;\n let password = document.getElementById(\"pwd\").value;\n let url = getContextPath() +'/userInfo'\n\n let data = new FormData();\n let changed = false;\n if (validateUpdateAccount(name, oldName, email, oldEmail, phone, oldPhone, location, oldLocation, password)) {\n let json = JSON.stringify({\n \"id\": id,\n \"name\": name,\n \"email\": email,\n \"phone\": phone,\n \"location\": location,\n \"password\": password\n })\n\n data.append('blob', new Blob([json], {type: 'application/json'}))\n changed = true\n }\n\n let userPic = document.getElementById(\"photo\").files[0];\n if (userPic) {\n data.append('datafile', userPic);\n changed = true\n }\n if (changed)\n $.post({\n url: url,\n data: data,\n cache: false,\n processData: false,\n contentType: false,\n async: false\n }).done(function () {\n ok()\n loadUserData()\n }).fail(function () {\n error()\n })\n\n}", "function updateUserRole(el) {\n //console.log(el.attr('data-id'));\n //console.log(el.attr('data-role-name'));\n //console.log(el.val());\n\n var dataModel = {\n UserId: el.attr('data-id'),\n RoleName: el.attr('data-role-name'),\n Add: el.val()\n };\n\n $.ajax({\n url: '/api/users/updaterole',\n type: 'POST',\n data: JSON.stringify(dataModel),\n contentType: 'application/json'\n })\n .fail(function () {\n showRoleAlert('alert-warning', 'User role update failed.');\n });\n}", "function updateUser(){\n let sessionStorage = new SessionStorageDB('token');\n var token = sessionStorage.get()[0]['token'];\n\n var id = document.getElementById('_id').value;\n var username = document.getElementById('username').value;\n var name = document.getElementById('name').value;\n var lastname = document.getElementById('lastname').value;\n var password = document.getElementById('password').value;\n var role = document.getElementById('role').value; \n \n axios.put(`http://localhost:4000/api/users/${id}`,{data:{'name':name,'lastname':lastname,'username':username,'password':password,'role':role}},\n {\n headers: {\n 'Content-Type': 'application/json;charset=UTF-8',\n 'Authorization': 'Bearer ' + token\n },\n })\n .then(function (res) {\n console.log(res.status)\n if (res.status == 200) {\n swal('User update correctly', \"\", \"success\");\n drawTable();\n clearInput();\n }\n })\n .catch(function (err) {\n console.log(err);\n })\n}", "function updateUser() {\r\n let email = $('#update-email').val();\r\n let fullname = $('#update-fullname').val();\r\n let role = $('#update-role').val();\r\n let cbRead;\r\n let cbCreate;\r\n let cbUpdate;\r\n let cbDelete;\r\n let cbUser;\r\n let cbBlog;\r\n let cbCommerce;\r\n let cbConsult;\r\n let cbSupply;\r\n let cbReport;\r\n\r\n if($('.cb2 #cb-read').is(':checked')) \r\n cbRead = 1;\r\n else\r\n cbRead = 0;\r\n if($('.cb2 #cb-create').is(':checked')) \r\n cbCreate = 1;\r\n else\r\n cbCreate = 0;\r\n if($('.cb2 #cb-update').is(':checked')) \r\n cbUpdate = 1;\r\n else\r\n cbUpdate = 0;\r\n if($('.cb2 #cb-delete').is(':checked')) \r\n cbDelete = 1;\r\n else\r\n cbDelete = 0;\r\n if($('.cb2 #cb-user').is(':checked')) \r\n cbUser = 1;\r\n else\r\n cbUser = 0;\r\n if($('.cb2 #cb-blog').is(':checked')) \r\n cbBlog = 1;\r\n else\r\n cbBlog = 0;\r\n if($('.cb2 #cb-commerce').is(':checked')) \r\n cbCommerce = 1;\r\n else\r\n cbCommerce = 0;\r\n if($('.cb2 #cb-consult').is(':checked')) \r\n cbConsult = 1;\r\n else\r\n cbConsult = 0;\r\n if($('.cb2 #cb-supply').is(':checked')) \r\n cbSupply = 1;\r\n else\r\n cbSupply = 0;\r\n if($('.cb2 #cb-report').is(':checked')) \r\n cbReport = 1;\r\n else\r\n cbReport = 0;\r\n\r\n let authority = {\r\n user: {\r\n read: cbRead,\r\n create: cbCreate,\r\n update: cbUpdate,\r\n delete: cbDelete\r\n },\r\n api: {\r\n user: cbUser,\r\n blog: cbBlog, \r\n commerce: cbCommerce, \r\n consult: cbConsult, \r\n supply: cbSupply, \r\n report: cbReport \r\n }\r\n }\r\n\r\n if(email == null || fullname == null || role == null) {\r\n alert(\"Form cannot be empty\");\r\n }\r\n else {\r\n $.get(address + ':3000/update-user', {email: email, fullname: fullname, role: role, authority: authority}, function(data) {\r\n if(data.ok == 1) {\r\n let userEmail = email;\r\n let query = `mutation updateSingleUser($userEmail:String!, $input:PersonInput) {\r\n updateUser(email: $userEmail, input: $input) {\r\n fullname\r\n }\r\n }`;\r\n\r\n fetch(address + ':3000/graphql', {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Accept': 'application/json',\r\n },\r\n body: JSON.stringify({\r\n query,\r\n variables: {\r\n userEmail,\r\n input: {\r\n email,\r\n fullname,\r\n role,\r\n authority\r\n }\r\n }\r\n })\r\n }).then(r => r.json()).then(function(data) {\r\n console.log(data);\r\n });\r\n alert(\"Update Success\");\r\n window.location.replace(address + \":3001/dashboard.html\");\r\n }\r\n else {\r\n alert(\"Update Error\");\r\n }\r\n });\r\n }\r\n}", "function updateUser() \n {\n swal({\n title: \"Attention\",\n text: \"Are you sure you want to update this user?\",\n type: \"warning\",\n showCancelButton: true,\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: \"Yes!\",\n cancelButtonText: \"No!\"\n /*closeOnConfirm: false,\n closeOnCancel: false*/\n }).then(function(result){\n\n if (result.value) \n {\n //name vairables\n var form = $('#form-update-user'); //form\n var userID = form.find('#user_id').val();\n var email = form.find('#user_email1').val();\n var avatar = form.find(\"#avatar1\").val();\n var table = $('#users').DataTable();\n var fields = form.find('input.required, select.required');\n \n blockUI();\n\n for(var i=0;i<fields.length;i++)\n {\n if(fields[i].value == \"\")\n {\n /*alert(fields[i].id);*/\n unblockUI(); \n showSimpleMessage(\"Attention\", \"All fields are required\", \"error\");\n $('#'+fields[i].id).focus();\n return false;\n }\n }\n\n if(!validateEmail(email))\n {\n unblockUI();\n showSimpleMessage(\"Attention\", \"Please provide a valid email address\", \"error\");\n return false;\n }\n else\n {\n if(avatar == \"\" || avatar == null)\n {\n $.ajax({\n type: 'PUT',\n url: API_URL_ROOT+'/users/'+userID,\n data: new FormData(form[0]),\n dataType: 'json',\n contentType: false,\n processData: false,\n cache: false,\n headers:{'x-access-token':token},\n success: function(response)\n {\n if(response.error == false)\n {\n unblockUI();\n showSimpleMessage(\"Success\", response.message, \"success\");\n table.ajax.reload(null, false);\n }\n else\n {\n unblockUI();\n showSimpleMessage(\"Attention\", response.message, \"error\");\n } \n },\n error: function(req, status, error)\n {\n unblockUI();\n showSimpleMessage(\"Attention\", \"ERROR - \"+req.status+\" : \"+req.responseText, \"error\");\n }\n }); \n }\n else\n {\n var extension = avatar.split('.').pop().toLowerCase();\n //Create array with the file extensions that we wish to upload\n var validFileExtensions = ['jpeg', 'jpg', 'png'];\n var file_length = $(\"#avatar1\").get(0).files.length;\n\n if($.inArray(extension, validFileExtensions) == -1)\n {\n //invalid avatar format\n unblockUI();\n $(\"#avatar1\").focus();\n showSimpleMessage(\"Attention\", \"Avatar must be a jpeg, jpg, png, gif file formats\", \"error\");\n return false;\n } \n else if($(\"#avatar1\").get(0).files[0].size > (1024 * 200)) \n {\n //user image is more than 1MB\n unblockUI();\n $(\"#avatar1\").focus();\n showSimpleMessage(\"Attention\", \"Avatar must not be more than 200KB in size\", \"error\");\n return false;\n } \n else\n {\n $.ajax({\n type: 'PUT',\n url: API_URL_ROOT+'/users/'+userID,\n data: new FormData(form[0]),\n dataType: 'json',\n contentType: false,\n processData: false,\n cache: false,\n headers:{'x-access-token':token},\n success: function(response)\n {\n if(response.error == false)\n {\n unblockUI();\n showSimpleMessage(\"Success\", response.message, \"success\");\n form.find(\"#avatar1\").val('');\n form.find('#imgprev1').slideDown(1000);\n table.ajax.reload(null, false);\n }\n else\n {\n unblockUI();\n showSimpleMessage(\"Attention\", response.message, \"error\");\n } \n },\n error: function(req, status, error)\n {\n unblockUI();\n showSimpleMessage(\"Attention\", \"ERROR - \"+req.status+\" : \"+req.responseText, \"error\");\n }\n });\n }\n } \n }\n } \n else \n {\n showSimpleMessage('Canceled', 'Process Abborted', 'error');\n }\n });\n }", "function Update() {\n var res = validateUpdate();\n if (res == false) {\n return false;\n }\n \n var sv = {\n ID: $('#ID').val(),\n MaSV: $('#SuaMasv').val(),\n facultyId: $('.ddlKhoaHoc2 #KhoaHoc').val(),\n FirstName: $('#SuaHo').val(),\n LastName: $('#SuaTen').val(),\n Phone: $('#SuaSdt').val(),\n Email:$('#SuaEmail').val(),\n Address:$('#SuaDc').val(),\n Birthday:$('#SuaNs').val(),\n Sex: $(\"#SuaGt\").val()\n };\n $.ajax({\n url: \"/Student/Update\",\n data: JSON.stringify(sv),\n type: \"POST\",\n contentType: \"application/json;charset=utf-8\",\n dataType: \"json\",\n success: function (result) {\n changeDropKhoaHoc($(\"#KhoaHoc\").val())\n $('#suasvthuctap').modal('hide');\n toastr.success('Cập nhật thành công !');\n\n },\n error: function (errormessage) {\n toastr.error('Cập nhật thất bại !');\n }\n });\n}", "function inicializar_ajax_editar_persona_POST(id_persona_a_editar){\n //vamos a obtener en una variable, el formulario creado por Django con los datos de la persona a editar, el cual despues le vamos aponer una escucha\n var form_edicion_persona = document.getElementById('formulario_de_edicion_de_persona');\n\n //aqui vamos a poner a la escucha el formulario del evento de submit, para que en el momentod e que le demos en enviar, no la mande de una vez si no que primero vamos a iniciar una funcion la cual nos ayudara a aobtener los datos y a enviarlos por AJAX, para que se vea asincronico\n form_edicion_persona.addEventListener('submit', inicializar_ajax_editar_persona_POST_2, false);\n\n //aqui vamos a hacer la funcion de inicializar_ajax_editar_persona_POST_2, la cual obtendra los datos y los enviara por AJAX a Django\n // le pasamos por parametro el evento, en el cual mas adelante vamos a obtener el objetivo del mismo\n function inicializar_ajax_editar_persona_POST_2(e){\n //primero vamos a hacer la variable que tendra la peticionHTTP_editar_persona_POST\n var peticionHTTP_editar_persona_POST;\n\n //vamos a obtener la TR que tenemos que modicficar, segun el id de la persona\n var tr_a_modificar_edicion_persona = document.getElementById(`tres${id_persona_a_editar}`);\n\n //luego segun el tipo de navegador que estemos usando, asi mismo se va a crear la peticion XML\n if (window.XMLHttpRequest) {\n //si es chrome\n peticionHTTP_editar_persona_POST = new XMLHttpRequest();\n }else{\n //si es internet explorer\n peticionHTTP_editar_persona_POST = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n\n\n //luego vamos a hacer la funcion quese ejecutara en el momento o cada vez que el estado de la peticion cambie\n peticionHTTP_editar_persona_POST.onreadystatechange = function(){\n //aqui podremos colocar lo que queremos que aparesca en el momento de que la peticion este en proceso o que haya habido algun problema con la misma\n\n //aqui vamos ha hacer una condicion, la cual va a evaluar si la peticion esta en un estado de lista 4 y en un estado 200, quiere decir que se pudo obtener correctamente\n // entonces se va a ejecutar lo que tengamos dentro de la condicional\n if (peticionHTTP_editar_persona_POST.readyState === 4 && peticionHTTP_editar_persona_POST.status === 200) {\n //vamos a modificar la TR que tiene la informacion antigua\n tr_a_modificar_edicion_persona.innerHTML = peticionHTTP_editar_persona_POST.responseText;\n console.log(tr_a_modificar_edicion_persona)\n\n //ahora vamos a hacer la eliminacion del formulario para que no genere conflicto con los demas formularios de eliminacion o creaciones\n div_formulario_editar_persona.innerHTML = \"\";\n\n\n //con esto llamamos una funcion con jquery la cual nos cerrara la ventana de edicion de la persona para que despues de hacer los cambios pues que se cierre ya que no necesitamos mas esta ventana\n $('#div_editar_persona').modal('hide')\n\n //ahora vamos a hacer la insercion de la notificacion de que se edito la persona correctamente\n /*NOTIFICACIONES*/\n //aqui vamos a cambiarle la imagen al div el cual lleva la notificacion y pondremos una carita masomenos feliz\n imagen_notificacion_editar_persona.setAttribute('src', '/static/img/botones/notificaciones/bien_editado.gif');\n //aqui estamos removiento la clase notificacion para poder colocar otra, y esto lo hacemos con el fin de que la otra clase tiene propiedades de css diferentes a esta\n div_notificacion_editar_persona.classList.remove('notificacion');\n //aqui estamos colocando la otra clase, la cual tiene propiedades de css difirentes a la primera\n div_notificacion_editar_persona.classList.add('notificacion_editar_persona_correcto');\n\n //aqui estamos removiendo la clase generica de la imagen, esto con el fin de poer otra ya que queremos que las propiedades de css cambien\n imagen_notificacion_editar_persona.classList.remove('imagen_notificacion');\n //aqui estamos colocando la otra clase la cual tiene propiedades diferentes de css\n imagen_notificacion_editar_persona.classList.add('img_notificacion_correcto_editar_persona');\n\n //aqui estamos insertando en el em del HTML el texto el cual lleva la informacion de la persona creada\n texto_notificacion_editar_persona.innerHTML = \" \" + \"Se edita correctamente a \" + nombre_completo_para_notificacion_editar_persona + \".\" + \" Ya puedes ver el registro de \" + nombre_completo_para_notificacion_editar_persona + \" con las modificaciones hechas.\";\n\n //aqui con esta funcion lo que estamos haciendo es que despues de 10 segundos se vuelven y se coloquen todas las clases que venian por defecto para que todo vuelva a la normalidad y por ende se desaparesca\n setTimeout(function() {\n div_notificacion_editar_persona.classList.remove('notificacion_editar_persona_correcto');\n div_notificacion_editar_persona.classList.add('notificacion');\n imagen_notificacion_editar_persona.classList.remove('img_notificacion_correcto_editar_persona');\n imagen_notificacion_editar_persona.classList.add('imagen_notificacion');\n }, 10000)\n /*NOTIFICACIONES*/\n\n\n\n\n //luego iniciamos todas las funciones que hemos hecho hasta ahora para que el nuevo registro que insertamos tambien tenga las mismas escuchas de eventos\n iniciar_ajax_crear_aplicacion();\n iniciar_ajax_crear_persona();\n iniciar_ajax_eliminar_persona();\n iniciar_ajax_editar_persona();\n iniciar_ajax_eliminar_persona_aplicacion();\n }\n }\n\n //aqui vamos a hacer la funcion de enviar de informacion ajax post 2, la cual llevara por parametro la url o los datos a enviar\n function enviar_datos_ajax_editar_persona_POST_2(data) {\n //aqui vamos a hacer 3 cosas con la peticionHTTP, la primero es que vamos a abrirla y este metodo llevara 3 parametros, el primero es el metodo de envio de la informacion el cual sera POST, el segundo es la url sin datos, ya que no se pueden mandar asi por que es POST\n // y el tercer paramtro es true, ya que la peticion es de metodo asincronico\n peticionHTTP_editar_persona_POST.open('POST', 'editar_persona', true);\n //luego aqui con este metodo indicamos que los datos vana a estar de alguna manera cifrados con un protocolo para que no se puedan leer\n peticionHTTP_editar_persona_POST.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n //y aqui vamos a enviar la informacion por medio de este metodo y no como simepre lo haciamos por GET\n peticionHTTP_editar_persona_POST.send(data);\n }\n\n //vamos a evitar que el formulario se envie verdaderamente por medio de la siguiente funcion\n e.preventDefault();\n //vamos a empezar a obtener los datos, vamos a empezar por el token\n var token = `csrfmiddlewaretoken=${form_edicion_persona[0].value}&`;\n\n //vamos a obtener el id de la persona a editar\n var id = `id=${id_persona_a_editar}`;\n\n //ahora vamos a obtener el nombre completo de la persona\n var nombre_completo = `&nombre_completo=${document.getElementById('id_nombre_completo').value}`;\n\n /*NOTIFICACIONES*/\n //aqui vamos ahacer una variable global, la cual vamos a manejar en el codigo de la notificacion de la persona editada\n var nombre_completo_para_notificacion_editar_persona = document.getElementById('id_nombre_completo').value\n /*NOTIFICACIONES*/\n\n //ahora el id del cargo que le asignamos\n var cargo = `&cargo=${document.getElementById('id_cargo').value}`;\n\n //vamos a obtener los datos de la ubicacion de la persona\n var ubicacion = `&ubicacion=${document.getElementById('id_ubicacion').value}`;\n\n //vamos a obtener los datos de la ubicacion del centro de la persona\n var centro = `&centro=${document.getElementById('id_centro').value}`;\n\n //ahora vamos a hacer la URL completa con la informacion obtenida anteriormente\n var url = token + id + nombre_completo + cargo + ubicacion + centro;\n console.log(url)\n\n //luego vamos a hacer el envio de la informacion a la funcion de enviar peticion ajax post 2\n enviar_datos_ajax_editar_persona_POST_2(url);\n\n }\n }", "function enviar() {\n if (!validar()) {\n mostrarMensaje(\"alert alert-danger\", \"Debe digitar los campos del formulario\", \"Error!\");\n } else if (!validarTamCampos()) {\n mostrarMensaje(\"alert alert-danger\", \"Tamaño de los campos marcados Excedido\", \"Error!\");\n } else {\n //Se envia la información por ajax\n $.ajax({\n url: 'UsuarioServlet',\n data: {\n accion: $(\"#usuariosAction\").val(),\n idUsuario: $(\"#idUsuario\").val(),\n password: $(\"#password\").val(),\n nombre: $(\"#nombre\").val(),\n apellido1: $(\"#primerApellido\").val(),\n apellido2: $(\"#segundoApellido\").val(),\n correo: $(\"#correo\").val(),\n fechaNacimiento: $(\"#fechaNacimiento\").data('date'),\n direccion: $(\"#direccion\").val(),\n telefono1: $(\"#telefono1\").val(),\n telefono2: $(\"#telefono2\").val(),\n tipo: \"normal\"\n },\n error: function () { //si existe un error en la respuesta del ajax\n mostrarMensaje(\"alert alert-danger\", \"Se genero un error, contacte al administrador (Error del ajax)\", \"Error!\");\n },\n success: function (data) { //si todo esta correcto en la respuesta del ajax, la respuesta queda en el data\n var respuestaTxt = data.substring(2);\n var tipoRespuesta = data.substring(0, 2);\n if (tipoRespuesta === \"C~\") {\n mostrarModal(\"myModal\", \"Exito\", \"Usuario agregado Correctamente!\", \"true\");\n limpiarForm();\n } else {\n if (tipoRespuesta === \"E~\") {\n mostrarMensaje(\"alert alert-danger\", respuestaTxt, \"Error!\");\n } else {\n mostrarMensaje(\"alert alert-danger\", \"Se genero un error, contacte al administrador\", \"Error!\");\n }\n }\n },\n type: 'POST'\n });\n }\n}", "function login () {\n \n var value_email_login = document.getElementById('login_email').value;\n var value_num_afiliacion_login = document.getElementById('login_num_afiliacion').value;\n\n if (value_email_login && value_num_afiliacion_login) {\n\n var objUsuario = Usuario(value_email_login, value_num_afiliacion_login);\n\n var objUsuario_json = JSON.stringify(objUsuario);\n \n objAjax = AJAXCrearObj();\n objAjax.open('GET', './php/login_usuario.php?objUsuario_json='+objUsuario_json, true); // llamamos al php\n objAjax.send();\n objAjax.onreadystatechange=responder_login;\n\n } else {\n\n alert(\"Rellene todos los campos\");\n }\n}", "function checkValidMailUpTodos(\n newemailUpTodos,\n pass2UpTodos,\n nombreup2Todos,\n checkUpTodos,\n id\n) {\n // var url_base = $(\"#url_base\").val();\n fetch(\"https://sistemas.mininterior.gob.ar/desagenesis/api/perfiles/updateUsuario\", {\n method: \"PUT\",\n headers: new Headers({\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n }),\n body:\n \"email=\" +\n newemailUpTodos +\n \"&nombre=\" +\n nombreup2Todos +\n \"&owner=\" +\n checkUpTodos +\n \"&pass=\" +\n pass2UpTodos +\n \"&id=\" +\n id,\n })\n .then((resp) => resp.json())\n .then((respObj) => {\n //Espera la respuesta de la API y consulta siempre por 0 (cero), si es correcto.\n if (respObj.status == 0) {\n swal({\n title: \"Excelente!\",\n text: respObj.messege,\n icon: \"success\",\n }).then(function () {\n location.reload();\n });\n } else {\n swal({\n title: \"Algo Salió Mal!\",\n text: respObj.messege,\n type: \"danger\",\n }).then(function () {\n location.reload();\n });\n }\n })\n .catch((error) => {\n alert(error);\n });\n}", "function modifyUser() {\n\n //create a new form\n createForm();\n\n document.getElementById('inter-btn').addEventListener('click', function (e) {\n const name = document.getElementById('name').value;\n const website = document.getElementById('website').value;\n const companyName = document.getElementById('cmpName').value;\n const catchPhrase = document.getElementById('cmpCatch').value;\n const userid = document.getElementById('userid').value;\n\n let output = '';\n\n if (name !== '' && website !== '') {\n //create data to send to API\n const dat = {\n name: `${name}`,\n website: `${website}`,\n company: {\n name: `${companyName}`,\n catchPhrase: `${catchPhrase}`\n\n }\n }\n //Create Post Request\n http.put(`https://jsonplaceholder.typicode.com/users/${userid}`, dat, function (err, posts) {\n if (err) {\n output = `<h5>${err}</h5>`;\n } else {\n posts = JSON.parse(posts);\n output = `\n <h5 class=\"mt-2\"> The user with id : ${posts.id} is now modified!</h5>\n <div class=\"card card-body mb-2\">\n <h5>Name : ${posts.name}</h4>\n <p>Id : ${posts.id}</p>\n <p>Website : ${posts.website}</p>\n <h6> Company: </h6>\n <ul>\n <li>Name : ${posts.company.name}</li>\n <li>Catchphrase : ${posts.company.catchPhrase}</li>\n </ul>\n </div>\n `;\n }\n document.getElementById('output').innerHTML = output;\n });\n }\n e.preventDefault();\n });\n\n}", "function editRow() {\n $('#error_edit').html(\"\");\n if (validateEditUser() == true) {\n try {\n var xhr = new XMLHttpRequest();\n xhr.open(\"PUT\", \"http://localhost:8080/Server/UsersController?session=\" + sessionStorage.getItem('session'), true);\n\n var data = JSON.stringify({\n \"username\": $('#edit-username').val(),\n \"password\": $('#edit-password').val(),\n \"email\": $('#edit-email').val(),\n \"grade\": $('#edit-grade').val(),\n \"name\": $('#edit-name').val(),\n \"age\": $('#edit-age').val(),\n \"address\": $('#edit-address').val(),\n \"id\": $('#edit-id').val()\n });\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4 && xhr.status === 200) {\n var obj = JSON.parse(xhr.responseText);\n if (obj.result == true) {\n var res = JSON.parse(data);\n $('#tbody .targetRow:nth-child(' + tempIndex + ') td:nth-child(1)').html('<span>' + res.username + \"</span>\");\n $('#tbody .targetRow:nth-child(' + tempIndex + ') td:nth-child(2)').html('<span>' + res.password + \"</span>\");\n $('#tbody .targetRow:nth-child(' + tempIndex + ') td:nth-child(3)').html('<span>' + res.email + \"</span>\");\n $('#tbody .targetRow:nth-child(' + tempIndex + ') td:nth-child(4)').html('<span>' + $('#add-grade option:selected').text() + \"</span>\");\n $('#tbody .targetRow:nth-child(' + tempIndex + ') td:nth-child(5)').html('<span>' + res.name + \"</span>\");\n $('#tbody .targetRow:nth-child(' + tempIndex + ') td:nth-child(6)').html('<span>' + res.age + \"</span>\");\n $('#tbody .targetRow:nth-child(' + tempIndex + ') td:nth-child(7)').html('<span>' + res.address + \"</span>\");\n $('#tbody .targetRow:nth-child(' + tempIndex + ') td:nth-child(8)').html('<span>' + res.id + \"</span>\");\n }\n $('#error_edit').html(obj.errorMessage);\n } else if (xhr.status === 401) {\n alert('Unauthorized user!');\n } else if (xhr.status === 0) {\n $('#error_edit').html('Server is offline!');\n }\n }\n xhr.send(data);\n } catch (exception) {\n alert(\"Request failed\");\n }\n }\n}", "function eliminarRegistro(datos, id_Reg, tipo) {\n\n // Se verifica si se van a eliminar todos o solo uno\n const todos = document.getElementById('todos').checked;\n let regEliminar = [];\n\n if(todos === true){\n regEliminar = id_Reg;\n } else {\n regEliminar = [datos.id_reg_act];\n }\n\n const idRegistrador = document.getElementById('idRegistrador').value;\n const fechaApertura = datos.fecha_hora_apertura;\n const idGrupo = datos.grupo;\n\n Swal.fire({\n title: '¿Está seguro?',\n text: 'Se eliminará el consecutivo ' + (regEliminar.length === 1 ? datos.consecutivo : datos.consecutivo + ' y sus asociados'),\n icon: 'warning',\n showCancelButton: true,\n confirmButtonColor: '#3085d6',\n cancelButtonColor: '#d33',\n confirmButtonText: 'Si, eliminarlo'\n }).then((result) => {\n if (result.value) {\n // Se definen los datos que se van a enviar al fetch\n const data = new FormData();\n data.append('id_Reg', regEliminar);\n data.append('fecha_hora_apertura', fechaApertura);\n data.append('idRegistrador', idRegistrador);\n data.append('idGrupo', idGrupo);\n data.append('tipo', tipo);\n\n // Conexión del fetch al archivo php\n fetch('inc/modelos/modelo-registro.php', {\n method: 'POST',\n body: data\n })\n .then(respuestaExitosa) // Respuesta exitosa llama la función\n .catch(mostrarError); // Respuesta negativa llama la función\n\n // Si la ejecución del AJAX es correcta se verifica la respuesta\n function respuestaExitosa(response){\n if(response.ok) { // Si la respuesta en ok se llama la función para mostrar los resultados\n response.json().then(mostrarResultado);\n } else { // Si la respuesta no es ok se muestra el error\n mostrarError('status code: ' + response.status);\n }\n }\n\n // Se muestran los resultados devueltos en el JSON\n function mostrarResultado(respuesta){\n // Si la respuesta es correcta\n if(respuesta.estado === 'correcto') { \n mostrarMensaje('success', 'Eliminación de Registro Exitoso') ; \n \n // Se oculta el modal de cierre de registro\n $('#modalAccionesReg').modal('hide');\n \n // Se actualiza la tabla\n var table = $('#tablaRegistros').DataTable();\n table.ajax.reload();\n\n }else if(respuesta.estado === 'incorrecto') {\n mostrarMensaje('error', 'No se realizó la eliminación del registro'); \n } else {\n // Hubo un error\n if(respuesta.error) {\n mostrarMensaje('error', 'Algo falló al eliminar el registro de actividad'); \n }\n if (respuesta.conexion) {\n mostrarMensaje('error', 'Falla en la conexión a la base de datos');\n }\n }\n }\n\n // Muestra el error si el AJAX no se ejecuta o la respuesta no es ok\n function mostrarError(err){\n console.log('Error', err);\n }\n }\n })\n}", "function enviar_datos_ajax_editar_persona_POST_2(data) {\n //aqui vamos a hacer 3 cosas con la peticionHTTP, la primero es que vamos a abrirla y este metodo llevara 3 parametros, el primero es el metodo de envio de la informacion el cual sera POST, el segundo es la url sin datos, ya que no se pueden mandar asi por que es POST\n // y el tercer paramtro es true, ya que la peticion es de metodo asincronico\n peticionHTTP_editar_persona_POST.open('POST', 'editar_persona', true);\n //luego aqui con este metodo indicamos que los datos vana a estar de alguna manera cifrados con un protocolo para que no se puedan leer\n peticionHTTP_editar_persona_POST.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n //y aqui vamos a enviar la informacion por medio de este metodo y no como simepre lo haciamos por GET\n peticionHTTP_editar_persona_POST.send(data);\n }", "function insert_user_data(eThis) {\n var username = $('#txt-username');\n var password = $('#txt-password');\n var role = $('#txt-role option:selected').text();\n var status = $('#txt-status');\n\n if (username.val() == ''){\n alert(\"Insert Username\");\n username.focus();\n return;\n }else if (password.val() ==''){\n alert(\"Insert Password\");\n password.focus();\n return;\n }\n\n var frm = eThis.closest('form.form1');\n var frm_data = new FormData(frm[0]);\n $.ajax({\n url: 'action/insert_user.php',\n type: 'POST',\n data: frm_data,\n contentType: false,\n cache: false,\n processData: false,\n dataType: \"json\",\n // beforeSend: function (data) {\n // },\n success: function (data) {\n if (data.duplicate == true){\n alert(\"Duplicate Username\");\n }else {\n if (data.edit == true){\n table_data.find('tr:eq('+indexTr+') td:eq(1)').text(username.val());\n table_data.find('tr:eq('+indexTr+') td:eq(2)').text(role);\n table_data.find('tr:eq('+indexTr+') td:eq(3)').text(status.val());\n $('.popup').remove();\n }else {\n var row_data = '<tr>' +\n '<td>' + data.id + '</td>' +\n '<td style=\"text-align: left\">' + username.val() + '</td>' +\n '<td>' + role + '</td>' +\n '<td>' + status.val() + '</td>' +\n '<td>' + button_edit + '</td>' +\n '</tr>';\n $('#table_data').find('tr:eq(0)').after(row_data);\n username.val('');\n username.focus();\n password.val('');\n $('#txt-id').val(parseInt(data.id) + 1);\n }\n }\n count_data();\n }\n });\n }", "function editUsers(){\n\tvar position=JSON.parse(localStorage.getItem('CurrentUser')).Position;\n\tvar users= JSON.parse(localStorage.getItem('Users'));\n\tvar user =users[position];\n\tif(document.getElementById('widget_password').value !== document.getElementById('widget_password_confirmation').value){\n\t\talert(\"The password doesn't match\");\n\t\treturn;\n\t}\n\tuser.FirstName=document.getElementById('widget_first_name').value;\n\tuser.LastName=document.getElementById('widget_last_name').value;\n\tuser.UserName=document.getElementById('widget_userName').value;\n\tuser.Email=document.getElementById('widget_email').value;\n\tuser.Password=document.getElementById('widget_password').value;\n\tuser.Admin=document.getElementById('box').checked;\n\tdocument.getElementById('welcomeUser').innerHTML='Welcome '+ user.FirstName + ' ' + user.LastName;\n\tlocalStorage.setItem('Users',JSON.stringify(users));\n\tlocalStorage.setItem(\"CurrentUser\",JSON.stringify(user));\n\t$('.overlay-bg, .overlay-content').hide();\n\talert(\"The user has been edited successfully\");\n}", "function addUsers(event) {\n\n event.preventDefault();\n\n const target = event.target.elements;\n const fName = target[0].value;\n const lName = target[1].value;\n\n const data = {\n firstName: fName,\n lastName: lName,\n };\n\n const options = {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(data)\n };\n\n fetch(apiUrl, options)\n .then(resp => {\n if (resp.ok) {\n return resp.json();\n } else {\n Promise.reject('NEIN');\n }\n })\n .catch(err => console.error(err))\n .finally(loadUsers)\n}", "function agregarUsuarios(e){\n\te.preventDefault();\n\n\tvar peticion = new XMLHttpRequest();\n\tpeticion.open('POST', 'php/insertar.php');\n\n\t// Validar variables y quitar los espacios//\n\tusuario_nombre = formulario.nombre.value.trim();\n\t// Convertir el valor a entero\n\tusuario_edad = parseInt(formulario.edad.value.trim());\n\tusuario_pais = formulario.pais.value.trim();\n\tusuario_correo = formulario.correo.value.trim();\n\n\t// si formulario-valido es true envia los datos via ajax a archivo php\n\tif(formulario_valido()){\n\n\t\terror_box.classList.remove('active');\n\n\t\tvar parametros = 'nombre=' + usuario_nombre + '&edad=' + usuario_edad + '&pais=' + usuario_pais + '&correo=' + usuario_correo;\n\t\tpeticion.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\")\n\n\t\tloader.classList.add('active');\n\n\t\tpeticion.onload = function(){\n\t\t\t//carga el contenido de la base de datos\n\t\t\tcargarUsuarios();\n\t\t\t// Borra contenido de los text\n\t\t\tformulario.nombre.value = '';\n\t\t\tformulario.edad.value = '';\n\t\t\tformulario.pais.value = '';\n\t\t\tformulario.correo.value = '';\n\t\t};\n\t\tpeticion.send(parametros);\n\n\t\tpeticion.onreadystatechange = function(){\n\t\t\tif(peticion.readyState == 4 && peticion.status == 200){\n\t\t\t\tloader.classList.remove('active');\n\t\t\t}\n\t\t}\n\n\t}else{\n\t\terror_box.classList.add('active');\n\t\terror_box.innerHTML = 'Por favor complete el formulario correctamente';\n\t}\n}", "updateUsers(data) {\n var res = {\n status: \"fail\",\n reason: \"unknown\"\n }\n const [username, email, password] = [\n data.body.username,\n data.body.email,\n data.body.password,\n ]\n var data = fs.readFileSync('./database/users.json', 'utf-8');\n\n // Handle file error\n try {\n data = JSON.parse(data);\n } catch (e) {\n fs.writeFileSync('./database/usersbackup.json', data);\n fs.writeFileSync('./database/users.json', \"{}\");\n }\n\n if (!(email in data) && email !== \"\" && username !== \"\" & password !== \"\") {\n data[email] = [username, password];\n fs.writeFileSync('./database/users.json', JSON.stringify(data, null, 4))\n res.status = \"success\";\n }\n else {\n res.status = \"fail\";\n res.reason = \"This email is already registered with us\";\n }\n return res;\n }", "function user_info_submit_handler(e){\n // Check the user input. Helper function defined in index.js\n if (check_user_personal_information(e) === 0){\n return; // Input failed test so do not continue\n }\n\n // Make the changes to the databse by making a request to server\n // Prepear to make the server call\n let data = {\n first_name: e.data.first_name.val(),\n last_name: e.data.last_name.val(),\n username: e.data.username.val(),\n password: e.data.password1.val(),\n email: e.data.email.val(),\n user_id: login_account.user_id\n }\n const request = new Request(\"/editUserInfo\", {\n method: \"post\",\n body: JSON.stringify(data),\n headers: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': 'application/json'\n }\n });\n\n // Now we make the request, the server will take care of this\n fetch(request).then((res) => {\n // We handle the response given back from the server\n if (res.status === 200){\n // Make the changes locally\n login_account.first_name = e.data.first_name.val();\n login_account.last_name = e.data.last_name.val();\n login_account.username = e.data.username.val();\n login_account.password = e.data.password1.val();\n login_account.email = e.data.email.val();\n alert(\"Your personal information has been saved.\");\n return;\n }else {\n alert(\"Something went wrong try again. There may be a problem with the server at this time.\");\n }\n })\n}", "function estadoUser(idUser,estadoUsuario) {\n\n if (estadoUsuario==0) {\n estadoUsuario = 1;\n estado = \"Activo\";\n clase = \"badge badge-success classEstado\";\n }else{\n estadoUsuario = 0;\n estado = \"Inactivo\";\n clase =\"badge badge-danger classEstado\";\n } \n\n\n const data = new FormData();\n data.append('codigoUser',idUser);\n data.append('estadoUser',estadoUsuario); \n\n \n let url = \"ajax/usuarios.ajax.php\";\n \n fetch(url,{\n method:'POST',\n body: data\n\n }).then(resp=> resp.text())\n .then( ) \n\n \n}", "function informacionUsuarios(){\n $.ajax({\n url: \"https://localhost:3000/volvo/api/GU/GU_GESTION_USUARIOS\",\n headers: {'Authorization': 'Bearer ' + localStorage.getItem('token')},\n data: {\n \"accion\" : 'SELECT',\n \"idEstadoUsuario\" : $('#selectEstadoUsuario').val(),\n \"idAreaTrabajo\" : $('#selectAreaTrabajo').val()\n\n },\n dataType: \"json\",\n method: \"POST\",\n success: function(respuesta){\n if(respuesta.output.pcodigoMensaje == 0){\n for(i=0; i < respuesta.data.length; i++){\n $('#bodyTable').append(`\n <tr>\n <th>\n <input type=\"checkbox\" id=\"${respuesta.data[i].idUsuario}\" value=\"${respuesta.data[i].idUsuario}\" style=\"width:10px; height:100%;\"/> \n <label for=\"${respuesta.data[i].idUsuario}\"></label>\n </th>\n <td style=\"width:15px; text-align:center;\">${respuesta.data[i].idUsuario}</td>\n <td id=\"${'nombrePersona'+respuesta.data[i].idUsuario}\">${respuesta.data[i].nombrePersona}</td>\n <td id=\"${'nombreUsuario'+respuesta.data[i].idUsuario}\">${respuesta.data[i].nombreUsuario}</td>\n <td id=\"${'correoElectronico'+respuesta.data[i].idUsuario}\">${respuesta.data[i].correoElectronico}</td>\n <td id=\"${'numeroTelefono'+respuesta.data[i].idUsuario}\">${respuesta.data[i].numeroTelefono}</td>\n <td id=\"${'areaTrabajo'+respuesta.data[i].idUsuario}\">${respuesta.data[i].AreaTrabajo}</td>\n </tr>`\n );\n }\n }\n }\n });\n}", "function modificarTipoPerfil(){\n\tlet idTipoPerfil=$('#idMod').val();\n\tlet valorTipoPerfil=$('#valorTipoPerfilmod').val();\n\tlet form={id:idTipoPerfil, perfil:valorTipoPerfil}\n\tlet dataResp=ajaxRequest(`${URL_TARIFA}/${idTipoPerfil}/update`, form, \"modModificar\");\n\tif(!isEmptyObject(dataResp)){\n\t\t$('#tablaTipoPerfil').DataTable().ajax.reload();\n\t}\n}" ]
[ "0.71081597", "0.6977313", "0.69429994", "0.6906251", "0.68846804", "0.68843", "0.68794096", "0.68691546", "0.68672556", "0.6854354", "0.68448526", "0.6731379", "0.67258584", "0.67014265", "0.66931474", "0.6691615", "0.66669744", "0.6648613", "0.6638524", "0.6627828", "0.66175234", "0.66108364", "0.6603643", "0.65982074", "0.659252", "0.657008", "0.6564034", "0.6563472", "0.65625834", "0.65218025", "0.6511115", "0.65052205", "0.64800847", "0.647773", "0.6473526", "0.647083", "0.64688146", "0.6467358", "0.6440855", "0.63803834", "0.63777477", "0.63753134", "0.6373816", "0.6372897", "0.6370256", "0.6358006", "0.6357375", "0.6331545", "0.63138807", "0.6309146", "0.62988275", "0.6297428", "0.629538", "0.6289613", "0.62716264", "0.6255087", "0.6248089", "0.62476283", "0.62398016", "0.62357163", "0.6233467", "0.6229758", "0.6225612", "0.62245554", "0.6215946", "0.61998403", "0.6182272", "0.6175747", "0.617529", "0.61716425", "0.6160397", "0.6159705", "0.6146538", "0.614274", "0.613922", "0.6132268", "0.61318886", "0.6129094", "0.6128142", "0.61235", "0.6122591", "0.6117781", "0.610807", "0.6104004", "0.6099021", "0.6096337", "0.60763496", "0.6073528", "0.6062245", "0.605594", "0.6054556", "0.6053837", "0.6050147", "0.60326207", "0.6030273", "0.6029356", "0.6028976", "0.60289466", "0.6028192", "0.6026545", "0.60156715" ]
0.0
-1
int Bind (IDispatch, string, string)
Bind(IDispatch, string, string) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Component_BindingHandler() {}", "function Bind_A_Obound() {\r\n}", "bindResponder(_responder) {\n }", "bindResponder(_responder) {\n }", "function Bind_Obound() {\r\n}", "function Bind_A_A_A() {\r\n}", "function bindable(){\n\t\t\n\t}", "function Bind_A_Oother() {\r\n}", "function Bind_A_A_R() {\r\n}", "function simpleBind(context,fn){return function(value){fn.call(context,value);};}", "function BindFactory(){}", "function BindAndRun() {\r\n}", "function Bind_R() {\r\n}", "function bind(value){var lView=getLView();return bindingUpdated(lView,lView[BINDING_INDEX]++,value)?value:NO_CHANGE;}", "_bind() {\n\t\tthis._bindCaption();\n\t\tthis._bindChoices();\n\t}", "function bind(fn,ctx){function boundFn(a){var l=arguments.length;return l?l>1?fn.apply(ctx,arguments):fn.call(ctx,a):fn.call(ctx);}// record original fn length\nboundFn._length=fn.length;return boundFn;}", "function bind(fn,ctx){function boundFn(a){var l=arguments.length;return l?l>1?fn.apply(ctx,arguments):fn.call(ctx,a):fn.call(ctx);}// record original fn length\nboundFn._length=fn.length;return boundFn;}", "function bind(method,context){return function(){return method.apply(context,arguments);};}", "function bind(method,context){return function(){return method.apply(context,arguments);};}", "function bind_shim() {\n\n if (!Function.prototype.bind) {\n\n Function.prototype.bind = function(oThis) {\n\n if (typeof this !== \"function\") {\n // closest thing possible to the ECMAScript 5 internal IsCallable function\n throw new TypeError(\n \"Function.prototype.bind - what is trying to be bound is not callable\");\n }\n\n var fSlice = Array.prototype.slice, aArgs = fSlice.call(arguments, 1), fToBind = this;\n\n /**\n * @constructor\n */\n var fNOP = function() {\n\n };\n\n var fBound = function() {\n\n return fToBind.apply(this instanceof fNOP ? this : oThis || window, aArgs\n .concat(fSlice.call(arguments)));\n };\n\n fNOP.prototype = this.prototype;\n fBound.prototype = new fNOP();\n\n return fBound;\n };\n }\n\n}", "function BindObject(cbRef) {\n\t\tthis.bindTo = function(state) {\n\t\t\tif (state) {\n\t\t\t\tcbRef[1] = state;\n\t\t\t}\n\t\t};\n\t}", "function i(e){return o.bind(this,e)}", "function bind(fn,o) {\n return function() {\n fn.call(o);\n }\n}", "function bind(context, name) {\n return function() {\n return context[name].apply(context,arguments);\n }\n}", "function HostBindingDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "function Bind_A_Oliteral() {\r\n}", "function myBind(func, context, ...args) {\n //call\n //input: context, arg1 ...argN\n //output: func result\n\n //input: the same as func\n //out: func result\n return function (...funcArgs) {\n func.call(context, ...args, ...funcArgs);\n };\n}", "function IWindable() {}", "Add(ISWbemServicesEx, string, int, IDispatch) {\n\n }", "function simpleBind(context, fn) { // 14775\n return function(value) { // 14776\n fn.call(context, value); // 14777\n }; // 14778\n } // 14779", "function bind(value) {\n var lView = getLView();\n return bindingUpdated(lView, lView[BINDING_INDEX]++, value) ? value : NO_CHANGE;\n}", "function bind(value) {\n var lView = getLView();\n return bindingUpdated(lView, lView[BINDING_INDEX]++, value) ? value : NO_CHANGE;\n}", "function simpleBind(context, fn) {\n\t return function(value) {\n\t fn.call(context, value);\n\t };\n\t }", "function bind$1(fn,ctx){function boundFn(a){var l=arguments.length;return l?l>1?fn.apply(ctx,arguments):fn.call(ctx,a):fn.call(ctx);}// record original fn length\n\tboundFn._length=fn.length;return boundFn;}", "function HostBindingDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "function HostBindingDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "function HostBindingDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "_bind(...methods) {\n methods.forEach((method) => this[method] = this[method].bind(this));\n }", "function $bind(func, thisValue) {\n return function() {return func.apply(thisValue, arguments)}\n}", "constructor() { \n autoBind(this); \n }", "bind(key) {\n const binding = new binding_1.Binding(key.toString());\n this.add(binding);\n return binding;\n }", "function bind(value) {\n return bindingUpdated(viewData[BINDING_INDEX]++, value) ? value : NO_CHANGE;\n}", "function bind(eventName, element, callback) {if(element.addEventListener){element.addEventListener(eventName,callback,false);}else{if(element===window){element=document.body;}element.attachEvent(\"on\" + eventName,function(event){return callback.call(element,event);});}}", "function bind(fn, obj) {\n\t return function binded() {\n\t return fn.apply(obj, arguments);\n\t }\n\t}", "dispatcher(){ return this.dispatch.bind(this); }", "function bind( func, ob ) {\n\treturn function() {\n\t\treturn func.apply( ob, arguments );\n\t};\n}", "getBindingHandler (/* key */) {}", "bind(path, method, ship = this.authTokens.ship, appl = \"hall\", success, fail) {\n this.bindPaths = _.uniq([...this.bindPaths, path]);\n\n window.subscriptionId = window.urb.subscribe(ship, appl, path, \n (err) => {\n fail(err);\n },\n (event) => {\n success({\n data: event,\n from: {\n ship,\n path\n }\n });\n },\n (err) => {\n fail(err);\n });\n }", "function winBinding(foo) {\n console.log(this);\n return foo;\n}", "function bind(func, context) {\n return function() {\n return func.call(context, arguments)\n };\n}", "function binding (obj) {\n return function (name) {\n var _name = '_' + name;\n obj[_name] = obj[_name] || bind(obj, name);\n return obj[_name];\n }\n}", "function bind(fn, ctx) {\n\t function boundFn(a) {\n\t var l = arguments.length;\n\t return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);\n\t }\n\t // record original fn length\n\t boundFn._length = fn.length;\n\t return boundFn;\n\t}", "function bind(fn, ctx) {\n\t function boundFn(a) {\n\t var l = arguments.length;\n\t return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);\n\t }\n\t // record original fn length\n\t boundFn._length = fn.length;\n\t return boundFn;\n\t}", "function BindAjaxForm() {\n IObserver.call(this);\n}", "function windowBind (param) {\n console.log(this);\n}", "function bind(key, action) {\r\n bindings[key] = action; \r\n\r\n}", "autoBind(proto) {\n let methods = Object.getOwnPropertyNames(proto || this.constructor.prototype)\n .filter(prop => typeof this[prop] === \"function\");\n\n methods.filter(nonCoreMethods).forEach(method => {\n this[method] = this[method].bind(this);\n });\n }", "function simpleBind(context, fn) {\n return function (value) {\n fn.call(context, value);\n };\n }", "function _bind (fn, ctx, ...args) {\n function result (args2) {\n fn.apply(ctx, args.concat(args2))\n }\n result.prototype = fn.prototype\n return result\n}", "function newBind(fn,ctx) {\n return function () {\n return fn.call(ctx)\n }\n}", "function onBindEvent(name)\n\t{\n\t\tswitch(name)\n\t\t{\n\t\t\tcase 'CONNECTION_STATUS_CHANGED' :\n\t\t\t\tthis.emit('CONNECTION_STATUS_CHANGED', this.connectionStatus);\n\t\t\tbreak;\n\t\t}\n\t}", "function bind(fn, ctx) {\n function boundFn(a) {\n var l = arguments.length;\n return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);\n }\n // record original fn length\n boundFn._length = fn.length;\n return boundFn;\n}", "function bind(fn, ctx) {\n function boundFn(a) {\n var l = arguments.length;\n return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);\n }\n // record original fn length\n boundFn._length = fn.length;\n return boundFn;\n}", "function bind(fn, ctx) {\n function boundFn(a) {\n var l = arguments.length;\n return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);\n }\n // record original fn length\n boundFn._length = fn.length;\n return boundFn;\n}", "function bind(fn, ctx) {\n function boundFn(a) {\n var l = arguments.length;\n return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);\n }\n // record original fn length\n boundFn._length = fn.length;\n return boundFn;\n}", "function bind(fn, ctx) {\n function boundFn(a) {\n var l = arguments.length;\n return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);\n }\n // record original fn length\n boundFn._length = fn.length;\n return boundFn;\n}", "function bind(fn, ctx) {\n function boundFn(a) {\n var l = arguments.length;\n return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);\n }\n // record original fn length\n boundFn._length = fn.length;\n return boundFn;\n}", "function bind(fn, ctx) {\n function boundFn(a) {\n var l = arguments.length;\n return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);\n }\n // record original fn length\n boundFn._length = fn.length;\n return boundFn;\n}", "function bind(fn, ctx) {\n function boundFn(a) {\n var l = arguments.length;\n return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);\n }\n // record original fn length\n boundFn._length = fn.length;\n return boundFn;\n}", "function bind(fn, ctx) {\n function boundFn(a) {\n var l = arguments.length;\n return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);\n }\n // record original fn length\n boundFn._length = fn.length;\n return boundFn;\n}", "function bind(unwrapped) {\n if (!(unwrapped && unwrapped[CONTEXTS_SYMBOL])) {\n return unwrapped;\n }\n\n let wrapped = unwrapped;\n let unwrappedContexts = unwrapped[CONTEXTS_SYMBOL];\n Object.keys(unwrappedContexts).forEach(function (name) {\n let thunk = unwrappedContexts[name];\n wrapped = thunk.namespace.bind(wrapped, thunk.context);\n });\n return wrapped;\n }", "function Bind_Oliteral() {\r\n}", "function bind (fn, ctx) {\n\t function boundFn (a) {\n\t var l = arguments.length;\n\t return l\n\t ? l > 1\n\t ? fn.apply(ctx, arguments)\n\t : fn.call(ctx, a)\n\t : fn.call(ctx)\n\t }\n\t // record original fn length\n\t boundFn._length = fn.length;\n\t return boundFn\n\t}", "function bind (fn, ctx) {\n\t function boundFn (a) {\n\t var l = arguments.length;\n\t return l\n\t ? l > 1\n\t ? fn.apply(ctx, arguments)\n\t : fn.call(ctx, a)\n\t : fn.call(ctx)\n\t }\n\t // record original fn length\n\t boundFn._length = fn.length;\n\t return boundFn\n\t}", "function bind (fn, ctx) {\n\t function boundFn (a) {\n\t var l = arguments.length;\n\t return l\n\t ? l > 1\n\t ? fn.apply(ctx, arguments)\n\t : fn.call(ctx, a)\n\t : fn.call(ctx)\n\t }\n\t // record original fn length\n\t boundFn._length = fn.length;\n\t return boundFn\n\t}", "function bind (fn, ctx) {\n\t function boundFn (a) {\n\t var l = arguments.length;\n\t return l\n\t ? l > 1\n\t ? fn.apply(ctx, arguments)\n\t : fn.call(ctx, a)\n\t : fn.call(ctx)\n\t }\n\t // record original fn length\n\t boundFn._length = fn.length;\n\t return boundFn\n\t}", "function bind(e,t){return function(){return t.apply(e,arguments)}}", "function bind(fn /*: Function */, ctx /*: Object */) {\r\n if (!fn)\r\n { return false; }\r\n function boundFn(a) {\r\n var l /*: number */ = arguments.length;\r\n return l ? (l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a)) : fn.call(ctx);\r\n }\r\n // record original fn length\r\n boundFn._length = fn.length;\r\n return boundFn;\r\n }", "function NewBinding(message, name) {\nthis.name = name;\nthis.message = message;\nthis.say = function(){\n return `${this.name} has a message for you: ${this.message}.`\n}\n}", "function bind(fn, ctx) {\n function boundFn(a) {\n var l = arguments.length;\n return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);\n }\n // record original fn length\n boundFn._length = fn.length;\n return boundFn;\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }" ]
[ "0.652874", "0.6359866", "0.6313454", "0.6313454", "0.62571216", "0.6064689", "0.59890056", "0.59293824", "0.5873056", "0.583148", "0.5757355", "0.5699284", "0.569582", "0.5686329", "0.5585851", "0.55058354", "0.55058354", "0.5499269", "0.5499269", "0.54651004", "0.5430335", "0.5404316", "0.5373273", "0.53601706", "0.53386647", "0.53339666", "0.53115606", "0.53106284", "0.5276406", "0.5272306", "0.52676845", "0.52676845", "0.52509433", "0.52365416", "0.5233082", "0.5233082", "0.5233082", "0.52115846", "0.5204411", "0.51980585", "0.51942104", "0.5187074", "0.5180861", "0.5173928", "0.5123552", "0.51235056", "0.51168674", "0.50964266", "0.50893813", "0.50776297", "0.50588167", "0.5058582", "0.5058582", "0.5057803", "0.50482106", "0.5042819", "0.5037777", "0.5035881", "0.5024421", "0.50095725", "0.4997911", "0.49810517", "0.49810517", "0.49810517", "0.49810517", "0.49810517", "0.49810517", "0.49810517", "0.49810517", "0.49810517", "0.49768347", "0.49764174", "0.49611312", "0.49611312", "0.49611312", "0.49611312", "0.49594846", "0.49470076", "0.4946971", "0.49440485", "0.4928768", "0.4928768", "0.4928768", "0.4928768", "0.4928768", "0.4928768", "0.4928768", "0.4928768", "0.4928768", "0.4928768", "0.4928768", "0.4928768", "0.4928768", "0.4928768", "0.4928768", "0.4928768", "0.4928768", "0.4928768", "0.4928768", "0.4928768" ]
0.93775713
0
define functions 1. main slide funtion
function goToSlide(index){ $slideGroup.animate({left: -100 * index + "%"}, 400); currentIndex = index; update() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function main() {\n NodeList.prototype.forEach = HTMLCollection.prototype.forEach = Array.prototype.forEach\n\n slideEls = document.querySelectorAll('.presentation > div')\n\n // Specific slide tech\n $('pre, code').each(function(i, block) {\n hljs.highlightBlock(block)\n });\n\n // Set up\n getSlideNumberFromUrlFragment()\n document.querySelector('.presentation').classList.add('visible')\n showSlide(true, true)\n onSlideEnter(slideEls[currentSlideNumber], true)\n\n document.body.addEventListener('keydown', onKeyDown)\n document.body.focus()\n}", "function main() {\n landingPageEffects();\n introSlideShow();\n}", "function nextSlide() {\n \n}", "function showSlides() {\n slideIndex++;\n showSlidesByClick(slideIndex);\n}", "function currentSlide(n,p) {\r\n showSlides(slideIndex = n,p);\r\n \r\n}", "function main() {\n startSlideShowAnimation();\n renderProject();\n}", "function slidetweaks()\n{\n\tvar $ = jQuery;\n\n\t// Because of where this callback function is executed within \n\t// SlidesJS code I don't have access to sjs variable in here :(\n\n\t// put prev & next inside of main slide area so they can be positioned relative to it.\n\t$('.slidesjs-navigation').appendTo('.slidesjs-container');\n\n\t$('.slidesjs-slide').css('display','block');\n\t$('.slidesjs-slide img').each( function(index,element){ centerImage(element); } );\n\t$('.slidesjs-slide').css('display','none');\n\t$('.slidesjs-slide').first().css('display','block');\n}", "function main() {\n var images = [\n 'http://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png',\n 'http://www.google.com/services/images/phone-animation-results_2x.png',\n 'http://www.google.com/services/images/section-work-card-img_2x.jpg',\n 'http://gsuite.google.com/img/icons/product-lockup.png',\n 'http://gsuite.google.com/img/home-hero_2x.jpg'\n ];\n var [title, subtitle] = presentation.getSlides()[0].getPageElements();\n title.asShape().getText().setText(NAME);\n subtitle.asShape().getText().setText('Google Apps Script\\nSlides Service demo');\n images.forEach(addImageSlide);\n}", "function Initialize2()\n{\n const Slides = document.querySelectorAll('.slides1');\n const pages = document.querySelectorAll('section');\n let current=0;\n\n Slides.forEach((slide,index) => {\n slide.addEventListener('click', function(){\n changeDots(this);\n nextSlide(index);\n });\n });\n\n\n function changeDots(dot)\n {\n Slides.forEach(slide => {\n slide.classList.remove(\"active\");\n })\n\n dot.classList.add(\"active\");\n }\n\n function nextSlide(pageNumber)\n {\n const nextPage = pages[pageNumber];\n const currentPage = pages[current];\n\n const tl = new TimelineMax({defaults:{ease:\"power2.out\"}});\n\n tl.fromTo(currentPage , 0.8,{opacity:1,pointerEvents:\"all\"},{opacity:0,pointerEvents:\"none\"})\n .fromTo(nextPage,0.8,{opacity:0,pointerEvents:\"none\"},{opacity:1,pointerEvents:\"all\"},'-=0.4') \n\n current = pageNumber;\n }\n}", "function currentSlide(n) { // parameter holds slideIndex\n showSlides(slideIndex = n);\n} // end function", "function plusSlides(num) {\n //add or minus by 1 to slideIndex depending on\n //whether the user clicks right or left on the image slides,\n //(-1 left ,+1 right)\n slideIndex += num;\n //and pass it as an arguement to displaySlides()\n displaySlides(slideIndex);\n}", "function simpleSlideshow() {\n $('.slideshow--simple, .slideshow--research').on('init', (e, slick) => {\n $('.slick-dots, .slick-arrow').on('click', function() {\n $('.slideshow--simple, .slideshow--research').slick('slickPause');\n });\n });\n $('.slideshow--simple, .slideshow--research').slick({\n dots: true,\n arrows: false,\n fade: true,\n lazyLoad: true,\n autoplay: !reducedMotionState,\n autoplaySpeed: 7000,\n focusOnSelect: true\n });\n }", "function addSlide() {\r\n showSlides(slideIndex += 1);\r\n}", "function main(){\n //klik-functie van pijl naar rechts\n $('#arrow-next').click(function() {\n if ($(this).hasClass(\"disabled\")){\n return false\n }\n $(this).addClass(\"disabled\");\n var $sliderdots = $(\"#slider-dots\");\n var $thumbnails = $(\"#thumbnails\");\n var currentSlide = $thumbnails.find(\".active-list\");\n var nextSlide = currentSlide.prev();\n var currentDot = $sliderdots.find(\".active-dot\");\n var nextDot = currentDot.next();\n\n if(nextSlide.length === 0) {\n nextSlide = $thumbnails.children(\".Outer\").last();\n nextDot = $sliderdots.find(\".dot\").first();\n }\n\n var $yearinfo = $(\"#yearinfo\");\n var nextSlideEndYear = nextSlide.children(\":last\").find(\"p\").text().slice(-4);\n var nextSlideStartYear = nextSlide.children(\":first\").find(\"p\").text().slice(-4);\n var currentYear = $yearinfo.text();\n if (nextSlideEndYear != currentYear){\n $yearinfo.text(\"\");\n if (nextSlideStartYear == nextSlideEndYear){\n $yearinfo.text(nextSlideStartYear);\n }\n else if (nextSlideEndYear == \"\"){\n $yearinfo.text(nextSlideStartYear);\n }\n else if (nextSlideStartYear == \"\"){\n $yearinfo.text(nextSlideEndYear);\n }\n else{\n $yearinfo.text(nextSlideStartYear + \" - \" + nextSlideEndYear);\n }\n }\n\n $.when(\n currentSlide.fadeOut(500).removeClass('active-list')\n ).done(function(){\n currentSlide.addClass(\"hidden\")}\n ).done(function() {\n nextSlide.fadeIn(500).addClass('active-list').removeClass(\"hidden\")}\n ).done(function() {\n $('#arrow-next').removeClass(\"disabled\");\n currentDot.removeClass('active-dot');\n nextDot.addClass('active-dot');\n });\n\n return false\n });\n\n //klik-functie van pijl naar links\n $('#arrow-prev').click(function() {\n if ($(this).hasClass(\"disabled\")){\n return false\n }\n $(this).addClass(\"disabled\");\n var $thumbnails = $(\"#thumbnails\");\n var $sliderdots = $(\"#slider-dots\");\n var currentSlide = $thumbnails.find('.active-list');\n var prevSlide = currentSlide.next();\n var currentDot = $sliderdots.find('.active-dot');\n var prevDot = currentDot.prev();\n\n if(prevSlide.length === 0) {\n prevSlide = $thumbnails.find(\".Outer\").first();\n prevDot = $sliderdots.find('.dot').last();\n }\n\n var $yearinfo = $(\"#yearinfo\");\n var prevSlideEndYear = prevSlide.children(\":last\").find(\"p\").text().slice(-4);\n var prevSlideStartYear = prevSlide.children(\":first\").find(\"p\").text().slice(-4);\n var currentYear = $yearinfo.text();\n if (prevSlideStartYear != currentYear){\n $yearinfo.text(\"\");\n if (prevSlideEndYear == prevSlideStartYear){\n $yearinfo.text(prevSlideStartYear);\n }\n else if (prevSlideEndYear == \"\"){\n $yearinfo.text(prevSlideStartYear);\n }\n else if (prevSlideStartYear == \"\"){\n $yearinfo.text(prevSlideEndYear);\n }\n else{\n $yearinfo.text(prevSlideStartYear + \" - \" + prevSlideEndYear);\n }\n }\n\n $.when(\n currentSlide.fadeOut(500).removeClass('active-list')\n ).done(function(){\n currentSlide.addClass(\"hidden\")}\n ).done(function() {\n prevSlide.fadeIn(500).addClass('active-list').removeClass(\"hidden\")}\n ).done(function() {\n $('#arrow-prev').removeClass(\"disabled\");\n currentDot.removeClass('active-dot');\n prevDot.addClass('active-dot');\n });\n\n return false\n });\n\n //Checkbox \"Get all trips\"\n $('#filterall').change(function(){\n mindata = (this.checked)? -1 : 0;\n });\n\n $('#unitform').find('.unit').change(function(){\n var unitselection = $('input[name=unitradio]:checked', '#unitform').val().split(\" \");\n UNITSPEED = unitselection[1];\n UNITDIST = unitselection[2];\n UNITMULTIPLIER = unitselection[0];\n UNITMULTIPLIERDIST = (UNITMULTIPLIER == 3.6)? 1000 : 1;\n $(\"#distfilter\").children(\".dis\").prop('placeholder', UNITDIST);\n $(\"#speedfilter\").children(\".spe\").prop('placeholder', UNITSPEED);\n\n deleteTripInfo();\n lapse.getter.ExtractData(TripInfo);\n\n });\n $('#serverform').find('.server').change(function(){\n server = $('input[name=serverradio]:checked', '#serverform').val();\n total_refresh = true;\n });\n $(\"#FilterDateOn\").change(function(){\n if (this.checked){\n $(\"#FilterDateFrom,#FilterDateTo\").removeAttr(\"checked\");\n }\n });\n\n $(\"#FilterDateFrom\").change(function(){\n if (this.checked){\n $(\"#FilterDateOn\").removeAttr(\"checked\");\n }\n });\n\n $(\"#FilterDateTo\").change(function(){\n if (this.checked){\n $(\"#FilterDateOn\").removeAttr(\"checked\");\n }\n });\n\n //Herladen\n $(\"#refresh\").click(function () {\n\n spinner();\n var unitselection = $('input[name=unitradio]:checked', '#unitform').val().split(\" \");\n SetDates();\n SetSpeed();\n SetDistances();\n $(\"#loadicon\").fadeIn({\n complete:function(){\n $(\"#groupinfo\").show();\n $(\"#nodata\").hide();\n $(\"#slider-dots\").empty();\n $(\"#thumbnails\").empty();\n if (!total_refresh) {\n lapse.getter.ExtractAverageMax(AllTrips);\n thumbnail(AllTrips);\n }\n else {\n groupURL = \"http://dali.cs.kuleuven.be:\" + server + \"/qbike/trips?groupID=\" + groupID;\n mapsloaded();\n total_refresh = false;\n }\n }\n });\n $(\"#tripinfo\").slideUp({\n duration:\"slow\",\n complete: deleteTripInfo()\n });\n\n });\n\n $(\"#Sort\").children(\":button\").click(function(){\n var prop = $(this).val();\n function changecaret($button){\n if($button.children(\".activesort\").length == 0){\n $(\"#Sort\").find(\".activesort\").removeClass(\"activesort\").hide();\n $button.children(\".up\").addClass(\"activesort\").show();\n lapse.getter.Sort(AllTrips, prop);\n }\n else{\n if($button.children(\".up.activesort\").length != 0){\n $button.children(\".up\").removeClass(\"activesort\").hide();\n $button.children(\".down\").addClass(\"activesort\").show();\n AllTrips.reverse();\n }\n else{\n $button.children(\".down\").removeClass(\"activesort\").hide();\n $button.children(\".up\").addClass(\"activesort\").show();\n AllTrips.reverse()\n }\n }\n }\n spinner();\n changecaret($(this));\n $(\"#loadicon\").fadeIn({\n complete:function(){\n $(\"#slider-dots\").empty();\n $(\"#thumbnails\").empty();\n lapse.getter.ExtractAverageMax(AllTrips);\n thumbnail(AllTrips);\n }\n });\n $(\"#tripinfo\").slideUp({\n duration:\"slow\",\n complete: deleteTripInfo()\n });\n });\n\n $(\"#close\").click(function () {\n $(\"#thumbnails\").find(\".thumbnail.active\").removeClass(\"active\");\n $(\"#tripinfo\").slideUp({\n duration:\"slow\",\n complete: function () {\n deleteTripInfo()\n }\n });\n });\n\n //\n //TIMELAPSE PLAY-PAUSE\n //\n $(\"#timelapse-play\").click(function(){\n $(\"#timelapse-pause\").removeClass(\"hidden\");\n $(this).addClass(\"hidden\");\n timelapse()\n });\n\n $(\"#timelapse-pause\").click(function(){\n $(\"#timelapse-play\").removeClass(\"hidden\");\n $(this).addClass(\"hidden\");\n clearInterval(interval);\n });\n}", "function previousSlide() {\n \n}", "function mainSlider() {\n if ($('.tp-banner').length) {\n $('.tp-banner').revolution({\n delay:9000,\n startwidth:1170,\n startheight: 800,\n hideThumbs:10,\n fullWidth:\"on\",\n forceFullWidth:\"on\",\n onHoverStop:\"off\",\n navigationType:\"none\",\n navigationStyle:\"preview4\",\n spinner:\"off\",\n hideTimerBar:\"on\"\n });\n }\n }", "function Initialize()\n{\n const Slides = document.querySelectorAll('.slides');\n const pages = document.querySelectorAll('section');\n let current=0;\n\n Slides.forEach((slide,index) => {\n slide.addEventListener('click', function(){\n changeDots(this);\n nextSlide(index);\n });\n });\n\n\n function changeDots(dot)\n {\n Slides.forEach(slide => {\n slide.classList.remove(\"active\");\n })\n\n dot.classList.add(\"active\");\n }\n\n function nextSlide(pageNumber)\n {\n const nextPage = pages[pageNumber];\n const currentPage = pages[current];\n\n const tl = new TimelineMax({defaults:{ease:\"power2.out\"}});\n\n tl.fromTo(currentPage , 0.8,{opacity:1,pointerEvents:\"all\"},{opacity:0,pointerEvents:\"none\"})\n .fromTo(nextPage,0.8,{opacity:0,pointerEvents:\"none\"},{opacity:1,pointerEvents:\"all\"},'-=0.4') \n\n current = pageNumber;\n }\n}", "function chosenSlide(clickedSlide) {\n // change slideIndex num to clickedSlide argument num\n slideIndex = clickedSlide;\n //pass slideIndex new value into displaySlides function\n displaySlides(slideIndex);\n}", "function slider(slide,slideBtnup,slideBtndn){\n \tvar that = this;\n \tthat.FNum=that.tempNum=$(slide+\" .slider_nav\"+\" .content\"+\" .box\").length-4;\n \t$(slide+\" .slider_nav\"+\" .content\"+\" .box\").each(function(index){\n \t\t$(this).on('click',function(){\n \t\t\tthat.swichBigimg(index);\n \t\t\tthat.swichBigtitle(index);\n \t\t});\n \t});\n \tthis.BtnUpClick = function(){\n \t\tif(that.FNum<that.tempNum){\n \t\t\t$(slideBtndn).off('click');\n \t\t\tthat.FNum++;\n \t\t\t$(slide+\" .slider_nav\"+\" .content_img\").animate({top: '+=140',}, 500, function() {\n \t\t\t\t$(slideBtndn).on('click',that.BtnDnClick)});\n \t\t}\n \t\t\n \t},\n \tthis.BtnDnClick = function(){\n \t\tif(that.FNum>0){\n \t\t\t$(slideBtnup).off('click');\n \t\t\tthat.FNum--;\n \t\t\t$(slide+\" .slider_nav\"+\" .content_img\").animate({top: '-=140',}, 500, function() {\n \t\t\t\t$(slideBtnup).on('click',that.BtnUpClick)});\n \t\t}\n \t},\n \tthis.swichBigimg = function(index){\n \t\t$(slide+\" .slider_content\"+\" .lazy\").each(function(index){\n \t\t\t$(this).animate({opacity: 0}, 300);\n \t });\n \t $($(slide+\" .slider_content\"+\" .lazy\")[index]).animate({opacity: 1}, 300);\n \t $($(slide+\" .slider_content\"+\" .lazy\")[index]).css('display','block');\n \t $($(slide+\" .slider_content\"+\" .lazy\")[index]).lazyload();\n \t},\n \tthis.swichBigtitle = function(index){\n \t\t$(slide+\" .slider_content\"+\" .slider_content_title\"+\" .slider_content_smalltitle\").each(function(index){\n \t\t\t$(this).animate({opacity: 0}, 300);\n \t });\n \t $($(slide+\" .slider_content\"+\" .slider_content_title\"+\" .slider_content_smalltitle\")[index]).animate({opacity: 1}, 300);\n \t $($(slide+\" .slider_content\"+\" .slider_content_title\"+\" .slider_content_smalltitle\")[index]).css('display','block');\n \t}\n \t$(slideBtnup).on('click',this.BtnUpClick);\n \t$(slideBtndn).on('click',this.BtnDnClick);\n \t\tthat.swichBigimg(0);\n \tthat.swichBigtitle(0);\n }", "function showSlide()\r\n{\r\n // create objects\r\n const image1 = {file: \"ocean_beach_2.jpg\", description: \"Ocean Beach\", alt: \"Ocean Beach\"};\r\n const image2 = {file: \"back_beach_sorrento.jpg\", description: \"Sorrento Back Beach\", alt: \"Sorrento Back Beach\"};\r\n const image3 = {file: \"ocean_beach.jpg\", description: \"Ocean Beach\", alt: \"Ocean Beach\"};\r\n \r\n // using an array\r\n const images = [image1, image2, image3];\r\n \r\n // limit slideshow\r\n if (slideIndex >= images.length)\r\n {\r\n slideIndex = 0; // reset to the start\r\n }\r\n if (slideIndex === -1)\r\n {\r\n slideIndex = images.length-1; // reset to last slide \r\n }\r\n\r\n // display the slide\r\n const slideImage = document.querySelector(\".slides img\");\r\n slideImage.src = \"ICTWEB431_AE_Pro_1of2_SR1/\" + images[slideIndex].file;\r\n slideImage.alt = images[slideIndex].alt;\r\n\r\n // slides[slideIndex - 1].style.display = \"block\";\r\n\r\n // display description\r\n const description = document.querySelector(\".description\");\r\n description.innerHTML = images[slideIndex].description;\r\n\r\n // display the slide dot as the current dot\r\n // remove the class active from all dots\r\n const dotsList = document.getElementsByClassName(\"dot\");\r\n\r\n for (let i = 0; i < dotsList.length; i++)\r\n {\r\n dotsList[i].classList.remove(\"active\");\r\n }\r\n \r\n // set the class for the slide as \"active\" \r\n dotsList[slideIndex].classList.add(\"active\");\r\n\r\n}", "function mainBanner () {\r\n\tif($(\"#main_slider\").length) {\r\n\t\t$(\"#main_slider\").vegas({\r\n\t\t slides: [\r\n\t\t { src: \"images/home/slide-1.jpg\" },\r\n\t\t { src: \"images/home/slide-2.jpg\" },\r\n\t\t { src: \"images/home/slide-3.jpg\" },\r\n\t\t\t\t{ src: \"images/home/slide-4.jpg\" },\r\n\t\t\t\t{ src: \"images/home/slide-5.jpg\" },\r\n\t\t ],\r\n\r\n\t\t transition: [ 'fade', 'zoomOut', 'swirlLeft' ]\r\n\t\t});\r\n\r\n\t\t$('button#previous').on('click', function () {\r\n\t\t\t $(\"#main_slider\").vegas('options', 'transition', 'zoomOut').vegas('previous');\r\n\t\t\t});\r\n\r\n\t\t\t$('button#next').on('click', function () {\r\n\t\t\t $(\"#main_slider\").vegas('options', 'transition', 'slideLeft2').vegas('next');\r\n\t\t\t});\r\n\r\n\t}\r\n}", "function main() {\n var images = [\n 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png',\n 'http://www.google.com/services/images/phone-animation-results_2x.png',\n 'http://www.google.com/services/images/section-work-card-img_2x.jpg',\n 'http://gsuite.google.com/img/icons/product-lockup.png',\n 'http://gsuite.google.com/img/home-hero_2x.jpg'\n ];\n var [title, subtitle] = deck.getSlides()[0].getPageElements();\n title.asShape().getText().setText(NAME);\n subtitle.asShape().getText().setText('Google Apps Script\\nSlides Service demo');\n images.forEach(addImageSlide);\n}", "function setup_slideshow() {\n slide_count = img_array.length;\n current_slide_index = 0;\n set_current_slide(img_array[0].src);\n play();\n}", "function main_slider(){\r\n if ( $('#main_slider').length ){\r\n $(\"#main_slider\").revolution({\r\n sliderType:\"standard\",\r\n sliderLayout:\"auto\",\r\n delay:5000,\r\n disableProgressBar:\"off\",\r\n spinner : \"spinner7\",\r\n RewindatSlideStart:\"on\",\r\n NextSlideonEnd:\"on\",\r\n // stopAfterLoops : \"1\",\r\n // stopAtSlide:1,\r\n navigation: {\r\n onHoverStop: 'off',\r\n touch:{\r\n touchenabled:\"on\"\r\n },\r\n arrows: {\r\n style:\"zeus\",\r\n enable:true,\r\n hide_onmobile:true,\r\n hide_under:820,\r\n hide_onleave:true,\r\n hide_delay:200,\r\n hide_delay_mobile:1200,\r\n tmp:'<div class=\"tp-title-wrap\"> \t<div class=\"tp-arr-imgholder\"></div> </div>',\r\n left: {\r\n h_align: \"left\",\r\n v_align: \"center\",\r\n h_offset: 5,\r\n v_offset: 0\r\n },\r\n right: {\r\n h_align: \"right\",\r\n v_align: \"center\",\r\n h_offset: 5,\r\n v_offset: 0\r\n }\r\n },\r\n },\r\n responsiveLevels:[4096,1320,1199,992,767,480],\r\n gridwidth:[1170,1170,960,720,700,300],\r\n gridheight:[900,900,900,800,500,500],\r\n lazyType:\"smart\",\r\n fallbacks: {\r\n simplifyAll:\"off\",\r\n nextSlideOnWindowFocus:\"off\",\r\n disableFocusListener:false,\r\n }\r\n })\r\n }\r\n }", "function plusSlides(n) {\n\n}", "function init() {\n \n\tTweenLite.set($slides, {\n\t\tleft: \"-100%\"\n });\n\tgotoSlide(0, 0);\n}", "function mainSlider(){\n\n\n\t//SLIDER 1\n\t$('#carousel-example-generic').carousel({\n\t\tinterval: 10000\n\t});\n\n\t\t$('.carousel-indicators li').click(function(){\n\t\t\t$('#carousel-example-generic').carousel('pause');\n\t\t});\n\n\n\t\t//URL HASH\n\t\tvar url = document.location.toString();\n\t\tif (url.match('#')) {\n\t\t // Clear active item\n\t\t $('#carousel-example-generic .carousel-inner .item.active').removeClass('active');\n\t\t $('#carousel-example-generic .carousel-indicators li.active').removeClass('active');\n\n\t\t // Activate item number #hash\n\t\t $('.carousel-inner div:nth-child(' + url.split('#')[1] + ')').addClass('active');\n\t\t $('.carousel-indicators li:nth-child(' + url.split('#')[1] + ')').addClass('active');\n\t\t}\n\n\t\t$('#carousel-example-generic').bind('slid', function (e) {\n\t\t // Update location based on slide (index is 0-based)\n\t\t window.location.hash = \"#\"+ parseInt($('#carousel-example-generic .carousel-inner .item.active').index()+1);\n\t\t});\n\n\n}", "function main_slider(){\n if ( $('#main_slider').length ){\n $(\"#main_slider\").revolution({\n sliderType:\"standard\",\n sliderLayout:\"auto\",\n delay:400000,\n disableProgressBar:\"on\",\n navigation: {\n onHoverStop: 'off',\n touch:{\n touchenabled:\"on\"\n },\n arrows: {\n style:\"zeus\",\n enable:true,\n hide_onmobile:true,\n hide_under:767,\n hide_onleave:true,\n hide_delay:200,\n hide_delay_mobile:1200,\n tmp:'<div class=\"tp-title-wrap\"> \t<div class=\"tp-arr-imgholder\"></div> </div>',\n left: {\n h_align: \"left\",\n v_align: \"center\",\n h_offset: 50,\n v_offset: 0\n },\n right: {\n h_align: \"right\",\n v_align: \"center\",\n h_offset: 50,\n v_offset: 0\n }\n },\n },\n responsiveLevels:[4096,1199,992,767,480],\n gridwidth:[1170,1000,750,700,300],\n gridheight:[860,860,860,600,500],\n lazyType:\"smart\",\n fallbacks: {\n simplifyAll:\"off\",\n nextSlideOnWindowFocus:\"off\",\n disableFocusListener:false,\n }\n })\n }\n }", "function slideTo($url){\n\n function addCurrent($num){\n $('.slider').attr('data-slide', $num);\n }\n slider.css({\n marginLeft: 0\n });\n if($url === '#1'){\n slider.css({\n marginLeft: 0\n });\n\n addCurrent('1');\n }\n else if($url === '#2'){\n slider.css({\n marginLeft: '-'+slideWidth + 'px'\n });\n\n addCurrent('2');\n }\n else{\n slider.css({\n marginLeft: '-'+slideWidth*2 + 'px'\n });\n addCurrent('3'); \n }\n\n }", "function switchSlide () {\n grabNextSlide();\n loadSlide();\n }", "function moveSlide(n) { //moveSlide untuk button prev dan next\r\n index = index+n\r\n showSlides(index);\r\n}", "function run(x) {\n position = $(\"#carousel\").find(\".show\").index();\n if (x == 1)\n ++position;\n else\n --position;\n checker();\n changeCarousal(); //function call that actually changes slides\n }", "function make_slides(f) {\n var slides = {};\n var present_list = stimfile// _.shuffle(stims.concat(fillers)); //\n // var present_list = _.shuffle(fillers);\n slides.consent = slide({\n name : \"consent\",\n start: function() {\n exp.startT = Date.now();\n $(\"#consent_2\").hide();\n exp.consent_position = 0;\n },\n button : function() {\n if(exp.consent_position === 0) {\n exp.consent_position++;\n $(\"#consent_1\").hide();\n $(\"#consent_2\").show();\n } else {\n exp.go(); //use exp.go() if and only if there is no \"present\" data.\n }\n }\n });\n\n slides.i0 = slide({\n name : \"i0\",\n start: function() {\n exp.startT = Date.now();\n }\n });\n\n slides.trial = slide({\n name : \"trial\",\n present : present_list,\n start: function() {\n exp.startT = Date.now();\n },\n\n present_handle : function(stim) {\n // if stim is an attention check, pass html \n this.stim = stim;\n $(\".prompt\").html(\"<p><strong>\" + stim.stim + \"</strong></p>\"); /*\"<u>Speaker A</u>: <p class='hangingindent'>\" + stim.setup + \". \" + \n stim.question + \"</p><br>\" + \"<u>Speaker B</u>: <p class='hangingindent'><b>\" + \n stim.response + \".</b></p>\") ;*/\n},\nbutton: function(stim) {\n if ($('input[name=\"rating\"]:checked').val() === undefined) {\n $(\".error\").show();\n } else {\n $(\".error\").hide()\n /* use _stream.apply(this); if and only if there is\n \"present\" data. (and only *after* responses are logged) */\n /*if (this.stim.type == \"filler\" & this.stim.truefalse_question != \"na\" & $('input[name=\"truefalse\"]:checked').val() === undefined) {\n $('.truefalse-buttons').show()\n $('.vertical-radio-buttons').hide()\n $(\".prompt\").html(\"Given what you just read, is the following true or false: <p><b>\" +\n this.stim.truefalse_question + \"</b>.\") ;\n } else {\n if (this.stim.truefalse_question === \"na\") {\n truefalse_response = \"na\";\n } else {\n truefalse_response = $('input[name=\"truefalse\"]:checked').val();\n }*/\n this.log_responses();\n _stream.apply(this);\n $('input[name=\"rating\"]').attr('checked',false)\n //$('input[name=\"truefalse\"]').attr('checked',false)\n //$('.truefalse-buttons').hide()\n $('.vertical-radio-buttons').show()\n //}\n }\n },\n log_responses: function() {\n exp.data_trials.push({\n \"rating\" : $('input[name=\"rating\"]:checked').val(),\n \"stim\" : this.stim.stim,\n \"first_conj_subj\" : this.stim.first_conj_subj,\n \"last_conj_subj\" : this.stim.last_conj_subj,\n \"stim_type\" : this.stim.stim_type,\n \"predicate_type\" : this.stim.predicate_type,\n \"has_gapping\" : this.stim.has_gapping,\n \"has_negation\" : this.stim.has_negation,\n \"tense\" : this.stim.tense,\n \"verb\" : this.stim.verb,\n \"first_conj_arg\" : this.stim.first_conj_arg,\n \"last_conj_arg\" : this.stim.last_conj_arg,\n //\"question\" : this.stim.question,\n //\"answer\" : this.stim.response,\n //\"type\" : this.stim.type,\n //\"expression\" : this.stim.expr,\n //\"polarity\" : this.stim.polarity,\n //\"truefalse_question\" : this.stim.truefalse_question,\n //\"truefalse_answer\" : this.stim.truefalse_answer,\n //\"truefalse_response\" : truefalse_response,\n \"order\" : order,\n });\n order = order + 1;\n }\n });\n\n slides.instructions = slide({\n name : \"instructions\",\n button : function() {\n exp.go(); //use exp.go() if and only if there is no \"present\" data.\n }\n });\n\n slides.subj_info = slide({\n name : \"subj_info\",\n submit : function(e){\n //if (e.preventDefault) e.preventDefault(); // I don't know what this means.\n exp.subj_data = {\n language : $(\"#language\").val(),\n enjoyment : $(\"#enjoyment\").val(),\n asses : $('input[name=\"assess\"]:checked').val(),\n age : $(\"#age\").val(),\n gender : $(\"#gender\").val(),\n education : $(\"#education\").val(),\n comments : $(\"#comments\").val(),\n problems: $(\"#problems\").val(),\n fairprice: $(\"#fairprice\").val()\n };\n exp.go(); //use exp.go() if and only if there is no \"present\" data.\n }\n });\n\n slides.thanks = slide({\n name : \"thanks\",\n start : function() {\n exp.data= {\n \"trials\" : exp.data_trials,\n \"catch_trials\" : exp.catch_trials,\n \"system\" : exp.system,\n \"subject_information\" : exp.subj_data,\n \"time_in_minutes\" : (Date.now() - exp.startT)/60000\n };\n setTimeout(function() {turk.submit(exp.data);}, 1000);\n }\n });\n\n return slides;\n}", "function currentSlide(n) {\r\n showSlides(slideIndex = n);\r\n}", "function carrousel(){\n\t//el objetivo es establecer inline nuestra imagen con la que queremos jugar.\n var i;\n var x = document.getElementsByClassName(\"slide1\");\n for(i=0; i<x.length; i++){\n x[i].style.display = \"none\";\n }\n myIndex1++;\n if ( myIndex1 > x.length){myIndex1=1};\n x[myIndex1-1].style.display = \"inline\";\n\n x = document.getElementsByClassName(\"slide2\");\n for(i=0; i<x.length; i++){\n x[i].style.display = \"none\";\n }\n myIndex2++;\n if ( myIndex2 > x.length){myIndex2=1};\n x[myIndex2-1].style.display = \"inline\";\n\n x = document.getElementsByClassName(\"slide3\");\n for(i=0; i<x.length; i++){\n x[i].style.dispaly = \"none\";\n }\n myIndex3++;\n if ( myIndex3 > x.length){myIndex3=1};\n x[myIndex3-1].style.display = \"inline\";\n}", "function currentSlide(n) {\r\n showSlides(slideInd = n);\r\n}", "function showSlide() {\n slides[currentSlide].className = \"fds-slide\";\n currentSlide = (currentSlide + 1) % slides.length;\n slides[currentSlide].className = \"fds-slide is-visible\";\n updateNav();\n}", "function slideFunction(slide) {\n //setNextButton(true)\n // console.log(slide);\n // i++;\n // if (i == 4) {\n // setActiveButton(false);\n // setNextButton(true);\n // }\n // if (i < 5) {\n // setSlide(props.slides[i].title);\n // setNextSlide(props.slides[i].text);\n // setNextButton(true);\n // }\n var found1 = props.slides;\n var index1 = found1.findIndex((fruit1) => fruit1.title === slide);\n // console.log(index1)\n if (index1 == 3) {\n setActiveButton(false);\n }\n if (index1 < 4) {\n setSlide(found1[index1 + 1].title);\n setNextSlide(found1[index1 + 1].text);\n setNextButton(true);\n setAgainStart(true);\n }\n }", "function nextSlide() { showSlide(slideNumber + 1); }", "function startslides() {\n\tif(imgSearch) {\n\t\timgSearch.startSlides();\n\t}\n}", "function currentSlide(n){\n slideIndex = n;\n}", "function minimalSlider(){\r\n\r\n\t// Default view\r\n var minimalSwiper = $('.minimal-slider').swiper({\r\n\t\tslidesPerView:1,\r\n\t\tloop:true,\r\n\t});\r\n\r\n\t//init slider navigation arrow\r\n\r\n $('.minimal-slider-control .prev-arrow').on('click', function(e){\r\n e.preventDefault();\r\n minimalSwiper.swipePrev();\r\n });\r\n\r\n $('.minimal-slider-control .next-arrow').on('click', function(e){\r\n e.preventDefault();\r\n minimalSwiper.swipeNext();\r\n });\r\n}//end function", "function next() {\n changeSlide($nextel);\n }", "function initSimpleSlider() {\n\n showSlides(slideIndex);\n\n if (slides.length < 10) {\n total.textContent = `0${slides.length}`;\n } else {\n total.textContent = slides.length;\n }\n\n function showSlides(n) {\n if (n > slides.length) {\n slideIndex = 1;\n }\n if (n < 1) {\n slideIndex = slides.length;\n }\n\n slides.forEach((item) => item.classList.remove(\"show\"));\n\n slides[slideIndex - 1].classList.add(\"show\");\n\n if (slides.length < 10) {\n current.textContent = `0${slideIndex}`;\n } else {\n current.textContent = slideIndex;\n }\n }\n\n function plusSlides(n) {\n showSlides(slideIndex += n);\n }\n\n prev.addEventListener('click', function () {\n plusSlides(-1);\n });\n\n next.addEventListener('click', function () {\n plusSlides(1);\n });\n\n }", "function crearEx6() {\n sliderViatge();\n filtrarViatge();\n}", "function slideView(shortName, slide_num) { // direction is next or prev\n contentDiv = $('#ajax_wrapper'); // slide_wrapper\n var theURL = \"/connections/slideshow/slide/\" + shortName + \"/\" + slide_num + \"/\";\n getURL(theURL, contentDiv);\n}", "function main_slider4(){\n if ( $('#main_slider4').length ){\n $(\"#main_slider4\").revolution({\n sliderType:\"standard\",\n sliderLayout:\"auto\",\n delay:4000,\n disableProgressBar:\"on\",\n navigation: {\n onHoverStop: 'off',\n touch:{\n touchenabled:\"on\"\n },\n arrows: {\n style:\"zeus\",\n enable:true,\n hide_onmobile:true,\n hide_under:767,\n hide_onleave:true,\n hide_delay:200,\n hide_delay_mobile:1200,\n tmp:'<div class=\"tp-title-wrap\"> \t<div class=\"tp-arr-imgholder\"></div> </div>',\n left: {\n h_align: \"left\",\n v_align: \"center\",\n h_offset: 50,\n v_offset: 0\n },\n right: {\n h_align: \"right\",\n v_align: \"center\",\n h_offset: 50,\n v_offset: 0\n }\n },\n },\n responsiveLevels:[4096,1199,992,767,480],\n gridwidth:[1170,1000,750,700,300],\n gridheight:[954,954,750,600,500],\n lazyType:\"smart\",\n fallbacks: {\n simplifyAll:\"off\",\n nextSlideOnWindowFocus:\"off\",\n disableFocusListener:false,\n }\n })\n }\n }", "function nextSlide()\r\n{\r\n slideIndex++;\r\n showSlide();\r\n}", "function main_slider(){\r\n var mainSlider = $('#main_slider');\r\n if ( mainSlider.length ){\r\n mainSlider.revolution({\r\n sliderType:\"standard\",\r\n sliderLayout:\"auto\",\r\n delay:5000,\r\n disableProgressBar:\"on\",\r\n navigation: {\r\n onHoverStop: 'off',\r\n touch:{\r\n touchenabled:\"on\"\r\n },\r\n arrows: {\r\n style:\"normal\",\r\n enable:true,\r\n hide_onmobile:true,\r\n hide_under:992,\r\n hide_onleave:true,\r\n hide_delay:200,\r\n hide_delay_mobile:1200,\r\n left: {\r\n h_align: \"left\",\r\n v_align: \"center\",\r\n h_offset: 0,\r\n v_offset: 0\r\n },\r\n right: {\r\n h_align: \"right\",\r\n v_align: \"center\",\r\n h_offset: 0,\r\n v_offset: 0\r\n }\r\n },\r\n bullets: {\r\n enable:true,\r\n hide_onmobile:true,\r\n hide_under:768,\r\n style:\"hesperiden\",\r\n hide_onleave:false,\r\n direction:\"vertical\",\r\n h_align:\"left\",\r\n v_align:\"bottom\",\r\n h_offset:380,\r\n v_offset:0,\r\n space:10,\r\n tmp: \"\",\r\n },\r\n },\r\n responsiveLevels:[4096,1320,1199,992,767,480],\r\n gridwidth:[1170,1170,960,720,700,300],\r\n gridheight:[950,950,950,700,500,500],\r\n lazyType:\"smart\",\r\n fallbacks: {\r\n simplifyAll:\"off\",\r\n nextSlideOnWindowFocus:\"off\",\r\n disableFocusListener:false,\r\n }\r\n })\r\n }\r\n }", "function slider_sucks(argument) {\n\n var nextButton = document.getElementById('next');\n var prevButton = document.getElementById('prev');\n\n var slides = document.getElementsByClassName('slide');\n var currentSlide = 0;\n slides[currentSlide].style.display = 'block';\n\n var prev = slides.length - 1;\n var next = currentSlide + 1;\n\n nextButton.onclick = function () {\n slides[currentSlide].style.display = 'none';\n\n prev = currentSlide;\n currentSlide = next;\n next++;\n\n if (next >= slides.length) {\n next = 0;\n }\n\n slides[currentSlide].style.display = 'block';\n }\n\n\n prevButton.onclick = function () {\n slides[currentSlide].style.display = 'none';\n\n next = currentSlide;\n currentSlide = prev;\n prev--;\n\n if (prev < 0) {\n prev = slides.length - 1;\n }\n\n slides[currentSlide].style.display = 'block';\n }\n}", "function changeSlide(e) {\n // console.log(e);\n\n nextSlide = e.target.dataset.name;\n // if the statement is true\n if ( lastSlide == nextSlide) {\n // return exits (ends) the function\n // the code after (show, hide,..) doesn't get executed\n return;\n }\n\n // SHOW\n document.getElementById(nextSlide).style.display = 'grid';\n document.getElementById('btn-'+nextSlide).style.backgroundColor = \"#2896E0\";\n // HIDE\n document.getElementById(lastSlide).style.display = 'none';\n document.getElementById('btn-'+lastSlide).style.backgroundColor = \"#BEFCFE\";\n //SAVE\n lastSlide = nextSlide;\n \n \n playTimeLine(lastSlide);\n playTimeline(nextSlide);\n}", "function goToSlide(num) {\n myPresentation.goToSlide(num);\n displayNumberCurrentSlide();\n}", "function showNext(){\r\n\t$(\"#liveDemo-show\").html(\"\");//empty the box, to show the next slide\r\n\t$(\"#liveDemo-message\").hide();//hide the message box\r\n\t\r\n\tif(i<liveDemo.length){//make sure that we don't go further than number of slides\r\n\t\tif( typeof liveDemo[i][1] == 'number') liveDemo[i][1]= $('*').eq(liveDemo[i][1]);\r\n\t\t\r\n\t\tswitch(liveDemo[i][0]){//get the type of slide\r\n\t\t\t/***** COMMENT *****/\r\n\t\t\tcase \"comment\":\r\n\t\t\t\t$(\"#liveDemo-message\")//add the message to message box\r\n\t\t\t\t\t.show()\r\n\t\t\t\t\t.html(liveDemo[i][1]);\r\n\t\t\t\tcallNext(liveDemo[i][2]);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t/***** TAGGING *****/\r\n\t\t\tcase \"tag\":\r\n\t\t\t\tvar original = $(liveDemo[i][1]);\r\n\t\t\t\tvar element = clone(original,true);//copy the element\r\n\t\t\t\tvar offset = element.offset();//get original element's offset\r\n\t\t\t\tvar midPage= $(document).width()/2; ///get centre of page\r\n\t\t\t\t//place the message box according to position of\r\n\t\t\t\t//element relative to middle of page\r\n\t\t\t\tif(offset.left>midPage){\r\n\t\t\t\t\t$(\"#liveDemo-message\").css({'left':offset.left-165,\r\n\t\t\t\t\t\t\t\t\t\t\t 'top':offset.top,\r\n\t\t\t\t\t\t\t\t\t\t\t 'width':150\r\n\t\t\t\t\t\t\t\t\t\t\t })\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$(\"#liveDemo-message\").css({'left':offset.left+original.innerWidth()+10,\r\n\t\t\t\t\t\t\t\t\t\t\t 'top':offset.top,\r\n\t\t\t\t\t\t\t\t\t\t\t 'width':150\r\n\t\t\t\t\t\t\t\t\t\t\t })\r\n\t\t\t\t}\r\n\t\t\t\t//add the tag\r\n\t\t\t\t$(\"#liveDemo-message\")\r\n\t\t\t\t\t.fadeIn('slow')\r\n\t\t\t\t\t.html(liveDemo[i][2]);\r\n\t\t\t\tcallNext(liveDemo[i][3]);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t/***** CLICK *****/\r\n\t\t\tcase \"click\":\r\n\t\t\t\tvar original = $(liveDemo[i][1]);\r\n\t\t\t\tvar href = original.attr('href');\r\n\t\t\t\tvar element = clone(original);//copy the element\r\n\t\t\t\tvar offset = original.offset();//get original element's offset\r\n\t\t\t\tvar height = element.innerHeight();\r\n\t\t\t\tvar width = element.innerWidth();\r\n\t\t\t\t//position of the mouse\r\n\t\t\t\tvar cx = offset.left+width/2;\r\n\t\t\t\tvar cy = offset.top + height/2;\r\n\t\t\t\t//add the mouse\r\n\t\t\t\t$(\"#liveDemo-show\")\r\n\t\t\t\t\t.append('<img style=\"position:absolute; left:'+cx+'px; top:'+cy+'px\"'+\r\n\t\t\t\t\t\t\t'src=\"'+host+'icons/cursor.png\" />');\r\n\t\t\t\tsetTimeout(\"window.location = '\"+href+\"'\",1000)\r\n\t\t\t\tcallNext(\"mouse\");\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t/***** TYPE *****/\r\n\t\t\tcase \"type\":\r\n\t\t\t\tvar original = $(liveDemo[i][1])\r\n\t\t\t\tvar element = clone(original);//copy the element\r\n\t\t\t\telement.val('');//empty it\r\n\t\t\t\tvar offset = original.offset();//get original element's offset\r\n\t\t\t\tvar textArray = liveDemo[i][2].split('');//make an array from input text\r\n\t\t\t\tvar text = '';\r\n\t\t\t\tvar j =0;//j is number of characters from text showed on the box\r\n\t\t\t\t$(\"#liveDemo-show\").append(element);\r\n\t\t\t\telement\r\n\t\t\t\t\t.css(offset)\r\n\t\t\t\t\t.css({\"position\":\"absolute\",\"margin\":0});\r\n\t\t\t\t//typeWord function\r\n\t\t\t\tfunction typeWord(){\r\n\t\t\t\t\tif(j!=textArray.length){//if there's any character left, add it to the box\r\n\t\t\t\t\t\ttext+=textArray[j];\r\n\t\t\t\t\t\telement.val(text);\r\n\t\t\t\t\t\tj++;\r\n\t\t\t\t\t\tsetTimeout(typeWord,150);//show next character in 150 ms\r\n\t\t\t\t\t}else{//if no character left go to next slide\r\n\t\t\t\t\t\tcallNext(\"mouse\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\ttypeWord();//call the function\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t/***** SCROLL *****/\r\n\t\t\tcase \"scroll\":\r\n\t\t\t\tvar original = $(liveDemo[i][1]);\r\n\t\t\t\tif(original.get(0).tagName==undefined){\r\n\t\t\t\t\t//if tagName is undefined, it means we've scrolled on the actual page\r\n\t\t\t\t\t//and not it's elements, so we set element as body\r\n\t\t\t\t\telement = $('html, body');\r\n\t\t\t\t\t$(\"#liveDemo-blind\").hide();//so we show the whole page, to show scrolling\r\n\t\t\t\t\tsetTimeout(\"$('#liveDemo-blind').show();\",2001);//and show the blind again after scrolling is finished\r\n\t\t\t\t}else{\r\n\t\t\t\t\telement = clone(original);\r\n\t\t\t\t}\r\n\t\t\t\tvar top = liveDemo[i][2];//get the new position for scrolling to\r\n\t\t\t\telement.animate({scrollTop: top}, 2000);//animate scrolling for 2 seconds\r\n\t\t\t\tcallNext(\"mouse\");\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t/***** USER CLICK *****/\r\n\t\t\tcase \"userClick\":/***** EXPERIMENTAL *****/\r\n\t\t\t\tvar element = clone(liveDemo[i][1]);\r\n\t\t\t\tvar offset = liveDemo[i][1].offset();\r\n\t\t\t\tvar midPage= $(document).width()/2;\r\n\t\t\t\tif(offset.left>midPage){\r\n\t\t\t\t\t$(\"#liveDemo-message\").css({'left':offset.left-165,\r\n\t\t\t\t\t\t\t\t\t\t\t 'top':offset.top,\r\n\t\t\t\t\t\t\t\t\t\t\t 'width':150\r\n\t\t\t\t\t\t\t\t\t\t\t })\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$(\"#liveDemo-message\").css({'left':offset.left+$(liveDemo[i][1]).innerWidth()+10,\r\n\t\t\t\t\t\t\t\t\t\t\t 'top':offset.top,\r\n\t\t\t\t\t\t\t\t\t\t\t 'width':150\r\n\t\t\t\t\t\t\t\t\t\t\t })\r\n\t\t\t\t}\r\n\t\t\t\t$(\"#liveDemo-message\")\r\n\t\t\t\t\t.fadeIn('slow')\r\n\t\t\t\t\t.html('please click here');\r\n\t\t\t\tcallNext(element);\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t/***** USER TYPE *****/\r\n\t\t\tcase \"userType\":/***** EXPERIMENTAL *****/\r\n\t\t\t\tvar element = clone(liveDemo[i][1]);\r\n\t\t\t\tvar offset = liveDemo[i][1].offset();\r\n\t\t\t\tvar midPage= $(document).width()/2;\r\n\t\t\t\tif(offset.left>midPage){\r\n\t\t\t\t\t$(\"#liveDemo-message\").css({'left':offset.left-165,\r\n\t\t\t\t\t\t\t\t\t\t\t 'top':offset.top,\r\n\t\t\t\t\t\t\t\t\t\t\t 'width':150\r\n\t\t\t\t\t\t\t\t\t\t\t })\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$(\"#liveDemo-message\").css({'left':offset.left+$(liveDemo[i][1]).innerWidth()+10,\r\n\t\t\t\t\t\t\t\t\t\t\t 'top':offset.top,\r\n\t\t\t\t\t\t\t\t\t\t\t 'width':150\r\n\t\t\t\t\t\t\t\t\t\t\t })\r\n\t\t\t\t}\r\n\t\t\t\t$(\"#liveDemo-message\")\r\n\t\t\t\t\t.fadeIn('slow')\r\n\t\t\t\t\t.html('please type here');\r\n\t\t\t\tcallNext('mouse');\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}else{\r\n\t\t//if there's no slide left, remove all boxs and reset iterator\r\n\t\t$(\"#liveDemo-show,#liveDemo-blind,#liveDemo-message\").remove();\r\n\t\t$(\"#liveDemo-toolbar\").show();\r\n\t\ti = 0;\r\n\t}\r\n}", "function init() {\n\n //this thing is for hiding the second and the third image slide\n TweenLite.set(slide.not(active), { autoAlpha: 0 });\n\n //this thing is for hiding the second and the third text slide\n TweenLite.set(textSlide.not(active), { autoAlpha: 0 });\n\n }", "function init_appslide()\n {\n $('.join-us .carousel').carousel(\n {\n navigation: true,\n navigationText: [\n '<i class=\"fa fa-arrow-left\"></i>',\n '<i class=\"fa fa-arrow-right\"></i>'\n ],\n singleItem: true,\n autoPlay: true,\n pagination: false\n });\n }", "function currentSlide(n) {\n // Set slideIndex based on dot clicked and display\n showSlides(slideIndex = n);\n}", "function main_slider3(){\n if ( $('#main_slider3').length ){\n $(\"#main_slider3\").revolution({\n sliderType:\"standard\",\n sliderLayout:\"auto\",\n delay:4000,\n disableProgressBar:\"on\",\n navigation: {\n onHoverStop: 'off',\n touch:{\n touchenabled:\"on\"\n },\n arrows: {\n style:\"zeus\",\n enable:false,\n hide_onmobile:true,\n hide_under:767,\n hide_onleave:true,\n hide_delay:200,\n hide_delay_mobile:1200,\n tmp:'<div class=\"tp-title-wrap\"> \t<div class=\"tp-arr-imgholder\"></div> </div>',\n left: {\n h_align: \"left\",\n v_align: \"center\",\n h_offset: 50,\n v_offset: 0\n },\n right: {\n h_align: \"right\",\n v_align: \"center\",\n h_offset: 50,\n v_offset: 0\n }\n },\n },\n responsiveLevels:[4096,1199,992,767,480],\n gridwidth:[1170,1000,750,700,300],\n gridheight:[600,600,600,600,470],\n lazyType:\"smart\",\n fallbacks: {\n simplifyAll:\"off\",\n nextSlideOnWindowFocus:\"off\",\n disableFocusListener:false,\n }\n })\n }\n }", "function mainBanner() {\n\n if ($('#rev_slider').length > 0) {\n var revapi16;\n if ($('#rev_slider').revolution == undefined) {\n revslider_showDoubleJqueryError('#rev_slider');\n } else {\n revapi16 = $('#rev_slider').show().revolution({\n sliderType: 'carousel',\n jsFileLocation: '../revolution/js/',\n sliderLayout: 'fullscreen',\n dottedOverlay: 'none',\n delay: 9000,\n navigation: {\n keyboardNavigation: 'off',\n keyboard_direction: 'horizontal',\n mouseScrollNavigation: 'off',\n // mouseScrollNavigation:\"on\",\n // mouseScrollReverse:\"default\",\n onHoverStop: 'off',\n touch: {\n touchenabled: 'on',\n swipe_threshold: 75,\n swipe_min_touches: 1,\n swipe_direction: 'horizontal',\n drag_block_vertical: false\n },\n\n arrows: {\n style: 'arrowpag',\n enable: true,\n hide_onmobile: true,\n hide_under: 600,\n hide_onleave: false,\n hide_delay: 200,\n hide_delay_mobile: 1200,\n tmp: '<div class=\"arrow-text\">{{param1}}</div>',\n left: {\n h_align: 'left',\n v_align: 'center',\n h_offset: 30,\n v_offset: 0\n },\n right: {\n h_align: 'right',\n v_align: 'center',\n h_offset: 30,\n v_offset: 0\n }\n },\n\n tabs: {\n style: 'hermes',\n enable: true,\n // width: 175,\n // height: 140,\n width: 320,\n height: 160,\n min_width: 150,\n wrapper_padding: 0,\n wrapper_color: '#000000',\n wrapper_opacity: '0.5',\n tmp: '<span class=\"tp-tab-image\"></span>',\n visibleAmount: 10,\n hide_onmobile: true,\n hide_under: 776,\n hide_onleave: false,\n hide_delay: 200,\n // direction: \"vertical\",\n direction: 'horizontal',\n span: true,\n position: 'inner',\n space: 0,\n // h_align: \"right\",\n h_align: 'center',\n v_align: 'bottom',\n h_offset: 0,\n v_offset: 100\n }\n },\n carousel: {\n horizontal_align: 'center',\n vertical_align: 'center',\n fadeout: 'on',\n vary_fade: 'on',\n maxVisibleItems: 3,\n infinity: 'on',\n space: 0,\n stretch: 'on'\n },\n responsiveLevels: [1240, 1024, 778, 480],\n gridwidth: [800, 640, 480, 480],\n gridheight: [720, 720, 480, 360],\n lazyLoad: 'on',\n lazyType: 'smart',\n parallax: {\n type: 'scroll',\n origo: 'enterpoint',\n speed: 400,\n levels: [5, 10, 15, 20, 25, 30, 35, 40, 45, 50]\n },\n shadow: 0,\n spinner: 'off',\n stopLoop: 'off',\n stopAfterLoops: 0,\n stopAtSlide: -1,\n shuffle: 'off',\n autoHeight: 'off',\n disableProgressBar: 'off',\n hideThumbsOnMobile: 'off',\n hideSliderAtLimit: 0,\n hideCaptionAtLimit: 0,\n hideAllCaptionAtLilmit: 0,\n debugMode: false,\n fallbacks: {\n simplifyAll: 'off',\n nextSlideOnWindowFocus: 'off',\n disableFocusListener: false\n }\n });\n }\n };\n\n $('#thumbsButton').on('mouseenter', function (e) {\n $('body').toggleClass('showThumbnails');\n });\n\n $('.tp-tabs').on('mouseleave', function (e) {\n $('body').removeClass('showThumbnails');\n });\n}", "function main_slider(){\n if ( $('#main_slider').length ){\n $(\"#main_slider\").revolution({\n sliderType:\"standard\",\n sliderLayout:\"auto\",\n delay:5000,\n disableProgressBar:\"on\",\n navigation: {\n onHoverStop: 'off',\n touch:{\n touchenabled:\"on\"\n },\n arrows: {\n style:\"normal\",\n enable:true,\n hide_onmobile:true,\n hide_under:992,\n hide_onleave:true,\n hide_delay:200,\n hide_delay_mobile:1200,\n left: {\n h_align: \"left\",\n v_align: \"center\",\n h_offset: 0,\n v_offset: 0\n },\n right: {\n h_align: \"right\",\n v_align: \"center\",\n h_offset: 0,\n v_offset: 0\n }\n },\n bullets: {\n enable:true,\n hide_onmobile:true,\n hide_under:768,\n style:\"hesperiden\",\n hide_onleave:false,\n direction:\"vertical\",\n h_align:\"left\",\n v_align:\"bottom\",\n h_offset:380,\n v_offset:0,\n space:10,\n tmp: \"\",\n },\n },\n responsiveLevels:[4096,1320,1199,992,767,480],\n gridwidth:[1170,1170,960,720,700,300],\n gridheight:[950,950,950,700,500,500],\n lazyType:\"smart\",\n fallbacks: {\n simplifyAll:\"off\",\n nextSlideOnWindowFocus:\"off\",\n disableFocusListener:false,\n }\n })\n }\n }", "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "function nextSlide(){\n goToSlide(currentSlide+1);\n}", "function slideSlide() {\n grabNextSlide();\n nextImage.src = slides[currentSlide].image;\n caption = slides[currentSlide].caption;\n sequence.innerHTML = (currentSlide + 1) + \" / \" + slides.length;\n\n bufferCtx.canvas.width = slideshow.width;\n bufferCtx.canvas.height = slideshow.height;\n\n x = -bufferCtx.canvas.width;\n draw();\n transition();\n\n }", "function plusSlides(n) { // parameter holds slideIndex\n showSlides(slideIndex += n);\n} // end function", "function changeSlide() {\n\n mainSlide.setAttribute(\"src\", slideArray[slideIndex]['url']);\n slideIndex++;\n if (slideIndex >= slideArray.length) {\n slideIndex = 0;\n }\n }", "function showSlide() {\n shift = -count * widthImage;\n controlLimitImg();\n carouselPhotos.style.marginLeft = shift + 'px';\n }", "function staffSlider() {\r\n\r\n\t// Default view\r\n var minimalSwiper = $('.staff-slider').swiper({\r\n\t\tslidesPerView:1\r\n\t});\r\n\r\n\t//init slider navigation arrow\r\n $('.staff-slider-control .prev-arrow').on('click', function(e){\r\n e.preventDefault();\r\n minimalSwiper.swipePrev();\r\n });\r\n\r\n $('.staff-slider-control .next-arrow').on('click', function(e){\r\n e.preventDefault();\r\n minimalSwiper.swipeNext();\r\n });\r\n}", "function main() {\n window.addEventListener('load', onBodyLoad)\n\n NodeList.prototype.forEach = HTMLCollection.prototype.forEach = Array.prototype.forEach\n\n useCompanion = (location.href.indexOf('?companion') != -1) ||\n (location.href.indexOf('&companion') != -1)\n useLocalServer = (location.href.indexOf('?local') != -1) ||\n (location.href.indexOf('&local') != -1)\n\n slideEls = document.querySelectorAll('.presentation > div')\n}", "function first_slide(ev)\n {\n ev.preventDefault();\n activate(0); // Move the \"active\" class\n // console.log(\"first: current = \"+current+\" t -> \"+timecodes[current]);\n seek_video();\n }", "function switch_slides () {\n // Animate to next slide by facing opacity of foreground from 100% to 0%\n foreground_element.animate({ opacity: 0 }, that.options.speed, function () {\n load_slide(foreground_element, that.options.slides[current_slide_id]);\n foreground_element.css('opacity', 1); // turn foreground on full opacity\n load_slide(background_element, that.options.slides[next_slide_id]); // load next slide into background\n });\n\n // Update slide_id's\n current_slide_id += 1; //next_slide_id - 1;\n if (current_slide_id >= slide_count) {\n current_slide_id = 0;\n }\n next_slide_id = current_slide_id + 1;\n if (next_slide_id >= slide_count) {\n next_slide_id = 0;\n }\n }", "function slideButtons() {\n if (current_slide > 1 ){\n activateButton(\"previous\", \"previousSlide\" );\n } else {\n deactivateButton(\"previous\");\n }\n if (current_slide <= slidecount){\n activateButton('next', \"nextSlide\");\n } else {\n deactivateButton('next');\n }\n if (current_slide > slidecount){\n $('#slideshowInfo').html(\"End of \" + slidetitle );\n } else {\n showSlideCount();\n }\n}", "function slides() {\r\n $(\".dots .dot\").click(function () {\r\n index = ($(this).index());\r\n if (index <= 5) {\r\n $(\".dot\").removeClass(\"active\");\r\n $(\".dots\").children().eq(index).addClass(\"active\");\r\n }\r\n\r\n tuto();\r\n });\r\n }", "function initControls() \n{\n 'use strict';\n\n // If a slide title is selected from the drop up list, show the slide.\n $('.dropdown-menu li a').on('click', function (event) {\n pfView.showSlide(event, $(this));\n });\n\n // Cycles to the previous slide\n $('#prev-slide-btn').on('click', function (){ \n pfView.moveLeft();\n });\n\n // Cycles to the next slide\n $('#next-slide-btn').on('click', function (){ \n pfView.moveRight();\n });\n\n // Listen for keydown anywhere in body.\n $('body').on('keydown', function (event) {\n return keystroke(event);\n });\n\n // Listen for keyup anywhere in body.\n $('body').on('keyup', function (event) {\n return keystroke(event);\n });\n}", "function js_startSlide() {\n reset();\n sliderImages[0].style.display = 'block'; // Show image 1.\n temporal[current].innerHTML = current + 1 + \"/\" + sliderImages.length; // Print number image is in current location.\n dots[current].classList.add(\"active\"); // Add class active dot current image.\n}", "function main_slider2(){\n if ( $('#main_slider2').length ){\n $(\"#main_slider2\").revolution({\n sliderType:\"standard\",\n sliderLayout:\"auto\",\n delay:4000,\n disableProgressBar:\"on\",\n navigation: {\n onHoverStop: 'off',\n touch:{\n touchenabled:\"on\"\n },\n arrows: {\n style:\"zeus\",\n enable:false,\n hide_onmobile:true,\n hide_under:767,\n hide_onleave:true,\n hide_delay:200,\n hide_delay_mobile:1200,\n tmp:'<div class=\"tp-title-wrap\"> \t<div class=\"tp-arr-imgholder\"></div> </div>',\n left: {\n h_align: \"left\",\n v_align: \"center\",\n h_offset: 50,\n v_offset: 0\n },\n right: {\n h_align: \"right\",\n v_align: \"center\",\n h_offset: 50,\n v_offset: 0\n }\n },\n },\n responsiveLevels:[4096,1199,992,767,480],\n gridwidth:[1170,1000,750,700,300],\n gridheight:[1080,1080,860,600,500],\n lazyType:\"smart\",\n fallbacks: {\n simplifyAll:\"off\",\n nextSlideOnWindowFocus:\"off\",\n disableFocusListener:false,\n }\n })\n }\n }", "function nextSlidecountFn(){\n cnt++; // 1 2 0 1 2 .....\n if(cnt>2){cnt=0} \n mainSlideFn();\n }", "plusSlides(n){\n showSlides(this.state.slideIndex)\n }", "function effectSlide () {\n pauseSlideshow();\n effect = 2;\n runSlideshow();\n }", "function showSlide(id) {\n // Hide all slides\n $(\".slide\").hide();\n // Show just the slide we want to show\n $(\"#\"+id).show();\n}", "function selectOtherSlide(e) {\n\n var clickedThing = e.target;\n\n // <li> element, if clickedThing was a side slide's <img>\n var clickedThingGrandparent = clickedThing.parentNode.parentNode; // !!! FULLSCREEN BUTTON MAY AFFECT THIS DOM NAVIGATION !!!\n\n if (clickedThingGrandparent.hasAttribute('data-sideslide')) {\n\n var imgToShow = clickedThing;\n\n // declare variables needed for named function\n var clickedSideSlide = clickedThingGrandparent;\n var dotsContainer = clickedSideSlide.parentNode.lastElementChild;// !!! FULLSCREEN BUTTON MAY AFFECT THIS DOM NAVIGATION !!!\n var gallery = clickedSideSlide.parentNode;// !!! FULLSCREEN BUTTON MAY AFFECT THIS DOM NAVIGATION !!!\n var clickedIndex = clickedSideSlide.getAttribute('data-slide-index');\n var galleryName = gallery.getAttribute('id');\n var currentSlide = document.getElementById(galleryName + '-current');\n\n // calls NAMED FUNCTION\n advanceOrRetreat(clickedSideSlide, dotsContainer, gallery, clickedIndex, galleryName, currentSlide);\n\n } // close if\n} // close function", "function mainSlider() {\r\n\t\tvar BasicSlider = $('.slider-active');\r\n\t\tBasicSlider.on('init', function (e, slick) {\r\n\t\t\tvar $firstAnimatingElements = $('.single-slider:first-child').find('[data-animation]');\r\n\t\t\tdoAnimations($firstAnimatingElements);\r\n\t\t});\r\n\t\tBasicSlider.on('beforeChange', function (e, slick, currentSlide, nextSlide) {\r\n\t\t\tvar $animatingElements = $('.single-slider[data-slick-index=\"' + nextSlide + '\"]').find('[data-animation]');\r\n\t\t\tdoAnimations($animatingElements);\r\n\t\t});\r\n\t\tBasicSlider.slick({\r\n\t\t\tautoplay: false,\r\n\t\t\tautoplaySpeed: 10000,\r\n\t\t\tdots: false,\r\n\t\t\tfade: true,\r\n\t\t\tarrows: false,\r\n\t\t\tresponsive: [\r\n\t\t\t\t{ breakpoint: 767, settings: { dots: false, arrows: false } }\r\n\t\t\t]\r\n\t\t});\r\n\r\n\t\tfunction doAnimations(elements) {\r\n\t\t\tvar animationEndEvents = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';\r\n\t\t\telements.each(function () {\r\n\t\t\t\tvar $this = $(this);\r\n\t\t\t\tvar $animationDelay = $this.data('delay');\r\n\t\t\t\tvar $animationType = 'animated ' + $this.data('animation');\r\n\t\t\t\t$this.css({\r\n\t\t\t\t\t'animation-delay': $animationDelay,\r\n\t\t\t\t\t'-webkit-animation-delay': $animationDelay\r\n\t\t\t\t});\r\n\t\t\t\t$this.addClass($animationType).one(animationEndEvents, function () {\r\n\t\t\t\t\t$this.removeClass($animationType);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\t}", "function plusSlide() {\n showSlides(slideIndex += 1);\n}", "function start(){\n\t//creating eventlisteners for startSlideShow and startSlideShow events.\n\tdocument.getElementById(\"startSlideShow\").addEventListener(\"click\",startSlideShowF,false);\n\tdocument.getElementById(\"stopSlideShow\").addEventListener(\"click\",stopSlideShowF,false);\n\t\n}//end of start function", "function init() {\n $ss.cycle({\n height: '383px',\n next: '#next', \n prev: '#prev',\n\t\t\tpaused: function(cont, opts, byHover) {\n $pause.removeClass('control--pause').addClass('control--play');\n },\n resumed: function(cont, opts, byHover) {\n $pause.removeClass('control--play').addClass('control--pause');\n },\n before: function(curr, next, opts) {\n if(opts.addSlide) { // If function exists\n offset += limit;\n $.ajax({\n url: 'gallery/slideshow/images',\n type: 'POST',\n data: { limit: limit, offset: offset },\n dataType: 'json',\n success: function(data) {\n // If data then add the images\n if(data.length > 0) {\n for(var i = 0; i < data.length; i++) {\n opts.addSlide(data[i]);\n }\n }\n }\n });\n }\n }\n });\n }", "function mainSlider() {\r\n var BasicSlider = $('.slider-active');\r\n BasicSlider.on('init', function (e, slick) {\r\n var $firstAnimatingElements = $('.single-slider:first-child').find('[data-animation]');\r\n doAnimations($firstAnimatingElements);\r\n });\r\n BasicSlider.on('beforeChange', function (e, slick, currentSlide, nextSlide) {\r\n var $animatingElements = $('.single-slider[data-slick-index=\"' + nextSlide + '\"]').find('[data-animation]');\r\n doAnimations($animatingElements);\r\n });\r\n BasicSlider.slick({\r\n autoplay: false,\r\n autoplaySpeed: 10000,\r\n dots: true,\r\n fade: true,\r\n prevArrow: '<button type=\"button\" class=\"slick-prev\">PR<br>EV</button>',\r\n nextArrow: '<button type=\"button\" class=\"slick-next\">NE<br>XT</button>',\r\n arrows: true,\r\n responsive: [\r\n { breakpoint: 992, settings: { dots: true, arrows: false } }\r\n ]\r\n });\r\n\r\n function doAnimations(elements) {\r\n var animationEndEvents = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';\r\n elements.each(function () {\r\n var $this = $(this);\r\n var $animationDelay = $this.data('delay');\r\n var $animationType = 'animated ' + $this.data('animation');\r\n $this.css({\r\n 'animation-delay': $animationDelay,\r\n '-webkit-animation-delay': $animationDelay\r\n });\r\n $this.addClass($animationType).one(animationEndEvents, function () {\r\n $this.removeClass($animationType);\r\n });\r\n });\r\n }\r\n }", "function setControls(slides,speed){\n \n $( \".pointer\" ).click(function() {\n var point = $(this).attr('data-sl');\n point = point - 1\n if(point >= slides){ point = 1; }\n if(point < 0){ point = slides; }\n count = point;\n clicked = 1;\n startSlide(slides,speed);\n console.log(\"clicked point:\"+point);\n });\n\n }", "function autoSlide(ele) {\n\n function runSlide() {\n var cur_act = ele[cur_pos];\n cur_act.classList.remove('active');\n if (cur_pos < ele.length -1) {\n cur_pos++;\n } else {cur_pos=0;}\n var next_act = ele[cur_pos];\n cur_act.classList.add('hide');\n next_act.classList.add('show');\n cur_act.addEventListener('webkitAnimationEnd', function () {\n cur_act.classList.remove('hide');\n cur_act.classList.remove('active');\n });\n next_act.addEventListener('webkitAnimationEnd', function () {\n next_act.classList.add('active');\n next_act.classList.remove('show');\n });\n }\n return runSlide; //CLOSURE , return runSlide with autoSlide enviroment (which has cur_pos var)\n }", "function showSlide(index,dir){\n\n nextSlide = slides[index];\n\n if(dir ==1 ){\n if(index > 0){\n prevSlide = slides[index -1];\n }\n else{\n prevSlide = slides[slides.length-1];\n }\n }\n else if(dir == 0){\n if(index < slides.length -1){\n prevSlide = slides[index + 1];\n }\n else{\n prevSlide = slides[0];\n }\n }\n\n // ZoomOut slide\n prevSlide.style.zIndex = '5';\n let deg = 1;\n let outInterval = setInterval(function(){\n deg = deg - 0.1;\n prevSlide.querySelector('img').style.transform = 'scale(' + deg + ')';\n prevSlide.style.opacity = deg;\n if(deg <= 0.7){ \n prevSlide.style.display = 'none'; \n clearInterval(outInterval); \n }\n },70);\n\n // SlideIn slide\n nextSlide.style.display = 'block';\n nextSlide.style.transform = 'translateY(-100%)';\n let prosent = 100;\n let inInterval = setInterval(function(){\n prosent = prosent - 5;\n nextSlide.style.transform = 'translateY(' + (-prosent) +'%)';\n\n if(prosent <= 0){\n clearInterval(inInterval);\n }\n },20);\n\n for(let y=0; y < slides.length; y++){\n slides[y].querySelector('img').style.transform = 'scale(1)';\n slides[y].style.opacity = 1;\n slides[y].style.zIndex = 0;\n }\n\n \n }", "function nextImg(){\n currentSlide++\n if (currentSlide > slides.length){\n currentSlide = 1\n }\n slideShow();\n}", "function setupCallbacks() {\n\n $(\".slideshow-container\").on(\"click\", \".js-next\", function(e) {\n let projectId = (String(e.currentTarget.className).split(\" \"))[2];\n updateImage(projectId, NEXT_BUTTON);\n });\n\n $(\".slideshow-container\").on(\"click\", \".js-prev\", function(e) {\n let projectId = (String(e.currentTarget.className).split(\" \"))[2];\n updateImage(projectId, PREV_BUTTON);\n });\n\n $(\".dots\").on(\"click\", \".js-slider-0\", function(e) {\n let projectId = (String(e.currentTarget.className).split(\" \"))[2];\n let project = projectsArr[projectId];\n project.current_index = 0;\n\n showCurrentSlide(project);\n });\n\n $(\".dots\").on(\"click\", \".js-slider-1\", function(e) {\n let projectId = (String(e.currentTarget.className).split(\" \"))[2];\n let project = projectsArr[projectId];\n project.current_index = 1;\n showCurrentSlide(project);\n });\n\n $(\".dots\").on(\"click\", \".js-slider-2\", function(e) {\n let projectId = (String(e.currentTarget.className).split(\" \"))[2];\n let project = projectsArr[projectId];\n project.current_index = 2;\n\n showCurrentSlide(project);\n });\n\n}", "function DetailSlide(){\n var slidelager = $(\"#slide-room-lg\");\n var slidethumnail = $(\"#slide-room-sm\");\n \n slidelager.owlCarousel({\n singleItem : true,\n autoPlay:false,\n slideSpeed : 1000,\n navigation: false,\n pagination:false,\n transitionStyle : \"fade\",\n afterAction : syncPosition\n });\n \n slidethumnail.owlCarousel({\n slideSpeed : 1000,\n mouseDrag:false,\n navigation:true,\n navigationText:[\"<span class='prev-next-room prev-room'></span>\",\"<span class='prev-next-room next-room'></span>\"],\n itemsCustom: [[320, 3],[480, 5], [768, 6], [992, 7], [1200, 8]],\n pagination:false,\n afterInit : function(el){\n el.find(\".owl-item\").eq(0).addClass(\"synced\");\n }\n });\n \n function syncPosition(el){\n var current = this.currentItem;\n slidethumnail\n .find(\".owl-item\")\n .removeClass(\"synced\")\n .eq(current)\n .addClass(\"synced\")\n if($(\"#slide-room-sm\").data(\"owlCarousel\") !== undefined){\n center(current)\n }\n }\n \n $(\"#slide-room-sm\").on(\"click\", \".owl-item\", function(e){\n e.preventDefault();\n if($(this).hasClass('synced')){\n return false;\n }else{\n var number = $(this).data(\"owlItem\");\n slidelager.trigger(\"owl.goTo\",number);\n }\n });\n \n function center(number){\n var slidethumnailvisible = slidethumnail.data(\"owlCarousel\").owl.visibleItems;\n var num = number;\n var found = false;\n for(var i in slidethumnailvisible){\n if(num == slidethumnailvisible[i]){\n var found = true;\n }\n }\n \n if(found==false){\n if(num>slidethumnailvisible[slidethumnailvisible.length-1]){\n slidethumnail.trigger(\"owl.goTo\", num - slidethumnailvisible.length+2)\n }else{\n if(num - 1 == -1){\n num = 0;\n }\n slidethumnail.trigger(\"owl.goTo\", num);\n }\n } else if(num == slidethumnailvisible[slidethumnailvisible.length-1]){\n slidethumnail.trigger(\"owl.goTo\", slidethumnailvisible[1])\n } else if(num == slidethumnailvisible[0]){\n slidethumnail.trigger(\"owl.goTo\", num-1)\n }\n \n }\n }", "function Showcase() {\r\n\t\t\r\n\t\r\n\t\tif( $('#showcase-slider').length > 0 ){\t\r\n\t\t\t\r\n\t\t\tvar titles = [];\r\n\t\t\tvar subtitle = [];\r\n\t\t\tvar counter = [];\r\n\t\t\t$('#showcase-slider .swiper-slide').each(function(i) {\r\n\t\t\t \ttitles.push($(this).data('title'))\r\n\t\t\t\tsubtitle.push($(this).data('subtitle'))\r\n\t\t\t\tcounter.push($(this).data('number'))\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tvar interleaveOffset = 0.4;\r\n\r\n\t\t\tvar swiperOptions = {\r\n\t\t\t\tdirection: \"horizontal\",\r\n\t\t\t\tloop: false,\r\n\t\t\t\tgrabCursor: true,\r\n\t\t\t\tresistance : true,\r\n\t\t\t\tresistanceRatio : 0,\r\n\t\t\t\tspeed:1200,\r\n\t\t\t\tautoplay: false,\r\n\t\t\t\teffect: \"slide\",\r\n\t\t\t\tmousewheel: true,\t\t\t\t\r\n\t\t\t\tpagination: {\r\n\t\t\t\t\tel: '.showcase-pagination',\r\n\t\t\t\t\tclickable: true,\r\n\t\t\t\t\trenderBullet: function (index, className) {\r\n\t\t\t\t\t\treturn '<div class=\"tab__link ' + className + '\">' + '<div class=\"counter-wrap\">' + '<div class=\"counter\">' + counter[index] + '</div>' + '</div>' + '<div class=\"subtitle\">' + subtitle[index] + '</div>' + '<div class=\"title\">' + titles[index] + '</div>' + '</div>';\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\tnavigation: {\r\n\t\t\t\t\tnextEl: '.swiper-button-next',\r\n\t\t\t\t\tprevEl: '.swiper-button-prev',\r\n\t\t\t\t},\r\n\t\t\t\ton: {\r\n\t\t\t\t\tprogress: function() {\r\n\t\t\t\t\t var swiper = this;\r\n\t\t\t\t\t for (var i = 0; i < swiper.slides.length; i++) {\r\n\t\t\t\t\t\tvar slideProgress = swiper.slides[i].progress;\r\n\t\t\t\t\t\tvar innerOffset = swiper.width * interleaveOffset;\r\n\t\t\t\t\t\tvar innerTranslate = slideProgress * innerOffset;\r\n\t\t\t\t\t\tswiper.slides[i].querySelector(\".img-mask\").style.transform = \"translate3d(\" + innerTranslate + \"px,0, 0)\";\r\n\t\t\t\t\t }\r\n\t\t\t\t\t},\r\n\t\t\t\t\ttouchStart: function() {\r\n\t\t\t\t\t var swiper = this;\r\n\t\t\t\t\t for (var i = 0; i < swiper.slides.length; i++) {\r\n\t\t\t\t\t\tswiper.slides[i].style.transition = \"\";\r\n\t\t\t\t\t }\r\n\t\t\t\t\t},\r\n\t\t\t\t\tsetTransition: function(speed) {\r\n\t\t\t\t\t var swiper = this;\r\n\t\t\t\t\t for (var i = 0; i < swiper.slides.length; i++) {\r\n\t\t\t\t\t\tswiper.slides[i].style.transition = speed + \"ms\";\r\n\t\t\t\t\t\tswiper.slides[i].querySelector(\".img-mask\").style.transition = speed + \"ms\";\r\n\t\t\t\t\t } \r\n\t\t\t\t },\r\n\t\t\t\t\tinit: function () {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.swiper-slide-active').find('video').each(function() {\r\n\t\t\t\t\t\t\t$(this).get(0).play();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t},\r\n\t\t\t\t\tslideNextTransitionStart: function () {\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//TweenMax.set($(\".swiper-slide\"), {transform:\"skew(10deg, 0deg)\"});\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar prevslidetitle = new TimelineLite();\t\t\t\t\t\t\r\n\t\t\t\t\t\tprevslidetitle.staggerTo($('.swiper-pagination-bullet-active').prev().find('.title span'), 0.5, {scale:0.9, x:-100, opacity:0, ease:Power2.easeInOut}, 0.02)\r\n\t\t\t\t\t\tvar prevslidecaption = new TimelineLite();\r\n\t\t\t\t\t\tprevslidecaption.staggerTo($('.swiper-pagination-bullet-active').prev().find('.subtitle'), 0.5, {x:-20, opacity:0, delay:0.3, ease:Power2.easeIn}, 0.02)\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar activeslidetitle = new TimelineLite();\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tactiveslidetitle.staggerTo($('.swiper-pagination-bullet-active').find('.title span'), 0.5, {scale:1, x:0, opacity:1, scale:1, delay:0.3, ease:Power2.easeOut}, 0.02)\r\n\t\t\t\t\t\tvar activeslidecaption = new TimelineLite();\r\n\t\t\t\t\t\tactiveslidecaption.staggerTo($('.swiper-pagination-bullet-active').find('.subtitle'), 0.5, {x:0, opacity:1, scale:1, delay:0.6, ease:Power2.easeOut}, 0.02)\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar nextslidetitle = new TimelineLite();\t\t\t\t\t\t\r\n\t\t\t\t\t\tnextslidetitle.staggerTo($('.swiper-pagination-bullet-active').next().find('.title span'), 0.5, {scale:1.1, x:100, opacity:0, ease:Power2.easeInOut}, 0.02)\r\n\t\t\t\t\t\tvar nextslidecaption = new TimelineLite();\t\r\n\t\t\t\t\t\tnextslidecaption.staggerTo($('.swiper-pagination-bullet-active').next().find('.subtitle'), 0.5, {x:20, opacity:0, delay:0.3, ease:Power2.easeIn}, 0.02)\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar tl = new TimelineLite();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.swiper-pagination-bullet-active').prev().find('.counter').each(function(index, element) {\r\n\t\t\t\t\t\t\ttl.to(element, 0.3, {scale:1, y:-20, opacity:0, ease:Power2.easeIn}, index * 0.01)\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.swiper-pagination-bullet-active').find('.counter').each(function(index, element) {\r\n\t\t\t\t\t\t\ttl.to(element, 0.4, {scale:1, y:0, opacity:1, scale:1, delay:0.3, ease:Power2.easeOut}, index * 0.01)\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.swiper-pagination-bullet-active').next().find('.counter').each(function(index, element) {\r\n\t\t\t\t\t\t\ttl.to(element, 0.3, {scale:1, y:20, opacity:0, ease:Power2.easeIn}, index * 0.01)\r\n\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},\r\n\t\t\t\t\tslidePrevTransitionStart: function () {\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//TweenMax.set($(\".swiper-slide\"), {transform:\"skew(-10deg, 0deg)\"});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar prevslidetitle = new TimelineLite();\t\t\t\t\t\t\r\n\t\t\t\t\t\tprevslidetitle.staggerTo($('.swiper-pagination-bullet-active').prev().find('.title span'), 0.5, {scale:1.1, x:-100, opacity:0, ease:Power2.easeInOut}, -0.02)\r\n\t\t\t\t\t\tvar prevslidecaption = new TimelineLite();\r\n\t\t\t\t\t\tprevslidecaption.staggerTo($('.swiper-pagination-bullet-active').prev().find('.subtitle'), 0.5, {x:-20, opacity:0, delay:0.3, ease:Power2.easeIn}, -0.02)\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar activeslidetitle = new TimelineLite();\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tactiveslidetitle.staggerTo($('.swiper-pagination-bullet-active').find('.title span'), 0.5, {scale:1, x:0, opacity:1, scale:1, delay:0.5, ease:Power2.easeOut}, -0.02)\r\n\t\t\t\t\t\tvar activeslidecaption = new TimelineLite();\r\n\t\t\t\t\t\tactiveslidecaption.staggerTo($('.swiper-pagination-bullet-active').find('.subtitle'), 0.5, {x:0, opacity:1, scale:1, delay:0.6, ease:Power2.easeOut}, -0.02)\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar nextslidetitle = new TimelineLite();\t\t\t\t\t\t\r\n\t\t\t\t\t\tnextslidetitle.staggerTo($('.swiper-pagination-bullet-active').next().find('.title span'), 0.5, {scale:0.9, x:100, opacity:0, ease:Power2.easeInOut}, -0.02)\r\n\t\t\t\t\t\tvar nextslidecaption = new TimelineLite();\t\r\n\t\t\t\t\t\tnextslidecaption.staggerTo($('.swiper-pagination-bullet-active').next().find('.subtitle'), 0.5, {x:20, opacity:0, delay:0.3, ease:Power2.easeIn}, -0.02)\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar tl = new TimelineLite();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.swiper-pagination-bullet-active').prev().find('.counter').each(function(index, element) {\r\n\t\t\t\t\t\t\ttl.to(element, 0.3, {scale:1, y:-20, opacity:0, delay:0.1, ease:Power2.easeIn}, index * 0.01)\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.swiper-pagination-bullet-active').find('.counter').each(function(index, element) {\r\n\t\t\t\t\t\t\ttl.to(element, 0.4, {scale:1, y:0, opacity:1, scale:1, delay:0.45, ease:Power2.easeOut}, index * 0.01)\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.swiper-pagination-bullet-active').next().find('.counter').each(function(index, element) {\r\n\t\t\t\t\t\t\ttl.to(element, 0.3, {scale:1, y:20, opacity:0, delay:0.1, ease:Power2.easeIn}, index * 0.01)\r\n\t\t\t\t\t\t});\t\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t},\t\t\t\t\t\r\n\t\t\t\t\tslideChangeTransitionStart: function () {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.swiper-button-white').addClass('disable-click');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tLinesWidth(); \t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.swiper-slide-active').find('video').each(function() {\r\n\t\t\t\t\t\t\t$(this).get(0).play();\r\n\t\t\t\t\t\t}); \t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t},\t\t\r\n\t\t\t\t\tslideChangeTransitionEnd: function () {\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.swiper-button-white').removeClass('disable-click');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.swiper-slide-prev').find('video').each(function() {\r\n\t\t\t\t\t\t\t$(this).get(0).pause();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.swiper-slide-next').find('video').each(function() {\r\n\t\t\t\t\t\t\t$(this).get(0).pause();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n \t\t\t\t},\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tfunction LinesWidth() {\r\n\t\t\t\t\r\n\t\t\t\tvar carouselWidth = $('#showcase-holder').width();\r\n\t\t\t\tvar captionWidth = $('.swiper-pagination-bullet-active .title').width();\r\n\t\t\t\tif ($(window).width() >= 1466) {\r\n\t\t\t\t lineWidth = carouselWidth / 2 - 440\r\n\t\t\t\t} else if ($(window).width() >= 1024) {\r\n\t\t\t\t lineWidth = carouselWidth / 2 - 220\r\n\t\t\t\t} else if ($(window).width() >= 767) {\r\n\t\t\t\t lineWidth = carouselWidth / 2 - 160\r\n\t\t\t\t} else if ($(window).width() >= 479) {\r\n\t\t\t\t lineWidth = carouselWidth / 2 - 50\r\n\t\t\t\t} else {\r\n\t\t\t\t lineWidth = carouselWidth / 2 - 40\r\n\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t$(\".caption-border.left\").css({\r\n\t\t\t\t\t'width': lineWidth - captionWidth/2 + 'px',\r\n\t\t\t\t\t'opacity': 1,\r\n\t\t\t\t});\t\t\t\t\r\n\t\t\t\t$(\".caption-border.right\").css({\r\n\t\t\t\t\t'width': lineWidth - captionWidth/2 + 'px',\r\n\t\t\t\t\t'opacity': 1,\r\n\t\t\t\t});\t\t\t\r\n\t\t\t\t\r\n\t\t\t}// End First Load\r\n\t\t\t\t\r\n\t\t\tvar swiper = new Swiper(\".swiper-container\", swiperOptions);\r\n\t\t\t\r\n\t\t\tLinesWidth();\r\n\t\t\t\r\n\t\t\t$('.title').each(function(){\r\n\t\t\t\tvar words = $(this).text().split(\" \");\r\n\t\t\t\tvar total = words.length;\r\n\t\t\t\t$(this).empty();\r\n\t\t\t\tfor (index = 0; index < total; index ++){\r\n\t\t\t\t\t$(this).append($(\"<div /> \").text(words[index]));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t$('.title div').each(function(){\r\n\t\t\t\tvar words = $(this).text().slice(\" \");\r\n\t\t\t\tvar total = words.length;\r\n\t\t\t\t$(this).empty();\r\n\t\t\t\tfor (index = 0; index < total; index ++){\r\n\t\t\t\t\t$(this).append($(\"<span /> \").text(words[index]));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// Tilt Showcase Wrapper\r\n\t\t\tvar maxTilt = 1.5;\r\n\t\t\tvar mouseX, mouseY;\r\n\t\t\t$(document).on(\"mousemove\", function(event) {\r\n\t\t\t\tmouseX = event.pageX;\r\n\t\t\t\tmouseY = event.pageY;\r\n\t\t\t});\r\n\t\t\t$('#showcase-tilt').each(function() {\r\n\t\t\t\tvar thisWidth = $(this).width();\r\n\t\t\t\tvar thisHeight = $(this).height();\r\n\t\t\t\tvar thisOffset = $(this).offset();\r\n\t\t\t\t$(document).mousemove(function() {\r\n\t\t\t\t\tvar horTilt = ((mouseX / thisWidth) * (maxTilt * 2)) - maxTilt;\r\n\t\t\t\t\tvar verTilt = (((mouseY - thisOffset.top) / thisHeight) * (maxTilt * 2)) - maxTilt;\t\t\t\t\t\r\n\t\t\t\t\tTweenMax.to('#showcase-tilt', 1,{rotationY: horTilt, rotationX: verTilt, scale: 1.05, ease:Power1.easeOut});\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$('#showcase-slider').on('mousedown touchstart', function(event) {\t\t\t\t\r\n\t\t\t\t$('body').addClass('scale-up');\r\n\t\t\t\tTweenMax.to('#ball', 0.1,{transformOrigin: '15px 15px', borderWidth: '1px', scale: 2});\r\n\t\t\t\t$('.caption-border, .arrows-wrap').fadeOut(200);\r\n\t\t\t});\t\t\t\r\n\t\t\t$('#showcase-slider').on('mouseup touchend', function(event) {\t\t\t\t\r\n\t\t\t\t$('body').removeClass('scale-up');\r\n\t\t\t\tTweenMax.to('#ball', 0.1,{borderWidth: '2px', scale:1, x: -15, y: -15});\r\n\t\t\t\t$('.caption-border, .arrows-wrap').fadeIn(200)\t\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$('.footer-button').on('mousedown touchstart', function(event) {\r\n\t\r\n\t\t\t\tevent.preventDefault();\r\n\t\t\t\t$('.button-border span[data-hover]').each(function(){$(this).attr('data-hover', \"Hold On\");});\r\n\t\t\t\t$('.is-selected').addClass('down-hold');\t\r\n\t\t\t\t$('.caption-border').append('<span class=\"btn-hold-progress-bar\"></span>');\r\n\t\t\t\t$('.section-image').animate({\r\n\t\t\t\t\topacity: '0.8',\r\n\t\t\t\t}, 800);\r\n\t\t\t\t\r\n\t\t\t\tvar progress = $('.btn-hold-progress-bar');\r\n\t\t\t\t$(progress).width('0%');\r\n\t\t\t\t$(progress).animate({\r\n\t\t\t\t\twidth: '100%',\r\n\t\t\t\t}, 1000, 'linear', function() {\r\n\t\t\t\t\t\r\n\t\t\t\t//Execute trigger click here\r\n\t\t\t\tvar navtitleheight = $(\".title\").height()\r\n\t\t\t\tvar navsubtitleheight = $(\".subtitle\").height()\r\n\t\t\t\t\r\n\t\t\t\t$('#showcase-tilt').addClass('disabled');\r\n\t\t\t\tTweenMax.to($(\".subtitle\"), 0.3, {force3D:true, opacity:0, scale:0.5, delay:0, ease:Power2.easeOut});\r\n\t\t\t\tTweenMax.to($(\".title\"), 0.6, {force3D:true, y:-navtitleheight, delay:0.1, ease:Power2.easeInOut});\r\n\t\t\t\tTweenMax.set($(\".subtitle\"), {opacity:0, scale:1, y: 150, delay:0.4});\r\n\t\t\t\tTweenMax.to($(\".swiper-pagination-bullet-active .subtitle\"), 0.3, {force3D:true, opacity:1, scale:1, y:navsubtitleheight, delay:0.4, ease:Power2.easeOut});\r\n\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\tTweenMax.to($(\".footer-button-wrap, .caption-border, .showcase-counter, .counter, .arrows-wrap\"), 0.3, {force3D:true, opacity:0, delay:0, ease:Power2.easeOut});\r\n\t\t\t\tTweenMax.to($(\".button-wrap.left\"), 0.3, {force3D:true, opacity:0, delay:0.1, x:-20, ease:Power2.easeOut});\r\n\t\t\t\tTweenMax.to('#ball', 0.3,{borderWidth: '2px', delay:0.3, scale:1, opacity:1});\r\n\t\t\t\tTweenMax.to($(\".socials-wrap\"), 0.3, {force3D:true, opacity:0, delay:0.1, x:20, ease:Power2.easeOut});\r\n\t\t\t\t$(\"body\").addClass(\"load-project-page\");\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t$('.swiper-slide-active').find('a.showcase-link-project').trigger('click');\r\n\t\t\t\t\t$(\"body\").addClass(\"show-loader\");\t\r\n\t\t\t\t} , 500 );\r\n\t\t\t });\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t$('.footer-button').on('mouseup touchend', function(event) {\r\n\t\r\n\t\t\t\tvar progress = $('.btn-hold-progress-bar');\r\n\t\t\t\t$(progress).stop();\r\n\t\t\t\t$('.button-border span[data-hover]').each(function(){$(this).attr('data-hover', \"Click and Hold\");});;\t\r\n\t\t\t\t$(progress).animate({width: '0%',}, 250);\r\n\t\t\t\t$('.section-image').stop();\r\n\t\t\t\t$('.section-image').animate({opacity: '1',}, 250);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tTweenMax.set($(\"#showcase-holder\"), {opacity:0, scale:1.1});\r\n\t\t\tTweenMax.to($(\"#showcase-holder\"), 0.8, {force3D:true, opacity:1, scale:1, delay:0, ease:Power2.easeOut});\r\n\t\t\tTweenMax.to($(\".swiper-pagination-bullet-active .subtitle\"), 0.4, {force3D:true, opacity:1, y:0, delay:0.1, ease:Power2.easeOut});\r\n\t\t\tTweenMax.to($(\".swiper-pagination-bullet-active .title\"), 0.4, {force3D:true, opacity:1, y:0, delay:0.15, ease:Power2.easeOut});\r\n\t\t\tTweenMax.to($(\".footer-button-wrap\"), 0.4, {force3D:true, opacity:1, y:0, delay:0.2, ease:Power2.easeOut});\r\n\t\t\tTweenMax.to($(\".showcase-counter, .swiper-pagination-bullet-active .counter, .arrows-wrap\"), 0.3, {force3D:true, opacity:1, delay:0.15, ease:Power2.easeOut});\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\t\t\r\n\t\t\r\n\t\t\t\r\n\t}", "function showSlide(id) {\n // Hide all slides\n\t$(\".slide\").hide();\n\t// Show just the slide we want to show\n\t$(\"#\"+id).show();\n}", "function showslide(s) {\n var slideid = s;\n $('.howtoslide').hide();\n $('#' + displaymode + '_howtoslide' + slideid).fadeIn('slow');\n $('body').scrollTop(0);\n}", "currentSlide(n) {\n return this.showSlides(this.slideIndex = n);\n }", "function showNextSlide() {\r\n\t\tshowSlide(currentSlide + 1);\r\n\t }", "function plusSlides(n) {\n // Increment or decrement slideIndex and display\n showSlides(slideIndex += n);\n}", "function init() {\r\n\r\n slideImage.forEach((img, i) => {\r\n img.style.left = i * 100 + \"%\";\r\n });\r\n\r\n slideImage[0].classList.add(\"active\");\r\n\r\n createNavigationDots();\r\n}", "function slideRest () {\n cpCmndTOCVisible = false;\n hidePlay();\n }", "function showSlide(id) {\n // Hide all slides\n $(\".slide\").hide();\n // Show just the slide we want to show\n $(\"#\"+id).show();\n}", "function PageSlide(){\n if($('.page-slide').length>0){\n $('.page-slide').owlCarousel({\n autoPlay: 10000,\n slideSpeed: 1000,\n navigation: false,\n pagination: true,\n singleItem: true,\n autoHeight: true,\n navigationText:[\"<i class='fa fa-angle-left'></i>\",\"<i class='fa fa-angle-right'></i>\"]\n });\n }\n }" ]
[ "0.7397232", "0.73610973", "0.71461684", "0.7035936", "0.69285965", "0.6922403", "0.6744746", "0.6693899", "0.66894877", "0.6665247", "0.6652298", "0.66491705", "0.6619514", "0.6586867", "0.65711707", "0.6568348", "0.65635955", "0.6556759", "0.65275407", "0.6512946", "0.651042", "0.6465509", "0.6462828", "0.64593464", "0.64491266", "0.64466834", "0.6444726", "0.64409614", "0.6438271", "0.6424275", "0.64180773", "0.6396932", "0.6373057", "0.63716376", "0.63699347", "0.63668394", "0.6365599", "0.6361361", "0.6347815", "0.63441163", "0.63370425", "0.63365716", "0.6336155", "0.6334804", "0.6332391", "0.6332029", "0.6315188", "0.63128924", "0.63100404", "0.6305378", "0.63053507", "0.6291884", "0.628359", "0.62794346", "0.62777585", "0.6272546", "0.62614095", "0.62583536", "0.62526447", "0.6229664", "0.6229664", "0.62246543", "0.62204945", "0.6220466", "0.621711", "0.6215629", "0.62064785", "0.6197461", "0.618276", "0.61777246", "0.6176962", "0.6162149", "0.61621356", "0.61603034", "0.6158953", "0.6157643", "0.61531544", "0.614617", "0.6143804", "0.61385894", "0.61327285", "0.6131484", "0.6129549", "0.61285216", "0.612433", "0.612358", "0.61171234", "0.6116053", "0.6114984", "0.61086184", "0.6103397", "0.6101761", "0.6101521", "0.6098472", "0.6093129", "0.6091955", "0.60905725", "0.6079554", "0.6079528", "0.6071436", "0.60654175" ]
0.0
-1
2. auto slide start function
function startTimer(){ timer = setInterval(function(){ var nextIndex = (currentIndex + 1 ) % $slides.length; // 슬라이드 제작시 많이 쓰는 공식 goToSlide(nextIndex); console.log(nextIndex); }, 2000) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function slideStart()\n{\n\n\tcontinueFollow='continue';\n\t\tsliderDrag();\n}", "function startAutoSlide() {\n\t// if (autoSlideInterval) { // if the interval has been set already\n\t\tclearInterval(autoSlideInterval); // clear the interval\n\t// }\n\t// MAYBE SHOULD WAIT FOR FINAL RESIZE EVENT??? TEST TO FIND OUT\n\tvar interval = autoSlide * 1000; // * 1000 to convert s to ms\n\tautoSlideInterval = setInterval(function() { moveCarousel('next'); }, interval); // call moveCarousel('next') every interval\n}", "function startAutoslide() {\n if (!$run.autoslideId) {\n $run.autoslideId = window.setInterval(slideForward, $conf.autoslide);\n }\n }", "function startSlide(){\n console.log(\"automatically changing slides\")\n changeSlide(1)\n setTimeout(startSlide, 4000);\n}", "function startSlide() {\n reset();\n slides[0].style.display = 'flex';\n }", "function autoSlide(ele) {\n\n function runSlide() {\n var cur_act = ele[cur_pos];\n cur_act.classList.remove('active');\n if (cur_pos < ele.length -1) {\n cur_pos++;\n } else {cur_pos=0;}\n var next_act = ele[cur_pos];\n cur_act.classList.add('hide');\n next_act.classList.add('show');\n cur_act.addEventListener('webkitAnimationEnd', function () {\n cur_act.classList.remove('hide');\n cur_act.classList.remove('active');\n });\n next_act.addEventListener('webkitAnimationEnd', function () {\n next_act.classList.add('active');\n next_act.classList.remove('show');\n });\n }\n return runSlide; //CLOSURE , return runSlide with autoSlide enviroment (which has cur_pos var)\n }", "function setupAuto() {\n\t\t\tself.playSlides = setInterval(function carouselPlaySlidesInterval() {\n\t\t\t\tif (currentPane === (paneCount - 1)) {\n\t\t\t\t\tself.showPane(0, true);\n\t\t\t\t} else {\n\t\t\t\t\tself.next();\n\t\t\t\t}\n\t\t\t}, slideTimer);\n\t\t}", "function nextSlide() {\n \n}", "goToFirstSlide() {\n\n this.goTo(0, -1);\n\n }", "function autoSlide(){\n\tslider.timerOn = true;\n\treturn setInterval(function(){incrementIndex(1)}, \"8000\");\n}", "function startSlider() {\n sliderIntervalID = setInterval(function() {\n nextSlide();\n }, set.slidePause);\n }", "function js_startSlide() {\n reset();\n sliderImages[0].style.display = 'block'; // Show image 1.\n temporal[current].innerHTML = current + 1 + \"/\" + sliderImages.length; // Print number image is in current location.\n dots[current].classList.add(\"active\"); // Add class active dot current image.\n}", "function startSlide() {\n\n\t\tsliderCoorTop = $(\".for-slider\").offset().top;\n\t\tsliderCoorBottom = sliderCoorTop + $(window).height();\n\t\ttopWindowCoor = $(document).scrollTop();\n\t\tbottomWindowCoor = topWindowCoor + $(window).height();\n\n\t\tif( sliderCoorBottom > topWindowCoor && bottomWindowCoor > sliderCoorTop) {\n\t\t\t++countScrollForSlider;\n\t\t\t// to start the slide once\n\t\t\tif( countScrollForSlider == 1) {\n\n\t\t\t\t// console.log(\"start function showSlide\");\n\n\t\t\t\tcountClearScrollForSlider = 0;\n\t\t\t\tshowSlide();\n\n\t\t\t}\t\n\n\t\t} else {\n\n\t\t\tcountScrollForSlider = 0;\n\t\t\t++countClearScrollForSlider;\n\t\t\t// if document was scrolled\n\t\t\tif(countClearScrollForSlider == 1) {\n\t\t\t\t// stop the slide\n\t\t\t\t// console.log(\"stop. clearTimeout of 'sliderStart' \");\n\t\n\t\t\t\tclearTimeout(sliderStart);\n\n\t\t\t}\t\t\t\n\n\t\t}\n\n\t}", "function first_slide(ev)\n {\n ev.preventDefault();\n activate(0); // Move the \"active\" class\n // console.log(\"first: current = \"+current+\" t -> \"+timecodes[current]);\n seek_video();\n }", "function startslides() {\n\tif(imgSearch) {\n\t\timgSearch.startSlides();\n\t}\n}", "function automaticallySlide(){\n\t\tactiveSlideNum++;\n\t\tif(activeSlideNum>3) activeSlideNum=1;\n\t\tactiveDot = \"dot_\" + activeSlideNum;\n\t\tactiveSlide = \"slide_\" + activeSlideNum;\n\n\t\t$(\".find_carousel .slide\").removeClass(\"active\");\n\t\t$(\".find_carousel .\" + activeSlide).addClass(\"active\");\n\n\t\t$(\".find_carousel .dot\").removeClass(\"active\");\n\t\t$(\".find_carousel .\" + activeDot).addClass(\"active\");\n\t}", "function startSlideShow(){\n \n var $slideBox = $('.auto_slideshow ul');\n var $slides = $('.auto_slideshow li');\n \n interval = setInterval(function(){\n $slideBox.animate({'margin-left': '-=' +autoSlideWidth},autoSlideSpeed, function() {\n ($slideBox).find('li:last').after($slideBox.find('li:first'));\n $slideBox.css('margin-left',0);\n }); //End animate function \n }, autoSlidePause);//End Setinterval function\n }", "function currentSlide(n,p) {\r\n showSlides(slideIndex = n,p);\r\n \r\n}", "function nextSlide(){\n goToSlide(currentSlide+1);\n}", "function nextSlide(inc){\r\n if (noOfSlides <= 1) return;\r\n slideOmit = true; // inhibit next time trigger\r\n slideUp = inc >= 0 ? +1 : -1;\r\n slideTime = 11000; // keep next slide for longer\r\n if (inc == 0) slideIndex += slideUp;\r\n else if (inc < -3) slideIndex = 888; // force start 0\r\n else if (inc > +3) slideIndex = -888; // force end\r\n carousel();\r\n} // nextSlide(inc)", "function playAutoSlide(index, duration) {\n autoSlideInterval =this.setInterval(function() {\n if (currentIndex + 1 > slide.length) { \n goToSlide(0);\n } else {\n goToSlide(currentIndex + 1);\n }\n }, 5000)\n}", "function startSlideShow(n){\n\tseconds = slideTimer;\n\n\tsetInterval(function(){\n\t\tseconds--;\n\t\tif ( seconds <= 0 ) {\n\t\t\tshowNextSlide();\n\t\t\tseconds = slideTimer;\n\t\t}\n\t}, 10)\n}", "function nextSlide() { showSlide(slideNumber + 1); }", "function slideForward() {\n if ($run.activeIndex < ($conf.slides.length - 1)) {\n $run.activeIndex += 1;\n } else if ($conf.cycle) {\n $run.activeIndex = 0;\n }\n\n alignToActiveSlide();\n }", "function slideAuto(state) {\r\n\r\n\t\t\t\t\tclearTimeout(timeout);\r\n\r\n\t\t\t\t\tif (state) {\r\n\t\t\t\t\t\ttimeout = setTimeout(function() { slideMove(options.direction,false); },pause);\r\n\t\t\t\t\t\toptions.auto = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\toptions.auto = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function init() {\n \n\tTweenLite.set($slides, {\n\t\tleft: \"-100%\"\n });\n\tgotoSlide(0, 0);\n}", "function startSlide(event) {\n\tevent.preventDefault();\n\tbody.addEventListener('mousemove', moveSlide, false);\n\tsetSlidePosition(event, event.target);\n}", "function autoSlide (){\r\n if (slider.scrollLeft > (maxScrollLeft - 1)) {\r\n clearInterval(autoMove);\r\n slider.scrollLeft -= maxScrollLeft;\r\n setTimeout(() => {\r\n return autoMove = setInterval(autoSlide,speed);\r\n }, 2000);\r\n }else{\r\n slider.scrollLeft += 10;\r\n }\r\n }", "function moveSlide(n) { //moveSlide untuk button prev dan next\r\n index = index+n\r\n showSlides(index);\r\n}", "function next() {\n slide(false, true);\n }", "function autoSlide(){\n\t\t\t\n\t\t\t//tinh slide dang hien thi\n\t\t\tvar vitrislide = 0;\n\t\t\tvar slidehientai= document.querySelector(\".homeslide ul li.active\");\n\t\t\t//console.log(slidehientai.previousElementSibling);\n\t\t\t//console.log(slidehientai);\n\t\t\t\tfor (vitrislide = 0; slidehientai = slidehientai.\n\t\t\t\t\tpreviousElementSibling; vitrislide++) {}\n\t\t\t\t\t//neu chua den slide cuoi cung tuc la vitrislide <= slides.length -> hoat dong binh thuong\n\t\t\t\tif(vitrislide < (slides.length-1)){\n\t\t\t\t\tfor (var i = 0; i < slides.length; i++) {\n\t\t\t\t\tslides[i].classList.remove(\"active\");\n\t\t\t\t\tchuyenslide[i].classList.remove(\"slideon\");\n\t\t\t\t\t}\n\t\t\t\t\tslides[vitrislide].nextElementSibling.classList.add(\"active\");\n\t\t\t\t\tchuyenslide[vitrislide].nextElementSibling.classList.add(\"slideon\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tfor (var i = 0; i < slides.length; i++) {\n\t\t\t\t\tslides[i].classList.remove(\"active\");\n\t\t\t\t\tchuyenslide[i].classList.remove(\"slideon\");\n\t\t\t\t\t}\n\t\t\t\t\tslides[0].classList.add(\"active\");\n\t\t\t\t\tchuyenslide[0].classList.add(\"slideon\");\n\t\t\t\t}\n\n\t\t\t\t//console.log(\"vi tri hien tai la\" + vitrislide);\n\t\t}", "function nextSlide()\r\n{\r\n slideIndex++;\r\n showSlide();\r\n}", "function setup_slideshow() {\n slide_count = img_array.length;\n current_slide_index = 0;\n set_current_slide(img_array[0].src);\n play();\n}", "function showSlides() {\n slideIndex++;\n showSlidesByClick(slideIndex);\n}", "function cueAutoSlide() {\n\n clearTimeout(autoSlideTimeout);\n\n // Cue the next auto-slide if enabled\n if (autoSlide && !isPaused() && !isOverview()) {\n autoSlideTimeout = setTimeout(navigateNext, autoSlide);\n }\n\n }", "function startSlider(){\n interval = setInterval (function() { \n $slideContainer.animate({'margin-left': '-=' +width}, animationSpeed, function(){\n currentSlide++;\n if (currentSlide===$slides.length){\n currentSlide = 1;// \n $slideContainer.css('margin-left', 0);\n }\n });\n }, pause);\n \n }", "function currentSlide(n) {\r\n showSlides(slideInd = n);\r\n}", "function start(){\n\t//creating eventlisteners for startSlideShow and startSlideShow events.\n\tdocument.getElementById(\"startSlideShow\").addEventListener(\"click\",startSlideShowF,false);\n\tdocument.getElementById(\"stopSlideShow\").addEventListener(\"click\",stopSlideShowF,false);\n\t\n}//end of start function", "function currentSlide(n) { // parameter holds slideIndex\n showSlides(slideIndex = n);\n} // end function", "function startSlide(nextSlide, nextImage) {\n\t\t// if (pauseSlide) {\n\t\t// \treturn;\n\t\t// }\n\n\t\tvar currentSlide = $('.active-slide');\n\t\t// var currentDot = $('.active-dot');\n\t\tvar\tcurrentImage = $('.active-image');\n\n\t\tif (nextSlide.length === 0) {\n\t\t\tnextSlide = $('.slide').first();\n\t\t\t// nextDot = $('.dot').first();\n\t\t\tnextImage = $('.imageSlide').first();\n\t\t}\n\n\t\tif (nextSlide.hasClass('comingsoon')) {\n\t\t\tnextSlide = $('.slide').first();\n\t\t\t// nextDot = $('.dot').first();\n\t\t\tnextImage = $('.imageSlide').first();\n\t\t}\n\n\n\t\tcurrentSlide.fadeOut(600).removeClass('active-slide');\n\t\tnextSlide.fadeIn(600).addClass('active-slide');\n\n\t\tcurrentImage.fadeOut(600).removeClass('active-image');\n\t\tnextImage.fadeIn(200).addClass('active-image');\n\n\t\t// currentDot.removeClass('active-dot');\n\t\t// nextDot.addClass('active-dot');\n\n\t\tchangeBorderColor();\n\n\t\tsetTimeout(function(){\n\t\t\tcurrentlyAnimating = false;\n\t\t}, 600);\n\t}", "function switchSlide () {\n grabNextSlide();\n loadSlide();\n }", "init() {\n this.timer = setInterval(this.nextSlide, 5000); // Change slide every 5 seconds\n }", "function currentSlide(n) {\r\n showSlides(slideIndex = n);\r\n}", "slideNext(object, slideView) {\n slideView.slideNext(500);\n }", "function currentSlide(n){\n slideIndex = n;\n}", "function addSlide() {\r\n showSlides(slideIndex += 1);\r\n}", "function panStart() {\n element.css('pointer-events', 'none');\n maxWidth = ((control.slideWidth) * (control.slideLength-control.visibleSlides));\n container.addClass('ss-noanimate');\n }", "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "function autoPlay() {\n if (slider.scrollLeft > (maxScrollLeft - 1)) {\n slider.scrollLeft -= maxScrollLeft;\n } else {\n slider.scrollLeft += 1;\n}\n}", "function changeSlidesAutomatically() {\n if (indexOfCurrentSlide > maxNumberOfSlides) {\n indexOfCurrentSlide %= maxNumberOfSlides;\n }\n\n removeCurrentClass();\n\n switch (indexOfCurrentSlide) {\n case 1:\n createFirstSlide();\n break;\n case 2:\n createSecondSlide();\n break;\n case 3:\n createThirdSlide();\n break;\n case 4:\n createForthSlide();\n break;\n case 5:\n createFifthSlide();\n break;\n default:\n break;\n }\n\n setCurrentClass();\n indexOfCurrentSlide += 1;\n // resetTimer();\n }", "function next()\n{\t\n\tnewSlide = sliderint+1;\n\tshowSlide(newSlide);\n}", "function startSlider() {\n sliderIntervalID = setInterval(function () {\n run(1);\n }, sliderInterval);\n }", "function startSlide() {\n\n // set up interval stored in a variable to reference\n showStart = setInterval(printQuote, slideInt);\n\n // hide quoteButtons\n $('#quoteButtons').hide();\n\n // show slideshow controls\n $('#controls').show();\n\n // change quote initially to kick the ball rolling\n printQuote();\n\n}", "function startSlideshow() {\n\t\t_startSlideshowTimer();\n\t\tbtnStart.addClass(CLASS_DISABLED);\n\t\tbtnStop.removeClass(CLASS_DISABLED);\n\t}", "function showNextSlide() {\r\n\t\tshowSlide(currentSlide + 1);\r\n\t }", "function makeActiveSlide(n) {\n var x = ((n > 0) && (n < $conf.slides.length)) ? n : 0;\n $run.activeIndex = x;\n alignToActiveSlide();\n }", "function slideShowNext() {\n slideShow((curIndex !== slides.length - 1) ? curIndex + 1 : 0, 'left');\n }", "function Initialize2()\n{\n const Slides = document.querySelectorAll('.slides1');\n const pages = document.querySelectorAll('section');\n let current=0;\n\n Slides.forEach((slide,index) => {\n slide.addEventListener('click', function(){\n changeDots(this);\n nextSlide(index);\n });\n });\n\n\n function changeDots(dot)\n {\n Slides.forEach(slide => {\n slide.classList.remove(\"active\");\n })\n\n dot.classList.add(\"active\");\n }\n\n function nextSlide(pageNumber)\n {\n const nextPage = pages[pageNumber];\n const currentPage = pages[current];\n\n const tl = new TimelineMax({defaults:{ease:\"power2.out\"}});\n\n tl.fromTo(currentPage , 0.8,{opacity:1,pointerEvents:\"all\"},{opacity:0,pointerEvents:\"none\"})\n .fromTo(nextPage,0.8,{opacity:0,pointerEvents:\"none\"},{opacity:1,pointerEvents:\"all\"},'-=0.4') \n\n current = pageNumber;\n }\n}", "function next() {\n changeSlide($nextel);\n }", "function showSlide() {\n shift = -count * widthImage;\n controlLimitImg();\n carouselPhotos.style.marginLeft = shift + 'px';\n }", "function AddFirstSlide() {\n myPresentation.setCurrentSlideIndex(0);\n myPresentation.addSlide(0);\n updateSlideselector();\n}", "function Initialize()\n{\n const Slides = document.querySelectorAll('.slides');\n const pages = document.querySelectorAll('section');\n let current=0;\n\n Slides.forEach((slide,index) => {\n slide.addEventListener('click', function(){\n changeDots(this);\n nextSlide(index);\n });\n });\n\n\n function changeDots(dot)\n {\n Slides.forEach(slide => {\n slide.classList.remove(\"active\");\n })\n\n dot.classList.add(\"active\");\n }\n\n function nextSlide(pageNumber)\n {\n const nextPage = pages[pageNumber];\n const currentPage = pages[current];\n\n const tl = new TimelineMax({defaults:{ease:\"power2.out\"}});\n\n tl.fromTo(currentPage , 0.8,{opacity:1,pointerEvents:\"all\"},{opacity:0,pointerEvents:\"none\"})\n .fromTo(nextPage,0.8,{opacity:0,pointerEvents:\"none\"},{opacity:1,pointerEvents:\"all\"},'-=0.4') \n\n current = pageNumber;\n }\n}", "function autoPlay() {\n if ($('#'+slideshowID).hasClass('autoplay')) {\n config._interval = window.setInterval(function() {\n changeSlide(\"next\");\n }, config.animationTime);\n }\n }", "function jumpToFirst() {\n\t\t\tif (options.SliderTypeVert) {\n\t\t\t\t$SliderWindow.animate({\n\t\t\t\t\tmarginTop: '0px'\n\t\t\t\t}, 0);\n\t\t\t// horizontal slider\n\t\t\t} else if (!options.SliderTypeFade) {\n\t\t\t\t$SliderWindow.animate({\n\t\t\t\t\tright: '0px'\n\t\t\t\t}, 0);\n\t\t\t}\n\t\t}", "function previousSlide() {\n \n}", "function slideSlide() {\n grabNextSlide();\n nextImage.src = slides[currentSlide].image;\n caption = slides[currentSlide].caption;\n sequence.innerHTML = (currentSlide + 1) + \" / \" + slides.length;\n\n bufferCtx.canvas.width = slideshow.width;\n bufferCtx.canvas.height = slideshow.height;\n\n x = -bufferCtx.canvas.width;\n draw();\n transition();\n\n }", "function showSlide() {\n slides[currentSlide].className = \"fds-slide\";\n currentSlide = (currentSlide + 1) % slides.length;\n slides[currentSlide].className = \"fds-slide is-visible\";\n updateNav();\n}", "function currentSlide(n)\n{\n clearInterval(myTimer);\n myTimer = setInterval(function(){plusSlides(n + 1)}, 3000);\n showSlides(slideIndex = n);\n}", "function showThisSlide() {\n slides[currentSlide].className = \"fds-slide\";\n currentSlide = (currentSlide + 1) % slides.length;\n slides[currentSlide].className = \"fds-slide is-visible\";\n}", "function slideit() {\n //------Função, sem variáveis, para executar slide show; \n //Atribui ao atributo src do elemento img o valor que estiver \n //aqui \"_imagens/pub_image\" + step + \".jpg\";\n document.getElementById('pub_image').src = \"_imagens/pub_image\" + step_slideit + \".jpg\";\n //Se o valor da variável step for menor que o número limite de imagens (6) \n //então soma mais um ao número;\n if (step_slideit < 6)\n step_slideit++;\n //Caso seja igual iguala o valor da variável step a 1, para começar de novo;\n else\n step_slideit = 1;\n //Temporizador para executar a função slideit(), auto se executa a \n //cada 2,5 segundos;\n setTimeout(\"slideit()\", 2500);\n}", "function ccs_slideToTheLeft() {\n var n = ccs_slideIndex-= 1;\n var slides = document.getElementsByClassName(\"cc-slider_item\");\n if (n > slides.length) {\n ccs_slideIndex = 1;\n } \n if (n < 1) {\n ccs_slideIndex = slides.length;\n }\n ccs_showSlide(n);\n}", "function init_slider(){\n var $container = $('.template-index > .row-1 > .outer-wrapper');//get container for slides\n var $slides = $container.css({\t//set container properties and get slides\n \"position\":\"relative\",\n \"overflow\":\"hidden\"\n }).find(\".slide\");\n if($slides.length<1){ //if no slides don't don anything else\n return;\n }\n $slides.eq(0).css({ //set first slide to active and in view\n \"position\":\"absolute\",\n \"width\":\"100%\",\n \"height\":\"100%\",\n \"top\": 0,\n \"left\": 0,\n \"z-index\":-1,\n \"display\": \"block\"\n }).addClass(\"active\");\n if($slides.length<2){ //if no more slides do nothing else, just show first slide\n return;\n }\n for(var i=1;i<$slides.length;i++){//for each slide after the first\n var $this = $slides.eq(i); //get slide as $this\n $this.css({\t\t\t\t\t//set css properties for slide\n \"position\":\"absolute\",\n \"width\":\"100%\",\n \"height\":\"100%\",\n \"top\":0,\n \"left\": \"100%\",\n \"z-index\":-1,\n \"display\": \"block\"\n });\n }\n var timeout;//timeout with outer scope for when slides need to stop moving with clear timeout\n function slide(){//recursive function to move slides\n timeout = setTimeout(function(){ //set timeout\n var $active_slide = $slides.filter(\".active\").removeClass(\"active\").animate({//animate the active slide out of view and remove class active\n \"left\":\"-100%\"\n },1000,function(){\n $(this).css({//move back to the right with all the other slides off screen\n \"left\":\"100%\"\n });\n });\n //if last slide move to the first, otherwise get sibling slide\n var $next_slide = $active_slide.index() !== $slides.length-1 ? $active_slide.next() : $slides.eq(0);\n $next_slide.addClass(\"active\").animate({ //animate slide into view and add class active\n \"left\":\"0\"\n },1000);\n slide();//call self recursively\n },6000);\n }\n slide();\n }", "function carouselAutoplay() {\n this.slider.next();\n }", "function changeSlide() {\n var active = $(\".full-screen-slider img.active\");\n var next = active.next();\n if(next.length == 0) {\n next = $(\".full-screen-slider img:first\");\n }\n setTimeout(function() {\n fadeInSlide(next);\n }, 1);\n setTimeout(function() {\n fadeOutSlide(active, next);\n }, 1);\n }", "nextSlide() {\n\n if (this.currSlide < this.slides.length - 1) {\n\n this.goTo(this.currSlide + 1, -1);\n\n } else {\n\n this.goToFirstSlide();\n\n }\n\n }", "function setupAutoSlide(sliderID) {\n /* Pause auto advance if the user hovers over the slider. */\n $(`#${sliderID}`).hover(() => { shouldAdvance = false},() => { shouldAdvance = true; });\n\n /* Setup an interval to automatically advance except on hover. */\n setInterval(() => {\n if(shouldAdvance) { \n changeSlider('+',sliderID);\n }\n },options[sliderID].interval);\n }", "function changeSlide(d){\n //slide to next image\n if (d===\"n\"){\n $(\"#slides\").animate({\n top: \"-=42vh\"},1000); \n curr++;\n //slide to previous image\n } else if (d===\"p\") {\n $(\"#slides\").animate({\n top: \"+=41vh\"},1000); \n curr--; \n //slide to beginning \n } else {\n $(\"#slides\").animate({top: \"0\"},500);\n curr=0;\n }\n }", "function nextSlide() {\n position = $slider.find(\".show\").index() + 1;\n if (position > size - 1) position = 0;\n changeCarousel(position);\n }", "function nextImage () {\n slideIndex = slideIndex + 1\n showSlides(slideIndex)\n}", "function next(){\n let sliderSectionFirst = document.getElementsByClassName(\"sliderSection\")[0];\n slider.style.marginLeft = \"-200%\";\n slider.style.transition = \"all .6s\";\n setTimeout(function(){\n slider.style.transition = \"none\"; //quito la transicion\n slider.insertAdjacentElement(\"beforeend\", sliderSectionFirst ); //Coloco la primera imagen antes q termine el slider, asi crea el efecto de scroll infinito\n slider.style.marginLeft = \"-100%\";\n }, 600); //SetTimeout es una funcion que recibe de parametros la funcion en si y el tiempo que queres q demore en hacerla. \n}", "function plusSlides(n) {\r\n showSlides(slideIndex += n);\r\n //clearInterval(interval);\r\n}", "function plusSlides(num) {\n //add or minus by 1 to slideIndex depending on\n //whether the user clicks right or left on the image slides,\n //(-1 left ,+1 right)\n slideIndex += num;\n //and pass it as an arguement to displaySlides()\n displaySlides(slideIndex);\n}", "function slidebanner(option){\n \n var num=0;\n var timer=null;\n var screenWid=$(document.body).width();\n // $(option.contain1).width($(document.body).width());\n // $(option.contain1).css({'width':1200});\n $(option.contain2).find('li').width($(option.contain1).width());\n $(option.contain2).find('li img').width($(option.contain1).width());\n $(option.contain1).height($(option.contain2).find('li img').eq(0).get(0).offsetHeight);\n var firstLi=$(option.contain2).find('li').eq(0).clone(); \n $(option.contain2).append(firstLi);\n $(option.btn).children().eq(0).addClass('active');\n\n $(option.contain2).width($(option.contain1).width()*$(option.contain2).children().length);\n\n\n function autoPlay(){\n clearInterval(timer);\n timer=setInterval(function(){\n num++;\n if(num==$(option.contain2).children().length){\n num=1;\n $(option.contain2).css('left',0);\n }\n $(option.contain2).stop().animate({'left':-num*$(option.contain1).width()},800,'swing');\n if(num==$(option.contain2).children().length-1){\n $(option.btn).children().eq(0).addClass('active').siblings().removeClass('active');\n }else{\n $(option.btn).children().eq(num).addClass('active').siblings().removeClass('active');\n }\n },2000);\n }\n\n if(option.auto){\n autoPlay();\n }\n\n $(option.contain2).hover( //移入移出停止轮番 开启轮番\n\n function(){\n clearInterval(timer);\n },\n function(){\n if(option.auto){\n autoPlay();\n } \n }\n );\n\n // 给每一个导航按钮添加事件\n $(option.btn).children().each(function(i){\n \n $(this).on('mouseover',function(){\n clearInterval(timer);\n $(option.contain2).stop().animate({'left':-$(this).index()*$(option.contain1).width()},150,'swing');\n $(option.btn).children().eq($(this).index()).addClass('active').siblings().removeClass('active');\n num=$(this).index(); \n });\n });\n\n //上一张图效果\n $(option.sldir[0]).click(function(){\n num--;\n clearInterval(timer);\n if(num<0){\n num=$(option.contain2).children().length-2;\n $(option.contain2).css('left',-$(option.contain1).width()*($(option.contain2).children().length-1));\n }\n console.log(-$(option.contain1).width()*$(option.contain2).children().length-2);\n $(option.contain2).stop().animate({left:-num*$(option.contain1).width()},800);\n $(option.btn).children().eq(num).addClass('active').siblings().removeClass('active'); \n });\n //下一张图效果\n $(option.sldir[1]).click(function(){\n num++;\n clearInterval(timer);\n if(num==$(option.contain2).children().length){\n num=1;\n $(option.contain2).css({left:0});\n }\n $(option.contain2).stop().animate({left:-num*$(option.contain1).width()},800);\n\n if(num==$(option.contain2).children().length-1){\n $(option.btn).children().eq(0).addClass('active').siblings().removeClass('active');\n }else{\n $(option.btn).children().eq(num).addClass('active').siblings().removeClass('active');\n }\n });\n}", "function slideshow(){\n\tif(slider){\n\t\tclearInterval(slider);\n\t\tslider = 0;\n\t\tget('wcr_btnslide').innerHTML = 'Start Slideshow';\n\t}\n\telse{\n\t\tvar secs = Number(prompt('Enter the number of seconds for turning a page (enter a negative number to advance backwards)\\n\\n'+\n\t\t\t'Press the slideshow button, the ESC key or manually turn pages to stop', 10));\n\t\tif(secs){\n\t\t\tvar dir = secs > 0 ? 1 : -1;\n\t\t\tsecs *= dir*1000;\n\t\t\tslider = setInterval(function(){cambiaPag(dir, false, true);}, secs);\n\t\t\tget('wcr_btnslide').innerHTML = 'Stop Slideshow';\n\t\t}\n\t}\n}", "function next_slide(ev)\n {\n ev.preventDefault();\n if (current == sync_elts.length - 1) return; // No next element\n activate(current + 1); // Move the \"active\" class\n //console.log(\"next: current = \"+current+\" t -> \"+timecodes[current]);\n seek_video();\n }", "function jumpToFirst() {\n\t\t\tif (options.sliderType === 'vertical') {\n\t\t\t\t$sliderWindow.animate({\n\t\t\t\t\tmarginTop: '0px'\n\t\t\t\t}, 0);\n\t\t\t} else if (options.sliderType === 'horizontal') {\n\t\t\t\t$sliderWindow.animate({right: '0px'}, 0);\n\t\t\t}\n\t\t}", "function showslide(s) {\n var slideid = s;\n $('.howtoslide').hide();\n $('#' + displaymode + '_howtoslide' + slideid).fadeIn('slow');\n $('body').scrollTop(0);\n}", "function myMoveLeft() { //ad ogni click sulla freccia di sinistra\n scrollPosition = scrollPosition - scrollChange; //sottraggo alla posizione iniziale il valore di cambiamento settato \n carousel.scrollTo(scrollPosition, 0); //vado ad assegnare la posizione finale al contenitore sull'asse x\n}", "function plusSlides(n) { //this will go to the previous or next slide deppening on if you hit the next or prev button\n showSlides(slideIndex += n);\n}", "function currentSlide(n){\n clearInterval(gMyTimer);\n gMyTimer = setInterval(function(){plusSlides(n + 1)}, 4000);\n showSlides(gSlideIndex = n);\n}", "function moveToNext(isAuto) {\n if (isAuto && !auto) return;\n currentItem = (currentItem + 1) % slideNum;\n\n slideDisplay();\n}", "function showSlides(){\r\n\t\tlet slides = document.getElementsByClassName(\"eachslide\");\r\n\t\t\tfor (let i=0; i < slides.length; i++){\r\n\t\t\t\tslides[i].style.display = \"none\";\r\n\t\t\t}\r\n\t\t\tslideIndx++;\r\n\t\t\tif (slideIndx > slides.length){\r\n\t\t\t\tslideIndx = 1;\r\n\t\t\t}\r\n\t\t\tslides[slideIndx-1].style.display = \"block\";\r\n\t\t\ttimerSlide = setTimeout(showSlides, 2500); //2.5 seconds\r\n\t}", "function currentSlide(n) {\n // Set slideIndex based on dot clicked and display\n showSlides(slideIndex = n);\n}", "slidePrev(object, slideView) {\n slideView.slidePrev(500);\n }", "function callNextSlide() {\r\n\t\t\tvar nextIndex = (currentIndex < itemNum - 1) ? (currentIndex + 1) : 0;\r\n\t\t\tchangeSlide(nextIndex);\r\n\t\t}", "function nextSlide()\n{\n if(index == slider.length-1)\n {\n // If index is greater than the no. of slides\n index = 0;\n }\n else\n {\n // Forward the slides\n index++;\n }\n changeSlide(index);\n updateIndicator(index);\n}", "initSlides () {\n let i = 0,\n sections = document.getElementsByClassName(\"slide__section\");\n for ( let section of sections ) {\n let slide = new Slide(section, this)\n this.slides.push(slide)\n\n let control = this.controls[i]\n slide.control = control\n control.slideIndex = i\n\n this.bindEventToControl(control)\n\n i++\n }\n this.controls[this.current].classList.add(\"current\")\n this.len = this.slides.length\n }", "function start() {\n $('#waitPanel').remove();\n\n // build slides dynamically\n const slides = $('div.slides');\n const areyoureadyTemplate = $('#areyouready-template').html();\n slides.append(areyoureadyTemplate\n .replace(/VOICE_ID/g, sessionData['voice']['id'])\n );\n const wordTemplate = $('#word-template').html();\n $.each(sessionData['wordList'], function(idx, data) {\n slides.append(wordTemplate\n .replace(/ID/g, idx+1)\n );\n });\n const goodjobTemplate = $('#goodjob-template').html();\n slides.append(goodjobTemplate\n .replace(/VOICE_ID/g, sessionData['voice']['id'])\n );\n\n Reveal.initialize({\n controlsLayout: \"edges\",\n overview: false,\n autoPlayMedia: true,\n hash: false,\n viewDistance: Number.MAX_VALUE,\n keyboard: {\n 13: listenAgain,\n 65: listenAgain, // A - again\n 82: listenAgain, // R - repeat\n }\n });\n\n Reveal.addEventListener('slidechanged', function(p) {\n const slideNum = p['indexh'];\n playSound(slideNum);\n });\n\n // change to first (later changes will be captured above\n playSound(0);\n}", "function constrolSlides(ele) {\n // select controls ul element\n const ul=controls.children;\n // select ul chidren li element\n const li=ul[0].children;\n var active;\n for(let i=0;i<li.length;i++){\n if(li[i].className==\"active\"){\n // find who is now active\n active=i;\n // remove active class from all li element\n li[i].className=\"\";\n }\n }\n // add active class ro current slide\n ele.className=\"active\";\n\n var numb=(ele.id-1)-active;\n jumpSlideWidth=jumpSlideWidth+(slicktrackWidth*numb);\n slicktrack.style.marginLeft=-jumpSlideWidth + \"px\";\n}" ]
[ "0.81570256", "0.7804483", "0.7780646", "0.76676464", "0.74800533", "0.73905337", "0.73668736", "0.7356376", "0.7330425", "0.7324", "0.7304307", "0.72740877", "0.72647136", "0.723816", "0.7091694", "0.70783985", "0.706661", "0.70332074", "0.7017015", "0.7004169", "0.700324", "0.6994743", "0.6965584", "0.6964139", "0.69540954", "0.6949452", "0.69484454", "0.69267756", "0.6905715", "0.689623", "0.68775064", "0.6876643", "0.6873904", "0.6863382", "0.68519926", "0.68448174", "0.68258214", "0.68221563", "0.6803623", "0.67982876", "0.678482", "0.67722803", "0.6772153", "0.67647564", "0.6735158", "0.67268807", "0.6719543", "0.6700495", "0.6700495", "0.669027", "0.6687042", "0.6676868", "0.66624194", "0.6638857", "0.6637357", "0.6633789", "0.6609466", "0.6593709", "0.65924484", "0.65847886", "0.6584462", "0.6582557", "0.65757495", "0.6568354", "0.6567971", "0.6557972", "0.6556422", "0.6555539", "0.6549206", "0.6546711", "0.6539474", "0.6527544", "0.6517333", "0.65152323", "0.65103924", "0.6509559", "0.6508643", "0.650808", "0.65030444", "0.6494661", "0.6492062", "0.6489006", "0.6483824", "0.6478927", "0.6477933", "0.6477566", "0.647654", "0.64703304", "0.64602053", "0.6453196", "0.6450449", "0.6447212", "0.6443052", "0.6442129", "0.6440908", "0.6422697", "0.6419071", "0.64136314", "0.6411928", "0.6409171" ]
0.68962467
29
3. auto slide stop funtion
function stopTimer(){ clearInterval(timer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function slideStop()\n{\n\t\n\tcontinueFollow='stop';\n\tsliderDrag();\n}", "function stopAutoSlide(){\n clearInterval(moveSlides);\n}", "function stopAutoSlide() {\n clearInterval(autoSlideInterval);\n autoSlide = null;\n}", "function stopAutoslide() {\n if ($run.autoslideId) {\n window.clearInterval($run.autoslideId);\n $run.autoslideId = null;\n }\n }", "function triggerSlideEnd(){\n if(!slided){\n $(element).trigger({\n type: \"afterSliding\",\n prevSlide: prevSlide,\n newSlide: obj.currentSlide,\n totalSlides:obj.totalSlides,\n prevIndex:obj.prevIndex\n });\n slided = true;\n }\n obj.prevIndex = obj.currentSlide;\n }", "function stopSlide() {\n\n // show quoteButtons\n $('#quoteButtons').show();\n\n // hide slideshow controls\n $('#controls').hide();\n\n // stop the slideshow\n clearInterval(showStart);\n}", "function autoSlide(ele) {\n\n function runSlide() {\n var cur_act = ele[cur_pos];\n cur_act.classList.remove('active');\n if (cur_pos < ele.length -1) {\n cur_pos++;\n } else {cur_pos=0;}\n var next_act = ele[cur_pos];\n cur_act.classList.add('hide');\n next_act.classList.add('show');\n cur_act.addEventListener('webkitAnimationEnd', function () {\n cur_act.classList.remove('hide');\n cur_act.classList.remove('active');\n });\n next_act.addEventListener('webkitAnimationEnd', function () {\n next_act.classList.add('active');\n next_act.classList.remove('show');\n });\n }\n return runSlide; //CLOSURE , return runSlide with autoSlide enviroment (which has cur_pos var)\n }", "function slideStart()\n{\n\n\tcontinueFollow='continue';\n\t\tsliderDrag();\n}", "function cancelAutoSlide() {\n\n clearTimeout(autoSlideTimeout);\n\n }", "stopTimerSlide() {\n clearInterval(this.interval);\n }", "function goToSlideInfinite() {\n var desired = -(width * (current + 1));\n animating = false;\n\n ML.El.cssTransform(ul, 'translateX(' + desired + 'px)');\n\n ul.addEventListener('transitionend', function() {\n animating = false;\n callback(false);\n });\n }", "function stopRotateSlides() {\n\t\t\tclearInterval(self.playSlides);\n\t\t}", "function cueAutoSlide() {\n\n clearTimeout(autoSlideTimeout);\n\n // Cue the next auto-slide if enabled\n if (autoSlide && !isPaused() && !isOverview()) {\n autoSlideTimeout = setTimeout(navigateNext, autoSlide);\n }\n\n }", "function nextSlide(inc){\r\n if (noOfSlides <= 1) return;\r\n slideOmit = true; // inhibit next time trigger\r\n slideUp = inc >= 0 ? +1 : -1;\r\n slideTime = 11000; // keep next slide for longer\r\n if (inc == 0) slideIndex += slideUp;\r\n else if (inc < -3) slideIndex = 888; // force start 0\r\n else if (inc > +3) slideIndex = -888; // force end\r\n carousel();\r\n} // nextSlide(inc)", "function stopSlideshow() {\n\t\t_clearSlideshowTimer();\n\t\tbtnStop.addClass(CLASS_DISABLED);\n\t\tbtnStart.removeClass(CLASS_DISABLED);\n\t}", "function slideBackward() {\n if ($run.activeIndex > 0) {\n $run.activeIndex -= 1;\n } else if ($conf.cycle) {\n $run.activeIndex = ($conf.slides.length - 1);\n }\n\n alignToActiveSlide();\n }", "function next() {\n slide(false, true);\n }", "function playAutoSlide(index, duration) {\n autoSlideInterval =this.setInterval(function() {\n if (currentIndex + 1 > slide.length) { \n goToSlide(0);\n } else {\n goToSlide(currentIndex + 1);\n }\n }, 5000)\n}", "function startAutoSlide() {\n\t// if (autoSlideInterval) { // if the interval has been set already\n\t\tclearInterval(autoSlideInterval); // clear the interval\n\t// }\n\t// MAYBE SHOULD WAIT FOR FINAL RESIZE EVENT??? TEST TO FIND OUT\n\tvar interval = autoSlide * 1000; // * 1000 to convert s to ms\n\tautoSlideInterval = setInterval(function() { moveCarousel('next'); }, interval); // call moveCarousel('next') every interval\n}", "function slideIn() {\nvar slidingDiv = document.getElementById(\"slider\");\nvar stopPosition = -342;\nif (parseInt(slidingDiv.style.right) > stopPosition) {\nslidingDiv.style.right = parseInt(slidingDiv.style.right) - 2 + \"px\";\nsetTimeout(slideIn, 1);\n}\n}", "function startAutoslide() {\n if (!$run.autoslideId) {\n $run.autoslideId = window.setInterval(slideForward, $conf.autoslide);\n }\n }", "function slidebanner(option){\n \n var num=0;\n var timer=null;\n var screenWid=$(document.body).width();\n // $(option.contain1).width($(document.body).width());\n // $(option.contain1).css({'width':1200});\n $(option.contain2).find('li').width($(option.contain1).width());\n $(option.contain2).find('li img').width($(option.contain1).width());\n $(option.contain1).height($(option.contain2).find('li img').eq(0).get(0).offsetHeight);\n var firstLi=$(option.contain2).find('li').eq(0).clone(); \n $(option.contain2).append(firstLi);\n $(option.btn).children().eq(0).addClass('active');\n\n $(option.contain2).width($(option.contain1).width()*$(option.contain2).children().length);\n\n\n function autoPlay(){\n clearInterval(timer);\n timer=setInterval(function(){\n num++;\n if(num==$(option.contain2).children().length){\n num=1;\n $(option.contain2).css('left',0);\n }\n $(option.contain2).stop().animate({'left':-num*$(option.contain1).width()},800,'swing');\n if(num==$(option.contain2).children().length-1){\n $(option.btn).children().eq(0).addClass('active').siblings().removeClass('active');\n }else{\n $(option.btn).children().eq(num).addClass('active').siblings().removeClass('active');\n }\n },2000);\n }\n\n if(option.auto){\n autoPlay();\n }\n\n $(option.contain2).hover( //移入移出停止轮番 开启轮番\n\n function(){\n clearInterval(timer);\n },\n function(){\n if(option.auto){\n autoPlay();\n } \n }\n );\n\n // 给每一个导航按钮添加事件\n $(option.btn).children().each(function(i){\n \n $(this).on('mouseover',function(){\n clearInterval(timer);\n $(option.contain2).stop().animate({'left':-$(this).index()*$(option.contain1).width()},150,'swing');\n $(option.btn).children().eq($(this).index()).addClass('active').siblings().removeClass('active');\n num=$(this).index(); \n });\n });\n\n //上一张图效果\n $(option.sldir[0]).click(function(){\n num--;\n clearInterval(timer);\n if(num<0){\n num=$(option.contain2).children().length-2;\n $(option.contain2).css('left',-$(option.contain1).width()*($(option.contain2).children().length-1));\n }\n console.log(-$(option.contain1).width()*$(option.contain2).children().length-2);\n $(option.contain2).stop().animate({left:-num*$(option.contain1).width()},800);\n $(option.btn).children().eq(num).addClass('active').siblings().removeClass('active'); \n });\n //下一张图效果\n $(option.sldir[1]).click(function(){\n num++;\n clearInterval(timer);\n if(num==$(option.contain2).children().length){\n num=1;\n $(option.contain2).css({left:0});\n }\n $(option.contain2).stop().animate({left:-num*$(option.contain1).width()},800);\n\n if(num==$(option.contain2).children().length-1){\n $(option.btn).children().eq(0).addClass('active').siblings().removeClass('active');\n }else{\n $(option.btn).children().eq(num).addClass('active').siblings().removeClass('active');\n }\n });\n}", "function effectSlide () {\n pauseSlideshow();\n effect = 2;\n runSlideshow();\n }", "function slideAuto(state) {\r\n\r\n\t\t\t\t\tclearTimeout(timeout);\r\n\r\n\t\t\t\t\tif (state) {\r\n\t\t\t\t\t\ttimeout = setTimeout(function() { slideMove(options.direction,false); },pause);\r\n\t\t\t\t\t\toptions.auto = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\toptions.auto = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function slideIt() {\nvar slidingDiv = document.getElementById(\"slider\");\nvar stopPosition = 0;\nif (parseInt(slidingDiv.style.right) < stopPosition) {\nslidingDiv.style.right = parseInt(slidingDiv.style.right) + 2 + \"px\";\nsetTimeout(slideIt, 1);\n}\n}", "changeSlideOnEnd(){\n if(this.dist.movement > 120 && this.index.next !== undefined){\n this.activeNextSlider();\n }else if(this.dist.movement < -120 && this.index.prev !== undefined){\n this.activePrevSlider();\n }else{\n this.changeSlide(this.index.active)\n }\n }", "function autoSlide (){\r\n if (slider.scrollLeft > (maxScrollLeft - 1)) {\r\n clearInterval(autoMove);\r\n slider.scrollLeft -= maxScrollLeft;\r\n setTimeout(() => {\r\n return autoMove = setInterval(autoSlide,speed);\r\n }, 2000);\r\n }else{\r\n slider.scrollLeft += 10;\r\n }\r\n }", "function nextSlide() {\n \n}", "breakSlide() {\n this.break.addEventListener(\"click\", () => {\n this.stopTimerSlide(this.interval);\n })\n }", "function slideshow(){\n\tif(slider){\n\t\tclearInterval(slider);\n\t\tslider = 0;\n\t\tget('wcr_btnslide').innerHTML = 'Start Slideshow';\n\t}\n\telse{\n\t\tvar secs = Number(prompt('Enter the number of seconds for turning a page (enter a negative number to advance backwards)\\n\\n'+\n\t\t\t'Press the slideshow button, the ESC key or manually turn pages to stop', 10));\n\t\tif(secs){\n\t\t\tvar dir = secs > 0 ? 1 : -1;\n\t\t\tsecs *= dir*1000;\n\t\t\tslider = setInterval(function(){cambiaPag(dir, false, true);}, secs);\n\t\t\tget('wcr_btnslide').innerHTML = 'Stop Slideshow';\n\t\t}\n\t}\n}", "function _switchSlide(){\r\n\t\tif(slide > 0){\r\n\t\t\tfor(var i = 0; i<slide; i++){\r\n\t\t\t\tTweenMax.set($('#slide_'+i),{css:{top:'-100%'}});\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(slide>3){\r\n\t\t\t$('#fake_slide_1').hide();\r\n\t\t}\r\n\r\n\t\tTweenMax.to($('#slide_'+slide),1.6,{css:{top:'-100%'},ease:Expo.easeOut});\r\n\t\tTweenMax.to($('#slide_'+(slide+1)),1.6,{delay:0.2,css:{top:'0%'},ease:Expo.easeOut, onComplete: function(){\r\n\t\t\tslide +=1;\r\n\t\t\tconsole.log('slide: '+slide);\r\n\t\t}});\r\n\t}", "function startSlideShow(){\n \n var $slideBox = $('.auto_slideshow ul');\n var $slides = $('.auto_slideshow li');\n \n interval = setInterval(function(){\n $slideBox.animate({'margin-left': '-=' +autoSlideWidth},autoSlideSpeed, function() {\n ($slideBox).find('li:last').after($slideBox.find('li:first'));\n $slideBox.css('margin-left',0);\n }); //End animate function \n }, autoSlidePause);//End Setinterval function\n }", "function plusSlides(n) {\r\n showSlides(slideIndex += n);\r\n //clearInterval(interval);\r\n}", "function autoPlay() {\n if (slider.scrollLeft > (maxScrollLeft - 1)) {\n slider.scrollLeft -= maxScrollLeft;\n } else {\n slider.scrollLeft += 1;\n}\n}", "function slideForward() {\n if ($run.activeIndex < ($conf.slides.length - 1)) {\n $run.activeIndex += 1;\n } else if ($conf.cycle) {\n $run.activeIndex = 0;\n }\n\n alignToActiveSlide();\n }", "function pauseSlideshow () {\n isRunning = false;\n control.className = \"fa fa-play\";\n clearInterval(play);\n play = 0;\n }", "goToFirstSlide() {\n\n this.goTo(0, -1);\n\n }", "function startSlide(){\n console.log(\"automatically changing slides\")\n changeSlide(1)\n setTimeout(startSlide, 4000);\n}", "function moveSlide(n) { //moveSlide untuk button prev dan next\r\n index = index+n\r\n showSlides(index);\r\n}", "function stop_slideshow() {\r\n // alert(\"Entering stop_slideshow. PID = \" + pid_slideshow);\r\n clearTimeout(pid_slideshow);\r\n // alert(\"Exiting stop_slideshow. PID = \" + pid_slideshow);\r\n}", "function autoSlide(){\n\t\t\t\n\t\t\t//tinh slide dang hien thi\n\t\t\tvar vitrislide = 0;\n\t\t\tvar slidehientai= document.querySelector(\".homeslide ul li.active\");\n\t\t\t//console.log(slidehientai.previousElementSibling);\n\t\t\t//console.log(slidehientai);\n\t\t\t\tfor (vitrislide = 0; slidehientai = slidehientai.\n\t\t\t\t\tpreviousElementSibling; vitrislide++) {}\n\t\t\t\t\t//neu chua den slide cuoi cung tuc la vitrislide <= slides.length -> hoat dong binh thuong\n\t\t\t\tif(vitrislide < (slides.length-1)){\n\t\t\t\t\tfor (var i = 0; i < slides.length; i++) {\n\t\t\t\t\tslides[i].classList.remove(\"active\");\n\t\t\t\t\tchuyenslide[i].classList.remove(\"slideon\");\n\t\t\t\t\t}\n\t\t\t\t\tslides[vitrislide].nextElementSibling.classList.add(\"active\");\n\t\t\t\t\tchuyenslide[vitrislide].nextElementSibling.classList.add(\"slideon\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tfor (var i = 0; i < slides.length; i++) {\n\t\t\t\t\tslides[i].classList.remove(\"active\");\n\t\t\t\t\tchuyenslide[i].classList.remove(\"slideon\");\n\t\t\t\t\t}\n\t\t\t\t\tslides[0].classList.add(\"active\");\n\t\t\t\t\tchuyenslide[0].classList.add(\"slideon\");\n\t\t\t\t}\n\n\t\t\t\t//console.log(\"vi tri hien tai la\" + vitrislide);\n\t\t}", "function speedSlide() {\n // check to see if speed is already too fast (5 seconds) if so then don't speed it further.. if not speed it up by 2.5 seconds\n if (slideInt <= 2500) {\n slideInt = 2500;\n resetSpeed();\n } else {\n slideInt = slideInt - 2500;\n resetSpeed();\n }\n}", "function autoSlide(){\n\tslider.timerOn = true;\n\treturn setInterval(function(){incrementIndex(1)}, \"8000\");\n}", "function resumeslider() {\n $('#slider').flexslider(\"next\"); $('#slider').flexslider(\"play\");\n}", "function reset() {\n window.clearInterval(interval)\n interval = window.setInterval(() => {\n nextSlide(1);\n }, 5000);\n}", "function slideRest () {\n cpCmndTOCVisible = false;\n hidePlay();\n }", "function startSlider(){\n interval = setInterval (function() { \n $slideContainer.animate({'margin-left': '-=' +width}, animationSpeed, function(){\n currentSlide++;\n if (currentSlide===$slides.length){\n currentSlide = 1;// \n $slideContainer.css('margin-left', 0);\n }\n });\n }, pause);\n \n }", "function previousSlide() {\n \n}", "function startSlide() {\n\n\t\tsliderCoorTop = $(\".for-slider\").offset().top;\n\t\tsliderCoorBottom = sliderCoorTop + $(window).height();\n\t\ttopWindowCoor = $(document).scrollTop();\n\t\tbottomWindowCoor = topWindowCoor + $(window).height();\n\n\t\tif( sliderCoorBottom > topWindowCoor && bottomWindowCoor > sliderCoorTop) {\n\t\t\t++countScrollForSlider;\n\t\t\t// to start the slide once\n\t\t\tif( countScrollForSlider == 1) {\n\n\t\t\t\t// console.log(\"start function showSlide\");\n\n\t\t\t\tcountClearScrollForSlider = 0;\n\t\t\t\tshowSlide();\n\n\t\t\t}\t\n\n\t\t} else {\n\n\t\t\tcountScrollForSlider = 0;\n\t\t\t++countClearScrollForSlider;\n\t\t\t// if document was scrolled\n\t\t\tif(countClearScrollForSlider == 1) {\n\t\t\t\t// stop the slide\n\t\t\t\t// console.log(\"stop. clearTimeout of 'sliderStart' \");\n\t\n\t\t\t\tclearTimeout(sliderStart);\n\n\t\t\t}\t\t\t\n\n\t\t}\n\n\t}", "function slides(){\n if( netscape || goodIE || mozilla){\n if(visib==1){\n clearTimeout(tim);\n countdown = longpause;\n moveit();\n tim=setTimeout(\"checktime()\", pausetime);\n }\n }\n}", "function onSlideChangeEnd()\n {\n isAnimating = false;\n }", "function next() {\r\n i++;\r\n if (i > image.length - 1) {\r\n i = 0;\r\n }\r\n slideShow();\r\n}", "function plusSlides(n)\n{\n clearInterval(myTimer);\n if (n < 0)\n {\n showSlides(slideIndex -= 1);\n } \n else \n {\n showSlides(slideIndex += 1); \n }\n \n //COMMENT OUT THE LINES BELOW TO KEEP ARROWS PART OF MOUSEENTER PAUSE/RESUME\n \n if (n === -1)\n {\n myTimer = setInterval(function(){plusSlides(n + 2)}, 3000);\n } \n else \n {\n myTimer = setInterval(function(){plusSlides(n + 1)}, 3000);\n }\n}", "function leave() {\n // console.log('left');\n if ($scope.filteredSlides[self.currentIndex].locked !== true) {\n timer = $timeout(autoSlide, self.interval);\n // console.log('restarted');\n }\n }", "function currentSlide(n)\n{\n clearInterval(myTimer);\n myTimer = setInterval(function(){plusSlides(n + 1)}, 3000);\n showSlides(slideIndex = n);\n}", "function cycleSlides() {\n var firstSlide = slideContainer.children[0]\n var secondSlide = slideContainer.children[1]\n\n firstSlide.classList.remove('moveSlide')\n secondSlide.classList.remove('moveSlide')\n\n firstSlide.remove()\n slideContainer.appendChild(firstSlide)\n\n firstSlide.removeEventListener('animationend', cycleSlides)\n}", "nextSlide() {\n\n if (this.currSlide < this.slides.length - 1) {\n\n this.goTo(this.currSlide + 1, -1);\n\n } else {\n\n this.goToFirstSlide();\n\n }\n\n }", "function changeSlidesAutomatically() {\n if (indexOfCurrentSlide > maxNumberOfSlides) {\n indexOfCurrentSlide %= maxNumberOfSlides;\n }\n\n removeCurrentClass();\n\n switch (indexOfCurrentSlide) {\n case 1:\n createFirstSlide();\n break;\n case 2:\n createSecondSlide();\n break;\n case 3:\n createThirdSlide();\n break;\n case 4:\n createForthSlide();\n break;\n case 5:\n createFifthSlide();\n break;\n default:\n break;\n }\n\n setCurrentClass();\n indexOfCurrentSlide += 1;\n // resetTimer();\n }", "function carousel() {\n for (const element of mySlides) { //pour chaque élément de $mySlides \n element.style.display = \"none\";//appliquer le style css \"display: none\" à chaque élement\n };\n\n slideIndex++; // ajoute un à la valeure actuelle de slideIndex\n\n if (slideIndex > mySlides.length) { //si slideIndex est supérieur au nombre d'objet dans $mySlides\n slideIndex = 1 //alors slideIndex est égale à 1\n };\n\n mySlides[slideIndex - 1].style.display = \"block\"; //applique le style css \"display: block\" à l'élement correspondant à l'index $mySlides. Le nombre insérré dans l'index correspond à la variable slideIndex -1\n \n setTimeout(carousel, 5000); //execute la fonction carousel tout les X secondes\n}", "function prev() {\n slide(false, false);\n }", "function slideShow(index){\n\tslideIndex = index - 1;\n\t\n\ttimer = window.setInterval(nextSlide, 2500);\n}", "function startTimer(){\r\n timer = setInterval(function(){\r\n var nextIndex = (currentIndex + 1 ) % $slides.length; // 슬라이드 제작시 많이 쓰는 공식\r\n goToSlide(nextIndex);\r\n console.log(nextIndex);\r\n }, 2000)\r\n }", "function constrolSlides(ele) {\n // select controls ul element\n const ul=controls.children;\n // select ul chidren li element\n const li=ul[0].children;\n var active;\n for(let i=0;i<li.length;i++){\n if(li[i].className==\"active\"){\n // find who is now active\n active=i;\n // remove active class from all li element\n li[i].className=\"\";\n }\n }\n // add active class ro current slide\n ele.className=\"active\";\n\n var numb=(ele.id-1)-active;\n jumpSlideWidth=jumpSlideWidth+(slicktrackWidth*numb);\n slicktrack.style.marginLeft=-jumpSlideWidth + \"px\";\n}", "function advance() {\r\n clearTimeout(timeout);\r\n\r\n timeout = setTimeout(function () {\r\n if (currentIndex < ($slides.length - 1)) {\r\n move(currentIndex + 1);\r\n }\r\n else {\r\n move(0);\r\n }\r\n }, 400000);\r\n }", "function next() {\n clearInterval(playslides);\n playslides = setInterval(next, 5000);\n if (current_slide_index < slide_count - 1) {\n current_slide_index++;\n set_current_slide(img_array[current_slide_index].src);\n }\n else {\n current_slide_index = 0;\n set_current_slide(img_array[current_slide_index].src);\n }\n}", "function slowSlide() {\n // check to see if speed is already too slow (60 seconds) if so then don't slow it further.. if not slow it down by 2.5 seconds\n if (slideInt >= 60000) {\n slideInt = 60000;\n resetSpeed();\n } else {\n slideInt = slideInt + 2500;\n resetSpeed();\n }\n}", "function moverDerecha() {\n\n //con is hago una comprobacion, me devuelve un booleano\n if (!slider.is(':animated')) {\n slider.animate({\n marginLeft : '-105.6%'\n }, 700, function () {\n $('#slider .slide:first').insertAfter('#slider .slide:last');\n slider.css('margin-left', '-43%');\n resetInterval();\n });\n }\n \n\n\n}", "function minusSlide() {\n\t\tvar goBack = carouselStatic();\n\t\tx[slidesIndex-1].style.display = \"block\";\n\t}", "function onSlideChangeEnd()\n\t{\n\t\tisAnimating = false;\n\t}", "function slideShowNext() {\n slideShow((curIndex !== slides.length - 1) ? curIndex + 1 : 0, 'left');\n }", "function forward () {\n\t\t\t\t\n\t\t\t\t$('.btn-right').prop('disabled', true);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t$('.btn-right').prop('disabled', false);\n\t\t\t\t\t}, 2000);\n\t\t\t\t\t\t\t\n\t\t\t\t$slideContainer.animate({'margin-left': '-=' +width}, animationSpeed, function () {\t\t\t\t\n\t\t\t\tcurrentSlide++;\n\n\t\t\t\t\t\tif ( currentSlide === $slides.length ) { \n\t\t\t\t\t\tcurrentSlide = 1;\n\t\t\t\t\t\t$slideContainer.css('margin-left', '-' + 700 + 'px');\n\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}", "function moverIzquierda() {\n if (!slider.is(':animated')) {\n $('#slider .slide:last').insertBefore('#slider .slide:first');\n slider.css('margin-left', '-105.6%');\n slider.animate({\n marginLeft: '-43%'\n },700, function () {\n resetInterval()\n });\n \n }\n }", "function move_slide_silent() {\n\t\t\tslides_holder.css({'margin-left' : slide_width * (-current_position)});\t\n\t\t}", "function interruptSlideShow() {//stop interval, start timer 15s restart\n if (angular.isDefined(vm.slideTimerId)) {\n $interval.cancel(vm.slideTimerId);\n vm.slideTimerId = undefined;\n }\n //start 15s timer to restart slide show\n $timeout(function () {\n console.log(\"========15 second timeout expired========\");\n vm.slideTimerId = $interval(slideTimerTrigger, 5000);\n }, 30000, 1);\n }", "function thaw() {\n log(\"clearing stop flag and scheduling a slide change\");\n\n if (stop) {\n jQuery('#panel1').show();\n setTimeout(function () {\n hideTopPanel();\n }, SETTINGS.CHANGETIME);\n }\n stop = false;\n}", "function hideSlides($slide) {\n $slide.css({\"top\": 0, \"left\": \"-9999px\", \"z-index\": \"\"});\n }", "function switch_slides () {\n // Animate to next slide by facing opacity of foreground from 100% to 0%\n foreground_element.animate({ opacity: 0 }, that.options.speed, function () {\n load_slide(foreground_element, that.options.slides[current_slide_id]);\n foreground_element.css('opacity', 1); // turn foreground on full opacity\n load_slide(background_element, that.options.slides[next_slide_id]); // load next slide into background\n });\n\n // Update slide_id's\n current_slide_id += 1; //next_slide_id - 1;\n if (current_slide_id >= slide_count) {\n current_slide_id = 0;\n }\n next_slide_id = current_slide_id + 1;\n if (next_slide_id >= slide_count) {\n next_slide_id = 0;\n }\n }", "function slideEr() {\n \t document.getElementById('slide').src = images[i];\n\t document.getElementById('slide').className += \"fadeOut\";\n\t setTimeout(function() {\n\t\t document.getElementById('slide').src = images[i];\n\t\t document.getElementById('slide').className= \"\";\n\t }, 450);\n\n\tif(i < images.length - 1){\n\t\ti++;\n\t}else{\n\t\t\ti=0;\n\t\t }\n\t\tsetTimeout(\"slideEr()\", 4000);\t\n}", "function pauseSlide() {\n\t\tif (!$('.pause-cycle-button').hasClass('paused')) {\n\t\t\tconsole.log('Pause Slide');\n\t\t\t$('.carousel').carousel('pause');\n\t\t\t$('.pause-cycle-button').toggleClass('paused');\n\t\t\t$('.pause-cycle-button i').removeClass('fa-pause').addClass('fa-play');\n\t\t\t$(this).blur();\n\t\t}\n\t}", "function slideRest(){\n cpCmndTOCVisible = false;\n cp.show(pauseID);\n stayMute(); \n }", "function slideshowplusSlides(n){\r\n clearInterval(myTimer);\r\n if (n < 0){\r\n showSlides1(slideIndex1 -= 1);\r\n } else {\r\n showSlides1(slideIndex1 += 1); \r\n }\r\n \r\n //COMMENT OUT THE LINES BELOW TO KEEP ARROWS PART OF MOUSEENTER PAUSE/RESUME\r\n \r\n if (n === -1){\r\n myTimer = setInterval(function(){slideshowplusSlides(n + 2)}, 4000);\r\n } else {\r\n myTimer = setInterval(function(){slideshowplusSlides(n + 1)}, 4000);\r\n }\r\n}", "function setSliderInterval(){\n clearInterval(sliderInterval);\n sliderInterval = setInterval(function(){\n obj.nextSlide();\n },options.interval);\n }", "function slideout()\n{\n\tvar sliderOptions =\n\t{\n\t\tcurrentMargin: 0,\n\t\tmarginSpeed: -10\n\t};\n\tvar s = $(\"#ltitle\");\n\n\tif (s.width() >= 288)\n\t{\n\t\ts.css(\"right\", \"0px\");\n\t}\n}", "function automaticallySlide(){\n\t\tactiveSlideNum++;\n\t\tif(activeSlideNum>3) activeSlideNum=1;\n\t\tactiveDot = \"dot_\" + activeSlideNum;\n\t\tactiveSlide = \"slide_\" + activeSlideNum;\n\n\t\t$(\".find_carousel .slide\").removeClass(\"active\");\n\t\t$(\".find_carousel .\" + activeSlide).addClass(\"active\");\n\n\t\t$(\".find_carousel .dot\").removeClass(\"active\");\n\t\t$(\".find_carousel .\" + activeDot).addClass(\"active\");\n\t}", "function currentSlide(n){\n clearInterval(gMyTimer);\n gMyTimer = setInterval(function(){plusSlides(n + 1)}, 4000);\n showSlides(gSlideIndex = n);\n}", "function previousSlide()\r\n{\r\n slideIndex--;\r\n showSlide();\r\n}", "function startSlideShow(n){\n\tseconds = slideTimer;\n\n\tsetInterval(function(){\n\t\tseconds--;\n\t\tif ( seconds <= 0 ) {\n\t\t\tshowNextSlide();\n\t\t\tseconds = slideTimer;\n\t\t}\n\t}, 10)\n}", "slideNext(object, slideView) {\n slideView.slideNext(500);\n }", "cycle() {\n const self = this;\n const { element, options, isPaused } = self;\n\n Timer.clear(element, carouselString);\n if (isPaused) {\n Timer.clear(element, pausedClass);\n removeClass(element, pausedClass);\n }\n\n Timer.set(element, () => {\n if (!self.isPaused && isElementInScrollRange(element)) {\n self.index += 1;\n self.to(self.index);\n }\n }, options.interval, carouselString);\n }", "function slideIn() {\n var slidingDiv = document.getElementById(\"info\");\n var stopPosition = -342;\n if (parseInt(slidingDiv.style.right) > stopPosition) {\n slidingDiv.style.right = parseInt(slidingDiv.style.right) - 2 + \"px\";\n setTimeout(slideIn, 5);\n }\n}", "function cycle_pluign(mc){\n\tvar aniType = mc.attr(\"data-transition\") ? mc.attr(\"data-transition\") : 'scrollDown';\n\tvar tim = !isNaN(mc.attr(\"data-starttime\")) ? Number(mc.attr(\"data-starttime\")) : 0;\n\tvar tim_end = !isNaN(mc.attr(\"data-endtime\")) ? Number(mc.attr(\"data-endtime\")) : 2000;\n\tvar easingType = mc.attr(\"data-easing\") ? mc.attr(\"data-easing\") : 'easeInOutBack';\n\tmc.hide();\n\tvar nextBtn = mc.find(\".next\");\n\tvar prevBtn = mc.find(\".prev\");\n\tmc.parent().find(\".cycleNextPrev\").append(nextBtn);\n\tmc.parent().find(\".cycleNextPrev\").append(prevBtn);\n\tsetTimeout(function(){\n\t\tmc.show();\n\t\tmc.cycle({\n\t\t\tfx: aniType, // choose your transition type, ex: fade, scrollUp, shuffle, etc...\n\t\t\tspeed: 1000, \n\t\t\teasing: easingType,\n\t\t\tcontainerResize: 1,\n\t\t\tslideResize: 1,\n\t\t\ttimeout: tim_end ,\n\t\t\tpause: true,\n\t\t\tnext: nextBtn,\n prev: prevBtn\n\t\t});\n\t}, tim)\n}", "function rewindSlide() {\n if (currentSlide > 0) {\n currentSlide -= 1;\n updateSlide();\n }\n}", "function resnap() {\n\t\twebslides.currentSlide.scrollIntoView();\n\t}", "function slideTo(index) {\n slide(index);\n }", "function moveToNext(isAuto) {\n if (isAuto && !auto) return;\n currentItem = (currentItem + 1) % slideNum;\n\n slideDisplay();\n}", "function slide(dir) {\n let active_index = $('.active-img').index();\n let new_index;\n if (dir == 'right') {\n new_index = active_index + 1;\n if (new_index == $('.carousel').children('li').length - 1) {\n new_index = 0;\n };\n } else if (dir == 'left') {\n new_index = active_index - 1;\n if (new_index == 0) {\n new_index = $('.carousel').children('li').length - 1;\n };\n };\n slideTo(new_index);\n}", "function move_slide() {\n\t\t\tslides_holder.animate({'marginLeft' : slide_width * (-current_position)});\t\n\t\t}", "function next_slide(ev)\n {\n ev.preventDefault();\n if (current == sync_elts.length - 1) return; // No next element\n activate(current + 1); // Move the \"active\" class\n //console.log(\"next: current = \"+current+\" t -> \"+timecodes[current]);\n seek_video();\n }", "function next(){\n let sliderSectionFirst = document.getElementsByClassName(\"sliderSection\")[0];\n slider.style.marginLeft = \"-200%\";\n slider.style.transition = \"all .6s\";\n setTimeout(function(){\n slider.style.transition = \"none\"; //quito la transicion\n slider.insertAdjacentElement(\"beforeend\", sliderSectionFirst ); //Coloco la primera imagen antes q termine el slider, asi crea el efecto de scroll infinito\n slider.style.marginLeft = \"-100%\";\n }, 600); //SetTimeout es una funcion que recibe de parametros la funcion en si y el tiempo que queres q demore en hacerla. \n}", "function nextSlide(){\n goToSlide(currentSlide+1);\n}", "function SlidePanels(action){\n var speed=900;\n var easing=\"easeInOutExpo\";\n if(action==\"open\"){\n // $(\"#arrow_indicator\").fadeTo(\"fast\",0);\n $outer_container_right.stop().animate({right: 0}, speed,easing);\n //$bg.stop().animate({right: 585}, speed,easing);\n\n } else {\n $outer_container_right.stop().animate({right: -510}, speed,easing);\n //$bg.stop().animate({right: 0}, speed,easing,function(){$(\"#arrow_indicator\").fadeTo(\"fast\",1);});\n }\n }" ]
[ "0.8165256", "0.8004957", "0.7644965", "0.7207027", "0.71406525", "0.71380246", "0.7089723", "0.7084637", "0.6986903", "0.6915306", "0.6894919", "0.6871284", "0.68291974", "0.68247664", "0.6798121", "0.6779139", "0.6738189", "0.6734049", "0.6716566", "0.6701337", "0.6681524", "0.66515946", "0.6648459", "0.66459864", "0.66451025", "0.664402", "0.6575482", "0.65736103", "0.655563", "0.6532753", "0.6524732", "0.6513802", "0.65075666", "0.6495667", "0.6474678", "0.64459157", "0.64397746", "0.64202607", "0.6415938", "0.6413197", "0.6409808", "0.6409256", "0.6408786", "0.6400844", "0.6398891", "0.6397676", "0.63889134", "0.63748455", "0.63747376", "0.6373734", "0.6367836", "0.63478017", "0.6340712", "0.63354415", "0.6334173", "0.6331498", "0.6331394", "0.633127", "0.6331079", "0.6327331", "0.6325881", "0.63208187", "0.6301278", "0.6298255", "0.6289257", "0.6288443", "0.62803304", "0.626803", "0.626371", "0.62589747", "0.6258598", "0.6255749", "0.6254829", "0.62523836", "0.6251048", "0.6248138", "0.6239874", "0.6206077", "0.6204573", "0.6204507", "0.61973053", "0.6196299", "0.61921835", "0.6184661", "0.61728173", "0.61717236", "0.6168018", "0.61664706", "0.61653674", "0.6163016", "0.6158555", "0.6158112", "0.61553943", "0.61552215", "0.6151981", "0.61508435", "0.6149081", "0.61486614", "0.61417043", "0.6134409", "0.61343575" ]
0.0
-1
4. stop slide when slide is in first or last index
function update(){ if(currentIndex === 0){ $nav.find(".prev").hide(); }else{ $nav.find(".prev").show(); } if(currentIndex === $slides.length - 1 ){ $nav.find(".next").hide(); }else{ $nav.find(".next").show(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function slideStop()\n{\n\t\n\tcontinueFollow='stop';\n\tsliderDrag();\n}", "changeSlideOnEnd(){\n if(this.dist.movement > 120 && this.index.next !== undefined){\n this.activeNextSlider();\n }else if(this.dist.movement < -120 && this.index.prev !== undefined){\n this.activePrevSlider();\n }else{\n this.changeSlide(this.index.active)\n }\n }", "nextSlide(){\r\n\r\n if(this.SlideList[this.SlideList.length-1].index !== 0){\r\n for(let i = 0; i < this.sliderLenght; i++){\r\n\r\n this.SlideList[i].index -= 1\r\n this.SlideList[i].update()\r\n }\r\n } \r\n }", "function slideBackward() {\n if ($run.activeIndex > 0) {\n $run.activeIndex -= 1;\n } else if ($conf.cycle) {\n $run.activeIndex = ($conf.slides.length - 1);\n }\n\n alignToActiveSlide();\n }", "function goToSlideInfinite() {\n var desired = -(width * (current + 1));\n animating = false;\n\n ML.El.cssTransform(ul, 'translateX(' + desired + 'px)');\n\n ul.addEventListener('transitionend', function() {\n animating = false;\n callback(false);\n });\n }", "goToLastSlide() {\n\n this.goTo(this.slides.length - 1, -1);\n\n }", "function prevSlide(){\n indexTracker--;\n if(indexTracker < 0){\n indexTracker = peopleArray.length - 1;\n }\n //$('.index-point-active').\n updateIndexPoints();\n}", "function last_slide(ev)\n {\n ev.preventDefault();\n // This isn't the last slide, but the last item on the last slide...\n activate(sync_elts.length - 1); // Move the \"active\" class\n // console.log(\"last: current = \"+current+\" t -> \"+timecodes[current]);\n seek_video();\n }", "goToFirstSlide() {\n\n this.goTo(0, -1);\n\n }", "function prevSlide()\n{\n if(index < 0)\n {\n // If index is lesser than the no. of slides\n index = 2;\n }\n else\n {\n // Backward the slides\n index--;\n }\n changeSlide(index);\n}", "function triggerSlideEnd(){\n if(!slided){\n $(element).trigger({\n type: \"afterSliding\",\n prevSlide: prevSlide,\n newSlide: obj.currentSlide,\n totalSlides:obj.totalSlides,\n prevIndex:obj.prevIndex\n });\n slided = true;\n }\n obj.prevIndex = obj.currentSlide;\n }", "nextSlide() {\n\n if (this.currSlide < this.slides.length - 1) {\n\n this.goTo(this.currSlide + 1, -1);\n\n } else {\n\n this.goToFirstSlide();\n\n }\n\n }", "function minusSlide() {\n\t\tvar goBack = carouselStatic();\n\t\tx[slidesIndex-1].style.display = \"block\";\n\t}", "function nextSlide()\n{\n if(index == slider.length-1)\n {\n // If index is greater than the no. of slides\n index = 0;\n }\n else\n {\n // Forward the slides\n index++;\n }\n changeSlide(index);\n updateIndicator(index);\n}", "function stopAutoSlide(){\n clearInterval(moveSlides);\n}", "function slideShowNext() {\n slideShow((curIndex !== slides.length - 1) ? curIndex + 1 : 0, 'left');\n }", "function next() {\r\n i++;\r\n if (i > image.length - 1) {\r\n i = 0;\r\n }\r\n slideShow();\r\n}", "next() {\n let newIndex = this.activeIndex + 1;\n\n // Wrap around indices.\n if (newIndex >= this.$slides.length) newIndex = 0;\n else if (newIndex < 0) newIndex = this.$slides.length -1;\n\n this.set(newIndex);\n }", "function previousSlide()\r\n{\r\n slideIndex--;\r\n showSlide();\r\n}", "activeNextSlider(){\n if(this.index.next !== undefined){\n this.changeSlide(this.index.next)\n }\n }", "function moveToSlide(index) { // 3277\n // Wrap around indices. // 3278\n if (index >= $slides.length) index = 0; // 3279\n else if (index < 0) index = $slides.length -1; // 3280\n // 3281\n $active_index = $slider.find('.active').index(); // 3282\n // 3283\n // Only do if index changes // 3284\n if ($active_index != index) { // 3285\n $active = $slides.eq($active_index); // 3286\n $caption = $active.find('.caption'); // 3287\n // 3288\n $active.removeClass('active'); // 3289\n $active.velocity({opacity: 0}, {duration: options.transition, queue: false, easing: 'easeOutQuad', // 3290\n complete: function() { // 3291\n $slides.not('.active').velocity({opacity: 0, translateX: 0, translateY: 0}, {duration: 0, queue: false});\n } }); // 3293\n captionTransition($caption, options.transition); // 3294\n // 3295\n // 3296\n // Update indicators // 3297\n if (options.indicators) { // 3298\n $indicators.eq($active_index).removeClass('active'); // 3299\n } // 3300\n // 3301\n $slides.eq(index).velocity({opacity: 1}, {duration: options.transition, queue: false, easing: 'easeOutQuad'});\n $slides.eq(index).find('.caption').velocity({opacity: 1, translateX: 0, translateY: 0}, {duration: options.transition, delay: options.transition, queue: false, easing: 'easeOutQuad'});\n $slides.eq(index).addClass('active'); // 3304\n // 3305\n // 3306\n // Update indicators // 3307\n if (options.indicators) { // 3308\n $indicators.eq(index).addClass('active'); // 3309\n } // 3310\n } // 3311\n } // 3312", "function nextSlide(inc){\r\n if (noOfSlides <= 1) return;\r\n slideOmit = true; // inhibit next time trigger\r\n slideUp = inc >= 0 ? +1 : -1;\r\n slideTime = 11000; // keep next slide for longer\r\n if (inc == 0) slideIndex += slideUp;\r\n else if (inc < -3) slideIndex = 888; // force start 0\r\n else if (inc > +3) slideIndex = -888; // force end\r\n carousel();\r\n} // nextSlide(inc)", "function firstToTheEnd() {\n let firstSlider; // variable stores first slider\n if (curIndex === 0) firstSlider = quoteSlides[quoteSlides.length - 1];\n else firstSlider = quoteSlides[curIndex - 1];\n\n // moving first slide to the end and removing the \"left: -200%\" class of the container\n mySlider.appendChild(firstSlider);\n mySlider.classList.remove('go-forward');\n\n // increment the current index \n curIndex++;\n if (curIndex > (quoteSlides.length - 1)) curIndex = 0;\n\n // setting current button number due to current Index\n if(curIndex > 0){\n curButton = curIndex - 1;\n // if current button = 0 we have to go to the last element \n if(curButton > 0){ \n myButtons[curButton - 1].classList.remove('active-btn');\n myButtons[curButton].classList.add('active-btn');\n } else{\n myButtons[myButtons.length - 1].classList.remove('active-btn');\n myButtons[0].classList.add('active-btn');\n } \n } else{\n curButton = myButtons.length - 1;\n myButtons[curButton - 1].classList.remove('active-btn');\n myButtons[curButton].classList.add('active-btn');\n }\n}", "function slideForward() {\n if ($run.activeIndex < ($conf.slides.length - 1)) {\n $run.activeIndex += 1;\n } else if ($conf.cycle) {\n $run.activeIndex = 0;\n }\n\n alignToActiveSlide();\n }", "function stopSlide() {\n\n // show quoteButtons\n $('#quoteButtons').show();\n\n // hide slideshow controls\n $('#controls').hide();\n\n // stop the slideshow\n clearInterval(showStart);\n}", "function changeImageBack(){\n document.slide.src = imageArray[i];\n \n \n if(i < imageArray.length - 1){\n i - 1;\n }else{\n i = 0;\n }\n}", "function advanceIndex( arr, container ) {\n var getIndex = currentSlide( arr ).index(); // get current slides index\n var newIdx = getIndex += 1; // set new index\n\n // if the index value is less than or equal to the array length value\n if ( currentSlide( arr ).index() < arr.length - 1 ) {\n // clear out current active state\n currentSlide(arr).selected.active = false;\n\n // assign new active state index\n arr[newIdx].active = true;\n //console.log(arr);\n\n // if idx of arr == newIdx\n if ( currentSlide( arr ).index() == newIdx ) {\n displaySlide( arr, container );\n dotNavSlides( arr, container );\n }\n else {\n console.log(\"conditional switcher inside advance index not working\");\n }\n }\n // set loop properties\n else if ( prefs.loop === true ) {\n currentSlide( arr ).selected.active = false;\n arr[0].active = true;\n\n displaySlide( arr, container );\n dotNavSlides( arr, container );\n }\n else {\n console.log(\"Last slide in the array\");\n }\n }", "function next_slide(ev)\n {\n ev.preventDefault();\n if (current == sync_elts.length - 1) return; // No next element\n activate(current + 1); // Move the \"active\" class\n //console.log(\"next: current = \"+current+\" t -> \"+timecodes[current]);\n seek_video();\n }", "function restart(slide) {\n var found3 = props.slides;\n var index3 = found3.findIndex((fruit3) => fruit3.title === slide);\n\n // setSlide(found3[0].title)\n // setNextSlide(found3[0].text);\n\n // setAgainStart(false)\n\n // setNextButton(false)\n\n if (index3 < found3.length) {\n setSlide(found3[0].title);\n setNextSlide(found3[0].text);\n setAgainStart(false);\n setActiveButton(true);\n setNextButton(false);\n }\n }", "function backSlide() { showSlide(slideNumber - 1); }", "function nextSlide(array){\n indexTracker++;\n if (indexTracker>=array.length){\n indexTracker=0;\n }\n updateIndexPoints(array);\n}", "resetInfinite() {\n // console.log('currentSlide', this.currentSlide, '<= slidesToScroll', this.options.slidesToScroll)\n if (this.currentSlide <= this.options.slidesToScroll) {\n this.gotoItem(this.currentSlide + (this.items.length - 2 * this.offset), false)\n } else if (this.currentSlide >= this.items.length - this.offset){\n this.gotoItem(this.currentSlide - (this.items.length - 2 * this.offset), false)\n }\n }", "next() {\n\n if (this.currStep < this.slides[this.currSlide].steps.length - 1) {\n\n this.nextStep();\n\n } else {\n\n this.nextSlide();\n\n }\n\n }", "activePrevSlider(){\n if(this.index.prev !== undefined){\n this.changeSlide(this.index.prev)\n }\n }", "function recalculateIndex(){\r\n\r\n\t\t\tisDragging = false;\r\n\r\n\t\t\tvar k = 0;\r\n\t\t\twhile($slides.eq(k).position().left*(-1) > $empty.position().left){\r\n\t\t\t\tk++;\r\n\t\t\t}\r\n\r\n\t\t\t_index = k-1 > 0 ? k-1 : k;\r\n\r\n\t\t}", "function slideStart()\n{\n\n\tcontinueFollow='continue';\n\t\tsliderDrag();\n}", "function prevSlide(slide) {\n //console.log(slide);\n var found = props.slides;\n // console.log(found)\n\n var index = found.findIndex((fruit) => fruit.title === slide);\n // console.log(index);\n if (index == 1) {\n setNextButton(false);\n setActiveButton(true);\n setAgainStart(false);\n }\n if (index > 0) {\n setSlide(found[index - 1].title);\n setNextSlide(found[index - 1].text);\n setActiveButton(true);\n }\n }", "next()\n\t{\n\t\tlet next = (this.current == this.slides.length - 1) ? 0 : this.current + 1;\n\t\treturn this.show(next);\n\t}", "function slide(dir) {\n let active_index = $('.active-img').index();\n let new_index;\n if (dir == 'right') {\n new_index = active_index + 1;\n if (new_index == $('.carousel').children('li').length - 1) {\n new_index = 0;\n };\n } else if (dir == 'left') {\n new_index = active_index - 1;\n if (new_index == 0) {\n new_index = $('.carousel').children('li').length - 1;\n };\n };\n slideTo(new_index);\n}", "function callNextSlide() {\r\n\t\t\tvar nextIndex = (currentIndex < itemNum - 1) ? (currentIndex + 1) : 0;\r\n\t\t\tchangeSlide(nextIndex);\r\n\t\t}", "function plusSlides(n) {\r\n showSlides(slideIndex += n);\r\n //clearInterval(interval);\r\n}", "function jumpToLast() {\n\t\t\tif (options.sliderType === 'vertical') {\n\t\t\t\t$sliderWindow.animate({\n\t\t\t\t\tmarginTop: - ((options.sliderParentHeight * (options.numberOfSlides - 1)))\n\t\t\t\t}, 0);\n\t\t\t} else if (options.sliderType === 'horizontal') {\n\t\t\t\t$sliderWindow.animate({\n\t\t\t\t\tright: (options.sliderWindowWidth - options.sliderParentWidth)\n\t\t\t\t}, 0);\n\t\t\t}\n\t\t}", "function next() {\n slide(false, true);\n }", "function slideShow() {\n $thumbArray\n .eq(index) // eq selects the element at the given index\n .trigger('click'); // trigger a psuedo click event\n\n // If the last thumbnail is passed, go the beginning\n if (++index >= $thumbArray.length) {\n index = 0;\n }\n }", "function paginationBackward(event) {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tvar currentEq = $('.sp-thumbs .sp-current').index();\n\t\t\t\tif(currentEq <= 0) {\n\t\t\t\t} else {\n\t\t\t\t\tif (currentEq == 1) {\n\t\t\t\t\t\t$('#sp-prev').css('opacity','.1');\n\t\t\t\t\t}\n\t\t\t\t\tvar nextEq = currentEq - 1;\n\t\t\t\t\t$('#sp-next').css('opacity','1');\n\t\t\t\t\t$('.sp-current').removeClass();\n\t\t\t\t\t$('.sp-thumbs a:eq('+nextEq+')').addClass('sp-current');\n\t\t\t\t\tswapImages(currentEq, nextEq)\n\t\t\t\t}\n\t\t\t\tevent.preventDefault();\n\t\t\t}", "function lastToTheBegin() {\n let lastSlider; // variable stores last slider\n if (curIndex === (quoteSlides.length - 1)) lastSlider = quoteSlides[0];\n else lastSlider = quoteSlides[curIndex + 1];\n\n // moving last slide to begin and removing the \"left: 0\" class of the container\n if (curIndex === 0) mySlider.insertBefore(lastSlider, quoteSlides[quoteSlides.length - 1]);\n else mySlider.insertBefore(lastSlider, quoteSlides[curIndex - 1]);\n mySlider.classList.remove('go-back');\n\n curButton--;\n if(curButton < 0){\n curButton = (myButtons.length - 1);\n myButtons[0].classList.remove('active-btn');\n myButtons[curButton].classList.add('active-btn');\n } else{\n myButtons[curButton + 1].classList.remove('active-btn');\n myButtons[curButton].classList.add('active-btn');\n }\n\n // decrement the current index \n curIndex--;\n if (curIndex < 0) {\n curIndex = 2;\n }\n}", "function prevImg(){\n currentSlide--\n if (currentSlide < 1){\n currentSlide = slides.length;\n }\n slideShow();\n}", "function moveSlide(n) { //moveSlide untuk button prev dan next\r\n index = index+n\r\n showSlides(index);\r\n}", "function _forwardThumbnailSlide() {\n\t\tif (thumbindex >= 0 && thumbindex+1 < anchors.size()) {\n\t\t\tthumbindex++;\n\t\t\t_thumbnailSlide();\n\t\t}\n\t}", "_handleClickOnSlide() {\n this.$slidesContainer.addEventListener(\"pointerup\", (e) => {\n for (let [i, $slide] of this.$slides.entries()) {\n if ($slide.contains(e.target) || $slide === e.target) {\n if (this.currentSlide !== $slide) {\n const slide = this.getSlide($slide);\n this.goTo(slide.idx);\n }\n }\n }\n });\n }", "function goToLastMarkedSlide() {\n if (markedSlidesStack.length == 0) {\n return false;\n }\n\n let s = markedSlidesStack.pop();\n\n if (s.subSlide >=0 ) {\n goToSlide(s.mainSlide, s.subSlide);\n } else {\n goToSlide(s.mainSlide);\n }\n\n return true;\n}", "prevSlide(e) {\r\n // !e.code will be true with mouse click. Rest condition check the key events\r\n if (!e.code || e.code.toLowerCase() === 'space' || e.code.toLowerCase() === 'enter' || e.code.toLowerCase() === 'numpadenter') {\r\n let n = this.index;\r\n n--;\r\n clearInterval(this.clrInterval);\r\n const val = n < 0 ? this.slides.length - 1 : n;\r\n this.slideShow(val);\r\n }\r\n }", "function grabPreviousSlide() {\n\n currentSlide--;\n if (currentSlide < 0) {\n currentSlide = slides.length - 1;\n }\n }", "function chooseSlide( event ) {\n var selected = $(this);\n var index = selected.index();\n var offset = index - selected.siblings(\".active\").index();\n\n for(var i = Math.abs(offset); i--; ) {\n var row = LG[ state.get() === \"info\" ? \"Info\" : \"List\" ].getCurrent();\n row[ offset < 0 ? \"previous\" : \"next\" ]( i !== 0 );\n }\n }", "function prev_slide(ev)\n {\n ev.preventDefault();\n if (current == 0) return; // Already at first element\n activate(current - 1); // Move the \"active\" class\n //console.log(\"prev: current = \"+current+\" t -> \"+timecodes[current]);\n seek_video();\n }", "function moveToSlide(index) {\n\t // Wrap around indices.\n\t if (index >= $slides.length) index = 0;\n\t else if (index < 0) index = $slides.length -1;\n\t\n\t $active_index = $slider.find('.active').index();\n\t\n\t // Only do if index changes\n\t if ($active_index != index) {\n\t $active = $slides.eq($active_index);\n\t $caption = $active.find('.caption');\n\t\n\t $active.removeClass('active');\n\t $active.velocity({opacity: 0}, {duration: options.transition, queue: false, easing: 'easeOutQuad',\n\t complete: function() {\n\t $slides.not('.active').velocity({opacity: 0, translateX: 0, translateY: 0}, {duration: 0, queue: false});\n\t } });\n\t captionTransition($caption, options.transition);\n\t\n\t\n\t // Update indicators\n\t if (options.indicators) {\n\t $indicators.eq($active_index).removeClass('active');\n\t }\n\t\n\t $slides.eq(index).velocity({opacity: 1}, {duration: options.transition, queue: false, easing: 'easeOutQuad'});\n\t $slides.eq(index).find('.caption').velocity({opacity: 1, translateX: 0, translateY: 0}, {duration: options.transition, delay: options.transition, queue: false, easing: 'easeOutQuad'});\n\t $slides.eq(index).addClass('active');\n\t\n\t\n\t // Update indicators\n\t if (options.indicators) {\n\t $indicators.eq(index).addClass('active');\n\t }\n\t }\n\t }", "function moveToSlide(index) {\n if (index >= $slides.length) index = 0;\n else if (index < 0) index = $slides.length -1;\n\n $active_index = $slider.find('.active').index();\n\n // Only do if index changes\n if ($active_index != index) {\n $active = $slides.eq($active_index);\n $caption = $active.find('.caption');\n\n $active.removeClass('active');\n $active.velocity({opacity: 0}, {duration: options.transition, queue: false, easing: 'easeOutQuad',\n complete: function() {\n $slides.not('.active').velocity({opacity: 0, translateX: 0, translateY: 0}, {duration: 0, queue: false});\n } });\n captionTransition($caption, options.transition);\n\n\n // Update indicators\n if (options.indicators) {\n $indicators.eq($active_index).removeClass('active');\n }\n\n $slides.eq(index).velocity({opacity: 1}, {duration: options.transition, queue: false, easing: 'easeOutQuad'});\n $slides.eq(index).find('.caption').velocity({opacity: 1, translateX: 0, translateY: 0}, {duration: options.transition, delay: options.transition, queue: false, easing: 'easeOutQuad'});\n $slides.eq(index).addClass('active');\n\n\n // Update indicators\n if (options.indicators) {\n $indicators.eq(index).addClass('active');\n }\n }\n }", "function previousSlide() {\n \n}", "function nextSlide() {\n if (i === sliders.length - 1) {\n i = 0;\n sliders[sliders.length - 1].classList.remove(\"active\");\n } else {\n i++;\n sliders[i - 1].classList.remove(\"active\");\n }\n sliders[i].classList.add(\"active\");\n}", "nextSlide(e) {\r\n // !e.code will be true with mouse click. Rest condition check the key events\r\n if (!e.code || e.code.toLowerCase() === 'space' || e.code.toLowerCase() === 'enter' || e.code.toLowerCase() === 'numpadenter') {\r\n let n = this.index;\r\n n++;\r\n clearInterval(this.clrInterval);\r\n const val = n > (this.slides.length - 1) ? 0 : n;\r\n this.slideShow(val);\r\n }\r\n }", "function stopRotateSlides() {\n\t\t\tclearInterval(self.playSlides);\n\t\t}", "pageDown() {\n\t\tlet index = this.state.firstIndex;\n\n\t\t//If increasing the carousel's first index will move beyond the array's limits, we reset back to zero\n\t\tif (index - 1 >= 0) {\n\t\t\tindex--;\n\t\t}\n\n\t\tthis.setState({\n\t\t\tfirstIndex: index\n\t\t});\n\t}", "prevSlide() {\n\n if (this.currSlide > 0) {\n\n this.goTo(this.currSlide - 1, -1);\n\n } else {\n\n this.goToLastSlide();\n\n }\n\n }", "function skipSequence() {\n skip = true;\n Velocity($skipBtn, 'transition.slideDownOut');\n}", "function goToNextSlide() {\n if (getCurrentSubSlide() != -1 && getNumberOfSubSlides() > getCurrentSubSlide()+1) {\n goToSlide(getCurrentMainSlide(), getCurrentSubSlide() + 1);\n return true;\n }\n if (getNumberOfMainSlides() > getCurrentMainSlide() + 1) {\n goToSlide(getCurrentMainSlide()+1);\n return true;\n }\n return false;\n}", "function rewindSlide() {\n if (currentSlide > 0) {\n currentSlide -= 1;\n updateSlide();\n }\n}", "function changeIndexNext() {\n if(index_prev == 4) {\n index_prev = 0;\n moveIndex(4);\n }\n else {\n disableClick();\n for(var iItem = 0 ; iItem < 5 ; iItem++){\n $(\".slideshow li\").eq(iItem).animate({\n left: \"-=\" + width \n }).promise().done(function () {\n enableClick();\n });\n }\n setOpacity(++index_prev);\n }\n}", "function slide(){\n index = (index+1)%(bilder.length);\n imgTag.src = bilder[index];\n}", "function moveToSlide(index) {\n // Wrap around indices.\n if (index >= $slides.length) index = 0;\n else if (index < 0) index = $slides.length -1;\n\n $active_index = $slider.find('.active').index();\n\n // Only do if index changes\n if ($active_index != index) {\n $active = $slides.eq($active_index);\n $caption = $active.find('.caption');\n\n $active.removeClass('active');\n $active.velocity({opacity: 0}, {duration: options.transition, queue: false, easing: 'easeOutQuad',\n complete: function() {\n $slides.not('.active').velocity({opacity: 0, translateX: 0, translateY: 0}, {duration: 0, queue: false});\n } });\n captionTransition($caption, options.transition);\n\n\n // Update indicators\n if (options.indicators) {\n $indicators.eq($active_index).removeClass('active');\n }\n\n $slides.eq(index).velocity({opacity: 1}, {duration: options.transition, queue: false, easing: 'easeOutQuad'});\n $slides.eq(index).find('.caption').velocity({opacity: 1, translateX: 0, translateY: 0}, {duration: options.transition, delay: options.transition, queue: false, easing: 'easeOutQuad'});\n $slides.eq(index).addClass('active');\n\n\n // Update indicators\n if (options.indicators) {\n $indicators.eq(index).addClass('active');\n }\n }\n }", "function moveToSlide(index) {\n // Wrap around indices.\n if (index >= $slides.length) index = 0;\n else if (index < 0) index = $slides.length -1;\n\n $active_index = $slider.find('.active').index();\n\n // Only do if index changes\n if ($active_index != index) {\n $active = $slides.eq($active_index);\n $caption = $active.find('.caption');\n\n $active.removeClass('active');\n $active.velocity({opacity: 0}, {duration: options.transition, queue: false, easing: 'easeOutQuad',\n complete: function() {\n $slides.not('.active').velocity({opacity: 0, translateX: 0, translateY: 0}, {duration: 0, queue: false});\n } });\n captionTransition($caption, options.transition);\n\n\n // Update indicators\n if (options.indicators) {\n $indicators.eq($active_index).removeClass('active');\n }\n\n $slides.eq(index).velocity({opacity: 1}, {duration: options.transition, queue: false, easing: 'easeOutQuad'});\n $slides.eq(index).find('.caption').velocity({opacity: 1, translateX: 0, translateY: 0}, {duration: options.transition, delay: options.transition, queue: false, easing: 'easeOutQuad'});\n $slides.eq(index).addClass('active');\n\n\n // Update indicators\n if (options.indicators) {\n $indicators.eq(index).addClass('active');\n }\n }\n }", "function moveToSlide(index) {\n // Wrap around indices.\n if (index >= $slides.length) index = 0;\n else if (index < 0) index = $slides.length -1;\n\n $active_index = $slider.find('.active').index();\n\n // Only do if index changes\n if ($active_index != index) {\n $active = $slides.eq($active_index);\n $caption = $active.find('.caption');\n\n $active.removeClass('active');\n $active.velocity({opacity: 0}, {duration: options.transition, queue: false, easing: 'easeOutQuad',\n complete: function() {\n $slides.not('.active').velocity({opacity: 0, translateX: 0, translateY: 0}, {duration: 0, queue: false});\n } });\n captionTransition($caption, options.transition);\n\n\n // Update indicators\n if (options.indicators) {\n $indicators.eq($active_index).removeClass('active');\n }\n\n $slides.eq(index).velocity({opacity: 1}, {duration: options.transition, queue: false, easing: 'easeOutQuad'});\n $slides.eq(index).find('.caption').velocity({opacity: 1, translateX: 0, translateY: 0}, {duration: options.transition, delay: options.transition, queue: false, easing: 'easeOutQuad'});\n $slides.eq(index).addClass('active');\n\n\n // Update indicators\n if (options.indicators) {\n $indicators.eq(index).addClass('active');\n }\n }\n }", "function goToNextSlide()\n\t{\n\t\tif($currentSlide.next().length)\n\t\t{\n\t\t\tgoToSlide($currentSlide.next());\n\t\t}\n\t}", "function prev() {\n slide(false, false);\n }", "function next(){\n\tpdx = idx;\n\tidx++;\n\tif(idx >= 4){\n\t\tidx = 0;\n\t}\n\tchangeSlide();\n}", "function checkIndex () {\n items.classList.remove('shifting');\n\n if (index === -1) {\n items.style.left = -(slidesLength * slideSize) + \"px\";\n index = slidesLength - 1;\n }\n\n if (index === slidesLength) {\n items.style.left = -(1 * slideSize) + \"px\";\n index = 0;\n }\n\n allowShift = true;\n }", "function first_slide(ev)\n {\n ev.preventDefault();\n activate(0); // Move the \"active\" class\n // console.log(\"first: current = \"+current+\" t -> \"+timecodes[current]);\n seek_video();\n }", "function prevSlide() {\n indexTracker--;\n if (indexTracker < 0) {\n indexTracker = peopleArray.length - 1;\n }\n allFadeOut();\n window.setTimeout(updateIndexPoints,500);\n allFadeIn();\n intervalReset();\n}", "function nextSlide() {\n console.log('nextSlide()', slides, currentIndex)\n slides[currentIndex].classList.remove('currentSlide')\n currentIndex = (currentIndex+1)%slides.length;\n slides[currentIndex].classList.add('currentSlide')\n }", "function prevSlide() {\n position = $slider.find(\".show\").index() - 1;\n if (position < 0) position = size - 1;\n changeCarousel(position);\n }", "function slideFunction(slide) {\n //setNextButton(true)\n // console.log(slide);\n // i++;\n // if (i == 4) {\n // setActiveButton(false);\n // setNextButton(true);\n // }\n // if (i < 5) {\n // setSlide(props.slides[i].title);\n // setNextSlide(props.slides[i].text);\n // setNextButton(true);\n // }\n var found1 = props.slides;\n var index1 = found1.findIndex((fruit1) => fruit1.title === slide);\n // console.log(index1)\n if (index1 == 3) {\n setActiveButton(false);\n }\n if (index1 < 4) {\n setSlide(found1[index1 + 1].title);\n setNextSlide(found1[index1 + 1].text);\n setNextButton(true);\n setAgainStart(true);\n }\n }", "function changeIndexPrev() {\n if(index_prev == 0) {\n index_prev = 4;\n moveIndex(4);\n }\n else {\n disableClick();\n for(var iItem = 4 ; iItem > 0 ; iItem--){\n $(\".slideshow li\").eq(iItem).animate({\n left: \"+=\" + width \n }).promise().done(function () {\n enableClick();\n });\n }\n setOpacity(--index_prev);\n }\n}", "function previous() {\n clearInterval(playslides);\n playslides = setInterval(next, 5000);\n if (current_slide_index > 0) {\n current_slide_index--;\n set_current_slide(img_array[current_slide_index].src);\n }\n else {\n current_slide_index = slide_count - 1;\n set_current_slide(img_array[current_slide_index].src);\n }\n}", "function nextImg(){\n currentSlide++\n if (currentSlide > slides.length){\n currentSlide = 1\n }\n slideShow();\n}", "function previousSlide() {\n if (!sliding) {\n if (currentSlide <= 1) {\n currentSlide = maxSlides;\n } else {\n currentSlide--;\n }\n goToIndex(currentSlide);\n }\n }", "function playAutoSlide(index, duration) {\n autoSlideInterval =this.setInterval(function() {\n if (currentIndex + 1 > slide.length) { \n goToSlide(0);\n } else {\n goToSlide(currentIndex + 1);\n }\n }, 5000)\n}", "function slideShow(index){\n\tslideIndex = index - 1;\n\t\n\ttimer = window.setInterval(nextSlide, 2500);\n}", "function loadPreviousSlide() {\n indexOfCurrentSlide -= 2;\n\n if (indexOfCurrentSlide <= 0) {\n indexOfCurrentSlide = maxNumberOfSlides;\n }\n\n resetTimer();\n }", "function moveToSlide(index) {\r\n // Wrap around indices.\r\n if (index >= $slides.length) index = 0;else if (index < 0) index = $slides.length - 1;\r\n\r\n $active_index = $slider.find('.active').index();\r\n\r\n // Only do if index changes\r\n if ($active_index != index) {\r\n $active = $slides.eq($active_index);\r\n $caption = $active.find('.caption');\r\n\r\n $active.removeClass('active');\r\n $active.velocity({ opacity: 0 }, { duration: options.transition, queue: false, easing: 'easeOutQuad',\r\n complete: function () {\r\n $slides.not('.active').velocity({ opacity: 0, translateX: 0, translateY: 0 }, { duration: 0, queue: false });\r\n } });\r\n captionTransition($caption, options.transition);\r\n\r\n // Update indicators\r\n if (options.indicators) {\r\n $indicators.eq($active_index).removeClass('active');\r\n }\r\n\r\n $slides.eq(index).velocity({ opacity: 1 }, { duration: options.transition, queue: false, easing: 'easeOutQuad' });\r\n $slides.eq(index).find('.caption').velocity({ opacity: 1, translateX: 0, translateY: 0 }, { duration: options.transition, delay: options.transition, queue: false, easing: 'easeOutQuad' });\r\n $slides.eq(index).addClass('active');\r\n\r\n // Update indicators\r\n if (options.indicators) {\r\n $indicators.eq(index).addClass('active');\r\n }\r\n }\r\n }", "function jumpToFirst() {\n\t\t\tif (options.SliderTypeVert) {\n\t\t\t\t$SliderWindow.animate({\n\t\t\t\t\tmarginTop: '0px'\n\t\t\t\t}, 0);\n\t\t\t// horizontal slider\n\t\t\t} else if (!options.SliderTypeFade) {\n\t\t\t\t$SliderWindow.animate({\n\t\t\t\t\tright: '0px'\n\t\t\t\t}, 0);\n\t\t\t}\n\t\t}", "function nextSlide() {\n if (!sliding) {\n if (currentSlide >= maxSlides) {\n currentSlide = 1;\n } else {\n currentSlide++;\n }\n goToIndex(currentSlide);\n }\n }", "function _switchSlide(){\r\n\t\tif(slide > 0){\r\n\t\t\tfor(var i = 0; i<slide; i++){\r\n\t\t\t\tTweenMax.set($('#slide_'+i),{css:{top:'-100%'}});\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(slide>3){\r\n\t\t\t$('#fake_slide_1').hide();\r\n\t\t}\r\n\r\n\t\tTweenMax.to($('#slide_'+slide),1.6,{css:{top:'-100%'},ease:Expo.easeOut});\r\n\t\tTweenMax.to($('#slide_'+(slide+1)),1.6,{delay:0.2,css:{top:'0%'},ease:Expo.easeOut, onComplete: function(){\r\n\t\t\tslide +=1;\r\n\t\t\tconsole.log('slide: '+slide);\r\n\t\t}});\r\n\t}", "function nextSlide(){\n indexTracker++;\n if(indexTracker >= peopleArray.length){\n indexTracker = 0;\n }\n\n updateIndexPoints();\n}", "goToSlide(slideIndex) {\n let delta = this.currentSlide - slideIndex;\n\n if(delta < 0) {\n for(let i = 0; i > delta; i--)\n this.nextSlide();\n } else if(delta > 0) {\n for(let i = 0; i < delta; i++)\n this.previousSlide();\n }\n\n return this.currentSlide;\n }", "function moveToSlide(index) {\n // Wrap around indices.\n if (index >= $slides.length) index = 0;else if (index < 0) index = $slides.length - 1;\n\n $active_index = $slider.find('.active').index();\n\n // Only do if index changes\n if ($active_index != index) {\n $active = $slides.eq($active_index);\n $caption = $active.find('.caption');\n\n $active.removeClass('active');\n $active.velocity({ opacity: 0 }, { duration: options.transition, queue: false, easing: 'easeOutQuad',\n complete: function () {\n $slides.not('.active').velocity({ opacity: 0, translateX: 0, translateY: 0 }, { duration: 0, queue: false });\n } });\n captionTransition($caption, options.transition);\n\n // Update indicators\n if (options.indicators) {\n $indicators.eq($active_index).removeClass('active');\n }\n\n $slides.eq(index).velocity({ opacity: 1 }, { duration: options.transition, queue: false, easing: 'easeOutQuad' });\n $slides.eq(index).find('.caption').velocity({ opacity: 1, translateX: 0, translateY: 0 }, { duration: options.transition, delay: options.transition, queue: false, easing: 'easeOutQuad' });\n $slides.eq(index).addClass('active');\n\n // Update indicators\n if (options.indicators) {\n $indicators.eq(index).addClass('active');\n }\n }\n }", "function moveToSlide(index) {\n // Wrap around indices.\n if (index >= $slides.length) index = 0;else if (index < 0) index = $slides.length - 1;\n\n $active_index = $slider.find('.active').index();\n\n // Only do if index changes\n if ($active_index != index) {\n $active = $slides.eq($active_index);\n $caption = $active.find('.caption');\n\n $active.removeClass('active');\n $active.velocity({ opacity: 0 }, { duration: options.transition, queue: false, easing: 'easeOutQuad',\n complete: function () {\n $slides.not('.active').velocity({ opacity: 0, translateX: 0, translateY: 0 }, { duration: 0, queue: false });\n } });\n captionTransition($caption, options.transition);\n\n // Update indicators\n if (options.indicators) {\n $indicators.eq($active_index).removeClass('active');\n }\n\n $slides.eq(index).velocity({ opacity: 1 }, { duration: options.transition, queue: false, easing: 'easeOutQuad' });\n $slides.eq(index).find('.caption').velocity({ opacity: 1, translateX: 0, translateY: 0 }, { duration: options.transition, delay: options.transition, queue: false, easing: 'easeOutQuad' });\n $slides.eq(index).addClass('active');\n\n // Update indicators\n if (options.indicators) {\n $indicators.eq(index).addClass('active');\n }\n }\n }", "function moveToSlide(index) {\n // Wrap around indices.\n if (index >= $slides.length) index = 0;else if (index < 0) index = $slides.length - 1;\n\n $active_index = $slider.find('.active').index();\n\n // Only do if index changes\n if ($active_index != index) {\n $active = $slides.eq($active_index);\n $caption = $active.find('.caption');\n\n $active.removeClass('active');\n $active.velocity({ opacity: 0 }, { duration: options.transition, queue: false, easing: 'easeOutQuad',\n complete: function () {\n $slides.not('.active').velocity({ opacity: 0, translateX: 0, translateY: 0 }, { duration: 0, queue: false });\n } });\n captionTransition($caption, options.transition);\n\n // Update indicators\n if (options.indicators) {\n $indicators.eq($active_index).removeClass('active');\n }\n\n $slides.eq(index).velocity({ opacity: 1 }, { duration: options.transition, queue: false, easing: 'easeOutQuad' });\n $slides.eq(index).find('.caption').velocity({ opacity: 1, translateX: 0, translateY: 0 }, { duration: options.transition, delay: options.transition, queue: false, easing: 'easeOutQuad' });\n $slides.eq(index).addClass('active');\n\n // Update indicators\n if (options.indicators) {\n $indicators.eq(index).addClass('active');\n }\n }\n }", "function currentIndex() {\n var cycle = !!(currentSlideQS <= 0 || currentSlideQS === initialSlideLengthQS);\n if (cycle) {\n if (currentSlideQS < 0) {\n currentSlideQS = initialSlideLengthQS - 1;\n } else if (currentSlideQS === initialSlideLengthQS) {\n currentSlideQS = 0;\n }\n }\n }", "function next() {\n clearInterval(playslides);\n playslides = setInterval(next, 5000);\n if (current_slide_index < slide_count - 1) {\n current_slide_index++;\n set_current_slide(img_array[current_slide_index].src);\n }\n else {\n current_slide_index = 0;\n set_current_slide(img_array[current_slide_index].src);\n }\n}", "function getIndexMax(){return carousel||loop?Math.max(0,slideCountNew-items):slideCountNew-1;}", "function keepSlidesPosition(){\n var activeSlides = $(SLIDE_ACTIVE_SEL);\n for( var i =0; i<activeSlides.length; i++){\n silentLandscapeScroll(activeSlides[i], 'internal');\n }\n }", "function keepSlidesPosition(){\n var activeSlides = $(SLIDE_ACTIVE_SEL);\n for( var i =0; i<activeSlides.length; i++){\n silentLandscapeScroll(activeSlides[i], 'internal');\n }\n }" ]
[ "0.72086966", "0.6869755", "0.6748433", "0.67288196", "0.6595142", "0.6564813", "0.65273565", "0.65159845", "0.65078783", "0.6499572", "0.64684343", "0.6447258", "0.64466035", "0.6440369", "0.64292544", "0.64075315", "0.64049035", "0.63178974", "0.6267503", "0.6246699", "0.62464756", "0.6235309", "0.6232417", "0.6213246", "0.6211363", "0.6196083", "0.61899775", "0.6184939", "0.61735165", "0.61426204", "0.6142426", "0.614136", "0.6140668", "0.6135852", "0.6131337", "0.6131113", "0.6126548", "0.61085284", "0.6106566", "0.6105316", "0.610216", "0.61005163", "0.6100322", "0.60948735", "0.6093757", "0.60916716", "0.6091457", "0.60891455", "0.60850364", "0.60770184", "0.6075618", "0.60718656", "0.60709596", "0.6036706", "0.6032684", "0.60316354", "0.6026183", "0.60166734", "0.60088676", "0.60068005", "0.60056174", "0.6000692", "0.5997808", "0.59940004", "0.5985994", "0.5984934", "0.5982686", "0.5976467", "0.5972073", "0.5972073", "0.5972073", "0.5970026", "0.5966703", "0.596103", "0.5960382", "0.59553146", "0.59494686", "0.59451336", "0.5937614", "0.593604", "0.5935869", "0.5934693", "0.59224445", "0.5921185", "0.59197944", "0.59192586", "0.5913194", "0.59107727", "0.59075105", "0.5907327", "0.5895602", "0.5895041", "0.58918685", "0.5890552", "0.5890552", "0.5890552", "0.58845943", "0.5882682", "0.5878053", "0.58769387", "0.58769387" ]
0.0
-1
true ako su svi igraci mrtvi
done() { for (let i = 0; i < this.players.length; i++) { if (!this.players[i].dead) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _checkAi(){return true;}", "function siamoNellaPrimaSettimana() {\n return indiceSettimana == 0;\n }", "function kiemTra(X, Y, viTriMoi){\n X = viTriX + X;\n Y = viTriY + Y;\n viTriMoi = viTriMoi || ViTriXoay; // khi xoay khoi co bi qua ngoai man hinh khong\n\n\n\n for ( var y = 0; y < 4; ++y ) {\n for ( var x = 0; x < 4; ++x ) {\n if ( viTriMoi [ y ][ x ] ) {\n if ( typeof bangGiaTri[ y + Y ] == 'undefined' // kiem tra cac Dk cua khoi co kha thi hay khong, khong ra ngoai khung hinh\n || typeof bangGiaTri[ y + Y ][ x + X ] == 'undefined'\n || bangGiaTri[ y + Y ][ x + X ]\n || x + X < 0\n || y + Y >= dongBang\n || x + X>= cotBang ) {\n if (Y == 1) \n\t\t\t\t\t{\n\t\t\t\t\t\tThua = true; // neu khoi dang o dong tren cung thi thua\n\t\t\t\t\t\t\n\t\t\t\t\t}\n return false;\n }\n }\n }\n }\n return true;\n}", "function checkPukiStat(){\n\tvar walkStat = false;\n\tvar runStat = false;\n\tvar sitStat = false;\n\t\n\tif(pukiActive_arr.walkActive || statusActive_arr.walkActive)\n\t\twalkStat=true;\n\t\t\n\tif(pukiActive_arr.runActive || statusActive_arr.runActive)\n\t\trunStat=true;\n\t\t\n\tif(pukiActive_arr.sitActive || statusActive_arr.sitActive)\n\t\tsitStat=true;\n\t\n\t\n\tpukiRunActive = runStat;\n\tpukiWalkActive = walkStat;\n\tpukiSitActive = sitStat;\n}", "function valorTriangulo(){\n if(trianguloAparienciaInteraccion == true && trianguloAparienciaTono == true && trianguloAparienciaMirada == true && trianguloAparienciaLlanto == true){\n trianguloApariencia = true;\n }else{\n trianguloApariencia = false;\n }\n}", "async function naVrsti() {\n // Preveri za konec igre\n let zm = await zmagovalec();\n if (zm != \"undefined\") {\n if (Number(zm) == igralec) {\n location.replace('/igra/zmaga');\n } else {\n location.replace('/igra/zguba');\n }\n return;\n }\n\n // Posodobi stanje bitke\n await zapolniTabelo();\n\n lahkoNapada = true;\n\n document.getElementById(\"besedilo\").innerText = \"Tunkaj ladje!\";\n document.getElementById(\"hnapad\").classList.add(\"border-info\");\n document.getElementById(\"hdomace\").classList.remove(\"border-info\");\n }", "function pisarTerreno(nuevo){\n // Recorrer cada terreno del jugador\n for(var a = 0; a < jugando.terrenos.length; a++){\n // Si el ID coincide con el nuevo terreno\n if(nuevo.id == jugando.terrenos[a][0]){\n // Si tiene un peso, entonces aplica\n if(jugando.terrenos[a][1] != \"\"){\n return true;\n }\n else{\n return false;\n }\n }\n }\n}", "isIntact () {\n return false;\n }", "doesMinotaurSeeTheseus(){\n\t\tlet minotaurLOS = this.getLineOfSight(this.props.G.minotaurPos);\n\t\tfor(let x = 0; x < minotaurLOS.length; x++){\n\t\t\tif(minotaurLOS[x] === this.props.G.theseusPos){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function letra(tecla) {\n //alert(tecla);\n var ltPCode;\n var acertouAq; // pesquisar se true letras que acertou\n var errouAq; // pesquisar letras que errou\n\n key = tecla;\n lt = String.fromCharCode(key).toLowerCase();\n ltPCode = lt.charCodeAt(0);\n\n acertouAq = acertou.indexOf(lt);\n errouAq = errou.indexOf(lt);\n\n if(key == 186){\n alert('Clique C ou outra consoante!');\n }else if(ltPCode == 97 || ltPCode == 98 || ltPCode == 99 || ltPCode == 100 || ltPCode == 101 || ltPCode == 102 || ltPCode == 103 || ltPCode == 104 || ltPCode == 105 ||\n ltPCode == 106 || ltPCode == 107 || ltPCode == 108 || ltPCode == 109 || ltPCode == 110 || ltPCode == 111 || ltPCode == 112 || ltPCode == 113 || ltPCode == 114 ||\n ltPCode == 115 || ltPCode == 116 || ltPCode == 117 || ltPCode == 118 || ltPCode == 119 || ltPCode == 120 || ltPCode == 121 || ltPCode == 122){\n\n if(acertou.length >= obj.length || imgAtual >= 6){\n\n }else if(perdeu == true) {\n\n }else if(acertouAq >= 0 || errouAq >= 0){\n alert('Você já tinha digitado a tecla \\\"'+lt+'\\\"');\n }else{\n ltPre = limpaLetra(lt);\n verLetra(ltPre);\n }\n\n }\n}", "function kontrola2(cislo) {\n let vysledek;\n if (cislo > 15 && cislo < 60 || cislo == 2) {\n vysledek = true;\n } else {\n vysledek = false;\n }\n return vysledek;\n}", "function verifierMot()\n{\n var lemot = \"\";\n for(let i=0; i<choisi.length; i++)\n {\n lemot += choisi[i].textContent;\n }\n if(lemot == mots[niveau])\n {\n nextlevel();\n }\n else{\n initialiseNiveau(niveau);\n }\n}", "function isPixieTva() {\n if($(\"#user_pixie_billing_address_country\").val() === \"FR\" && $(\"#user_pixie_billing_status\").val() === \"company\")\n {\n return true;\n }\n else if($(\"#user_pixie_billing_address_country\").val() === \"FR\" && $(\"#user_pixie_billing_status\").val() == \"microentrepreneurtva\")\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "function bool(ciuresult){\n if (ciuresult == 'y' || ciuresult == 'a') return true;\n // 'p' is for polyfill\n if (ciuresult == 'n' || ciuresult == 'p') return false;\n throw 'unknown return value from can i use';\n }", "async function naCakanju() {\n lahkoNapada = false;\n document.getElementById(\"besedilo\").innerText = \"Cakaj nasprotnika!\";\n document.getElementById(\"hdomace\").classList.add(\"border-info\");\n document.getElementById(\"hnapad\").classList.remove(\"border-info\");\n\n // Zacni cakanje da je igralec na vrsti\n zacniCakanje(`/igra/naVrsti/${id_igre}/${igralec}`, naVrsti, (el) => el != 'false');\n }", "liikuta(nimi, suunta){\n for (var i = 0; i < this.hahmot.length; i++){\n var h = this.hahmot[i];\n if (h.nimi == nimi) {\n if (suunta == suunnat.OIKEA) {\n if (this.onkoEtanoita(h.x + 1,h.y)) return;\n if (++h.x >= this.leveys) {\n h.x = 0;\n }\n }\n if (suunta == suunnat.VASEN) {\n if (this.onkoEtanoita(h.x - 1,h.y)) return;\n if (--h.x < 0) {\n h.x = this.leveys - 1;\n }\n }\n if (suunta == suunnat.YLOS) {\n if (this.onkoEtanoita(h.x,h.y - 1)) return;\n if (--h.y < 0) {\n h.y = 0;\n }\n }\n if (suunta == suunnat.ALAS) {\n if (this.onkoEtanoita(h.x, h.y + 1)) return;\n if (++h.y >= this.korkeus) {\n h.y = this.korkeus - 1;\n }\n }\n }\n } \n if (typeof this.pelihahmo == 'undefined') return;\n var h = this.pelihahmo;\n if (h.nimi == nimi) {\n if (suunta == suunnat.OIKEA) {\n if (++h.x >= this.leveys) {\n h.x = 0;\n }\n pisteet++;\n }\n if (suunta == suunnat.VASEN) {\n if (--h.x < 0) {\n h.x = this.leveys - 1;\n }\n pisteet--;\n }\n if (suunta == suunnat.YLOS) {\n if (--h.y < 0) {\n h.y = 0;\n }\n }\n if (suunta == suunnat.ALAS) {\n if (++h.y >= this.korkeus) {\n h.y = this.korkeus - 1;\n }\n }\n }\n }", "function confirmarLiz () {\n\tliz.lizOK = true;\n\tdibujar();\n}", "function tarkistaPari() {\r\n let ovatPari = ekaKortti.dataset.kehys === tokaKortti.dataset.kehys;\r\n //jos kortit ovat pari estetään niitä kääntymästä ja\r\n //jos kortit eivät ole pari käännetään ne takaisin\r\n ovatPari ? disable() : unflip();\r\n}", "function swieta(d, m)\n{\n if( d==1 && m==0 || d==6 && m==0 || d==ruchome[0] && m==ruchome[1] || d==1 && m==4 || d==3 && m==4 || d==ruchome[2] && m==ruchome[3] || d==15 && m==7 || d==1 && m==10 || d==11 && m==10 || d==25 && m==11 || d==26 && m==11 )\n {\n return true;\n }\n else \n {\n return false;\n }\n}", "function simboloss(t) {\r\n for (var i = 0; i < simbolos.length; i++) {\r\n if (cadena[t]== simbolos[i]) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}", "function soloL() {\r\n for (var i = 0; i < cadena.length; i++) {\r\n if (letrass(i)) {\r\n }else {\r\n if (simboloss(i)) {\r\n respuesta=\"Error\";\r\n return false;\r\n }\r\n }\r\n }\r\n respuesta=\"Letras\";\r\n return true;\r\n}", "function maj_a_verifier()\r\n\t{\r\n\t\t//\r\n\t\t// Gestion de la màj toute les 24 h\r\n\t\t//\r\n\r\n\t\tvar heure_dernier_maj = 0 ;\r\n\t\t//Lit le contenu de la variable\r\n\t\tvar donnee = localStorage.getItem(MENU_maj) ;\r\n\t\tif (donnee != null)\r\n\t\t{\r\n\t\t\theure_dernier_maj = donnee ;\r\n\t\t}\r\n\r\n\t\t//Récupération de l'heure actuelle (en s depuis 1970)\r\n\t\tvar heure_actuelle = new Date().getTime() / 1000 ;\r\n\t\t\t\t\r\n\t\t//Calcul le delta entre la dernière vérif et maintenant\r\n\t\tvar delta = heure_actuelle - heure_dernier_maj ;\r\n\t\tif (delta < DELTA_maj) \r\n\t\t{\r\n\t\t\treturn false ; //Pas de màj à vérifier\r\n//\t\t\treturn true ; //Force la màj\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn true ;\r\n\t\t}\r\n\t}", "function tiempoPerdido(){\n\tif(compReloj == true){\n\t\tgameStart=false;\n\t\tanadirTexto(\"Lo sentimos se ha terminado el tiempo.\");\n\t\tanadirTexto(\"Has perdido la partida\");\n\t}\n}", "function testIn() {\r\n\tvar bool = \" \";\r\n\tif(\"exit1\" in ur1Exits) {\r\n\t\tbool = \"true\";\r\n\t} else {\r\n\t\tbool = \"false\";\r\n\t}\r\n\treturn bool;\r\n}", "function tzimhoniClick()\n\t\t{\n\t\tif (tzimhoniClickStatus==true){\n\t\t\tthis.instruction_txt.text=\"לחץ על רכיב שתרצה לדעת עליו יותר\";\n\t\t\tthis.tivoni_fade.visible=1;\n\t\t\tthis.heraion_fade.visible=1;\n\t\t\tthis.kasher_fade.visible=1;\n\t\t\tthis.tzimhoni_fade.visible=0;\n\t\t\ttzimhoniClickStatus=false;\n\t\t\ttivoniClickStatus=true;\n\t\t\tkasherClickStatus=true;\n\t\t\theraionClickStatus=true;\n\t\t\tthis.tamago.alpha=1;\n\t\t\tthis.tivoni.mouseEnabled=false;\n\t\t\tthis.heraion.mouseEnabled=false;\n\t\t\tthis.kasher.mouseEnabled=false;\n\t\t\tthis.unagi.mouseEnabled=false;\n\t\t\tthis.tobiko.mouseEnabled=false;\n\t\t\tthis.tuna.mouseEnabled=false;\n\t\t\tthis.surimi.mouseEnabled=false;\n\t\t\tthis.palamida.mouseEnabled=false;\n\t\t\tthis.salmon.mouseEnabled=false;\n\t\t\tthis.skin.mouseEnabled=false;\n\t\t\tthis.ekora.mouseEnabled=false;\n\t\t}\n\t\telse{\n\t\t\tthis.instruction_txt.text=\"לחץ לבחירת המאפיין\";\n\t\t\tthis.tivoni_fade.visible=0;\n\t\t\tthis.heraion_fade.visible=0;\n\t\t\tthis.kasher_fade.visible=0;\n\t\t\tthis.tzimhoni_fade.visible=0;\n\t\t\ttzimhoniClickStatus=true;\n\t\t\ttivoniClickStatus=true;\n\t\t\tkasherClickStatus=true;\n\t\t\theraionClickStatus=true;\n\t\t\tthis.tivoni.mouseEnabled=true;\n\t\t\tthis.heraion.mouseEnabled=true;\n\t\t\tthis.kasher.mouseEnabled=true;\n\t\t\tthis.unagi.mouseEnabled=true;\n\t\t\tthis.tobiko.mouseEnabled=true;\n\t\t\tthis.tuna.mouseEnabled=true;\n\t\t\tthis.surimi.mouseEnabled=true;\n\t\t\tthis.palamida.mouseEnabled=true;\n\t\t\tthis.salmon.mouseEnabled=true;\n\t\t\tthis.skin.mouseEnabled=true;\n\t\t\tthis.ekora.mouseEnabled=true;\n\t\t}\n\t\t\n\t\t}", "function luoRuoka() {\n ruokaX = satunnainenKymppi(0, gameCanvas.width - 10);\n ruokaY = satunnainenKymppi(0, gameCanvas.height - 10);\n snake.forEach(function(snakeOsa) {\n if (ruokaX == snakeOsa.x && ruokaY == snakeOsa.y) {\n luoRuoka();\n }\n });\n}", "function main(){\r\n\r\n const letra;\r\n console.log('Digite aqui uma letra do nosso alfabeto alfanumérico português: ', letra)\r\n\r\n if (letra === 'a' || letra === 'e' || letra === 'i' || letra === 'o' || letra === 'u' || letra === 'A' || letra === 'E' || letra === 'I' || letra === 'O' || letra === 'U') {\r\n console.log('É vogal / n')\r\n }else {\r\n console.log('É consoante / n')\r\n }\r\n\r\n}", "function vacia(){\r\n\tif (this.raiz == null) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "function llamarBatman(llamar) {\n if (llamar) {\n console.log(\"Batiseñal activada\");\n }\n}", "function ejecutarReturn() {\r\n if (false) {\r\n console.log('La condición se cumple');\r\n return;\r\n }\r\n\r\n if (true) {\r\n console.log('La condición se cumple');\r\n return;\r\n }\r\n}", "function contrasenas(e)\n {\n key=e.keyCode || e.which;\n teclado=String.fromCharCode(key).toLowerCase();\n \n letras=\".-~^_/\\|abcdefghijklmnoñpqrstuvwxyz0123456789()[]{}*+<>\";\n especiales=\"8-37-38-46-164\";\n\n teclado_especial=false;\n\n for(var i in especiales)\n {\n if(key==especiales[i])\n {\n teclado_especial=true;\n break;\n }\n }\n\n if(letras.indexOf(teclado)==-1 && !teclado_especial)\n {\n return false;\n }\n }", "function Ejemplo(){return true}", "checkInfection(){\n this.virus.models.forEach((virus) => {\n if(Math.trunc(this.player.model.position.z) === virus.model.position.z && Math.trunc(this.player.model.position.x) === virus.model.position.x){\n this.player.infected = true;\n }\n });\n return this.player.infected;\n }", "function mostrarInfo() {\r\n alert(\"Projecte - Joc de trilers \\n Bienvenido\");\r\n nomUser = prompt(\"Nombre: (Solo letras) \");\r\n var letras=\"abcdefghijklmnñopqrstuvwxyzç\";\r\n if(nomUser!=null){\r\n for (var i = 0; i < letras.length; i++) {\r\n if (letras.indexOf(nomUser.charAt(i).toLowerCase(),0)!=-1){\r\n esletra=true;\r\n }else{\r\n noletra=true;\r\n }\r\n }\r\n if(esletra && !noletra){\r\n haynombre=true;\r\n console.log(\"a\");\r\n }else if(!esletra && noletra){\r\n haynombre=false;\r\n nomUser=null;\r\n console.log(\"b\");\r\n }else if(esletra && noletra){\r\n haynombre=false;\r\n //nomUser=null;\r\n console.log(\"c\");\r\n }\r\n\r\n }\r\n}", "function check_PI_it(piva){\n\tvar result=ControllaPIVA(piva);\n\t\n\tif (result>0){\n\t\treturn true;\n\t}else{\n\t\tif(result == -1){\n\t\t\talert(\t\"La lunghezza della partita IVA non e`\\n\" +\n\t\t\t\t\"corretta: la partita IVA dovrebbe essere lunga\\n\" +\n\t\t\t\t\"esattamente 11 caratteri.\\n\");\n\t\t\treturn false;\t\n\t\t}\n\n\t\tif(result == -2){\n\t\t\talert(\t\"La partita IVA contiene un carattere non valido `\" +\n\t\t\t\t\"'.\\nI caratteri validi sono le cifre.\\n\");\n\t\t\treturn false;\t\n\t\t}\n\n\t\tif(result == -3){\n\t\t\talert(\t\"La partita IVA non e` valida:\\n\" +\n\t\t\t\t\"il codice di controllo non corrisponde.\\n\");\n\t\t\treturn false;\t\n\t\t}\n\t}\n\n}", "function sjekkSvar() {\n var svar = \"\";\n for (var i = 0; i < ord.length; i++) {\n svar+=($('#t'+i).text());\n }\n\n if(svar==ord){\n alert(\"DU VANT!\")};\n }", "function field_ok() {\n\tvar s = document.getElementById(\"cpatchaTextBox\").value;\n\tif(s[0] !== code[0] || s[1] !== code[1]) {// prvni a druhe znaky nesedi, hacker se musi trochu snazit\n\t\treturn 0;\n\t}\n\tif(s.length !== 6) {// delka neni sest znaku\n\t\treturn 0;\n\t}\n\t// porovnej postupne znaky, jeslti tam nezadal nejake stejne\n\tfor(let i = 0; i < s.length-1; i++) {\n\t\tvar c = s.charAt(i); // aktualni znak\n\t\tfor(let j = i+1; j < s.length; j++) {\n\t\t\tif(c == s[j]) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}\n\treturn 1; // v poradku, nepokousel se podvadet\n}", "function periksaLanjut() {\n var periksa = true;\n while(periksa) {\n var lanjut = prompt('Anda ingin melanjutkan ? (jika ya ketik: ya atau jika tidak ketik: tidak)');\n if(lanjut.toLowerCase() == 'ya') {\n return true;\n periksa = false;\n }\n else if(lanjut.toLowerCase() == 'tidak') {\n return false;\n periksa = false;\n }\n else {\n alert('jawaban antara ya atau tidak')\n periksa = true;\n }\n }\n}", "function checkTecla(nombre, evt){\n\tvar t = teclado[nombre];\n\tif(!t) return false;\n\tif(!isArray(t)) t = [t];\n\tvar ats = ['keyCode', 'ctrlKey', 'shiftKey', 'altKey'];\n\tfor(var i=0; i<t.length; i++){\n\t\tvar ok = true;\n\t\tfor(var a=0; a<ats.length; a++){\n\t\t\tif(t[i][ats[a]] != evt[ats[a]]){\n\t\t\t\tif(ats[a] == 'keyCode'){\n\t\t\t\t\t//- y + en chrome, ff15+ y ff14-\n\t\t\t\t\tif(mismaTecla([189, 173, 109], t[i], evt) || mismaTecla([189, 173, 109], t[i], evt)) continue;\n\t\t\t\t}\n\t\t\t\tok = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif(ok) return true;\n\t}\n\treturn false;\n}", "function sjekkSvar() {\n var svar = \"\";\n for (var i = 0; i < ord.length; i++) {\n svar+=($('#t'+i).text());\n }\n\n if(svar==ord){\n $('#spill').append('<div id=\"spillvant\">DU VANT!</div>');\n skruAvInput();\n c.clearRect(0,0,canvas.width,canvas.height);}\n }", "function Deplacement_ennemiLimitrophe(Territoire){\r\n\tif (Territoire.army < 2) {return false}\r\n for (var i=0 ; i < Territoire.voisins.length ; i++){\r\n if (Territoire.proprietaire != Territoire.voisins[i].proprietaire ){\r\n return true\r\n }\r\n }\r\n return false\r\n}", "canMove(t) {\n if (this.done) return false; // turn used up\n // if (this.moves < 1) return false; // not enuf moves left\n return this.udata.terrain.charAt(t) !== \"0\";\n }", "canMove(t) {\n if (this.done) return false; // turn used up\n // if (this.moves < 1) return false; // not enuf moves left\n return this.udata.terrain.charAt(t) !== \"0\";\n }", "function DetectaPalmOS(){\n\n if (uagent.search(dispositivoPalm) > -1)\n\n return true;\n\n else\n\n return false;\n\n}", "function letrass(t) {\r\n for (var i = 0; i < letras.length; i++) {\r\n if (cadena[t]== letras[i]) {\r\n i=letras.length;\r\n return true;\r\n }\r\n }\r\n return false;\r\n}", "function int_msg(){\r\n\t//if(inlet == x)\r\n}", "soyAlto(){\n return this.altura >1.8\n }", "unlocked(){return hasChallenge(\"燃料\",11)}", "unlocked(){return hasChallenge(\"燃料\",11)}", "function soloLetras(e){\n key = e.keyCode || e.which;\n tecla = String.fromCharCode(key).toLowerCase();\n letras = \" áéíóúabcdefghijklmnñopqrstuvwxyz\";\n especiales = \"8-37-39-46\";\n\n tecla_especial = false\n for(var i in especiales){\n if(key == especiales[i]){\n tecla_especial = true;\n break;\n }\n }\n\n if(letras.indexOf(tecla)==-1 && !tecla_especial){\n return false;\n }\n }", "function chequeo(){\n \n contador(preguntas);\n\n if(palabrasTotales == 27){\n final = true;\n alert('No quedan mas letras en el abecedario. :(');\n } else {\n proxturno = confirm('Desea seguir con la siguiente ronda?');\n }\n\n if(proxturno == false){ \n final = true;\n }\n }", "function watAlsErEenMuisIs(){\n console.log('spring zo snel mogelijk op de tafel');\n}", "function mismaTecla(eqs, t, e){\n\treturn eqs.indexOf(parseInt(t.keyCode)) >= 0 && eqs.indexOf(parseInt(e.keyCode)) >= 0;\n}", "function controllo(nome,cognome){\n var nome_pul = nome.replace(/[^A-Za-z0-9]/g, \"\"); \n var cognome_pul = cognome.replace(/[^A-Za-z0-9]/g, \"\");\n if(nome==nome_pul && cognome==cognome_pul)\n return true;\n else return false;\n}", "function soloLetras(e){\r\n key = e.keyCode || e.which;\r\n tecla = String.fromCharCode(key).toLowerCase();\r\n letras = \" áéíóúabcdefghijklmnñopqrstuvwxyz\";\r\n especiales = [8,37,39,46];\r\n\r\n tecla_especial = false;\r\n for(var i in especiales){\r\n if(key == especiales[i]){\r\n tecla_especial = true;\r\n break;\r\n }\r\n }\r\n\r\n if(letras.indexOf(tecla)==-1 && !tecla_especial){\r\n return false;\r\n }\r\n}", "function soloLetras(e) {\n tecla = (document.all) ? e.keyCode : e.which;\n if (tecla == 8) {\n return true;\n } else if (tecla == 9) {\n return true;\n }\n\n patron = /^([A-Za-zÑñáéíóúÁÉÍÓÚ ]+)$/;\n\n te = String.fromCharCode(tecla);\n return patron.test(te);\n}", "function ricaricaTreeStrutturaAmministrativoContabile() {\n var editabile = $(\"#HIDDEN_StrutturaAmministrativoContabileEditabile\").val() === \"true\";\n if(editabile) {\n caricaStrutturaAmministrativoContabile()\n .then(function() {\n var hiddenField = $(\"#HIDDEN_StrutturaAmministrativoContabileUid\");\n var uid = hiddenField.data(\"originalUid\");\n var albero = $.fn.zTree.getZTreeObj(\"treeStruttAmm\");\n var node;\n\n hiddenField.val(uid);\n if(albero) {\n node = albero.getNodeByParam(\"uid\", uid);\n node && !node.checked && albero.checkNode(node, true, true, true);\n }\n $(document).trigger(\"strutturaAmministrativoContabileCaricato\");\n });\n }\n }", "function soloLetras(e){\r\n key = e.keyCode || e.which;\r\n tecla = String.fromCharCode(key).toLowerCase();\r\n letras = \" áéíóúabcdefghijklmnñopqrstuvwxyz\"; /* Se especifican las letras que solo aceptan */\r\n especiales = \"8-37-39-46\";\r\n\r\n tecla_especial = false\r\n for(var i in especiales){\r\n if(key == especiales[i]){\r\n tecla_especial = true;\r\n break;\r\n }\r\n }\r\n\r\n if(letras.indexOf(tecla)==-1 && !tecla_especial){\r\n return false;\r\n }\r\n }", "_tratamentoAnoIniFim() {\n\n\t\t\t\tvar dataini = this.byId(\"dataInicio\").getValue();\n\t\t\t\tvar datafin = this.byId(\"dataFim\").getValue();\n\n\t\t\t\tvar auxini = dataini.split(\"-\");\n\t\t\t\tvar auxfin = datafin.split(\"-\");\n\n\t\t\t\tvar anoini = auxini[0];\n\t\t\t\tvar anofin = auxfin[0];\n\n\t\t\t\treturn parseInt(anoini) <= parseInt(anofin);\n\t\t\t}", "function acabarPreInversion (){\n \n realizandoInversion = false \n}", "function esMayor05(){\n if (obtenerAleatorio()> 0.5) {\n return true;\n }else {\n return false;\n }\n}", "function soloLetras(e) {\n tecla = (document.all) ? e.keyCode : e.which;\n if (tecla == 8) return true;\n patron = /^([A-Za-zÑñáéíóúÁÉÍÓÚ ]+)$/;\n\n te = String.fromCharCode(tecla);\n return patron.test(te);\n}", "function voittaakoTämäPelaaja(lauta, pelaaja) {\n\n return voittorivit.some(x => {\n if (lauta[x[0]]!=nap.tyhja \n && lauta[x[0]].nappula == pelaaja \n && lauta[x[1]].nappula == pelaaja\n && lauta[x[2]].nappula == pelaaja) {\n return true\n }\n\n });\n\n }", "function ok() {\n return true\n }", "function startSuivi() {\n\n\tsuivi = true;\n\n\tif(!geolocation) {\n\t\tstartGeolocation();\n\t}\n\n\n\t$(\"#picto-geoloc\").attr('src', \"img/btn-mesuivre-on.png\");\n}", "function soloLetras(e){\n key = e.keyCode || e.which;\n tecla = String.fromCharCode(key).toLowerCase();\n letras = \" áéíóúabcdefghijklmnñopqrstuvwxyz\";\n especiales = \"8-37-39-46\";\n\n tecla_especial = false\n for(var i in especiales){\n if(key == especiales[i]){\n tecla_especial = true;\n break;\n }\n }\n\n if(letras.indexOf(tecla)==-1 && !tecla_especial){\n return false;\n }\n }", "EstoyLibre(costeLiberar){\n if(this.liberation && (this.keys-costeLiberar)>=0){\n this.keys=this.keys-costeLiberar;\n return (true);\n }\n else\n return false;\n }", "async function testePionValide(i, j, login, hote, adversaire){\n \n let naturePion = await getPion(i, j, hote, adversaire);\n if (naturePion===null) return false;\n // le joueur est un noir\n if(login===hote){\n if (naturePion===PION_NOIR) return true;\n else if(naturePion===DAME_NOIR) return true;\n }\n // le joueur est un blanc\n else {\n if (naturePion===PION_BLANC) return true;\n else if(naturePion===DAME_BLANC) return true;\n }\n return false;\n}", "function taoTroChoi() {\n clearInterval(interval);\n KhoiTao();\n TaoHinhMoi();\n Thua = false;\n interval = setInterval( vongLap, Tocdo)\n}", "function ok() {\n return true\n }", "function verifSaisie() {\n\n\tif ( document.getElementById('frmQte').txtQte.value ) {\n\n\t\treturn true;\n\n\t} else {\n\n\t\tdocument.getElementById('frmQte').txtQte.focus();\n\t\treturn false;\n\n\t}\n\n}", "function celluleEstVide(i,j) {\n\n if (celluleExiste(i,j) && plateau[i][j] === 16) {\n return true;\n }\n return false;\n }", "function timeret() {\n if (SERVG.ME.GHOUL !== 0) return;\n var NMMmV = SERVG.ME.mnWwv;\n if (NMMmV > 0) {\n if (NMMmV < 500) Mm.globalAlpha = WNW.mWV.wWM(NMMmV / 500);\n else if (NMMmV > 1500) Mm.globalAlpha = WNW.mWV.wWM(1 - ((NMMmV - 1500) / 500));\n else Mm.globalAlpha = 1;\n var wmN = (SERVG.ME.NmWvw === 1) ? vwnWv : VNN[items[SERVG.ME.NmWvw].loot];\n wN.WM(NmWvw, nvm, 50, 0, 0, 0, 1);\n wN.WM(wmN, nvm, 50, 0, 0, 0, 1);\n Mm.globalAlpha = 1;\n SERVG.ME.mnWwv -= mV;\n }\n var mvn = SERVG.ME.mvn;\n switch (mvn) {\n case 0:\n if (nMWVv.m !== 1) {\n if (vNv === 0) nMWVv = wN.wvv(looticon, nMWVv);\n else nMWVv = wN.wvv(lootmobileicon, nMWVv);\n return;\n }\n var Nm = mn + (WvmnV * mn);\n var vNwMN = Nm / mn;\n var scalex = (mn * nMWVv.width) / 2;\n var scaley = (mn * nMWVv.height) / 2;\n var posx = ((wvm + NmM) * Nm) - (scalex / 2);\n var posy = win.Math.max(10 * mn, ((((NNw + WWV) * Nm) - (scaley / 2)) - (65 * Nm)) - (60 * mn));\n if (vNv === 1) {\n windowobjects.mNNwM = posx;\n windowobjects.nNwMM = posy;\n windowobjects.vwVnW = scalex;\n windowobjects.mnNnW = scaley;\n }\n Mm.drawImage(nMWVv, posx, posy, scalex, scaley);\n var loot = VNN[SERVG.ME.loot];\n posx = ((wvm + NmM) * vNwMN) - (scalex / (2 * mn));\n posy = win.Math.max(10, ((((NNw + WWV) * vNwMN) - (scaley / (2 * mn))) - (65 * vNwMN)) - 60);\n wN.WM(loot, posx + 77, posy + 33, loot.angle, 0, 0, loot.scale);\n break;\n case 1:\n var vW = SERVG.ME.wVnVm / SERVG.ME.nWVvv;\n var mN = SERVG.ME.nWVvv - SERVG.ME.wVnVm;\n SERVG.ME.wVnVm -= mV;\n if (SERVG.ME.wVnVm < 0) {\n SERVG.ME.mvn = -1;\n return;\n }\n if (timer.m !== 1) {\n timer = wN.wvv(timericon, timer);\n return;\n }\n if (arrow.m !== 1) {\n arrow = wN.wvv(timerarrow, arrow);\n return;\n }\n if (lights.m !== 1) {\n lights = wN.wvv(timerlights, lights);\n return;\n }\n var Nm = mn + (WvmnV * mn);\n var scalex = (mn * timer.width) / 2;\n var scaley = (mn * timer.height) / 2;\n var wwn = (wvm + NmM) * Nm;\n var Nmn = (NNw + WWV) * Nm;\n var posx = wwn - (scalex / 2);\n var posy = win.Math.max(10 * Nm, ((Nmn - (scaley / 2)) - (65 * Nm)) - (60 * mn));\n if (mN < 100) Mm.globalAlpha = mN / 100;\n else if (SERVG.ME.wVnVm < 100) Mm.globalAlpha = SERVG.ME.wVnVm / 100;\n Mm.drawImage(timer, posx, posy, scalex, scaley); // posx = pos of timer img in x axis, posy = in y axis |||| scalex, scaley is scale\n Mm.save();\n Mm.translate(wwn, win.Math.max((10 * Nm) + (scaley / 2), (Nmn - (65 * Nm)) - (60 * mn)));\n Mm.rotate(-WNVNM * vW);\n Mm.drawImage(arrow, -scalex / 2, -scaley / 2, scalex, scaley);\n Mm.restore();\n Mm.drawImage(lights, posx, posy, scalex, scaley);\n Mm.globalAlpha = 1;\n break;\n case 2:\n var W = SERVG.ME.MWVMV.W;\n if (W.m !== 1) {\n if (vNv === 0) SERVG.ME.MWVMV.W = wN.wvv(SERVG.ME.MWVMV.src, W);\n else SERVG.ME.MWVMV.W = wN.wvv(SERVG.ME.MWVMV.src.replace(\"e-\", \"e-mobile-\"), W);\n return;\n }\n var Nm = mn + (WvmnV * mn);\n var scalex = (mn * W.width) / 2;\n var scaley = (mn * W.height) / 2;\n var posx;\n if (SERVG.ME.mwMmN === 1) posx = (((wvm + NmM) - 5) * Nm) - scalex;\n else posx = ((wvm + NmM) * Nm) - (scalex / 2);\n var posy = win.Math.max(10 * mn, ((((NNw + WWV) * Nm) - (scaley / 2)) - (65 * Nm)) - (60 * mn));\n if (vNv === 1) {\n windowobjects.mNNwM = posx;\n windowobjects.nNwMM = posy;\n windowobjects.vwVnW = scalex;\n windowobjects.mnNnW = scaley;\n }\n Mm.drawImage(W, posx, posy, scalex, scaley);\n if (SERVG.ME.mwMmN === 1) {\n if (VWvVN.m !== 1) {\n if (vNv === 0) VWvVN = wN.wvv(loot2icon, VWvVN);\n else VWvVN = wN.wvv(lootmobileicon, nMWVv);\n return;\n }\n var vNwMN = Nm / mn;\n scalex = (mn * VWvVN.width) / 2;\n scaley = (mn * VWvVN.height) / 2;\n posx += scalex + (10 * mn);\n posy = win.Math.max(10 * mn, ((((NNw + WWV) * Nm) - (scaley / 2)) - (65 * Nm)) - (60 * mn));\n if (vNv === 1) {\n windowobjects.mmNWn = posx;\n windowobjects.vmwNV = posy;\n }\n Mm.drawImage(VWvVN, posx, posy, scalex, scaley);\n var loot = VNN[SERVG.ME.loot];\n posx = ((wvm + NmM) * vNwMN) + 5;\n posy = win.Math.max(10, ((((NNw + WWV) * vNwMN) - (scaley / (2 * mn))) - (65 * vNwMN)) - 60);\n wN.WM(loot, posx + 77, posy + 33, loot.angle, 0, 0, loot.scale);\n }\n break;\n }\n }", "posZahtMet()\n {\n this.posZah=!this.posZah;\n }", "function validasi(cs) {\nvar ada = false;\nvar dataCS = dataKaryawan;\n\n for (var x in dataCS) {\n if (dataCS[x]==cs) {ada=true}\n }\n if (ada) {return ada}\n else {message(\"Maaf CS tidak ditemukan\");exit()}\n}", "function soloLetras(e) {\r\n key = e.keyCode || e.which;\r\n tecla = String.fromCharCode(key).toLowerCase();\r\n letras = \" áéíóúabcdefghijklmnñopqrstuvwxyz\";\r\n especiales = \"8-37-39-46\";\r\n tecla_especial = false\r\n for (var i in especiales) {\r\n if (key == especiales[i]) {\r\n tecla_especial = true;\r\n break;\r\n }\r\n }\r\n if (letras.indexOf(tecla) == -1 && !tecla_especial) {\r\n return false;\r\n }\r\n}", "function kiemtrahople() {\n\treturn kiemtrakhoangtrong() && chieudaiusername(\"username\",5,30) && kiemtramail(\"email\") && kiemtratuoi(18,50);\n}", "Check_Tie(){\r\n if (this.Find_Moves() == [] && this.Check_Win() == false){\r\n return true\r\n }else{\r\n return false\r\n }\r\n }", "function trykk() {\n on[i] = false;\n finishTime = new Date().getTime();\n clearTimeout(timeID);\n utregningTid();\n updateView();\n}", "function checkTaskClone ( vi, task) {\ntry {\nvar villageTask = GM_getValue(myacc() + \"_\" + vi + \"_waitTask\", \"false\");\nvar result = false\n//8_525743_100,100,100,100_0_1338566744000_610000\n\tif ( villageTask != \"false\" ) {\n\t\tvar allTasks = villageTask.split(\"|\");\n\t\tfor (var i=0 ; i<allTasks.length ; i++){\n\t\t var villageCTransTask = allTasks[i].split(\"_\");\n\t\t if(allTasks[i].indexOf(task) != -1 && villageCTransTask[5] == \"600001\" ){result = true; break;};\n\t\t};\n };\nreturn result;\t\n\n}\ncatch ( err ) {\n\t\tprintStackTrace();\n\t\tvar msg = \"<b>checkTaskClone():: Something went wrong, error: \" + err.name + \", Error Message: \" + err.message + \"</b>\";\n\t\tplaySound ( msg );\n\t\tprintErrorMSG(msg);\n\t\tthrow err;\n\t}\n}", "function comprobarRecursividad(cadenaNt,cadenaNnT){\r\n var banderaRecursividad=false;\r\n //verifico si exte recusividad por la izquierda si exite devuelve true\r\n var resultado = (cadenaNt.substr(0,cadenaNt.length)==cadenaNnT.substr(0,cadenaNt.length))?banderaRecursividad=true:banderaRecursividad=false;\r\n return banderaRecursividad;\r\n}", "function returnTrue() {\n\t\t\treturn true;\n\t\t}", "function returnTrue() {\n\t\t\treturn true;\n\t\t}", "function returnTrue() {\n\t\t\treturn true;\n\t\t}", "function returnTrue() {\n\t\t\treturn true;\n\t\t}", "function soloLetras(e) {\n key = e.keyCode || e.which;\n tecla = String.fromCharCode(key).toLowerCase();\n letras = \" áéíóúabcdefghijklmnñopqrstuvwxyz\";\n especiales = \"8-37-39-46\";\n tecla_especial = false\n for (var i in especiales) {\n if (key == especiales[i]) {\n tecla_especial = true;\n break;\n }\n }\n if (letras.indexOf(tecla) == -1 && !tecla_especial) {\n return false;\n }\n}", "function targil3(str) {\n if(str.indexOf(\"r\") != -1){\n return true;\n }\n return false; \n}", "function vacio(){\n\t var c_na = /^([a-z]|[A-Z]|├í|├ę|├*|├│|├║|├▒|├╝|\\s)+$/\n if(!c_na.test(solicitar.nombre.value)){\n alert('Escriba su nombre y apellido respetando may˙sculas, min˙sculas y acentos.');\n\t\t solicitar.nombre.focus();\n return false;\n }\n return true;\n }", "function vence(novoTabuleiro, jogador){\n\n // checa vitoria de \"X\" ou \"O\"\n if(\n // checando horizontal\n novoTabuleiro[0] == jogador && novoTabuleiro[1] == jogador && novoTabuleiro[2] == jogador ||\n novoTabuleiro[3] == jogador && novoTabuleiro[4] == jogador && novoTabuleiro[5] == jogador ||\n novoTabuleiro[6] == jogador && novoTabuleiro[7] == jogador && novoTabuleiro[8] == jogador ||\n\n // checando vertical\n novoTabuleiro[0] == jogador && novoTabuleiro[3] == jogador && novoTabuleiro[6] == jogador ||\n novoTabuleiro[1] == jogador && novoTabuleiro[4] == jogador && novoTabuleiro[7] == jogador ||\n novoTabuleiro[2] == jogador && novoTabuleiro[5] == jogador && novoTabuleiro[8] == jogador ||\n\n // checando diagonal\n novoTabuleiro[0] == jogador && novoTabuleiro[4] == jogador && novoTabuleiro[8] == jogador ||\n novoTabuleiro[2] == jogador && novoTabuleiro[4] == jogador && novoTabuleiro[6] == jogador){\n\n //textoVencedor = jogador + \" venceu!\";\n return true;\n\n }\n return false;\n\n}", "function soloUsuario(e) {\n tecla = (document.all) ? e.keyCode : e.which;\n if (tecla == 8) return true;\n patron = /^([A-Za-zÑñáéíóúÁÉÍÓÚ0-9]+)$/;\n\n te = String.fromCharCode(tecla);\n return patron.test(te);\n}", "function sjekkSvar() {\n var svar = \"\";\n for (var i = 0; i < ord.length; i++) {\n svar+=($('#t'+i).text());\n }\n\n if(svar==ord){\n skruAvInput();\n\n c.clearRect(0,0,canvas.width,canvas.height);\n };\n }", "function validarletra(a) { \r\n tecla = (document.all) ? a.keyCode : a.which;\r\n\tif (tecla==0) return true; //Tecla que permite las flechas de direccionamiento,tab,supr\r\n\tif (tecla==8) return true; //Tecla de retroceso (para poder borrar) \r\n\tif (tecla==32) return true; //Tecla de espacio (para poder borrar) \r\n\tif (tecla==47) return true; //Tecla / \r\n\tif (tecla==40) return true; //Tecla ( \r\n\tif (tecla==41) return true; //Tecla )\r\n\tif (tecla==95) return true; //Tecla _\r\n\tif (tecla==61) return false; //Tecla =\r\n\tif (tecla==241) return true;// Tacla para la letra ñ\r\n\tif (tecla==209) return true;// Tacla para la letra Ñ\r\n\tif (tecla==225) return true;//Tecla para el acento de la letra a \r\n\tif (tecla==233) return true;//Tecla para el acento de la letra e\r\n\tif (tecla==237) return true;//Tecla para el acento de la letra i \r\n\tif (tecla==243) return true;//Tecla para el acento de la letra o \r\n\tif (tecla==250) return true;//Tecla para el acento de la letra u \r\n\tif (tecla==193) return true;//Tecla para el acento de la letra A \r\n\tif (tecla==201) return true;//Tecla para el acento de la letra E\r\n\tif (tecla==205) return true;//Tecla para el acento de la letra I \r\n\tif (tecla==211) return true;//Tecla para el acento de la letra O \r\n\tif (tecla==218) return true;//Tecla para el acento de la letra U\r\n\tif (tecla==250) return true;//Tecla para el acento de la letra u \r\n\tpatron =/[A-Za-z]/; // Solo acepta letras \r\n\t//if (key >= 48 && key <= 57) return true;\r\n\t//patron = /\\d/; Solo acepta n�meros \r\n //patron = /\\w/; Acepta n�meros y letras \r\n //patron = /\\D/; //No acepta n�meros \r\n te = String.fromCharCode(tecla); \r\n return patron.test(te); \r\n} // fin de la funcion de solo letras", "function validarletra(a) { \r\n tecla = (document.all) ? a.keyCode : a.which;\r\n\tif (tecla==0) return true; //Tecla que permite las flechas de direccionamiento,tab,supr\r\n\tif (tecla==8) return true; //Tecla de retroceso (para poder borrar) \r\n\tif (tecla==32) return true; //Tecla de espacio (para poder borrar) \r\n\tif (tecla==47) return true; //Tecla / \r\n\tif (tecla==40) return true; //Tecla ( \r\n\tif (tecla==41) return true; //Tecla )\r\n\tif (tecla==95) return true; //Tecla _\r\n\tif (tecla==61) return false; //Tecla =\r\n\tif (tecla==241) return true;// Tacla para la letra ñ\r\n\tif (tecla==209) return true;// Tacla para la letra Ñ\r\n\tif (tecla==225) return true;//Tecla para el acento de la letra a \r\n\tif (tecla==233) return true;//Tecla para el acento de la letra e\r\n\tif (tecla==237) return true;//Tecla para el acento de la letra i \r\n\tif (tecla==243) return true;//Tecla para el acento de la letra o \r\n\tif (tecla==250) return true;//Tecla para el acento de la letra u \r\n\tif (tecla==193) return true;//Tecla para el acento de la letra A \r\n\tif (tecla==201) return true;//Tecla para el acento de la letra E\r\n\tif (tecla==205) return true;//Tecla para el acento de la letra I \r\n\tif (tecla==211) return true;//Tecla para el acento de la letra O \r\n\tif (tecla==218) return true;//Tecla para el acento de la letra U\r\n\tif (tecla==250) return true;//Tecla para el acento de la letra u \r\n\tpatron =/[A-Za-z]/; // Solo acepta letras \r\n\t//if (key >= 48 && key <= 57) return true;\r\n\t//patron = /\\d/; Solo acepta n�meros \r\n //patron = /\\w/; Acepta n�meros y letras \r\n //patron = /\\D/; //No acepta n�meros \r\n te = String.fromCharCode(tecla); \r\n return patron.test(te); \r\n} // fin de la funcion de solo letras", "function soloLetras(e) {\n key = e.keyCode || e.which;\n tecla = String.fromCharCode(key).toLowerCase();\n letras = \" '/áéíóúabcdefghijklmnñopqrstuvwxyz\";\n especiales = \"8-37-39-46\";\n\n tecla_especial = false\n for (var i in especiales) {\n if (key == especiales[i]) {\n tecla_especial = true;\n break;\n }\n }\n\n if (letras.indexOf(tecla) == -1 && !tecla_especial) {\n return false;\n }\n}", "function runOnMOM() {\n return true;\n}", "function verifLike(indexUser, sauceLike, userId) {\n console.log(\"entrer dans verif like \");\n if (indexUser >= 0 && userId == sauceLike.usersLiked[indexUser]) {\n var retour = true;\n console.log(\"Userid dans userliked : \" + userId);\n\n } else {\n\n var retour = false;\n\n }\n\n console.log(\"Sortie verif like : \" + retour);\n return retour;\n}", "function calcoloRisultato(nPc, nUt, sclt) {\n // Inizializzo una variabile che contenga la somma dei due numeri giocati\n var somma = nPc + nUt;\n console.log(\"La somma dei valori é: \" + somma);\n // Calcolo incrociato tra risultato numerico e la scelta del giocatore\n if(somma % 2 != 0 && sclt == pari ){\n console.log(\"Hai perso...\")\n }\n else{\n console.log(\"Hai vinto\")\n }\n\n }", "function command_ok(command){\n if (command == 2 || command == 4 || command == 6 || command == 7){\n return true;\n }\n return false;\n}", "function comprobarPosicio(Y, X) {\n var ok = false;\n if (tauler[Y][X] == 1) {\r\n ok = true;\n }\r\n return ok;\n}", "function letrasYEspacios(e)\n {\n key=e.keyCode || e.which;\n teclado=String.fromCharCode(key).toLowerCase();\n \n letras=\" aábcdeéfghiíjklmnñoópqrstuúvwxyz\";\n especiales=\"8-37-38-46-164\";\n\n teclado_especial=false;\n\n for(var i in especiales)\n {\n if(key==especiales[i])\n {\n teclado_especial=true;\n break;\n }\n }\n\n if(letras.indexOf(teclado)==-1 && !teclado_especial)\n {\n return false;\n }\n }", "async function testePionJouable(i, j, login, hote, adversaire){\n \n // si le client est l'adversaire, c'est le blanc\n if(login===adversaire){\n \n let pionIJ=await getPion(i, j, hote, adversaire);\n \n if ((pionIJ===PION_BLANC)||(pionIJ===DAME_BLANC)){\n // pion haut droit\n if ((j<9)&&(i>0)){\n let pion1 = await getPion(i-1, j+1, hote, adversaire);\n if(pion1!=null){\n if(pion1===SANS_PION) return true;\n }\n }\n \n // pion haut gauche\n if ((j>0)&&(i>0)){\n let pion2 = await getPion(i-1, j-1, hote, adversaire);\n if(pion2!=null){\n if(pion2===SANS_PION) return true;\n }\n }\n \n // pion haut droit mangeable\n if ((j<8)&&(i>1)){\n let pion3, pion4;\n pion3 = await getPion(i-2, j+2, hote, adversaire);\n pion4 = await getPion(i-1, j+1, hote, adversaire); \n if ((pion3!=null)&&(pion4!=null)){\n if ((pion3===SANS_PION)&&(pion4===PION_NOIR)) return true;\n }\n }\n \n // pion haut gauche mangeable\n if ((j>1)&&(i>1)){\n let pion5, pion6;\n pion5 = await getPion(i-2, j-2, hote, adversaire);\n pion6 = await getPion(i-1, j-1, hote, adversaire); \n if((pion5===SANS_PION)&&(pion6===PION_NOIR)) return true;\n }\n \n // pion haut droit mangeable\n if ((j<8)&&(i>1)){\n let pion7, pion8;\n pion7 = await getPion(i-2, j+2, hote, adversaire);\n pion8 = await getPion(i-1, j+1, hote, adversaire);\n if ((pion7===SANS_PION)&&(pion8===DAME_NOIR)) return true;\n }\n \n // pion haut gauche mangeable\n if ((j>1)&&(i>1)){\n let pion9, pion10;\n pion9 = await getPion(i-2, j-2, hote, adversaire);\n pion10 = await getPion(i-1, j-1, hote, adversaire);\n if((pion9===SANS_PION)&&(pion10===DAME_NOIR)) return true;\n }\n \n // si c'est une dame (deplacement ou on veut)\n if (pionIJ===DAME_BLANC){\n // pion bas droit\n if ((j<9)&&(i<9)){\n let pion11 = await getPion(i+1, j+1, hote, adversaire);\n if (pion11===SANS_PION) return true; \n }\n \n // pion bas gauche\n if ((j>0)&&(i<9)){\n let pion12 = await getPion(i+1, j-1, hote, adversaire);\n if (pion12===SANS_PION) return true;\n }\n \n // pion bas droit mangeable\n if ((j<8)&&(i<8)){\n let pion13 = await getPion(i+1, j+1, hote, adversaire);\n let pion14 = await getPion(i+2, j+2, hote, adversaire);\n if((pion13===PION_NOIR)&&(pion14===SANS_PION)) return true;\n }\n \n // pion bas gauche mangeable\n if ((j>1)&&(i<8)){\n let pion15 = await getPion(i+1, j-1, hote, adversaire);\n let pion16 = await getPion(i+2, j-2, hote, adversaire); \n if((pion15===PION_NOIR)&&(pion16===SANS_PION)) return true;\n }\n \n // dame bas droit mangeable\n if ((j<8)&&(i<8)){\n let pion17 = await getPion(i+1, j+1, hote, adversaire);\n let pion18 = await getPion(i+2, j+2, hote, adversaire);\n if ((pion17==DAME_NOIR)&&(pion18===SANS_PION)) return true;\n }\n \n // dame bas gauche mangeable\n if ((j>1)&&(i<8)){\n let pion19 = await getPion(i+1, j-1, hote, adversaire);\n let pion20 = await getPion(i+2, j-2, hote, adversaire);\n if((pion19===DAME_NOIR)&&(pion20===SANS_PION)) return true;\n }\n }\n }\n }\n \n // si le client est l'hote, cest le pion noir\n if(login===hote){\n \n let pionIJ=await getPion(i, j, hote, adversaire);\n \n if((pionIJ===PION_NOIR)||(pionIJ===DAME_NOIR)){\n // pion bas droit\n if ((j<9)&&(i<9)){\n let pion1 = await getPion(i+1, j+1, hote, adversaire);\n if(pion1===SANS_PION) return true;\n }\n \n // pion bas gauche\n if ((j>0)&&(i<9)){\n let pion2 = await getPion(i+1, j-1, hote, adversaire);\n if(pion2===SANS_PION) return true;\n }\n \n // pion bas droit mangeable\n if ((j<8)&&(i<8)){\n let pion3 = await getPion(i+1, j+1, hote, adversaire);\n let pion4 = await getPion(i+2, j+2, hote, adversaire);\n if((pion3===PION_BLANC)&&(pion4===SANS_PION)) return true;\n }\n \n // pion bas gauche mangeable\n if ((j>1)&&(i<8)){\n let pion5 = await getPion(i+1, j-1, hote, adversaire);\n let pion6 = await getPion(i+2, j-2, hote, adversaire);\n if((pion5===PION_BLANC)&&(pion6===SANS_PION)) return true;\n }\n \n // dame bas droit mangeable\n if ((j<8)&&(i<8)){\n let pion7 = await getPion(i+1, j+1, hote, adversaire);\n let pion8 = await getPion(i+2, j+2, hote, adversaire);\n if((pion7===DAME_BLANC)&&(pion8===SANS_PION)) return true;\n }\n \n // dame bas gauche mangeable\n if ((j>1)&&(i<8)){\n let pion9 = await getPion(i+1, j-1, hote, adversaire);\n let pion10 = await getPion(i+2, j-2, hote, adversaire);\n if((pion9===DAME_BLANC)&&(pion10===SANS_PION)) return true;\n }\n \n // si c'est une dame (deplacement ou on veut)\n if (pionIJ===DAME_NOIR){\n // pion haut droit\n if ((j<9)&&(i>0)){\n let pion11 = await getPion(i-1, j+1, hote, adversaire);\n if (pion11===SANS_PION) return true;\n }\n \n // pion haut gauche\n if ((j>0)&&(i>0)){\n let pion12 = await getPion(i-1, j-1, hote, adversaire);\n if (pion12===SANS_PION) return true;\n }\n \n // pion haut droit mangeable\n if ((j<8)&&(i>1)){\n let pion13 = await getPion(i-2, j+2, hote, adversaire);\n let pion14 = await getPion(i-1, j+1, hote, adversaire);\n if((pion13===SANS_PION)&&(pion14===PION_BLANC)) return true;\n }\n \n // pion haut gauche mangeable\n if ((j>1)&&(i>1)){\n let pion15 = await getPion(i-2, j-2, hote, adversaire);\n let pion16 = await getPion(i-1, j-1, hote, adversaire);\n if ((pion15===SANS_PION)&&(pion16===PION_BLANC)) return true;\n }\n \n // dame haut droit mangeable\n if ((j<8)&&(i>1)){\n let pion17 = await getPion(i-2, j+2, hote, adversaire);\n let pion18 = await getPion(i-1, j+1, hote, adversaire);\n if((pion17===SANS_PION)&&(pion18===DAME_BLANC)) return true;\n }\n \n // dame haut gauche mangeable\n if ((j>1)&&(i>1)){\n let pion19 = await getPion(i-2, j-2, hote, adversaire);\n let pion20 = await getPion(i-1, j-1, hote, adversaire);\n if((pion19===SANS_PION)&&(pion20===DAME_BLANC)) return true;\n }\n }\n }\n }\n \n return false;\n}" ]
[ "0.62881213", "0.6106665", "0.59497046", "0.5901296", "0.5720537", "0.5700155", "0.56874716", "0.5684375", "0.56332403", "0.56296945", "0.5599713", "0.5568872", "0.5567031", "0.5537956", "0.5530381", "0.55146855", "0.55019957", "0.5489751", "0.5480038", "0.54756325", "0.54726046", "0.5469755", "0.5456365", "0.5449567", "0.54469365", "0.5441471", "0.5441108", "0.54355085", "0.54342604", "0.54333544", "0.5422871", "0.5420805", "0.54130447", "0.5406816", "0.540355", "0.53983295", "0.53942114", "0.53928584", "0.5390717", "0.53900194", "0.5389986", "0.5380741", "0.5380741", "0.5370586", "0.5369676", "0.5362674", "0.5345861", "0.5345537", "0.5345537", "0.533964", "0.5334359", "0.5328548", "0.5323393", "0.53228575", "0.53182435", "0.53167933", "0.5309469", "0.53079027", "0.5307176", "0.5304909", "0.52983874", "0.5297967", "0.5294394", "0.52931905", "0.52857816", "0.52836543", "0.52797765", "0.52771866", "0.5276273", "0.52753156", "0.5262043", "0.52619225", "0.5261841", "0.525353", "0.525339", "0.52521354", "0.525057", "0.5242342", "0.52418077", "0.52383405", "0.5237768", "0.5237251", "0.5237251", "0.5237251", "0.5237251", "0.5236121", "0.5235636", "0.5227268", "0.52261734", "0.5220423", "0.5212905", "0.52117294", "0.52117294", "0.5209937", "0.5209701", "0.5208751", "0.5208574", "0.51996565", "0.51923007", "0.51840955", "0.51827365" ]
0.0
-1
zove se kada su svi igraci mrtvi (this.players) i nova generacija se pravi
naturalSelection() { let previousBest = this.players[0]; this.speciate(); //razvrstava igrace po vrstama this.calculateFitness(); //Racuna se fitnes svih igraca this.sortSpecies(); //Sortira vrste od najbolje ka najgoroj if (this.massExtinctionEvent) { this.massExtinction(); this.massExtinctionEvent = false; } this.cullSpecies(); //Ubija donju polovinu svake vrste this.killStaleSpecies(); //Ubija vrste koje nisu napredovale 15 generacija this.killBadSpecies(); //Ubija sve ispod prosecne vrste console.log( "generation " + this.gen + " species: " + this.species.length ); const averageSum = this.getAvgFitnessSum(); const children = []; for (let j = 0; j < this.species.length; j++) { children.push(this.species[j].champ.clone()); //Dodaje sampiona bez mutacija const NoOfChildren = floor( (this.species[j].averageFitness / averageSum) * this.players.length ) - 1; //Dozvoljen broj dece for (let i = 0; i < NoOfChildren; i++) { //Vrati bebe u odnosu na broj dece children.push(this.species[j].giveMeBaby()); } } if (children.length < this.players.length) { children.push(previousBest.clone()); } while (children.length < this.players.length) { //Ako nema dovoljno beba zbog zaokruzivanja children.push(this.species[0].giveMeBaby()); //Uzima bebe od najbolje vrste } this.players = []; arrayCopy(children, this.players); this.gen += 1; for (let i = 0; i < this.players.length; i++) { this.players[i].brain.generateNetwork(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "placePlayers() {\n this.players.forEach((player) => {\n player.initPlayer(this.map);\n this.map.addPlayerToCell(player);\n });\n }", "createPlayers() {\r\n var sword = new Weapon(\"sword\");\r\n var chakram = new Weapon(\"chakram\");\r\n var Axe = new Weapon(\"Axe\");\r\n var boStaff = new Weapon(\"boStaff\");\r\n var shotgun = new Weapon(\"Shotgun\");\r\n var glove = new Weapon(\"Infinity Gauntlet\");\r\n var grenade = new Weapon(\"Grenade\");\r\n var dreambow = new Weapon(\"Dream Bow\");\r\n\r\n var heWasNumberOne = new Player();\r\n var queen = new Player();\r\n var ironProf = new Player();\r\n var lightning = new Player();\r\n var bigLou = new Player();\r\n var Kurgan = new Player();\r\n /*populate cache and players arrays*/\r\n\r\n const weaponNames = [\"sword\", \"shotgun\", \"glove\", \"grenade\", \"dreambow\", \"Axe\", \r\n\"boStaff\", \"chakram\"];\r\n const weaponsCache = [];\r\n weaponNames.map(weaponName => weaponsCache.push(new Weapon(weaponName)));\r\n\r\n const playerNames = [\"Smitty Werbenjagermanjensen\", \"Ice Queen\", \"Iron Professor\", \"lightning bolt\", \"big Lou\", \"Wild Kurgan\"];\r\n playerNames.map(playerName => this.players.push(new Player(playerName, weaponsCache)));\r\n\r\n }", "createPlayer() {\n this.match.match_name = \"MATCH\" + Math.floor(Math.random() * Math.floor(1000));\n var date = new Date();\n this.match.match_date = date.getHours() + \":\" + date.getMinutes() + \":\" + date.getSeconds() + \" \" + date.getDate() + \"/\" + (date.getMonth() + 1) + \"/\" + date.getFullYear()\n this.text_log.match = this.match.match_name;\n this.text_log.date = this.match.match_date;\n this.pushTextSimulation(\"<p>----------- \" + this.match.match_name + \" ----------</p>\");\n this.pushTextSimulation(\"<p>----------- \" + this.match.match_date + \" ----------</p>\");\n this.pushTextSimulation(\"<p>----------- Goal \" + this.target + \" ----------</p>\");\n for (var i = 1; i <= this.number_player; i++) {\n var element = {\n player_name: this.randomString(1) + Math.floor(Math.random() * Math.floor(1000)),\n player_current_position: 0,\n }\n this.players.push(element);\n this.pushTextSimulation(\"<p> Created Player: <span class='player_name'>\" + element.player_name + \"</span> </p> \");\n\n }\n this.pushTextSimulation(\"<p>-----------START GAME----------</p>\");\n }", "createPlayers(){\n\t\tthis.players = [];\n\t\tfor (let i=0; i<this.playersCount; i++){\n\t\t\tthis.players.push(\n\t\t\t\tthis.player = {\n\t\t\t\t\tplayerNumber: i+1,\n\t\t\t\t\tdices: this.createDicesPerPlayer(),\n\t\t\t\t\tactive: true,\n\t\t\t\t\twinner: false\n\t\t\t\t}\n\t\t\t);\n\t\t};\n\t\treturn this.players;\n\t}", "_updatePlayerList (players) {\n // add all new players, including host, to playersData\n Object.keys(players).forEach(playerId => {\n if (!this.playersData[playerId]) {\n players[playerId].name = playerId;\n players[playerId].color = this.playerColorCodes.shift();\n\n let playerDetails = new Player(players[playerId]);\n this.playersData[playerId] = playerDetails;\n\n this.uiService.updatePlayerList(playerDetails);\n }\n });\n }", "addPlayer(no,firstName,lastName,pos,bat,thw,age,ht,wt,birthplace) {\n let player = {\n No: no,\n firstName: firstName,\n lastName: lastName,\n POS: pos,\n BAT: bat,\n THW: thw,\n AGE: age,\n HT: ht,\n WT: wt,\n birthPlace: birthplace\n };\n //add the each of new player in the list.\n this._players.push(player);\n }", "newPlayer(data1) {\n\n\t\tlet TLC = thing;\n\n\t\tif (online == true) {\n\t\t\tlet RC = Random(255);\n\t\t\tlet player0 = {\n\t\t\t\ttype: 'player',\n\t\t\t\tpos: {\n\t\t\t\t\tx: TLC.pos.x + data1.x,\n\t\t\t\t\ty: TLC.pos.y + data1.y,\n\t\t\t\t},\n\t\t\t\tid: data1.id,\n\t\t\t\tcolor: 'red',\n\t\t\t\tdirection: 'UP',\n\t\t\t\tHP: 300,\n\t\t\t}\n\t\t\tlet player0BR = {\n\t\t\t\tname: 'BR',\n\t\t\t\ttype: 'player',\n\t\t\t\tpos: {\n\t\t\t\t\tx: TLC.pos.x + data1.x,\n\t\t\t\t\ty: TLC.pos.y + data1.y,\n\t\t\t\t},\n\t\t\t\tid: data1.id,\n\t\t\t\tcolor: 'red',\n\t\t\t}\n\t\t\tlet player0BL = {\n\t\t\t\tname: 'BL',\n\t\t\t\ttype: 'player',\n\t\t\t\tpos: {\n\t\t\t\t\tx: TLC.pos.x + data1.x - 1,\n\t\t\t\t\ty: TLC.pos.y + data1.y,\n\t\t\t\t},\n\t\t\t\tid: data1.id,\n\t\t\t\tcolor: 'red',\n\t\t\t}\n\t\t\tlet player0TR = {\n\t\t\t\tname: 'TR',\n\t\t\t\ttype: 'player',\n\t\t\t\tpos: {\n\t\t\t\t\tx: TLC.pos.x + data1.x,\n\t\t\t\t\ty: TLC.pos.y + data1.y - 1,\n\t\t\t\t},\n\t\t\t\tid: data1.id,\n\t\t\t\tcolor: 'red',\n\t\t\t}\n\t\t\tlet player0TL = {\n\t\t\t\tname: 'TL',\n\t\t\t\ttype: 'player',\n\t\t\t\tpos: {\n\t\t\t\t\tx: TLC.pos.x + data1.x - 1,\n\t\t\t\t\ty: TLC.pos.y + data1.y - 1,\n\t\t\t\t},\n\t\t\t\tid: data1.id,\n\t\t\t\tcolor: 'red',\n\t\t\t}\n\t\t\tplayerList.push(player0);\n\t\t\tentities.push(player0BR);\n\t\t\tentities.push(player0BL);\n\t\t\tentities.push(player0TR);\n\t\t\tentities.push(player0TL);\n\t\t}\n\t}", "createPlayer() {\n let startWithBob = true;\n this.map.findObject('Player', (obj) => {\n if (obj.type === 'StartPosition') {\n if (obj.properties && obj.properties.hasOwnProperty('Start')) startWithBob = false;\n if (obj.name === 'Bob') {\n this.bob = new Bob(this, obj.x, obj.y);\n this.bob.depth = 100;\n this.game.Bob = this.bob;\n }\n if (obj.name === 'Flit') {\n this.flit = new Flit(this, obj.x, obj.y);\n this.flit.depth = 100;\n this.game.Flit = this.flit;\n }\n }\n });\n\n this.ActivePlayer = startWithBob ? this.game.Bob : this.game.Flit;\n this.cameras.main.startFollow(this.ActivePlayer);\n }", "insertPlayers(playerX, playerO) {\n let nameX = playerX, nameO = playerO;\n if(!playerX || playerX === '' || !this.existingPlayer(playerX)) {\n nameX = (playerX === '' || !playerX) ? this.generateName() : playerX;\n this._players.push(new Player(nameX));\n }\n\n if(!playerO || playerO === '' || !this.existingPlayer(playerO)) {\n nameO = (playerO === '' || !playerO) ? this.generateName() : playerO;\n this._players.push(new Player(nameO));\n }\n this.activePlayers = [nameX, nameO];\n return this.activePlayers;\n }", "setPlayers() {\n\n GameElements.players[0].xPos = 50;\n GameElements.players[0].yPos = 50;\n GameElements.players[0].position = 17;\n GameElements.players[0].state = Player.STATES.PLAYING;\n GameElements.players[0].color = Player.COLORS.WHITE;\n\n if (REQUIRED_PLAYERS > 1) {\n GameElements.players[1].xPos = 650;\n GameElements.players[1].yPos = 50;\n GameElements.players[1].position = 29;\n GameElements.players[1].state = Player.STATES.PLAYING;\n GameElements.players[1].color = Player.COLORS.BLACK;\n }\n if (REQUIRED_PLAYERS > 2) {\n GameElements.players[2].xPos = 50;\n GameElements.players[2].yPos = 550;\n GameElements.players[2].position = 167;\n GameElements.players[2].state = Player.STATES.PLAYING;\n GameElements.players[2].color = Player.COLORS.BLUE;\n }\n if (REQUIRED_PLAYERS > 3) {\n GameElements.players[3].xPos = 650;\n GameElements.players[3].yPos = 550;\n GameElements.players[3].position = 179;\n GameElements.players[3].state = Player.STATES.PLAYING;\n GameElements.players[3].color = Player.COLORS.YELLOW;\n }\n\n }", "function onNewPlayer(data)\n{\n playerList = data;\n\n console.log(data[0].id);\n \n for (i = 0; i < playerList.length; i++)\n {\n var existingPlayer = new Player(playerList[i].id, playerList[i].username, playerList[i].chips, playerList[i].index);\n if (existingPlayer.getUsername() != \"INVALID_USER\")\n {\n if (existingPlayer.getUsername() == currentPlayer.getUsername())\n {\n currentPlayer = existingPlayer;\n playerAmount(currentPlayer.getUsername(), currentPlayer.getChips());\n console.log(\"Found the current player. His username is \" + currentPlayer.getUsername() + \" and his tableIndex is \" + currentPlayer.getTableIndex());\n }\n currentPlayers[existingPlayer.getTableIndex()] = existingPlayer;\n }\n }\n\n console.log(currentPlayers);\n\n var localIndex;\n \n localIndex = currentPlayer.getTableIndex();\n console.log(\"The player tableIndex is: \" + currentPlayer.getTableIndex());\n var nextPlayerIndex;\n var nextPlayerIterator = 0;\n\n for (i = 0; i< maxPlayers - 1; i++)\n {\n\t// Increase the Iterator by one to indicate the next Player\n nextPlayerIterator++;\n\t// modulo with the current length of players\n nextPlayerIndex = (localIndex + nextPlayerIterator) % currentPlayers.length;\n\tconsole.log(\"The nextPlayerIndex is: \" + nextPlayerIndex);\n //console.log(currentPlayers)\n //console.log(currentPlayers[nextPlayerIndex].getUsername() != \"INVALID_USER\");\n if (currentPlayers[nextPlayerIndex].getUsername() != \"INVALID_USER\")\n {\n console.log(\"got thru\" + nextPlayerIndex + \" fdsfds\" + i);\n drawPlayerAt(nextPlayerIndex, i);\n }\n }\n \n numPlayers++;\n}", "updatePlayersData() {\n\n this.playersData = [];// Reinicia el array\n\n GameElements.players.forEach(player => {\n if (!player.isDead) {\n if (player.isStunt) {\n player.stunningTime--;\n if (player.stunningTime == 0) {\n player.isStunt = false;\n }\n }\n //Si el juegador no esta mareado puede ...\n else {\n if (player.canKickBomb) {\n player.kickBomb();\n }\n player.updatePosition(player.speed);\n player.pickItem();\n }\n }\n //Si el jugador esta muerto, se hace la animacion de la muerte\n else {\n if (player.deathAnimationTime > 0) {\n player.deathAnimation();\n player.deathAnimationTime--;\n }\n\n }\n //Se agrega al array la informacion de cada jugador \n let playerData = this.getUpdatedPlayerData(player);\n this.playersData.push(playerData);\n });\n }", "function fillListPlayers(){\n\t\tlistPlayers.push(playerOne);\n\t\tlistPlayers.push(playerTwo);\n\t}", "playersReceived(p) {\n for(let i=0;i<p.players.length;i++) {\n let exists = false;\n for(let x=0;x<players.length;x++) {\n if(players[x].pid == p.players[i].pid) {\n exists = true;\n }\n }\n //only add new player if it doesn't already exist\n if(!exists) {\n let player = newPlayer(p.players[i]);\n players.push(player);\n }\n }\n }", "newGame() {\n this.initMap();\n this.addMapEnvironnement();\n this.addMapPattern();\n this.addMapItems(4);\n this.players.forEach((player) => {\n this.addPlayer(player[0], player[1])\n });\n this.placePlayers(); \n this.interface.displayPlayersStatus(this.players);\n this.initializePlayerControlEvents(); \n this.roundManager(); \n }", "set players(value) {\n this._players = value;\n }", "function buildPlayerList(){\n playerArray.forEach(function(player){\n if (player.Team === vm.teamKey) {\n vm.currentPlayerArray.push(player);\n };\n });\n vm.currentPlayerArray.forEach(function(player){\n player.Name = player.Name.toUpperCase();\n player.lastName = player.lastName.toUpperCase();\n });\n vm.maxScore = vm.currentPlayerArray.length;\n vm.gameStarted = true;\n vm.isTimeLeft = true\n vm.displayTimer();\n }", "static createPlayers(amountOfBots) {\n this.players = [new Human('MrGarrison47', 1000)];\n for (let i = 0; i < amountOfBots; i++) {\n this.players = [...this.players, new Bot()];\n }\n this.players = [...this.players, new Dealer()];\n }", "constructor(_name = \"\", _description = \"\", _options = [], _players = 0)\n {\n\n super(_name, _description, _options, _players);\n this.players = [];\n\n }", "function player_generate() {\n\n var player_code = \"\"; //il var lo devo lasciare fuori dal DO xke dopo non mi lo riconosce gli oggetti sotto......\n do {\n player_code = \"\";\n // Genero le 3 lettere e le concateno\n for (var i = 0; i < 3; i++) {\n var char_position = number_generator(0,25); // nell array characters si parte da 0....\n var char = characters.charAt(char_position);\n player_code += char;\n }\n // Genero le 3 cifre e le concateno\n for (var i = 0; i < 3; i++) {\n player_code += number_generator(0,9);\n }\n } while (player_codes.includes(player_code));\n\n player_codes.push(player_code);\n // Genero numero di punti\n var punti = number_generator(0,40);\n // Genero numero di rimbalzi\n var rimbalzi = number_generator(0,300);\n // Genero Falli\n var falli = number_generator(0,5); //5 falli e il massimo di falli permessi se no sei espulso !!!!\n // Genero percentuali per i tiri 2 punti\n var percentuali_2 = (number_generator(0,1000) / 10).toFixed(1);\n // Genero percentuali per i tiri da 3 punti\n var percentuali_3 = (100 - percentuali_2).toFixed(1);\n // Genero il giocatore (OGGETTO)\n var player = {\n 'Codice Player': player_code,\n 'Punti': punti,\n 'Rimbalzi': rimbalzi,\n 'Falli': falli,\n 'Percentuali 2 punti': percentuali_2,\n 'Percentuale 3 punti': percentuali_3,\n }\n return player;\n}", "function insertTestPlayers() {\n var player;\n for (i = 0; i < 3; i++) {\n player = {\n name: (\"number\" + (i + 1)), color: \"\", keyLeft: 0, keyRight: 0, finished: false,\n lastX: 100 + i * 50, lastY: 100 + i * 50, angle: 0, turnLeft: false, turnRight: false, score: 0\n };\n player.color = getColor();\n player.keyLeft = (49 + 2 * i);\n player.keyRight = (50 + 2 * i);\n players.push(player);\n }\n displayData();\n}", "static randomizePlayers() {\n let arr = shuffle([1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2])\n for (const index in arr) {\n let ter = Territory.find(parseInt(index) + 1)\n ter.player_id = arr[index]\n }\n }", "setPlayers({ gameType, players = [], localPlayer = null }) {\n // Instantiate new players as needed (if user is about to play the first game\n // or if the user is switching modes)\n if (this.players.length === 0) {\n if (gameType === '1P') {\n // If user chose 1-Player mode, the user will play against the AI\n this.players.push(new HumanPlayer({ name: 'Human', color: 'red' }));\n this.players.push(new AIPlayer({ name: 'Mr. A.I.', color: 'black' }));\n } else if (gameType === '2P') {\n // If user chooses 2-Player mode, the user will play against another\n // human\n this.players.push(new HumanPlayer({ name: 'Human 1', color: 'red' }));\n this.players.push(new HumanPlayer({ name: 'Human 2', color: 'blue' }));\n } else if (gameType === 'online' && players.length > 0 && localPlayer) {\n // If user chooses Online mode, the user will play against another human\n // on another machine\n this.players.push(...players.map((player) => {\n if (player.color === localPlayer.color) {\n return new HumanPlayer(player);\n } else {\n return new OnlinePlayer(player);\n }\n }));\n }\n } else if (gameType !== this.lastType) {\n // If user switches game type (e.g. from 1-Player to 2-Player mode),\n // recreate set of players\n this.players.length = 0;\n this.setPlayers({ gameType });\n return;\n }\n this.type = gameType;\n this.lastType = gameType;\n }", "static setupPlayers (number) {\n\t\tfor(let i=0;i<number;i++) {\n\t\t\t// add players\n\t\t\tconst player = new this('player' + i);\n\t\t\t// set them to 'go'\n\t\t\tplayer.placeOnBoard(Board.go);\n\t\t\t// also add them player list\n\t\t\tBoard.addPlayer(player);\n\t\t}\n\t}", "get players() {\n return this._players;\n }", "function addOtherPlayers(self, playerInfo) {\n\n var otherPlayer;\n\n\n if (playerInfo.isLadron) {\n otherPlayer = self.add.sprite(playerInfo.x, playerInfo.y, 'carro').setOrigin(0.5, 0.5).setDisplaySize(30, 45);\n\n } else {\n otherPlayer = self.add.sprite(playerInfo.x, playerInfo.y, 'policia').setOrigin(0.5, 0.5).setDisplaySize(58, 45);\n\n }\n\n otherPlayer.playerId = playerInfo.playerId;\n self.otherPlayers.add(otherPlayer);\n\n}", "function spawnPlayers() {\n\n for (var i = 0; i < numPlayers; i++) {\n var randX = floor(random(0, rows * cellSize));\n var randY = floor(random(0, cols * cellSize));\n append(player, new Player(randX, randY, i));\n //player.push(new Player(randX, randY, i));\n }\n\n}", "function AddPlayer ( player :GameObject ) {\n\tvar minSize : float = 1000;\n\tvar minTeam : Team;\n\tfor (var t : Team in teams) {\n\t\tvar s = t.GetBalancedSize();\n\t\tif (s < minSize) {\n\t\t\tminSize = s;\n\t\t\tminTeam = t;\n\t\t} \n\t}\n\tminTeam.AddPlayer(player);\n}", "function initPlayers(scene) {\n for (let id in gameState.coords) {\n if (id != PLAYER_ID) {\n if (!(id in players)) { //new player\n const coords = gameState.coords[id];\n cursors[id] = {right: false, left: false, up: false, down: false};\n positions[id] = {x: coords.x, y: coords.y};\n players[id] = scene.physics.add.sprite(coords.x, coords.y, 'hemadi', 'walk_down_2.png');\n players[id].anims.play('walk_down');\n scene.physics.add.collider(players[id], collideLayer);\n }\n }\n }\n}", "static createPlayers(n){\n let players=[];\n for(let i=1;i<=n;i++){\n players.push(new Person(i,\"player\"+i))\n }\n Game.displayPlayers(players)\n return players;\n }", "_createPlayers() {\n\n\t\tlet rotation = Math.PI * 0.5;\n\t\tlet regions;\n\n\t\tif ( this.color === TEAM.RED ) {\n\n\t\t\tregions = _redDefendingRegions;\n\t\t\trotation *= - 1;\n\n\t\t} else {\n\n\t\t\tregions = _blueDefendingRegions;\n\n\t\t}\n\n\t\tconst goalkeeper = new Goalkeeper( this, this.pitch, regions[ 0 ] );\n\t\tgoalkeeper.rotation.fromEuler( 0, rotation, 0 );\n\t\tthis.add( goalkeeper );\n\n\t\tconst fieldplayer1 = new FieldPlayer( ROLE.ATTACKER, this, this.pitch, regions[ 1 ] );\n\t\tfieldplayer1.rotation.fromEuler( 0, rotation, 0 );\n\t\tthis.add( fieldplayer1 );\n\n\t\tconst fieldplayer2 = new FieldPlayer( ROLE.ATTACKER, this, this.pitch, regions[ 2 ] );\n\t\tfieldplayer2.rotation.fromEuler( 0, rotation, 0 );\n\t\tthis.add( fieldplayer2 );\n\n\t\tconst fieldplayer3 = new FieldPlayer( ROLE.DEFENDER, this, this.pitch, regions[ 3 ] );\n\t\tfieldplayer3.rotation.fromEuler( 0, rotation, 0 );\n\t\tthis.add( fieldplayer3 );\n\n\t\tconst fieldplayer4 = new FieldPlayer( ROLE.DEFENDER, this, this.pitch, regions[ 4 ] );\n\t\tfieldplayer4.rotation.fromEuler( 0, rotation, 0 );\n\t\tthis.add( fieldplayer4 );\n\n\t}", "addPlayer(team) {\n if (team) {\n const index = this.getTeamSpawn(team)\n this.player = this.newPiece({ team, type: 'warrior', player: true, index })\n }\n }", "fetchPlayers() {\n if(this.players.length === 0) { return []; }\n return this.players.map((value) => value._player);\n }", "updatePlayersList(players) {\n if (players.length > 0) {\n const updatedPlayersList = [];\n players.forEach(player => {\n updatedPlayersList.push(player);\n });\n this.PLAYERS_LIST = updatedPlayersList;\n } else {\n this.PLAYERS_LIST = null;\n }\n }", "get players() {\n return this._players;\n }", "get players() {\n return this._players;\n }", "getPlayers () {\n return this.#players\n }", "generate() {\r\n const numberObstacles = this.game.config.numObstacles;\r\n const map = [`<div class='mdl-grid'>`];\r\n let rndRow;\r\n let rndColumn;\r\n let cell;\r\n let weap;\r\n const rand = randomize;\r\n // on calcule la position des obstacles\r\n while (this.obstaclesCells.length < numberObstacles) {\r\n rndRow = rand(0, this.rows - 1);\r\n rndColumn = rand(0, this.columns - 1);\r\n cell = this.obstaclesCells.some(e => e.x === rndColumn && e.y === rndRow);\r\n if (!cell) {\r\n this.obstaclesCells.push({\r\n x: rndColumn, y: rndRow, isOk: false\r\n });\r\n }\r\n }\r\n // on calcule la position des armes\r\n this.weapons.forEach((weapon, idx) => {\r\n if (idx < this.game.config.numWeaponsOnMap) {\r\n rndRow = rand(0, this.rows - 1);\r\n rndColumn = rand(0, this.columns - 1);\r\n cell = this.obstaclesCells.some(e => e.x === rndColumn && e.y === rndRow);\r\n weap = this.weapons.some(e => e.x === rndColumn && e.y === rndRow);\r\n while (cell || weap) {\r\n rndRow = rand(0, this.rows - 1);\r\n rndColumn = rand(0, this.columns - 1);\r\n cell = this.obstaclesCells.some(e => e.x === rndColumn && e.y === rndRow);\r\n weap = this.weapons.some(e => e.x === rndColumn && e.y === rndRow);\r\n }\r\n if (!cell && !weap) {\r\n weapon.x = rndColumn;\r\n weapon.y = rndRow;\r\n }\r\n }\r\n });\r\n // on calcule la position du personnage 1\r\n this.getPlayerPosition(this.game.player1);\r\n // on calcule la position du personnage 2\r\n this.getPlayerPosition(this.game.player2);\r\n for (let rowIdx = 0; rowIdx < this.rows; rowIdx++) {\r\n for (let colIdx = 0; colIdx < this.columns; colIdx++) {\r\n let tile = ` ${this.planet._name}-tile`;\r\n let tileWeapon = \"\";\r\n let player = \"\";\r\n cell = this.obstaclesCells.some(e => e.x === colIdx && e.y === rowIdx);\r\n const weapon = this.weapons.find(e => e.x === colIdx && e.y === rowIdx);\r\n if (cell && !weapon) {\r\n tile = ` ${this.planet._name}-obstacle`;\r\n } else if (weapon) {\r\n tileWeapon = ` ${weapon.name}`;\r\n } else if (this.game.player1.x === colIdx && this.game.player1.y === rowIdx) {\r\n this.game.player1.x = colIdx;\r\n this.game.player1.y = rowIdx;\r\n player = ` ${this.game.player1.name}`;\r\n } else if (this.game.player2.x === colIdx && this.game.player2.y === rowIdx) {\r\n this.game.player2.x = colIdx;\r\n this.game.player2.y = rowIdx;\r\n player = ` ${this.game.player2.name}`;\r\n }\r\n player = player !== \"\" ? ` player ${player}` : player;\r\n map.push(`<div data-x='${colIdx}' data-y='${rowIdx}' data-weapon='${tileWeapon.trim()}' class='mdl-cell mdl-cell--1-col planet${tile}${tileWeapon}${player}'></div>`);\r\n }\r\n }\r\n map.push(\"</div>\");\r\n $(\"div.main .middle\").append(map.join(\"\"));\r\n // on calcule la taille des celulles en fonction de la taille de la grille\r\n this.calcGridAndCellsSize();\r\n $(window).on(\"resize\", () => {\r\n this.calcGridAndCellsSize();\r\n });\r\n }", "constructor() {\n //numberOfPlayers sets the number of players that can take part in a game, currently hard-coded to 2, could be set by the game's initiator\n let numberOfPlayers = 2;\n this.getNumberOfPlayers = function() {\n return numberOfPlayers;\n }\n //every game gets a unique id\n let id = uuidv4();\n this.getId = function() {\n return id;\n }\n //stores a game's players\n let players = [];\n this.getPlayers = function() {\n return players;\n }\n //adds a player to a game\n this.addPlayer = function(playerId, openGames) {\n players.push(playerId);\n //Every time a player gets added, check if the necessary number of players has been reached so that the game can start\n //In this case the first turn is set to the player that was just added\n if (players.length == numberOfPlayers) {\n let index = openGames.findIndex((openGame) => openGame == id);\n this.setPlayerTurn(playerId);\n return index;\n } else {\n return -1;\n }\n }\n //playerTurn is used to store whose turn it is. This is achieved by simply storing the player's turn.\n let playerTurn;\n this.getPlayerTurn = function(playerId) {\n if (playerId == playerTurn) {\n return true;\n }\n else{\n return false;\n }\n }\n this.setPlayerTurn = function(playerId) {\n playerTurn = playerId\n }\n //makeMove is only setup in a preliminary way. Right now it only passes the turn to the next player in line. It could however also be used to update the board\n this.makeMove = function(playerId){\n let index = players.findIndex(player => player == playerId);\n if (index==players.length-1){\n index=0;\n }\n else{\n index++;\n }\n this.setPlayerTurn(players[index]);\n }\n }", "function create_Player(){\n\t\n\taddOn_db = loadDB(\"addOnDB\")\n\tvar json = JSON.parse(localStorage[\"addOnDB\"]);\n\t\n\tif(json.length == 2){\n\t\tvar num = 3;\n\t}\n\telse {\n\t\tfor(i=0;i<json.length;i++){\n\t\t\tif (json[i].id == 3) {\n\t\t\tvar num = 4;\n\t\t\t} else {\n\t\t\tvar num = 3;\n\t\t\t}\n\t\t}\n\t}\n\t\n \t//Create player array with elements\n\t\tvar newPlayer = {\n\t\t\tid: num,\n\t\t\tnumber:\"−\",\n\t\t\tname:\"\",\n\t\t\tcolor:\"\"\n\t\t}\n\t\t//add array to database\n\t\taddOn_db.push(newPlayer)\n\t\t//add player row in html\n\t\tplayers.append(create_Row(newPlayer));\n\t\t//save database\n\t\tsaveDB(\"addOnDB\", addOn_db)\n\t\t//update the players\n\t\t//updatePlayers()\n\t\tcheck_Add()\n\t}", "setPlayersData (data) {\n console.log('SETTING PLAYER DATA')\n console.log('')\n var i = 0\n THIS.playerList = []\n for (var i = 0; i < data.players.length; i++) {\n var player = data.players[i]\n var p = new Player(i, player.name, i)\n p.reinforcements = data.players[i].reinforcements\n p.tokens.tok1 = data.players[i].tokens.tok1\n p.tokens.tok2 = data.players[i].tokens.tok2\n p.tokens.tok3 = data.players[i].tokens.tok3\n p.tokens.tok4 = data.players[i].tokens.tok4\n console.log('player is set :')\n console.log(p)\n THIS.playerList.push(p)\n if (localStorage.login === data.players[i].name) {\n THIS.view.localNbTokenTypeJoker = data.players[i].tokens.tok1\n THIS.view.localNbTokenTypeOne = data.players[i].tokens.tok2\n THIS.view.localNbTokenTypeTwo = data.players[i].tokens.tok3\n THIS.view.localNbTokenTypeThree = data.players[i].tokens.tok4\n }\n }\n console.log('this playerlist is set')\n console.log(THIS.playerList)\n\n // The player list is copyied to the view\n THIS.view.players = THIS.playerList\n }", "function initializePlayers() {\n\tvar playerPrefab:GameObject = Resources.Load(\"PlayerPrefab\", GameObject);\n\tfor (var i:int = 0; i < numberOfPlayers; i++) {\n\t\tvar player:GameObject = playerPrefab.Instantiate(playerPrefab, Vector3(), Quaternion.Euler(0.0f, (360.0f / numberOfPlayers) * i, 0.0f));\n\t\tplayer.name = \"Player\" + i;\n\t\tplayer.transform.parent = transform;\n\t}\n}", "allPlayers() {\n let client = this;\n this.socket.on('allplayers', function(data) {\n if (client.ID != null) {\n for (var i = 0; i < data.length; i++) {\n addNewPlayer(data[i].id, data[i].x, data[i].y);\n }\n client.move();\n }\n });\n }", "function createPlayer() {\n currentCoordinateY = totalRows - 1;\n currentCoordinateX = totalColumns - 1;\n jsGrid[currentCoordinateY][currentCoordinateX] = \"X\";\n\n var mapGridValue = \"#r\" + currentCoordinateY + \" #c\" + currentCoordinateX;\n var mapGrid = document.querySelector(mapGridValue);\n var player = document.createElement(\"img\");\n player.id = \"player\";\n player.src = selectedCharacter.frontView;\n mapGrid.appendChild(player);\n}", "start(playerOneName, playerTwoName) {\n this.players.push(new Player(playerOneName));\n this.players.push(new Player(playerTwoName));\n let d = new Deck();\n d.createDeck();\n d.shuffleDeck(); \n this.players[0].playerCards = d.cards.splice(0, 2);\n this.players[1].playerCards = d.cards.splice(0, 2);\n this.cardsInMiddle = d;\n this.players[0].playerChips = 2;\n this.players[1].playerChips = 2;\n }", "function createPlayer() {\n}", "getPlayers() {\n\t\treturn this.players;\n\t}", "createForPlayer(player) {\n if (this.#players_.has(player))\n return;\n\n this.#element_.displayForPlayer(player);\n this.#players_.add(player);\n }", "constructor() {\n this.turnLeft = 10;\n this.players = {};\n this.setPlayers();\n this.createPlayer();\n }", "function PlayerManager() {\n this.opponents_ = new Array();\n this.seats_ = new Array(false,false,false,false,false,false,false);\n \n this.AddOpponent = function(name,id) {\n console.log(\"-c:adding opponent\");\n var opponent = new Opponent(name, id);\n opponent.SetPosition(this.FindSeat());\n this.opponents_.push(opponent);\n }\n \n this.FindSeat = function() {\n for(var i=0;i<7;i++)\n {\n if(!this.seats_[i])\n {\n this.seats_[i] = true;\n return i;\n }\n }\n }\n\n this.RemoveOpponent = function(id) {\n for(var i=this.opponent.length;i>=0;i--) {\n if(this.opponents_[i].id == id) {\n this.seats_[i] = false;\n this.opponents_.splice(i,1);\n }\n }\n }\n\n this.DrawOpponentCard = function() {\n\tvar len = this.opponents_.length;\n for(var i=0;i<len;i++) {\n this.opponents_[i].Draw();\n }\n } \n\n}", "playerReceived(p) {\n let player = newPlayer(p);\n players.push(player);\n }", "function loadPlayerList() {\n playerArray.forEach(addPlayerToUIList);\n }", "function addOtherPlayers(self, playerInfo) {\n // Create new player, and add to Group `otherPlayers`\n var spriteName = `${playerInfo.team}`\n const otherPlayer = self.physics.add.image(playerInfo.x, playerInfo.y, spriteName)\n .setOrigin(0.5, 0.5)\n .setDisplaySize(53, 40);\n otherPlayer.playerId = playerInfo.playerId;\n self.otherPlayers.add(otherPlayer);\n}", "function loadPlayerList() {\n Player_v.all({order: 'id'}, function(err, results) {\n var players = [];\n var player = {};\n player.player_name = 'Not Selected';\n player.id = \"\";\n players[0] = player;\n\n if(results.length > 0) {\n for (var i = 0; i < results.length; i++) {\n // create a brand new instance of player object for every record. One cannot reuse the same player variable.\n var player = { player_name: results[i].first_name + \" \" + results[i].last_name + \"-\" + results[i].city + \"/\" + results[i].state_or_province,\n id: results[i].id};\n players.push(player);\n }\n } // end of if.\n\n this.player_list = players;\n\n next(); // process the next tick.\n }.bind(this));\n}", "function createPlayers(zone,lst,h,w,pauseImage){\n $$(\"initialisation des players\");\n var k=0;\n var divs=zone.getElementsByTagName(\"div\");\n for(var i=0;i<divs.length;i++){\n var div=divs[i];\n if(div.innerHTML==\"player\"){\n players[k]={};\n div.innerHTML=\"<img style='width:30px;' id='state\"+k+\"' src='/img/pause.png'><br>\";\n var iframe=document.createElement(\"iframe\");\n iframe.id=\"player\"+i;\n iframe.index=i;\n iframe.sizeplayer=h;\n iframe.addEventListener(\"onloadframe\",function(){onLoadFrame(this);});\n iframe.src=\"/players/\"+lst[k*2];\n iframe.style=\"height:\"+h+\"px;\"+\"width:\"+w+\"px;\";\n iframe.pauseImage=\"/img/\"+pauseImage;\n div.appendChild(iframe);\n players[k].buttonplay=document.getElementById(\"state\"+k);\n players[k].player=iframe.contentWindow;\n players[k].typePlayer=lst[k*2].replace(\"Player.html\",\"\");\n players[k].origin=lst[k*2+1];\n players[k].window=iframe;\n setUserAgent(players[k].player,\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36\");\n k++;\n }\n }\n}", "function drawPlayerPositions() {\r\n for(var i = 0; i < players.length; i++){\r\n var player = players[i];\r\n var x = Math.floor(Math.random() * 5);\r\n var y = Math.floor(Math.random() * 5);\r\n var tile = gameBoard[x][y];\r\n if (player.role === \"Pilot\"){\r\n x = helipadX;\r\n y = helipadY;\r\n tile = gameBoard[x][y];\r\n }else{\r\n while(tile.state === \"sunk\" || tile.children.length > 0 || x == helipadX || y == helipadY){\r\n x = Math.floor(Math.random() * 5);\r\n y = Math.floor(Math.random() * 5);\r\n tile = gameBoard[x][y];\r\n }\r\n }\r\n tile.addChild(player.sprite);\r\n player.x = x;\r\n player.y = y;\r\n player.initValidActionTiles();\r\n player.calculateValidMoveTiles(player.x, player.y, player.validMoveTiles);\r\n player.calculateValidNavigatorTiles();\r\n player.calculateValidShoreTiles();\r\n player.calculateValidGiveTargets();\r\n }\r\n}", "function create_player_areas(){\n var $player_area = $('.players_cards');\n for(var i = 0; i < num_players; i++){\n var $player = $('<div>').addClass('player').addClass(`player_${i}`);\n $player.append(create_player_chip(i));\n // only for diagnostics\n // var $best_hand = $('<div>').addClass('best_hand');\n // $player.append($best_hand);\n $player_area.append($player);\n }\n }", "constructor(players) {\n this.players = players;\n\n if(players.length > 6){\n throw 'max number of players is 6';\n }\n\n for (let i = 0; i< this.players.length; i++) {\n this.players[i].color = this.colors[i];\n }\n\n this.playerTurn = this.players[0];\n this.calculateSoldiersToPut();\n\n this.cards = [...cards];\n this.shuffleCards()\n\n this.currentState = gameState.newGame;\n }", "initializeForPuzzle () {\n this.players = []\n for (let p = 0; p < DrMario.NUM_PLAYERS; ++p) {\n let field = null\n let upcomingPieces = null\n if (p == 0) {\n field = DrMarioPuzzleData.drMarioPuzzlePlayer1Field\n upcomingPieces = DrMarioPuzzleData.drMarioPuzzlePlayer1UpcomingPieces\n } else if (p == 1) {\n field = DrMarioPuzzleData.drMarioPuzzlePlayer2Field\n upcomingPieces = DrMarioPuzzleData.drMarioPuzzlePlayer2UpcomingPieces\n }\n // TODO: Don't hardcode the player type.\n this.players.push(new Player(p == 0 ? Player.playerTypeEnum.HUMAN : Player.playerTypeEnum.COMPUTER, field, upcomingPieces))\n }\n }", "update() {\n let newPlayers = this.api.fetchPlayers();\n newPlayers.forEach(player => {\n var current_player = this.players.find(p => {\n return p.id == player.id;\n })\n if (current_player != null) {\n current_player.Update(player, this.viewport)\n } else {\n this.players.push(new Player(\n player.id,\n player.posX,\n player.posY,\n player.name,\n ))\n }\n });\n\n let self = this;\n let index = 0;\n this.players.forEach(player => {\n var current_player = newPlayers.find(p => {\n return p.id == player.id;\n })\n if (current_player == null) {\n $(\"#\"+player.id).remove();\n self.players.splice(index, 1);\n }\n index++;\n });\n }", "function initPlayerObjects() {\n var numfriendlyPlayers = 1;\n\n for (var i = 0; i < numfriendlyPlayers; i++) {\n // Create new star and push it to the friendlyPlayers array\n friendlyPlayers.push(new Player((i / numfriendlyPlayers) * 5.0, i / numfriendlyPlayers));\n }\n}", "constructor(game, textureMeta, players) {\n this.game = game;\n this.textureOffsets = textureMeta;\n this.players = {\n 'player': {\n src: '/textures/player.png'\n },\n 'substack': {\n src: '/textures/substack.png'\n },\n 'viking': {\n src: '/textures/viking.png'\n }\n };\n //game.players;\n\n this.byName = {};\n this.byValue = {};\n\n /*\n // Prepare name and value mapping\n for (var i = 0; i < textureArray.length; i++) {\n var texture = textureArray[i];\n this.byValue[texture.value] = texture;\n this.byName[texture.name] = texture;\n }\n */\n }", "addPlayer(firstName, lastName, age) {\n let player = {\n firstName: firstName,\n lastName: lastName,\n age: age\n }\n this.players.push(player);\n }", "function generatePlayerIndex(players) {\r\n let playerNumbers = [];\r\n while ( playerNumbers.length < players ) {\r\n var newIndex = (generateRandom(0, players)) - 1;\r\n if (playerNumbers.indexOf(newIndex) == -1) {\r\n playerNumbers.push(newIndex);\r\n }\r\n }\r\n return playerNumbers;\r\n }", "function generate(oldPlayers) {\r\n var newPlayers = [];\r\n for (let i = 0; i < oldPlayers.length; i++) {\r\n // Select a player based on fitness\r\n var player = poolSelection(oldPlayers);\r\n newPlayers[i] = player;\r\n }\r\n return newPlayers;\r\n }", "function addplayers() {\n for (let i in grid) {\n for (let d in grid[i]) {\n if (grid[i][d] == players[0]) {\n x(i,d);\n } else if (grid[i][d] == players[1]) {\n o(i,d);\n }\n }\n }\n}", "function makePlayerMap(players) {\n var playerMap = {};\n for (var i = 0; i < players.length; i++) {\n playerMap[players[i]._id] = {shortID : players[i].shortID, name : players[i].player_name};\n }\n return playerMap;\n}", "addOtherPlayer(playerInfo) {\n const randomColor = Math.floor(Math.random()*16777215);\n const otherPlayer = this.add.image(100, playerInfo.y, 'player').setTint(randomColor);\n if(playerInfo.isActive) {\n otherPlayer.alpha = 0.3;\n console.log('activejoined')\n } else {\n console.log('inactivejoined');\n otherPlayer.alpha = 0.0;\n }\n otherPlayer.playerInfo = playerInfo;\n //add player to the group defined above\n this.otherPlayers.add(otherPlayer);\n if(this.player){\n this.player.setDepth(1)\n }\n\n }", "addPlayer(playerObject) {\n if(this.playersArray.length === 0) {\n this.playersArray.push(playerObject);\n console.log('initialized first player');\n return;\n }\n for(let i = 0; i < this.playersArray.length; i++) {\n if (this.playersArray[i].jersey > playerObject.jersey) {\n this.playersArray.splice(i, 0, playerObject);\n console.log(`spliced a game in the ${i}th position`);\n return;\n }\n }\n this.playersArray.splice(this.playersArray.length, 0, playerObject);\n console.log(`spliced a player at the end`);\n }", "function onNewPlayer (data) {\n\n var newPlayer;\n // Create a new player\n if(playerById(this.id)){\n newPlayer = playerById(this.id);\n } else {\n newPlayer = new Player(this.id)\n }\n\n if(pcByPlayerName(data.name) == false){\n //newPlayer.PC = pcByPlayerName('TEMPDEFAULT');\n //console.log('USING TEMPDEFAULT USER ' + newPlayer.PC.name);\n console.log('USER ' + this.id + ' NEEDS TO CREATE NEW CHARACTER');\n\n socket.to(this.id).emit('create new character', {id: newPlayer.id});\n return;\n } else {\n //newPlayer.PC = pcByPlayerName(data.name);\n //players.push(newPlayer)\n //newPlayer.PC = pcByPlayerName(data.name);\n socket.to(this.id).emit('start mud', {id: this.id}); //Goes to onPlayerStarted\n\n }\nreturn;\n}", "addNewPlayer(playerName) {\n if (!this.started) {\n let newPlayer = new Player(playerName, this);\n this.players[newPlayer.id] = newPlayer;\n this.emit('userchange');\n return newPlayer;\n }\n }", "function preparePlayerInfo(newPlayer) {\n // var newPlayer = $(\".playerName-input\");\n console.log(\"theLeague II: \", theLeague);\n\n newPlayerObj = {\n playerName: newPlayer.val().trim(),\n commander: 0,\n points: 0,\n LeagueId: theLeague.id\n };\n newPlayer.val(\"\");\n addPlayer(newPlayerObj);\n }", "function getPlayers() {\n $.get(\"/api/players\", function(data) {\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createPlayerRow(data[i]));\n }\n renderPlayerList(rowsToAdd);\n nameInput.val(\"\");\n passInput.val(\"\");\n steamID.val(\"\");\n });\n }", "function createPlayers() {\n var currentPlayer = me ? me : 0;\n $(\"#botPlayer\").html(playerHtml(currentPlayer));\n $(\"#p\" + me).sortable();\n $(\"#pt\" + me).prop(\"contenteditable\",true).blur(function() {\n var data = {type:\"change\",name:$(this).html()};\n connection.send(JSON.stringify(data));\n });\n currentPlayer = (currentPlayer + 1) % 4;\n $(\"#rightPlayer\").html(\"<div class='boardSide sideHolder'><div id='rightSide' class='rotate270'>\" + playerHtml(currentPlayer) + \"</div></div>\");\n currentPlayer = (currentPlayer + 1) % 4;\n $(\"#topPlayer\").html(\"<div class='sideHolder'><div class='rotate180'>\" + playerHtml(currentPlayer) + \"</div></div>\");\n currentPlayer = (currentPlayer + 1) % 4;\n $(\"#leftPlayer\").html(\"<div class='boardSide sideHolder'><div id='leftSide' class='rotate90'>\" + playerHtml(currentPlayer) + \"</div></div>\");\n\n var height = $(\"#botPlayer\").height();\n var width = $(\"#botPlayer\").width();\n\n $(\".boardSide\").width(height).height(width);\n $(\"#rightSide\").width(width).height(height);\n $(\"#leftSide\").width(width).height(height);\n}", "function generate_player_data(player_id) {\n\tvar cards = genShuffledDeck();\n\tvar i;\n\tvar pile = [];\n\tvar home = [];\n\tvar zones = [[],[],[],[]];\n\t\n/*\tfor (i=0; i<52; i++)\n\t\tif (cards[i] % 13 == 0) {\n\t\t\tvar t = cards[i];\n\t\t\tcards[i] = cards[3];\n\t\t\tcards[3] = t;\n\t\t\tbreak;\n\t\t}\n*/\n\n\tfor (i=0;i<13;i++) pile[i] = cards.pop();\n\tfor (i=0;i<35;i++) home[i] = cards.pop();\n\tfor (i=0;i<4;i++) zones[i][0] = cards.pop();\n\tvar player = {\n\t\tid: player_id,\n\t\tscore: 0,\n\t\tstandby: false,\n\t\trequested_end: false,\n\t\tpile: pile,\n\t\thome: home,\n\t\tcut: 32,//Player can see home[cut](top) to home[bot](bottom)\n\t\tbot: 34,\n\t\tzones: zones,\n\n\t\tget_overview: function(){\n\t\t\treturn {\n\t\t\t\tname: map_id_to_name[this.id],\n\t\t\t\tscore: this.score,\n\t\t\t\trequested_end: this.requested_end,\n\t\t\t\tpile: this.pile[this.pile.length-1],\n\t\t\t\tpile_count: this.pile.length,\n\t\t\t\thome_count: this.cut,\n\t\t\t\thomeside: this.home.slice(this.cut, this.bot+1).reverse(),\n\t\t\t\tzones: this.zones,\n\t\t\t};\n\t\t},\n\t\thomenext: function(){\n\t\t\tthis.bot = this.cut-1;\n\t\t\tif (this.cut == 0)\n\t\t\t\tthis.cut = this.home.length;\n\t\t\telse {\n\t\t\t\tthis.cut -= 3;\n\t\t\t\tif (this.cut < 0) this.cut = 0;\n\t\t\t}\n\t\t},\n\t\tmove: function(srcz, srcf, dstz){\n\t\t\tvar srccard = this.get_card_value(srcz, srcf);\n\t\t\tvar dstcard = this.zones[dstz][this.zones[dstz].length-1];\n\t\t\tconsole.log('move '+srccard+' to '+dstcard);\n\t\t\tif (dstcard >= 0 && dstcard <=51) {\n\t\t\t\tif ((srccard+1+39-dstcard)%26 != 0 || srccard % 13 == 12) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (srcz < 4) {\n\t\t\t\tthis.zones[dstz] = this.zones[dstz].concat(this.zones[srcz].splice(srcf, this.zones[srcz].length-srcf));\n\t\t\t}\n\t\t\telse if (srcz == 4) {\n\t\t\t\tthis.zones[dstz] = this.zones[dstz].concat(this.home.splice(this.cut, 1));\n\t\t\t\tif (this.bot > this.cut) this.bot -= 1;\n\t\t\t}\n\t\t\telse if (srcz == 5) {\n\t\t\t\tthis.zones[dstz].push(this.pile.pop());\n\t\t\t\tthis.score += 2;\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\tget_card_value: function(z, f){\n\t\t\tif (z < 4)\n\t\t\t\treturn this.zones[z][f];\n\t\t\telse if (z == 4)\n\t\t\t\treturn this.home[this.cut];\n\t\t\telse if (z == 5)\n\t\t\t\treturn this.pile[this.pile.length-1];\n\t\t},\n\t\tabandon: function(z){\n\t\t\tif (z < 4) {\n\t\t\t\tif (this.zones[z].length > 0) {\n\t\t\t\t\tthis.zones[z].pop();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.error('Abandoning a nonexistent card!');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (z == 4) {\n\t\t\t\tif (this.cut < home.length && this.cut >= 0) {\n\t\t\t\t\tthis.home.splice(this.cut, 1);\n\t\t\t\t\tif (this.bot > this.cut) this.bot -= 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.error('Abandoning a nonexistent card!');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse if (z == 5) {\n\t\t\t\tif (this.pile.length > 0) {\n\t\t\t\t\tthis.pile.pop();\n\t\t\t\t\tthis.score += 2;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.error('Abandoning a nonexistent card!');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.error('Abandoning a nonexistent card!');\n\t\t\t}\n\t\t},\n\t};\n\treturn player;\n}", "addNewPlayer(name, id) {\n this.players.push(new Player(id, name));\n }", "draw(){\n for(var team of this.teams){\n var team_dom = document.getElementById(team.name);\n if(team_dom == null){\n var teamContainerLeft = document.getElementById(\"team-container-left\");\n var teamContainerRight = document.getElementById(\"team-container-right\");\n var template = document.getElementById(\"team-template\"); \n var clone = template.content.cloneNode(true).children[0];\n clone.id = team.name;\n var nametag = clone.getElementsByClassName(\"team-name\")[0]\n nametag.innerHTML = team.name;\n\n var teamContainer = null;\n if(teamContainerLeft.children.length > teamContainerRight.children.length){\n teamContainer = teamContainerRight;\n }else{\n teamContainer = teamContainerLeft;\n }\n teamContainer.append(clone)\n team_dom = clone;\n }\n\n\n var gks = team_dom.getElementsByClassName(\"picked-gks\")[0]\n var defs = team_dom.getElementsByClassName(\"picked-defs\")[0]\n var mids = team_dom.getElementsByClassName(\"picked-mids\")[0]\n var fwds = team_dom.getElementsByClassName(\"picked-fwds\")[0]\n\n for(var player of team.players){\n if(document.getElementById(player.id) != null){\n continue;\n }\n var div = document.createElement(\"div\");\n div.id = player.id;\n var shirtImg = document.createElement(\"img\");\n shirtImg.src = player.getShirtUrl();\n var playerStr = player.name + \" (\" + player.team + \")\";\n div.append(shirtImg);\n div.append(playerStr);\n\n if(player.pos == \"GK\"){\n gks.append(div);\n }else if(player.pos == \"DEF\"){\n defs.append(div);\n }else if(player.pos == \"MID\"){\n mids.append(div)\n }else if(player.pos == \"FWD\"){\n fwds.append(div)\n }else{\n console.log(\"NO POS???\");\n }\n }\n }\n }", "function addNewPlayer(id, name) {\n var i = true;\n var color;\n while (i) {\n color = '#'+(Math.random().toString(16)+'000000').slice(2,8);\n if (color != deadColor) {\n i = false; \n }\n }\n // TODO: check if start position is valid\n var x = Math.floor(Math.random()*gridWidth*tileLength);\n var y = Math.floor(Math.random()*gridHeight*tileLength);\n var newPlayer = { id:id, x:x, y:y, name:name, speed:125, color:color, powerup:'house', connected:true, captured:0 };\n users[id] = newPlayer;\n scores[id] = 0;\n leaderboard.push(id); // Remove this later\n startTime = new Date();\n return newPlayer;\n}", "function Player(){\n this.name\n this.grid = createPlayerGrid() // 1 == Ship // 0 == No Ship\n this.placedShips = AMOUNT_SHIPS\n this.score = 0\n}", "speciate() {\n //Reset vrsti\n for (let s of this.species) {\n s.players = [];\n }\n for (let i = 0; i < this.players.length; i++) {\n let speciesFound = false;\n for (let s of this.species) {\n if (s.sameSpecies(this.players[i].brain)) {\n //Ako je igrac dovoljno slican da pripadne toj vrsti\n s.addToSpecies(this.players[i]);\n speciesFound = true;\n break;\n }\n }\n if (!speciesFound) {\n //Ako igrac nije slican ni jednoj vrsti, dodaj ga kao sampiona nove vrste\n this.species.push(new Species(this.players[i]));\n }\n }\n }", "construct_player() {\n this.player = new Player(this);\n this.player.x = 208;\n this.player.y = 800;\n this.nubs = this.add.group();\n this.left_nub = this.physics.add.sprite(this.player.x - 17, this.player.y).setBodySize(3, 3);\n this.nubs.add(this.left_nub);\n this.right_nub = this.physics.add.sprite(this.player.x + 17, this.player.y).setBodySize(3, 3);\n this.nubs.add(this.right_nub);\n this.up_nub = this.physics.add.sprite(this.player.x, this.player.y - 17).setBodySize(3, 3);\n this.nubs.add(this.up_nub);\n this.down_nub = this.physics.add.sprite(this.player.x, this.player.y + 17).setBodySize(3, 3);\n this.nubs.add(this.down_nub);\n\n }", "function setPlayers(players, teamId, hostOrGuest) {\n let content = \"\";\n // Clear prevous players\n $(\".\" + hostOrGuest + \"-players\").html(\"\");\n if (players !== undefined && Array.isArray(players) && players.length !== 0) {\n for (let i = 0, len = players.length; i < len; i++) {\n content += '<div class=\"form-check\">';\n content += '<input class=\"form-check-input\" type=\"checkbox\" name=\"player-team-' + teamId + '\" id=\"' + hostOrGuest + '-player-' + players[i].id + '\" value=\"' + players[i].id + '\">';\n content += '<label class=\"\" for=\"' + hostOrGuest + '-player-' + players[i].id + '\">' + players[i].name + '</label>';\n content += '</div>';\n }\n }\n // Set new players\n $(\".\" + hostOrGuest + \"-players\").html(content);\n }", "function renderPlayers(){\n for( var key in shipPlayers){\n shipPlayers[key].renderShip();\n }\n }", "sendPos()\n {\n for(const playerId in this.players)\n {\n const data = []\n const player = this.players[playerId]\n data.push({\n name: player.name,\n color: player.color,\n position: player.engineObject.position,\n musicInfo: player.musicInfo\n })\n for(const nearPlayer of player.getNearPlayers(300))\n {\n data.push({\n id: nearPlayer.id,\n name: nearPlayer.name,\n color: nearPlayer.color,\n position: nearPlayer.engineObject.position,\n musicInfo: nearPlayer.musicInfo,\n energy: nearPlayer.energy\n })\n }\n player.socket.emit('updatePlayer', data)\n }\n }", "function generatePlayers() {\n return core.user.get(bogusPlayerIDs[0])\n .then(function(user) {\n if (!user) {\n return Promise.map(bogusPlayerIDs, function(id, index) {\n return new db.models.User({\n id: id,\n email: 'bogus' + (index + 1) + '@bogus.com'\n }).save(null, { method: 'insert' });\n });\n }\n else {\n return Promise.resolve(0);\n }\n });\n}", "function addPlayer(id) {\n players[id] = new Player(random(width), random(height), id);\n while (players[id].collidingWithAnyStructure()) {\n players[id] = new Player(random(width), random(height), id);\n }\n ids.push(id);\n}", "function placePlayer(player){\n\nlet row = randomRowColumnNumber(9);\nlet col = randomRowColumnNumber(9);\nlet gridItem = $(`[data-col=\"${col}\"][data-row=\"${row}\"]`);\nif( gridItem.hasClass('full') ) {\n \n return placePlayer(player);\n}\n\ngridItem.addClass('full').addClass(player.playerType);\nplayer.playerPos.row = row;\nplayer.playerPos.col = col;\n\n\n}", "get players() { return this.#runtime_.players; }", "playerTeamAttribution() {\r\n this.players = shuffle(this.players);\r\n const size = this.players.length;\r\n for (let i=0; i<size; i++) {\r\n if (i < Math.floor(size/2)) {\r\n this.players[i].team = 'red';\r\n } else {\r\n this.players[i].team = 'blue';\r\n }\r\n }\r\n }", "function createPlayersUI() {\n document.getElementById('players').innerHTML = '';\n for (var i = 0; i < players.length; i++) {\n //Create DOM elements \n var div_player = document.createElement('div');\n var div_playerid = document.createElement('div');\n var div_hand = document.createElement('div');\n var div_points = document.createElement('div');\n\n div_points.className = 'points';\n div_points.id = 'points_' + i;\n div_player.id = 'player_' + i;\n div_player.className = 'player';\n div_hand.id = 'hand_' + i;\n\n div_playerid.innerHTML = players[i].ID;\n div_player.appendChild(div_playerid);\n div_player.appendChild(div_hand);\n div_player.appendChild(div_points);\n document.getElementById('players').appendChild(div_player);\n }\n}", "function loadPlayers() {\n //console.log('IN LOAD PLAYERS');\n\n\n storedPlayers =\n JSON.parse(window.localStorage.getItem('players'));\n\n if (storedPlayers !== 0) {\n\n players = storedPlayers;\n }\n else {\n player.cheeseBricks = 100;\n player.currentCheeseBricks = 100;\n players.push(player);\n savePlayer();\n\n }\n}", "async _addPlayer() {\n this.arena.player = await new Player({\n playerProps: this.config.playerProps,\n container: this.stage.container(),\n layer: this.layer,\n onScreenUpdate: this._onScreen.bind(this),\n commands: this.commands,\n }).init()\n\n for (let children in this.arena.player.sprite.getChildren()) {\n let child = this.arena.player.sprite[children];\n\n if (child.top || child.middle || child.lower) {\n for (let headgear in child) {\n this.layer.add(child[headgear]);\n }\n } else {\n this.layer.add(child);\n }\n\n }\n\n this._updateFrame();\n this.arena.player.sprite.start();\n }", "static giveAPlayerATurn() {\n for (let i = 0; i < this.players.length; i++) {\n if (!this.hasPlayerHadTurn(i)) {\n this.playTurn(i);\n return;\n }\n }\n }", "addPlayers(){\n // current players obj\n this.players = this.props.games[this.props.params.id].players;\n Object.keys(this.players).forEach((id, i)=>{\n // if current player color is white otherwise blue\n const color = (id === this.props.userkey) ? 0xffffff : 0x0000ff;\n // if player is not included in playerlist add graphics\n if(!this.playerlist.includes(id)){\n this[`player_${id}`] = new PIXI.Graphics();\n const player = this[`player_${id}`];\n player.beginFill(color);\n player.drawCircle(0, 0, 16);\n player.endFill();\n player.x = this.players[id].x;\n player.y = this.players[id].y;\n player.vx = 0;\n player.vy = 0;\n this[`player_${id}`].accelx = 0;\n this[`player_${id}`].accely = 0;\n this[`player_${id}`].playerstate = 'NOT_IT';\n const fontstyle = {\n fontFamily: \"Arial\",\n fontSize: 20,\n fontFill: 0xffffff //for some reason text always appears black\n }\n // players username attached to player\n this[`text_${id}`] = new PIXI.Text(this.props.users[id].username, fontstyle);\n this[`text_${id}`].x = this.players[id].x;\n this[`text_${id}`].y = this.players[id].y - 48;\n this.gameScene.addChild(this[`text_${id}`]);\n this.gameScene.addChild(player);\n this.playerlist.push(id);\n }\n });\n }", "addPlayer(player) {\n this.players.push(player);\n this.scores[player.id] = 0;\n }", "function convertToPlayerClass(players) {\n var newPlayers = [];\n for (let i = 0; i < players.length; i++) {\n newPlayers.push(new Player(players[i]));\n }\n return newPlayers;\n}", "function playerCreate(characters){\n\tplayers = characters.map(function(letter, index){\n\t\treturn new Player(index, sanitizeInputs(letter));\n\t}); \n\treturn players;\n}", "function populateScreenPlayers(notablePlayersObj) {\n for (var i = 0; i < notablePlayersObj.length; i++) {\n if (notablePlayersObj[i].name) {\n let playerOnScreen = \"<h4 id=\" + notablePlayersObj[i].account_id + \">\" + notablePlayersObj[i].name + \"</h4>\";\n $('footer').append(playerOnScreen);\n let gamesPlayed = '<h4 class=standard>' + notablePlayersObj[i].games_played + '</h4>';\n $('footer2').append(gamesPlayed);\n animatePlayer(notablePlayersObj[i].account_id);\n }\n }\n }", "getAllPlayers(){\n var allPlayers = [];\n for(var i = 0; i < this.teams.length; i++){\n var team = this.teams[i];\n for(var j = 0; j < team.players.length; j++){\n var player = team.players[j];\n allPlayers.push(player);\n }\n }\n return allPlayers;\n }", "function syncPlayer() {\n\t\t$scope.players = $scope.room.game.players;\n\t\t$scope.room.game.players.forEach(function(player, ind) {\n\t\t\tif (player.user.name === $routeParams['user']) {\n\t\t\t\t$scope.player = player;\n\t\t\t}\n\t\t});\n\t}", "killsPlayers() {\n\n GameElements.players.forEach(player => {\n //Comprueba si el centro de la explosion mata a jugadores \n if (player.isInsideElement(player.xPos, player.yPos, this)\n && player.isDead == false) {\n //Mata a un jugador si aun esta vivo\n player.isDead = true;\n player.dropItems();\n }\n //Comprueba si las llamas de la exlosion matan a jugadores\n this.flames.forEach(flame => {\n if (player.isInsideElement(player.xPos, player.yPos, flame)\n && player.isDead == false) {\n //Mata a un jugador si aun esta vivo \n player.isDead = true;\n player.dropItems();\n }\n });\n });\n\n }" ]
[ "0.7199472", "0.7172245", "0.6963491", "0.68712753", "0.67852336", "0.6767366", "0.6744942", "0.6645938", "0.6625114", "0.66124725", "0.66082346", "0.6561628", "0.6559118", "0.65578765", "0.65509635", "0.6544635", "0.65433", "0.6534485", "0.6530251", "0.65182483", "0.6509511", "0.64859194", "0.6474406", "0.64582676", "0.6456642", "0.64506817", "0.64457965", "0.6440558", "0.6420147", "0.6391238", "0.63816285", "0.63813794", "0.6354464", "0.6350329", "0.6347962", "0.6347962", "0.6345544", "0.63420415", "0.6339506", "0.63341933", "0.6323584", "0.6320598", "0.63169897", "0.6315842", "0.6307959", "0.6306931", "0.6303923", "0.6302469", "0.63009167", "0.62990624", "0.6296", "0.62851167", "0.627814", "0.6266773", "0.62486416", "0.62117404", "0.62054193", "0.6205045", "0.62050015", "0.6199297", "0.61960274", "0.6184001", "0.6177146", "0.6173136", "0.61728734", "0.61601645", "0.61287695", "0.6116547", "0.6111864", "0.6103487", "0.60990894", "0.6088464", "0.60876185", "0.6085528", "0.60818964", "0.6078185", "0.6075931", "0.6070948", "0.60676503", "0.606384", "0.60624695", "0.6059933", "0.6058309", "0.60535663", "0.6051192", "0.6034354", "0.60281265", "0.6021298", "0.6019977", "0.6018722", "0.6015543", "0.60151196", "0.6014902", "0.60064435", "0.6001013", "0.5991816", "0.59910583", "0.59904385", "0.598502", "0.5984227", "0.59824264" ]
0.0
-1
Podeli igrace u vrste u odnosu na to koliko se razlikuju od najboljeg u vrsti
speciate() { //Reset vrsti for (let s of this.species) { s.players = []; } for (let i = 0; i < this.players.length; i++) { let speciesFound = false; for (let s of this.species) { if (s.sameSpecies(this.players[i].brain)) { //Ako je igrac dovoljno slican da pripadne toj vrsti s.addToSpecies(this.players[i]); speciesFound = true; break; } } if (!speciesFound) { //Ako igrac nije slican ni jednoj vrsti, dodaj ga kao sampiona nove vrste this.species.push(new Species(this.players[i])); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function naVrsti() {\n // Preveri za konec igre\n let zm = await zmagovalec();\n if (zm != \"undefined\") {\n if (Number(zm) == igralec) {\n location.replace('/igra/zmaga');\n } else {\n location.replace('/igra/zguba');\n }\n return;\n }\n\n // Posodobi stanje bitke\n await zapolniTabelo();\n\n lahkoNapada = true;\n\n document.getElementById(\"besedilo\").innerText = \"Tunkaj ladje!\";\n document.getElementById(\"hnapad\").classList.add(\"border-info\");\n document.getElementById(\"hdomace\").classList.remove(\"border-info\");\n }", "function graczOberwal() {\r\n\r\n\t\t\t\t//zabieranie rebulla:\r\n\t\t\t\tif (DD_predkoscPocztkowaGracza >= 250) {\r\n\t\t\t\t\tDD_predkoscPocztkowaGracza -= 125;\r\n\t\t\t\t\tgracz.twoway(DD_predkoscPocztkowaGracza); //redukuj predkosc gracza\r\n\t\t\t\t\tDD_obrazeniaPocikskowGracz -= 0.05; //zredukuj obrazenia zadawane przez pociski gracza\r\n\r\n\t\t\t\t\t//dodaj napis o redukcji rebulla:\r\n\t\t\t\t\tvar bonusTekst = Crafty.e(\"2D, Canvas, Text, Delay, Motion\")\r\n\t\t\t\t\t\t.attr({ x: gracz.x - 25, y: gracz.y, z: 98 })\r\n\t\t\t\t\t\t.text('- REBULL')\r\n\t\t\t\t\t\t.textColor('gray')\r\n\t\t\t\t\t\t.textFont({ size: '15px', weight: 'bold' })\r\n\t\t\t\t\t\t.bind('EnterFrame', function (e) {\r\n\t\t\t\t\t\t\tthis.alpha -= 0.01;\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\t.delay(function () {\r\n\t\t\t\t\t\t\tthis.destroy();\r\n\t\t\t\t\t\t}, 1500, 0)\r\n\t\t\t\t\t\t;\r\n\t\t\t\t\tbonusTekst.velocity().y = -50;\r\n\r\n\t\t\t\t}\r\n\t\t\t\tif (DD_buforStrzalu <= 5) {\r\n\t\t\t\t\tDD_buforStrzalu += 1; //redukuj szybkosztrzelnosc\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//czerwona maska przy oberwaniu od przeciwnika:\r\n\t\t\t\tvar boli = Crafty.e('2D, Canvas, Image, Renderable, Delay')\r\n\t\t\t\t\t.attr({ x: 0, y: 0, w: 500, h: 300 })\r\n\t\t\t\t\t.image(\"assets/obrazki/ouch2.png\", \"no-repeat\")\r\n\t\t\t\t\t.delay(function () {\r\n\t\t\t\t\t\tthis.destroy();\r\n\t\t\t\t\t}, 150, 0)\r\n\t\t\t\t\t;\r\n\t\t\t\t// intensywnosc maski zalezy od ilosci pozostalego zycia:\r\n\t\t\t\tboli.alpha = (1 / gracz.zycie) * DD_fala;\r\n\t\t\t\treturn;\r\n\t\t\t}", "function pokreniKviz(){\r\n // niz koji popunjavamo tekstom pitanja i ponudjenim odgovorima\r\n // niz ce sadrzati HTML elemente\r\n const output = [];\r\n // prolazimo petljom kroz sve elemente niza pitanja\r\n // uzimamo pitanje koje je aktuelno u trenutnoj iteraciji i njegov indeks\r\n pitanja.forEach(function(trenutnoPitanje, pitanjeInd){\r\n // niz koji cemo popuniti odgovorima na trenutno pitanje\r\n const odgovori = []; \r\n // petlja koja prolazi svim odgovorima trenutnog pitanja\r\n for(slovo in trenutnoPitanje.odgovori){\r\n // u niz odgovora dodajemo HTML kod za prikaz ponudjenog odgovora\r\n // inputi za odgovor na isto pitanje moraju imati isti name atribut\r\n // odradjujemo da svaki od njih ima name=\"odogovor\"+indeks_trenutnog_pitanja\r\n // na taj nacin ce svi ponudjeni odgovori na pitanje sa indeksom 1 imati name=\"odgovor1\"\r\n // vrijednost odgovora je upravo ono slovo pod kojim je on i ponudjen\r\n // tekst je oblika: \" a : tekst_odgovora \"\r\n odgovori.push(\r\n `<label>\r\n <input type=\"radio\" name=\"odgovor${pitanjeInd}\" value=\"${slovo}\" >\r\n ${slovo} : ${trenutnoPitanje.odgovori[slovo]}\r\n </label>`\r\n );\r\n }\r\n // na kraju u output niz koji sadrzi sva pitanja i ponudjene odgovore dodajemo trenutno\r\n // trenutnoPitanje.pitanje je tekst pitanja\r\n // funkcija join od niza pravi string\r\n output.push(\r\n `\r\n <div class=\"pitanje\">${trenutnoPitanje.pitanje}</div>\r\n <div class=\"odgovori\"> ${odgovori.join('')} </div>\r\n `\r\n );\r\n });\r\n // na kraju popunjavamo div za prikaz pitanja i odgovora\r\n kvizDiv.innerHTML = output.join('');\r\n}", "function preberiMeritveVitalnihZnakov() {\n\tsessionId = getSessionId();\n \n \n\tvar ehrId = $(\"#meritveVitalnihZnakovEHRid\").val();\n\t\n\t// Spodaj poskrbimo da so vrednosti ponovno \"\", ko izberemo drugega pacienta\n\t//prav tako ponovno skrijemo vrednosti, tako da se pokazejo sele ob pritisku na gumb\n document.getElementById(\"wikiTextBloodPressure\").innerHTML = \"\";\n document.getElementById(\"wikiTextDeath\").innerHTML = \"\";\n document.getElementById(\"wikiTextItm\").innerHTML = \"\";\n document.getElementById(\"wikiTextTveganja\").innerHTML = \"\";\n document.getElementById(\"wikiTextZdravje\").innerHTML = \"\";\n $(\"#wikiTextTveganja2\").html(\"\"); //lazje kot document.getelement blabla\n $(\"#wikiDetails\").hide();\n\n\tif (!ehrId || ehrId.trim().length == 0 ) {\n\t\t$(\"#preberiMeritveVitalnihZnakovSporocilo\").html(\"<span class='obvestilo \" +\n \"label label-warning fade-in'>Prosim vnesite zahtevan podatek!\");\n\t} else {\n\t \n\t\n\t\t$.ajax({\n\t\t\turl: baseUrl + \"/demographics/ehr/\" + ehrId + \"/party\",\n\t \ttype: 'GET',\n\t \theaders: {\"Ehr-Session\": sessionId},\n\t \tsuccess: function (data) {\n\t\t\t\tvar party = data.party;\n\t\t\t\t\n\n\t\t\t\t//pridobimo srcni utrip\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t url: baseUrl + \"/view/\" + ehrId + \"/\" + \"pulse\",\n\t\t\t\t\t type: 'GET',\n\t\t\t\t\t headers: {\"Ehr-Session\": sessionId},\n\t\t\t\t\t success: function (res) {\n\t\t\t\t var hintUtrip = \"<br>\";\n\t\t\t\t \n\t\t\t\t if (res[res.length-1].pulse > 100)\n\t\t\t\t \thintUtrip += \"<p class='bg-danger'>Vaš srčni utrip je povišan. Optimalen srčni utrip znaša 50 - 100 /min</p>\"\n\t\t\t\t \telse if (res[res.length-1].pulse < 50)\n\t\t\t\t hintUtrip += \"<p class='bg-danger'>Vaš srčni utrip je nizek. Optimalen srčni utrip znaša 50 - 100 /min/p>\"\n\t\t\t\t else\n\t\t\t\t \thintUtrip += \"<p class='bg-success'> Vaš srčni utrip je optimalen </p>\"\n\t\t\t\t \n\t\t\t\t\t document.getElementById('utrip').innerHTML = \"Vaš srčni utrip znaša \" + res[res.length-1].pulse + \" /min\" + hintUtrip;\n\t\t\t\t\t document.getElementById('utripNumber').innerHTML = res[res.length-1].pulse;\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t preveri() //pri vsakem klicu gremo v funkcijo \"preveri\", katera caka da se izvedejo vsi tej klici, potem pa nadaljuje z graficnim prikazom\n\t\t\t\t\t \n\t\t\t\t\t },\n\t\t\t\t\t});\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//zacetek ajaxa za tezo\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t url: baseUrl + \"/view/\" + ehrId + \"/\" + \"weight\",\n\t\t\t\t\t type: 'GET',\n\t\t\t\t\t headers: {\"Ehr-Session\": sessionId},\n\t\t\t\t\t success: function (res) {\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t document.getElementById('teza').innerHTML = \"<p class='bg-info'>Vaša teža znaša \" + res[res.length-1].weight + \" kg </p>\"\n\t\t document.getElementById('tezaNumber').innerHTML = res[res.length-1].weight;\n\t\t preveri()\n\t\t\t\t\t },\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t//zacetek ajaxa za zgornji tlak\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t url: baseUrl + \"/view/\" + ehrId + \"/\" + \"blood_pressure\",\n\t\t\t\t\t type: 'GET',\n\t\t\t\t\t headers: {\"Ehr-Session\": sessionId},\n\t\t\t\t\t success: function (res) {\n\t\t\t\t\t var hintTlak = \"<br>\";\n\t\t\t\t\t \n\t\t\t\t\t \tif (res[res.length-1].systolic > 140)\n\t\t\t\t\t \t\thintTlak += \" <p class='bg-danger'>Vaš zgornji krvni tlak je povišan. Optimalen sistolični tlak znaša 100 - 140 mm Hg</p>\"\n\t\t\t\t\t \telse if (res[res.length-1].systolic < 100)\n\t\t\t\t\t \t\thintTlak += \" <p class='bg-danger'>Vaš zgornji krvni tlak je nizek. Optimalen sistolični tlak znaša 100 - 140 mm Hg</p>\"\n\t\t\t\t\t \telse\n\t\t\t\t\t \t\thintTlak += \"<p class='bg-success'>Vaš zgornji krvni tlak je optimalen </p>\"\n\t\t\t\t\t \t\n\t\t\t\t\t \t\n\t\t document.getElementById('zgornjiTlak').innerHTML = \"Vaš zgornji krvni pritisk znaša \" + res[res.length-1].systolic + \" mm Hg\" + hintTlak\n\t\t document.getElementById(\"zgornjiTlakNumber\").innerHTML = res[res.length-1].systolic;\n\t\t preveri()\n\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//zacetek ajaxa za spodnji tlak\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t url: baseUrl + \"/view/\" + ehrId + \"/\" + \"blood_pressure\",\n\t\t\t\t\t type: 'GET',\n\t\t\t\t\t headers: {\"Ehr-Session\": sessionId},\n\t\t\t\t\t success: function (res) {\n\t\t\t\t\t \tvar hintSpodnji = \"<br>\"\n\t\t\t\t\t \t\n\t\t\t\t\t \tif (res[res.length-1].diastolic > 90)\n\t\t\t\t\t \t\thintSpodnji += \" <p class='bg-danger'>Vaš spodnji krvni tlak je povišan. Optimalen diastolični tlak znaša 60 - 90 mm Hg</p>\"\n\t\t\t\t\t \telse if (res[res.length-1].systolic < 60)\n\t\t\t\t\t \t\thintSpodnji += \" <p class='bg-danger'>Vaš spodnji krvni tlak je nizek. Optimalen diastolični tlak znaša 60 - 90 mm Hg</p>\"\n\t\t\t\t\t \telse\n\t\t\t\t\t \t\thintSpodnji += \"<p class='bg-success'>Vaš spodnji krvni tlak je optimalen </p>\"\n\t\t document.getElementById('spodnjiTlak').innerHTML = \"Vaš spodnji krvni pritisk znaša \" + res[res.length-1].diastolic + \" mm Hg\" + hintSpodnji\n\t\t document.getElementById(\"spodnjiTlakNumber\").innerHTML = res[res.length-1].diastolic;\n\t\t preveri()\n\t\t\t\t\t },\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t//zacetek ajaxa za višino\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t url: baseUrl + \"/view/\" + ehrId + \"/\" + \"height\",\n\t\t\t\t\t type: 'GET',\n\t\t\t\t\t headers: {\"Ehr-Session\": sessionId},\n\t\t\t\t\t success: function (res) {\n\t\t\t\t\t \n\t\t document.getElementById('visina').innerHTML = \"<p class='bg-info'>Vaša višina znaša \" + res[res.length-1].height + \" cm</p>\"\n\t\t document.getElementById(\"visinaNumber\").innerHTML = res[res.length-1].height;\n\t\t preveri()\n\t\t\t\t\t },\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t$(\"#overall, #details, #friendlyTip\").show();\n\t\t\n\t\t\t\n\t\n\t\t\t\t\n\t \t},\n\t \n\t\t});\n\t}\n\t\n}", "function wykonaj_ruch_SI()\n{\n let ruchy = generuj_ruchy(), ruch_t;\n\n // sprawdzanie czy jest mat/pat\n if(ruchy.ruchy.length + ruchy.zbicia.length === 0)\n {\n if(czy_szach(szachownica.biale_ruch))\n {\n // mat, SI przegralo\n napisz_wynik(szachownica.biale_ruch ? 2 : 1);\n }\n else\n {\n // pat, remis\n napisz_wynik(3);\n }\n\n zablokowane = true;\n\n return;\n }\n\n // sprawdzanie pozostalych remisow\n if(szachownica.liczba_polowek_od_r > 100 || poprzednie_pozycje[szachownica.hash] >= 3 || !czy_wystarczajacy_material())\n {\n napisz_wynik(3);\n\n szachownica.biale_ruch = !szachownica.biale_ruch;\n zablokowane = true;\n\n return;\n }\n\n tablica_transp = new Map();\n\n let nr = Math.floor(Math.random() * (ruchy.ruchy.length + ruchy.zbicia.length));\n\n if(nr < ruchy.ruchy.length)\n ruch_t = ruchy.ruchy[nr];\n else\n ruch_t = ruchy.zbicia[nr - ruchy.ruchy.length];\n\n wykonaj_ruch(ruch_t);\n if(szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k] === 6 && ruch_t.wiersz_k === 7)\n {\n // promocja biale\n promuj_piona(ruch_t.wiersz_k, ruch_t.kolumna_k, Math.floor(Math.random() * 4) + 2);\n }\n else if(szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k] === 12 && ruch_t.wiersz_k === 0)\n {\n // promocja czarne\n promuj_piona(ruch_t.wiersz_k, ruch_t.kolumna_k, Math.floor(Math.random() * 4) + 8);\n }\n\n narysuj();\n}", "function prikaziRezultat(){\r\n // na samom pocetku nije imao tacnih odgovora\r\n let brTacnih = 0;\r\n const listaPitanja = document.querySelectorAll(\".pitanje\")\r\n // prolazimo kroz globalni niz svih pitanja\r\n // tu poredimo odgovor koji je igrac dao na to pitanja sa tacnim odgovorom pitanja \r\n pitanja.forEach(function(trenutnoPitanje, pitanjeInd){\r\n // selektor koji trazi cekirani input na trenutno pitanje\r\n const selektor = `input[name=odgovor${pitanjeInd}]:checked`;\r\n // igrac je odgovorio ono sto je vrijednost cekiranog input-a (radio button-a)\r\n const odgovoreno = (document.querySelector(selektor) || {} ).value;\r\n\r\n // ako je ono sto je igrac odgovorio jednako tacnom odgovoru na trenutno pitanje\r\n // to znaci da je igrac tacno odgovorio i povecavamo ukupan broj tacnih odgovora\r\n \r\n if(odgovoreno === trenutnoPitanje.tacanOdgovor){\r\n brTacnih = brTacnih + 1;\r\n\r\n /* DOMACI */\r\n listaPitanja[pitanjeInd].style.color = \"green\"\r\n }else {\r\n listaPitanja[pitanjeInd].style.color = \"red\" \r\n } /* DOMACI */\r\n\r\n\r\n });\r\n // na kraju samo popunjavamo div za prikaz rezultata\r\n rezultatDiv.innerHTML = `rezultat: <h3>${brTacnih} od ${pitanja.length}</h3>`; \r\n}", "function fl_outToSelek ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "async function naCakanju() {\n lahkoNapada = false;\n document.getElementById(\"besedilo\").innerText = \"Cakaj nasprotnika!\";\n document.getElementById(\"hdomace\").classList.add(\"border-info\");\n document.getElementById(\"hnapad\").classList.remove(\"border-info\");\n\n // Zacni cakanje da je igralec na vrsti\n zacniCakanje(`/igra/naVrsti/${id_igre}/${igralec}`, naVrsti, (el) => el != 'false');\n }", "function kreirajEHRzaBolnika() {\n\tsessionId = getSessionId();\n\n\tvar ime = $(\"#kreirajIme\").val();\n\tvar priimek = $(\"#kreirajPriimek\").val();\n\n\tif (!ime || !priimek || ime.trim().length == 0 ||\n priimek.trim().length == 0 ) {\n\t\t$(\"#kreirajSporocilo\").html(\"<span class='obvestilo label \" +\n \"label-warning fade-in'>Prosim vnesite zahtevane podatke!</span>\");\n\t} else {\n\t\t$.ajaxSetup({\n\t\t headers: {\"Ehr-Session\": sessionId}\n\t\t});\n\t\t$.ajax({\n\t\t url: baseUrl + \"/ehr\",\n\t\t type: 'POST',\n\t\t success: function (data) {\n\t\t var ehrId = data.ehrId;\n\t\t var partyData = {\n\t\t firstNames: ime,\n\t\t lastNames: priimek,\n\t\t partyAdditionalInfo: [{key: \"ehrId\", value: ehrId}]\n\t\t };\n\t\t $.ajax({\n\t\t url: baseUrl + \"/demographics/party\",\n\t\t type: 'POST',\n\t\t contentType: 'application/json',\n\t\t data: JSON.stringify(partyData),\n\t\t success: function (party) {\n\t\t if (party.action == 'CREATE') {\n\t\t $(\"#kreirajSporocilo\").html(\"<span class='obvestilo \" +\n \"label label-success fade-in'>Uspešno kreiran EHR '\" +\n ehrId + \"'.</span>\");\n\t\t $(\"#preberiEHRid\").val(ehrId);\n\t\t }\n\t\t },\n\t\t error: function(err) {\n\t\t \t$(\"#kreirajSporocilo\").html(\"<span class='obvestilo label \" +\n \"label-danger fade-in'>Napaka '\" +\n JSON.parse(err.responseText).userMessage + \"'!\");\n\t\t }\n\t\t });\n\t\t }\n\t\t});\n\t}\n}", "function fl_outToRimon ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t\n\t\t}}", "function fl_outToOznei_aman ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function obrisi_sekvencu(kliknuta_kartica) {\r\n\t// koji igrac zeli ponovo da popuni kombinaciju\r\n\tvar br_igraca = nadji_igraca(kliknuta_kartica);\r\n\tif (br_igraca == 1) {\r\n\t\tlocalStorage.setItem(\"sekvenca_zemalja1\", \"\");\r\n\t\t//sekvenca_zemalja1 = [];\r\n\t}\r\n\r\n\tif (br_igraca == 2) {\r\n\t\tlocalStorage.setItem(\"sekvenca_zemalja2\", \"\");\r\n\t\t//sekvenca_zemalja2 = [];\r\n\t}\r\n\r\n\t//dohvati sve kartice kako bi ih sve obrisao\r\n\tvar _niz = document.querySelectorAll(\"div.kartica\");\r\n\r\n\r\n\tvar vracen_fokus_na_prvu_karticu = 0;\r\n\t// 4 za po svakog igraca posto smo dohvatili sve kartice, a zelimo da brisemo samo za jednog\r\n\tfor (let i = 0; i < 8; i++) {\r\n\t\tlet vlasnik__niz = nadji_igraca(_niz[i]);\r\n\t\tif (vlasnik__niz != br_igraca) continue;\r\n\t\telse {\r\n\t\t\t// kada obrise sekvencu da se ispise ? na kartici\r\n\t\t\t_niz[i].innerHTML = \"<img class='icon' src='skocko-dodatno/upitnik2.png' alt='?'>\";\r\n\t\t\t_niz[i].classList.remove(mesto_fokusa[br_igraca]);\r\n\r\n\t\t\t// prva na koju naidjemo je zapravo prva kartica od tog igraca i na nju treba da se vratimo kada sve obrisemo\r\n\t\t\tif (vracen_fokus_na_prvu_karticu == 0) {\r\n\t\t\t\t_niz[i].classList.add(mesto_fokusa[br_igraca]);\r\n\t\t\t\tvracen_fokus_na_prvu_karticu = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function tarkistaPari() {\r\n let ovatPari = ekaKortti.dataset.kehys === tokaKortti.dataset.kehys;\r\n //jos kortit ovat pari estetään niitä kääntymästä ja\r\n //jos kortit eivät ole pari käännetään ne takaisin\r\n ovatPari ? disable() : unflip();\r\n}", "function zmien_ocene(ruch_t)\n{\n let nr_bierki_p = szachownica.pola[ruch_t.wiersz_p][ruch_t.kolumna_p];\n let nr_bierki_k = szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k];\n\n if(nr_bierki_k !== 0)\n zmien_ocene_usun(ruch_t.wiersz_k, ruch_t.kolumna_k);\n\n szachownica.ocena.tablice += wartosc_tabela(ruch_t.wiersz_k, ruch_t.kolumna_k, nr_bierki_p) - wartosc_tabela(ruch_t.wiersz_p, ruch_t.kolumna_p, nr_bierki_p);\n szachownica.ocena.tablice_koncowka += wartosc_tabela_konc(ruch_t.wiersz_k, ruch_t.kolumna_k, nr_bierki_p) - wartosc_tabela_konc(ruch_t.wiersz_p, ruch_t.kolumna_p, nr_bierki_p);\n}", "function obojiZauzecaImpl(\n kalendarRef,\n mjesec,\n sala,\n vrijemePocetka,\n vrijemeKraja\n ) {\n //ako postoje zauzete sale od prije, trebaju se osloboditi\n var td = kalendarRef.getElementsByTagName(\"td\");\n for (var i = 0; i < td.length; i++) {\n if (td[i].className == \"zauzeta\") td[i].className = \"slobodna\";\n }\n\n var date = new Date(trenutnaGodina, trenutniMjesec, 1);\n var prviDan = date.getDay();\n var brojDana = new Date(trenutnaGodina, trenutniMjesec + 1, 0).getDate();\n if (prviDan == 0) prviDan = 6;\n else prviDan--;\n var brojReda;\n for (var i = 0; i < periodicna.length; i++) {\n brojReda = 2;\n if (\n vrijemePocetka.length > 0 &&\n vrijemeKraja.length > 0 &&\n sala == periodicna[i].naziv &&\n !(\n periodicna[i].kraj <= vrijemePocetka ||\n vrijemeKraja <= periodicna[i].pocetak\n ) &&\n // periodicna[i].pocetak >= vrijemePocetka &&\n // periodicna[i].kraj <= vrijemeKraja &&\n (((trenutniMjesec >= 9 || trenutniMjesec == 0) &&\n periodicna[i].semestar == \"zimski\") ||\n (trenutniMjesec >= 1 &&\n trenutniMjesec <= 5 &&\n periodicna[i].semestar == \"ljetni\"))\n ) {\n if (periodicna[i].dan < prviDan) brojReda++;\n for (var j = 0; j < prviDan + brojDana; j++) {\n if (j % 7 == 0) {\n if (brojReda >= kalendarRef.getElementsByTagName(\"tr\").length)\n break;\n var tr = kalendarRef.getElementsByTagName(\"tr\")[brojReda++];\n if (periodicna[i].dan >= tr.getElementsByTagName(\"td\").length)\n break;\n var td = tr.getElementsByTagName(\"td\")[periodicna[i].dan];\n td.className = \"zauzeta\";\n }\n }\n }\n }\n\n for (var i = 0; i < vanredna.length; i++) {\n var dd = vanredna[i].datum.substr(0, 2);\n var mm = vanredna[i].datum.substr(3, 2);\n var yyyy = vanredna[i].datum.substr(6, 4);\n if (\n vrijemePocetka.length > 0 &&\n vrijemeKraja.length > 0 &&\n sala == vanredna[i].naziv &&\n mm - 1 == mjesec &&\n yyyy == trenutnaGodina &&\n !(\n vanredna[i].kraj <= vrijemePocetka ||\n vrijemeKraja <= vanredna[i].pocetak\n )\n // vanredna[i].pocetak >= vrijemePocetka &&\n // vanredna[i].kraj <= vrijemeKraja\n ) {\n date = new Date(yyyy, mm - 1, 1);\n prviDan = date.getDay();\n if (prviDan == 0) prviDan = 6;\n else prviDan--;\n var td;\n if ((prviDan + parseInt(dd)) % 7 == 0)\n tr = kalendarRef.getElementsByTagName(\"tr\")[\n parseInt((parseInt(dd) + prviDan) / 7) + 1\n ];\n else\n tr = kalendarRef.getElementsByTagName(\"tr\")[\n parseInt((parseInt(dd) + prviDan) / 7) + 2\n ];\n\n var pozicija = ((parseInt(dd) + prviDan) % 7) - 1;\n if (pozicija == -1) pozicija = 6;\n var td = tr.getElementsByTagName(\"td\")[pozicija];\n td.className = \"zauzeta\";\n }\n }\n }", "function getRaspored() {\n var data, dataL;\n data = fetchRasp(smjena);\n dataL = data.length;\n trajanje = trajanjeFn(data[0]);\n\n // Biranje između učenika i profesora\n if (osoba == \"Učenik\") {\n getUcenik(data, dataL);\n } else if (osoba == \"Profesor\" && smjena != \"A/B\") {\n getProfesor(data, dataL);\n } else {\n getProfesorAB(data);\n }\n }", "function fl_outToLevivot ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.modern_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function ujebTomu(x) {\r\n //ulozi id tuknuteho luda\r\n let pes = document.getElementById(x);\r\n\r\n //ak uz nie je otvoreny nejaky iny zamestnanec\r\n if (otvoreny == \"nikto\") {\r\n //ulozi aktualne otvoreneho luda\r\n otvoreny = pes;\r\n x = '#' + x;\r\n\r\n //zmaze css pre zatvorenu tablicku - ci uz pc alebo mobil\r\n $(x).removeClass(\"mobileLudo\");\r\n $(x).removeClass(\"normLudo\");\r\n\r\n //prida css pre otvorenu tablicku\r\n if ($(window).width() < 1000) {\r\n //pre mobil otvori \"fullscreen\" zobrazenie luda\r\n $('body div').hide();\r\n //vypne moznost kliknut na logo v mavbare kym je otvoreny nejaky ludo\r\n $('.mavbar a').attr(\"onclick\", \"\");\r\n\r\n let picus = \"#BL\" + pes.id;\r\n $(picus).show();\r\n $(picus).find(\"div\").show();\r\n $('.mavbar').show();\r\n $('.mavbar #menuButton').hide();\r\n } else {\r\n //pre pc\r\n $(x).addClass(\"bigLudo\");\r\n $(x).find('.dlhyOpis').show();\r\n }\r\n\r\n //ukaze kontakt danej osoby\r\n $(x).find(\".bengoroKontakt\").show();\r\n //ukaze tlacitka pre email a zatvorenie tablicky\r\n $(x).find(\".miniButtony\").show();\r\n //ukaze zvysok opisneho textu\r\n $(x).find(\".quiestce\").find(\"span\").removeClass(\"hidden\");\r\n } else {\r\n //ak uz bol nejaky ludo otvoreny v momente kliknutia tak ho zavre\r\n //a otvori aktualne tuknuteho luda\r\n odjebTomu(otvoreny.id);\r\n ujebTomu(pes.id);\r\n otvoreny = pes\r\n }\r\n\r\n //riesi marginy medzi ludo divmi - obdlzniky nalavo maju mat margin right\r\n if ($(x).hasClass(\"lavo\")) {\r\n $('.lavo').each(function() {\r\n if ($(this).index() > $(x).index() &&\r\n $(this).parent().attr(\"id\") == $(x).parent().attr(\"id\")) {\r\n $(this).removeClass(\"medzeraNapravo\");\r\n }\r\n })\r\n\r\n $('.pravo').each(function() {\r\n if ($(this).index() > $(x).index() &&\r\n $(this).parent().attr(\"id\") == $(x).parent().attr(\"id\")) {\r\n $(this).addClass('medzeraNapravo');\r\n }\r\n })\r\n }\r\n}", "function upisNajaFunc()\n{\n\t/* ako je br bacanja veci od 1, nije najavljeno nedozvoljen upis */\n\tif (brojBacanja > 1 && indNajave < 1)\n\t{\n\t\talert(\"Niste najavili!\");\n\t\treturn;\n\t}\n\t/* u suprotnom u prvom smo bacanju i zelimo da najavimo */\n\telse if (brojBacanja == 1 && indNajave < 1)\n\t{\n\t\tindNajave = Number(this.id.slice(1, ));\n\n\t\t/* manipulate css for different background color */\n\t\tvar elm = document.getElementById(this.id);\n\t\telm.className = (elm.className == \"najaKlik\") ? \"polje naja\" : \"najaKlik\";\n\t\treturn;\n\t}\n\telse if (brojBacanja === 0)\n\t\treturn;\n\n\t/* get the value of the field clicked */\n\tvar vred = Number(this.id.slice(1, ));\n\n\t/* if not equal, user did not announce that field */\n\tif (vred != indNajave)\n\t{\n\t\talert(\"Niste TO najavili!\");\n\t\treturn; \n\t}\n\t\n\n\t///* see if the previous field is not -1 */\n\t///* else disable writting to preserve order */\n\t//if(vred < 12 && kNaja[vred] < 0)\n\t//{\n\t//\talert(\"Nedozvoljen upis!\");\n\t//\treturn;\n\t//}\n\t\n\t/* did we already write into this field */\n\tif(kNaja[vred-1] >= 0)\n\t{\n\t\talert(\"Vec ste upisali u ovo polje!\");\n\t\treturn;\n\t}\n\n\tvar tmp = 0;\n\tvar tmpNiz = [];\n\n\t/* splice izabraneKockice and baceneKockice */\n\tfor(var i=0; i<5; ++i)\n\t{\n\t\tif (Number(izabraneKockice[i].innerText))\n\t\t\ttmpNiz.push(Number(izabraneKockice[i].innerText));\n\t}\n\n\tfor(var i=0; i<5; ++i)\n\t{\n\t\tif (Number(baceneKockice[i].innerText))\n\t\t\ttmpNiz.push(Number(baceneKockice[i].innerText));\n\t}\n\n\tif(tmpNiz.length != 5)\n\t\talert(\"Niz nije 5! vec: \" + tmpNiz.length);\n\n\t/* decide which field was clicked: broj, maxmin ili igra */\n\tswitch(vred)\n\t{\n\t\tcase 1:\n\t\tcase 2:\n\t\tcase 3:\n\t\tcase 4:\n\t\tcase 5:\n\t\tcase 6:\n\t\t\tfor(var i=0; i<5; ++i)\n\t\t\t{\n\t\t\t\tif(tmpNiz[i] == vred)\n\t\t\t\t\ttmp += tmpNiz[i]\n\t\t\t}\n\t\t\tkNaja[vred-1] = tmp;\n\t\t\tsumaKolFunc(kNaja, \"suma4\");\n\t\t\tsumaRazFunc(kNaja, \"suma8\")\n\t\t\tbreak;\n\t\tcase 7:\n\t\tcase 8:\n\t\t\ttmp = zbir(tmpNiz);\n\t\t\tkNaja[vred-1] = tmp;\n\t\t\t/* suma8 */\n\t\t\tsumaRazFunc(kNaja, \"suma8\")\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\ttmp = jelFul(tmpNiz);\n\t\t\tkNaja[vred-1] = tmp;\n\t\t\tsumaIgFunc(kNaja, \"suma12\");\n\t\t\tbreak;\n\t\tcase 10:\n\t\t\ttmp = jelPoker(tmpNiz);\n\t\t\tkNaja[vred-1] = tmp;\n\t\t\tsumaIgFunc(kNaja, \"suma12\");\n\t\t\tbreak;\n\t\tcase 11:\n\t\t\ttmp = jelKenta(tmpNiz);\n\t\t\tkNaja[vred-1] = tmp;\n\t\t\tsumaIgFunc(kNaja, \"suma12\");\n\t\t\tbreak;\n\t\tcase 12:\n\t\t\ttmp = jelYamb(tmpNiz);\n\t\t\tkNaja[vred-1] = tmp;\n\t\t\tsumaIgFunc(kNaja, \"suma12\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\n\t/* write number of vred thrown */\n\tdocument.getElementById(this.id).innerText=Number(tmp);\n\n\t/* manipulate css for different background color */\n\tvar elm = document.getElementById(this.id);\n\telm.className = (elm.className == \"najaKlik\") ? \"polje naja\" : \"najaKlik\";\n\tindNajave = 0;\n\tresetuj(izabraneKockice, baceneKockice);\n\n}", "function fl_outToGvina ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "function obliczPunkty(dane)\n{\n var ro = 1.21; // gęstośc czynnika\n var stosunek_et = [0.86, 0.98, 1, 0.966, 0.86]; // stosunek sprawności izentropowych\n\n var mi0 = (1 - (Math.sqrt(Math.sin(dane.beta2 * (Math.PI / 180))) / (Math.pow(dane.z, 0.7)))).toPrecision(3); // współczynnik zmniejszenia mocy wentylatora\n var u2 = ((dane.D2 * Math.PI * dane.n) / 60).toPrecision(3); // prędkość obwodowa wirnika\n var c2u = ((dane.deltapzn * 1000) / (ro * u2 * dane.etazn)).toPrecision(3); // prędkość zależna od ułopatkowania wirnika\n var fi2r = ((c2u * Math.tan(dane.alfa2 * Math.PI / 180)) / u2).toPrecision(3); // wskaźnik prędkości koła wirnikowego\n var fi2r0 = ((mi0 * fi2r) / (mi0 - (c2u / u2))).toPrecision(3); // wartośc wskaznika prędkości koła wirnikowego dla wartości zerowej charakterystyki koła wirnikowego\n var Qmax = (dane.Qzn * (fi2r0 / fi2r)).toPrecision(3); // przepływ maksymalny\n\n var krok = 0.6;\n\n var daneDoWykresu = {};\n daneDoWykresu.deltap = []; // tablica wartości sprężu (deltap)\n daneDoWykresu.Q = []; // tablica wartości wydajności\n daneDoWykresu.Q = []; // tablica wartości wydajności\n daneDoWykresu.eta = []; // etazn * stosunek_et\n\tdaneDoWykresu.wspQ = []; //współczynnik Q: 1-Q/Qmax\n\tdaneDoWykresu.mp = [] ; // tablica wartości mocy pobieranej\n\t\n /* obliczanie punktów charakterystyk */\n\t\n for (var i = 0; i < 5; i++)\n\t{\n daneDoWykresu.Q[i] = krok * dane.Qzn;\n daneDoWykresu.wspQ[i] = 1 - (daneDoWykresu.Q[i] / Qmax);\n daneDoWykresu.eta[i] = dane.etazn * stosunek_et[i];\n\t\tdaneDoWykresu.deltap[i] =((293/(273+dane.tc))*((ro * (Math.pow(u2, 2)) * mi0 * daneDoWykresu.wspQ[i] * daneDoWykresu.eta[i])) / 1000); // kPa\n\t\tdaneDoWykresu.mp[i] = ((daneDoWykresu.Q[i]*daneDoWykresu.deltap[i])/(daneDoWykresu.eta[i]*dane.etas))/100; // kW/100\n krok += 0.2;\n }\n return daneDoWykresu;\n}", "function fl_outToRosh_ha_shana_btn ()\n\t\t{\n\t\t\tif(freez == \"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.sufgania.alpha=1\t\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t this.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t\t\tthis.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "function rekurzivnopozivanjeq()\r\n{\r\n\t//console.log(\"pozivan, nije prosao if\");\r\n\r\n\tif(brojacredovaq<10 && pricetier<4)\r\n\t{\r\n\t\tsortbytierquery();\r\n\t\tpricetier++;\r\n\t\tsetTimeout(rekurzivnopozivanjeq,2000);\r\n\t\tconsole.log(\"pozivan je rekurzivni pozivac, price tier= \"+pricetier);\r\n\t\r\n\t\t}\r\n}", "function gra()\n{\n\t\n\t// klasa weza\n\tfunction Waz(imie, nr)\n\t{\n\t\tthis.imie = imie;\n\t\tthis.nr = nr;\n\t\tthis.waz;\n\t\t\n\t\tthis.stworz = function(plansza, init) \n\t\t{\n\t\t\tthis.kierunek = 'p';\n\t\t\tthis.punkty = 0;\n\t\t\tthis.predkosc = 100;\t\n\t\t\tthis.waz = new Array(init);\n\t\t\t\n\t\t\t// wyloowanie pozycji dla glowy weza\n\t\t\tvar wspolrzedne = losowanieWspolrzednych();\n\t\t\t\n\t\t\t// --> plansza[x][y] == 5 oznacza jedzenie, 1 lub 2 i kolejne to oznacza, ze waz sie tam znajduje\n\t\t\t// sprawdzenie czy wylosowana pozycja glowy pozwoli na zmieszczenie reszty czlonow weza\n\t\t\twhile (((wspolrzedne[0] - this.waz.length) < 0) || ( plansza[wspolrzedne[0]][wspolrzedne[1]] == this.nr)\n\t\t\t\t\t|| ( plansza[wspolrzedne[0]][wspolrzedne[1]] ==5)) \n\t\t\t\twspolrzedne[0] = losowanieX();\n\t\t\t\n\t\t\t// wpisanie weza na plansze zaczynajac od glowy\n\t\t\tfor (var i = 0; i < this.waz.length; i++)\n\t\t\t{\n\t\t\t\tthis.waz[i] = { x: wspolrzedne[0] - i, y: wspolrzedne[1] };\n\t\t\t\t//console.log(this.waz[0].x);\n\t\t\t\tplansza[wspolrzedne[0] - i][wspolrzedne[1]] = this.nr;\n\t\t\t}\t \n\t\t\treturn plansza;\n\t\t}\n\t\t\n\t\tthis.rysuj = function(plansza) \n\t\t{\t\t\t\n\t\t\t// przejscie po kazdym elemencie weza, zaczynam od jego ostatniego czlonu\n\t\t\tfor (var i = this.waz.length - 1; i >= 0; i--) \n\t\t\t{\t\t\t\n\t\t\t\t// ---> roznica miedzy porownaniem ===, a == jest taka, ze === nie konwertuje typow\n\t\t\t\t// przesuwam glowe weza zgodnie z jego kierunkiem poruszania sie\n\t\t\t\tif (i === 0) {\n\t\t\t\t\tswitch(this.kierunek) {\n\t\t\t\t\t\tcase 'p': // Right\n\t\t\t\t\t\t\tthis.waz[0] = { x: this.waz[0].x + 1, y: this.waz[0].y }\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'l': // Left\n\t\t\t\t\t\t\tthis.waz[0] = { x: this.waz[0].x - 1, y: this.waz[0].y }\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'g': // Up\n\t\t\t\t\t\t\tthis.waz[0] = { x: this.waz[0].x, y: this.waz[0].y - 1 }\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'd': // Down\n\t\t\t\t\t\t\tthis.waz[0] = { x: this.waz[0].x, y: this.waz[0].y + 1 }\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t \n\t\t\t\t\t// sprawdzenie czy glowa weza nie wyszla poza zakres planszy gry\n\t\t\t\t\tif (this.waz[0].x < 0 || this.waz[0].x >= ilSzerokosc || \tthis.waz[0].y < 0 ||\tthis.waz[0].y >= ilWysokosc)\n\t\t\t\t\t{\t\t\t\t\n\t\t\t\t\t\tprzegrana(this.imie);\n\t\t\t\t\t\treturn;\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t// jesli waz wszedl na jedzenie to zwiekszam il. punktow\n\t\t\t\t\tif (plansza[this.waz[0].x][this.waz[0].y] === 5) \n\t\t\t\t\t{\n\t\t\t\t\t\tthis.punkty += 1;\n\t\t\t\t\t\tplansza = losowanieJedzenia(plansza); // wylosowanie nowego miejsca dla jedzenia\t \n\t\t\t\t\t\t// oraz dodaje nowy czlon weza\n\t\t\t\t\t\tthis.waz.push({ x: this.waz[this.waz.length - 1].x, y: this.waz[this.waz.length - 1].y });\n\t\t\t\t\t\tplansza[this.waz[this.waz.length - 1].x][this.waz[this.waz.length - 1].y] = this.nr;\t \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// sprawdzenie czy waz nie uderzyl sam w siebie\n\t\t\t\t\t} else if (plansza[this.waz[0].x][this.waz[0].y] === this.nr)\n\t\t\t\t\t{\t\t\t\t\n\t\t\t\t\t\tprzegrana(this.imie);\n\t\t\t\t\t\treturn;\t\t\t\t\t\n\t\t\t\t\t} else if (plansza[this.waz[0].x][this.waz[0].y] === 2)\n\t\t\t\t\t{\t\t\t\t\n\t\t\t\t\t\t// wygral adam\n\t\t\t\t\t\twaz1.punkty+=5;\n\t\t\t\t\t\tvar ilosc = waz2.waz.length/2;\n\t\t\t\t\t\tif(ilosc < 2) \n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tprzegrana(waz2.imie);\t\n\t\t\t\t\t\t\treturn;\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor(var i=0; i<ilosc; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tplansza[waz2.waz[waz2.waz.length-1].x][waz2.waz[waz2.waz.length-1].y] = null;\n\t\t\t\t\t\t\twaz2.waz.pop();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t} else if (plansza[this.waz[0].x][this.waz[0].y] === 1)\n\t\t\t\t\t{\t\t\t\t\n\t\t\t\t\t\t// wygral dawid\n\t\t\t\t\t\twaz2.punkty+=5;\n\t\t\t\t\t\tvar ilosc = waz1.waz.length/2;\n\t\t\t\t\t\tif(ilosc < 2) \n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tprzegrana(waz1.imie);\t\n\t\t\t\t\t\t\treturn;\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor(var i=0; i<ilosc; i++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tplansza[waz1.waz[waz1.waz.length-1].x][waz1.waz[waz1.waz.length-1].y] = null;\n\t\t\t\t\t\t\twaz1.waz.pop();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\t\t\t\t\n\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t// wpisanie nowej pozycji glowy weza do planszy\n\t\t\t\t\tplansza[this.waz[0].x][this.waz[0].y] = this.nr;\n\t\t\t\t} else // dla wszystkich czlonow weza oprocz glowy\n\t\t\t\t{\n\t\t\t\t\t// zwolnienie ostatniego czlonu weza\n\t\t\t\t\tif (i === (this.waz.length - 1))\n\t\t\t\t\t\tplansza[this.waz[i].x][this.waz[i].y] = null;\t\t\t\t\n\t\t \n\t\t\t\t\t// przypisanie miejsca wczesniejszego czlonu weza do czlonu i\n\t\t\t\t\tthis.waz[i] = { x: this.waz[i - 1].x, y: this.waz[i - 1].y };\n\t\t\t\t\tplansza[this.waz[i].x][this.waz[i].y] = this.nr;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn plansza;\t\t\n\t\t}\n\n\t}\n\t\n\t// tworze obiekt canvas ze standardu HTML 5 do rysowania na nim gry\n\tvar canvas = document.createElement('canvas'),\n\t\tcontext = canvas.getContext('2d'),\n\t ilWezy = 0,\n\t\tpredkosc = 100,\n\t\tgra = false; // czy gra jest aktywna\t\n\t\n\t// wyliczenie ilosc pol do gry w zaleznosci od rozdzieloczosc okna\n\t// --->> \"-1\" zeby plansza gry nie wychodzila poza obszar ekranu\n\tvar ilSzerokosc = parseInt(window.innerWidth / 20) - 1;\n\tvar ilWysokosc = parseInt(window.innerHeight / 20) - 2 ;\t\n\t\t\t\n\t// wymiary ramki do planszy\n\tcanvas.width = ilSzerokosc*20;\t\t\t\t\n\tcanvas.height = ilWysokosc*20;\n\t\n\t// stworzenie planszy o dwoch wymiarach \n\tvar plansza = new Array(ilSzerokosc);\n\tfor (var i = 0; i < plansza.length; i++)\t\n\t\tplansza[i] = new Array(ilWysokosc);\n\t\n\t\n\t// dodanie dwoch graczy lokalnych\n\tilWezy++;\n\tvar waz1 = new Waz(\"Adam\", ilWezy);\n\tplansza = waz1.stworz(plansza, 8);\t\n\tilWezy++;\n\tvar waz2 = new Waz(\"Dawid\", ilWezy);\n\tplansza = waz2.stworz(plansza, 8); \n\tgra = true;\n\t\n\t// wygenerowanie pozycji pierwszego punktu\n\tplansza = losowanieJedzenia(plansza);\n\t\n\t/* cos nie chce zadzialac\n\t// stworzenie zmiennej do przechowania stylow css\n\tvar css = 'punktacja { font-size:30px;}';\n\tvar style = document.createElement('style');\n\tstyle.type = 'text/css';\n\tif (style.styleSheet){\n\t style.styleSheet.cssText = css;\n\t} else {\n\t style.appendChild(document.createTextNode(css));\n\t}\n\tdocument.getElementsByTagName('head')[0].appendChild(style); */\n\t\t\n\t// pobranie referencji do obiekty body ze strony HTML\n\t// --->pobieram [0], zeby otrzymac jeden element, a nie cala liste,\n\t// --->bo getElementsBtTagName() zwraca zawsze liste\n\tvar body = document.getElementsByTagName('body')[0];\t\n\tvar punktacja = document.createTextNode(\"Punkty: \" + waz1.punkty);\n\t// dodanie obiektu punktacji i planszy (canvas) do ciala strony\t\n\tbody.appendChild(punktacja);\t\n\tbody.appendChild(canvas);\n\t\n\t// wywolanie f. odpowiedzialnej za rysowanie gry\n\trysowanie(plansza);\n\t\n\t// nasluchiwanie wcisniecia przyciskow strzalek do sterowania wezem\n\twindow.addEventListener('keydown', function(event) {\n if (event.keyCode === 38 && waz1.kierunek !== 'd') {\n waz1.kierunek = 'g'; // Up\n } else if (event.keyCode === 40 && waz1.kierunek !== 'g') {\n waz1.kierunek = 'd'; // Down\n\t\t} else if (event.keyCode === 39 && waz1.kierunek !== 'l') {\n waz1.kierunek = 'p'; // Right\n } else if (event.keyCode === 37 && waz1.kierunek !== 'p') {\n waz1.kierunek = 'l'; // Left\n\t\t} else if (event.keyCode === 87 && waz2.kierunek !== 'g') {\n waz2.kierunek = 'g'; // Up\n } else if (event.keyCode === 83 && waz2.kierunek !== 'g') {\n waz2.kierunek = 'd'; // Down\n\t\t} else if (event.keyCode === 68 && waz2.kierunek !== 'l') {\n waz2.kierunek = 'p'; // Right\n } else if (event.keyCode === 65 && waz2.kierunek !== 'p') {\n waz2.kierunek = 'l'; // Left\n\t\t}\n });\t\n\t\n\t// rysowanie kolejnych elementow gry\n\tfunction rysowanie()\n\t{\n\t\tcontext.clearRect(0, 0, canvas.width, canvas.height); // wyczyszczenie planszy\n\t\trysujRamke(); // narysowanie ramki i wypisanie punktacji\t\t\t\n\t\t\n\t\tplansza = waz1.rysuj(plansza);\n\t\tplansza = waz2.rysuj(plansza);\n\t\t\n\t\t// narysowanie wezy i jedzenia\n for (var x = 0; x < ilSzerokosc ; x++) {\n for (var y = 0; y < ilWysokosc; y++) {\n if (plansza[x][y] == 5) {\n context.fillStyle = 'red';\n context.fillRect(x * 20, y * 20, 20, 20);\n } else if (plansza[x][y] === 1) {\n context.fillStyle = 'green';\n context.fillRect(x * 20, y * 20, 20, 20); \n } else if (plansza[x][y] === 2) {\n context.fillStyle = 'blue';\n context.fillRect(x * 20, y * 20, 20, 20); \n }\n }\n }\n\t\t\n\t\t// wywolanie funkcji rysowania z opoznieniem w ms okreslonym zmienna prekosc\n if(gra) setTimeout(rysowanie, 200); \n\t}\n\t\n\tfunction rysujRamke() \n\t{\t\t\n\t\tcontext.fillStyle = 'black'; // okresla kolor ramki\n\t\tcontext.lineWidth = 5; // okresla szerekosc ramki\n\t\t//narysowanie ramki planszy\n\t\tcontext.strokeRect(0, 0, canvas.width, canvas.height);\n\t\t\n\t\t// uaktualnienie ilosc punktow gracza\n\t\tvar tekst = waz1.imie+ \" zdobyl \" + waz1.punkty + \" punkty/ow. \"\n\t\t\t\t + waz2.imie+ \" zdobyl \" + waz2.punkty + \" punkty/ow\";\n\t\tpunktacja.nodeValue = tekst;\n\t\tpunktacja.fontsize=20;\t\n\t\t// --> aleternatywne wypisanie punktow\n\t\t//context.font = '20px arial';\n\t\t//context.fillText(imie, 10, 30);\n\t\t//context.fillText(\"Punktacja: \" + punkty, 300, 30);\t\n\t}\t\n\t\n\tfunction losowanieJedzenia(plansza)\n\t{\n // wylosowanie wspolrzednych dla jedzenia\n var wspolrzedne = losowanieWspolrzednych();\n\t\t\n // sprwadzenie czy wylosowana pozycja jedzenia nie naklada sie z cialem weza\n while (plansza[wspolrzedne[0]][wspolrzedne[1]] === 1 || plansza[wspolrzedne[0]][wspolrzedne[1]] === 2) \n wspolrzedne = losowanieWspolrzednych();\n \n\t\t// wpisanie jedzenia do planszy\n plansza[wspolrzedne[0]][wspolrzedne[1]] = 5; \n return plansza;\t\n\t}\n\t\n\tfunction przegrana(imie)\n\t{\n\t\tgra = false;\n\t\tcontext.clearRect(0, 0, canvas.width, canvas.height); // wyczyszczenie ekranu gry\n\t\tcontext.fillStyle = 'red';\n\t\tcontext.font = '20px arial';\t\t\n\t\tcontext.fillText(imie+ ' przegral !', canvas.width / 2 , 50);\n\t}\n\tfunction losowanieX()\n\t{\n\t\treturn Math.round(Math.random() * (ilSzerokosc-1));\n\t}\n\n\tfunction losowanieWspolrzednych()\n\t{\n\t\tvar tab = [];\n\t\ttab[0] = losowanieX();\n\t\ttab[1] = Math.round(Math.random() * ilWysokosc-3);\n\t\treturn tab;\n\t}\t\n\n}", "function vratiKoc()\n{\n\t/* nothing to be done if there is no text on the button */\n\tif(this.innerHTML == \"&nbsp;\")\n\t{\n\t\treturn;\n\t}\n\telse\n\t{\n\t\t/* get the position of the button */\n\t\tvar vred = Number(this.id[1]);\n\t\t/* set to the id of bacene button */\n\t\tvar ajdi = \"b\" + vred;\n\t\t/* set the value of bacene button to izabrane clicked */\n\t\tdocument.getElementById(ajdi).innerText=this.innerText;\n\n\t\t/* set the according value of nizBac */\n\t\t/* so we dont use it in baciFunc */\n\t\tnizBac[vred-1] = Number(this.innerText);\n\n\t\t/* set the value of izabrane button to space */\n\t\tthis.innerHTML=\"&nbsp;\";\n\t}\n\t\n}", "function cruzamiento(poblacion,seleccion,ciudades,elite)\n\t\t\t{\n\t\t\t\tvar numPobla = poblacion.length;\n\t\t\t\tvar indice1,indice2;\n\t\t\t\tvar k = 0;\n\t\t\t\tvar new_poblation = new Array();\n\t\t\t\t/*Genero nueva poblacion*/\n\t\t\t\twhile(k < parseInt(numPobla / 2))\n\t\t\t\t{\n\t\t\t\t\t//Escogo el metodo de seleccion para tener dos PADRES\n\t\t\t\t\tswitch(seleccion)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Torneo\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tdo{\n\t\t\t\t\t\t\t\tindice1 = torneo(poblacion,elite);\n\t\t\t\t\t\t\t\tindice2 = torneo(poblacion,elite);\n\t\t\t\t\t\t\t}while(indice1 == indice2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//Ranking\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//Aleatorio\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tdo{\n\t\t\t\t\t\t\t\tindice1 = parseInt( Math.random() * numPobla*elite);\n\t\t\t\t\t\t\t\tindice2 = parseInt( Math.random() * numPobla*elite);\n\t\t\t\t\t\t\t}while(indice1 == indice2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t//console.log(indice1);\n\t\t\t\t\t//console.log(indice2);\n\t\t\t\t\t/*Padres*/\n\t\t\t\t\tvar dad = poblacion[indice1].recorrido; \n\t\t\t\t\tvar mom = poblacion[indice2].recorrido;\n\t\t\t\t\t/*Camino para Hijos*/\n\t\t\t\t\tvar camino1 = new Array();\n\t\t\t\t\tvar camino2 = new Array();\n\t\t\t\t\t/*Numero entre 0 y numero de ciudades menos 1*/\n\t\t\t\t\tbp = parseInt( Math.random() * ciudades ); /*Punto de roptura*/\n\n\t\t\t\t/*-----------Genero 2 nuevos caminos-----------*/\n\t\t\t\t\t//Respaldo caminos de papa y mama hasta bp\n\t\t\t\t\tfor(var i = 0; i < bp; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcamino1.push(dad[i]);\n\t\t\t\t\t\tcamino2.push(mom[i]);\n\t\t\t\t\t}\n\t\t\t\t\tfor(var i = 0; i < ciudades; i++)\n\t\t\t\t\t{\t\n\t\t\t\t\t\t//Tomo el elemento a buscar en el segundo vector\n\t\t\t\t\t\tvar busca1 = mom[i];\n\t\t\t\t\t\tvar busca2 = dad[i];\n\t\t\t\t\t\tfor(var j = bp; j < ciudades; j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(busca1 == dad[j])\n\t\t\t\t\t\t\t\tcamino1.push(busca1);\n\t\t\t\t\t\t\tif(busca2 == mom[j])\n\t\t\t\t\t\t\t\tcamino2.push(busca2); \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t/*Hijos generados*/\n\t\t\t\t\tvar hijo1 = {recorrido: camino1, distancia: aptitud(camino1,region)}\n\t\t\t\t\tvar hijo2 = {recorrido: camino2,distancia : aptitud(camino2,region)}\n\n\t\t\t\t\tnew_poblation.push(hijo1);\n\t\t\t\t\tnew_poblation.push(hijo2);\n\t\t\t\t\tk++;\n\t\t\t\t}\n\t\t\t\treturn new_poblation;\n\t\t\t}", "function rysowanie()\n\t{\n\t\tcontext.clearRect(0, 0, canvas.width, canvas.height); // wyczyszczenie planszy\n\t\trysujRamke(); // narysowanie ramki i wypisanie punktacji\t\t\t\n\t\t\n\t\tplansza = waz1.rysuj(plansza);\n\t\tplansza = waz2.rysuj(plansza);\n\t\t\n\t\t// narysowanie wezy i jedzenia\n for (var x = 0; x < ilSzerokosc ; x++) {\n for (var y = 0; y < ilWysokosc; y++) {\n if (plansza[x][y] == 5) {\n context.fillStyle = 'red';\n context.fillRect(x * 20, y * 20, 20, 20);\n } else if (plansza[x][y] === 1) {\n context.fillStyle = 'green';\n context.fillRect(x * 20, y * 20, 20, 20); \n } else if (plansza[x][y] === 2) {\n context.fillStyle = 'blue';\n context.fillRect(x * 20, y * 20, 20, 20); \n }\n }\n }\n\t\t\n\t\t// wywolanie funkcji rysowania z opoznieniem w ms okreslonym zmienna prekosc\n if(gra) setTimeout(rysowanie, 200); \n\t}", "function fl_outToBeiza ()\n\t\t{\n\t\t\tif (freez=='false'){\n\t\t console.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\t\t }\n\t\t\n\t\t}", "function ocen_statycznie()\n{\n return szachownica.ocena.material + (szachownica.ocena.faza_gry * szachownica.ocena.tablice + (70 - szachownica.ocena.faza_gry) * szachownica.ocena.tablice_koncowka) * 0.03;\n}", "function rencontre(pnj, textePnj) { // fonction gérant la collision avec un pnj \n\n\tif (joueur.posX + joueur.largeur > pnj.posX2 && joueur.posX - tailleTuile < pnj.posX2 && joueur.posY + joueur.hauteur > pnj.posY2 && joueur.posY - tailleTuile < pnj.posY2) {\n\t\tconsole.log(pnj.name);\n\n\t\tswitch(dir) { // on va évaluer la direction du personnage joueur\n\t\t\tcase 1: \n\t\t\t\tjoueur.posX -= 1; // on enlève 1 à la position posX du joueur pour qu'il se décale horizontalement par rapport au pnj\n\t\t\t\t// pnj.v=0; // on arrête le déplacement du pnj en mettant sa vitesse à 0\n\t\t\t\t// dirPnj=0; // on le fait regarder de face\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tjoueur.posX += 1; // on ajoute 1 à la position posX du joueur pour qu'il se décale horizontalement par rapport au pnj\n\t\t\t\t// pnj.v=0; //on arrête le déplacement du pnj en mettant sa vitesse à 0\n\t\t\t\t // dirPnj=0; // on le fait regarder de face\n\t\t\t\tbreak;\n\n\t \t\tcase 0: \n\t\t\t\tjoueur.posY -= 1; // on enlève 1 à la position posY du joueur pour qu'il se décale verticalement par rapport au pnj\n\t\t\t\t// pnj.v=0; //on arrête le déplacement du pnj en mettant sa vitesse à 0\n\t\t\t\t // dirPnj=0; // on le fait regarder de face\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tjoueur.posY += 1; // on ajoute 1 à la position posY du joueur pour qu'il se décale verticalementement par rapport au pnj\n\t\t\t\t// pnj.v=0; //on arrête le déplacement du pnj en mettant sa vitesse à 0\n\t\t\t\t // dirPnj=0; // on le fait regarder de face\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (pnj.collision == 0) {\n\t\t\tbulleTexte(pnj.texte, pnj.posX2, pnj.posY2); // affiche une \"bulle\" de dialogue\n\n\t\t}\n\n\t\tpnj.collision += 1; // permettra de savoir ensuite qu'on a touché le pnj\n\n\t\tconsole.log(pnj.collision+\" - pnj !\");\n\n\t}\n}", "function fl_outToSufgania ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function kiekReiketuTapetuRulonuKambariui(ilgis, plotis, aukstis) {\n const vienasRulonas = 10;\n \n // debugger\n // gauti visus sienu ir lubu plota\n let sienos = kambarioSienuPlotas(ilgis, plotis, aukstis);\n let grindysLubos = kabarioLubosGrindys(ilgis, plotis);\n // pagal gauta plota paskaiciuoti kiek rulonu reikes \n let kiekRulonu = (sienos + grindysLubos) / vienasRulonas;\n\n return kiekRulonu;\n}", "function fl_outToOf ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.modern_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "function sortirajSveRastuce() {\r\n let tempNiz = nizPrikazanihProizvoda;\r\n tempNiz.sort((a,b) => {\r\n if(a.cena == b.cena)\r\n return 0;\r\n return a.cena < b.cena ? -1 : 1;\r\n });\r\n prikaziProizvode(tempNiz);\r\n}", "function fl_outToPesach_btn ()\n\t\t{\n\t\tif(freez == \"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t\tthis.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\t\t\n\t\tthis.mishloah_explain.alpha=0\n\t\t\n\t\tthis.sufgania_explain.alpha=0\n\t\t\n\t\tthis.perot_explain.alpha=0\n\t\t\n\t\tthis.tapuah_explain.alpha=0\n\t\t\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function maakEenBroodjeKaas() {\r\n console.log(\"pak een boterham\");\r\n console.log(\"smeer er boter op\");\r\n console.log(\"leg er een plakje kaas op\");\r\n}", "function Deplacement_ennemiLimitrophe(Territoire){\r\n\tif (Territoire.army < 2) {return false}\r\n for (var i=0 ; i < Territoire.voisins.length ; i++){\r\n if (Territoire.proprietaire != Territoire.voisins[i].proprietaire ){\r\n return true\r\n }\r\n }\r\n return false\r\n}", "function odjebTomu(x) {\r\n //id osoby + zapamata si, ze ziadna tablicka uz nie je otvorena\r\n x = \"#\" + x;\r\n otvoreny = \"nikto\";\r\n\r\n //zmaze css pre roztvorenu tablicku\r\n $(x).removeClass(\"bigLudo\");\r\n $(x).removeClass(\"mobigLudo\");\r\n\r\n //prida css pre zatvorenu tablicku, podla toho ci pc alebo mobil\r\n if ($(window).width() < 1000) {\r\n $(x).addClass(\"mobileLudo\");\r\n } else {\r\n $(x).addClass(\"normLudo\");\r\n $(x).find('.dlhyOpis').hide();\r\n }\r\n\r\n //zmaze kontakt osoby, male tlacitka a zvysok opisneho textu\r\n $(x).find(\".bengoroKontakt\").hide();\r\n $(x).find(\".miniButtony\").hide();\r\n $(x).find(\".quiestce\").find(\".dlhyOpis\").addClass(\"hidden\");\r\n\r\n $(\".pravo\").removeClass(\"medzeraNapravo\");\r\n $('.lavo').addClass(\"medzeraNapravo\");\r\n}", "function zwrocUnikSlowaIwielkFontow() {\n \n let wszyskieTytuly = listOfMovies.map((film) => getTitle(film));\n let wszystkieSlowaZtytulow = zwrocSlowaZtytulow(wszyskieTytuly);\n let unikalneSlowa = getUniqueWords(wszystkieSlowaZtytulow);\n\n // nie bylo czy sortowac rosnaco, czy malejaco\n // 'slowa uporzadkuj alfabetycznie' (rosnaco czy malejaco)\n // damy rosnaco\n unikalneSlowa = unikalneSlowa.sort((a, b) => a.localeCompare(b));\n \n //liczymy liczbe wystapien slowa\n let liczbWystSlowa = [];\n\n for (let i = 0; i < unikalneSlowa.length; i++) {\n\t// tmp - zawiera dane unikalne slowo powtorzone tyle razy \n\t// ile wystapilo w tytulach, np. [\"ala\", \"ala\", \"ala\"], czy [\"kot\"]\n\tlet tmp = wszystkieSlowaZtytulow.filter((slowo) => slowo == unikalneSlowa[i]);\n\tliczbWystSlowa.push(tmp.length);\n }\n \n // dodamy na poczatku ten tag \"wszystkie tagi\" do wyswietlanie wszystkich filmow\n // lepiej wygladalby przycisk, no ale zadanie to zadanie\n // bedzie jednak \"wszystkie tagi\" bo inaczej tytul w stylu: \n // \"wszystkie psy ida do nieba\" bedzie klopotliwy\n unikalneSlowa.unshift(\"wszystkie tagi\");\n liczbWystSlowa.unshift(4); \t// a to da w efekcie czcionke = 20px\n \n // obliczmy wielkosci czcionek\n let wielkosciCzcionek = \n\tliczbWystSlowa.map((wystapienie) => zwrocRozmCzcionki(wystapienie));\n\n return [unikalneSlowa, wielkosciCzcionek];\n}", "function rimuovi(){\n\n\tvar j = 0;\n\n\t// Per ogni elemento controllo la condizione\n\t// Se è idoneo, copio elemento in J\n\n\tfor(var i = 0; i<persone.length; i++){\n\t\tif(persone[i].altezza > 1.5) {\n\t\t\tpersone[j++] = persone[i];\n\t\t}\n\t}\n\t// Aggiorno array con valori nuovi messi in J\n\tpersone.length = j;\n\n\t// Visualizzo\n\tvisualizzaPersone();\n}", "function uspjesnost() {\n let brojRijesenih = 0;\n let procenat = 0;\n\n zadaci.forEach(zadatak => {\n if (zadatak.zavrsen === true) {\n brojRijesenih++;\n }\n })\n procenat = ((brojRijesenih / zadaci.length) * 100).toFixed(2);\n\n if (procenat < 50) {\n document.getElementById(\"uspesnost\").style.color = \"#DC143C\";\n } else {\n document.getElementById(\"uspesnost\").style.color = \"#00AD56\";\n }\n if (zadaci.length == 0) {\n document.getElementById('uspesnost').innerHTML = '';\n } else {\n document.getElementById('uspesnost').innerHTML = '<h6>Uspjesnost: ' + procenat + '%</h6>';\n }\n}", "function ohodnot(frm)\r\n{\r\n\t// \r\n\t// nazov class pomocou ktorej sa hladaju input elementy\r\n\tvar MOZNOST_CLASS_NAME = 'odpoved';\r\n\r\n\t//\r\n\t// nazov triedy, ktorou bude oznaceny rodicovsky element spravnej odpovede\r\n\tvar SPRAVNA_CLASS_NAME = 'spravna';\r\n\t\r\n\t//\r\n\t// nazov triedy, ktorou bude oznaceny rodicovsky element spravnej odpovede\r\n\tvar NESPRAVNA_CLASS_NAME = 'nespravna';\t\r\n\r\n\r\n\t// \r\n\t// najdi vsetky odpovede\r\n\tvar odpovede = document.getElementsByClassName( MOZNOST_CLASS_NAME, frm);\r\n\t\r\n\t//\r\n\t// ziskaj z nich unique zoznam \"name\"\r\n\tvar nazvy = Array();\r\n\todpovede.each(function (item) { \r\n\t\tnazvy.push(item.name); \r\n\t});\r\n\tnazvy = nazvy.uniq();\r\n\t\r\n\t// \r\n\t// over ci su vsetky zaskrtnute\r\n\tfor (var i=0; i<nazvy.length; i++) {\r\n\t\tvar nazov = nazvy[i];\r\n\t\t\r\n\t\t\t\t\r\n\t\t// zoznam item v nich\r\n\t\tvar moznosti = frm.getInputs('radio', nazov);\r\n\t\t\r\n\t\t// prelistuj ich a zisti ci je aspon 1 zaskrtnuty (viac nemoze byt, lebo maju rovnake meno)\r\n\t\tvar zaskrtnute = false;\r\n\t\tvar spravne_moznosti = 0;\r\n\t\tmoznosti.each(function (moznost) {\r\n\t\t\tif (moznost.checked) {\r\n\t\t\t\tzaskrtnute = true;\r\n\t\t\t}\r\n\t\t\tif (moznost.value == 1) {\t\r\n\t\t\t\tspravne_moznosti++;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t// ak nie je zakrtnuty, tak zrus validaciu\r\n\t\tif (!zaskrtnute) {\r\n\t\t\talert('Musíte zodpovedať všetky otázky!');\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\n\t\tdocument.getElementById(nazov).style.visibility = 'visible';\r\n\t\t//\r\n\t\t// ak otazka nema ani jednu spravnu odpoved v kode, alebo ma viac moznosti\r\n\t\t// upozorni autora\r\n\t\tif (spravne_moznosti != 1) {\r\n\t\t\tif (spravne_moznosti > 1) {\r\n\t\t\t\talert('Otazka s parametrom name: '+ nazov + ' musi mat len 1 spravnu odpoved!');\r\n\t\t\t} else {\r\n\t\t\t\talert('Otazka s parametrom name: '+ nazov + ' musi mat 1 spravnu odpoved !');\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t};\r\n\t\r\n\t//\r\n\t// statistiky vyhodnocovania\r\n\tvar pocet_otazok = nazvy.length;\r\n\tvar pocet_nespravnych = 0;\r\n\tvar pocet_spravnych = 0;\r\n\t\r\n\t// \r\n\t// vyhodnot jednotlive moznosti\r\n\tnazvy.each(function (nazov) {\r\n\t\t\r\n\t\t// zoznam item v nich\r\n\t\tvar moznosti = frm.getInputs('radio', nazov);\r\n\t\t\r\n\t\t// prelistuj a ohodnot\r\n\t\tmoznosti.each(function (moznost) {\r\n\t\t\tif (moznost.checked) {\r\n\t\t\t\tif (moznost.value == 1) {\r\n\t\t\t\t\tpocet_spravnych++;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpocet_nespravnych++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\t\r\n\t// \r\n\t// zvyrazni spravne a nespravne vysledky\r\n\tnazvy.each(function (nazov) {\r\n\t\t\r\n\t\t// zoznam item v nich\r\n\t\tvar moznosti = frm.getInputs('radio', nazov);\r\n\t\t\r\n\t\t// prelistuj a ohodnot\r\n\t\tmoznosti.each(function (moznost) {\r\n\t\t\r\n\t\t\t// odstran predchadzajuce\r\n\t\t\tmoznost.parentNode.removeClassName(SPRAVNA_CLASS_NAME);\t\t\t\r\n\t\t\tmoznost.parentNode.removeClassName(NESPRAVNA_CLASS_NAME);\r\n\t\t\t\r\n\t\t\tif (moznost.checked) {\r\n\t\t\t\tif (moznost.value == 1) {\r\n\t\t\t\t\t// spravna odpoved + celkovo spravna\r\n\t\t\t\t\tmoznost.parentNode.addClassName(SPRAVNA_CLASS_NAME);\r\n\t\t\t\t\tmoznost.parentNode.parentNode.removeClassName(NESPRAVNA_CLASS_NAME);\r\n\t\t\t\t\tmoznost.parentNode.parentNode.removeClassName('otazka');\r\n\t\t\t\t\tmoznost.parentNode.parentNode.addClassName('otazka'+SPRAVNA_CLASS_NAME);\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// nespravna odpoved + celkovo nespravna\r\n\t\t\t\t\tmoznost.parentNode.addClassName(NESPRAVNA_CLASS_NAME);\r\n\t\t\t\t\tmoznost.parentNode.parentNode.removeClassName(SPRAVNA_CLASS_NAME);\r\n\t\t\t\t\tmoznost.parentNode.parentNode.removeClassName('otazka');\r\n\t\t\t\t\tmoznost.parentNode.parentNode.addClassName('otazka'+NESPRAVNA_CLASS_NAME);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (moznost.value == 1) {\r\n\t\t\t\t\t// spravna odpoved\r\n\t\t\t\t\tmoznost.parentNode.addClassName(SPRAVNA_CLASS_NAME);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\t\r\n\t//\r\n\t// zobraz vysledok za pomoci alert\r\n\tif (pocet_otazok == pocet_spravnych) {\r\n\t\talert('Gratulujem !!!, zodpovedali ste všetky otázky správne!');\r\n\t} else {\r\n\t\talert('Zodpovedali ste správne ' + pocet_spravnych + ' otázok z ' + pocet_otazok + ' možných.');\r\n\t}\r\n\t\r\n\t// \r\n\t// allways return false - do not redirect\r\n\treturn false;\r\n}", "function ordenatuBerriak(berriako,prop, asc) {\n \n var berriab = berriako.Berriak.sort(function(a, b) {\n if (asc) {\n if (a[prop] > b[prop]) return 1;\n if (a[prop] < b[prop]) return -1;\n return 0;\n } else {\n if (b[prop] > a[prop]) return 1;\n if (b[prop] < a[prop]) return -1;\n return 0;\n }\n });\n //console.log(\"ORDENATU ONDOREN WORKERREAN\");\n berriako.Berriak = berriab;\n //console.log(berriab);\n berriab = '{ \"Berriak\" :' + JSON.stringify(berriab) + '}';\n //console.log(berriab);\n //console.log(\"ORDENATU ONDOREN WORKERREAN II\");\n //console.log(JSON.parse(berriab));\n // behin berriak ordenatuta, datuak itzuli !\n //postMessage(JSON.stringify(berriako));\n postMessage(JSON.stringify(berriab));\n //berriak ordenatuta objetua bistaratu kontsolan\n //console.log(\"workerrean eratutakoa\" + JSON.stringify(berriako) + berriako.Berriak);\n // behin ordenatuta dagoenean, BerriApp.js fitxategiari bidali, bistaratu dezan\n \n}", "function mostraNotas(){}", "function upisSlobFunc()\n{\n\n\tif (brojBacanja === 0)\n\t\treturn;\n\n\tif (indNajave > 0)\n\t{\n\t\talert(\"Igrali ste najavu!\")\n\t\treturn;\n\t}\n\n\t/* get the value of the field clicked */\n\tvar vred = Number(this.id.slice(1, ));\n\n\t///* see if the previous field is not -1 */\n\t///* else disable writting to preserve order */\n\t//if(vred > 1 && kDole[vred-2] < 0)\n\t//{\n\t//\talert(\"Nedozvoljen upis!\");\n\t//\treturn;\n\t//}\n\t\n\t/* did we already write into this field */\n\tif(kSlob[vred-1] >= 0)\n\t{\n\t\talert(\"Vec ste upisali u ovo polje!\");\n\t\treturn;\n\t}\n\n\tvar tmp = 0;\n\tvar tmpNiz = [];\n\n\t/* splice izabraneKockice and baceneKockice */\n\tfor(var i=0; i<5; ++i)\n\t{\n\t\tif (Number(izabraneKockice[i].innerText))\n\t\t\ttmpNiz.push(Number(izabraneKockice[i].innerText));\n\t}\n\n\tfor(var i=0; i<5; ++i)\n\t{\n\t\tif (Number(baceneKockice[i].innerText))\n\t\t\ttmpNiz.push(Number(baceneKockice[i].innerText));\n\t}\n\n\tif(tmpNiz.length != 5)\n\t\talert(\"Niz nije 5! vec: \" + tmpNiz.length);\n\n\t/* decide which field was clicked: broj, maxmin ili igra */\n\tswitch(vred)\n\t{\n\t\tcase 1:\n\t\tcase 2:\n\t\tcase 3:\n\t\tcase 4:\n\t\tcase 5:\n\t\tcase 6:\n\t\t\tfor(var i=0; i<5; ++i)\n\t\t\t{\n\t\t\t\tif(tmpNiz[i] == vred)\n\t\t\t\t\ttmp += tmpNiz[i]\n\t\t\t}\n\t\t\tkSlob[vred-1] = tmp;\n\t\t\tsumaKolFunc(kSlob, \"suma2\");\n\t\t\tsumaRazFunc(kSlob, \"suma6\")\n\t\t\tbreak;\n\t\tcase 7:\n\t\tcase 8:\n\t\t\ttmp = zbir(tmpNiz);\n\t\t\tkSlob[vred-1] = tmp;\n\t\t\tsumaRazFunc(kSlob, \"suma6\")\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\ttmp = jelFul(tmpNiz);\n\t\t\tkSlob[vred-1] = tmp;\n\t\t\tsumaIgFunc(kSlob, \"suma10\");\n\t\t\tbreak;\n\t\tcase 10:\n\t\t\ttmp = jelPoker(tmpNiz);\n\t\t\tkSlob[vred-1] = tmp;\n\t\t\tsumaIgFunc(kSlob, \"suma10\");\n\t\t\tbreak;\n\t\tcase 11:\n\t\t\ttmp = jelKenta(tmpNiz);\n\t\t\tkSlob[vred-1] = tmp;\n\t\t\tsumaIgFunc(kSlob, \"suma10\");\n\t\t\tbreak;\n\t\tcase 12:\n\t\t\ttmp = jelYamb(tmpNiz);\n\t\t\tkSlob[vred-1] = tmp;\n\t\t\tsumaIgFunc(kSlob, \"suma10\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\n\t/* write number of vred thrown */\n\tdocument.getElementById(this.id).innerText=Number(tmp);\n\n\tresetuj(izabraneKockice, baceneKockice);\n}", "function sortirajSveRastuce() {\r\n console.log(\"SORTIRANJE\");\r\n console.log(nizPrikazanihProizvoda);\r\n let tempNiz = nizPrikazanihProizvoda;\r\n tempNiz.sort((a,b) => {\r\n if(a.cena == b.cena)\r\n return 0;\r\n return a.cena < b.cena ? -1 : 1;\r\n });\r\n prikaziProizvode(tempNiz);\r\n}", "function vise_manje(rec){\n\tdugme('#gotovo','disabled',false);\n\tdugme('#jos_druge_igre','disabled',false);\n\t$('#1').attr('src',karta2.slika);\n\tlet izraz;\n\trec==='higher' ? izraz=karta2.vrednost>karta1.vrednost : izraz=karta2.vrednost<karta1.vrednost;\n\tif(izraz){\n\t\tbrojac_druga++;\n\t\tkarta1=karta2;\n\t\tkarta2=spil2.deal_card();\n\t}else{\n\t\tbrojac_druga=0;\n\t\tdugme('#jos_druge_igre');\n\t}\n\tlet a=brojac_druga*dobitak;\n\tprikaz_dobitka(a);\n\tdugme('#vise');\n\tdugme('#manje');\n}", "popuniIzvjestaj() {\n this.vrijednost = Util.getRandomFloatIn(2, 10);\n this.vrijemeObroka = Util.randomDate(new Date(2012, 0, 1), new Date());\n }", "function predstaveni2(jmeno) {\n console.log(\"Ahoj\");\n console.log(\"Moje jmeno je \" + jmeno)\n console.log(\"Jak se mas?\")\n}", "function FimJogo(){\n\t\tswitch(_vitoria){\n\t\t\tcase 1:AnunciarVitoria(1);p1.Vencer();break;\n\t\t\tcase 2:AnunciarVitoria(2);p2.Vencer();break;\n\t\t\tcase 4:AnunciarVitoria(3);p3.Vencer();break;\n\t\t\tcase 8:AnunciarVitoria(4);p4.Vencer();break;\n\t\t\tcase 0:AnunciarVitoria(0);AnimacaoEmpate();break;\n\t\t\tdefault:if(_minutos==0 && _segundos==0){AnunciarVitoria(0);AnimacaoEmpate();}break;\n\t\t}\n\t}", "function zapisiSePodatke(ehrId){\n \t\t $.ajaxSetup({\n \t\t headers: {\"Ehr-Session\": sessionId}\n \t\t });\n \t\t \tvar podatki = {\n \t\t\t// Struktura predloge je na voljo na naslednjem spletnem naslovu:\n // https://rest.ehrscape.com/rest/v1/template/Vital%20Signs/example\n \t\t \"ctx/language\": \"en\",\n \t\t \"ctx/territory\": \"SI\",\n \t\t \n \t\t \"vital_signs/height_length/any_event/body_height_length\": visina,\n \t\t \"vital_signs/body_weight/any_event/body_weight\": teza,\n \t\t \"vital_signs/pulse/any_event/rate|magnitude\": srcniUtrip,\n \t\t \"vital_signs/pulse/any_event/rate|unit\":\"/min\",\n \t\t \"vital_signs/blood_pressure/any_event/systolic\": zgornjiTlak,\n \t\t \"vital_signs/blood_pressure/any_event/diastolic\": spodnjiTlak,\n \t\t};\n \t\tvar parametriZahteve = {\n \t\t ehrId: ehrId,\n \t\t templateId: 'Vital Signs',\n \t\t format: 'FLAT',\n \t\t // committer: merilec\n \t\t};\n \t\t$.ajax({\n \t\t url: baseUrl + \"/composition?\" + $.param(parametriZahteve),\n \t\t type: 'POST',\n \t\t contentType: 'application/json',\n \t\t data: JSON.stringify(podatki),\n \t\t success: function (res) {\n \t\t document.getElementById(\"kreiraniEHRji\").innerHTML += \"<p class='bg-success'> <b>Generiran vpis:</b> \"+ime+\" \"+priimek+\",<b> EHR-Id:</b> \"+ ehrId + \"</p>\"\n \t\t },\n \t\t \n \n \t\t });\n \t\t }", "function fl_outToPerot ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "function liczbaZnakow(zdanie, litera) {\n\n\n var policz = 0;\n\n for (i = 0; i < zdanie.length; i++) {\n\n if (zdanie[i] == litera) {\n policz++;\n }\n }\n return \"Litera \" + litera + \" wystepuje \" + policz + \" razy w zdaniu : \" + zdanie ;\n}", "function skft()\n{\n\t// uzima izabranu temu iz baze (ako nije izabrana, podrazumevana je paleta servis)\n\tvar tema = GM_getValue(\"tema\", \"servis\");\n\n\t// na osnovu izbora postavlja predefinisane boje\n\tswitch (tema)\n\t{\n\tcase \"lp\":\n\t\t// laki pingvini\n\t\tvar b1 = \"#711B6C\"; // tamna pozadina zaglavlja + okviri\n\t\tvar b2 = \"#91238B\"; // svetla pozadina zaglavlja\n\t\tvar b3 = \"#E9A2E5\"; // tekst zaglavlja + pozadina info boxa\n\t\tvar b4 = \"#FCECFB\"; // pozadina poruke\n\t\tvar t1 = \"#400F3D\"; // tekst\n\t\tvar t2 = \"#95268F\"; // link\n\t\tvar t3 = \"#FF00FC\"; // aktivan link\n\t\tbreak;\n\tcase \"gray\":\n\t\t// siva\n\t\tvar b1 = \"#444\"; // tamna pozadina zaglavlja + okviri\n\t\tvar b2 = \"#555\"; // svetla pozadina zaglavlja\n\t\tvar b3 = \"#DDD\"; // tekst zaglavlja + pozadina info boxa\n\t\tvar b4 = \"#EEE\"; // pozadina poruke\n\t\tvar t1 = \"#222\"; // tekst\n\t\tvar t2 = \"#000\"; // link\n\t\tvar t3 = \"#FF7400\"; // aktivan link\n\t\tbreak;\n\tcase \"web20\":\n\t\t// WEB 2.0 boje\n\t\tvar b1 = \"#3F4C6B\"; // tamna pozadina zaglavlja + okviri\n\t\tvar b2 = \"#356AA0\"; // svetla pozadina zaglavlja\n\t\tvar b3 = \"#C3D9FF\"; // tekst zaglavlja + pozadina info boxa\n\t\tvar b4 = \"#F9F7ED\"; // pozadina poruke\n\t\tvar t1 = \"#36393D\"; // tekst\n\t\tvar t2 = \"#4096EE\"; // link\n\t\tvar t3 = \"#008C00\"; // aktivan link\n\t\tbreak;\n\tdefault:\n\t\t// servis (podrazumevana)\n\t\tvar b1 = \"#004000\"; // tamna pozadina zaglavlja + okviri\n\t\tvar b2 = \"#008000\"; // svetla pozadina zaglavlja\n\t\tvar b3 = \"#D0F3B6\"; // tekst zaglavlja + pozadina info boxa\n\t\tvar b4 = \"#F9F7ED\"; // pozadina poruke\n\t\tvar t1 = \"#008000\"; // tekst\n\t\tvar t2 = \"#004000\"; // link\n\t\tvar t3 = \"#800040\"; // aktivan link\n\t}\n\n\t// definise selektore sa predefinisanom temom boja\n\tvar css = \"body, .page { color: \"+t1+\"; }\" +\n\t\t\"a:link, a:visited { color: \"+t2+\"; }\" +\n\t\t\"a:hover, a:active { color: \"+t3+\"; }\" +\n\t\t\".tborder { background: white; color: \"+b1+\"; border: 1px solid \"+b1+\"; }\" +\n\t\t\".thead { background: \"+b1+\"; color: \"+b4+\"; }\" +\n\t\t\".tcat, .vbmenu_control, .tfoot { background: \"+b2+\"; color: \"+b4+\"; }\" +\n\t\t\".alt1, .alt1Active, .panelsurround, .wysiwyg { background: \"+b4+\" !important; color: \"+t1+\" !important; border: none !important; }\" +\n\t\t\".alt2, .controlbar, .imagebutton, .panel { background: \"+b3+\"; color: \"+t1+\"; border: none !important; }\" +\n\t\t\"div.page {width: 100% !important; padding: 0; margin: 0;}\" +\n\t\t\"input, textarea {color: \"+t2+\"}\";\n\n\t// primenjuje CSS na stranu\n\tGM_addStyle(css);\n\t\n\t// nizovi sa IDovima redakcije, saradnika i moderatora\n\tvar skft_red = new Array(\"1\", \"3\", \"5\", \"6\", \"8\", \"10\", \"14\", \"19\", \"115\", \"242\"); // redakcija\n\tvar skft_sar = new Array(\"4\", \"7\", \"15\", \"18\", \"21\", \"22\", \"62\", \"113\", \"128\", \"268\", \"312\", \"321\", \"353\", \"1734\", \"2486\", \"2526\", \"4049\", \"21855\"); // saradnici\n\tvar skft_mod = new Array(\"121\", \"123\", \"169\", \"185\", \"192\", \"216\", \"222\", \"245\", \"395\", \"452\", \"589\", \"600\", \"624\", \"773\", \"990\", \"1365\", \"1756\", \"1945\", \"2243\", \"2588\", \"2833\", \"3052\", \"4029\", \"5035\", \"10390\"); // moderator\n\n\t// procesiram sve slike na strani\n\tvar slike = document.getElementsByTagName('img');\n\n\tfor (i = 0; i < slike.length; i++)\n\t{\n\t\t// debug → GM_log(\"i = \" + i + \": src = \" + slike[i].src);\n\t\t// ako profil ima avatar\n\t\tif ( slike[i].alt.match(\"Avatar\") ) {\n\t\t\t// vidi da li je promenjen SRC slike ili je original\n\t\t\tif ( slike[i].src.match(\"u=\") ) {\n\t\t\t\t// odredi status clana (cin) na osnovu uzmi UID-a iz URL-a slike avatara\n\t\t\t\tskft_uid = slike[i].src.split(\"=\")[1].split(\"&\")[0];\n\t\t\t\tif ( skft_red.in_array(skft_uid) ) { // redakcija\n\t\t\t\t\tskft_cin = \"redakcija\";\n\t\t\t\t} else if ( skft_sar.in_array(skft_uid) ) { // saradnici\n\t\t\t\t\tskft_cin = \"saradnik\";\n\t\t\t\t} else if ( skft_mod.in_array(skft_uid) ) { // moderator\n\t\t\t\t\tskft_cin = \"moderator\";\n\t\t\t\t}\n\t\t\t} else if ( slike[i].src.match(\"AVATAR-\") ) {\n\t\t\t\t// odredi status clana (cin) na osnovu uzmi UID-a iz URL-a slike avatara\n\t\t\t\tskft_uid = slike[i].src.split(\"-\")[1];\n\t\t\t\tif ( skft_red.in_array(skft_uid) ) { // redakcija\n\t\t\t\t\tskft_cin = \"redakcija\";\n\t\t\t\t} else if ( skft_sar.in_array(skft_uid) ) { // saradnici\n\t\t\t\t\tskft_cin = \"saradnik\";\n\t\t\t\t} else if ( skft_mod.in_array(skft_uid) ) { // moderator\n\t\t\t\t\tskft_cin = \"moderator\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// posto je SRC promenjen, uzmi cin iz URL-a slike avatara\n\t\t\t\tskft_cin = slike[i].src.split(\"-\")[2];\n\t\t\t}\n\t\t\t// promeni avatar\n\t\t\tskft_avatar = skft_av_url + \"AVATAR-sk-\" + skft_cin + \"-\" + tema + \".png\";\n\t\t\t// debug → GM_log(\"Menjam sliku avatara: \"+skft_avatar);\n\t\t\tslike[i].src = skft_avatar;\n\t\t} else if ( slike[i].src.match(\"lastpost.gif\") || slike[i].src.match(\"/lastpost-\") ) {\n\t\t\tslike[i].src = skft_av_url + \"lastpost-\" + tema + \".gif\";\n\t\t} else if ( slike[i].src.match(\"firstnew.gif\") || slike[i].src.match(\"/firstnew-\") ) {\n\t\t\tslike[i].src = skft_av_url + \"firstnew-\" + tema + \".gif\";\n\t\t} else if ( slike[i].src.match(\"trashcan_small.gif\") || slike[i].src.match(\"/trashcan_small-\") ) {\n\t\t\tslike[i].src = skft_av_url + \"trashcan_small-\" + tema + \".gif\";\n\t\t// dugmad\n\t\t} else if ( slike[i].src.match(\"edit.gif\") || slike[i].src.match(\"/edit-\") ) {\n\t\t\tslike[i].src = skft_av_url + \"edit-\" + tema + \".gif\";\n\t\t} else if ( slike[i].src.match(\"multiquote_off.gif\") || slike[i].src.match(\"/multiquote_off-\") ) {\n\t\t\tslike[i].src = skft_av_url + \"multiquote_off-\" + tema + \".gif\";\n\t\t} else if ( slike[i].src.match(\"post_thanks.gif\") || slike[i].src.match(\"/post_thanks-\") ) {\n\t\t\tslike[i].src = skft_av_url + \"post_thanks-\" + tema + \".gif\";\n\t\t} else if ( slike[i].src.match(\"quickreply.gif\") || slike[i].src.match(\"/quickreply-\") ) {\n\t\t\tslike[i].src = skft_av_url + \"quickreply-\" + tema + \".gif\";\n\t\t} else if ( slike[i].src.match(\"quote.gif\") || slike[i].src.match(\"/quote-\") ) {\n\t\t\tslike[i].src = skft_av_url + \"quote-\" + tema + \".gif\";\n\t\t} else if ( slike[i].src.match(\"reply.gif\") || slike[i].src.match(\"/reply-\") ) {\n\t\t\tslike[i].src = skft_av_url + \"reply-\" + tema + \".gif\";\n\t\t}\n\t\t\n\t}\n}", "function sortirajSveOpadajuce() {\r\n let tempNiz = nizPrikazanihProizvoda;\r\n tempNiz.sort((a,b) => {\r\n if(a.cena == b.cena)\r\n return 0;\r\n return a.cena > b.cena ? -1 : 1;\r\n });\r\n prikaziProizvode(tempNiz);\r\n}", "function luoRuoka() {\n ruokaX = satunnainenKymppi(0, gameCanvas.width - 10);\n ruokaY = satunnainenKymppi(0, gameCanvas.height - 10);\n snake.forEach(function(snakeOsa) {\n if (ruokaX == snakeOsa.x && ruokaY == snakeOsa.y) {\n luoRuoka();\n }\n });\n}", "function ok2(){ \n if(j-avain2<0){\n \n r=29-avain2+j;\n \n \n }\n else{\n r=(j-avain2);\n \n }\n}", "function ucitajPodatkeImpl(periodicna, vanredna){\r\n //ucitavanje podataka\r\n glavniNizP=periodicna;\r\n glavniNizV=vanredna;\r\n }", "function letra(tecla) {\n //alert(tecla);\n var ltPCode;\n var acertouAq; // pesquisar se true letras que acertou\n var errouAq; // pesquisar letras que errou\n\n key = tecla;\n lt = String.fromCharCode(key).toLowerCase();\n ltPCode = lt.charCodeAt(0);\n\n acertouAq = acertou.indexOf(lt);\n errouAq = errou.indexOf(lt);\n\n if(key == 186){\n alert('Clique C ou outra consoante!');\n }else if(ltPCode == 97 || ltPCode == 98 || ltPCode == 99 || ltPCode == 100 || ltPCode == 101 || ltPCode == 102 || ltPCode == 103 || ltPCode == 104 || ltPCode == 105 ||\n ltPCode == 106 || ltPCode == 107 || ltPCode == 108 || ltPCode == 109 || ltPCode == 110 || ltPCode == 111 || ltPCode == 112 || ltPCode == 113 || ltPCode == 114 ||\n ltPCode == 115 || ltPCode == 116 || ltPCode == 117 || ltPCode == 118 || ltPCode == 119 || ltPCode == 120 || ltPCode == 121 || ltPCode == 122){\n\n if(acertou.length >= obj.length || imgAtual >= 6){\n\n }else if(perdeu == true) {\n\n }else if(acertouAq >= 0 || errouAq >= 0){\n alert('Você já tinha digitado a tecla \\\"'+lt+'\\\"');\n }else{\n ltPre = limpaLetra(lt);\n verLetra(ltPre);\n }\n\n }\n}", "function sakrij(){\n\tskriveno= window.setTimeout(zatvoriPodmeni, vrijeme);\n}", "posZahtMet()\n {\n this.posZah=!this.posZah;\n }", "function fl_outToTamar ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.modern_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function jelKenta(niz)\n{\n\t/* make a set from an array */\n\tvar skup = napraviSet(niz);\n\tvar tmpn = Array.from(skup);\n\ttmpn.sort();\n\n\tif(skup.size === 5)\n\t{\n\t\tconsole.log(tmpn[4]);\n\t\t/* kandidat za kentu */\n\t\tif((tmpn[4] - tmpn[0]) === 4)\n\t\t{\n\t\t\t/* velika ili mala kenta? */\n\t\t\tif(tmpn[0] === 1)\n\t\t\t\treturn 75;\n\t\t\telse\n\t\t\t\treturn 80;\n\t\t}\n\t\telse\n\t\t\treturn 0;\n\t}\n\telse\n\t\treturn 0;\n\n}", "function ricaricaTreeStrutturaAmministrativoContabile() {\n var editabile = $(\"#HIDDEN_StrutturaAmministrativoContabileEditabile\").val() === \"true\";\n if(editabile) {\n caricaStrutturaAmministrativoContabile()\n .then(function() {\n var hiddenField = $(\"#HIDDEN_StrutturaAmministrativoContabileUid\");\n var uid = hiddenField.data(\"originalUid\");\n var albero = $.fn.zTree.getZTreeObj(\"treeStruttAmm\");\n var node;\n\n hiddenField.val(uid);\n if(albero) {\n node = albero.getNodeByParam(\"uid\", uid);\n node && !node.checked && albero.checkNode(node, true, true, true);\n }\n $(document).trigger(\"strutturaAmministrativoContabileCaricato\");\n });\n }\n }", "function szigoruanNovekvoE(){\n let ertekTomb2 = [];\n for (i = 0; i <= 10; i++){\n ertekTomb2.push(randomMinMax(1,100));\n }\n let eredmeny = 'x';\n for (i = 0; i <= ertekTomb2.length-1; i++){\n if(ertekTomb2[i] >= ertekTomb2[i+1]){\n return eredmeny = 'Nem növekszik szigorúan';\n } else {\n eredmeny = 'Szigorúan növekszik';\n }\n }\n}", "function treciOdgovor(){\n\tif (document.getElementById('drPitZato')) {\n\t\tvar $trOdg = document.getElementById('drPitZato').value.toLowerCase();\n\t\tif ($trOdg.indexOf('ne') !== -1) { \n\t\t\tdocument.getElementById('odgovor3').innerHTML='<h3>A ti nemoj?</h3>';\n\t\t}\n\t\telse if ($trOdg.indexOf('da') !== -1) {\n\t\t\tdocument.getElementById('odgovor3').innerHTML='<h3>E pa muči se onda i dalje!</h3>';\n\n\t\t}\n\t\telse {\n\t\t\tdocument.getElementById('odgovor3').innerHTML='<p>Ne razumem odgovor: da ili ne?</p><input type=\"text\" id=\"drPitZato\" value=\"\" placeholder=\"\"><button type=\"submit\" onclick=\"treciOdgovor();\">Submit</button>';\n\n\t\t};\n\t}\n\telse if (document.getElementById('drPitEto')) {\n\t\tvar $trOdg = document.getElementById('drPitEto').value.toLowerCase();\n\t\tif ($trOdg.indexOf('ne') !== -1) { \n\t\t\tdocument.getElementById('odgovor3').innerHTML='<h3>Onda smisli razlog!</h3>';\n\t\t}\n\t\telse if ($trOdg.indexOf('da') !== -1) {\n\t\t\tdocument.getElementById('odgovor3').innerHTML='<h3>Razumemo se!</h3>';\n\n\t\t}\n\t\telse {\n\t\t\tdocument.getElementById('odgovor3').innerHTML='<p>Ne razumem odgovor: da ili ne?</p><input type=\"text\" id=\"drPitEto\" value=\"\" placeholder=\"\"><button type=\"submit\" onclick=\"treciOdgovor();\">Submit</button>';\n\n\t\t};\n\t}\n\n\telse if (document.getElementById('drPitMenja')) {\n\t\tvar $trOdg = document.getElementById('drPitMenja').value.toLowerCase();\n\t\tif ($trOdg.indexOf(',') !== -1) { \n\t\t\tdocument.getElementById('odgovor3').innerHTML='<h3>Evo, prosledićemo listu Vladi!</h3>';\n\t\t}\n\t\telse if (($trOdg.indexOf('nista') !== -1) || ($trOdg.indexOf('ništa') !== -1) || ($trOdg.indexOf('ne znam') !== -1)) {\n\t\t\tdocument.getElementById('odgovor3').innerHTML='<h3>Malo bi, a malo ne bi, a?</h3>';\n\n\t\t}\n\t\telse {\n\t\t\tdocument.getElementById('odgovor3').innerHTML='<h3>Pa reci Vladi, možda može da promeni!</h3>';\n\n\t\t};\n\n\t}\n\t\n\telse {\n\t\tvar $trOdg = document.getElementById('drPitDoma').value.toLowerCase();\n\t\tif (($trOdg.indexOf('radim') !== -1) && ($trOdg.indexOf('ne') == -1)) { \n\t\t\tdocument.getElementById('odgovor3').innerHTML=\"<h3>Izvin'te, moja greška!</h3>\";\n\t\t}\n\t\telse if (($trOdg.indexOf('nemam vremena') !== -1) || ($trOdg.indexOf('koji') !== -1) || ($trOdg.indexOf('ne znam') !== -1)) {\n\t\t\tdocument.getElementById('odgovor3').innerHTML='<h3>Hajde, nema zabušavanja!</h3>';\n\n\t\t}\n\t\telse {\n\t\t\tdocument.getElementById('odgovor3').innerHTML='<p>Ne razumem odgovor, pojasni mi.</p><input type=\"text\" id=\"drPitDoma\" value=\"\" placeholder=\"\"><button type=\"submit\" onclick=\"treciOdgovor();\">Submit</button>';\n\n\t\t};\n\n\t}\n}", "function sortirajSveOpadajuce() {\r\n console.log(\"SORTIRANJE\");\r\n console.log(nizPrikazanihProizvoda);\r\n let tempNiz = nizPrikazanihProizvoda;\r\n tempNiz.sort((a,b) => {\r\n if(a.cena == b.cena)\r\n return 0;\r\n return a.cena > b.cena ? -1 : 1;\r\n });\r\n prikaziProizvode(tempNiz);\r\n}", "function prikaziRezultat(){\n\n const tajmer = document.querySelector('#tajmer'); \n tajmer.style.display = \"none\";\n clearInterval(interval);\n\n let brTacnih=0;\n //const sviOdgovori = kvizDiv.querySelectorAll('.odgovori');\n\n pitanja.forEach(function(trenutnoPitanje, pitanjeIdn){\n const selektor = `input[name=odgovor${pitanjeIdn}]:checked`;\n const odgovoreno = (document.querySelector(selektor) || {}).value;\n\n console.log(odgovoreno, trenutnoPitanje.tacanOdgovor);\n\n //smjestanje pitanja u niz i pozivanje pojedinacnog\n const nizPitanja = document.querySelectorAll('.pitanje');\n const pojedinacnoPitanje = nizPitanja[pitanjeIdn];\n\n if(odgovoreno === trenutnoPitanje.tacanOdgovor){\n brTacnih++;\n pojedinacnoPitanje.classList.add('tacno_pitanje'); \n } else {\n pojedinacnoPitanje.classList.add('netacno_pitanje'); \n }\n });\n\n\n rezultatDiv.innerHTML = `Rezultat: <h3>${brTacnih} od ${pitanja.length}</h3>`\n}", "function draw() {\n background(0,0,0);\n vitorioso();\n if(!(placarPlayerUm >= 10 || placarPlayerDois >=10)){\n jogo();\n }\n}", "function fl_outToShavuot_btn ()\n\t\t{\n\t\t\tif(freez == \"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=0.4\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t this.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.modern_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\t\t\n\t\tthis.mishloah_explain.alpha=0\n\t\t\n\t\tthis.sufgania_explain.alpha=0\n\t\t\n\t\tthis.perot_explain.alpha=0\n\t\t\n\t\tthis.tapuah_explain.alpha=0\n\t\t\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function IndicadorRangoEdad () {}", "function fl_outToKarpas ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function posarBoleta(e) {\r\n// console.log(\"has clicat el \"+ e.target.getAttribute('id'));\r\n if (numDeClics==0) {\r\n //si guanya\r\n if (e.target.getAttribute('id')==aleatorio) {\r\n resultat(\"guany\", \"Felicitats :)\");\r\n // resultat(\"Felicitats :)\");\r\n //si perd\r\n }else{\r\n // resultat(\"Torna a provar! :S\");\r\n resultat(\"perd\", \"Torna a provar! :S\");\r\n\r\n }\r\n numDeClics=numDeClics+1;\r\n }\r\n}", "displayRaichiTuichi() {\n this.clearWinningPaths();\n const king = this.getKingPos(this.gamedatas.board);\n if (!king || Number(king.limitWin)) {\n return;\n }\n const raichiOrTuichi = this.getRaichiOrTuichi(king);\n if (raichiOrTuichi) {\n const [ winningMoveName, winningPath ] = raichiOrTuichi;\n this.displayWinningPaths(winningPath);\n this.showMessage(`${ winningMoveName } !`, 'info');\n }\n }", "function jugadaOrdinador() {\n if (jugadorActiu === 1) {\n seleccionatOrd = Math.floor(Math.random() * 3);\n canviarNodeText();\n }\n}", "async function zapolniTabelo() {\n /**\n * Funkcija ki pobarva celico\n * @param {HTMLElement} el Element celice ki jo barvamo\n * @param {String} tip Tip celice ki nam pove kako naj pobarvamo\n */\n function pobarvajPolje(el, tip) {\n switch (tip) {\n case \".\": el.classList = \"bg-info\"; el.innerText = \"\"; break;\n case \"#\": el.classList = \"bg-secondary\"; el.innerText = \"#\"; break;\n case \"X\": el.classList = \"bg-danger\"; el.innerText = \"X\"; break;\n case \"O\": el.classList = \"bg-info\"; el.innerText = \"O\"; break;\n }\n }\n\n // Pridobi podatke iz streznika in jih preberi\n const sb = JSON.parse(await stanjeBojisca());\n const domace = sb.domace;\n const tuje = sb.tuje[0];\n\n // Ustrezno pobarvaj obe tabeli\n for (let y = 0; y < 15; y++) {\n for (let x = 0; x < 15; x++) {\n let el_napad = at(napadalnaTabela, x, y);\n let el_domace = at(domacaTabela, x, y);\n\n pobarvajPolje(el_napad, tuje[y][x]);\n pobarvajPolje(el_domace, domace[y][x]);\n }\n }\n }", "function nascer()\n{\n\n estado = 3;\n flag_vida = 1;\n vidas_jogador[jog_activo]--;\n\tsom_inicio.play();\n if(jog_activo == 0)\n move_obj($('jogador_1'),290,320);\n else\n move_obj($('jogador_2'),290,320);\n\n // coloca objectos iniciais\n inicializa_objectos();\n objectos_comida();\n for(i = 0; i < 5; i++)\n {\n chama_objecto(i);\n }\n\n move_obj($('preparado'),320,450);\n setTimeout(\"move_obj($('jogador_1'),-1000,0); move_obj($('jogador_2'),-1000,0); move_obj($('preparado'),-1000,0); actividade(); \", 2143);\n}", "function otvaranje(nivo) {\r\n otvoreneKartice.push(izabrano);\r\n //aktiviranje tajmera klikom na prvu karticu:\r\n let duzina = otvoreneKartice.length;\r\n if (duzina === 1) {\r\n timer();\r\n };\r\n //broj razlicitih kartica u zavisnosti od nivoa:\r\n let brojRazlicitihKartica;\r\n if (nivo === 'easy') {\r\n brojRazlicitihKartica = easy_razliciteKartice;\r\n\r\n } else if (nivo === 'medium') {\r\n brojRazlicitihKartica = medium_razliciteKartice;\r\n \r\n } else {\r\n brojRazlicitihKartica = hard_razliciteKartice;\r\n }\r\n //kad se upare sve kartice pozivanje modala:\r\n if (upareneKartice.length == brojRazlicitihKartica) {\r\n clearInterval(interval);\r\n setTimeout(() => cestitamo(nivo), 1500);\r\n };\r\n}", "function IA_sacrifier(){\n\t\t // IA sacrifie la carte de plus haut cout d'invocation\n\t\t //SSI aucune carte vide\n\t\t \n\t\t no=rechercherIdxCarteAdvCoutMax()\n\t\t if (no>=0){\n\t\t\tlaCarte = jeu_adv[no];\n\t\t \tsacrifierUneCarte(no,laCarte,false,true);\n\t\t}\n\t }", "function sortujPoRoku() {\n \n // resetujemy monit o dodaniu filmu (aby caly czas sie nie wyswietlal)\n // paragraf ten bedzie istnial juz w dokumencie HTML\n // przy pierwszym wywolaniu tej funkcji\n parWalidacjaDodanegoFilmu.innerHTML = \"\";\n \n if (rokRosnaco) {\n\t// mozliwosc przeslania wlasnej funkcji sortujacej daje duza plastycznosc\n\t// getYear() zwraca rok jako string (np. \"1998\")\n\tlistOfMovies.sort((a, b) => parseInt(getYear(a)) - parseInt(getYear(b)));\n\trokRosnaco = !rokRosnaco;\n\t\n\t// update-owanie napisu w przycisku\n\t// przy kazdym sortowaniu zmieni sie wartosc przecisku \n\t// aby uzytkownik wiedzial co i jak\n\t// przy pierwszym wywolaniu tej funkcji zmienna przyciskSortujPoRoku\n\t// (patrz nizej bedzie juz istniala)\n\tprzyciskSortujPoRoku.value = \"Sortuj po roku (malejąco)\";\n\t\n\tusunListeKafelkow(); \t// usuwa liste kafelkow\n\t// a teraz ja odtwarza\n\toutput.appendChild(utworzListeKafelkow(listOfMovies));\n\t\n\t// updateujemy i wyswietlamy liczbe filmow i liczbe filmow widocznych\n\tupdateFilmyWszystkieIwidoczne();\n\twyswietlFilmyWszystkieIwidoczne();\n\t\n\n } else {\n\t// mozliwosc przeslania wlasnej funkcji sortujacej daje duza plastycznosc\n\t// getYear() zwraca rok jako string (np. \"1998\")\n\tlistOfMovies.sort((a, b) => parseInt(getYear(b)) - parseInt(getYear(a)));\n\trokRosnaco = !rokRosnaco;\n\n\t// update-owanie napisu w przycisku\n\t// przy kazdym sortowaniu zmieni sie wartosc przecisku\n\t// aby uzytkownik wiedzial co i jak\n\t// przy pierwszym wywolaniu tej funkcji zmienna przyciskSortujPoRoku\n\t// (patrz nizej bedzie juz istniala)\n\tprzyciskSortujPoRoku.value = \"Sortuj po roku (rosnąco)\";\n\t\n\tusunListeKafelkow(); \t// usuwa liste kafelkow\n\t// a teraz ja odtwarza\n\toutput.appendChild(utworzListeKafelkow(listOfMovies));\n\t\n\t// updateujemy i wyswietlamy liczbe filmow i liczbe filmow widocznych\n\tupdateFilmyWszystkieIwidoczne();\n\twyswietlFilmyWszystkieIwidoczne();\n\n }\n // aby przy dodaniu filmu do listy posortowac je odpowiednio przy wyswietleniu\n // przy pierwszym wywolaniu tej funkcji zmienna ostatnoSortowanePo\n // bedzie juz istniala\n ostatnioSortowanePo = \"rok\";\n}", "function korisnik(ime, prezime, god){\n console.log(`Korisnik je: ${ime} ${prezime} ima ${god} godina.`);\n}", "function tamagoOverTo(){\n\t\t\tif (tivoniClickStatus == true && tzimhoniClickStatus == true && kasherClickStatus == true && heraionClickStatus == true && ingridiantClick==true){\n\t\t\tthis.gari.alpha=0.2;\n\t\t\tthis.tobiko.alpha=0.2;\n\t\t\tthis.tuna.alpha=0.2;\n\t\t\tthis.unagi.alpha=0.2;\n\t\t\tthis.surimi.alpha=0.2;\n\t\t\tthis.palamida.alpha=0.2;\n\t\t\tthis.salmon.alpha=0.2;\n\t\t\tthis.skin.alpha=0.2;\n\t\t\tthis.ekora.alpha=0.2;\n\t\t\tthis.panko.alpha=0.2;\n\t\t\tthis.wasabi.alpha=0.2;\n\t\t\tthis.daikon.alpha=0.2;\n\t\t\tthis.shitaki.alpha=0.2;\n\t\t\tthis.nuri.alpha=0.2;\n\t\t\tthis.nato.alpha=0.2;\n\t\t\tthis.tograshi.alpha=0.2;\n\t\t\tthis.canfio.alpha=0.2;\n\t\t\tthis.tzimhoni_fade.visible=0;\n\t\t\tthis.tivoni_fade.visible=1;\n\t\t\tthis.heraion_fade.visible=0;\n\t\t\tthis.kasher_fade.visible=0;\n\t\t\tthis.instruction_txt.text=\"לחץ כדי ללמוד עוד על הרכיב\";\n\t\t}\n\t\tif((tzimhoniClickStatus == false || kasherClickStatus == false || heraionClickStatus == false) && ingridiantClick==true){\n\t\t\tthis.instruction_txt.text=\"לחץ כדי ללמוד עוד על הרכיב\";\n\t\t}\n\t\t}", "function fl_outToHazeret ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "function wyzerujOdp() {\n for (var i = 0; i < liczbapytan; i++) {\n odpUzytkownika[i] = \"\";\n czyOdpowiedziano[i] = false;\n }\n}", "function fl_outToHasa ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function galerijRechts(){\r\n\tlengthExtensie = getImgPad(\"plaatjeFrame\");\r\n\tif (Number(lengthExtensie[3]) < totaalPlaatjes){\r\n\t\tplaatjeNummer = Number(lengthExtensie[3]) + 1;\r\n\t}\r\n\telse{\r\n\t\tplaatjeNummer = 1;\r\n\t}\r\n\tsetPlaatjeNaam(lengthExtensie, plaatjeNummer, \"plaatjeFrame\");\r\n\treturn\r\n}", "function rndEstadoOferta(v,x,r){\n\t\tif (r.get(\"CGVCN_FECHA_EXPIRACION\") && r.get(\"CGVCN_FECHA_EXPIRACION\")<new Date() && v==1 && r.get(\"CGVCN_OFERTA_APROBADA\") == 1 )\t\n\t\t\tv=3;\n\t\tswitch (v){\t\t\t\n\t\t\tcase -1:v= \"<span style='color:GRAY;font-style: italic'>PENDIENTE</span>\";break;\n\t\t\tcase 0:v= \"<span style='font-style: italic'>Por aprobar</span>\";break;\n\t\t\tcase 1:v= \"<span style='color:green'>Aprobada</span>\";break;\n\t\t\tcase 2:v= \"<span style='color:red'>Rechazada</span>\";break;\n\t\t\tcase 3:v= \"<span style='color:orange'>Vencida</span>\";break;\n\t\t\tcase 4:v= \"<span style='color:red'>No mano obra</span>\";break;\n\t\t\tcase 5:v= (r.get(\"CGVCN_OFERTA_APROBADA\")==2)?\"<span style='color:#4194BC'>Selecci\\u00F3n</span>\":\"<span style='color:#4194BC'>Entrevista</span>\";break;\n\t\t\tcase 6:v= \"<span >Finalizada</span>\";break;\n\t\t\tcase 7:v= \"<span >Finalizada</span>\";break;\n\t\t\tcase 8:v= \"<span >Cancelada</span>\";break;\t\t\t\n\t\t\tcase 9:v= \"<span style='color:green'>Aprobada</span>\";break;\n\t\t}\n\t\treturn v;\n\t}", "function drugiOdgovor(){\n\tif (!document.getElementById('drPitDa') ) {\n\t\tvar $drOdg = document.getElementById('drPitNe').value.toLowerCase();\n\t\tif (($drOdg.indexOf('zato što') !== -1) || ($drOdg.indexOf('zato sto') !== -1) || ($drOdg.indexOf('jer') !== -1) ) { \n\t\t\tdocument.getElementById('odgovor2').innerHTML='<p>Da li je to dovoljan razlog?</p><input type=\"text\" id=\"drPitZato\" value=\"\" placeholder=\"\"><button type=\"submit\" onclick=\"treciOdgovor();\">Submit</button>';\n\n\t\t\tpromena3();\n\t\t}\n\t\telse if (($drOdg == 'onako') || ($drOdg == 'tako') || ($drOdg == 'eto') || ($drOdg == 'zato') || ($drOdg == 'ne znam') || ($drOdg == 'nemam pojma')) {\n\t\t\tdocument.getElementById('odgovor2').innerHTML='<p>Zbog sira i vojne muzike?</p><input type=\"text\" id=\"drPitEto\" value=\"\" placeholder=\"\"><button type=\"submit\" onclick=\"treciOdgovor();\">Submit</button>';\n\n\t\t\tpromena3();\n\t\t}\n\t\telse {\n\t\t\tdocument.getElementById('odgovor2').innerHTML='<p>Ne razumem odgovor... Objasni mi.</p><input type=\"text\" id=\"drPitNe\" value=\"\" placeholder=\"\"><button type=\"submit\" onclick=\"drugiOdgovor();\">Submit</button>';\n\n\t\t};\t\t\n\t}\n\telse {\n\t\tvar $drOdg = document.getElementById('drPitDa').value.toLowerCase();\n\t\tif (($drOdg.indexOf('da') !== -1) || (($drOdg.indexOf('mislim') !== -1 ) && ($drOdg.indexOf('ne') == -1)) || ($drOdg.indexOf('mozda') !== -1) || ($drOdg.indexOf('možda') !== -1) ) { \n\t\t\tdocument.getElementById('odgovor2').innerHTML='<p>Nabroj šta bi menjao/menjala (odvoj zarezima):</p><input type=\"text\" id=\"drPitMenja\" value=\"\" placeholder=\"\"><button type=\"submit\" onclick=\"treciOdgovor();\">Submit</button>';\n\t\t\tpromena3();\n\t\t}\n\t\telse if ($drOdg.indexOf('ne') !== -1) {\n\t\t\tdocument.getElementById('odgovor2').innerHTML='<p>Zašto onda ne radiš domaći?</p><input type=\"text\" id=\"drPitDoma\" value=\"\" placeholder=\"\"><button type=\"submit\" onclick=\"treciOdgovor();\">Submit</button>';\n\n\t\t\tpromena3();\n\t\t}\n\t\telse {\n\t\t\tdocument.getElementById('odgovor2').innerHTML='<p>Ne razumem odgovor... Objasni mi.</p><input type=\"text\" id=\"prPitDa\" value=\"\" placeholder=\"\"><button type=\"submit\" onclick=\"drugiOdgovor();\">Submit</button>';\n\n\t\t};\t\t\n\n\t};\n\n}", "function dodajRecept()\n {\t\n \t//ako je lek selektovan\n \tif($('#lekoviType').val()>-1)\n \t{\n \t\t//alert(\"Lek odabran\");\n \t\t\n \t\t//postavi selektovani lek u listu\n \t\treceptiMap[$('#lekoviType :selected').val()] = $('#lekoviType :selected').text()\n \t\t\n \t\t$('#receptiStavkeDiv').html('');\n \t\t\n \t\thtml = '';\n \t\t\n \t\t$.each(receptiMap, function(index,value){\n \t\t\t\n \t\t\thtml += '<label>' + value + '</label></br>';\n \t\t\t//alert(value);\n \t\t})\n \t\t//alert(html);\n \t\t\n \t\t//prikazi listu lekova\n \t\t$('#receptiStavkeDiv').append(html);\n \t}\n \telse\n \t{\n \t\t//ako lek nije odabran\n \t\talert(\"Morate odabrati lek\");\n \t}\n }", "function fl_outToHaroset ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function poprawneRozwiazanie()\r\n{\r\n var i;\r\n for(i = 1; i <= 9; i++)\r\n {\r\n if (!poprawnaTablica(wiersz(i))) return false;\r\n if (!poprawnaTablica(kolumna(i))) return false;\r\n if (!poprawnaTablica(kwadrat(i))) return false;\r\n }\r\n return true;\r\n}", "function uppdateraAllaKlossar() {\n /* Skapa rader */\n for (let j = 1; j < 6; j++) {\n /* Skapa klossar */\n for (let i = 0; i < 6; i++) {\n if (!klossar[j][i].hit) {\n ritaKlossar(45 + i * 120, j * 50);\n }\n }\n }\n }", "function reglaRebajaPrecios(){\n if(producto.super_avance.sellIn = 0)\n {\n precio_SuperAvance - 2;\n\n if(producto.fc_superduper.sellIn = 0){\n precio_FullSuperDuper - 2;\n\n if(producto.f_cobertura.sellIn = 0){\n precio_FullCobertura - 2;\n }\n }\n }else{\n }\n}", "function trazilicaData() {\n // Zove ajax i funkcije za filtriranje\n if (osoba == \"Učenik\") {\n var data = fetchRasp(smjena);\n var dataL = data.length;\n filterRazredi(data, dataL);\n } else if (osoba == \"Profesor\") {\n if (smjena == \"A/B\") {\n var data = fetchRasp(smjena);\n var dataL = data.length;\n filterProfesorAB(data);\n } else {\n var data = fetchRasp(smjena);\n var dataL = data.length;\n filterProfesor(data, dataL);\n }\n }\n }", "function uppdateraAllaKlossar() {\n /* Skapa rader */\n for (let j = 1; j < 5; j++) {\n /* Skapa klossar */\n for (let i = 0; i < 6; i++) {\n if (!klossar[j][i].hit) {\n ritaKloss(40 + i * 120, j * 50);\n }\n }\n }\n }", "liikuta(nimi, suunta){\n for (var i = 0; i < this.hahmot.length; i++){\n var h = this.hahmot[i];\n if (h.nimi == nimi) {\n if (suunta == suunnat.OIKEA) {\n if (this.onkoEtanoita(h.x + 1,h.y)) return;\n if (++h.x >= this.leveys) {\n h.x = 0;\n }\n }\n if (suunta == suunnat.VASEN) {\n if (this.onkoEtanoita(h.x - 1,h.y)) return;\n if (--h.x < 0) {\n h.x = this.leveys - 1;\n }\n }\n if (suunta == suunnat.YLOS) {\n if (this.onkoEtanoita(h.x,h.y - 1)) return;\n if (--h.y < 0) {\n h.y = 0;\n }\n }\n if (suunta == suunnat.ALAS) {\n if (this.onkoEtanoita(h.x, h.y + 1)) return;\n if (++h.y >= this.korkeus) {\n h.y = this.korkeus - 1;\n }\n }\n }\n } \n if (typeof this.pelihahmo == 'undefined') return;\n var h = this.pelihahmo;\n if (h.nimi == nimi) {\n if (suunta == suunnat.OIKEA) {\n if (++h.x >= this.leveys) {\n h.x = 0;\n }\n pisteet++;\n }\n if (suunta == suunnat.VASEN) {\n if (--h.x < 0) {\n h.x = this.leveys - 1;\n }\n pisteet--;\n }\n if (suunta == suunnat.YLOS) {\n if (--h.y < 0) {\n h.y = 0;\n }\n }\n if (suunta == suunnat.ALAS) {\n if (++h.y >= this.korkeus) {\n h.y = this.korkeus - 1;\n }\n }\n }\n }", "function dodajClana() {\n if (ime.value == \"\" || prezime.value == \"\" || datumRodjenja.value == \"\") {\n alert(\"Unesite sve potrebne podatke: Ime, prezime, datum rođenja!!!\");\n } else if (danasnjDatum < new moment(datumRodjenja.value)) {\n alert(\"Potrebno je da unesete datum ne mlađi od današnjeg !!!\");\n } else {\n var ispis = racunjanjeDatuma(datumRodjenja.value);\n brojClanovaPorodice();\n var row =\n \"<tr><td>\" +\n ime.value +\n \"</td><td>\" +\n prezime.value +\n \"</td><td>\" +\n datumRodjenja.value +\n \"</td><td>\" +\n ispis +\n \"</td>\" +\n trash +\n edit +\n check +\n \"</tr>\";\n var novi = tableTbody.innerHTML + row;\n tableTbody.innerHTML = novi;\n obrisiVrijednosti();\n console.table(porodica);\n }\n}", "function loggInnGammelt(brukernr) {\r\n Aliases.hovedmeny.linkMinProfil.Click();\r\n endrePassGyldig(brukernr);\r\n aqUtils.Delay(2000);\r\n Aliases.hovedmeny.loggUt.Click();\r\n Aliases.pageStartsideMinOptimera.linkLoggInn.Click();\r\n func.loggInn(bruker[brukernr].brukernavn, bruker[brukernr].passord);\r\n aqObject.CheckProperty(Aliases.pageLoggInn.feilPassordVarsel, \"Visible\", cmpEqual, true);\r\n func.loggInn(bruker[brukernr].brukernavn, testData.endreInfo.passord);\r\n}", "function ponerObstaculo(){\n\tvar ROCKET = [JESSIE,JAMES,MEOWTH];\n\tvar empty= [];\n\tfor (var x=0; x < grilla.width; x++) {\n\t\tfor (var y=0; y < grilla.height; y++) {\n\t\t\tif (grilla.get(x, y) === EMPTY) {\n\t\t\t\tempty.push({x:x, y:y});\n\t\t\t}\n\t\t}\n\t}\n\tvar randpos = empty[Math.round(Math.random()*(empty.length - 1))];\n\tfor (var j=0; j<py ;j++){\n\t\tvar randrocket = ROCKET[Math.floor(Math.random() * ROCKET.length)];\n\t\tgrilla.set(randrocket, randpos.x, randpos.y+j);\n\t}\n}", "function fl_outToChanuka_btn ()\n\t\t{\n\t\t\tif(freez == \"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=01\n\t\t this.of.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "function fl_outToMaza ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.modern_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}" ]
[ "0.6753502", "0.65285033", "0.6390136", "0.61814785", "0.6113063", "0.6066457", "0.5998599", "0.5985392", "0.5966415", "0.5933652", "0.5931987", "0.59226835", "0.5871933", "0.58610696", "0.5856169", "0.58499134", "0.5846479", "0.58304036", "0.5823336", "0.5797134", "0.579227", "0.57661396", "0.5748373", "0.57472295", "0.573449", "0.57264435", "0.57221484", "0.5719875", "0.57170916", "0.5708479", "0.56960535", "0.5680342", "0.5679397", "0.56769186", "0.5671671", "0.5670805", "0.56623596", "0.56462985", "0.56398964", "0.56341016", "0.5634094", "0.5609088", "0.5604993", "0.5597311", "0.55961317", "0.55905235", "0.55822635", "0.5576294", "0.5560624", "0.55530393", "0.55527264", "0.5537093", "0.5534883", "0.5531938", "0.5531741", "0.551568", "0.5513388", "0.5512371", "0.55110425", "0.5502072", "0.5500477", "0.54991716", "0.5498749", "0.54945153", "0.5492943", "0.5491344", "0.5490049", "0.5484891", "0.54756993", "0.5470951", "0.54674023", "0.54668456", "0.5466201", "0.54615813", "0.5457627", "0.5457585", "0.5457186", "0.5456179", "0.54510665", "0.54484946", "0.544404", "0.54403234", "0.54398507", "0.5439197", "0.5436986", "0.5434608", "0.5430783", "0.5426265", "0.54259133", "0.5425789", "0.5421415", "0.5420435", "0.54068214", "0.5403786", "0.5394933", "0.53941363", "0.53826797", "0.53634983", "0.535857", "0.5358491", "0.5356299" ]
0.0
-1
Racuna fitnes svih igraca
calculateFitness() { for (let i = 1; i < this.players.length; i++) { this.players[i].calculateFitness(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function caricaModello() {\n // CARICA MAPPA DISPLACEMENT\n mappaTemp = mappa;\n //mappaTemp.filter(BLUR, oggetto.Smooth);\n\n\n mappaTemp.loadPixels();\n let f = 0;\n let k = 0;\n for (let x = 0; x < mappaTemp.width-res; x+=res) {\n punti[f] = [];\n for (let y = 0; y < mappaTemp.height-res; y+=res) {\n let c = mappaTemp.get(x, y);\n let h = brightness(c);\n punti[f][k] = h;\n k++;\n }\n k=0;\n f++;\n }\n mappaTemp.updatePixels();\n\n // CARICA TEXTURE\n gino.loadPixels();\n let i = 0;\n let j = 0;\n for (let x = 1; x <= gino.width-res; x+=res) {\n voxel[i] = [];\n voxelBN[i] = [];\n for (let y = 1; y <= gino.height-res; y+=res) {\n let c = gino.get(x, y);\n let h = brightness(c);\n voxel[i][j] = c;\n voxelBN[i][j] = h;\n j++;\n }\n j=0;\n i++;\n }\n gino.updatePixels();\n}", "function kiekReiketuTapetuRulonuKambariui(ilgis, plotis, aukstis) {\n const vienasRulonas = 10;\n \n // debugger\n // gauti visus sienu ir lubu plota\n let sienos = kambarioSienuPlotas(ilgis, plotis, aukstis);\n let grindysLubos = kabarioLubosGrindys(ilgis, plotis);\n // pagal gauta plota paskaiciuoti kiek rulonu reikes \n let kiekRulonu = (sienos + grindysLubos) / vienasRulonas;\n\n return kiekRulonu;\n}", "function leyes_vida(){\n\tcelulas_x2= new Array(50);\n\tfor(i=0;i<50;i++){\n\t\tcelulas_y2= new Array(50);\n\t\tfor(j=0;j<50;j++){\n\t\t\tsum=0;\n\t\t\tcelulas_y2[j]=evaluar(i,j,celulas_x,celulas_x[i][j],sum);\n\t\t\t//alert(\"resultado: \"+celulas_y2[j]);\n\t\t\t\n\t\t}//for j\n\t\tcelulas_x2[i]=celulas_y2;\n\t\t\n\t}//for i\n\tcelulas_x=celulas_x2;\n\t\n\timprimir_celulas(celulas_x);\n\t\n}", "function ocen_statycznie()\n{\n return szachownica.ocena.material + (szachownica.ocena.faza_gry * szachownica.ocena.tablice + (70 - szachownica.ocena.faza_gry) * szachownica.ocena.tablice_koncowka) * 0.03;\n}", "function hitungLuasSegitiga(alas,tinggi) {\n var luas = 1/2 * alas * tinggi;\n\n return luas;\n\n}", "function wykonaj_ruch_SI()\n{\n let ruchy = generuj_ruchy(), ruch_t;\n\n // sprawdzanie czy jest mat/pat\n if(ruchy.ruchy.length + ruchy.zbicia.length === 0)\n {\n if(czy_szach(szachownica.biale_ruch))\n {\n // mat, SI przegralo\n napisz_wynik(szachownica.biale_ruch ? 2 : 1);\n }\n else\n {\n // pat, remis\n napisz_wynik(3);\n }\n\n zablokowane = true;\n\n return;\n }\n\n // sprawdzanie pozostalych remisow\n if(szachownica.liczba_polowek_od_r > 100 || poprzednie_pozycje[szachownica.hash] >= 3 || !czy_wystarczajacy_material())\n {\n napisz_wynik(3);\n\n szachownica.biale_ruch = !szachownica.biale_ruch;\n zablokowane = true;\n\n return;\n }\n\n tablica_transp = new Map();\n\n let nr = Math.floor(Math.random() * (ruchy.ruchy.length + ruchy.zbicia.length));\n\n if(nr < ruchy.ruchy.length)\n ruch_t = ruchy.ruchy[nr];\n else\n ruch_t = ruchy.zbicia[nr - ruchy.ruchy.length];\n\n wykonaj_ruch(ruch_t);\n if(szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k] === 6 && ruch_t.wiersz_k === 7)\n {\n // promocja biale\n promuj_piona(ruch_t.wiersz_k, ruch_t.kolumna_k, Math.floor(Math.random() * 4) + 2);\n }\n else if(szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k] === 12 && ruch_t.wiersz_k === 0)\n {\n // promocja czarne\n promuj_piona(ruch_t.wiersz_k, ruch_t.kolumna_k, Math.floor(Math.random() * 4) + 8);\n }\n\n narysuj();\n}", "function calculation () {\n omega = 2*Math.PI*ny; // Kreisfrequenz (1/s)\n if (dPhi == 0) i0 = u0/r; // Maximale Stromstärke (A, für Widerstand)\n else if (dPhi > 0) i0 = u0*omega*c; // Maximale Stromstärke (A, für Kondensator)\n else i0 = u0/(omega*l); // Maximale Stromstärke (A, für Spule)\n }", "function indovina(){\n\n gino = get(posIniX, posIniY, beholder.width, beholder.height);\n classifier.classify(gino, gotResult);\n mappa = aCheAssimiglia(gino, daMappare);\n\n}", "function hitungLuasSegiTiga(alas,tinggi){\n var luas = 0.5 * alas * tinggi\n return luas\n}", "fRn(){\n return 0.25*this.fm*this.b*this.Lbrg\n }", "calcularIMC() {\n const peso = this.peso;\n const altura = this.altura;\n return (peso / altura * altura)\n }", "function effemeridi_pianeti(np,TEMPO_RIF,LAT,LON,ALT,ITERAZIONI,STEP,LAN){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) ottobre 2011\n // funzione per il calcolo delle effemeridi del Sole.\n // Parametri utilizzati\n // np= numero identificativo del pianeta 0=Mercurio,1=Venere.....7=Nettuno\n // il valore np=2 (Terra) non deve essere utilizzato come parametro.\n // TEMPO_RIF= \"TL\" o \"TU\" tempo locale o tempo universale.\n // LAT= latitudine in gradi sessadecimali.\n // LON= longtudine in gradi sessadecimali.\n // ALT= altitudine in metri.\n // ITERAZIONE =numero di ripetizioni del calcolo.\n // STEP=salto \n // LAN=\"EN\" versione in inglese.\n \n \n var njd=calcola_jdUT0(); // numero del giorno giuliano all'ora 0 di oggi T.U.\n\n njd=njd+0.00078; // correzione per il Terrestrial Time.\n\n //njd=njd+t_luce(njd,np); // correzione tempo luce.\n \nvar data_ins=0; // data\nvar data_inser=0; // data\nvar numero_iterazioni=ITERAZIONI;\n\nvar fusoloc=-fuso_loc(); // recupera il fuso orario della località (compresa l'ora legale) e riporta l'ora del pc. come T.U.\n\nvar sorge=0;\nvar trans=0;\nvar tramn=0;\nvar azimuts=0;\nvar azimutt=0;\n\nvar effe_pianeta=0;\nvar ar_pianeta=0;\nvar de_pianeta=0;\nvar classetab=\"colore_tabellaef1\";\nvar istanti=0;\nvar magnitudine=0;\nvar fase=0;\nvar diametro=0;\nvar distanza=0;\nvar elongazione=0;\nvar costl=\"*\"; // nome della costellazione.\nvar parallasse=0;\nvar p_ap=0; // coordinate apparenti del pianeta.\n\nif (STEP==0) {STEP=1;}\n \n document.write(\"<table width=100% class='.table_effemeridi'>\");\n document.write(\" <tr>\");\n\n // versione in italiano.\n\n if (LAN!=\"EN\") // diverso da EN\n {\n document.write(\" <td class='colore_tabella'>Data:</td>\");\n document.write(\" <td class='colore_tabella'>Sorge:</td>\");\n document.write(\" <td class='colore_tabella'>Culmina:</td>\");\n document.write(\" <td class='colore_tabella'>Tramonta:</td>\");\n document.write(\" <td class='colore_tabella'>A. So.:</td>\");\n document.write(\" <td class='colore_tabella'>A. Tr.:</td>\");\n document.write(\" <td class='colore_tabella'>A. Retta:</td>\");\n document.write(\" <td class='colore_tabella'>Dec.:</td>\");\n document.write(\" <td class='colore_tabella'>Fase.</td>\");\n document.write(\" <td class='colore_tabella'>Dist.</td>\");\n document.write(\" <td class='colore_tabella'>Dia.</td>\");\n document.write(\" <td class='colore_tabella'>El.</td>\");\n document.write(\" <td class='colore_tabella'>Ma.</td>\");\n document.write(\" <td class='colore_tabella'>Cost.</td>\");\n }\n\n // versione in inglese.\n\nif (LAN==\"EN\")\n {\n\n document.write(\" <td class='colore_tabella'>Date:</td>\");\n document.write(\" <td class='colore_tabella'>Rise:</td>\");\n document.write(\" <td class='colore_tabella'>Transit:</td>\");\n document.write(\" <td class='colore_tabella'>Set:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Rise:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Set:</td>\");\n document.write(\" <td class='colore_tabella'>R.A.:</td>\");\n document.write(\" <td class='colore_tabella'>Dec.:</td>\");\n document.write(\" <td class='colore_tabella'>Ph.</td>\");\n document.write(\" <td class='colore_tabella'>Dist.</td>\");\n document.write(\" <td class='colore_tabella'>Dia.</td>\");\n document.write(\" <td class='colore_tabella'>El.</td>\");\n document.write(\" <td class='colore_tabella'>Ma.</td>\");\n document.write(\" <td class='colore_tabella'>Const.</td>\");\n\n }\n\n\n document.write(\" </tr>\");\n\n // ST_ASTRO_DATA Array(azimut_sorgere,azimut_tramonto,tempo_sorgere,tempo_transito,tempo_tramonto)\n // 0 1 2 3 4\n\n njd=njd-STEP;\n\n for (b=0; b<numero_iterazioni; b=b+STEP){\n njd=njd+STEP;\n effe_pianeta=pos_pianeti(njd,np); \n\n // calcola le coordinate apparenti nutazione e aberrazione.\n\n p_ap=pos_app(njd,effe_pianeta[0],effe_pianeta[1]);\n ar_pianeta= sc_ore(p_ap[0]); // ascensione retta in hh:mm:ss.\n de_pianeta=sc_angolo(p_ap[1],0); // declinazione. \n \n fase=effe_pianeta[2];\n magnitudine=effe_pianeta[3];\n distanza=effe_pianeta[4].toFixed(3);\n diametro=effe_pianeta[5].toFixed(1);\n elongazione=effe_pianeta[6].toFixed(1);\n costl=costell(effe_pianeta[0]); // costellazione.\n\n istanti=ST_ASTRO_DATA(njd,effe_pianeta[0],effe_pianeta[1],LON,LAT,ALT,0);\n\nif (TEMPO_RIF==\"TL\"){\n sorge=ore_24(istanti[2]+fusoloc);\n trans=ore_24(istanti[3]+fusoloc);\n tramn=ore_24(istanti[4]+fusoloc); }\n\nelse {\n sorge=ore_24(istanti[2]);\n trans=ore_24(istanti[3]);\n tramn=ore_24(istanti[4]); } \n\n sorge=sc_ore_hm(sorge); // istanti in hh:mm\n trans=sc_ore_hm(trans);\n tramn=sc_ore_hm(tramn);\n\n // formatta la data da inserire.\n\n data_ins=jd_data(njd);\n\n if (LAN!=\"EN\") {data_inser=Lnum(parseInt(data_ins[0]),2)+\":\"+Lnum(parseInt(data_ins[1]),2)+\" |\"+data_ins[3];} // versione in italiano.\n if (LAN==\"EN\") {data_inser=Lnum(parseInt(data_ins[0]),2)+\":\"+Lnum(parseInt(data_ins[1]),2)+\" |\"+data_ins[4];} // versione in inglese.\n\n azimuts=istanti[0].toFixed(1);\n azimutt=istanti[1].toFixed(1);\n\n if (b%2==0){classetab=\"colore_tabellaef2\"; }\n\n else {classetab=\"colore_tabellaef1\";}\n\n\n document.write(\" <tr>\");\n document.write(\" <td class='\"+classetab+\"'>\"+data_inser+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+sorge+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+trans+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+tramn+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+azimuts+\"&deg;</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+azimutt+\"&deg;</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+ar_pianeta+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+de_pianeta+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+fase+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+distanza+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+diametro+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+elongazione+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+magnitudine+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+costl+\"</td>\");\n\n document.write(\" </tr>\");\n\n }\n document.write(\" </table>\");\n\n\n}", "function turis(r) { // funkicja, funkcijos pavadinimas () skliausteliuose duomenys, {} aprasoma ka funkcija turi daryti // r kintamasis\nlet t = 4 * 3.14 * r * r * r / 3;\nreturn t; // grazinimas\n}", "function preCalculate1(){\n\t\tvar datos = 0;\n\n\t\t// Crea una matriz inicializada a 0 con todos los posibles niveles de cada tipo de recurso\n\t\tvar grid = new Array(4);\n\t\tfor(i = 0; i < 4; i ++) {\n\t\t\tgrid[i] = new Array(26);\n\t\t\tfor(j = 0; j <= 25; j++) {\n\t\t\t\tgrid[i][j] = 0;\n\t\t\t}\n\t\t}\n\n\t\t// Solo hay 6 tipos de aldeas de 15 casillas cada uno. Se describe el tipo de recurso por casilla\n\t\tvar dist = [\n\t\t\t[3, 3, 0, 3, 3, 1, 2, 3, 3, 2, 2, 3, 3, 0, 3, 1, 0, 1], // 9 cereales\n\t\t\t[2, 3, 0, 2, 1, 1, 2, 3, 3, 2, 2, 3, 3, 0, 3, 1, 0, 1],\n\t\t\t[0, 3, 0, 2, 1, 1, 2, 3, 3, 2, 2, 3, 3, 0, 3, 1, 0, 1],\n\t\t\t[0, 3, 0, 1, 1, 1, 2, 3, 3, 2, 2, 3, 3, 0, 3, 1, 0, 1],\n\t\t\t[0, 3, 0, 2, 0, 1, 2, 3, 3, 2, 2, 3, 3, 0, 3, 1, 0, 1],\n\t\t\t[3, 3, 0, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 3] // 15 cereales\n\t\t];\n\n\t\tfind(\"//img[@usemap='#rx']\", XPFirst).src.search(/\\/f(\\d).jpg$/);\n\t\tvar tipo = RegExp.$1;\n\n\t\t// Recupera todas las casillas y rellena la matriz con los niveles detectados\n\t\tfor (var i = 1; i <= 18; i++){\n\t\t\tvar a = find(\"//img[@class='rf\" + i + \"']\", XPFirst);\n\t\t\tif (a){\n\t\t\t\ta.src.search(/\\/s(\\d+).gif$/);\n\t\t\t\tgrid[dist[tipo - 1][i - 1]][RegExp.$1]++;\n\t\t\t}else{\n\t\t\t\tgrid[dist[tipo - 1][i - 1]][0]++;\n\t\t\t}\n\t\t}\n\n\t\t// Crea una tabla mostrando por cada tipo de recurso un representante de cada nivel que se ha encontrado\n\t\t// Muestra al lado de cada uno los recursos y tiempo restantes hasta poder subirlo de nivel\n\t\tvar table = document.createElement('TABLE');\n\t\ttable.setAttribute(\"class\", \"tbg\");\n\t\ttable.setAttribute(\"align\", \"center\");\n\t\ttable.setAttribute(\"cellspacing\", \"1\");\n\t\ttable.setAttribute(\"cellpadding\", \"2\");\n\t\tvar fila1 = document.createElement('TR');\n\t\tvar fila2 = document.createElement('TR');\n\t\tfila1.setAttribute(\"class\", \"rbg\");\t\n\t\ttable.appendChild(fila1);\n\t\ttable.appendChild(fila2);\n\t\tfor (var i = 0; i < 4; i++){\n\t\t\tvar td1 = elem('TD', '<img src=\"' + img('r/' + (i+1) + '.gif') + '\" width=\"18\" height=\"12\" border=\"0\" title=\"' + T('RECURSO' + (i+1)) + '\">');\n\t\t\tfila1.appendChild(td1);\n\n\t\t\tvar td2 = document.createElement('TD');\n\t\t\tfila2.appendChild(td2);\n\n\t\t\tvar table2 = document.createElement('TABLE');\n\t\t\ttable2.setAttribute(\"align\", \"center\");\n\t\t\ttd2.appendChild(table2);\n\t\t\tfor (var j = 0; j < 25; j++){\n\t\t\t\tif (grid[i][j] > 0 && buildingCost[i][j+1] != null){\n\t\t\t\t\tdatos = 1;\n\t\t\t\t\tvar fila3 = document.createElement('TR');\n\t\t\t\t\tvar imagen = '<div style=\"width: 0%;\"><img src=\"data:image/gif;base64,' + imagenes[\"r\" + i] + '\" border=\"0\" title=\"' + T('RECURSO' + (i+1)) + '\">';\n\t\t\t\t\tif (j > 0) imagen += '<img src=\"' + img('g/s/s' + j + '.gif') + '\" style=\"position:relative; bottom:52px; left: 27px;\" border=\"0\">';\n\t\t\t\t\timagen += '</div>';\n\t\t\t\t\tvar td = elem(\"TD\", imagen);\n\t\t\t\t\tfila3.appendChild(td);\n\n\t\t\t\t\tvar restante = calculateResourceTime(buildingCost[i][j+1]);\n\t\t\t\t\tvar td3 = document.createElement('TD');\n\t\t\t\t\ttd3.setAttribute('class', 'c f7');\n\t\t\t\t\tfila3.appendChild(td3);\n\t\t\t\t\ttable2.appendChild(fila3);\n\n\t\t\t\t\tif (restante != null) td3.innerHTML = restante;\n\t\t\t\t\telse td3.innerHTML = T('SUBIR_NIVEL');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\ttable.style.position = 'absolute';\n\t\ttable.setAttribute(\"id\", \"resumen\");\n\t\t// Se desplaza la tabla hacia abajo para no interferir con la lista de aldeas / enlaces derecha\n\t\ttable.style.top = 580 + longitudPantalla() + 'px';\n\t\tif (datos == 1) document.body.appendChild(table);\n\t}", "function hitungLuasPersegi(sisi) {\n var luas = sisi * sisi;\n return luas;\n}", "function staciakampoPlotas(ilgis, aukstis) {\n return ilgis * aukstis;\n}", "function hitungLuasSegiEmpat(sisi){\n //tidak ada nilai balik\n var luas = sisi * sisi\n return luas\n}", "function obliczPunkty(dane)\n{\n var ro = 1.21; // gęstośc czynnika\n var stosunek_et = [0.86, 0.98, 1, 0.966, 0.86]; // stosunek sprawności izentropowych\n\n var mi0 = (1 - (Math.sqrt(Math.sin(dane.beta2 * (Math.PI / 180))) / (Math.pow(dane.z, 0.7)))).toPrecision(3); // współczynnik zmniejszenia mocy wentylatora\n var u2 = ((dane.D2 * Math.PI * dane.n) / 60).toPrecision(3); // prędkość obwodowa wirnika\n var c2u = ((dane.deltapzn * 1000) / (ro * u2 * dane.etazn)).toPrecision(3); // prędkość zależna od ułopatkowania wirnika\n var fi2r = ((c2u * Math.tan(dane.alfa2 * Math.PI / 180)) / u2).toPrecision(3); // wskaźnik prędkości koła wirnikowego\n var fi2r0 = ((mi0 * fi2r) / (mi0 - (c2u / u2))).toPrecision(3); // wartośc wskaznika prędkości koła wirnikowego dla wartości zerowej charakterystyki koła wirnikowego\n var Qmax = (dane.Qzn * (fi2r0 / fi2r)).toPrecision(3); // przepływ maksymalny\n\n var krok = 0.6;\n\n var daneDoWykresu = {};\n daneDoWykresu.deltap = []; // tablica wartości sprężu (deltap)\n daneDoWykresu.Q = []; // tablica wartości wydajności\n daneDoWykresu.Q = []; // tablica wartości wydajności\n daneDoWykresu.eta = []; // etazn * stosunek_et\n\tdaneDoWykresu.wspQ = []; //współczynnik Q: 1-Q/Qmax\n\tdaneDoWykresu.mp = [] ; // tablica wartości mocy pobieranej\n\t\n /* obliczanie punktów charakterystyk */\n\t\n for (var i = 0; i < 5; i++)\n\t{\n daneDoWykresu.Q[i] = krok * dane.Qzn;\n daneDoWykresu.wspQ[i] = 1 - (daneDoWykresu.Q[i] / Qmax);\n daneDoWykresu.eta[i] = dane.etazn * stosunek_et[i];\n\t\tdaneDoWykresu.deltap[i] =((293/(273+dane.tc))*((ro * (Math.pow(u2, 2)) * mi0 * daneDoWykresu.wspQ[i] * daneDoWykresu.eta[i])) / 1000); // kPa\n\t\tdaneDoWykresu.mp[i] = ((daneDoWykresu.Q[i]*daneDoWykresu.deltap[i])/(daneDoWykresu.eta[i]*dane.etas))/100; // kW/100\n krok += 0.2;\n }\n return daneDoWykresu;\n}", "function calculation () {\n omega1 = Math.sqrt(G/L); // 1. Eigen-Kreisfrequenz (parallele Schwingung)\n omega2 = Math.sqrt(G/L+2*D/M); // 2. Eigen-Kreisfrequenz (antiparallele Schwingung)\n a1 = (alpha01+alpha02)/2; // Hilfsgröße \n a2 = (alpha01-alpha02)/2; // Hilfsgröße\n }", "function alfa_beta(glebia_ob, glebia_maks, glebia_maks_zapisz_ruch, alfa, beta)\n{\n let ruchy_teraz, element, bierka_zbita;\n\n if(tablica_transp[szachownica.hash])\n {\n if(tablica_transp.glebia > glebia_ob - glebia_maks)\n return tablica_transp[szachownica.hash].ocena;\n else if(tablica_transp.ruchy)\n ruchy_teraz = tablica_transp.ruchy;\n }\n\n if(!ruchy_teraz)\n ruchy_teraz = generuj_ruchy();\n\n // tu zrobic sortowanie ruchow\n\n if(glebia_ob <= glebia_maks_zapisz_ruch)\n element.ruchy = ruchy_teraz;\n \n if(szachownica.biale_ruch)\n {\n // wykonywanie zbic dla bialych\n for(let i = 0; i < ruchy_teraz.zbicia.length; i++)\n {\n let wiersz_p = ruchy_teraz.zbicia.wiersz_p, kolumna_p = ruchy_teraz.zbicia.kolumna_p;\n let wiersz_k = ruchy_teraz.zbicia.wiersz_k, kolumna_k = ruchy_teraz.zbicia.kolumna_k;\n let nr_kolumny_en_passant = szachownica.nr_kolumny_en_passant, bylo_w_przelocie = false, liczba_pol_ruch = szachownica.liczba_polowek_od_r;\n let nr_zbijanej = szachownica[wiersz_k][kolumna_k];\n let kopia_OOW = szachownica.mozna_roszada_biale_OO, kopia_OOOW = szachownica.mozna_roszada_biale_OOO;\n let kopia_OOB = szachownica.mozna_roszada_czarne_OO, kopia_OOOB = szachownica.mozna_roszada_czarne_OOO;\n let hash_kopia = szachownica.hash, ocena_kopia = szachownica.ocena;\n let poz_krol_biale = szachownica.poz_krol_biale, poz_krol_czarne = szachownica.poz_krol_czarne;\n\n if(szachownica.pola[wiersz_p][kolumna_p] === 6 && wiersz_p === 4 && kolumna_p !== kolumna_k && szachownica.pola[wiersz_k][kolumna_k] === 0) // bicie w przelocie\n {\n nr_kolumny_en_passant = szachownica.nr_kolumny_en_passant;\n bylo_w_przelocie = true;\n }\n\n wykonaj_ruch(ruchy_teraz.zbicia[i]);\n\n beta = Math.min(beta, alfa_beta(glebia_ob + 1, glebia_maks, glebia_maks_zapisz_ruch, alfa, beta));\n\n // cofnij ruch!!!\n if(bylo_w_przelocie)\n {\n szachownica.pola[wiersz_k][kolumna_k] = 0;\n szachownica.pola[wiersz_p][kolumna_p] = 6;\n szachownica.pola[wiersz_p][kolumna_k] = 12;\n }\n else\n {\n szachownica.pola[wiersz_p][kolumna_p] = szachownica.pola[wiersz_k][kolumna_k];\n szachownica.pola[wiersz_k][kolumna_k] = nr_zbijanej;\n }\n\n szachownica.hash = hash_kopia;\n szachownica.ocena = ocena_kopia;\n\n szachownica.biale_ruch = !szachownica.biale_ruch;\n szachownica.nr_kolumny_en_passant = nr_kolumny_en_passant;\n szachownica.liczba_polowek_od_r = liczba_pol_ruch;\n\n szachownica.mozna_roszada_biale_OO = kopia_OOW;\n szachownica.mozna_roszada_biale_OOO = kopia_OOOW;\n szachownica.mozna_roszada_czarne_OO = kopia_OOB;\n szachownica.mozna_roszada_czarne_OOO = kopia_OOOB;\n\n szachownica.poz_krol_biale = poz_krol_biale;\n szachownica.poz_krol_czarne = poz_krol_czarne;\n\n if(alfa >= beta)\n break;\n }\n\n // wykonywanie ruchow dla bialych\n if(glebia_ob <= glebia_maks && alfa < beta)\n {\n for(let i = 0; i < ruchy_teraz.ruchy.length; i++)\n {\n wykonaj_ruch(ruchy_teraz.ruchy[i]);\n\n if(szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k] === 6 && ruch_t.wiersz_k === 7)\n {\n // promocja biale\n for(let j = 2; j < 6; j++)\n {\n promuj_piona(ruch_t.wiersz_k, ruch_t.kolumna_k, j);\n\n beta = Math.min(beta, alfa_beta(glebia_ob + 1, glebia_maks, glebia_maks_zapisz_ruch, alfa, beta));\n\n // odpromuj piona!!!\n\n if(alfa >= beta)\n break;\n }\n }\n else\n {\n // normalny ruch biale\n beta = Math.min(beta, alfa_beta(glebia_ob + 1, glebia_maks, glebia_maks_zapisz_ruch, alfa, beta));\n }\n\n // cofnij ruch!!!\n\n if(alfa >= beta)\n break;\n }\n }\n\n element.glebia = glebia_maks - glebia_ob;\n element.ocena = beta;\n\n return beta;\n }\n else\n {\n // wykonywanie zbic dla czarnych\n for(let i = 0; i < ruchy_teraz.zbicia.length; i++)\n {\n wykonaj_ruch(ruchy_teraz.zbicia[i]);\n\n alfa = Math.max(alfa, alfa_beta(glebia_ob + 1, glebia_maks, glebia_maks_zapisz_ruch, alfa, beta));\n\n // cofnij ruch!!!\n\n if(alfa >= beta)\n break;\n }\n\n // wykonywanie ruchow dla czarnych\n if(glebia_ob <= glebia_maks && alfa < beta)\n {\n for(let i = 0; i < ruchy_teraz.ruchy.length; i++)\n {\n wykonaj_ruch(ruchy_teraz.ruchy[i]);\n\n if(szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k] === 6 && ruch_t.wiersz_k === 7)\n {\n // promocja biale\n for(let j = 2; j < 6; j++)\n {\n promuj_piona(ruch_t.wiersz_k, ruch_t.kolumna_k, j);\n\n beta = Math.max(beta, alfa_beta(glebia_ob + 1, glebia_maks, glebia_maks_zapisz_ruch, alfa, beta));\n\n // odpromuj piona!!!\n\n if(alfa >= beta)\n break;\n }\n }\n else\n {\n // normalny ruch biale\n alfa = Math.max(alfa, alfa_beta(glebia_ob + 1, glebia_maks, glebia_maks_zapisz_ruch, alfa, beta));\n }\n\n // cofnij ruch!!!\n\n if(alfa >= beta)\n break;\n }\n }\n\n element.glebia = glebia_maks - glebia_ob;\n element.ocena = alfa;\n\n return alfa;\n }\n}", "function trasf_equa_azim(njd,Ar,De,Long,Lat){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) giugno 2013\n // njd= numero del giorno giuliano dell'istante da calcolare riferito al T.U.\n // Ar= ascensione retta in ore decimali.\n // De= declinazione in gradi sessadecimali\n // Long= Longitudine dell'osservatore =- per ovest rispetto a Greenwich\n // Lat= Latitudine dell'osservatore.\n\nvar ang_H=angolo_H(njd,Ar,Long); // calcolo dell'angolo orario H.\n\n // trasformare gli angoli sessadecimali in radianti.\n\n ang_H=Rad(ang_H*15); \n Ar= Rad(Ar*15); \n De= Rad(De); \n Long=Rad(Long); \n Lat= Rad(Lat); \n \n // angolo_a=altezza sull'orizzonte dell'astro. \n\nvar angolo_a=Math.sin(De)*Math.sin(Lat)+Math.cos(De)*Math.cos(Lat)*Math.cos(ang_H);\n angolo_a=Math.asin(angolo_a); // in radianti.\n angolo_a=Rda(angolo_a); // altezza dell'astro in gradi. \n \nvar azimut=(Math.sin(De)-Math.sin(Lat)*Math.sin(Rad(angolo_a)))/(Math.cos(Lat)*Math.cos(Rad(angolo_a)));\n azimut=Math.acos(azimut); \n azimut=Rda(azimut);\n\nazimut=(Math.sin(ang_H)<0) ? (azimut=azimut):(azimut=360-azimut); // operatore ternario.\n\nvar coord_azimut= new Array(angolo_a,azimut) ; // restituisce 2 valori: altezza e azimut.\n\nreturn coord_azimut;\n\n// NOTE SUL CALCOLO: \n// Se il seno di ang_H(angolo orario) è negativo (>180°) azimut=azimut, se positivo azimut=360-azimut\n\n}", "function eqsol(anno){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) ottobre 2010.\n // calcola la data degli equinozi e dei solstizi per l'anno indicato nel parametro.\n\n\nvar Y=anno;\nvar y1=Y/1000;\n\nvar jd1=1721139.2855+365.2421376*Y+0.0679190*y1*y1-0.0027879*y1*y1*y1; // EQUINOZIO DI MARZO\n\nvar jd2=1721233.2486+365.2417284*Y-0.0530180*y1*y1+0.0093320*y1*y1*y1; // SOLSTIZIO DI GIUGNO\n\nvar jd3=1721325.6978+365.2425055*Y-0.1266890*y1*y1+0.0019401*y1*y1*y1; // EQUINOZIO DI SETTEMBRE\n\nvar jd4=1721414.3920+365.2428898*Y-0.0109650*y1*y1-0.0084885*y1*y1*y1; // SOLSTIZIO DI DICEMBRE\n\nvar tempi= new Array(jd1,jd2,jd3,jd4);\n\nreturn tempi;\n\n\n}", "function regen() {\n minp = maxp\n let n, i, j\n for (i = 0; i < width; i++) {\n for (j = 0; j < height; j++) {\n n = grid[i][j]\n if (n>0) { // if this pixel has tally 0 then just ignore it\n if (tah[n]===undefined) { tah[n] = 1 } else { tah[n]++ } \n if (n<minp) minp = n \n }\n }\n }\n let sum = 0\n Object.keys(tah).forEach(i => {\n sum += (calg===2 ? 1 : \n calg===3 ? log(tah[i]) : \n calg===4 ? sqrt(tah[i]) :\n calg===5 ? tah[i] :\n calg===6 ? tah[i]**1.5 :\n calg===7 ? tah[i]**2 :\n calg===8 ? tah[i]**3 : \n 1)\n tah[i] = sum\n })\n const a = tah[minp]\n Object.keys(tah).forEach(i => { tah[i] = (tah[i]-a)/(sum-a) })\n // now tah[minp] is 0 and tah[maxp] is 1\n rx = minx\n}", "function Filtros(filtros){\n\n if(filtros==\"Normal\"){\n var ctx = canvasF.getContext('2d');\n ctx.drawImage(imgEspejo,0,0,canvasW, canvasH);\n \n }\n \n else if(filtros==\"Blanco y Negro\"){\n var ctx = canvasOrg.getContext('2d');\n let data= ctx.getImageData(0,0,canvasW,canvasH);\n for(let i =0; i<data.data.length; i++){\n let red= data.data[i*4];\n let blue= data.data[i*4+1];\n let green= data.data[i*4+2];\n let valor=(red+blue+green)/3\n\n data.data[i*4]=valor;\n data.data[i*4+1]=valor;\n data.data[i*4+2]=valor;\n }\n contextF.putImageData(data,0,0);\n \n }\n else if(filtros==\"Negativo\"){\n var ctx = canvasOrg.getContext('2d');\n let data= ctx.getImageData(0,0,canvasW,canvasH);\n for (var i = 0; i < data.data.length; i += 4) {\n data.data[i] = 255 - data.data[i]; // rojo\n data.data[i + 1] = 255 - data.data[i + 1]; // verde\n data.data[i + 2] = 255 - data.data[i + 2]; // azul\n }\n contextF.putImageData(data,0,0);\n \n }\n\n else if(filtros==\"Espejo\"){\n var ctx = canvasF.getContext('2d');\n ctx.translate(canvasW,0);\n ctx.scale(-1,1);\n ctx.drawImage(imgEspejo,0,0,canvasW, canvasH);\n normalway();\n }\n else if(filtros==\"Sepia\"){\n var ctx = canvasOrg.getContext('2d');\n let data= ctx.getImageData(0,0,canvasW,canvasH);\n \n for (var i = 0; i < data.data.length; i += 4) {\n var r, g, b;\n r = data.data[i];\n g = data.data[i + 1];\n b = data.data[i + 2];\n\n data.data[i] = 0.3 * (r + g + b);\n data.data[i + 1] = 0.25 * (r + g + b);\n data.data[i + 2] = 0.20 * (r + g + b);\n }\n contextF.putImageData(data,0,0);\n\n }\n\n else if(filtros==\"Rojo\"){\n //este es rojo con detalles negros\n //para hacer rojo con detalles \"normales\"/blancos se cambia el rojo quitando el 255 y agregando el +\n var ctx = canvasOrg.getContext('2d');\n let data= ctx.getImageData(0,0,canvasW,canvasH);\n for (var i = 0; i < data.data.length; i += 4) {\n data.data[i] = + data.data[i]; // rojo\n data.data[i + 1] = - data.data[i]; // verde\n data.data[i + 2] = - data.data[i]; // azul\n\n }\n contextF.putImageData(data,0,0);\n\n }\n else if(filtros==\"Rojo/Azul\"){\n var ctx = canvasOrg.getContext('2d');\n let data= ctx.getImageData(0,0,canvasW,canvasH);\n for (var i = 0; i < data.data.length; i += 4) {\n data.data[i] =255 - data.data[i]; // rojo\n data.data[i + 1] = - data.data[i]; // verde\n data.data[i + 2] = 255- data.data[i]; // azul\n\n }\n contextF.putImageData(data,0,0);\n\n }\n\n \n else if(filtros==\"Rojo Menta\"){\n var ctx = canvasOrg.getContext('2d');\n let data= ctx.getImageData(0,0,canvasW,canvasH);\n for (var i = 0; i < data.data.length; i += 4) {\n data.data[i] = 255- data.data[i]; // rojo\n data.data[i + 1] = 255- data.data[i]; // verde\n data.data[i + 2] = 255 - data.data[i]; // azul\n \n }\n contextF.putImageData(data,0,0);\n\n }\n else if(filtros==\"Rayos X\"){\n var ctx = canvasOrg.getContext('2d');\n let data= ctx.getImageData(0,0,canvasW,canvasH);\n for (var i = 0; i < data.data.length; i += 4) {\n data.data[i] =255 - data.data[i]; // rojo\n data.data[i + 1] = + data.data[i]; // verde\n data.data[i + 2] = + data.data[i]; // azul\n \n }\n contextF.putImageData(data,0,0);\n\n }\n }", "function predict(_entradaX=0, _entradaY=0){\n //atribui os parâmetros nas variáveis globais\n entradaX = _entradaX;\n entradaY = _entradaY;\n\n let classeEntrada = 0;\n const raiz = raizes();\n\n let indiceMenor = -1;\n let menor = Infinity; //infinito para que na primeira rodada do if a raiz[i] seja menor\n\n //percorre a raiz -> a raiz menor é que prediz qual é a classe\n for(let i = 0; i < raiz.length; i++){\n if(raiz[i] <= menor){\n menor = raiz[i];\n indiceMenor = i;\n }\n }\n\n classeEntrada = classe[indiceMenor];\n return classeEntrada;\n}", "caricaFlussi() {\n\t\tthis.serviceFlussi.all(this.riempiFlussi)\n\t}", "function R(e, t, n, r, o, i, a, s) {\n for (var u, l, c, p, d, f, h, m, g = [], v = [ [], [] ], y = 0; y < 2; ++y) if (0 == y ? (l = 6 * e - 12 * n + 6 * o, \n u = -3 * e + 9 * n - 9 * o + 3 * a, c = 3 * n - 3 * e) : (l = 6 * t - 12 * r + 6 * i, \n u = -3 * t + 9 * r - 9 * i + 3 * s, c = 3 * r - 3 * t), $(u) < 1e-12) {\n if ($(l) < 1e-12) continue;\n 0 < (p = -c / l) && p < 1 && g.push(p);\n } else h = l * l - 4 * c * u, m = q.sqrt(h), h < 0 || (d = (-l + m) / (2 * u), 0 < d && d < 1 && g.push(d), \n 0 < (f = (-l - m) / (2 * u)) && f < 1 && g.push(f));\n for (var b, x = g.length, C = x; x--; ) p = g[x], b = 1 - p, v[0][x] = b * b * b * e + 3 * b * b * p * n + 3 * b * p * p * o + p * p * p * a, \n v[1][x] = b * b * b * t + 3 * b * b * p * r + 3 * b * p * p * i + p * p * p * s;\n return v[0][C] = e, v[1][C] = t, v[0][C + 1] = a, v[1][C + 1] = s, v[0].length = v[1].length = C + 2, \n {\n min: {\n x: W.apply(0, v[0]),\n y: W.apply(0, v[1])\n },\n max: {\n x: V.apply(0, v[0]),\n y: V.apply(0, v[1])\n }\n };\n }", "function fl_outToGvina ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "enhetspris() {\n return this.pris / this.antall;\n }", "calculVitesseX(){\r\n //rajout de 1 facteur\r\n if (this.vitesseXFacteur < this.limiteFacteur){\r\n this.vitesseXFacteur +=1; // faire en fonction de la largeur du terrain\r\n }\r\n else {/*rien car la vitesse ne peux pas depasser la limite*/}\r\n }", "function getPelnas(pajamos, mokesciai, mokesciai2){\nvar pelnas = (pajamos - (pajamos * mokesciai)) - (pajamos - (pajamos * mokesciai)) * mokesciai2;\n return pelnas;\n}", "function sfera (r,gradi,alpha,trasla) {\n if (trasla === undefined) {\n trasla = [];\n };\n var tx = trasla[0] || 0;\n var ty = trasla[1] || 0;\n var tz = trasla[2] || 0;\n\n var funzione = function (p) {\n var a = p[0] * PI/2;\n var b = alpha + p[1] * gradi;\n\n return [tx + r * COS(a) * SIN(b),ty + r * COS(a) * COS(b),tz + r * SIN(a)];\n }\n\n return funzione;\n}", "function semicerchioR (r,scala) {\n var funzione = function (p) { \n var u = p[0] * PI/2;\n var x = r * SIN(u);\n var y = 0;\n var z = r * COS(u);\n \n return ruotaPunti([x,y,z*scala]);\n };\n\n return funzione;\n}", "function dvakrat(cislo) {\r\n return cislo * 2;\r\n}", "function cfasi_lunari(mese,anno,fase){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) Luglio 2010\n // funzione per il calcolo delle fasi lunari.\n // mese= numero del mese da 1 a 12.\n // anno=anno di riferimento.\n // k=0.00 per la luna nuova\n // k=0.25 per il primo quarto.\n // k=0.50 per la luna piena\n // k=0.75 per l'ultimo quarto.\n // fase= valore numerico per la fase 0 - 0.25 - 0.50 - 0.75 sono ammessi solo questi valori.\n \nvar anno_dec=anno+(mese/12);\nvar k=(anno_dec-1900)*12.3685; // calcolo della costante k. (parseInt) tronca la parte decimale\n k=parseInt(k)*1+fase*1;\n \nvar T=k/1236.85;\n\nvar fseno=166.56+132.87*T-0.009173*T*T;\n fseno=fseno/180*Math.PI;\n\nvar njd_fase =2415020.75933+29.53058868*k+0.0001178*T*T-0.000000155*T*T*T+0.00033*Math.sin(fseno);\n\n // calcolo anomalia media del sole.\n\nvar M=359.2242+29.10535608*k-0.0000333*T*T-0.00000347*T*T*T;\n M=gradi_360(M);\n M=M/180*Math.PI;\n\n // calcolo anomalia media della luna.\n\nvar M1=306.0253+385.81691806*k+0.0107306*T*T+0.00001236*T*T*T;\n M1=gradi_360(M1);\n M1=M1/180*Math.PI;\n\n // calcolo dell'argomento della latitudine della luna.\n\nvar F=21.2964+390.67050646*k-0.0016528*T*T-0.00000239*T*T*T;\n F=gradi_360(F);\n F=F/180*Math.PI;\n\n // calcolo correzioni per la luna nuova e piena.\n\nvar correzione1=0;\n\nif (fase==0 || fase==0.50) {\n \n correzione1= (0.1734-0.000393*T)*Math.sin(M)\n +0.0021*Math.sin(2*M)\n -0.4068*Math.sin(M1)\n +0.0161*Math.sin(2*M1)\n -0.0004*Math.sin(3*M1)\n +0.0104*Math.sin(2*F)\n -0.0051*Math.sin(M+M1)\n -0.0074*Math.sin(M-M1)\n +0.0004*Math.sin(2*F+M)\n -0.0004*Math.sin(2*F-M)\n -0.0006*Math.sin(2*F+M1)\n +0.0010*Math.sin(2*F-M1)\n +0.0005*Math.sin(M+2*M1); \n}\n\nelse if (fase==0.25 || fase==0.75) {\n \n correzione1= (0.1721-0.0004*T)*Math.sin(M)\n +0.0021*Math.sin(2*M)\n -0.6280*Math.sin(M1)\n +0.0089*Math.sin(2*M1)\n -0.0004*Math.sin(3*M1)\n +0.0079*Math.sin(2*F)\n -0.0119*Math.sin(M+M1)\n -0.0047*Math.sin(M-M1)\n +0.0003*Math.sin(2*F+M)\n -0.0004*Math.sin(2*F-M)\n -0.0006*Math.sin(2*F+M1)\n +0.0021*Math.sin(2*F-M1)\n +0.0003*Math.sin(M+2*M1)\n +0.0004*Math.sin(M-2*M1)\n -0.0003*Math.sin(2*M+M1); \n}\n\nelse {alert(\"Valore fase \"+fase+\" non valido!\");}\n\nvar njd_fase=njd_fase+correzione1; // per la luna nuova.\n\n // njd_fase= numero dei giorni giuliani.\nreturn njd_fase;\n\n}", "function hitungFVA() {\n\t\tvar MASKBr = document.getElementById(\"fva1\").value;\n\t\tvar MASKBi = document.getElementById(\"fva2\").value;\n\t\tvar MASKBn = document.getElementById(\"fva3\").value;\n\n\t\tvar Br = MASKBr.split(',').join('');\n\t\tvar Bi = MASKBi.split(',').join('');\n\t\tvar Bn = MASKBn.split(',').join('');\n\n\t\tvar Bip = Bi / 100;\n\t\tvar Bpengalifv = ( (Math.pow(1+Bip,Bn)) - 1 ) / Bip;\n\t\tvar Bfva = Math.round(Br * Bpengalifv);\n\t\tdocument.getElementById(\"outputFVA\").innerHTML = \n\t\t\"Faktor Pengali FVanuitas : \\n\"+\n\t\t\"\t\t= ( ( 1 + i )^n - 1 ) / i \\n\"+\n\t\t\"\t\t= ( (1 + \"+ Bip +\")^\"+ Bn +\" - 1 ) / \"+ Bip +\" \\n\"+\n\t\t\"\t\t= \"+ Bpengalifv.toFixed(4) +\" \\n\"+\n\t\t\"Future Value Anuitas : \\n\"+\n\t\t\"\t\t= R x Faktor Pengali Fvanuitas \\n\"+\n\t\t\"\t\t= Rp. \"+ MASKBr +\" x \"+ Bpengalifv.toFixed(4) +\" \\n\"+\n\t\t\"\t\t= \"+ uang(Bfva, \"Rp.\");\n\t\t}", "function spindulioReiksme () {\n// let ivedimoLaukas = document.querySelector('div input');\n let r = document.querySelector('div input').value;\n let plotas= Math.PI*r*r\n\n// console.log(plotas);\ndocument.querySelector(\".apskritimo-plotas\").innerHTML = plotas;\n}", "function zmien_ocene(ruch_t)\n{\n let nr_bierki_p = szachownica.pola[ruch_t.wiersz_p][ruch_t.kolumna_p];\n let nr_bierki_k = szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k];\n\n if(nr_bierki_k !== 0)\n zmien_ocene_usun(ruch_t.wiersz_k, ruch_t.kolumna_k);\n\n szachownica.ocena.tablice += wartosc_tabela(ruch_t.wiersz_k, ruch_t.kolumna_k, nr_bierki_p) - wartosc_tabela(ruch_t.wiersz_p, ruch_t.kolumna_p, nr_bierki_p);\n szachownica.ocena.tablice_koncowka += wartosc_tabela_konc(ruch_t.wiersz_k, ruch_t.kolumna_k, nr_bierki_p) - wartosc_tabela_konc(ruch_t.wiersz_p, ruch_t.kolumna_p, nr_bierki_p);\n}", "function dibujar_protesis_fija(canvas){\r\n\tif (i_inic<=i_final){\r\n\t//var px=87;\r\n\t//var py=129;\r\n\t//var numi=0;\r\n\t\r\n\tvar i= i_inic+1;\r\n\t var i_inic_s= i_inic+1;\r\n\t \r\n\t//dibujar diente sano antes de convencion\r\n\tdibujar_diente_sano_alr(canvas,pxi, pyi,i_inic);\r\n\tdibujar_diente_sano (canvas,cara1,i_inic);\r\n\tdibujar_diente_sano (canvas,cara2,i_inic);\r\n\tdibujar_diente_sano (canvas,cara3,i_inic);\r\n\tdibujar_diente_sano (canvas,cara4,i_inic);\r\n\tdibujar_diente_sano (canvas,cara5,i_inic);\r\n \r\n\t//dibujar diente sano en dientes medios\r\n\tfor ( i_inic_s; i_inic_s<i_final; i_inic_s++) {\r\n\t\t//dibujar diente sano antes de convencion\r\n\t\tdibujar_diente_sano_alr(canvas,pxi, pyi,i_inic_s);\r\n\t\tdibujar_diente_sano (canvas,cara1,i_inic_s);\r\n\t\tdibujar_diente_sano (canvas,cara2,i_inic_s);\r\n\t\tdibujar_diente_sano (canvas,cara3,i_inic_s);\r\n\t\tdibujar_diente_sano (canvas,cara4,i_inic_s);\r\n\t\tdibujar_diente_sano (canvas,cara5,i_inic_s);\r\n\t\t\r\n\t\t\r\n\t}\r\n\t//dibujar diente sano antes de convencion\r\n\tdibujar_diente_sano_alr(canvas,pxf, pyf,i_final);\r\n\tdibujar_diente_sano (canvas,cara1,i_final);\r\n\tdibujar_diente_sano (canvas,cara2,i_final);\r\n\tdibujar_diente_sano (canvas,cara3,i_final);\r\n\tdibujar_diente_sano (canvas,cara4,i_final);\r\n\tdibujar_diente_sano (canvas,cara5,i_final);\r\n\t\r\n\t//dibujar protesis fija en diente inicial\r\n\tdibujar_protesis_fija_inicial(canvas,protesisim,i_inic);\r\n\t\r\n\t//dibujar protesis fija en dientes medios\r\n\tfor ( i; i<i_final; i++) {\r\n\t\r\n\t\t//dibujar convencion\r\n\t\tdibujar_protesis_fija_media(canvas,protesisim,i);\r\n\t\t\r\n\t}\r\n\t\r\n\t//dibujar protesis fija en diente final\r\n\tdibujar_protesis_fija_final(canvas,protesisf,i_final);\r\n\t//\r\n\t\r\n\t\r\n\ti=0;\r\n\ti_inic=0;\r\n\ti_final=0;\r\n\tpxi=0;\r\n\tpxf=0;\r\n\tpyi=0;\r\n\tpyf=0;\r\n\tsw_punto_inic =false;\r\n\tsw_punto_final =false;\r\n\tsector_inicial=0;\r\n\tsector_final=0;\r\n\t//protesisf.length=0;\r\n\t//protesisim.length=0;\r\n\t\r\n\t\r\n\t}else{\r\n\t\tvar i= i_final+1;\r\n\t\tvar i_inic_s= i_final+1;\r\n\t\t \r\n\t\t//dibujar diente sano antes de convencion\r\n\t\tdibujar_diente_sano_alr(canvas,pxi, pyi,i_inic);\r\n\t\tdibujar_diente_sano (canvas,cara1,i_inic);\r\n\t\tdibujar_diente_sano (canvas,cara2,i_inic);\r\n\t\tdibujar_diente_sano (canvas,cara3,i_inic);\r\n\t\tdibujar_diente_sano (canvas,cara4,i_inic);\r\n\t\tdibujar_diente_sano (canvas,cara5,i_inic);\r\n\t \r\n\t\t//dibujar diente sano en dientes medios\r\n\t\tfor ( i_inic_s; i_inic_s<i_inic; i_inic_s++) {\r\n\t\t\t//dibujar diente sano antes de convencion\r\n\t\t\tdibujar_diente_sano_alr(canvas,pxi, pyi,i_inic_s);\r\n\t\t\tdibujar_diente_sano (canvas,cara1,i_inic_s);\r\n\t\t\tdibujar_diente_sano (canvas,cara2,i_inic_s);\r\n\t\t\tdibujar_diente_sano (canvas,cara3,i_inic_s);\r\n\t\t\tdibujar_diente_sano (canvas,cara4,i_inic_s);\r\n\t\t\tdibujar_diente_sano (canvas,cara5,i_inic_s);\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t//dibujar diente sano antes de convencion\r\n\t\tdibujar_diente_sano_alr(canvas,pxf, pyf,i_final);\r\n\t\tdibujar_diente_sano (canvas,cara1,i_final);\r\n\t\tdibujar_diente_sano (canvas,cara2,i_final);\r\n\t\tdibujar_diente_sano (canvas,cara3,i_final);\r\n\t\tdibujar_diente_sano (canvas,cara4,i_final);\r\n\t\tdibujar_diente_sano (canvas,cara5,i_final);\r\n\t\t//dibujar protesis fija en diente inicial\r\n\t\tdibujar_protesis_fija_inicial(canvas,protesisim,i_final);\r\n\t\t\r\n\t\t//dibujar protesis fija en dientes medios\r\n\t\tfor ( i; i<i_inic; i++) {\r\n\t\t\tdibujar_protesis_fija_media(canvas,protesisim,i);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//dibujar protesis fija en diente final\r\n\t\tdibujar_protesis_fija_final(canvas,protesisf,i_inic);\r\n\t\ti=0;\r\n\t\ti_inic=0;\r\n\t\ti_final=0;\r\n\t\tpxi=0;\r\n\t\tpxf=0;\r\n\t\tpyi=0;\r\n\t\tpyf=0;\r\n\t\tsw_punto_inic =false;\r\n\t\tsw_punto_final =false;\r\n\t\tsector_inicial=0;\r\n\t\tsector_final=0;\r\n\t\t//protesisf.length=0;\r\n\t\t//protesisim.length=0;\r\n\t\t\r\n\t}\r\n\t\r\n\t\r\n\r\n}", "function getRaspored() {\n var data, dataL;\n data = fetchRasp(smjena);\n dataL = data.length;\n trajanje = trajanjeFn(data[0]);\n\n // Biranje između učenika i profesora\n if (osoba == \"Učenik\") {\n getUcenik(data, dataL);\n } else if (osoba == \"Profesor\" && smjena != \"A/B\") {\n getProfesor(data, dataL);\n } else {\n getProfesorAB(data);\n }\n }", "function Iluminacao(pl, ka, ia, kd, od, ks, il, n) {\n this.pl = pl; //posições originais da fonte de luz em coordenadas de mundo\n this.pl_pvista_camera = pl; //adapta as posiçoes de entrada para o ponto de vista da camera\n this.ka = ka; // reflexão de luz ambiente (quanto maior, mais reflexível é)\n this.ia = ia; // intensidade da luz ambiente (quanto maior, mais iluminado kkk)\n this.kd = kd; // constante difusa, o quão espalhável é essa luz\n this.od = od; // vetor difuso, usado para simplesmente espalhar kkk\n this.ks = ks; // parte especular, como a luz vai ser refletida no objeto\n this.il = il; // cor da fonte de luz\n this.n = n; // constante de rugosidade, trata irregularidades, ruídos, enfim, frescura.\n}", "function inverse$i(p) {\n var n;\n var x = p.x;\n var y = p.y;\n\n var delta_x = x - this.x0;\n var delta_y = y - this.y0;\n\n // 1. Calculate z\n var z_re = delta_y / this.a;\n var z_im = delta_x / this.a;\n\n // 2a. Calculate theta - first approximation gives km accuracy\n var z_n_re = 1;\n var z_n_im = 0; // z^0\n var z_n_re1;\n var z_n_im1;\n\n var th_re = 0;\n var th_im = 0;\n for (n = 1; n <= 6; n++) {\n z_n_re1 = z_n_re * z_re - z_n_im * z_im;\n z_n_im1 = z_n_im * z_re + z_n_re * z_im;\n z_n_re = z_n_re1;\n z_n_im = z_n_im1;\n th_re = th_re + this.C_re[n] * z_n_re - this.C_im[n] * z_n_im;\n th_im = th_im + this.C_im[n] * z_n_re + this.C_re[n] * z_n_im;\n }\n\n // 2b. Iterate to refine the accuracy of the calculation\n // 0 iterations gives km accuracy\n // 1 iteration gives m accuracy -- good enough for most mapping applications\n // 2 iterations bives mm accuracy\n for (var i = 0; i < this.iterations; i++) {\n var th_n_re = th_re;\n var th_n_im = th_im;\n var th_n_re1;\n var th_n_im1;\n\n var num_re = z_re;\n var num_im = z_im;\n for (n = 2; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n num_re = num_re + (n - 1) * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);\n num_im = num_im + (n - 1) * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);\n }\n\n th_n_re = 1;\n th_n_im = 0;\n var den_re = this.B_re[1];\n var den_im = this.B_im[1];\n for (n = 2; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n den_re = den_re + n * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);\n den_im = den_im + n * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);\n }\n\n // Complex division\n var den2 = den_re * den_re + den_im * den_im;\n th_re = (num_re * den_re + num_im * den_im) / den2;\n th_im = (num_im * den_re - num_re * den_im) / den2;\n }\n\n // 3. Calculate d_phi ... // and d_lambda\n var d_psi = th_re;\n var d_lambda = th_im;\n var d_psi_n = 1; // d_psi^0\n\n var d_phi = 0;\n for (n = 1; n <= 9; n++) {\n d_psi_n = d_psi_n * d_psi;\n d_phi = d_phi + this.D[n] * d_psi_n;\n }\n\n // 4. Calculate latitude and longitude\n // d_phi is calcuated in second of arc * 10^-5, so we need to scale back to radians. d_lambda is in radians.\n var lat = this.lat0 + (d_phi * SEC_TO_RAD * 1E5);\n var lon = this.long0 + d_lambda;\n\n p.x = lon;\n p.y = lat;\n\n return p;\n}", "function completitud(oa, es){\n var titulo=0; var keyword=0; var descripcion=0; var autor=0;\n var tipoRE=0; var formato=0; var contexto=0; var idioma=0;\n var tipointer=0; var rangoedad=0; var nivelagregacion=0;\n var ubicacion=0; var costo=0; var estado=0; var copyright=0;\n\n // verifica que la variable tenga un valor y asigna el peso a las variables\n if (oa.title!=\"\") {\n titulo=0.15;\n }\n if (oa.keyword!=\"\") {\n keyword=0.14;\n }\n if (oa.description!=\"\") {\n descripcion=0.12;\n }\n if (oa.entity!=\"\") {\n autor=0.11;\n }\n if (oa.learningresourcetype!=\"\") {\n tipoRE=0.09;\n }\n if (oa.format!=\"\") {\n formato=0.08;\n }\n\n \n // hace la comprobacion cuantos contextos existe en el objeto\n var context=oa.context;\n // cuenta cuantas ubicaciones tiene el objeto\n var can=context.length;\n // asigna el nuevo peso que tendra cada contexto\n var pesocontexto=0.06/can;\n // comprueba que los contextos sean diferentes a vacio o a espacio \n for (var w=0; w <can ; w++) { \n if (context[w]!=\"\") {\n // calcula el nuevo peso para entregar para el calculo de la metrica\n contexto=contexto+pesocontexto;\n }\n }\n\n\n\n\n\n if (oa.language!=\"\") {\n idioma=0.05;\n }\n if (oa.interactivitytype!=\"\") {\n tipointer=0.04;\n }\n if (oa.typicalagerange!=\"\") {\n rangoedad=0.03;\n }\n if (oa.aggregationlevel!=\"\") {\n nivelagregacion=0.03;\n }\n // hace la comprobacion cuantas ubicaciones existe en el objeto\n var location=oa.location;\n // cuenta cuantas ubicaciones tiene el objeto\n var can=location.length;\n // asigna el nuevo peso que tendra cada ubicacion\n var peso=0.03/can;\n // comprueba que las ubicaciones sean diferentes a vacio o a espacio \n for (var i=0; i <can ; i++) { \n if (location[i]!=\"\") {\n // calcula el nuevo peso para entregar para el calculo de la metrica\n ubicacion=ubicacion+peso;\n }\n }\n \n\n if (oa.cost!=\"\") {\n costo=0.03;\n }\n if (oa.status!=\"\") {\n estado=0.02;\n }\n if (oa.copyrightandotherrestrictions!=\"\") {\n copyright=0.02;\n }\n\n \n \n // hace la sumatoria de los pesos \n var m_completitud=titulo + keyword + descripcion + autor + tipoRE + formato + contexto + idioma +\n tipointer + rangoedad + nivelagregacion + ubicacion + costo + estado + copyright;\n\n \n //alert(mensaje);\n return m_completitud;\n \n //echo \"* Completitud de: \".m_completitud.\"; \".evaluacion.\"<br>\";\n }", "function beratBadanWanita(tinggi){\r\n let ideal = (tinggi - 100) - (tinggi -100) * 0.15\r\n return `Wanita = ${ideal} Kg`; \r\n}", "function fl_outToOznei_aman ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function screw(ilgis, zingsnis, pasukimas) {\n const sriegiai = ilgis / zingsnis;\n const laipsniai = sriegiai * 360;\n const ats = laipsniai / pasukimas;\n return ats;\n}", "function TinhTheoLoaiXe(sokm, tgcho, giaLoai1, giaLoai2, giaLoai3, tgChoTheoLoai) {\n var tien = 0;\n if (sokm <= 1) {\n tien = sokm * giaLoai1 + tgcho * tgChoTheoLoai;\n // console.log(tien);\n } else if (sokm > 1 && sokm < 21) {\n tien = giaLoai1 + (sokm - 1) * giaLoai2 + tgcho * tgChoTheoLoai;\n // console.log(tien);\n } else if (sokm >= 21) {\n tien = giaLoai1 + 19 * giaLoai2 + (sokm - 20) * giaLoai3 + tgcho * tgChoTheoLoai;\n // console.log(tien);\n }\n return document.getElementById('xuatTien').innerHTML = tien + ' vnđ';\n}", "getResultado(f, l, n) {\n //Seteamos la Funcion Original y el Arreglo de Variables\n core.setFunction('f', l, f); //Hacemos uso de la biblioteca Nerdamer para las derivadas paraciales\n\n this.derivX = core.diff(f, l[0]);\n this.derivY = 0; //Verificamos si es multivariada la funcion.\n\n if (f.indexOf('y') !== null) {\n this.derivY = core.diff(f, l[1]);\n } else {\n this.derivY = 0;\n } //Visualizamos por consola las derivadas\n //console.log('dX: ', this.derivX.text());\n //console.log('dY: ', this.derivY.text());\n //Generamos t symbol\n\n\n t = new nerdamer(\"t\"); //console.log(t.text());\n\n if (n === 'a') {\n //evaluamos las derivadas parciales de la funcion, con los valores parciales del nodo\n this.evaluador(this.derivX, this.derivY, this.valoresParciales);\n this.getT(n); //para hidden layers\n\n let result = parseFloat(core('f(' + this.output + ')').toTeX('decimal'));\n this.resultadoGlobal[0] = result;\n } else {\n this.evaluador(this.derivX, this.derivY, this.valoresParciales[0]);\n this.getT(n); // para output layers\n\n let result = parseFloat(core('f(' + this.output + ')').toTeX('decimal'));\n this.resultadoGlobal.push(result);\n }\n\n return this.resultadoGlobal;\n }", "function cilindro (r,h,gradi,alpha,trasla) {\n if (trasla === undefined) {\n trasla = [];\n };\n var x = trasla[0] || 0;\n var y = trasla[1] || 0;\n var z = trasla[2] || 0;\n\n var funzione = function (p) {\n var u = alpha + p[0] * gradi;\n var w = p[1] * h;\n\n return [x + r * COS(u), y + r * SIN(u), z + w];\n }\n\n return funzione;\n}", "function pos_pianeticr(njd,np){\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) settembre 2010\n // termini di correzione per i pianeti Giove e Saturno.\n // np=numero identificativo del pianeta.\n\n var T=(njd-2415020.0)/36525;\n\n M=358.47583+35999.049750*T-0.000150*T*T-0.0000033*T*T*T; // Sole.\n\n M1=102.27938+149472.51529*T+0.000007*T*T; // Mercurio.\n M2=212.60322+ 58517.80387*T+0.001286*T*T; // Venere.\n M4=319.51913+ 19139.85475*T+0.000181*T*T; // Marte.\n M5=225.32833+ 3034.69202*T-0.000722*T*T; // Giove.\n M6=175.46622+ 1221.55147*T-0.000502*T*T; // Saturno.\n \n \n \n var Delta_LP=0; // termini correzione di lungo periodo.\n //var Delta_L=0; // correzione per la longitudine.\n var Delta_R=0; // correzione per il raggio vettore.\n\n var Delta_LL=0; // correzione per la longitudine.\n var Delta_P=0; // correzione per il perielio.\n var Delta_AS=0; // correzione semiasse maggiore.\n var Delta_EC=0; // correzione eccentricità.\n var Delta_MM=0; // correzione anomalia media.\n var Delta_LAT_ELIO=0; // correzione latitudine eliocentrica.\n \n\n// Correzioni per Mercurio - Perturbazioni in longitudine.\n// Da aggiungere dopo aver risolto l'E.Keplero\n\n if (np==0) {\n\n // longitudine\n\n Delta_LL=0.00204*Math.cos(Rad(5*M2-2*M1+12.220))\n +0.00103*Math.cos(Rad(2*M2-M1-160.6920))\n +0.00091*Math.cos(Rad(2*M5-M1-37.00300))\n +0.00078*Math.cos(Rad(5*M2-3*M1+10.137));\n\n // perturbazioni in raggio vettore\n\n Delta_R=0.000007525*Math.cos(Rad(2*M5-M1+53.013))\n +0.000006802*Math.cos(Rad(5*M2-3*M1-259.918))\n +0.000005457*Math.cos(Rad(2*M2-2*M1-71.188))\n +0.000003569*Math.cos(Rad(5*M2-M1-77.75));\n \n }\n\n// Correzioni per Venere -Perturbazioni in longitudine. \n// Delta_LP da aggiungere alla longitudine e anomalia media prima di aver risolto l'E.Keplero.\n// gli altri 2 termini dopo aver risolto l'E.Keplero.\n\nelse if(np==1) {\n\n // longitudine e anomalia media\n\n Delta_LP=0.00077*Math.sin(Rad(237.24+150.27*T));\n Delta_MM=Delta_LP;\n\n // longitudine\n\n Delta_LL=0.00313*Math.cos(Rad(2*M-2*M2-148.225))\n +0.00198*Math.cos(Rad(3*M-3*M2+2.565))\n +0.00136*Math.cos(Rad(M-M2-119.107))\n +0.00096*Math.cos(Rad(3*M-2*M2-135.912))\n +0.00082*Math.cos(Rad(M5-M2-208.087));\n\n // perturbazioni in raggio vettore\n\n Delta_R=0.000022501*Math.cos(Rad(2*M-2*M2-58.208))\n +0.000019045*Math.cos(Rad(3*M-3*M2+92.577))\n +0.000006887*Math.cos(Rad(M5-M2-118.090))\n +0.000005172*Math.cos(Rad(M-M2-29.110))\n +0.000003620*Math.cos(Rad(5*M-4*M2-104.208))\n +0.000003283*Math.cos(Rad(4*M-4*M2+63.513))\n +0.000003074*Math.cos(Rad(2*M5-2*M2-55.167));\n\n}\n\n// Correzioni per la Terra\n\nelse if (np==2) {\n\n Delta_LP=0;\n\n // correzioni ***************\n\n var A=153.23+22518.7541*T;\n var B=216.57+45037.5082*T;\n var C=312.69+32964.3577*T;\n var D=350.74+445267.1142*T-0.00144*T*T;\n var E=231.19+20.20*T;\n var H=353.40+65928.7155*T;\n\n // angoli in radianti.\n\n A=Rad(A); \n B=Rad(B); \n C=Rad(C); \n D=Rad(D); \n E=Rad(E); \n H=Rad(H); \n\n // correzione per la longitudine.\n\n var Delta_LL=0.00134*Math.cos(A)\n +0.00154*Math.cos(B)\n +0.00200*Math.cos(C)\n +0.00179*Math.sin(D)\n +0.00178*Math.sin(E);\n\n // correzioni per il raggio vettore.\n\n var Delta_R=0.00000543*Math.sin(A)\n +0.00001575*Math.sin(B)\n +0.00001627*Math.sin(C)\n +0.00003076*Math.cos(D) \n +0.00000927*Math.sin(H);\n \n}\n\n// correzioni per il pianeta Marte ******************************** INIZIO .\n// Delta_LP da aggiungere alla longitudine e anomalia media prima di aver risolto l'E.Keplero.\n// gli altri 2 termini dopo aver risolto l'E.Keplero.\n\n\nif (np==3) {\n\n // longitudine e anomalia media\n\nDelta_LP=-0.01133*Math.sin(Rad(3*M5-8*M4+4*M))\n -0.00933*Math.cos(Rad(3*M5-8*M4+4*M)); // termine lungo periodo.\nDelta_MM=Delta_LP;\n\n // longitudine\n\nDelta_LL=0.00705*Math.cos(Rad(M5-M4-48.958))\n +0.00607*Math.cos(Rad(2*M5-M4-118.350))\n +0.00445*Math.cos(Rad(2*M5-2*M4-191.897))\n +0.00388*Math.cos(Rad(M-2*M4+20.495))\n +0.00238*Math.cos(Rad(M-M4+35.097))\n +0.00204*Math.cos(Rad(2*M-3*M4+158.638))\n +0.00177*Math.cos(Rad(3*M4-M2-57.602))\n +0.00136*Math.cos(Rad(2*M-4*M4+154.093))\n +0.00104*Math.cos(Rad(M5+17.618));\n\n // raggio vettore\n\nDelta_R=0.000053227*Math.cos(Rad(M5-M4+41.1306))\n +0.000050989*Math.cos(Rad(2*M5-2*M4-101.9847))\n +0.000038278*Math.cos(Rad(2*M5-M4-98.3292))\n +0.000015996*Math.cos(Rad(M-M4-55.555))\n +0.000014764*Math.cos(Rad(2*M-3*M4+68.622))\n +0.000008966*Math.cos(Rad(M5-2*M4+43.615))\n +0.000007914*Math.cos(Rad(3*M5-2*M4-139.737))\n +0.000007004*Math.cos(Rad(2*M5-3*M4-102.888))\n +0.000006620*Math.cos(Rad(M-2*M4+113.202)) \n +0.000004930*Math.cos(Rad(3*M5-3*M4-76.243))\n +0.000004693*Math.cos(Rad(3*M-5*M4+190.603))\n +0.000004571*Math.cos(Rad(2*M-4*M4+244.702))\n +0.000004409*Math.cos(Rad(3*M5-M4-115.828));\n}\n\n// correzioni per il pianeta Marte ******************************** FINE.\n\n// correzioni per il pianeta Giove ******************************* INIZIO.\n// tutti i termini di Giove sono da aggiungere prima dell'equazione di Keplero\n\n\nif (np==4) {\n\n var X=(T/5)+0.1;\n var P=237.47555+3034.9061*T;\n var Q=265.91650+1222.1139*T;\n var S=243.51721+428.46770*T;\n var V=5*Q-2*P;\n var W=2*P-6*Q+3*S;\n var Z=Q-P;\n\n // ************************* A\n // correzione per la longitudine media da aggiungere prima dell'equazione di Keplero\n // solo per la longitudine media.\n\n Delta_LL=(0.331364-0.010281*X-0.004692*X*X)*Math.sin(Rad(V)) \n +(0.003228-0.064436*X+0.002075*X*X)*Math.cos(Rad(V)) \n -(0.003083+0.000275*X-0.000489*X*X)*Math.sin(Rad(2*V))\n +0.002472*Math.sin(Rad(W))\n +0.013619*Math.sin(Rad(Z))\n +0.018472*Math.sin(Rad(2*Z))\n +0.006717*Math.sin(Rad(3*Z))\n +0.002775*Math.sin(Rad(4*Z))\n +(0.007275-0.001253*X)*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n +0.006417*Math.sin(Rad(2*Z))*Math.sin(Rad(Q))\n +0.002439*Math.sin(Rad(3*Z))*Math.sin(Rad(Q)) \n -(0.033839+0.001125*X)*Math.cos(Rad(Z))*Math.sin(Rad(Q))\n -0.003767*Math.cos(Rad(2*Z))*Math.sin(Rad(Q))\n -(0.035681+0.001208*X)*Math.sin(Rad(Z))*Math.cos(Rad(Q))\n -0.004261*Math.sin(Rad(2*Z))*Math.cos(Rad(Q))\n +0.002178*Math.cos(Rad(Q))\n +(-0.006333+0.001161*X)*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n -0.006675*Math.cos(Rad(2*Z))*Math.cos(Rad(Q))\n -0.002664*Math.cos(Rad(3*Z))*Math.cos(Rad(Q))\n -0.002572*Math.sin(Rad(Z))*Math.sin(Rad(2*Q))\n -0.003567*Math.sin(Rad(2*Z))*Math.sin(Rad(2*Q))\n +0.002094*Math.cos(Rad(Z))*Math.cos(Rad(2*Q))\n +0.003342*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q));\n\n // correzione per l'anomalia media -- più in fondo nel listato.\n\n // perturbazioni perielio da utilizzare per calcolare M. (vedi in fondo nel listato)\n\n Delta_P=(0.007192-0.003147*X)*Math.sin(Rad(V))\n +(-0.020428-0.000675*X+0.000197*X*X)*Math.cos(Rad(V))\n +(0.007269+0.000672*X)*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n -0.004344*Math.sin(Rad(Q))\n +0.034036*Math.cos(Rad(Z))*Math.sin(Rad(Q))\n +0.005614*Math.cos(Rad(2*Z))*Math.sin(Rad(Q))\n +0.002964*Math.cos(Rad(3*Z))*Math.sin(Rad(Q))\n +0.037761*Math.sin(Rad(Z))*Math.cos(Rad(Q))\n +0.006158*Math.sin(Rad(2*Z))*Math.cos(Rad(Q))\n -0.006603*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n -0.005356*Math.sin(Rad(Z))*Math.sin(Rad(2*Q))\n +0.002722*Math.sin(Rad(2*Z))*Math.sin(Rad(2*Q))\n +0.004483*Math.cos(Rad(Z))*Math.sin(Rad(2*Q))\n -0.002642*Math.cos(Rad(2*Z))*Math.sin(Rad(2*Q))\n +0.004403*Math.sin(Rad(Z))*Math.cos(Rad(2*Q))\n -0.002536*Math.sin(Rad(2*Z))*Math.cos(Rad(2*Q))\n +0.005547*Math.cos(Rad(Z))*Math.cos(Rad(2*Q))\n -0.002689*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q));\n\n // correzione per l'anomalia media da aggiungere prima dell'equazione di Keplero\n\n var el_orb=orb_plan(njd,4); // recupera l'eccentricità del pianeta.\n var eccent=el_orb[4]; // eccentricità non corretta.\n\n Delta_MM=Delta_LL-(Delta_P/eccent);\n\n\n // semiasse maggiore da aggiungere prima dell'equazione di Keplero.\n\n Delta_AS=-263*Math.cos(Rad(V))\n +205*Math.cos(Rad(Z))\n +693*Math.cos(Rad(2*Z))\n +312*Math.cos(Rad(3*Z))\n +147*Math.cos(Rad(4*Z))\n +299*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n +181*Math.cos(Rad(2*Z))*Math.sin(Rad(Q))\n +204*Math.sin(Rad(2*Z))*Math.cos(Rad(Q))\n +111*Math.sin(Rad(3*Z))*Math.cos(Rad(Q))\n -337*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n -111*Math.cos(Rad(2*Z))*Math.cos(Rad(Q));\n \n Delta_AS=Delta_AS/1000000;\n \n // eccentricità da aggiungere prima dell'equazione di Keplero\n\n Delta_EC=(3606+130*X-43*X*X)*Math.sin(Rad(V))\n +(1289-580*X)*Math.cos(Rad(V))\n -6764*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n -1110*Math.sin(Rad(2*Z))*Math.sin(Rad(Q))\n -224*Math.sin(Rad(3*Z))*Math.sin(Rad(Q))\n -204*Math.sin(Rad(Q))\n +(1284+116*X)*Math.cos(Rad(Z))*Math.sin(Rad(Q))\n +188*Math.cos(Rad(2*Z))*Math.sin(Rad(Q))\n +(1460+130*X)*Math.sin(Rad(Z))*Math.cos(Rad(Q))\n +224*Math.sin(Rad(2*Z))*Math.cos(Rad(Q))\n -817*Math.cos(Rad(Q))\n +6074*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n +992*Math.cos(Rad(2*Z))*Math.cos(Rad(Q))\n +508*Math.cos(Rad(3*Z))*Math.cos(Rad(Q))\n +230*Math.cos(Rad(4*Z))*Math.cos(Rad(Q))\n +108*Math.cos(Rad(5*Z))*Math.cos(Rad(Q))\n -(956+73*X)*Math.sin(Rad(Z))*Math.sin(Rad(2*Q))\n +448*Math.sin(Rad(2*Z))*Math.sin(Rad(2*Q))\n +137*Math.sin(Rad(3*Z))*Math.sin(Rad(2*Q))\n +(-997+108*X)*Math.cos(Rad(Z))*Math.sin(Rad(2*Q))\n +480*Math.cos(Rad(2*Z))*Math.sin(Rad(2*Q))\n +148*Math.cos(Rad(3*Z))*Math.sin(Rad(2*Q))\n +(-956+99*X)*Math.sin(Rad(Z))*Math.cos(Rad(2*Q))\n +490*Math.sin(Rad(2*Z))*Math.cos(Rad(2*Q))\n +158*Math.sin(Rad(3*Z))*Math.cos(Rad(2*Q))\n +179*Math.cos(Rad(2*Q))\n +(1024+75*X)*Math.cos(Rad(Z))*Math.cos(Rad(2*Q))\n -437*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q))\n -132*Math.cos(Rad(3*Z))*Math.cos(Rad(2*Q));\n\n Delta_EC=Delta_EC/10000000;\n}\n\n// correzioni per il pianeta Giove ********************************* FINE.\n\n// correzioni per il pianeta Saturno ****************************** INIZIO.\n// tutti i termini di Saturno sono da aggiungere prima dell'equazione di Keplero\n// tranne il termine della latitudine eliocentrica\n\n\nif (np==5) {\n\n var X=(T/5)+0.1;\n var P=237.47555+3034.9061*T;\n var Q=265.91650+1222.1139*T;\n var S=243.51721+428.46770*T;\n var V=5*Q-2*P;\n var W=2*P-6*Q+3*S;\n var Z=Q-P;\n var PS=S-Q;\n\n // perturbazioni in longitudine media\n\n Delta_LL=+(-0.814181+0.018150*X+0.016714*X*X)*Math.sin(Rad(V))\n +(-0.010497+0.160906*X-0.004100*X*X)*Math.cos(Rad(V))\n +0.007581*Math.sin(Rad(2*V))\n -0.007986*Math.sin(Rad(W))\n -0.148811*Math.sin(Rad(Z))\n -0.040786*Math.sin(Rad(2*Z))\n -0.015208*Math.sin(Rad(3*Z))\n -0.006339*Math.sin(Rad(4*Z))\n -0.006244*Math.sin(Rad(Q))\n +(0.008931+0.002728*X)*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n -0.016500*Math.sin(Rad(2*Z))*Math.sin(Rad(Q))\n -0.005775*Math.sin(Rad(3*Z))*Math.sin(Rad(Q))\n +(0.081344+0.003206*X)*Math.cos(Rad(Z))*Math.sin(Rad(Q))\n +0.015019*Math.cos(Rad(2*Z))*Math.sin(Rad(Q))\n +(0.085581+0.002494*X)*Math.sin(Rad(Z))*Math.cos(Rad(Q))\n +(0.025328-0.003117*X)*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n +0.014394*Math.cos(Rad(2*Z))*Math.cos(Rad(Q))\n +0.006319*Math.cos(Rad(3*Z))*Math.cos(Rad(Q))\n +0.006369*Math.sin(Rad(Z))*Math.sin(Rad(2*Q))\n +0.009156*Math.sin(Rad(2*Z))*Math.sin(Rad(2*Q))\n +0.007525*Math.sin(Rad(3*PS))*Math.sin(Rad(2*Q))\n -0.005236*Math.cos(Rad(Z))*Math.cos(Rad(2*Q))\n -0.007736*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q))\n -0.007528*Math.cos(Rad(3*PS))*Math.cos(Rad(2*Q));\n\n // eccentricità\n\n Delta_EC=+(-7927+2548*X+91*X*X)*Math.sin(Rad(V))\n +(13381+1226*X-253*X*X)*Math.cos(Rad(V))\n +(248-121*X)*Math.sin(Rad(2*V))\n -(305+91*X)*Math.cos(Rad(2*V))\n +412*Math.sin(Rad(Z))\n +12415*Math.sin(Rad(Q))\n +(390-617*X)*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n +(165-204*X)*Math.sin(Rad(2*Z))*Math.sin(Rad(Q))\n +26599*Math.cos(Rad(Z))*Math.sin(Rad(Q))\n -4687*Math.cos(Rad(2*Z))*Math.sin(Rad(Q))\n -1870*Math.cos(Rad(3*Z))*Math.sin(Rad(Q))\n -821*Math.cos(Rad(4*Z))*Math.sin(Rad(Q))\n -377*Math.cos(Rad(5*Z))*Math.sin(Rad(Q))\n +497*Math.cos(Rad(2*PS))*Math.sin(Rad(Q))\n +(163-611*X)*Math.cos(Rad(Q))\n -12696*Math.sin(Rad(Z))*Math.cos(Rad(Q))\n -4200*Math.sin(Rad(2*Z))*Math.cos(Rad(Q))\n -1503*Math.sin(Rad(3*Z))*Math.cos(Rad(Q))\n -619*Math.sin(Rad(4*Z))*Math.cos(Rad(Q))\n -268*Math.sin(Rad(5*Z))*Math.cos(Rad(Q))\n -(282+1306*X)*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n +(-86+230*X)*Math.cos(Rad(2*Z))*Math.cos(Rad(Q))\n +461*Math.sin(Rad(2*PS))*Math.cos(Rad(Q))\n -350*Math.sin(Rad(2*Q))\n +(2211-286*X)*Math.sin(Rad(Z))*Math.sin(Rad(2*Q)) \n -2208*Math.sin(Rad(2*Z))*Math.sin(Rad(2*Q))\n -568*Math.sin(Rad(3*Z))*Math.sin(Rad(2*Q))\n -346*Math.sin(Rad(4*Z))*Math.sin(Rad(2*Q))\n -(2780+222*X)*Math.cos(Rad(Z))*Math.sin(Rad(2*Q))\n +(2022+263*X)*Math.cos(Rad(2*Z))*Math.sin(Rad(2*Q))\n +248*Math.cos(Rad(3*Z))*Math.sin(Rad(2*Q))\n +242*Math.sin(Rad(3*PS))*Math.sin(Rad(2*Q))\n +467*Math.cos(Rad(3*PS))*Math.sin(Rad(2*Q))\n -490*Math.cos(Rad(2*Q))\n -(2842+279*X)*Math.sin(Rad(Z))*Math.cos(Rad(2*Q))\n +(128+226*X)*Math.sin(Rad(2*Z))*Math.cos(Rad(2*Q))\n +224*Math.sin(Rad(3*Z))*Math.cos(Rad(2*Q))\n +(-1594+282*X)*Math.cos(Rad(Z))*Math.cos(Rad(2*Q))\n +(2162-207*X)*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q))\n +561*Math.cos(Rad(3*Z))*Math.cos(Rad(2*Q))\n +343*Math.cos(Rad(4*Z))*Math.cos(Rad(2*Q))\n +469*Math.sin(Rad(3*PS))*Math.cos(Rad(2*Q))\n -242*Math.cos(Rad(3*PS))*Math.cos(Rad(2*Q))\n -205*Math.sin(Rad(Z))*Math.sin(Rad(3*Q))\n +262*Math.sin(Rad(3*Z))*Math.sin(Rad(3*Q))\n +208*Math.cos(Rad(Z))*Math.cos(Rad(3*Q))\n -271*Math.cos(Rad(3*Z))*Math.cos(Rad(3*Q))\n -382*Math.cos(Rad(3*Z))*Math.sin(Rad(4*Q))\n -376*Math.sin(Rad(3*Z))*Math.cos(Rad(4*Q));\n\n Delta_EC=Delta_EC/10000000; \n\n // correzione del perielio\n\n Delta_P=+(0.077108+0.007186*X-0.001533*X*X)*Math.sin(Rad(V))\n +(0.045803-0.014766*X-0.000536*X*X)*Math.cos(Rad(V))\n -0.007075*Math.sin(Rad(Z))\n -0.075825*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n -0.024839*Math.sin(Rad(2*Z))*Math.sin(Rad(Q))\n -0.008631*Math.sin(Rad(3*Z))*Math.sin(Rad(Q))\n -0.072586*Math.cos(Rad(Q))\n -0.150383*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n +0.026897*Math.cos(Rad(2*Z))*Math.cos(Rad(Q))\n +0.010053*Math.cos(Rad(3*Z))*Math.cos(Rad(Q))\n -(0.013597+0.001719*X)*Math.sin(Rad(Z))*Math.sin(Rad(2*Q))\n +(-0.007742+0.001517*X)*Math.cos(Rad(Z))*Math.sin(Rad(2*Q))\n +(0.013586-0.001375*X)*Math.cos(Rad(2*Z))*Math.sin(Rad(2*Q))\n +(-0.013667+0.001239*X)*Math.sin(Rad(Z))*Math.cos(Rad(2*Q))\n +0.011981*Math.sin(Rad(2*Z))*Math.cos(Rad(2*Q))\n +(0.014861+0.001136*X)*Math.cos(Rad(Z))*Math.cos(Rad(2*Q))\n -(0.013064+0.001628*X)*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q));\n\n\n // correzione per l'anomalia media da aggiungere prima dell'equazione di Keplero\n\n var el_orb=orb_plan(njd,5); // recupera l'eccentricità del pianeta.\n var eccent=el_orb[4]; // eccentricità senza correzione.\n\n Delta_MM=Delta_LL-(Delta_P/eccent);\n\n\n// semiasse maggiore.\n\n Delta_AS=572*X*Math.sin(Rad(V))\n +2933*Math.cos(Rad(V))\n +33629*Math.cos(Rad(Z))\n -3081*Math.cos(Rad(2*Z))\n -1423*Math.cos(Rad(3*Z))\n -671*Math.cos(Rad(4*Z))\n -320*Math.cos(Rad(5*Z))\n +1098*Math.sin(Rad(Q))\n -2812*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n +688*Math.sin(Rad(2*Z))*Math.sin(Rad(Q))\n -393*Math.sin(Rad(3*Z))*Math.sin(Rad(Q))\n -228*Math.sin(Rad(4*Z))*Math.sin(Rad(Q))\n +2138*Math.cos(Rad(Z))*Math.sin(Rad(Q))\n -999*Math.cos(Rad(2*Z))*Math.sin(Rad(Q))\n -642*Math.cos(Rad(3*Z))*Math.sin(Rad(Q))\n -325*Math.cos(Rad(4*Z))*Math.sin(Rad(Q))\n -890*Math.cos(Rad(Q))\n +2206*Math.sin(Rad(Z))*Math.cos(Rad(Q))\n -1590*Math.sin(Rad(2*Z))*Math.cos(Rad(Q))\n -647*Math.sin(Rad(3*Z))*Math.cos(Rad(Q))\n -344*Math.sin(Rad(4*Z))*Math.cos(Rad(Q))\n +2885*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n +(2172+102*X)*Math.cos(Rad(2*Z))*Math.cos(Rad(Q))\n +296*Math.cos(Rad(3*Z))*Math.cos(Rad(Q))\n -267*Math.sin(Rad(2*Z))*Math.sin(Rad(2*Q))\n -778*Math.cos(Rad(Z))*Math.sin(Rad(2*Q))\n +495*Math.cos(Rad(2*Z))*Math.sin(Rad(2*Q))\n +250*Math.cos(Rad(3*Z))*Math.sin(Rad(2*Q))\n -856*Math.sin(Rad(Z))*Math.cos(Rad(2*Q))\n +441*Math.sin(Rad(2*Z))*Math.cos(Rad(2*Q))\n +296*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q))\n +211*Math.cos(Rad(3*Z))*Math.cos(Rad(2*Q))\n -427*Math.sin(Rad(Z))*Math.sin(Rad(3*Q))\n +398*Math.sin(Rad(3*Z))*Math.sin(Rad(3*Q))\n +344*Math.cos(Rad(Z))*Math.cos(Rad(3*Q))\n -427*Math.cos(Rad(3*Z))*Math.cos(Rad(3*Q));\n \nDelta_AS=Delta_AS/1000000;\n\n\n\n// aggiungere alla latitudine eliocentrica.\n\n Delta_LAT_ELIO= +0.000747*Math.cos(Rad(Z))*Math.sin(Rad(Q))\n +0.001069*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n +0.002108*Math.sin(Rad(2*Z))*Math.sin(Rad(2*Q))\n +0.001261*Math.cos(Rad(2*Z))*Math.sin(Rad(2*Q))\n +0.001236*Math.sin(Rad(2*Z))*Math.cos(Rad(2*Q))\n -0.002075*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q)); \n\n}\n\n// correzioni per il pianeta Saturno******************************** FINE.\n\n// correzioni per il pianeta Urano******************************** INIZIO.\n\nif (np==6) {\n\n var X=(T/5)+0.1;\n var P=237.47555+3034.9061*T;\n var Q=265.91650+1222.1139*T;\n var S=243.51721+428.46770*T;\n var W=2*P-6*Q+3*S;\n var G=83.76922+218.4901*T;\n var H=2*G-S;\n var Z=S-P;\n var N=S-Q;\n var OM=G-S;\n \n // perturbazioni in longitudine media A\n\n Delta_LP=+(0.864319-0.001583*X)*Math.sin(Rad(H))\n +(0.082222-0.006833*X)*Math.cos(Rad(H))\n +0.036017*Math.sin(Rad(2*H))\n -0.003019*Math.cos(Rad(2*H))\n +0.008122*Math.sin(Rad(W));\n\n var B=0.120303*Math.sin(Rad(H))\n +(0.019472-0.000947*X)*Math.cos(Rad(H))\n +0.006197*Math.sin(Rad(2*H));\n\n // correzione per l'anomalia media di Urano\n\n var el_orb=orb_plan(njd,6); // recupera l'eccentricità del pianeta.\n var eccent=el_orb[4]; // eccentricità senza correzione.\n\n Delta_MM=Delta_LP-(B/eccent);\n\n // eccentricità\n\nDelta_EC=+(-3349+163*X)*Math.sin(Rad(H)) \n +20981*Math.cos(Rad(H))\n +1311*Math.cos(Rad(2*H));\n\nDelta_EC=Delta_EC/10000000;\n\n // correzione semiasse maggiore.\n\nDelta_AS=-0.003825*Math.cos(Rad(H));\n\n // correzione per la longitudine vera.\n\n Delta_LL=+(0.010122-0.000988*X)*Math.sin(Rad(S+N))\n +(-0.038581+0.002031*X-0.001910*X*X)*Math.cos(Rad(S+N))\n +(0.034964-0.001038*X+0.000868*X*X)*Math.cos(Rad(2*S+N))\n +0.005594*Math.sin(Rad(S+3*OM))\n -0.014808*Math.sin(Rad(Z))\n -0.005794*Math.sin(Rad(N))\n +0.002347*Math.cos(Rad(N))\n +0.009872*Math.sin(Rad(OM))\n +0.008803*Math.sin(Rad(2*OM))\n -0.004308*Math.sin(Rad(3*OM));\n\n// aggiungere alla latitudine eliocentrica.\n\n Delta_LAT_ELIO=+(0.000458*Math.sin(Rad(N))-0.000642*Math.cos(Rad(N))-0.000517*Math.cos(Rad(4*OM)))*Math.sin(Rad(S))\n -(0.000347*Math.sin(Rad(N))+0.000853*Math.cos(Rad(N))+0.000517*Math.sin(Rad(4*N)))*Math.cos(Rad(S))\n +0.000403*(Math.cos(Rad(2*OM))*Math.sin(Rad(2*S))+Math.sin(Rad(2*OM))*Math.cos(Rad(2*S))); \n\n// correzione al raggio vettore.\n\nDelta_R=-25948+ (5795*Math.cos(Rad(S))-1165*Math.sin(Rad(S))+1388*Math.cos(Rad(2*S)))*Math.sin(Rad(N))\n +4985*Math.cos(Rad(Z))+(1351*Math.cos(Rad(S))+5702*Math.sin(Rad(S))+1388*Math.sin(Rad(2*S)))*Math.cos(Rad(N))\n -1230*Math.cos(Rad(S))+904*Math.cos(Rad(2*OM))\n +3354*Math.cos(Rad(N))+894*(Math.cos(Rad(OM))-Math.cos(Rad(3*OM)));\n\nDelta_R=Delta_R/1000000;\n \n \n\n}\n// correzioni per il pianeta Urano ************************************ FINE.\n\n// correzioni per il pianeta Nettuno ******************************** INIZIO.\n\nif (np==7) {\n\n var X=(T/5)+0.1;\n var P=237.47555+3034.9061*T;\n var Q=265.91650+1222.1139*T;\n var S=243.51721+428.46770*T;\n var W=2*P-6*Q+3*S;\n var G=83.76922+218.4901*T;\n var H=2*G-S;\n var Z=G-P;\n var N=G-Q;\n var OM=G-S;\n \n // perturbazioni in longitudine media A\n\n Delta_LP=+(-0.589833+0.001089*X)*Math.sin(Rad(H))\n +(-0.056094+0.004658*X)*Math.cos(Rad(H)) \n -0.024286*Math.sin(Rad(2*H));\n\n var B=0.024039*Math.sin(Rad(H))\n -0.025303*Math.cos(Rad(H))\n +0.006206*Math.sin(Rad(2*H))\n -0.005992*Math.cos(Rad(2*H));\n\n// correzione per l'anomalia media di Urano\n\n var el_orb=orb_plan(njd,7); // recupera l'eccentricità del pianeta.\n var eccent=el_orb[4]; // eccentricità senza correzione.\n\n Delta_MM=Delta_LP-(B/eccent);\n\n // eccentricità\n\n Delta_EC=+4389*Math.sin(Rad(H))\n +4262*Math.cos(Rad(H))\n +1129*Math.sin(Rad(2*H))\n +1089*Math.cos(Rad(2*H));\n\n Delta_EC=Delta_EC/10000000;\n\n// correzione semiasse maggiore.\n\n Delta_AS=-817*Math.sin(Rad(H))+8189*Math.cos(Rad(H))+781*Math.cos(Rad(2*H));\n\n Delta_AS=Delta_AS/1000000;\n\n // correzione per la longitudine vera.\n\n Delta_LL=-0.009556*Math.sin(Rad(Z))\n -0.005178*Math.sin(Rad(N))\n +0.002572*Math.sin(Rad(2*OM))\n -0.002972*Math.cos(Rad(2*OM))*Math.sin(Rad(G))\n -0.002833*Math.sin(Rad(2*OM))*Math.cos(Rad(G));\n \n // aggiungere alla latitudine eliocentrica.\n\n Delta_LAT_ELIO=+0.000336*Math.cos(Rad(2*OM))*Math.sin(Rad(G))\n +0.000364*Math.sin(Rad(2*OM))*Math.cos(Rad(G));\n\n // correzione al raggio vettore.\n\n Delta_R=-40596\n +4992*Math.cos(Rad(Z))\n +2744*Math.cos(Rad(N))\n +2044*Math.cos(Rad(OM))\n +1051*Math.cos(Rad(2*OM));\n\nDelta_R=Delta_R/1000000;\n \n\n}\n// correzioni per il pianeta Nettuno ******************************** FINE\n\n\n// variabili correzioni\n// lperiodo, rvett long. assemagg ecc M lat\n var correzioni=new Array(Delta_LP,Delta_R,Delta_LL,Delta_AS,Delta_EC,Delta_MM,Delta_LAT_ELIO);\n\n return correzioni;\n\n}", "function fl_outToRimon ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t\n\t\t}}", "function fl_outToKarpas ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "xDistanceToQTerm(radTermica) {\n\n //Tolerancia del cálculo\n const tolerance = 0.01;\n\n //Valor de inicio del calculo de dsitancia x;\n let x = 0;\n\n //Radiacion termica \n var qi = 60;\n\n //Calculo de la distancia por iteracion\n for (x = 1; qi > radTermica; x = x + tolerance) {\n qi = this.qTermToDistance(x)\n // console.log(`x ${x} qi ${qi}`)\n }\n return x;\n }", "calcula(i){\n let vP = this.arrCamisas[i].camisap*10;\n let vM = this.arrCamisas[i].camisam*12;\n let vG = this.arrCamisas[i].camisag*15;\n\n let valortotal = vP+vM+vG;\n\n return valortotal;\n }", "function fl_outToSufgania ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function dibujarFresado128(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\n\t//Puntos fresado\n\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior) \n\tvar fresado2 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInferior,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInferior,pos.y+alaInferior)\n\tvar fresado4 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior)\n\t\n\tvar fresado5 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior)\n\tvar fresado6 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\t\n\tvar fresado8 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado9 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado10 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado11 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\n\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado11 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado7 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado10 ));\n\t\top_fresado.addObject(line,false);\n\n\t\n\t\n\t\t\n\t\n\t//anchura1 //superior\n\tif (anchura1>pliegueSuperior){ \n\t\t//var fresado12 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado12 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado19 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado20 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado20 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\n\t//anchura2 //superior\n\tif (anchura2>pliegueSuperior){ \n\t\t//var fresado13 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado13 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado21 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado22 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado22 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\n\t\t}\n\t}\n\t\n\t\n\t\n\t//anchura1 //inferior\n\tif (anchura1>pliegueInferior){ \n\t\t//var fresado12 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado2 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado15 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInferior+margenFresado,pos.y+alaInferior)\n\t\t\tvar fresado16 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInferior+margenFresado,pos.y)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado15 , fresado16 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura2 //inferior\n\tif (anchura2>pliegueInferior){ \n\t\t//var fresado12 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado4 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado17 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInferior-margenFresado,pos.y+alaInferior)\n\t\t\tvar fresado18 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInferior-margenFresado,pos.y)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado18 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t\n\t\n\n\treturn op_fresado; \n\n}", "function fe(a){this.ra=a}", "function hitungPVA() {\n\t\tvar MASKEr = document.getElementById(\"pva1\").value;\n\t\tvar MASKEi= document.getElementById(\"pva2\").value;\n\t\tvar MASKEn= document.getElementById(\"pva3\").value;\n\n\t\tvar Er = MASKEr.split(',').join('');\n\t\tvar Ei = MASKEi.split(',').join('');\n\t\tvar En = MASKEn.split(',').join('');\n\n\t\tvar Eip\t= Ei / 100;\n\t\tvar Efixed = (Math.pow(1+Eip,En)).toFixed(4);\n\t\tvar Epengalipva = (Efixed -1) / (Eip * Efixed);\n\t\tvar Epva = Er * Epengalipva;\n\t\tvar Erpva = Math.round(Epva);\n\t\tdocument.getElementById(\"outputPVA\").innerHTML = \n\t\t\"Faktor Pengali PV-annuitas : \\n\"+\n\t\t\"\t\t= (( 1 + i )^n + 1 ) / ( i x ( 1 + i )^n ) \\n\"+\n\t\t\"\t\t= (( 1 + \"+ Eip +\" )^\"+ En +\" + 1 ) / ( \"+ Eip +\" x ( 1 + \"+ Eip +\" )^\"+ En +\" ) \\n\"+\n\t\t\"\t\t= \"+ Epengalipva.toFixed(4) +\" \\n\"+\n\t\t\"Present Value Anuitas : \\n\"+\n\t\t\"\t\t= R x Faktor Pengali PV-annuitas \\n\"+\n\t\t\"\t\t= Rp. \"+ MASKEr +\" x \"+ Epengalipva.toFixed(4) +\"\\n\"+\n\t\t\"\t\t= \"+ uang(Erpva, \"Rp.\");\n\t}", "function dibujarFresado107(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t//Puntos trayectoria \n\t\t\t//Son los mismos puntos que la figura 001 (el unico que cambia es fresado6 y fresado14)\n\tvar fresado1 = new RVector(pos.x,pos.y+alaInferior) \n\tvar fresado2 = new RVector(pos.x+anchura1,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior)\n\tvar fresado4 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior)\n\tvar fresado5 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior)\n\t\n\t\n\t\n\t\n\t\n\tvar fresado6 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y) //punto fresado abajo a la izquierda [hay que corregirlo]\n\t\n\t\n\t\n\t\n\tvar fresado9 = new RVector(pos.x,pos.y+alaInferior+alturaPlaca)\n\tvar fresado10 = new RVector(pos.x+anchura1,pos.y+alaInferior+alturaPlaca)\n\tvar fresado11 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+alturaPlaca)\n\tvar fresado12 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior+alturaPlaca)\n\tvar fresado13 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca)\n\t\n\tvar fresado14 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\n\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado5 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado9 , fresado13 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado2 , fresado10 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado3 , fresado11 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado4 , fresado12 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado6 , fresado14 ));\n\top_fresado.addObject(line,false);\n\n\t\n\t\n\t\n\t//anchura1\n\tif (anchura1>pliegueSuperior){\n\t\tvar fresado17 = new RVector(pos.x,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado18 = new RVector(pos.x+anchura1-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado17 , fresado18 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado19 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado20 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado19 , fresado20 ));\n\t op_fresado.addObject(line,false);\n }\n\t}\n\t\n\t\n\t//anchura2\n\tif (anchura2>pliegueSuperior*2){\t\t\n\t\tvar fresado23 = new RVector(pos.x+anchura1+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado24 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado22 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado21 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado21 , fresado22 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado25 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado26 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t\n\t//anchura3\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado29 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado30 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\n\t\tif (crearFresado==1){\n\t\t\tvar fresado28 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado27 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado28 , fresado27 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado31 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado32 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t\n\t//anchura4\n\tif (anchura4>pliegueSuperior*2){\n\t\tvar fresado35 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado35 , fresado14 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado34 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado33 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n\t}\n\t\n\t\n\t\n\treturn op_fresado;\n\n}", "function principal(){\n\n borraCanvas();\n\n console.log(ratonX + ' - ' + ratonY);\n\n for(i=0; i<numParticulas;i++){\n particulas[i].actualiza();\n }\n\n}", "function\nfata(cr, ci, n, ar, ai, far, fai)\n{\n\tvar k;\n\tvar xr, xi, yr, yi;\n\n\tyr = cr[n - 1];\n\tyi = ci[n - 1];\n\n\tfor (k = n - 2; k >= 0; k--) {\n\n\t\t// x = a * y\n\n\t\txr = ar * yr - ai * yi;\n\t\txi = ar * yi + ai * yr;\n\n\t\t// y = x + c\n\n\t\tyr = xr + cr[k];\n\t\tyi = xi + ci[k];\n\t}\n\n\tfar[0] = yr;\n\tfai[0] = yi;\n}", "function swieta_ruchome(year) \n{\n //wielkanoc\n var poniedzialek_wielkanocny_dzien, poniedzialek_wielkanocny_miesiac, boze_cialo_dzien, boze_cialo_miesiac,\n luty = l_dni(1, year), \n dzien_roku = 31 + luty, \n f = Math.floor,\n\t\tG = year % 19,\n\t\tC = f(year / 100),\n\t\tH = (C - f(C / 4) - f((8 * C + 13)/25) + 19 * G + 15) % 30,\n\t\tI = H - f(H/28) * (1 - f(29/(H + 1)) * f((21-G)/11)),\n\t\tJ = (year + f(year / 4) + I + 2 - C + f(C / 4)) % 7,\n\t\tL = I - J,\n\t\tmonth = 3 + f((L + 40)/44),\n day = L + 28 - 31 * f(month / 4);\n\n if( day==31 && month==3 )\n {\n poniedzialek_wielkanocny_dzien = 1;\n poniedzialek_wielkanocny_miesiac = 3;\n }\n else\n {\n poniedzialek_wielkanocny_dzien = day + 1;\n poniedzialek_wielkanocny_miesiac = month - 1;\n }\n\n if( month==3 )\n {\n dzien_roku += day;\n }\n else\n {\n dzien_roku = dzien_roku + 31 + day;\n }\n\n dzien_roku += 60;\n\n if( luty==28 && dzien_roku<=151)\n {\n boze_cialo_dzien = dzien_roku - 120;\n boze_cialo_miesiac = 4;\n }\n else if( luty==29 && dzien_roku<=152 )\n {\n boze_cialo_dzien = dzien_roku - 121;\n boze_cialo_miesiac = 4;\n }\n else if( luty==29 )\n {\n boze_cialo_dzien = dzien_roku - 152;\n boze_cialo_miesiac = 5;\n }\n else\n {\n boze_cialo_dzien = dzien_roku - 151;\n boze_cialo_miesiac = 5;\n }\n\n return [poniedzialek_wielkanocny_dzien, poniedzialek_wielkanocny_miesiac, boze_cialo_dzien, boze_cialo_miesiac];\n}", "function pazymiuVidurkis(q,w,e,r,t) {\n var atsakymas = (q+w+e+r+t)/5;\n console.log(atsakymas);\n}", "function dibujarFresado116(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\tanchura4=0\n\tanchura5=0\n\t\n\t//Puntos trayectoria \n\t\t\t//Son los mismos puntos que la figura 001 (el unico que cambia es fresado6 y fresado14)\n\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior) \n\tvar fresado2 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior)\n\tvar fresado4 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior)\n\tvar fresado5 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior)\n\t\n\tvar fresado6 = new RVector(pos.x+alaIzquierda,pos.y) //punto fresado abajo a la izquierda\n\t\n\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4+pliegueDer,pos.y+alaInferior)\n\t\n\tvar fresado9 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca)\n\tvar fresado10 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+alturaPlaca)\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+alturaPlaca)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+alturaPlaca)\n\t\n\tvar fresado14 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4+pliegueDer,pos.y+alaInferior+alturaPlaca)\n\t\n\t\n\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado7 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado9 , fresado13 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado7 , fresado13 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado10 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado11 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado12 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado14 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\t\n\t//anchura1\n\tif (anchura1>pliegueSuperior){\n\t\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado18 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado19 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado20 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado20 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t//anchura2\n\tif (anchura2>pliegueSuperior*2){\n\t\t\n\t\tvar fresado23 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado24 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado22 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado21 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado22 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado25 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t//anchura3\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado29 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado30 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado31 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado32 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t//anchura4\n\tif (anchura4>pliegueSuperior){\n\t\tvar fresado35 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado36 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado34 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado33 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\treturn op_fresado; \n}", "function dibujarFresado125(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\t\n\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior)\n\tvar fresado2 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1,pos.y+alaInferior)\n\tvar fresado4 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2,pos.y+alaInferior)\n\tvar fresado5 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3,pos.y+alaInferior)\n\tvar fresado6 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior)\n\tvar fresado7 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4+pliegueDer,pos.y+alaInferior)\n\t\n\tvar fresado8 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+altura1)\n\tvar fresado9 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior+altura1)\n\tvar fresado10 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1,pos.y+alaInferior+altura1)\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2,pos.y+alaInferior+altura1)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2,pos.y+alaInferior+altura2)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3,pos.y+alaInferior+altura2)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+altura2)\n\tvar fresado15 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4+pliegueDer,pos.y+alaInferior+altura2)\n\t\n\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado7 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado8 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado10 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado12 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado13 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado7 , fresado15 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado11 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado12 , fresado15 ));\n\t\top_fresado.addObject(line,false);\n\t\n\t\n\n\n\treturn op_fresado; \n\n\t\n\t\n}", "function ResultadoInteresCompuestoConCap(C, i, r, n) {\n var x = (i / r); \n var y = (1 + x);\n var z = (C * y);\n var w = (n * r);\n var resultado = Math.pow(z, w); \n return resultado;\n}", "function instruerenSchroef(object){\n\tvar schroefDraai = 0;\n\tvar schroeven = [];\n\tvar schroefNummer = 0;\n\n\t$(\"[class*='schroefgat-\"+object.id+\"']\").each(function(i){\n\t\tschroeven.push(this);\n\t});\n\n\tvar pijlPosY = $(schroeven[schroefNummer]).attr(\"position\").y + 2;\n\t$(\"#schroevendraaier-icoon\").attr({\"position\": ''+$(schroeven[schroefNummer]).attr(\"position\").x+' '+$(schroeven[schroefNummer]).attr(\"position\").y+' '+$(schroeven[schroefNummer]).attr(\"position\").z+'', \"visible\": \"true\"});\n\t$(\"#pijl\").attr({\"position\": ''+$(schroeven[schroefNummer]).attr(\"position\").x+' '+pijlPosY+' '+$(schroeven[schroefNummer]).attr(\"position\").z+'', \"visible\": \"true\", \"rotation\": \"0 0 -90\"});\n\n\t$(\"#schroevendraaier-icoon\").mousedown(function(){\n\t\tif(schroevendraaierObject == true){\n\t\t\tif(schroefNummer < schroeven.length){\n\t\t\t\tafspelenGeluid(\"aandraaien\");\n\t\t\t\tschroefDraai++;\n\t\t\t\t$(\"#schroevendraaier-icoon\").attr(\"src\", '#schroevendraaier-icoon-'+schroefDraai+'-img');\n\t\t\t\tif(schroefDraai == 3){\n\t\t\t\t\tschroefNummer++;\n\t\t\t\t\tschroefDraai = 0;\n\t\t\t\t\t$(\"#schroevendraaier-icoon\").attr(\"src\", '#schroevendraaier-icoon-'+schroefDraai+'-img');\n\t\t\t\t}\n\t\t\t\tif(schroeven.length == schroefNummer){\n\t\t\t\t\tschroefNummer = 0;\n\t\t\t\t\tschroeven = [];\n\t\t\t\t\t$(\"#schroevendraaier-icoon\").attr({\"position\": '0 0 0', \"visible\": \"false\"});\n\t\t\t\t\t$(\"#pijl\").attr({\"position\": '0 0 0', \"visible\": \"false\"});\n\t\t\t\t\tvoltooienObject();\n\t\t\t\t\tif(objectenCompleet == 9){\n\t\t\t\t\t\tloslatenObject(draagObject);\n\t\t\t\t\t\tvoltooienSpel();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tvar pijlPosY = $(schroeven[schroefNummer]).attr(\"position\").y + 2;\n\t\t\t\t\t$(\"#schroevendraaier-icoon\").attr({\"position\": ''+$(schroeven[schroefNummer]).attr(\"position\").x+' '+$(schroeven[schroefNummer]).attr(\"position\").y+' '+$(schroeven[schroefNummer]).attr(\"position\").z+'', \"visible\": \"true\"});\n\t\t\t\t\t$(\"#pijl\").attr({\"position\": ''+$(schroeven[schroefNummer]).attr(\"position\").x+' '+pijlPosY+' '+$(schroeven[schroefNummer]).attr(\"position\").z+'', \"visible\": \"true\", \"rotation\": \"0 0 -90\"});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n}", "bouger()\r\n {\r\n this.gauche += Math.cos(this.angle) * this.vitesseX;\r\n this.haut += Math.sin(this.angle) * this.vitesseY;\r\n\r\n //Fonctions annexes\r\n this.limite();\r\n this.majHTML();\r\n }", "function NeurolaxTerm(){}", "function atvd17(){\n \n let a = parseFloat(document.querySelector(\"#atvd17-1\").value);\n let b = parseFloat(document.querySelector(\"#atvd17-2\").value);\n let c = parseFloat(document.querySelector(\"#atvd17-3\").value);\n\n let de,x1=0,x2=0;\n \n\n de = (Math.pow(b, 2)) - (4*a*c);\n \n \n x1= (-b - Math.sqrt(de))/(2*a);\n \n x2= (-b + Math.sqrt(de))/(2*a);\n \n\n if(de<0){\n document.getElementById(\"raiz\").innerHTML = \"Não existe raiz real\";\n\n }else{\n document.getElementById(\"raiz\").innerHTML = \"VALOR DA PRIMEIRA RAIZ:\" + x1+ \" | \" + \"VALOR DA SEGUNDA RAIZ:\" + x2;\n \n }\n \n }", "function pos_app_pa(njd,AR,DE,P,LAT,LON,ALT){\n\n // calcola la posizione apparente di un astro - nutazione - aberrazione della luce e parallasse geocentrica.\n // nutazione e aberrazione.\n\nvar cnutab=pos_app(njd,AR,DE); // applica la correzione per la nutazione e l'aberrazione.\n\nvar ARna=cnutab[0]; // ascensione retta.\nvar DEna=cnutab[1]; // declinazione.\n\n // parallasse.\n\nvar cpar= cor_parall(njd,ARna,DEna,P,LAT,LON,ALT); // applica la correzione per la parallasse geocentrica.\n\nvar ARp=cpar[0]; // ascensione retta.\nvar DEp=cpar[1]; // declinazione.\n\nvar RID_COORD=new Array(ARp,DEp); //coordinate equatoriali ridotte. \n\nreturn RID_COORD;\n\n}", "function dibujarFresado137(modelo,di,pos,document){\n\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\n\t//Puntos fresado\n\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior)\n\tvar fresado2 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInferior,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInferior,pos.y+alaInferior)\n\tvar fresado4 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueInferior,pos.y+alaInferior)\n\tvar fresado5 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueInferior,pos.y+alaInferior)\n\tvar fresado6 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueInferior,pos.y+alaInferior)\n\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueInferior,pos.y+alaInferior)\n\tvar fresado8 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior)\n\tvar fresado9 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior)\n\tvar fresado10 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado15 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado16 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado17 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado18 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\n\tvar fresado19\n\tif (anchura1>alaSuperior){ \n\t\tfresado19 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+alaSuperior)\n\t}else{ \n\t\tfresado19 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+anchura1)\n\t}\n\t\n\t\n\tvar fresado20\n\tif (anchura4>alaSuperior){\n\t\tfresado20 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+alaSuperior)\n\t}else{ \n\t\tfresado20 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+anchura4)\n\t}\n\n\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado2 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado4 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado6 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado7 , fresado8 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado9 , fresado13 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado14 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado19 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado10 , fresado15 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado16 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado12 , fresado17 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado20 ));\n\t\top_fresado.addObject(line,false);\n\t\n\n\t\n\t\n\t\n\t\n\t//anchura1\n\tif (anchura1>pliegueInferior){ \n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado2 ));\n\t\top_fresado.addObject(line,false);\n\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado21 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInferior+margenFresado,pos.y)\n\t\t\tvar fresado22 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInferior+margenFresado,pos.y+alaInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado22 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\n\t//anchura2 \n\tif (anchura2>pliegueInferior*2){ \n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado4 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado23 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInferior-margenFresado,pos.y)\n\t\t\tvar fresado24 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInferior-margenFresado,pos.y+alaInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado25 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueInferior+margenFresado,pos.y)\n\t\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueInferior+margenFresado,pos.y+alaInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t\n\t\n\t//anchura3 \n\tif (anchura3>pliegueInferior*2){ \n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado6 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueInferior-margenFresado,pos.y)\n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueInferior-margenFresado,pos.y+alaInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\n\t\t\t\n\t\t\tvar fresado29 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueInferior+margenFresado,pos.y)\n\t\t\tvar fresado30 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueInferior+margenFresado,pos.y+alaInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\t\top_fresado.addObject(line,false);\n\n\t\t}\n\t}\n\t\n\t//anchura4 //inferior\n\tif (anchura4>pliegueInferior){ \n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado7 , fresado8 ));\n\t\top_fresado.addObject(line,false);\n\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado31 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueInferior-margenFresado,pos.y)\n\t\t\tvar fresado32 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueInferior-margenFresado,pos.y+alaInferior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\t\top_fresado.addObject(line,false);\n\n\t\t}\n\t}\n\t\n\t\n\n\treturn op_fresado; \n\n}", "function coherencia(objeto){\n // extrae las variables nesesarias para la evaluacion\n var estructura= objeto.structure;\n var nivelagregacion=objeto.aggregationlevel;\n var tipointeractividad=objeto.interactivitytype; \n var nivelinteractivo=objeto.interactivitylevel;\n var tiporecursoeducativo=objeto.learningresourcetype;\n \n //inicializa las reglas y las variables de los pesos\n var r=0;\n var pesor1=0;\n var pesor2=0;\n var pesor3=0;\n\n //verifica las reglas que se van a evaluar\n if (estructura===\"atomic\" && nivelagregacion===\"1\"){\n r++;\n pesor1=1;\n }else if (estructura===\"atomic\" && nivelagregacion===\"2\"){\n r++;\n pesor1=0.5;\n }else if (estructura===\"atomic\" && nivelagregacion===\"3\"){\n r++;\n pesor1=0.25;\n }else if (estructura===\"atomic\" && nivelagregacion===\"4\"){\n r++;\n pesor1=0.125;\n }else if (estructura===\"collection\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5;\n }else if (estructura===\"networked\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"hierarchical\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"linear\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"collection\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"networked\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"hierarchical\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"linear\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion ===\"4\") ){\n r++;\n pesor1=1; \n }\n\n if (tipointeractividad===\"active\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\" || \n nivelinteractivo===\"medium\" || \n nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n $r++;\n $pesor2=1; \n }else if (tipointeractividad===\"mixed\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\" || \n nivelinteractivo===\"medium\" || \n nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n r++;\n pesor2=1;\n }else if (tipointeractividad===\"expositive\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\") ){\n r++;\n pesor2=0;\n }else if (tipointeractividad===\"expositive\" && nivelinteractivo===\"medium\" ){\n r++;\n pesor2=0.5;\n }else if (tipointeractividad===\"expositive\" && ( nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n r++;\n pesor2=1;\n } \n if ( tipointeractividad===\"active\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\") ){\n r++;\n pesor3=1; \n }else if (tiporecursoeducativo===\"active\" && (tiporecursoeducativo===\"diagram\" || \n tiporecursoeducativo===\"figure\" || \n tiporecursoeducativo===\"graph\" || \n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\") ){\n r++;\n pesor3=0;\n \n }else if (tipointeractividad===\"expositive\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\") ){\n r++;\n pesor3=0; \n }else if (tipointeractividad===\"expositive\" && (tiporecursoeducativo===\"diagram\" || \n tiporecursoeducativo===\"figure\" || \n tiporecursoeducativo===\"graph\" || \n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\") ){\n r++;\n pesor3=1;\n }else if (tipointeractividad===\"mixed\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\" ||\n tiporecursoeducativo===\"diagram\" ||\n tiporecursoeducativo===\"figure\" ||\n tiporecursoeducativo===\"graph\" ||\n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\" )){\n r++;\n pesor3=1; \n } \n m_coherencia=0;\n if (r>0) {\n\n // hace la sumatoria de los pesos \n m_coherencia= ( pesor1 + pesor2 + pesor3) / r;\n \n \n //alert(mensaje);\n return m_coherencia;\n //echo \"* Coherencia de: \". m_coherencia.\"; \". evaluacion.\"<br><br>\";\n }else{\n \n return m_coherencia;\n \n }\n\n\n }", "function dibujarFresado110(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3, pliegueInf4]\n\t\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (var n=0; n<4 ;n=n+1){\n\t\tif (pliegueInferior<plieguesInf[n]){\n\t\t\tpliegueInferior=plieguesInf[n]\n }\n }\n\t\n\t\n\tvar fresado11 = new RVector(pos.x+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior)\n\t\n\t\n\t\n\tvar fresado16 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior) \n\tvar fresado17 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado22 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\n\t\n\tif (anchura4>pliegueInf4){\n\t\tvar fresado15 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior-pliegueInf4-alaInferior)\n var line = new RLineEntity(document, new RLineData( fresado15 , fresado22 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }else{\n var line = new RLineEntity(document, new RLineData( fresado14 , fresado22 ));\n\t op_fresado.addObject(line,false);\n\n }\n\t var line = new RLineEntity(document, new RLineData( fresado16 , fresado14 ));\n\t op_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado20 , fresado13 ));\n\t op_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado12 , fresado19 ));\n\t op_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado18 , fresado11 ));\n\t op_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado17 , fresado21 ));\n\t op_fresado.addObject(line,false);\n\t\n\t\n\t\n\t\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1){\n\t\t//var fresado10 = new RVector(pos.x,pos.y+pliegueInferior+alaInferior) \n\t\tvar fresado1 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t//var fresado2 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x+anchura1-pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\t//dibujarFresado_auxiliar(doc,fresado10,fresado1)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t op_fresado.addObject(line,false);\n\t\t//dibujarFresado_auxiliar(doc,fresado2,fresado11)\n }\n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)){\n\t\tvar fresado4 = new RVector(pos.x+anchura1+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x+anchura1+anchura2-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n var line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3*2)){\n\t\tvar fresado6 = new RVector(pos.x+anchura1+anchura2+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n var line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }\n\t\n\t//anchura4 - Inferior\n\tif (anchura4>pliegueInf4){\n\t\tvar fresado8 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar fresado9 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n var line = new RLineEntity(document, new RLineData( fresado8 , fresado9 ));\n\t op_fresado.addObject(line,false);\n\t\t\n } \n\t\n\t\n\t\n\n\t\n\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)){\n\t\tvar fresado25 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado27 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }\n }\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)){\n\t\tvar fresado31 = new RVector(pos.x+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado29 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado33 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado37 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado35 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado39 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior){ \n\t\tvar fresado43 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado44 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado41 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado42 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t op_fresado.addObject(line,false);\n }\n }\n\t\n\t\n\t\n\treturn op_fresado;\n}", "function calc_zp(change, aoi, scl){\n var norm = change.select(['ndvi', 'ndsi', 'nbr', 'ndwi', 'rcvmax']);\n var chi = change.select(['cv']).rename(['cv_z']);\n var norm_bands = norm.bandNames();\n var chi_bands = ['cv'];\n var cat_mean = norm_bands.map(function(string){\n string = ee.String(string).cat('_mode');\n return string;\n });\n var cat_sd = norm_bands.map(function(string){\n string = ee.String(string).cat('_stdDev');\n return string;\n });\n var cat_p = norm_bands.map(function(string){\n string = ee.String(string).cat('_p');\n return string;\n });\n var cat_z = norm_bands.map(function(string){\n string = ee.String(string).cat('_z');\n return string;\n });\n var stats = change.select(norm_bands).reduceRegion({\n reducer: ee.Reducer.mode().combine({\n reducer2: ee.Reducer.stdDev(),\n sharedInputs: true\n }),\n //kernel: ee.Kernel.fixed(150, 150)\n geometry: aoi,\n scale: scl,\n maxPixels: 1e13,\n tileScale: 6\n });//.rename(norm_bands, cat_mean);\n /*\n var sd = change.select(norm_bands).reduceRegion({\n reducer: ee.Reducer.stdDev(),\n //kernel: ee.Kernel.fixed(150, 150)\n geometry: aoi,\n scale: scl,\n maxPixels: 100000000000,\n tileScale: 6\n }).rename(norm_bands, cat_sd);\n */\n //var stats = mean.combine(sd);\n var img_z = norm.subtract(stats.toImage(cat_mean))\n .divide(stats.toImage(cat_sd)).rename(cat_z);\n var np = norm_p(img_z.abs()).multiply(2).rename(cat_p);\n var cp = chi_p(chi, 6).multiply(-1).add(1).rename(['cv_p']);\n return chi.addBands(img_z).addBands(np).addBands(cp);\n}", "function promedioFila(fila){\n var suma = 0;\n for (let index = 0; index < COLUMNAS; index++) {\n suma += matrix[fila][index];\n }\n return suma/COLUMNAS;\n}", "function tubeFormula(jarijari, tinggi){\n let luasAlas = Math.PI * jarijari ** 2;\n let volumeTabung = luasAlas * tinggi;\n\n return volumeTabung;\n}", "function arcocerchio (r,ty,tz,gradi,alpha) { \n var funzione = function (p) { \n var u = alpha + p[0] * gradi;\n\n return [r * SIN(u) , ty , tz + r * COS(u)];\n };\n\n return funzione;\n}", "function hitungLuasLingkaran(jariJari){\n return 3.14 * jariJari ^ 2 \n}", "function hitungLuasPersegiPanjang (panjang,lebar){\n //tidak ada nilai balik\n var luas = panjang * lebar\n return luas\n}", "function ic(){\n\n console.log('ic',roundArr(stats.ic())) // calculates the information content\n\n // change your alphabet\n //console.log('',stats.setDNA(); // default\n //console.log('',stats.setProtein();\n\n // now you can scale the information content \n console.log('scaled ic',roundArr(stats.scale(stats.ic())));\n\n console.log('conservation',roundArr(stats.conservation())) // needs an alphabetSize!\n console.log('conservation scaled',roundArr(stats.scale(stats.conservation()))) // needs an alphabetSize!\n\n console.log('conservation residue',roundArrMap(stats.conservResidue())) // calculate conservation per resdiue\n console.log('conservation residue scaled',roundArrMap(stats.conservResidue({scaled: true}))) // calculate conservation per resdiue\n}", "function afase_pianeta(njd,AR,DE,dist_ps,dist_pt){\n\n // funzione per il calcolo dell'angolo di fase per un pianeta.\n // AR,DE sono le coordinate equatoriali decimali, del pianeta.\n // njd= numero del giorno giuliano.\n // dist_ps=distanza pianeta-sole in UA.\n // dist_pt=distanza pianeta-Terra in UA.\n // by Salvatore Ruiu - gennaio 2013.\n\n var coo_sole=pos_sole(njd); // coordinate equatoriali decimali del Sole.\n var Rs=coo_sole[4]; // distanza Terra-Sole. \n var elongaz=elong(AR,DE,coo_sole[0],coo_sole[1]); // elongazione in gradi dal Sole.\n\n // calcolo dell'angolo di fase in gradi . \n\n var Dpt= dist_pt; // distanza pianeta-terra.\n var Dts= Rs; // distanza terra-sole.\n var Dps= dist_ps; // distanza pianeta-sole.\n\n // risolve il teorema del coseno (noti i 3 lati del triangolo).\n\n var delta_fase=(Dts*Dts+Dps*Dps-Dpt*Dpt)/(2*Dps*Dts);\n delta_fase=Math.acos(delta_fase); \n delta_fase=Rda(delta_fase);\n\n var angolo_fase=180-Math.abs(elongaz)-delta_fase; // risultato: angolo di fase in gradi.\n\nreturn angolo_fase;\n\n}", "function PerkalianV2 (a, b) {\n //local variabel\n let hasil = a * b\n\n //give return value, spy value dr hasil bisa dipake diluar\n return hasil\n}", "function dibujarFresado113(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\t//Puntos trayectoria\t\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1,pos.y+alaInferior)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2,pos.y+alaInferior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3,pos.y+alaInferior)\n\tvar fresado15 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior)\n\t\n\tvar fresado16 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior)\n\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1,pos.y+alaInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2,pos.y+alaInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3,pos.y+alaInferior+alturaPlaca)\n\tvar fresado22 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca)\n\t\n\tvar line = new RLineEntity(document, new RLineData( fresado16 , fresado15 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado22 , fresado17 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado16 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado18 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado12 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado13 , fresado20 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado14 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\t\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)) {\n\t\tvar fresado25 = new RVector(pos.x+alaIzquierda+pliegueIzq+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\top_fresado.addObject(line,false);\n\t\n\t\t\n\t\tif (crearFresado==1) { //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado23 = new RVector(pos.x+alaIzquierda+pliegueIzq+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado24 = new RVector(pos.x+alaIzquierda+pliegueIzq+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)) {\n\t\tvar fresado31 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado29 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\tvar fresado33 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2) {\n\t\tvar fresado37 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado35 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\tvar fresado39 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior) {\n\t\tvar fresado43 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado44 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado41 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado42 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t\n\t\n\t\n\treturn op_fresado; \n}", "function dibujarFresado119(modelo,di,pos,document){\n\t\n\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\t//Puntos trayectoria \n\tvar fresado1 = new RVector(pos.x,pos.y+alaInferior)\n\tvar fresado2 = new RVector(pos.x,pos.y)\n\tvar fresado3 = new RVector(pos.x+anchura1,pos.y+alaInferior)\n\tvar fresado4 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior)\n\tvar fresado5 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior)\n\tvar fresado6 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior)\n\tvar fresado7 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior)\n\tvar fresado8 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+alturaPlaca)\n\tvar fresado9 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado10 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado11 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca)\n\tvar fresado12 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado13 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado14 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior+alturaPlaca)\n\tvar fresado15 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado16 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado17 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+alturaPlaca)\n\tvar fresado18 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado19 = new RVector(pos.x+anchura1+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado20 = new RVector(pos.x+anchura1,pos.y+alaInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+anchura1-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado22 = new RVector(pos.x,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado23 = new RVector(pos.x,pos.y+alaInferior+alturaPlaca)\n\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado22 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado20 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado17 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado11 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado7 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado22 , fresado21 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado16 , fresado15 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado13 , fresado12 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado10 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado8 ));\n\t\top_fresado.addObject(line,false);\n\n\n\treturn op_fresado; \n\n}", "entfernungVomUrsprung(){\n let a = this.x;\n let b = this.y;\n let c;\n let py = (a*a) + (b*b);\n c= Math.sqrt(py);\n return c;\n }", "function fl_outToBeiza ()\n\t\t{\n\t\t\tif (freez=='false'){\n\t\t console.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\t\t }\n\t\t\n\t\t}", "function jelFul(niz)\n{\n\tvar skup = napraviSet(niz);\n\t\t\n\t/* ako je velicina skupa 2, kandidat za full */\n\tif(skup.size === 2)\n\t{\n\t\tvar tmp = 0;\n\n\t\t/* since we dont have [] operator for sets in java script */\n\t\tvar tmpn = Array.from(skup);\n\n\t\t/* koji ful? */\n\t\tfor(var i=0; i<niz.length; ++i)\n\t\t{\n\t\t\tif(tmpn[0] === niz[i])\n\t\t\t\t++tmp;\n\t\t}\n\n\t\t//console.log(\"148 \" + tmp);\n\n\t\tif(tmp === 2)\n\t\t{\n\t\t\treturn tmp*tmpn[0] + 3*tmpn[1] + 40;\n\t\t}\n\n\t\tif(tmp === 3)\n\t\t{\n\t\t\treturn tmp*tmpn[0] + 2*tmpn[1] + 40;\n\t\t}\n\t}\n\telse\n\t\treturn 0;\n\n}", "function evaluate(criterios){\n for(let criterio of criterios){\n let modelo = criterio.notas.modelo\n let resultado = criterio.resultado\n \n /*\n #1\n modelo: {\n peso: 1,\n intervalo: {\n tipo: discreto,\n valor: [0, 5]\n }\n }\n resultado: 3\n \n #2\n modelo: {\n peso: 2,\n lista: [{\n texto: Danificada,\n valor: -1\n }, {...}, ...]\n }\n resultado: [0, 3]\n\n #3\n modelo: {\n peso: 2,\n boleano: {\n texto: Pets,\n valor: true/false\n }\n }\n resultado: true\n */\n \n let normal;\n if(modelo.intervalo){\n normal = (resultado - modelo.intervalo.valor[0])/(modelo.intervalo.valor[1] - modelo.intervalo.valor[0])\n }else if(modelo.booleano){\n normal = +(resultado == modelo.booleano.valor) * modelo.booleano.peso\n }else if(modelo.lista){\n let soma = modelo.lista.filter((v, i) => {\n return i in resultado\n }).reduce((acc, cur) => {\n return acc + cur.valor\n }, 0)\n let lista_ordenada = modelo.lista.sort((a, b) => a.valor - b.valor)\n let len_lista = modelo.lista.length\n \n let minimo = lista_ordenada[0].valor\n let maximo = lista_ordenada[len_lista-1].valor\n \n normal = (soma - minimo) / (maximo - minimo)\n }\n \n criterio.normal = normal\n criterio.normal_ponderada = normal * modelo.peso \n }\n \n let peso_total = criterios.reduce((acc, cur) => {\n return acc + cur.notas.peso\n }, 0)\n let nota_normal_ponderada_total = criterios.reduce((acc, cur) => acc + cur.normal_ponderada, 0)\n \n let nota_final = nota_normal_ponderada_total / peso_total\n \n return {\n final: nota_final,\n criterios: criterios.map(c => {\n return {\n resultado: c.resultado,\n normal: c.normal,\n peso: c.notas.peso,\n ponderada: c.ponderada\n }\n })\n }\n }", "function dibujarFresado109(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3, pliegueInf4]\n\t\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (var n=0; n<4 ;n=n+1){\n\t\tif (pliegueInferior<plieguesInf[n]){\n\t\t\tpliegueInferior=plieguesInf[n]\n\t\t}\n\t} \n\t\n\t\n\t//Puntos trayectoria \n \n\t\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado15 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior)\n\t\n\tvar fresado16 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+pliegueIzq)\n\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado22 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\n\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado15 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado22 , fresado17 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado16 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado18 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado12 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado13 , fresado20 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado14 ));\n\top_fresado.addObject(line,false);\n\n\t\n\t\n\t\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1){\n\t\tvar fresado10 = new RVector(pos.x+alaIzquierda,pos.y+pliegueInferior+alaInferior-pliegueIzq) \n\t\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado2 = new RVector(pos.x+alaIzquierda+pliegueIzq,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1-pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado10 , fresado1 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado11 ));\n\t\top_fresado.addObject(line,false);\n\n\t} \n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)){\n\t\tvar fresado4 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t\top_fresado.addObject(line,false);\n\t}\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3*2)){\n\t\tvar fresado6 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3-pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t} \n\t\n\t//anchura4 - Inferior\n\tif (anchura4>pliegueInf4){\n\t\tvar fresado8 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar fresado9 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t\n\t\n\n\t\n\t\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)){\n\t\tvar fresado25 = new RVector(pos.x+alaIzquierda+pliegueIzq+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado23 = new RVector(pos.x+alaIzquierda+pliegueIzq+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado24 = new RVector(pos.x+alaIzquierda+pliegueIzq+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado24 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)){\n\t\tvar fresado31 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado29 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado33 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2){ \n\t\tvar fresado37 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t\top_fresado.addObject(line,false);\n\t \n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado35 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado39 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior){\n\t\tvar fresado43 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado44 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado41 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado42 = new RVector(pos.x+alaIzquierda+pliegueIzq+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t\n\t\n\treturn op_fresado;\n}", "function formule_z(omegak0){\n\t\t//d騁ermine les formules qui sont utilent pour la distance metrique, omegak positif 0 ou negatif\n\tif (omegak0>0){\n\t return Sk_sin_x;\n \n\t\t}\n\telse if (omegak0===0){\n\t return Sk_x;\n\n\t\t}\n\telse{\n\t return Sk_sinh_x;\n\t}\n}", "function inverse(p) {\n var n;\n var x = p.x;\n var y = p.y;\n\n var delta_x = x - this.x0;\n var delta_y = y - this.y0;\n\n // 1. Calculate z\n var z_re = delta_y / this.a;\n var z_im = delta_x / this.a;\n\n // 2a. Calculate theta - first approximation gives km accuracy\n var z_n_re = 1;\n var z_n_im = 0; // z^0\n var z_n_re1;\n var z_n_im1;\n\n var th_re = 0;\n var th_im = 0;\n for (n = 1; n <= 6; n++) {\n z_n_re1 = z_n_re * z_re - z_n_im * z_im;\n z_n_im1 = z_n_im * z_re + z_n_re * z_im;\n z_n_re = z_n_re1;\n z_n_im = z_n_im1;\n th_re = th_re + this.C_re[n] * z_n_re - this.C_im[n] * z_n_im;\n th_im = th_im + this.C_im[n] * z_n_re + this.C_re[n] * z_n_im;\n }\n\n // 2b. Iterate to refine the accuracy of the calculation\n // 0 iterations gives km accuracy\n // 1 iteration gives m accuracy -- good enough for most mapping applications\n // 2 iterations bives mm accuracy\n for (var i = 0; i < this.iterations; i++) {\n var th_n_re = th_re;\n var th_n_im = th_im;\n var th_n_re1;\n var th_n_im1;\n\n var num_re = z_re;\n var num_im = z_im;\n for (n = 2; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n num_re = num_re + (n - 1) * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);\n num_im = num_im + (n - 1) * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);\n }\n\n th_n_re = 1;\n th_n_im = 0;\n var den_re = this.B_re[1];\n var den_im = this.B_im[1];\n for (n = 2; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n den_re = den_re + n * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);\n den_im = den_im + n * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);\n }\n\n // Complex division\n var den2 = den_re * den_re + den_im * den_im;\n th_re = (num_re * den_re + num_im * den_im) / den2;\n th_im = (num_im * den_re - num_re * den_im) / den2;\n }\n\n // 3. Calculate d_phi ... // and d_lambda\n var d_psi = th_re;\n var d_lambda = th_im;\n var d_psi_n = 1; // d_psi^0\n\n var d_phi = 0;\n for (n = 1; n <= 9; n++) {\n d_psi_n = d_psi_n * d_psi;\n d_phi = d_phi + this.D[n] * d_psi_n;\n }\n\n // 4. Calculate latitude and longitude\n // d_phi is calcuated in second of arc * 10^-5, so we need to scale back to radians. d_lambda is in radians.\n var lat = this.lat0 + (d_phi * __WEBPACK_IMPORTED_MODULE_0__constants_values__[\"e\" /* SEC_TO_RAD */] * 1E5);\n var lon = this.long0 + d_lambda;\n\n p.x = lon;\n p.y = lat;\n\n return p;\n}", "function inverse(p) {\n var n;\n var x = p.x;\n var y = p.y;\n\n var delta_x = x - this.x0;\n var delta_y = y - this.y0;\n\n // 1. Calculate z\n var z_re = delta_y / this.a;\n var z_im = delta_x / this.a;\n\n // 2a. Calculate theta - first approximation gives km accuracy\n var z_n_re = 1;\n var z_n_im = 0; // z^0\n var z_n_re1;\n var z_n_im1;\n\n var th_re = 0;\n var th_im = 0;\n for (n = 1; n <= 6; n++) {\n z_n_re1 = z_n_re * z_re - z_n_im * z_im;\n z_n_im1 = z_n_im * z_re + z_n_re * z_im;\n z_n_re = z_n_re1;\n z_n_im = z_n_im1;\n th_re = th_re + this.C_re[n] * z_n_re - this.C_im[n] * z_n_im;\n th_im = th_im + this.C_im[n] * z_n_re + this.C_re[n] * z_n_im;\n }\n\n // 2b. Iterate to refine the accuracy of the calculation\n // 0 iterations gives km accuracy\n // 1 iteration gives m accuracy -- good enough for most mapping applications\n // 2 iterations bives mm accuracy\n for (var i = 0; i < this.iterations; i++) {\n var th_n_re = th_re;\n var th_n_im = th_im;\n var th_n_re1;\n var th_n_im1;\n\n var num_re = z_re;\n var num_im = z_im;\n for (n = 2; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n num_re = num_re + (n - 1) * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);\n num_im = num_im + (n - 1) * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);\n }\n\n th_n_re = 1;\n th_n_im = 0;\n var den_re = this.B_re[1];\n var den_im = this.B_im[1];\n for (n = 2; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n den_re = den_re + n * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);\n den_im = den_im + n * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);\n }\n\n // Complex division\n var den2 = den_re * den_re + den_im * den_im;\n th_re = (num_re * den_re + num_im * den_im) / den2;\n th_im = (num_im * den_re - num_re * den_im) / den2;\n }\n\n // 3. Calculate d_phi ... // and d_lambda\n var d_psi = th_re;\n var d_lambda = th_im;\n var d_psi_n = 1; // d_psi^0\n\n var d_phi = 0;\n for (n = 1; n <= 9; n++) {\n d_psi_n = d_psi_n * d_psi;\n d_phi = d_phi + this.D[n] * d_psi_n;\n }\n\n // 4. Calculate latitude and longitude\n // d_phi is calcuated in second of arc * 10^-5, so we need to scale back to radians. d_lambda is in radians.\n var lat = this.lat0 + (d_phi * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SEC_TO_RAD\"] * 1E5);\n var lon = this.long0 + d_lambda;\n\n p.x = lon;\n p.y = lat;\n\n return p;\n}", "function FlexibleFit() { }", "function optimal_compos_golden(adr)//mam sklad 7, szukam czy ktos na lawce sie nadaje//szukanie lepszego perfo-nie roz problem\n{\n if(adr==1)\n {\n \ttea = team1;//z tempo odczyt, a do tempz zapisuje;\n }\n else \n {\n \ttea = team2;//z tempo odczyt, a do tempz zapisuje;\n }\n//console.log(changes);\n var all_lawka = [];\n var item1 = [];\n var item2 = [];\n var item3 = [];\n var item4 = [];\n for(var i=1;i<=6;i++)//mam gwaracje, że przejdzie przez każdego R na ławce, ale dalej zawsze wybierze najlepszego\n {\t\n tea[0]=Array(0,0,0,0,0,0,0,0,0,0,0,0);\n item1 = [];item2 = [];item3 = [];item4 = [];\n\t\t\tfor(var j=8;j<=12;j++)\n\t\t\t{\n\t\t\t //item = [];\n if(tea[j][4]==\"R\" && i == 1)// i = 1 - sprawdzam każdego z ławki konkretnie za R\n\t\t\t {\n\t\t\t \tif(tea[j][11] > (tea[i][11]+1))\n {\n nadwyzka = tea[j][11] - tea[i][11];nadwyzka = zaokr(nadwyzka); \n item1 = [j, i, nadwyzka];\n all_lawka.unshift(item1);// \n }\n\t\t\t }\n if(tea[j][4]==\"A\" && i == 4)// i = 4\t\n\t\t\t {\n\t\t\t \tif(tea[j][6] > (tea[i][6]+1))\n {\n nadwyzka = tea[j][6] - tea[i][6];nadwyzka = zaokr(nadwyzka);\n item2 = [j, i, nadwyzka];\n all_lawka.unshift(item2);// \n }\n\t\t\t }\n item3 =[];\n if(tea[j][4]==\"P\" && (i == 2 || i == 5))// i = 2; i =5;\n\t\t\t {\n\t\t\t \tif( (tea[j][6]+tea[j][7])/2 > ((tea[i][6]+tea[i][7])/2)+1)\n {\n nadwyzka = (tea[j][6]+tea[j][7])/2 - ((tea[i][6]+tea[i][7])/2);nadwyzka = zaokr(nadwyzka);\n item3=[];\n item3 = [j, i, nadwyzka];\n test = all_lawka.unshift(item3);//\n //alert(\"test-length: \"+test+\" item: \"+item3);\n }\n\t\t\t }\n if(tea[j][4]==\"S\" && (i == 3 || i == 6))// i = 3; i =6;\n\t\t\t {\n\t\t\t \tif( (tea[j][6]+tea[j][9])/2 > ((tea[i][6]+tea[i][9])/2)+1)\n {\n nadwyzka = (tea[j][6]+tea[j][9])/2 - ((tea[i][6]+tea[i][9])/2);nadwyzka = zaokr(nadwyzka);\n item4 = [j, i, nadwyzka];\n all_lawka.unshift(item4);// \n }\n\t\t\t }\n } //end of for j=8..12\n //console.log(all_lawka);\n }//end of for i=1..6\n //sortowanie\n for(u=0; u<all_lawka.length; u++)\n {\n for(w=1; w<all_lawka.length; w++)\n {\n if(all_lawka[w][2] > all_lawka[w-1][2])\n {\n temp = all_lawka[w-1];\n all_lawka[w-1] = all_lawka[w];\n all_lawka[w] = temp;\n }\n }\n }\n //próba wykoanania zmiany\n for(u=0; u<all_lawka.length; u++)\n {\n out_id = all_lawka[u][1];\n in_id = all_lawka[u][0];\n out_nr = tea[out_id][3]; //na indeksie 1 mam wyznaczonego do zejścia - nr dla funkcji possible_change\n in_nr = tea[in_id][3]; //\n if(adr == 1)\n {\n if(possible_change(adr, out_nr, in_nr) < 6)\n {\nvar fffv = document.getElementById(\"screen3\").innerHTML;\ndocument.getElementById(\"screen3\").innerHTML=fffv+\"<br>(\"+pkt1+\":\"+pkt2+\") \"+tea[in_id][5]+\" za: \"+tea[out_id][5]+\" (stan: \"+mm1+\" : \"+mm2+\") \";\n//2021-01-13: nowy screen do zapisu zmian na czas seta\nvar fffv = document.getElementById(\"change_info1\").innerHTML;\ndocument.getElementById(\"change_info1\").innerHTML=fffv+\"<br>(\"+pkt1+\":\"+pkt2+\") \"+tea[in_id][5]+\" za \"+tea[out_id][5];\n change1(out_id,in_id); flag_golden1 = 1; return 0;\n }\n }\n else\n {\n if(possible_change(adr, out_nr, in_nr) < 6)\n {\nvar fffv = document.getElementById(\"screen6\").innerHTML;\ndocument.getElementById(\"screen6\").innerHTML=fffv+\"<br>(\"+pkt1+\":\"+pkt2+\") \"+tea[in_id][5]+\" za: \"+tea[out_id][5]+\" (stan: \"+mm1+\" : \"+mm2+\") \";\n//2021-01-13: nowy screen do zapisu zmian na czas seta\nvar fffv = document.getElementById(\"change_info2\").innerHTML;\ndocument.getElementById(\"change_info2\").innerHTML=fffv+\"<br>(\"+pkt1+\":\"+pkt2+\") \"+tea[in_id][5]+\" za \"+tea[out_id][5];\n change2(out_id,in_id); flag_golden2 = 1; return 0;\n }\n }\n }\n\n\n if(adr==1)\n {\n team1 = tea;\n }\n else \n {\n team2 = tea;\n }\n\n banch_ins();\n return 1;\n}", "_calcularIRPF(){\n if (this._baseIRPF <= 1903.98){\n return this._valorIRPF = 0;\n }\n else if (this._salarioBruto > 1903.98 && this._salarioBruto <= 2826.65){\n return this._valorIRPF = ((this._baseIRPF - 142.80) * 7.5 / 100);\n }\n else if (this._salarioBruto > 2826.65 && this._salarioBruto <= 3751.05){\n return this._valorIRPF = ((this._baseIRPF - 354.80) * 15 / 100);\n }\n else if (this._salarioBruto > 3751.05 && this._salarioBruto <= 4664.68){\n return this._valorIRPF = ((this._baseIRPF - 636.13) * 22.5 / 100);\n }\n else {\n return this._valorIRPF = ((this._baseIRPF - 869.36) * 27.5 / 100);\n } \n }", "function fl_outToHasa ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function thememascot_fitVids() {\n $('body').fitVids();\n }", "function dibujarFresado111(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\t\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3, pliegueInf4, pliegueInf5]\n\t\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (var n=0 ; n<5 ; n=n+1){\n\t\tif (pliegueInferior<plieguesInf[n]){\n\t\t\tpliegueInferior=plieguesInf[n]\n }\n }\n\t\n\t\n\t\n\t//Puntos trayectoria \n\n\t\n\tvar fresado11 = new RVector(pos.x+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior)\n\tvar fresado15 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+pliegueInferior) //nuevo\n\t\n\t\n\t\n\tvar fresado16 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior) \n\tvar fresado17 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado22 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+pliegueInferior+alturaPlaca) //muevo\n\t\n\tvar fresado23 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\n\t\n\t\n\t\n\t\n\tif (anchura5>pliegueInf5){\n\t\tvar fresado14b = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+pliegueInferior-pliegueInf5-alaInferior)\n var line = new RLineEntity(document, new RLineData( fresado14b , fresado23 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }else{\n var line = new RLineEntity(document, new RLineData( fresado15 , fresado23 ));\n\t op_fresado.addObject(line,false);\n }\n\t\n\tvar line = new RLineEntity(document, new RLineData( fresado16 , fresado15 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado15 , fresado22 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado14 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado13 , fresado20 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado12 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado18 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado22 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1){\n\t\t//var fresado10 = new RVector(pos.x,pos.y+pliegueInferior+alaInferior) \n\t\tvar fresado1 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t//var fresado2 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x+anchura1-pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\t//dibujarFresado_auxiliar(doc,fresado10,fresado1)\n var line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t//dibujarFresado_auxiliar(doc,fresado2,fresado11)\n } \n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)){\n\t\tvar fresado4 = new RVector(pos.x+anchura1+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x+anchura1+anchura2-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n var line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3*2)){\n\t\tvar fresado6 = new RVector(pos.x+anchura1+anchura2+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n var line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t op_fresado.addObject(line,false);\n } \n\t\n\t//anchura4 - Inferior\n\tif (anchura4>(pliegueInf4*2)){\n\t\tvar fresado8 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar fresado9 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n var line = new RLineEntity(document, new RLineData( fresado8 , fresado9 ));\n\t op_fresado.addObject(line,false);\n\t\t\n } \n\t\n\t//anchura4 - Inferior\n\tif (anchura5>pliegueInf5){\n\t\tvar fresado10 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueInf5,pos.y+alaInferior+pliegueInferior-pliegueInf5)\n\t\tvar fresado11 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+pliegueInferior-pliegueInf5)\n var line = new RLineEntity(document, new RLineData( fresado10 , fresado11 ));\n\t op_fresado.addObject(line,false);\n\t\t\n } \n\t\n\t\n\t\n\n\t\n\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)){\n\t\tvar fresado25 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado27 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t op_fresado.addObject(line,false);\n }\n }\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)){\n\t\tvar fresado31 = new RVector(pos.x+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado29 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado33 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado37 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado35 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado39 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior*2){\n\t\tvar fresado43 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado44 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado41 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado42 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado45 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado46 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado45 , fresado46 ));\n\t op_fresado.addObject(line,false);\n }\n }\n\t\n\t//anchura5 - Superior\n\tif (anchura5>pliegueSuperior){\n\t\tvar fresado49 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado50 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado49 , fresado50 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado47 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado48 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado47 , fresado48 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t\n\treturn op_fresado;\n}", "function gradenumeric() {\n //var fasit = qobj.fasit;\n // for numeric the fasit is a template like this\n // 33.13:0.5 the answer is 33.13 +- 0.5\n // 32.0..33.5 the answer must be in the interval [32.0,33.5]\n // TODO a..b is the same as rng:a,b -- should we drop one of them?\n // nor:m,s the answer x is scored as e^-((1/(2) * ((x-m)/s)^2\n // sym:exp the answer x is scored as pycas(x - exp) == 0\n // eva:exp|a|b the answer x is scored as eval(x) == exp\n // zro:exp|a the answer x is correct if |exp(x)| < a\n // reg:r the answer x is scored as regular exp match for x,r\n // lis:a:A,b:B,c the answer x is scored as x == one of a,b,c - score is given by :A or 1\n var cor = ff;\n switch (swi) {\n case 'nor:':\n var norm = tch.split(',');\n var med = +norm[0];\n var std = +norm[1];\n var ex = ((uanum - med)/std);\n var sco = Math.pow(2.712818284,-(0.5*ex*ex));\n if (sco > 0.05) {\n ucorr += sco;\n feedb = Math.floor((1-sco)*10);\n } else {\n uerr++;\n }\n cor = med;\n break;\n case 'rng:': // [[rng:10,20]]\n var lims = tch.split(',');\n var lo = +lims[0];\n var hi = +lims[1];\n if (uanum >= lo && uanum <= hi) {\n ucorr += 1;\n feedb = 1;\n } else {\n uerr++;\n }\n cor = lo;\n break;\n case 'sym:':\n simple = false; // callback done after sympy is finished\n // fixup for 3x => 3*x etc\n var completed = { comp:0, lock:0 };\n if (uatxt == undefined || uatxt == '') {\n callback(score,'no input',completed,ua,1);\n } else {\n var elem = tch.split('|');\n var target = elem[0];\n var differ = elem[1]; // optional text that useranswer must NOT EQUAL\n // for symbolic equality - dont accept original equation\n // or new eq that is longer (not simpler)\n if (differ && (differ == uatxt || differ.length < uatxt.length) ) {\n callback(score,'sicut prius',completed,ua,1);\n } else {\n var ufu = sympify(target); // fasit\n cor = ufu;\n var fafu = sympify(uatxt); // user response\n var diffu = sympify(differ); // if testing equality - must be as short or shorter than this\n var intro = '# coding=utf-8\\n'\n + 'from sympy import *\\n';\n var text = 'x,y,z,a,b,c,d,e,f,u,v,w = symbols(\"x,y,z,a,b,c,d,e,f,u,v,w\")\\n'\n + 'a1=sympify(\"'+ufu+'\")\\n'\n + 'b1=sympify(\"'+fafu+'\")\\n'\n + 'c1=a1-b1\\n'\n + 'print simplify(c1)\\n';\n var score = 0;\n console.log(intro+text);\n fs.writeFile(\"/tmp/symp\"+now, intro+text, function (err) {\n if (err) { callback(score,'error1',completed,ua,1); throw err; }\n try {\n var child = exec(\"/usr/bin/python /tmp/symp\"+now, function(error,stdout,stderr) {\n fs.unlink('/tmp/symp'+now);\n //console.log(\"err=\",stderr,\"out=\",stdout,\"SOO\");\n if (error) {\n console.log(error,stderr);\n callback(score,'error2',completed,ua,1);\n } else {\n if (stdout && stdout != '') {\n //console.log(stdout);\n var feedb = stdout;\n var eta = +stdout.trim();\n if (_.isFinite(eta) && eta == 0 || Math.abs(eta) < 0.001 ) {\n score = 1\n if (differ) {\n // we are testing for simplification\n // minimum assumed to be ufu, diffu.length is original length (unsimplified)\n var span = diffu.length - ufu.length; // max shortening possible\n var dif = fafu.length - ufu.length; // how much shorter\n if (span > 0) {\n score = Math.max(0,Math.min(1,1-dif/span));\n // relative score depending on how many chars\n // you have shortened the eq - span assumed to be max\n feedb = (score > 0.8) ? 'Good answer' : (score > 0.5) ? 'Nearly' : 'Not quite';\n }\n } else {\n feedb = 'Correct answer';\n }\n } else {\n feedb = 'Incorrect answer';\n score = 0;\n }\n var cutcost = (attnum > 2) ? Math.min(1,cost*attnum*2) : cost*attnum;\n var adjust = score * (1 - cutcost - hintcost*hintcount);\n //console.log(qgrade,adjust,attnum,cost);\n score = aquest.points * Math.max(0,adjust);\n }\n //console.log(\"CAME SO FAR SYMBOLIC PYTHON \",eta,score,stdout,stderr,error);\n callback(score,feedb,completed,ua,1);\n }\n });\n } catch(err) {\n callback(score,'error3',completed,ua,1);\n }\n });\n }\n }\n break;\n case 'zro:':\n // zro:exp|a the answer x is correct if |exp(x)| < a\n var elem = tch.split('|');\n var exp = elem[0];\n var tol = elem[1] || 0.001 ;\n var sco = 0;\n exp = normalizeFunction(exp,0,ua);\n var num = +uatxt;\n if (uatxt != undefined && uatxt != '' && uatxt != '&nbsp;&nbsp;&nbsp;&nbsp;') {\n // user supplied root checked\n console.log(\"Checking if root:\",uatxt,exp);\n var bad = false;\n try {\n var fu1 = new Function(\"x\",' with(Math) { return ' +exp+'; }' );\n var f1 = Math.abs(fu1(num));\n console.log(\"Evalueated to \",f1,tol)\n if (f1 <= tol) {\n sco = 1;\n feedb = '1'; // mark as correct\n } else {\n bad = true;\n }\n }\n catch (err) {\n console.log(\"EVAL fu \",err);\n bad = true;\n }\n if (bad) {\n uerr++;\n } else {\n ucorr += sco;\n }\n }\n cor = 'NaN';\n break;\n case 'eva:':\n // eva:exp|a|b the answer x is scored as eval(x) == exp\n // the user answer must NOT EQUAL a,\n // Quiz: multiply (x+6) by 2, do not accept 2*(x+2)\n // eva:2x+12|2(x+6)\n // the answer should be as short as b (punished for extra chars - up to a.length)\n // simplify (2+4)*(7-5)\n // eva:12|(2+4)*(7-5)|12\n // so the constraints are : evaluate as 12, not eq \"(2+4)*(7-5)\" , as short as 12\n // partial score if between \"12\" and \"(2+4)*(7-5)\" in length\n var elem = tch.split('|');\n var exp = elem[0];\n var differ = elem[1]; // optional text that useranswer must NOT EQUAL\n var simply = elem[2]; // optional text that useranswer should match in length\n var lolim = -5;\n var hilim = 5;\n var sco = 0;\n exp = normalizeFunction(exp,0,ua);\n cor = exp;\n var ufu = normalizeFunction(uatxt,0);\n var udiff =normalizeFunction(differ,0);\n //console.log(exp,lolim,hilim,ufu);\n if (differ && (differ === uatxt || udiff === ufu) ) {\n uerr++;\n console.log(\"sicut prius\");\n } else if (exp === ufu) {\n ucorr++; // they are exactly equal\n feedb = '1'; // mark as correct\n //console.log(\"exact\");\n } else {\n //console.log(\"EVA:\",exp,ufu);\n if (uatxt != undefined && uatxt != '' && uatxt != '&nbsp;&nbsp;&nbsp;&nbsp;') {\n // user supplied function numericly tested against fasit\n // for x values lolim .. hilim , 20 steps\n var dx = (+hilim - +lolim) / 20;\n var bad = false;\n try {\n //return 'with(Math) { return ' + fu + '; }';\n var fu1 = new Function(\"x\",' with(Math) { return ' +exp+'; }' );\n var fu2 = new Function(\"x\",' with(Math) { return ' +ufu+'; }' );\n var reltol,f1,f2;\n for (var pi=0,xi = lolim; pi < 20; xi += dx, pi++) {\n //console.log(\"testing with \",xi);\n f1 = fu1(xi);\n f2 = fu2(xi);\n if (!isFinite(f1) && !isFinite(f2)) {\n reltol = 0;\n //console.log(\"NaN/inf\",xi,reltol);\n } else {\n reltol = f1 ? Math.abs(f1-f2)/Math.abs(f1) : Math.abs(f1-f2);\n }\n //console.log(xi,f1,f2,reltol);\n if (reltol > 0.005) {\n bad = true;\n break;\n }\n sco += reltol;\n }\n }\n catch (err) {\n console.log(\"EVAL fu \",err);\n bad = true;\n }\n if (bad) {\n uerr++;\n } else {\n if (simply) {\n // we are testing for simplification\n // minimum assumed to be simply.length, differ.length is original length (unsimplified)\n var span = differ.length - simply.length; // max shortening possible\n var dif = Math.min(span,Math.max(0,differ.length - ufu.length)); // how much shorter\n if (span > 0) {\n sco = 1 - Math.max(0,Math.min(1,dif/span));\n // relative score depending on how many chars\n // you have shortened the eq - span assumed to be max\n }\n }\n ucorr += 1 - sco;\n feedb = '1'; // mark as correct\n }\n }\n }\n break;\n case 'reg:':\n try {\n tch = tch.trim();\n var myreg = new RegExp('('+tch+')',\"gi\");\n var isgood = false;\n uatxt.replace(myreg,function (m,ch) {\n //console.log(\"REG:\",uatxt,tch,m,ch);\n isgood = (m == uatxt);\n });\n if ( isgood) {\n ucorr++; // good match for regular expression\n feedb = '1'; // mark as correct\n } else if (uatxt != undefined && uatxt != '' && uatxt != '&nbsp;&nbsp;&nbsp;&nbsp;') {\n uerr++;\n }\n }\n catch (err) {\n console.log(\"BAD REG EXP\",tch);\n if (uatxt != undefined && uatxt != '' && uatxt != '&nbsp;&nbsp;&nbsp;&nbsp;') {\n uerr++;\n }\n }\n cor = 'NaN';\n break;\n case 'lis:':\n var goodies = tch.split(',');\n if (goodies.indexOf(uatxt) > -1) {\n ucorr++;\n feedb = '1'; // mark as correct\n } else if (uatxt != undefined && uatxt != '' && uatxt != '&nbsp;&nbsp;&nbsp;&nbsp;') {\n uerr++;\n }\n cor = goodies[0];\n break;\n default:\n var num,tol,cor;\n cor = ff;\n //console.log(\"trying numeric\",ff,uatxt );\n if (ff == num) feedb = 1;\n if ( ff.indexOf(':') > 0) {\n // we have a fasit like [[23.3:0.5]]\n var elm = ff.split(':');\n num = +elm[0];\n tol = +elm[1];\n cor = num;\n //console.log(\"NUM:TOL\",ff,num,tol,uanum);\n } else if ( ff.indexOf('..') > 0) {\n // we have a fasit like [[23.0..23.5]]\n var elm = ff.split('..');\n var lo = +elm[0];\n var hi = +elm[1];\n tol = (hi - lo) / 2;\n num = lo + tol;\n cor = num;\n //console.log(\"LO..HI\",ff,lo,hi,num,tol,uanum);\n } else {\n num = +ff; tol = 0.0001;\n }\n if ( ff == 'any' || ff == 'anytext' || Math.abs(num - uanum) <= tol) {\n ucorr++;\n feedb = '1'; // mark as correct\n } else if (uatxt != undefined && uatxt != '' && uatxt != '&nbsp;&nbsp;&nbsp;&nbsp;') {\n uerr++;\n }\n break;\n }\n return cor;\n }", "function dibujarFresado115(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3, pliegueInf4]\n\t\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (n=1 ; n<4 ; n=n+1){\n\t\tif (pliegueInferior<plieguesInf[n]) {\n\t\t\tpliegueInferior=plieguesInf[n]\n\t\t}\n\t}\n\t\n\t\n\t\n\t//Puntos trayectoria\t\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior)\n\t\n\tvar fresado16 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior) \n\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado22 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado2 = new RVector(pos.x+alaIzquierda,pos.y)\n\t\n\t\n\tvar line = new RLineEntity(document, new RLineData( fresado16 , fresado14 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado20 , fresado13 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado12 , fresado19 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado18 , fresado11 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado21 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1) {\n\t\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)) {\n\t\tvar fresado4 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t\top_fresado.addObject(line,false);\n\t}\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3*2)) {\n\t\tvar fresado6 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t//anchura4 - Inferior\n\tif (anchura4>pliegueInf4) {\n\t\tvar fresado8 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar fresado9 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t\n\t\n\n\t\n\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)) {\n\t\tvar fresado25 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) { //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)) {\n\t\tvar fresado31 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado29 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\tvar fresado33 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2) {\n\t\tvar fresado37 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado35 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\tvar fresado39 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior) {\n\t\tvar fresado43 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado44 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado41 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado42 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\tvar fresado2 = new RVector(pos.x+alaIzquierda,pos.y)\n\tvar fresado25 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado25 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\treturn op_fresado; \n}" ]
[ "0.61084867", "0.587679", "0.5835429", "0.5835396", "0.58104366", "0.57809347", "0.5733182", "0.56833196", "0.5661794", "0.56308764", "0.55949163", "0.55936474", "0.54703647", "0.5454087", "0.54278964", "0.54215914", "0.5387993", "0.53754514", "0.53615636", "0.53598315", "0.5350266", "0.5322632", "0.53097093", "0.5305475", "0.5284994", "0.52747667", "0.527307", "0.5265618", "0.52523786", "0.52505434", "0.52421874", "0.523364", "0.5231785", "0.5222762", "0.5215405", "0.5214385", "0.5207035", "0.5200504", "0.5197469", "0.51787597", "0.51785946", "0.5164147", "0.5142779", "0.5142761", "0.51411074", "0.5139077", "0.51375264", "0.51369685", "0.5133527", "0.51333606", "0.5133288", "0.5130553", "0.5105833", "0.5105064", "0.5096858", "0.5081481", "0.5081177", "0.50788885", "0.5078503", "0.50773036", "0.5075569", "0.5075246", "0.5069407", "0.50687957", "0.50629914", "0.50619286", "0.5059488", "0.5059031", "0.5057477", "0.50574046", "0.50529736", "0.50515777", "0.5050922", "0.50399387", "0.50353706", "0.5031717", "0.5030654", "0.5030532", "0.5030233", "0.5029259", "0.5023152", "0.5020367", "0.50170255", "0.5015306", "0.5007904", "0.50017816", "0.5000184", "0.50000095", "0.49953735", "0.49945766", "0.49913648", "0.4989844", "0.4989844", "0.49866658", "0.4985514", "0.49828473", "0.49798384", "0.49796692", "0.49782225", "0.4977189", "0.49673837" ]
0.0
-1
Sortira vrste po fitnesu
sortSpecies() { //Sortira igrace po vrsti for (let s of this.species) { s.sortSpecies(); } //Sortira vrste po fitnesu najboljeg igraca let temp = []; for (let i = 0; i < this.species.length; i++) { let max = 0; let maxIndex = 0; for (let j = 0; j < this.species.length; j++) { if (this.species[j].bestFitness > max) { max = this.species[j].bestFitness; maxIndex = j; } } temp.push(this.species[maxIndex]); this.species.splice(maxIndex, 1); i--; } this.species = []; arrayCopy(temp, this.species); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortujPoTytule() {\n \n // resetujemy monit o dodaniu filmu (aby caly czas sie nie wyswietlal)\n // paragraf ten bedzie istnial juz w dokumencie HTML\n // przy pierwszym wywolaniu tej funkcji\n parWalidacjaDodanegoFilmu.innerHTML = \"\";\n\n if (tytulRosnaco) {\n\t// mozliwosc przeslania wlasnej funkcji sortujacej daje duza plastycznosc\n\tlistOfMovies.sort((a, b) => getTitle(a).localeCompare(getTitle(b)));\n\ttytulRosnaco = !tytulRosnaco;\n\t\n\t// update-owanie napisu w przycisku\n\t// przy kazdym sortowaniu zmieni sie wartosc przecisku aby\n\t// uzytkownik wiedzial co i jak\n\t// przy pierwszym wywolaniu tej funkcji zmienna przyciskSortujPoTytule\n\t// (patrz nizej bedzie juz istniala)\n\tprzyciskSortujPoTytule.value = \"Sortuj po tytule (malejąco)\";\n\t\n\tusunListeKafelkow(); \t// usuwa liste kafelkow\n\t// a teraz ja odtwarza\n\toutput.appendChild(utworzListeKafelkow(listOfMovies));\n\t\n\t// updateujemy i wyswietlamy liczbe filmow i liczbe filmow widocznych\n\tupdateFilmyWszystkieIwidoczne();\n\twyswietlFilmyWszystkieIwidoczne();\n\n } else {\n\t// mozliwosc przeslania wlasnej funkcji sortujacej daje duza plastycznosc\n\tlistOfMovies.sort((a, b) => getTitle(b).localeCompare(getTitle(a)));\n\ttytulRosnaco = !tytulRosnaco;\n\n\t// update-owanie napisu w przycisku\n\t// przy kazdym sortowaniu zmieni sie wartosc przecisku\n\t// aby uzytkownik wiedzial co i jak\n\t// przy pierwszym wywolaniu tej funkcji zmienna przyciskSortujPoTytule\n\t// (patrz nizej) bedzie juz istniala\n\tprzyciskSortujPoTytule.value = \"Sortuj po tytule (rosnąco)\";\n\n\tusunListeKafelkow(); \t// usuwa liste kafelkow\n\t// a teraz ja odtwarza\n\toutput.appendChild(utworzListeKafelkow(listOfMovies));\n\t\n\t// updateujemy i wyswietlamy liczbe filmow i liczbe filmow widocznych\n\tupdateFilmyWszystkieIwidoczne();\n\twyswietlFilmyWszystkieIwidoczne();\n }\n\n // aby przy dodaniu filmu do listy posortowac je odpowiednio przy wyswietleniu\n // przy pierwszym wywolaniu tej funkcji zmienna ostatnoSortowanePo\n // bedzie juz istniala\n // (patrz nizej) bedzie juz istniala\n ostatnioSortowanePo = \"tytul\";\n}", "function sortirajSveRastuce() {\r\n console.log(\"SORTIRANJE\");\r\n console.log(nizPrikazanihProizvoda);\r\n let tempNiz = nizPrikazanihProizvoda;\r\n tempNiz.sort((a,b) => {\r\n if(a.cena == b.cena)\r\n return 0;\r\n return a.cena < b.cena ? -1 : 1;\r\n });\r\n prikaziProizvode(tempNiz);\r\n}", "function sortirajSveRastuce() {\r\n let tempNiz = nizPrikazanihProizvoda;\r\n tempNiz.sort((a,b) => {\r\n if(a.cena == b.cena)\r\n return 0;\r\n return a.cena < b.cena ? -1 : 1;\r\n });\r\n prikaziProizvode(tempNiz);\r\n}", "function sortujPoRoku() {\n \n // resetujemy monit o dodaniu filmu (aby caly czas sie nie wyswietlal)\n // paragraf ten bedzie istnial juz w dokumencie HTML\n // przy pierwszym wywolaniu tej funkcji\n parWalidacjaDodanegoFilmu.innerHTML = \"\";\n \n if (rokRosnaco) {\n\t// mozliwosc przeslania wlasnej funkcji sortujacej daje duza plastycznosc\n\t// getYear() zwraca rok jako string (np. \"1998\")\n\tlistOfMovies.sort((a, b) => parseInt(getYear(a)) - parseInt(getYear(b)));\n\trokRosnaco = !rokRosnaco;\n\t\n\t// update-owanie napisu w przycisku\n\t// przy kazdym sortowaniu zmieni sie wartosc przecisku \n\t// aby uzytkownik wiedzial co i jak\n\t// przy pierwszym wywolaniu tej funkcji zmienna przyciskSortujPoRoku\n\t// (patrz nizej bedzie juz istniala)\n\tprzyciskSortujPoRoku.value = \"Sortuj po roku (malejąco)\";\n\t\n\tusunListeKafelkow(); \t// usuwa liste kafelkow\n\t// a teraz ja odtwarza\n\toutput.appendChild(utworzListeKafelkow(listOfMovies));\n\t\n\t// updateujemy i wyswietlamy liczbe filmow i liczbe filmow widocznych\n\tupdateFilmyWszystkieIwidoczne();\n\twyswietlFilmyWszystkieIwidoczne();\n\t\n\n } else {\n\t// mozliwosc przeslania wlasnej funkcji sortujacej daje duza plastycznosc\n\t// getYear() zwraca rok jako string (np. \"1998\")\n\tlistOfMovies.sort((a, b) => parseInt(getYear(b)) - parseInt(getYear(a)));\n\trokRosnaco = !rokRosnaco;\n\n\t// update-owanie napisu w przycisku\n\t// przy kazdym sortowaniu zmieni sie wartosc przecisku\n\t// aby uzytkownik wiedzial co i jak\n\t// przy pierwszym wywolaniu tej funkcji zmienna przyciskSortujPoRoku\n\t// (patrz nizej bedzie juz istniala)\n\tprzyciskSortujPoRoku.value = \"Sortuj po roku (rosnąco)\";\n\t\n\tusunListeKafelkow(); \t// usuwa liste kafelkow\n\t// a teraz ja odtwarza\n\toutput.appendChild(utworzListeKafelkow(listOfMovies));\n\t\n\t// updateujemy i wyswietlamy liczbe filmow i liczbe filmow widocznych\n\tupdateFilmyWszystkieIwidoczne();\n\twyswietlFilmyWszystkieIwidoczne();\n\n }\n // aby przy dodaniu filmu do listy posortowac je odpowiednio przy wyswietleniu\n // przy pierwszym wywolaniu tej funkcji zmienna ostatnoSortowanePo\n // bedzie juz istniala\n ostatnioSortowanePo = \"rok\";\n}", "function sortirajSveOpadajuce() {\r\n console.log(\"SORTIRANJE\");\r\n console.log(nizPrikazanihProizvoda);\r\n let tempNiz = nizPrikazanihProizvoda;\r\n tempNiz.sort((a,b) => {\r\n if(a.cena == b.cena)\r\n return 0;\r\n return a.cena > b.cena ? -1 : 1;\r\n });\r\n prikaziProizvode(tempNiz);\r\n}", "function kartenSortieren() {\n hand.sort(sortByvalue);\n hand.sort(sortBybild);\n handkarten();\n}", "function sortirajSveOpadajuce() {\r\n let tempNiz = nizPrikazanihProizvoda;\r\n tempNiz.sort((a,b) => {\r\n if(a.cena == b.cena)\r\n return 0;\r\n return a.cena > b.cena ? -1 : 1;\r\n });\r\n prikaziProizvode(tempNiz);\r\n}", "function ordenPorTitulos(misPeliculas){\n var titulos=misPeliculas.slice(0);\n titulos.sort(function(a,b){\n var x=a.titulo.toLowerCase();\n var y=b.titulo.toLowerCase();\n return x < y?-1:x>y?1:0;\n });\n console.log(titulos);\n}", "function sortFunction(a, b) {\n $('#deus_loader span').text('Tri par mots clés');\n if (a.deus_keywords_similarities === b.deus_keywords_similarities) {\n if (a.note_deussearch === b.note_deussearch) {\n return 0;\n }\n if(a.note_deussearch < b.note_deussearch) {\n return 1;\n }\n if(a.note_deussearch > b.note_deussearch) {\n return -1;\n }\n }\n if(a.deus_keywords_similarities < b.deus_keywords_similarities) {\n return 1;\n }\n if(a.deus_keywords_similarities > b.deus_keywords_similarities) {\n return -1;\n }\n }", "function sortByFuerzaAsc(a, b) {\n if (a.fuerza > b.fuerza) return 1;\n if (a.fuerza < b.fuerza) return -1;\n return 0;\n}", "function Sort() {}", "function sortArray() {\n\n //PRZYPISANIE WARTOSCI DO TABLICY\n var points = [41, 3, 6, 1, 114, 54, 64];\n\n //SORTOWANIE OD NAJMNIEJSZEJ DO NAJWIEKSZEJ\n points.sort(function (a, b) {\n //POROWNANIE DWOCH ELEM. TABLICY - MNIEJSZY STAWIA PO LEWEJ, WIEKSZY PO PRAWEJ\n return a - b;\n });\n\n //ZWROCENIE POSORTOWANEJ TABLICY\n return points;\n}", "sort () {\n\n\t\tthis.Dudes.sort((a, b) => {\n\t\t\treturn b.amIToughEnough(this.fitnessFunction) - a.amIToughEnough(this.fitnessFunction);\n\t\t});\n\n\t}", "sort(){\n\n }", "function ordina(){\n\n\tfor (var i = 0; i<persone.length; i++){\n\t\tvar minimoFinOra = i; \n\n\t\tfor(var j=i+1; j<persone.length; j++){\n\n\t\t\tif(persone[j].altezza<persone[minimoFinOra].altezza){\n\n\t\t\t\tminimoFinOra = j;\n\t\t\t}\n\t\t}\n\t\t// Salvo il valore minimo\n\t\tvar tmp = persone[i];\n\t\tpersone[i] = persone[minimoFinOra];\n\t\tpersone[minimoFinOra] = tmp;\n\t}\n\t//Visualizzo\n\tvisualizzaPersone();\n}", "function funzioneSort(type) {\n\tvar freturn;\n\n\ttype= Number(type)\n\n\tswitch (type) {\n\t\tcase 0:\n\t\t\t\t\t\tfreturn=function(a,b) {\n\t\t\t\t\t\t\tvar tita = $(a).find(\"h3\").text();\n\t\t\t\t\t\t\tvar titb = $(b).find(\"h3\").text();\n\n\t\t\t\t\t\t\tif (tita >= titb) {\n\t\t\t\t\t\t\t\treturn 1\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn -1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\tbreak;\n\t\tcase 1:\n\t\t\t\t\t\tfreturn=function(a,b) {\n\t\t\t\t\t\t\tvar tita = $(a).find(\"h3\").text();\n\t\t\t\t\t\t\tvar titb = $(b).find(\"h3\").text();\n\n\t\t\t\t\t\t\tif (tita <= titb) {\n\t\t\t\t\t\t\t\treturn 1\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn -1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\tbreak;\n\t\tcase 2:\n\t\t\t\t\tfreturn=function(a,b) {\n\n\t\t\t\t\t\tvar datia = $(a).find(\"section strong\");\n\t\t\t\t\t\tvar datib = $(b).find(\"section strong\");\n\n\t\t\t\t\t\tvar lungha = parseFloat($(datia[0]).text())\n\t\t\t\t\t\tvar lunghb = parseFloat($(datib[0]).text())\n\n\t\t\t\t\t\tif (lungha >= lunghb) {\n\t\t\t\t\t\t\treturn 1\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn -1\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t\t\tfreturn=function(a,b) {\n\t\t\t\t\t\t\tvar datia = $(a).find(\"section strong\");\n\t\t\t\t\t\t\tvar datib = $(b).find(\"section strong\");\n\n\t\t\t\t\t\t\tvar lungha = parseFloat($(datia[0]).text())\n\t\t\t\t\t\t\tvar lunghb = parseFloat($(datib[0]).text())\n\n\t\t\t\t\t\t\tif (lungha >= lunghb) {\n\t\t\t\t\t\t\t\treturn -1\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn 1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t\t\tfreturn=function(a,b) {\n\t\t\t\t\t\t\tvar datia = $(a).find(\"span.full\");\n\t\t\t\t\t\t\tvar datib = $(b).find(\"span.full\");\n\n\t\t\t\t\t\t\tif (datia.length >= datib.length) {\n\t\t\t\t\t\t\t\treturn 1\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn -1\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\t\t\tfreturn=function(a,b) {\n\t\t\t\t\t\t\t\tvar datia = $(a).find(\"span.full\");\n\t\t\t\t\t\t\t\tvar datib = $(b).find(\"span.full\");\n\n\t\t\t\t\t\t\t\tif (datia.length < datib.length) {\n\t\t\t\t\t\t\t\t\treturn 1\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\treturn -1\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\t\tfreturn=function(a,b) {\n\t\t\t\t\t\t\t\t\tvar datia = $(a).find(\"section div.row div.col-md-9 span.gps-txt\");\n\t\t\t\t\t\t\t\t\tvar datib = $(b).find(\"section div.row div.col-md-9 span.gps-txt\");\n\n\t\t\t\t\t\t\t\t\tvar distA = parseFloat($(datia).text())\n\t\t\t\t\t\t\t\t\tvar distB = parseFloat($(datib).text())\n\n\t\t\t\t\t\t\t\t\tif (distA < distB) {\n\t\t\t\t\t\t\t\t\t\treturn -1\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\treturn 1\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\tbreak;\n\n\t\t\t\t\t\tcase 7:\n\t\t\t\t\t\t\t\t\tfreturn=function(a,b) {\n\t\t\t\t\t\t\t\t\t\tvar datia = $(a).find(\"section div.row div.col-md-9 span.gps-txt\");\n\t\t\t\t\t\t\t\t\t\tvar datib = $(b).find(\"section div.row div.col-md-9 span.gps-txt\");\n\n\t\t\t\t\t\t\t\t\t\tvar distA = parseFloat($(datia).text())\n\t\t\t\t\t\t\t\t\t\tvar distB = parseFloat($(datib).text())\n\n\t\t\t\t\t\t\t\t\t\tif (distA < distB) {\n\t\t\t\t\t\t\t\t\t\t\treturn 1\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\treturn -1\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t}\n\n\treturn freturn\n}", "function ascendente(col){ // uso de slice() para que no cambie el array original\n Equipos_sort= CpyEquipos_array.slice().sort(function(a,b){\n if (a.puntos[col] > b.puntos[col]) { // > ordena de mayor a menor\n return 1;\n }\n if (a.puntos[col] < b.puntos[col]) {\n return -1;\n }\n // a must be equal to b\n return 0;\n });\n}", "function sortArray() {\n //Twoj komentarz ...\n //deklaracje tablicy z elemtami\n var points = [41, 3, 6, 1, 114, 54, 64];\n\n //Twoj komentarz ...\n points.sort(function(a, b) {\n //Twoj komentarz ...\n\n return a - b;\n });\n\n //Twoj komentarz ...\n //zwrócenie tablicy points\n return points;\n}", "sort() {\n\t}", "sort() {\n\t}", "function sort(d) {\r\n\t\t\t\tif (d.children) {\r\n\t\t\t\t d.children = senseD3.sortByLEROI(d.children, 'le_roi');\r\n\t\t\t\t d.children.forEach(function(child){\r\n\t\t\t\t \t\t\t\t\t\tsort(child);\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\treturn d;\r\n\t\t\t}", "Sort() {\n\n }", "function ordena(v){\n //algoritmo do buble sort\n for(let i=0; i<v.length; i++){\n for(let j=0;j<v.length-1; j++){\n if(v[j]> v[j+1]){\n //troca\n let aux = v[j]\n v[j] = v[j+1]\n v[j+1] = aux\n }\n }\n }\n //return v\n}", "function sorte ( i ){\n return function(){\n if(scope.sorting.obj){\n //var index = _.findIndex(scope.viewer, scope.sorting.obj);\n }\n var key = scope.headers[i].field;\n if(scope.sorting.field === key){\n scope.sorting.direction = scope.sorting.direction * -1;\n }else{\n scope.sorting.field = key;\n scope.sorting.direction = 1;\n }\n sorter(key,scope.sorting.direction);\n scope.sorting.obj = scope.headers[i];\n scope.buildTable();\n\n };\n }", "function sorte ( i ){\n return function(){\n if(scope.sorting.obj){\n //var index = _.findIndex(scope.viewer, scope.sorting.obj);\n }\n var key = scope.headers[i].field;\n if(scope.sorting.field === key){\n scope.sorting.direction = scope.sorting.direction * -1;\n }else{\n scope.sorting.field = key;\n scope.sorting.direction = 1;\n }\n sorter(key,scope.sorting.direction);\n scope.sorting.obj = scope.headers[i];\n scope.buildTable();\n\n };\n }", "sort () {\r\n this._data.sort((a, b) => a.sortOrder !== b.sortOrder ? b.sortOrder - a.sortOrder : a.value.localeCompare(b.value))\r\n }", "function sortPrice () {\n ispisArtikla.innerHTML = '';\n article.sort(compare);\n for (var i=0; i<article.length; i++) {\n if (article[i].stanje == true) {\n for (j=0; j<articleCategory.length; j++) {\n for (var k=0; k<articleCategory[j].podCategory.length; k++) {\n if (article[i].type == articleCategory[j].podCategory[k].id) {\n writeElement(i,j,k);\n }\n }\n }\n }\n }\n}", "function VardenSorter2018(){\n var list, i, sortera, b, borSortera;\n list = document.getElementById(\"varden\");\n sortera = true;\n while (sortera) {\n sortera = false;\n b = list.getElementsByTagName(\"LI\");\n for (i = 0; i < (b.length - 1); i++) {\n borSortera = false; \n if (Number(b[i].innerHTML) < Number(b[i + 1].innerHTML)) {\n borSortera = true;\n break;\n }\n }\n if (borSortera) {\n b[i].parentNode.insertBefore(b[i + 1], b[i]);\n sortera = true;\n }\n }\n}", "sortData() {\n this.data.sort(($val1, $val2 ) => {\n const a = JSON.stringify($val1[this.sortBy]);\n const b = JSON.stringify($val2[this.sortBy]);\n if ( a < b ){\n return -this.sortDir;\n }\n if ( a > b ){\n return this.sortDir;\n }\n return 0;\n });\n }", "function alphabetique(){\n entrepreneurs.sort.year\n }", "sort(){\n\t\tvar sortable = [];\n\t\tfor (var vehicle in this.primes) {\n\t\t sortable.push([vehicle, this.primes[vehicle]]);\n\t\t}\n\t\treturn sortable.sort(function(a, b) {\n\t\t return a[1] - b[1];\n\t\t});\n\t}", "tareasPorAntiguedad(){\n return this.tareas.sort((a,b) => b.antiguedad < a.antiguedad)\n }", "function sortByRichestAsc() {\n data.sort((a, b) => a.money - b.money);\n updateDOM();\n}", "function sortLeaguesByTeams() {\n // CODE HERE\n\n // Recorro las ligas \n const ligas = leagues.map(liga => {\n // creo un nuevo arreglo con los equipos que coincidan en id con esa liga.\n // en este nuevo arreglo tengo los equipos que pertenecen a una liga en especifica\n // al pasarlo por .length, obtengo en numero de equipos exactos.\n const teams = teamsByLeague.filter(wins => liga.id === wins.leagueId).length;\n\n // retorno la liga y el numero de equipos\n // utilizo el numero de equipos para ordenarlos\n return {\n liga: liga.name,\n champions: teams\n }\n });\n\n return ligas.sort(compare).map(item => item.liga);\n}", "function alphabeticallyOrder(){\n console.log(entrepreneurs.sort(trie));\n }", "function sortData (data) {\n ...\n}", "function sorterRetter() {\n console.log(\"Sortering\");\n\n document.querySelector(\"select\").addEventListener(\"change\", sorteringDropdown);\n\n function sorteringDropdown() {\n if (this.value == \"alfa\") {\n retter.sort((a, b) => a.navn.localeCompare(b.navn));\n } else if (this.value == \"pris-stigende\") {\n retter.sort((a, b) => a.pris - b.pris);\n } else if (this.value == \"pris-faldende\") {\n retter.sort((a, b) => b.pris - a.pris);\n }\n vis(retter, menuKategori);\n }\n }", "sortGraphics(a, b) {\n if (a.z === b.z) {\n return a.id - b.id;\n }\n return a.z - b.z;\n }", "function sortData(searches){\r\n var sorters = document.getElementsByName(\"sorter\");\r\n var sorted = 0;\r\n for(var x=0; x<4;x++){\r\n if(sorters[x].checked){\r\n sorted=x; break;\r\n }\r\n }\r\n /*\r\n sorted : \r\n 0 -> id\r\n 1 -> Name\r\n 2 -> Height\r\n 3 -> Weight\r\n */\r\n searches.sort(function (a,b){\r\n switch(sorted){\r\n case 0:\r\n return a.id - b.id;\r\n\r\n case 1:\r\n return a.name.localeCompare(b.name);\r\n \r\n case 2:\r\n return a.height-b.height;\r\n\r\n case 3:\r\n return a.weight - b.weight;\r\n }\r\n });\r\n return searches;\r\n}", "function sortMultiBattleResults(e){\n\t\t\t\tmultiBattleWorstToBest = ! multiBattleWorstToBest;\n\n\t\t\t\tif(multiBattleWorstToBest){\n\t\t\t\t\t$(\".multi-battle-sort\").html(\"Sort: Worst to best &#9650;\");\n\t\t\t\t} else{\n\t\t\t\t\t$(\".multi-battle-sort\").html(\"Sort: Best to worst &#9660;\");\n\t\t\t\t}\n\n\t\t\t\t// Reorganize child elements\n\n\t\t\t\t$(\".battle-results.multi .rankings-container\").children().each(function(i,li){$(\".battle-results.multi .rankings-container\").prepend(li)})\n\t\t\t}", "function ordenatuBerriak(berriako,prop, asc) {\n \n var berriab = berriako.Berriak.sort(function(a, b) {\n if (asc) {\n if (a[prop] > b[prop]) return 1;\n if (a[prop] < b[prop]) return -1;\n return 0;\n } else {\n if (b[prop] > a[prop]) return 1;\n if (b[prop] < a[prop]) return -1;\n return 0;\n }\n });\n //console.log(\"ORDENATU ONDOREN WORKERREAN\");\n berriako.Berriak = berriab;\n //console.log(berriab);\n berriab = '{ \"Berriak\" :' + JSON.stringify(berriab) + '}';\n //console.log(berriab);\n //console.log(\"ORDENATU ONDOREN WORKERREAN II\");\n //console.log(JSON.parse(berriab));\n // behin berriak ordenatuta, datuak itzuli !\n //postMessage(JSON.stringify(berriako));\n postMessage(JSON.stringify(berriab));\n //berriak ordenatuta objetua bistaratu kontsolan\n //console.log(\"workerrean eratutakoa\" + JSON.stringify(berriako) + berriako.Berriak);\n // behin ordenatuta dagoenean, BerriApp.js fitxategiari bidali, bistaratu dezan\n \n}", "function sorterTabell(tabellen) {\n var table = 0;\n var rader =0;\n var bytte= 0;\n var i= 0;\n var x= 0;\n var y= 0;\n var shouldSwitch= 0;\n var vei= 0;\n var switchcount = 0;\n table = document.getElementById(\"rapportTable\");\n vei = \"asc\";\n bytte = true;\n\n while (bytte) {\n bytte = false;\n rader = table.rows;\n for (i = 1; i < (rader.length - 1); i++) {\n shouldSwitch = false;\n y = rader[i + 1].getElementsByTagName(\"td\")[tabellen];\n x = rader[i].getElementsByTagName(\"td\")[tabellen];\n if (vei == \"asc\") {\n if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase()) {\n shouldSwitch = true;\n break;\n }\n\n } else if (vei == \"desc\") {\n if (x.innerHTML.toLowerCase() < y.innerHTML.toLowerCase()) {\n shouldSwitch = true;\n break;\n }\n }\n }\n if (shouldSwitch) {\n rader[i].parentNode.insertBefore(rader[i + 1], rader[i]);\n bytte = true;\n switchcount ++;\n } else {\n if (switchcount == 0 && vei == \"asc\") {\n vei = \"desc\";\n bytte = true;\n }\n\n }\n\n\n }\n }", "function resort(){\n if(scope.sorting && scope.sorting.obj){\n var sortKey = scope.sorting.obj.field;\n sorter(sortKey,scope.sorting.direction);\n }\n }", "function resort(){\n if(scope.sorting && scope.sorting.obj){\n var sortKey = scope.sorting.obj.field;\n sorter(sortKey,scope.sorting.direction);\n }\n }", "sort_by_fitness() {\n this.members.sort((firstEl, secondEl) => {\n if (firstEl.fitness > secondEl.fitness) {\n return -1;\n } else {\n return 1;\n }\n })\n }", "function sortRenderOrder() {\n \n var sortBy = function(field, reverse, primer){\n var key = primer ? function(x) {return primer(x[field])} : function(x) {return x[field]};\n reverse = [-1, 1][+!!reverse];\n return function (a, b) {\n\treturn a = key(a), b = key(b), reverse * ((a > b) - (b > a));\n } \n }\n \n gadgetRenderOrder.sort(sortBy(\"tabPos\", true, parseInt));\n gadgetRenderOrder.sort(sortBy(\"paneId\", true, parseInt));\n gadgetRenderOrder.sort(sortBy(\"parentColumnId\", true, parseInt));\n }", "function sortByScore()\n {\n newsItems.sort(function(a,b) {return a.points<b.points});\n console.log(newsItems);\n\n addNewsListItems();\n\n }", "_sortGenresByName(a, b) {\n if (a.slug < b.slug) {\n return -1;\n }\n if (a.slug > b.slug) {\n return 1;\n }\n return 0;\n }", "function klik() {\r\n a[1] = parseInt(document.getElementById(\"i1\").value);\r\n a[2] = parseInt(document.getElementById(\"i2\").value);\r\n a[3] = parseInt(document.getElementById(\"i3\").value);\r\n a[4] = parseInt(document.getElementById(\"i4\").value);\r\n a[5] = parseInt(document.getElementById(\"i5\").value);\r\n a[6] = parseInt(document.getElementById(\"i6\").value);\r\n a[7] = parseInt(document.getElementById(\"i7\").value);\r\n console.log(a.sort(function (p, q) {\r\n return p - q;\r\n }));\r\n\r\n document.getElementById(\"i1\").value = a[1];\r\n document.getElementById(\"i2\").value = a[2];\r\n document.getElementById(\"i3\").value = a[3];\r\n document.getElementById(\"i4\").value = a[4];\r\n document.getElementById(\"i5\").value = a[5];\r\n document.getElementById(\"i6\").value = a[6];\r\n document.getElementById(\"i7\").value = a[7];\r\n // console.log(BrojKombinacije(a));\r\n document.getElementById(\"i\").value = BrojKombinacije(a);\r\n}", "function sortJson() {\r\n\t \r\n}", "function ordenar(col){ // uso de slice() para que no cambie el array original\n Equipos_sort= CpyEquipos_array.slice().sort(function(a,b){\n if (a.puntos[col] < b.puntos[col]) { // > ordena de mayor a menor\n return 1;\n }\n if (a.puntos[col] > b.puntos[col]) {\n return -1;\n }\n // a must be equal to b\n return 0;\n });\n}", "function sortNumber(a, b) {\n return b.puntuacion - a.puntuacion;\n}", "function sortNumber(a, b) {\n return b.puntuacion - a.puntuacion;\n}", "function tirage_au_sort () \n{\n//tester la longueur de la chaine\nif (joueurs.length >0) \n\n{\n/*\n- déclaration d'une variable\n- methode mathematique pour melanger des donnees\n- tirage au sort d'une donnee\n- indication de la longueur de mon tableau joueurs\n*/\n\n\n\n\nvar rand = Math.floor(Math.random()*joueurs.length);\n\n// afficher le nom du gagnant//\ndocument.getElementById(\"affiche_gagnant\").innerHTML=\"Le gagnant est : <strong> \"+joueurs[rand]+\"</strong>\";\n}\nelse {\n alert(\"Vous n'avez pas inscrit de joueurs !!!\")\n}\n\n\n\n\n}", "function sortdata(a, b) {\n if (a.x != b.x) return a.x - b.x;\n if (a.y != b.y) return a.y - b.y;\n if (a.z != b.z) return a.z - b.z;\n if (a.bar != b.bar) return a.bar - b.bar;\n if (a.beat != b.beat) return a.beat - b.beat;\n return a.p - b.p;\n }", "sortByFitness() {\n\t\tthis.chromosomes = _.sortBy(this.chromosomes, 'totalDistance');\n\t}", "sortDonation(rev) {\n console.log(this.allBoxes);\n this.allBoxes = this.allBoxes.sort(compare);\n function compare(a, b) {\n let val;\n rev ? val = 1 : val = -1; \n let nameA = a.dataset.fundsNeeded;\n let nameB = b.dataset.fundsNeeded;\n return val * (nameA - nameB);\n }\n this.allBoxes.forEach(function(el, i) {el.style.order = i});\n }", "sort() {\r\n\t\treturn this.data.sort((a,b) => {\r\n\t\t\tfor(var i=0; i < this.definition.length; i++) {\r\n\t\t\t\tconst [code, key] = this.definition[i];\r\n\t\t\t\tswitch(code) {\r\n\t\t\t\t\tcase 'asc':\r\n\t\t\t\t\tcase 'desc':\r\n\t\t\t\t\t\tif (a[key] > b[key])\r\n\t\t\t\t\t\t\treturn code == 'asc' ? 1 : -1;\r\n\t\t\t\t\t\tif (a[key] < b[key])\r\n\t\t\t\t\t\t\treturn code == 'asc' ? -1 : 1;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'fn':\r\n\t\t\t\t\t\tlet result = key(a, b);\r\n\t\t\t\t\t\tif (result != 0) // If it's zero the sort wasn't decided.\r\n\t\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn 0;\r\n\t\t});\r\n\t}", "function orderByYear(peliculas) {\n const sortedPeliculas = [...peliculas];\n sortedPeliculas.sort((a, b) => {\n if (a.year - b.year)\n return a.year - b.year\n else {\n if (a.title < b.title) return -1\n else if (a.title > b.title) return 1\n else return 0\n }\n })\n return sortedPeliculas\n}", "order_() {\n const lines = Array.from(document.querySelectorAll(cssSelector.TUBE_LINE));\n const sorted = lines.sort((a, b) => {\n return +b.getAttribute(\"score\") - +a.getAttribute(\"score\");\n });\n\n Array.from(this.children).forEach((child) => {\n if (!child.classList.contains(cssClass.FILTER)) {\n this.removeChild(child);\n }\n });\n\n // insert sorted lines back into DOM\n sorted.forEach((line) => this.appendChild(line));\n }", "async function TopologicalSort(){}", "function doSortObjHighestToLowest() {\n const mappedNames = people.results\n .map((person) => {\n return {\n name: person.name.first,\n };\n })\n .filter((person) => person.name.startsWith('A')) //filtrando todos que começa com A\n .sort((a, b) => {\n return a.name.length - b.name.length;\n }); //ordenando\n console.log('lista de obj ordenados do menor para o maior', mappedNames);\n}", "function SortDistributionsByRank(){\n\tdistros.sort(Sort);\n\tvar lastPlace = 1;\n\tfor (var i = 1; i < distros.length;i++){\n\t\tdistros[i].Place = 1;\n\t\tif (distros[i].ChoosedBy == distros[i-1].ChoosedBy)\n\t\t\tdistros[i].Place = lastPlace;\n\t\telse\n\t\t\tdistros[i].Place = ++lastPlace;\n\t}\n}", "function sortFunction ( a, b ) { \n\t\t if (a[0] - b[0] != 0) {\n\t\t return (a[0] - b[0]);\n\t\t } else if (a[1] - b[1] != 0) { \n\t\t return (a[1] - b[1]);\n\t\t } else { \n\t\t return (a[2] - b[2]);\n\t\t }\n\t\t }", "function sortData(data) {\n displayComic(data.comics);\n //displayManga(data.manga);\n //displayGNovel(data.graphicNovels);\n readyComicFunctions();\n}", "function sortKittens() {\r\n loadKittens();\r\n\r\n //sort kittens in ascending order by name\r\n //list.sort((a, b) => (a.color > b.color) ? 1 : -1)\r\n let sortedKittens = kittens.sort((a, b) => (a.name > b.name) ? 1 : -1);\r\n\r\n\r\n\r\n //console.log(kittens.map(kitten =>kitten.name));\r\n\r\n saveKittens();\r\n\r\n}", "function sortPius(piusIds){\n piusIds.sort(function(a, b){return GeneralFunctions.getTimeFromPiuId(b) - GeneralFunctions.getTimeFromPiuId(a)});\n piusIds.sort(function(a, b){return baseDeDados.getDadosPiuFromPiuId(b).hasDestaque() - baseDeDados.getDadosPiuFromPiuId(a).hasDestaque()});\n}", "function sortReindeer(reindeerNames){\n const miData = reindeerNames.map((e, i) => {\n const temp = e.split(' ')\n return temp[1] + ' ' + temp[0]\n })\n\n miData.sort()\n\n return miData.map((e, i) => {\n const temp = e.split(' ')\n return temp[1] + ' ' + temp[0]\n })\n}", "function sortRichest(){\n data.sort( (a,b) => b.worth - a.worth );\n updateDOM();\n}", "function sort(){\n var toSort = S('#sched-list').children;\n toSort = Array.prototype.slice.call(toSort, 0);\n\n toSort.sort(function(a, b) {\n var a_ord = +a.id.split('e')[1]; //id tags of the schedule items are timeINT the INT = the numeric time\n var b_ord = +b.id.split('e')[1]; //splitting at 'e' and getting the element at index 1 gives use the numeric time\n\n return (a_ord > b_ord) ? 1 : -1;\n });\n\n var parent = S('#sched-list');\n parent.innerHTML = \"\";\n\n for(var i = 0, l = toSort.length; i < l; i++) {\n parent.appendChild(toSort[i]);\n }\n }", "set_lines(list_of_lines) {\n this.lines = list_of_lines;\n this.lines.sort((line1, line2) => {//Ordena las lineas según su punto más a la izquierda\n let min1 = (line1.a.x < line2.a.x) ? line1.a.x : line2.a.x;//Encuentro el minimo entre los puntos a \n let min2 = (line1.b.x < line2.b.x) ? line1.b.x : line2.b.x;//El mínimo entre los puntos b\n let min = (min1 < min2) ? min1 : min2;//Encuentro el mínimo de mínimos\n return ((min === line1.a.x) || (min === line1.b.x) ? -1 : 1);//Pregunto si el mínimo es el x de la\n //Linea 1, si es así, va primero regreso -1, si no, entonces el mínimo pertenece a la linea 2 y regreso 1\n \n });//Ordeno según el eje X\n this.original = [...this.lines];//Creo una copia de las lineas\n }", "req_08_ordenarLexical() {\n let lista = [\n { tipo: \"driver\", nombre: this.hacker1 },\n { tipo: \"hacker\", nombre: this.hacker2 }\n ];\n\n let fnOrdenar = (a, b) => {\n //TODO ver si aplica algo como localization- seguro si\n return a.nombre > b.nombre;\n };\n\n let listaOrdenada = lista.sort(fnOrdenar);\n\n let itemPosicion1 = listaOrdenada[0];\n\n let texto = `The ${itemPosicion1.tipo} goes first`;\n\n console.log(texto);\n }", "sortTwitsByText( ) {\n this.twits.sort( (a, b) => {\n \n if (this.switchPosition == \"normal\");\n if (a.text > b.text) {\n return 1;\n }\n if (a.text < b.text) {\n return -1;\n }\n if (this.switchPosition == \"reversed\"){\n if (a.text < b.text) {\n return 1;\n }\n if (a.text > b.text) {\n return -1;\n }\n }\n return 0;\n });\n }", "function sort_li(a, b) {\n an = Date.parse($(a).find('.col2').text());\n bn = Date.parse($(b).find('.col2').text());\n\n return bn < an ? 1 : -1;\n }", "static sortItems()\n {\n //bubble sort\n var length = Explorer.items.length;\n for (var i = 0; i < length; i++) {\n for (var j = 0; j < (length - i - 1); j++) {\n //sort by type, if same type sort by name\n if((Explorer.items[j].type > Explorer.items[j+1].type) ||\n (\n Explorer.items[j].type == Explorer.items[j+1].type &&\n Explorer.items[j].name > Explorer.items[j+1].name\n )\n ) {\n //Swap the numbers\n var tmp = Explorer.items[j]; //Temporary variable to hold the current number\n Explorer.items[j] = Explorer.items[j+1]; //Replace current number with adjacent number\n Explorer.items[j+1] = tmp; //Replace adjacent number with current number\n }\n }\n }\n }", "sort() {\n // Calculate the fitness of all the solutions.\n // We must do this for all because any could have experienced\n // a mutation that could change its fitness score.\n const fitnessSnapshot = this.solutions.map(solution => this.calculateFitness(solution));\n \n this.solutions.sort((a,b) => {\n const indexA = this.solutions.indexOf(a);\n const indexB = this.solutions.indexOf(b);\n const fitA = fitnessSnapshot[indexA];\n const fitB = fitnessSnapshot[indexB];\n \n if (fitA < fitB) { \n return -1;\n } else if (fitA > fitB) {\n return 1;\n } else {\n return 0;\n }\n });\n }", "function sortit(e)\n{\n var exp;\n if (typeof e == \"string\") {\n exp = e.split(\",\");\n last_sort = e;\n } else {\n exp = e.sortedlist.split(\",\");\n last_sort = e.sortedlist;\n }\n\n var sorter = [];\n var order=[];\n for(var i=0;i<exp.length;i++) {\n if (exp[i] === \"0\") continue;\n if (exp[i] === \"1\") {\n sorter.push(i);\n order.push(1);\n }\n else if (exp[i] == \"2\") {\n sorter.push(i);\n order.push(-1);\n }\n }\n\n var data;\n if (filtered_data == null) {\n data = raw_data.slice();\n } else {\n data = filtered_data.slice();\n }\n\n if (sorter.length == 0) {\n var dta = new async_emulator(data);\n views.view('table').data(dta);\n return;\n }\n\n // Do the Sort\n data.sort(function(a,b) {\n for(var i=0;i<sorter.length;i++) {\n var s = sorter[i];\n if ((a[s] == null && b[s] != null) || a[s] < b[s]) {\n if (order[i] > 0) return (-1)\n else return (1);\n } else if ((b[s] == null && a[s] != null) || a[s] > b[s]) {\n if (order[i] > 0) return (1);\n else return (-1);\n }\n }\n return (0);\n });\n\n var dta = new async_emulator(data);\n views.view('table').data(dta);\n}", "sort()\n {\n this.sorted.sort(\n function(a, b)\n {\n let aSize = Math.max(a.height, a.width)\n let bSize = Math.max(b.height, b.width)\n if (aSize === bSize)\n {\n aSize = Math.min(a.height, a.width)\n bSize = Math.max(b.height, b.width)\n }\n return bSize - aSize\n }\n )\n }", "sortFaces() {\n this.faces.sort((a, b) => {\n return (a.boundingPoly.vertices[0].x - b.boundingPoly.vertices[0].x);\n });\n }", "sorted(matches) {\n // sort on i primary, j secondary\n return matches.sort((m1, m2) => (m1.i - m2.i) || (m1.j - m2.j));\n }", "function sort(column_index) {\n var table, rows, switchcount = 0;\n var switching = true, shouldSwitch;\n var asc_sort_direction = true;\n table = document.getElementById('files_list');\n while (switching) {\n switching = false;\n rows = table.getElementsByTagName('tr');\n var curr_row;\n for (curr_row = 1; curr_row < (rows.length - 1); curr_row++) {\n shouldSwitch = false;\n var curr_row_creteria_value = (rows[curr_row].getElementsByTagName('td')[column_index]).innerHTML.toLowerCase();\n var next_row_creteria_value = (rows[curr_row + 1].getElementsByTagName('td')[column_index]).innerHTML.toLowerCase();\n if (asc_sort_direction) {\n if (column_index == 2) {\n if (curr_row_creteria_value.length > next_row_creteria_value.length || \n (curr_row_creteria_value.length == next_row_creteria_value.length && curr_row_creteria_value > next_row_creteria_value)) {\n shouldSwitch = true;\n break;\n }\n }\n else if (curr_row_creteria_value > next_row_creteria_value) {\n shouldSwitch = true;\n break;\n }\n } \n else { // descending order\n if (column_index == 2) {\n if (curr_row_creteria_value.length < next_row_creteria_value.length || \n (curr_row_creteria_value.length == next_row_creteria_value.length && curr_row_creteria_value < next_row_creteria_value)) {\n shouldSwitch = true;\n break;\n }\n }\n else if (curr_row_creteria_value < next_row_creteria_value) {\n shouldSwitch = true;\n break;\n }\n }\n }\n if (shouldSwitch) {\n rows[curr_row].parentNode.insertBefore(rows[curr_row + 1], rows[curr_row]);\n switching = true;\n switchcount ++;\n } \n else {\n if (switchcount == 0 && asc_sort_direction) {\n asc_sort_direction = false;\n switching = true;\n }\n }\n }\n}", "function Sort(a,b){\n\tif (a.ChoosedBy < b.ChoosedBy)\n\t\treturn 1;\n\telse\n\t\treturn -1;\n}", "sortBy() {\n // YOUR CODE HERE\n }", "function sortingAscend() {\n setSearchData(null)\n let sorted = studentData.sort(function(a, b){\n return b.id - a.id;\n })\n\n setStudentData(sorted)\n console.log(sorted, typeof(sorted))\n }", "function sortRichest() {\r\n data.sort((a, b) => b.money - a.money);\r\n updateDOM();\r\n}", "function orderAlphabetically(peliculas) {\n const sortedPeliculas = [...peliculas];\n let tituloPeliculas = sortedPeliculas.map(function(pelicula) {\n return pelicula.title\n })\n tituloPeliculas.sort((a, b) => {\n if (a < b) return -1\n else if (a > b) return 1\n else return 0\n })\n if (tituloPeliculas.length > 20) {\n tituloPeliculas = tituloPeliculas.slice(0, 20)\n }\n return tituloPeliculas\n}", "_resort() {\n // Ensure there's something to do.\n if (!this.orderComponents) return;\n\n // Define the comparator for the sort.\n /**\n * Return a comparison result for the two given models, honouring each\n * comparitor in order of their inclusion in the component list. \n */\n const compareModels = (a, b) => {\n for (let i = 0; i < this.orderComponents.length; i++) {\n // Comprehend this order component.\n const {\n identity: {attribute, type}, value: direction\n } = this.orderComponents[i];\n\n // Use the type comparator to retrieve and integer result of\n // the comparison.\n let value = type.compareValues(a[attribute], b[attribute]);\n // Modify based on order.\n if (direction == 'desc') value *= -1;\n // If this comparator found a difference between the two,\n // return it. Note that if it didn't, the next gets a chance\n // to.\n if (value > 0 || value < 0) return value;\n }\n\n return 0;\n };\n\n // Perform the sort.\n this._value.sort(compareModels);\n }", "function sortTable(num){\r\n var astro = JSON.parse(localStorage.getItem('astro'));\r\n if(num === 0){\r\n for(var i=0; i<astro.length; i++){\r\n var index = i;\r\n var name = astro[i].name.toLowerCase();\r\n for(var j=i+1; j<astro.length; j++){\r\n if(astro[j].name.toLowerCase()<name){\r\n index = j;\r\n name = astro[j].name.toLowerCase();\r\n }\r\n }\r\n var temp = astro[i];\r\n astro[i] = astro[index];\r\n astro[index] = temp;\r\n }\r\n }\r\n else if(num === 1){\r\n for(var i=0; i<astro.length; i++){\r\n var index = i;\r\n var name = astro[i].surname.toLowerCase();\r\n for(var j=i+1; j<astro.length; j++){\r\n if(astro[j].surname.toLowerCase()<name){\r\n index = j;\r\n name = astro[j].surname.toLowerCase();\r\n }\r\n }\r\n var temp = astro[i];\r\n astro[i] = astro[index];\r\n astro[index] = temp;\r\n }\r\n }\r\n\r\n else if(num===2){\r\n for(var i=0; i<astro.length; i++){\r\n var dob = astro[i].dob.split('-');\r\n var index = i;\r\n for(var j=i+1; j<astro.length; j++){\r\n var bod = astro[j].dob.split('-');\r\n if(bod[0]<dob[0]){\r\n index = j;\r\n dob = bod;\r\n } else if(bod[0]==dob[0] && bod[1]<dob[1]){\r\n index = j;\r\n dob = bod;\r\n } else if(bod[0]==dob[0] && bod[1]==dob[1] && bod[2]<dob[2]){\r\n index = j;\r\n dob = bod;\r\n }\r\n }\r\n var temp = astro[i];\r\n astro[i] = astro[index];\r\n astro[index] = temp;\r\n }\r\n }\r\n\r\n else if(num === 3){\r\n for(var i=0; i<astro.length; i++){\r\n var index = i;\r\n var name = astro[i].power.toLowerCase();\r\n for(var j=i+1; j<astro.length; j++){\r\n if(astro[j].power.toLowerCase()<name){\r\n index = j;\r\n name = astro[j].power.toLowerCase();\r\n }\r\n }\r\n var temp = astro[i];\r\n astro[i] = astro[index];\r\n astro[index] = temp;\r\n }\r\n }\r\n console.log(astro);\r\n localStorage.setItem('astro', JSON.stringify(astro));\r\n addAstronaut();\r\n}", "sortTheCard() {\n this.sort = this.cards.sort((currentCard, nextCard) => currentCard.value - nextCard.value);\n }", "function sort_li(a, b) {\n console.log('in');\n an = Date.parse($(a).find('.col1').text());\n bn = Date.parse($(b).find('.col1').text());\n\n return bn < an ? 1 : -1;\n }", "function sortingDscend() { \n setSearchData(null)\n let sorted = studentData.sort(function(a, b){\n return a.id - b.id;\n })\n\n setSearchData(sorted)\n // console.log(sorted, typeof(sorted))\n }", "function sortByHeight() {}", "sortedTasks(state){\n //criar uma variavel para ordernar nossas tarefas sem alterar o estado original(state)\n let sorted = state.tasks\n return sorted.sort((a,b) => {\n //se o a for menor então ele retorna para corrigir a ordenação\n if(a.name.toLowerCase() < b.name.toLowerCase()) return -1\n //mesma inversa se for o inverso da primeira situação\n if(a.name.toLowerCase() > b.name.toLowerCase()) return 1\n\n return 0\n }) \n }", "function sortByProb(recomms){\n sortedMusic = [];\n sortedBooks = [];\n sortedPlaces = [];\n sortedMovies = [];\n sortedShows = [];\n //music\n for(var i=1; i<recomms.music.length; i++){\n for(var j=0; j<recomms.music.length-i; j++){\n if(recomms.music[j].pr < recomms.music[j+1].pr){\n var aux = recomms.music[j];\n recomms.music[j] = recomms.music[j+1];\n recomms.music[j+1] = aux;\n }\n }\n }\n for(var i=0; i<recomms.music.length; i++){\n sortedMusic.push(recomms.music[i].track);\n }\n //books\n for(var i=1; i<recomms.books.length; i++){\n for(var j=0; j<recomms.books.length-i; j++){\n if(recomms.books[j].pr < recomms.books[j+1].pr){\n var aux = recomms.books[j];\n recomms.books[j] = recomms.books[j+1];\n recomms.books[j+1] = aux;\n }\n }\n }\n for(var i=0; i<recomms.books.length; i++){\n sortedBooks.push(recomms.books[i].book);\n }\n //places\n for(var i=1; i<recomms.places.length; i++){\n for(var j=0; j<recomms.places.length-i; j++){\n if(recomms.places[j].pr < recomms.places[j+1].pr){\n var aux = recomms.places[j];\n recomms.places[j] = recomms.places[j+1];\n recomms.places[j+1] = aux;\n }\n }\n }\n for(var i=0; i<recomms.places.length; i++){\n sortedPlaces.push(recomms.places[i].place);\n }\n //movies\n for(var i=1; i<recomms.movies.length; i++){\n for(var j=0; j<recomms.movies.length-i; j++){\n if(recomms.movies[j].pr < recomms.movies[j+1].pr){\n var aux = recomms.movies[j];\n recomms.movies[j] = recomms.movies[j+1];\n recomms.movies[j+1] = aux;\n }\n }\n }\n for(var i=0; i<recomms.movies.length; i++){\n sortedMovies.push(recomms.movies[i].movie);\n }\n //shows\n for(var i=1; i<recomms.shows.length; i++){\n for(var j=0; j<recomms.shows.length-i; j++){\n if(recomms.shows[j].pr < recomms.shows[j+1].pr){\n var aux = recomms.shows[j];\n recomms.shows[j] = recomms.shows[j+1];\n recomms.shows[j+1] = aux;\n }\n }\n }\n for(var i=0; i<recomms.shows.length; i++){\n sortedShows.push(recomms.shows[i].show);\n }\n\n var rec = {\n music: sortedMusic,\n books: sortedBooks,\n movies: sortedMovies,\n shows: sortedShows,\n places: sortedPlaces\n }\n return rec;\n}", "function sortData(){\r\n const {header, direction} = sortMethode\r\n if (header === 'first_name' || header === 'sur_name'){\r\n Data.sort((a, b) => { \r\n const NameA = a[header].toUpperCase()\r\n const NameB = b[header].toUpperCase()\r\n if (NameA < NameB) {\r\n return -1 * direction\r\n }\r\n if (NameA > NameB) {\r\n return 1 * direction\r\n }\r\n return 0\r\n })\r\n } else {\r\n Data.sort((a,b) => {\r\n return (a[header] - b[header]) * direction\r\n })\r\n } \r\n return Data\r\n}", "function sortList(a,b) {\n if (a.total < b.total)\n return -1;\n if (a.total > b.total)\n return 1;\n return 0;\n }", "function sortList(a,b) {\n if (a.total < b.total)\n return -1;\n if (a.total > b.total)\n return 1;\n return 0;\n }", "function toogleSort(){\r\n\t\tif(settings.sort_type=='desc'){\r\n\t\t\tsettings.sort_type='asc';\r\n\t\t }else{\r\n\t\t\t settings.sort_type='desc';\r\n\t\t }\r\n\t}", "sortProducts() {}", "function sortRows(){\n sortRowsAlphabeticallyUpwards();\n}" ]
[ "0.75513285", "0.7389637", "0.7382015", "0.72622705", "0.7226599", "0.7138333", "0.71343917", "0.703388", "0.6953784", "0.69508684", "0.68845403", "0.68337154", "0.677369", "0.6678424", "0.66772634", "0.66655105", "0.65253365", "0.65228224", "0.6495499", "0.6495499", "0.6481075", "0.64694273", "0.64620733", "0.6453877", "0.6453877", "0.64395624", "0.6425819", "0.6413909", "0.6383245", "0.63502085", "0.6344881", "0.63337314", "0.6310305", "0.6287354", "0.6261658", "0.6260975", "0.62243694", "0.6222351", "0.62185204", "0.6214864", "0.6211203", "0.6209895", "0.62081134", "0.62081134", "0.6198077", "0.6180328", "0.61765015", "0.6174935", "0.6170418", "0.6165991", "0.6161277", "0.6155373", "0.6155373", "0.61390567", "0.612306", "0.61112154", "0.61107165", "0.60992616", "0.60981476", "0.6095803", "0.60935104", "0.60913676", "0.6068827", "0.6064595", "0.60630894", "0.6061371", "0.6053557", "0.6049304", "0.6040074", "0.60346687", "0.6023714", "0.6019113", "0.6013677", "0.6011826", "0.6007301", "0.6004525", "0.5999742", "0.5996239", "0.5977689", "0.59708166", "0.59621435", "0.5959902", "0.59566927", "0.5949269", "0.5947148", "0.5947138", "0.59453213", "0.5942564", "0.5939126", "0.59388727", "0.59283066", "0.5926541", "0.5923523", "0.59182316", "0.5914958", "0.5914936", "0.5914936", "0.59103173", "0.59068286", "0.5906382" ]
0.6938738
10
Ubija sve vrste koje nisu napredovale 15 generacija
killStaleSpecies() { const species = []; for (let i = 2; i < this.species.length; i++) { if (this.species[i].staleness < 15) { species.push(this.species[i]); } } this.species = species; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateNumCommande() {\n var random = Math.floor(100000000 + Math.random() * 900000000);\n num_commande = 'NH'+random\n }", "generarSecuencia(){\n this.secuencia = new Array(10).fill(0).map(m => Math.floor(Math.random() * 4))\n }", "popuniIzvjestaj() {\n this.vrijednost = Util.getRandomFloatIn(2, 10);\n this.vrijemeObroka = Util.randomDate(new Date(2012, 0, 1), new Date());\n }", "async genSize(){\n var temp = misc.randomnum(1,100);\n if(temp <= 20)\n return 3;\n if(temp <= 70)\n return 2;\n if(temp <= 100)\n return 1;\n //else\n var temp2 = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate()+' '+today.getHours() + \":\" + today.getMinutes() + \":\" + today.getSeconds();\n fs.write('../0PlanetOIDGenerated.json', temp2, (err) => {if(err) throw err});\n return 0;\n }", "generaSecuencia() {\n this.secuencia = new Array(this.Ultimo_nivel)\n .fill(0)\n .map((n) => Math.floor(Math.random() * 4));\n }", "function CreateLottoValues() {\r\n return Math.floor(Math.random() * 90 + 1);\r\n }", "popuniIzvjestaj() {\n this.donja = Util.getRandomIntIn(50, 100);\n this.gornja = Util.getRandomIntIn(70, 140);\n this.puls = Util.getRandomIntIn(50, 160);\n }", "chargement_initial(n) {\n for (let k = 0; k < 10; k++) this.tabLien[k] = k;\n this.tabLien.shuffle();\n this.tete = this.tabLien.splice(Math.floor(Math.random() * this.tabLien.length), 1);\n let t = this.tete;\n let i = t;//indice du bloc\n let a = 1;//numéro de l'enregistrement courant\n let cle = 3;\n let j = 0;\n let bloc = new bloc_LOVC();\n let res;\n while (a <= n) {\n res = bloc.insert_enreg(cle, j);\n j = res.dernier_car;\n if ((res.plein == true)&&((j > 0) || (a != n))) {\n let s = this.tabLien.splice(Math.floor(Math.random() * this.tabLien.length), 1);\n bloc.suivant = s;\n this.tab_blocs[i] = bloc;\n this.nb_blocs++;\n i = s;\n bloc = new bloc_LOVC();\n if (res.c == true) {\n bloc.tab[0] = cle;\n bloc.tab[1] = false;\n }\n if (res.bool == true)\n bloc.tab[0] = false;\n }\n cle = cle + 3;\n a++;\n }\n this.nb_blocs++;\n if(j == 0) j = bloc.max;\n this.b = j;\n bloc.suivant = -1;\n this.tab_blocs[i] = bloc;\n this.nbr_carac_init = bloc_LOVC.max * (this.tab_blocs.length - 1) + j;\n }", "function generarAleatorio(valor)\r\n{\r\n return numIdentificacion = Math.floor(Math.random() * ((valor+1) - 0) + 0); \r\n}", "function getIdPublicacion(){\n\treturn Math.round(Math.random() * 20) + 1;\n}", "function wykonaj_ruch_SI()\n{\n let ruchy = generuj_ruchy(), ruch_t;\n\n // sprawdzanie czy jest mat/pat\n if(ruchy.ruchy.length + ruchy.zbicia.length === 0)\n {\n if(czy_szach(szachownica.biale_ruch))\n {\n // mat, SI przegralo\n napisz_wynik(szachownica.biale_ruch ? 2 : 1);\n }\n else\n {\n // pat, remis\n napisz_wynik(3);\n }\n\n zablokowane = true;\n\n return;\n }\n\n // sprawdzanie pozostalych remisow\n if(szachownica.liczba_polowek_od_r > 100 || poprzednie_pozycje[szachownica.hash] >= 3 || !czy_wystarczajacy_material())\n {\n napisz_wynik(3);\n\n szachownica.biale_ruch = !szachownica.biale_ruch;\n zablokowane = true;\n\n return;\n }\n\n tablica_transp = new Map();\n\n let nr = Math.floor(Math.random() * (ruchy.ruchy.length + ruchy.zbicia.length));\n\n if(nr < ruchy.ruchy.length)\n ruch_t = ruchy.ruchy[nr];\n else\n ruch_t = ruchy.zbicia[nr - ruchy.ruchy.length];\n\n wykonaj_ruch(ruch_t);\n if(szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k] === 6 && ruch_t.wiersz_k === 7)\n {\n // promocja biale\n promuj_piona(ruch_t.wiersz_k, ruch_t.kolumna_k, Math.floor(Math.random() * 4) + 2);\n }\n else if(szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k] === 12 && ruch_t.wiersz_k === 0)\n {\n // promocja czarne\n promuj_piona(ruch_t.wiersz_k, ruch_t.kolumna_k, Math.floor(Math.random() * 4) + 8);\n }\n\n narysuj();\n}", "static genereazaVariabilaNormala01() {\n\t\t\t// Lista pentru numere aleatoare U1...U12\n\t\t\tlet U = [];\n\n\t\t\t// Se genereaza cu RNG 12 numere aleatoare U1...U12\n\t\t\t// uniforme si independente pe (0, 1)\n\t\t\tfor(let i = 0; i < 12; i++) {\n\t\t\t\t// Atasam numerele in lista\n\t\t\t\tU.push(Math.random());\n\t\t\t}\n\n\t\t\t// Iesire Z = U1+...+U12 - 6 \n\t\t\treturn (U.reduce((a, b) => a + b, 0) - 6);\n\t\t}", "secuencia() {\n this.secuencia = new Array(ULTIMO_NIVEL).fill(0).map(n => Math.floor(Math.random() * 4))\n // console.log(this.secuencia)\n }", "function generarPoblacionInicial(){\n\tarrayAux = new Array(GENES);\n\tfor(i=0;i<POBLACION;i++) {\n\n\t\t//aux con los numeros del 0 al 22\n\t\tfor(j=0;j<GENES;j++) {\n\t\t\tarrayAux[j] = j;\n\t\t}\n\n\t\t//rellenar cromosomas con el aux en orden aleatorio\n\t\tfor(j=0;j<GENES;j++) {\n\t\t\tcromosoma[i][j] = parseInt((arrayAux.splice(Math.floor(Math.random() * arrayAux.length), 1)).join(\"\"));\n\t\t}\n\t}\n}", "function achatItem3Lvl1() {\n affichagePrixItem3Lvl1.innerHTML = \"OBTENU\";\n boutonItem3Lvl1.disabled = true;\n boutonItem3Lvl1.style.border = \"inherit\";\n clickRessource3 = 2;\n ressource1.innerHTML = ressource1.innerHTML - prixItem3Lvl1;\n activationItemsShop();\n compteurRessourcePlateau1 = parseInt(ressource1.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem3lvl1Vide\").src= \"assets/img/pioche1Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils1(); \n }", "function Random(){\n var nb = Math.floor(Math.random()*52)+1;\n if (nb<10){\n var nb = \"0\"+ nb; // Ajout d'un 0 pour s'adapter a l'appelation des fichiers\n }\n return nb;\n}", "function gener(){\r\n posX = length*Math.floor(8*Math.random());\r\n}", "function generaStelle (voto){\r\n\r\n var stelleTot = \" \";\r\n\r\n for (var i = 0; i < voto; i++){\r\n\r\n stelleTot += '<i id=\"gold\" class=\"fas fa-star\"></i>';\r\n }\r\n for (var i = 0 ; i < 5 - voto ; i++ ) {\r\n stelleTot += '<i id=\"yellow\" class=\"far fa-star\"></i>';\r\n }\r\n return stelleTot;\r\n}", "function generator() {\n\n // Dichiaro tutte le variabili\n var chilometri = document.getElementById(\"form_chilometri\").value;\n var eta = document.getElementById(\"form_eta\").value;\n var prezzo = 0.21 * chilometri;\n var prezzoFinale;\n\n // Controllo dei parametri inseriti; in caso negativo reset dei campi\n if(verificaValori(chilometri) == false || verificaValori(eta) == false ){\n alert(\"Non ha inserito correttamente i valori, riprovi\");\n document.getElementById(\"form_chilometri\").value = null;\n document.getElementById(\"form_eta\").value = null;\n document.getElementById(\"form_sconto\").innerHTML = \"\";\n document.getElementById(\"form_prezzo\").innerHTML = \"\";\n } else if (eta < 18 ) {\n prezzoFinale = prezzo - ((prezzo * 20)/100);\n document.getElementById(\"form_sconto\").innerHTML = \"20% perché minorenne\";\n } else if (eta > 65) {\n prezzoFinale = prezzo - ((prezzo * 40)/100);\n document.getElementById(\"form_sconto\").innerHTML = \"40% perché over 65\";\n } else if (eta >= 18 && eta <= 65) {\n prezzoFinale = prezzo;\n document.getElementById(\"form_sconto\").innerHTML = \"0%\";\n }\n\n document.getElementById(\"form_prezzo\").innerHTML = prezzoFinale.toFixed(2)+\" €\";\n \n}", "function genera_parametros(){\r\n\tx_0=103;\r\n\tm=1001;\r\n\tprimos.forEach(a=>{\r\n\t\tprimos.forEach(c=>{\r\n\t\t\tnum_ale = generador_mixto(a,c,x_0,m)\r\n\t\t\tif(num_ale.length == m){ //tambien deberia revisar si hay numeros repetidos\r\n\t\t\t\timprimir_configuracion_parametros_a_pantalla\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n}", "function cargarSegundo(){\r\n let txtSegundos;\r\n\r\n if(segundos < 0){\r\n segundos = 59; \r\n }\r\n\r\n //Mostrar Segundos en pantalla\r\n if(segundos < 10){\r\n txtSegundos = `0${segundos}`;\r\n }else{\r\n txtSegundos = segundos;\r\n }\r\n document.getElementById('segundos').innerHTML = txtSegundos;\r\n segundos--;\r\n\r\n cargarMinutos(segundos);\r\n}", "constructor() { //fungsi math.floor adlah membulatkan angka ke bawah ke angka integer terdekat dan mengebalikan hasilnya\n this.numberofCars = [Math.floor(Math.random() * 4)];// fungsi angka 4 adalah jumlah mobil yang di tulisakan dalam parameter\n }", "function karteGenerieren() {\r\n /* Eine beliebige Zahl wird mit der Länge multipliziert und die Karte nehmen wir*/\r\n let random = Math.floor(Math.random() * alle32Karten.length);\r\n console.log('random Number: ' + random);\r\n let karte = alle32Karten[random];\r\n alle32Karten.splice(random, 1);\r\n return karte;\r\n}", "function generarAleatorio(){\r\n let aleatorio = Math.floor(Math.random()*(10-5)+5);\r\n alert(aleatorio);\r\n}", "function galerijRechts(){\r\n\tlengthExtensie = getImgPad(\"plaatjeFrame\");\r\n\tif (Number(lengthExtensie[3]) < totaalPlaatjes){\r\n\t\tplaatjeNummer = Number(lengthExtensie[3]) + 1;\r\n\t}\r\n\telse{\r\n\t\tplaatjeNummer = 1;\r\n\t}\r\n\tsetPlaatjeNaam(lengthExtensie, plaatjeNummer, \"plaatjeFrame\");\r\n\treturn\r\n}", "nextGeneration() {\n let nextGeneration = [];\n this.generationCounter++;\n\n const survivors = Math.round(this.options.phenotypePerGeneration * this.options.repartition[0]);\n const childrens = Math.round(this.options.phenotypePerGeneration * this.options.repartition[1]);\n const randoms = Math.round(this.options.phenotypePerGeneration * this.options.repartition[2]);\n\n for (let i = 0; i < survivors; i++) {\n nextGeneration = [...nextGeneration, this.generation[this.options.phenotypePerGeneration - 1 - i]]\n }\n\n for (let i = survivors; i < survivors + childrens; i++) {\n nextGeneration = [...nextGeneration, this.makeChildren()]\n }\n for (let i = survivors + childrens; i < this.options.phenotypePerGeneration; i++) {\n let phenotype = new Phenotype(this.modelData, this.options.genotypePerPhenotype, this.genomOptions);\n phenotype.random();\n nextGeneration = [...nextGeneration, phenotype]\n }\n\n this.generation = nextGeneration;\n \n for (let i = survivors; i < this.options.phenotypePerGeneration; i++) {\n this.generation[i].similarityRatio = imgUtils.similarityBtwImageData(this.minifyModelData, this.generation[i].generate())\n }\n\n this.generation.sort((a, b) =>\n (a.similarityRatio - b.similarityRatio)) // Baddest to Best\n \n this.drawExample()\n\n let total = 0;\n for (let i = 0; i < this.options.phenotypePerGeneration; i++) {\n total += this.generation[i].similarityRatio\n }\n /** \n console.log(\"Generation n°\" + this.generationCounter \n + \" Best : \" + this.generation[this.options.phenotypePerGeneration - 1].similarityRatio \n + \", total : \" + total/this.options.phenotypePerGeneration);\n */\n }", "function agregarTri() {\n for (var i = 0; i < 3; i++) {\n var userName = makeid(5);\n var levelUser = parseInt(Math.floor(Math.random() * 401));\n var resetsUser = parseInt(Math.floor(Math.random() * 1000));\n var viplevelUser = parseInt(Math.floor(Math.random() * 9));\n\n var usuario = {\n \"userName\": userName,\n \"levelUser\": levelUser,\n \"resetsUser\": resetsUser,\n \"viplevelUser\": viplevelUser,\n };\n agregar(usuario);\n }\n }", "function generarGrilla(){\n for (let i = 0; i < 1750; i++) {\n let $div = $(\"<div></div>\");\n $grillaPixeles.append($div);\n }\n}", "function siguienteGeneracion() {\n if ((fitness.some(val => val > (1 / tamañoPoblacion * 1.4))) || (numPoblacionesIteradas > limiteIteraciones)) { //funcion de parado, cuando se hayan excedido el numero de iteraciones limite, o cuando se cumpla con la funcion de parado que es \n //cuando el fitness de un elemento de la poblacion es 40% mayor que el promedio que deberia tener\n hayQueParar = true;\n } else {\n poblacion = poblacion.map(val => {//actualizar la poblacion\n var ordenA = escogerUno(poblacion, fitness);\n var ordenB = escogerUno(poblacion, fitness); //obtener 2 muestras de la poblacion\n var orden = crossOver(ordenA, ordenB); //crossover entre las 2 muestras \n mutar(orden, 0.01); //mutacion aleatoria\n return orden;\n });\n }\n}", "generarMapa(){\n this.counterId = 1;\n this.salaActual = new Sala(true,NaN, NaN, \"0.txt\", 0 ,this.counterId);\n this.counterId++;\n var listaNodosAActualizar = [this.salaActual];\n this.inicio = this.salaActual;\n while (listaNodosAActualizar.length > 0)\n {\n var proximaProfundida = [];\n listaNodosAActualizar.forEach(sala => {\n\n var derecha = false, izquierda = false ,arriba = false ,abajo = false;\n //Genara la sala de la izuierda, que no necesariamente se va a utilizar\n if(sala.izquierda == null)\n {\n sala.izquierda = this.generarSala(posicionSala.izquierda, sala);\n izquierda = true;\n }\n\n //Genara la sala de la derecha\n if(sala.derecha == null) {\n sala.derecha = this.generarSala(posicionSala.derecha, sala);\n derecha = true;\n }\n //Genera la sala de arriba\n if(sala.arriba == null) {\n sala.arriba = this.generarSala(posicionSala.arriba, sala);\n arriba = true;\n }\n //genera la sala de abajo\n if(sala.abajo == null) {\n sala.abajo = this.generarSala(posicionSala.abajo, sala);\n abajo = true;\n }\n //Los mete en la proxima generacion\n if(izquierda) proximaProfundida.push(sala.izquierda);\n if(derecha) proximaProfundida.push(sala.derecha);\n if(arriba) proximaProfundida.push(sala.arriba);\n if(abajo) proximaProfundida.push(sala.abajo);\n\n\n\n\n });\n proximaProfundida = proximaProfundida.filter(x=> x.depth <= 3 );\n proximaProfundida = proximaProfundida.filter(x => x != this.inicio);\n listaNodosAActualizar = proximaProfundida;\n\n }\n }", "agregarNuevo(){\n let esta = false;\n let cont = 0;\n \n while(!esta){\n cont++;\n const fil = Math.floor(Math.random() * this.size);\n const col = Math.floor(Math.random() * this.size);\n\n if(this.getCelda(fil,col)==null){\n esta = true;\n const val = Math.floor(Math.random() * 6)+1;\n if(val>=0 && val<5)\n this.setCeldaEfecto(2,fil,col); // 3 chances de 4 de que toque 2\n else\n this.setCeldaEfecto(4,fil,col); // 3 chances de 4 de que toque 4\n }\n\n //conta\n if(cont==1000) esta = true;\n\n }\n\n }", "function boucleJeu() {\n\n var nouvelInterval = Date.now();\n\n\n\n //SI au premier instant du jeu on initialise le debut de l'interval a quelque chose\n if (!debutInterval) {\n debutInterval = Date.now();\n }\n\n gestionnaireObjets.repositionnerObjets(Bouteille, nouvelInterval);\n gestionnaireObjets.repositionnerObjets(Obstacle, nouvelInterval);\n gestionnaireObjets.repositionnerObjets(Voiture, nouvelInterval);\n\n\n //Si le nouveau temps est plus grand que l'accelaration souhaiter par rapport au début de l'interval\n if (nouvelInterval - debutInterval >= 20) {\n vitesseRoute += 0.005;\n\n debutInterval = nouvelInterval;\n }\n\n //Appliquer les déplacements\n gestionnaireObjets.deplacerLesObjets(vitesseRoute);\n }", "function generaRandom(){\n return Math.floor(Math.random() * 5 + 1);\n}", "function randomArmaduraEscudo(itera_bucle, rareza) {\n var item = \"\";\n var material = \"\";\n var mejora = 0;\n var cont_aptitudes = 0;\n\n var tirada = tiraDados(1,100);\n\n switch (rareza) {\n case 1:\n if (tirada <= 60) {\n itera_bucle = 0;\n\n item = \"Escudo\";\n mejora = 1;\n material = getMaterial(0);\n\n console.log(\"- Escudo +1\");\n } else if (tirada <= 80) {\n itera_bucle = 0;\n\n item = \"Armadura\";\n mejora = 1;\n\n console.log(\"- Armadura +1\");\n } else if (tirada <= 85) {\n itera_bucle = 0;\n\n item = \"Escudo\";\n mejora = 2;\n\n console.log(\"- Escudo +2\");\n } else if (tirada <= 87) {\n itera_bucle = 0;\n\n item = \"Armadura\";\n mejora = 2;\n\n console.log(\"- Armadura +2\");\n } else if (tirada <= 89) {\n itera_bucle = 1;\n\n // TODO: Armadura específica\n console.log(\"- Armadura esp.\");\n } else if (tirada <= 91) {\n itera_bucle = 1;\n\n // TODO: Escudo específico\n console.log(\"- Escudo esp.\");\n } else {\n cont_aptitudes++;\n\n randomArmaduraEscudo(1, rareza);\n }\n\n break;\n case 2:\n break;\n case 3:\n break;\n default:\n\n }\n\n // TODO: Materiales especiales\n\n if (itera_bucle == 0) {\n if (mejora > 0) {\n document.getElementById(\"objetos\").innerHTML = document.getElementById(\"objetos\").innerHTML + \" <br> \" + item + material + \" +\" + mejora + \" \";\n }\n }\n\n if (item == \"Armadura\") {\n for (var i = 0; i < cont_aptitudes; i++) {\n document.getElementById(\"objetos\").innerHTML = document.getElementById(\"objetos\").innerHTML + aptitudArmadura(rareza);\n }\n } else if (item == \"Escudo\") {\n for (var i = 0; i < cont_aptitudes; i++) {\n document.getElementById(\"objetos\").innerHTML = document.getElementById(\"objetos\").innerHTML + aptitudEscudo(rareza);\n }\n }\n\n document.getElementById(\"objetos\").innerHTML = document.getElementById(\"objetos\").innerHTML + \", \";\n}", "function genereerBosjes() {\n\tlet genereerBosjesData = [];\n\tlet bosjeX = 0;\n\tlet bosjeAfbeelding;\n\twhile (bosjeX < (2 * CANVAS_BREEDTE)) {\n\t\tif (Math.random() >= 0.5) {\n\t\t\tbosjeAfbeelding = bosje_1_Afbeelding;\n\t\t} else {\n\t\t\tbosjeAfbeelding = bosje_2_Afbeelding;\n\t\t}\n\t\tgenereerBosjesData.push({\n\t\t\tx: bosjeX,\n\t\t\ty: 80 + (Math.random() * 20),\n\t\t\timage: bosjeAfbeelding\n\t\t});\n\t\tbosjeX += 150 + (Math.random() * 200);\n\t}\n\treturn genereerBosjesData;\n}", "function LanciaDadi() {\n var numeroUtente = Math.floor(Math.random() * 6);\n console.log(\"Il tuo numero \" + numeroUtente);\n document.getElementById('punteggio-utente').innerHTML = numeroUtente;\n\n var numeroCpu = Math.floor(Math.random() * 6);\n console.log(\"Il numero della CPU \" + numeroCpu);\n document.getElementById('punteggio-cpu').innerHTML = numeroCpu;\n\n// 2- stabilire che vince (ovvero punteggio più alto) e stampare il risultato\n\n if (numeroUtente > numeroCpu) {\n document.getElementById('esito').innerHTML = \"Hai vinto maledetto fortunello!!\";\n } else {\n document.getElementById('esito').innerHTML = \"Hai perso torna a rubare le autoradio!!\";\n }\n\n}", "function crearIntegrantes(cantidadIntegrantes) {\n\n if (cantidadIntegrantes > 0) {\n mostrarBotonCalculo();\n mostrarIntegrantes(); //cambia el display\n ocultarTextoResultado();\n } else {\n //resetear(); \n }\n\n for( let i = 0; i < cantidadIntegrantes; i++){\n crearCasilleroIntegrantes(i)\n }\n}", "function azarDulce(){\n var NroDulce = Math.floor(Math.random()*MAXIMO_IMAGENES);\n return tipoDulce[NroDulce];\n}", "function inicio() {\r\n generaPalabra();\r\n pintarGuiones(palabra.length);\r\n generaABC(\"a\",\"z\");\r\n cont = 6;\r\n document.getElementById(\"intentos\").innerHTML=cont;\r\n}", "function crystall() {\n return Math.floor(Math.random() * 20 + 5)\n }", "function generarClave() {\n var i = 0;\n var clave = '';\n while (i < 10) {\n clave += caracter[(Math.round(Math.random() * 35))];\n i++;\n }\n return clave;\n}", "function trasformaVoto(numero){\n numero = Math.ceil(numero/2);\n var stelle = '';\n for (var i = 0; i < numero; i++) {\n stelle += \"<i class=\\\"fas fa-star\\\"></i>\";\n }\n for (var i = 0; i < 5-numero; i++) {\n stelle += \"<i class=\\\"far fa-star\\\"></i>\";\n }\n return stelle;\n }", "function generate() {\n\treturn (Math.random() * 1e18).toString(32).slice(0, 11);\n}", "function duplicarTreinta(){\n return 30*2;\n}", "function cw_generationZero() {\n cw_materializeGeneration();\n\n}", "function random() {\n if (nLanzamientos < 6){\n do {\n var r = Math.floor((Math.random() * 6) + 1);\n var randomRepetido = comprobacionRandom(r);\n\n } while(randomRepetido == true);\n\n nLanzamientos++;\n preguntadas.push(r);\n asignacionPreguntas(r);\n\n } else{\n document.getElementById('btn1').disabled = true;\n }\n}", "function achatItem1Lvl3() {\n affichagePrixItem1Lvl3.innerHTML = \"OBTENU\";\n boutonItem1Lvl3.disabled = true;\n boutonItem1Lvl3.style.border = \"inherit\";\n clickRessource1 = 6;\n ressource2.innerHTML = ressource2.innerHTML - prix1Item1Lvl3;\n ressource3.innerHTML = ressource3.innerHTML - prix2Item1Lvl3;\n activationItemsShop();\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau3 = parseInt(ressource3.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem1lvl3Vide\").src= \"assets/img/lance3Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils3();\n }", "function achatItem3Lvl3() {\n affichagePrixItem3Lvl3.innerHTML = \"OBTENU\";\n boutonItem3Lvl3.disabled = true;\n boutonItem3Lvl3.style.border = \"inherit\";\n clickRessource3 = 6;\n ressource2.innerHTML = ressource2.innerHTML - prix1Item3Lvl3;\n ressource3.innerHTML = ressource3.innerHTML - prix2Item3Lvl3;\n activationItemsShop();\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau3 = parseInt(ressource3.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem3lvl3Vide\").src= \"assets/img/pioche3Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils3();\n }", "function respuestaAlAzar() {\n let respuesta = '';\n for (let i = 1; i <= 8; i++) {\n ponerBoton(i, (Math.random() > 0.5 ? \"cruz\" : \"circulo\"));\n\n\n }\n}", "function cargarMiniaturas()\n{\n obtenerNoticiasPorCategoria(\"Miniaturas\", 5);\n}", "function generateCodeAuto() {\n\n var total = 0;\n angular.forEach($scope.activity.activityRounds, function (user) {\n var qty = parseInt(user.qty);\n if (qty) {\n total += qty;\n }\n });\n\n $scope.activity.serialLength = 7;\n $scope.activity.serialQty = total;\n if ($scope.activity.rewardCodeType != \"PREFIX\") {\n $scope.activity.prefixCodeStart = null;\n }\n\n }", "function player_generate() {\n\n var player_code = \"\"; //il var lo devo lasciare fuori dal DO xke dopo non mi lo riconosce gli oggetti sotto......\n do {\n player_code = \"\";\n // Genero le 3 lettere e le concateno\n for (var i = 0; i < 3; i++) {\n var char_position = number_generator(0,25); // nell array characters si parte da 0....\n var char = characters.charAt(char_position);\n player_code += char;\n }\n // Genero le 3 cifre e le concateno\n for (var i = 0; i < 3; i++) {\n player_code += number_generator(0,9);\n }\n } while (player_codes.includes(player_code));\n\n player_codes.push(player_code);\n // Genero numero di punti\n var punti = number_generator(0,40);\n // Genero numero di rimbalzi\n var rimbalzi = number_generator(0,300);\n // Genero Falli\n var falli = number_generator(0,5); //5 falli e il massimo di falli permessi se no sei espulso !!!!\n // Genero percentuali per i tiri 2 punti\n var percentuali_2 = (number_generator(0,1000) / 10).toFixed(1);\n // Genero percentuali per i tiri da 3 punti\n var percentuali_3 = (100 - percentuali_2).toFixed(1);\n // Genero il giocatore (OGGETTO)\n var player = {\n 'Codice Player': player_code,\n 'Punti': punti,\n 'Rimbalzi': rimbalzi,\n 'Falli': falli,\n 'Percentuali 2 punti': percentuali_2,\n 'Percentuale 3 punti': percentuali_3,\n }\n return player;\n}", "function nonceGen(size) {\r\n return ng(size-25).concat(nt());\r\n}", "function goukei_4_10() {\n var total_c1 = 0;\n var total_c2 = 0;\n var total_c3 = 0;\n var total_c4 = 0;\n if (vm.property.men4_10_5 && vm.property.men4_10_5.length > 0) {\n vm.property.men4_10_5.forEach(function (item) {\n total_c1 += item.c1;\n total_c2 += item.c2;\n total_c3 += item.c3;\n var c4 = item.c2 + item.c3;\n item.c4 = c4;\n total_c4 += c4;\n });\n }\n\n vm.property.men4_10_1 = total_c1;\n vm.property.men4_10_2 = total_c2;\n vm.property.men4_10_3 = total_c3;\n vm.property.men4_10_4 = total_c4;\n }", "function createUfo() {\r\n let timeToNextUfo;\r\n timeToNextUfo = Math.random() * (25000 - 13000) + 13000; // Math.random() * (max - min) + min \r\n window.setTimeout(createUfo, timeToNextUfo);\r\n let ufo = new SpaceInvader.Ufo();\r\n SpaceInvader.ufos.push(ufo);\r\n } //close createUfo", "function viagem(limiteTanque, valorGasolina, kmPercorrido, destino){\n\n document.write(\"fizemos uma viagem para \" + destino +'<br>')\n document.write(\"A viagem foi de \" + kmPercorrido + 'km <br>')\n\n //Quantos km faz o tanque\n var kmTotalTanque = limiteTanque * 2\n document.write('O tanque do carro faz ' + kmTotalTanque + 'km <br>')\n\n console.log(kmTotalTanque)\n //Quantas vezes abastecer\n var qtsVzsAbastecer = Math.ceil(kmPercorrido / kmTotalTanque)\n document.write('Precisamos abastecer ' + qtsVzsAbastecer +'vez(es) <br>')\n console.log(qtsVzsAbastecer)\n //Quantos litros abastecer\n var qtsLitrosAbastecer = (kmPercorrido / 2) - limiteTanque\n document.write('Precisamos abastecer ' + qtsLitrosAbastecer +'litros <br>')\n console.log(qtsLitrosAbastecer)\n //valor gasto com a gasolina\n var gastoGasolina = qtsLitrosAbastecer * valorGasolina\n document.write('Gastamos R$' + gastoGasolina + ' com gasolina <br>')\n console.log(gastoGasolina)\n //quanto tempo durou a viagem\n var tempoViagem = Math.ceil(kmPercorrido / 60)\n document.write(\"A viagem demorou aproximadamente \" + tempoViagem + ' horas')\n console.log(tempoViagem)\n}", "function achatItem3Lvl2() {\n affichagePrixItem3Lvl2.innerHTML = \"OBTENU\";\n boutonItem3Lvl2.disabled = true;\n boutonItem3Lvl2.style.border = \"inherit\";\n clickRessource3 = 4;\n ressource1.innerHTML = ressource1.innerHTML - prix1Item3Lvl2;\n ressource2.innerHTML = ressource2.innerHTML - prix2Item3Lvl2;\n activationItemsShop();\n compteurRessourcePlateau1 = parseInt(ressource1.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem3lvl2Vide\").src= \"assets/img/pioche2Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils2();\n }", "function cruzamiento(poblacion,seleccion,ciudades,elite)\n\t\t\t{\n\t\t\t\tvar numPobla = poblacion.length;\n\t\t\t\tvar indice1,indice2;\n\t\t\t\tvar k = 0;\n\t\t\t\tvar new_poblation = new Array();\n\t\t\t\t/*Genero nueva poblacion*/\n\t\t\t\twhile(k < parseInt(numPobla / 2))\n\t\t\t\t{\n\t\t\t\t\t//Escogo el metodo de seleccion para tener dos PADRES\n\t\t\t\t\tswitch(seleccion)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Torneo\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tdo{\n\t\t\t\t\t\t\t\tindice1 = torneo(poblacion,elite);\n\t\t\t\t\t\t\t\tindice2 = torneo(poblacion,elite);\n\t\t\t\t\t\t\t}while(indice1 == indice2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//Ranking\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//Aleatorio\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tdo{\n\t\t\t\t\t\t\t\tindice1 = parseInt( Math.random() * numPobla*elite);\n\t\t\t\t\t\t\t\tindice2 = parseInt( Math.random() * numPobla*elite);\n\t\t\t\t\t\t\t}while(indice1 == indice2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t//console.log(indice1);\n\t\t\t\t\t//console.log(indice2);\n\t\t\t\t\t/*Padres*/\n\t\t\t\t\tvar dad = poblacion[indice1].recorrido; \n\t\t\t\t\tvar mom = poblacion[indice2].recorrido;\n\t\t\t\t\t/*Camino para Hijos*/\n\t\t\t\t\tvar camino1 = new Array();\n\t\t\t\t\tvar camino2 = new Array();\n\t\t\t\t\t/*Numero entre 0 y numero de ciudades menos 1*/\n\t\t\t\t\tbp = parseInt( Math.random() * ciudades ); /*Punto de roptura*/\n\n\t\t\t\t/*-----------Genero 2 nuevos caminos-----------*/\n\t\t\t\t\t//Respaldo caminos de papa y mama hasta bp\n\t\t\t\t\tfor(var i = 0; i < bp; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcamino1.push(dad[i]);\n\t\t\t\t\t\tcamino2.push(mom[i]);\n\t\t\t\t\t}\n\t\t\t\t\tfor(var i = 0; i < ciudades; i++)\n\t\t\t\t\t{\t\n\t\t\t\t\t\t//Tomo el elemento a buscar en el segundo vector\n\t\t\t\t\t\tvar busca1 = mom[i];\n\t\t\t\t\t\tvar busca2 = dad[i];\n\t\t\t\t\t\tfor(var j = bp; j < ciudades; j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(busca1 == dad[j])\n\t\t\t\t\t\t\t\tcamino1.push(busca1);\n\t\t\t\t\t\t\tif(busca2 == mom[j])\n\t\t\t\t\t\t\t\tcamino2.push(busca2); \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t/*Hijos generados*/\n\t\t\t\t\tvar hijo1 = {recorrido: camino1, distancia: aptitud(camino1,region)}\n\t\t\t\t\tvar hijo2 = {recorrido: camino2,distancia : aptitud(camino2,region)}\n\n\t\t\t\t\tnew_poblation.push(hijo1);\n\t\t\t\t\tnew_poblation.push(hijo2);\n\t\t\t\t\tk++;\n\t\t\t\t}\n\t\t\t\treturn new_poblation;\n\t\t\t}", "function tiradas(n){\n var lista = [];\n for (var i = 0; i < n; i++) {\n lista.push(random(6));\n }\n return lista;\n}", "function prepararejerciciorandom() {\n brillo = 0;\n contraste = 0;\n saturacion = 0;\n exposicion = 0;\n ruido = 0;\n difuminacion = 0; \n var elegido = [];\n var valores = [-40,-30,-20,-10,10,20,30,40];\n var valoresespeciales = [0,0,0,0,0,10,0,0,0,0,0];\n brilloejercicio = valores[Math.floor(Math.random()*(valores.length))];\n contrasteejercicio = valores[Math.floor(Math.random()*(valores.length))];\n saturacionejercicio = valores[Math.floor(Math.random()*(valores.length))];\n exposicionejercicio = valores[Math.floor(Math.random()*(valores.length))];\n ruidoejercicio = valoresespeciales[Math.floor(Math.random()*(valores.length))];\n difuminacionejercicio = valoresespeciales[Math.floor(Math.random()*(valores.length))];\n Caman(\"#canvasejercicio\", imgejercicio , function () {\n this.brightness(brilloejercicio);\n this.contrast(contrasteejercicio);\n this.saturation(saturacionejercicio); \n this.exposure(exposicionejercicio);\n this.noise(ruidoejercicio);\n this.stackBlur(difuminacionejercicio); \n this.render();\n });\n elegido = [brilloejercicio,contrasteejercicio,saturacionejercicio,exposicionejercicio,ruidoejercicio,difuminacionejercicio]\n return elegido;\n}", "function plasserUtMat() {\n for (let i = 0; i < 5; i++) {\n const x = Math.trunc(Math.random() * 60);\n const y = Math.trunc(Math.random() * 60);\n ruter[x][y] = 1;\n const div = document.createElement(\"div\");\n div.className = \"gul ting\";\n divBrett.append(div);\n const banan = new Ting(div, x, y);\n banan.render();\n mat.push(banan);\n }\n for (let i = 0; i < 5; i++) {\n let ledig = false;\n let x; let y;\n while (!ledig) {\n x = Math.trunc(Math.random() * 60);\n y = Math.trunc(Math.random() * 60);\n ledig = ruter[x][y] === 0;\n }\n ruter[x][y] = 1;\n const div = document.createElement(\"div\");\n div.className = \"roed ting\";\n divBrett.append(div);\n const banan = new Ting(div, x, y);\n banan.render();\n mat.push(banan);\n }\n }", "function szigoruanNovekvoE(){\n let ertekTomb2 = [];\n for (i = 0; i <= 10; i++){\n ertekTomb2.push(randomMinMax(1,100));\n }\n let eredmeny = 'x';\n for (i = 0; i <= ertekTomb2.length-1; i++){\n if(ertekTomb2[i] >= ertekTomb2[i+1]){\n return eredmeny = 'Nem növekszik szigorúan';\n } else {\n eredmeny = 'Szigorúan növekszik';\n }\n }\n}", "async function setVendaPadraoTopVendedoresTotal() {\n var tempo = 20;\n $('#cardVendaPadraoTopVendedorPesquisa').val('');\n $('#cardVendaPadraoTopVendedorTabela').html('<div style=\"padding: 15px\"><small class=\"text-muted flashit\">Obtendo registros ...</small></div>');\n $('#cardVendaPadraoTopVendedorTotalBlock').fadeIn(50);\n const retorno = await getVendaPadraoTopVendedorTotalAJAX();\n if (retorno.length) {\n $('#cardVendaPadraoTopVendedorTabela').html('');\n for (var i = 0; i < retorno.length; i++) {\n if (retorno[i]) {\n var registro = retorno[i];\n var html = '';\n var rank = (i + 1);\n html += '<div class=\"d-flex div-registro\" style=\"cursor: pointer;padding: 10px;margin-top: 1px;padding-left: 12px;padding-right: 10px;animation: slide-up 1s ease\">';\n html += ' <input hidden class=\"nome\" value=\"' + registro['entidadeUsuario']['usuarioNome'] + '\">';\n html += ' <div style=\"padding-top: 14px;width: 25px\">';\n html += ' <p class=\"mb-0\">' + (rank < 10 ? '0' + rank : rank) + '</p>';\n html += ' </div>';\n html += ' <div style=\"margin-right: 10px;position: relative\">';\n html += ' <img src=\"data:image/png;base64,' + registro['entidadeUsuario']['imagemPerfil'] + '\" alt=\"user\" class=\"rounded-circle img-user\" height=\"47\" width=\"47\">';\n if (i === 0) {\n html += ' <small style=\"position: absolute; right: -7px; top: -8px;color: yellow\"><i class=\"mdi mdi-crown font-20\"></i></small>';\n } else if (i === 1) {\n html += ' <small class=\"text-muted\" style=\"position: absolute; right: -7px; top: -8px\"><i class=\"mdi mdi-crown font-20\"></i></small>';\n } else if (i === 2) {\n html += ' <small class=\"text-orange\" style=\"position: absolute; right: -7px; top: -8px\"><i class=\"mdi mdi-crown font-20\"></i></small>';\n }\n if (registro['empresa'] == 'telecom') {\n html += ' <small style=\"position: absolute; right: -4px; bottom: 3px\"><img style=\"height: 15px\" src=\"' + APP_HOST + '/public/template/assets/img/faviconTelecom.png\"></small>';\n } else {\n html += ' <small style=\"position: absolute; right: -4px; bottom: 3px\"><img style=\"height: 15px\" src=\"' + APP_HOST + '/public/template/assets/img/faviconConectividade.png\"></small>';\n }\n html += ' </div>';\n html += ' <div class=\"text-truncate\" style=\"padding-top: 11px\">';\n html += ' <h5 class=\"userNome mb-0 text-truncate color-default font-11\">' + registro['entidadeUsuario']['usuarioNome'] + '</h5>';\n html += ' <p class=\"userCargo mb-0 text-truncate text-muted font-11\" style=\"max-height: 20px\">' + registro['entidadeUsuario']['cargoNome'] + '</p>';\n html += ' </div>';\n html += ' <div class=\"d-flex ml-auto\">';\n html += ' <div style=\"padding-top: 14px;width: 45px\" title=\"Vendas de planos\">';\n html += ' <p class=\"mb-0\"><i class=\"mdi mdi-shopping \"></i> ' + registro['quantidade'] + '</p>';\n html += ' </div>';\n html += ' <div style=\"padding-top: 14px;width: 45px\" title=\"Vendas de roteadores\">';\n html += ' <p class=\"mb-0\"><i class=\"mdi mdi-router-wireless\"></i> ' + registro['quantidadeVendaRoteador'] + '</p>';\n html += ' </div>';\n html += ' <div style=\"padding-top: 14px;width: 35px\" title=\"Vendas de telefonia\">';\n html += ' <p class=\"mb-0\"><i class=\"mdi mdi-phone\"></i> ' + registro['quantidadeVendaTelefonia'] + '</p>';\n html += ' </div>';\n html += ' </div>';\n html += '</div>';\n $('#cardVendaPadraoTopVendedorTabela').append(html);\n await sleep(tempo);\n }\n }\n } else {\n $('#cardVendaPadraoTopVendedorTabela').html('<div style=\"padding: 15px\"><small class=\"text-muted\">Nenhum registro encontrado ...</small></div>');\n }\n $('#cardVendaPadraoTopVendedorTotalBlock').fadeOut(50);\n $('#cardVendaPadraoTopVendedorPesquisa').focus();\n}", "function TinhTheoLoaiXe(sokm, tgcho, giaLoai1, giaLoai2, giaLoai3, tgChoTheoLoai) {\n var tien = 0;\n if (sokm <= 1) {\n tien = sokm * giaLoai1 + tgcho * tgChoTheoLoai;\n // console.log(tien);\n } else if (sokm > 1 && sokm < 21) {\n tien = giaLoai1 + (sokm - 1) * giaLoai2 + tgcho * tgChoTheoLoai;\n // console.log(tien);\n } else if (sokm >= 21) {\n tien = giaLoai1 + 19 * giaLoai2 + (sokm - 20) * giaLoai3 + tgcho * tgChoTheoLoai;\n // console.log(tien);\n }\n return document.getElementById('xuatTien').innerHTML = tien + ' vnđ';\n}", "function achatItem2Lvl1() {\n affichagePrixItem2Lvl1.innerHTML = \"OBTENU\";\n boutonItem2Lvl1.disabled = true;\n boutonItem2Lvl1.style.border = \"inherit\";\n clickRessource2 = 2;\n ressource1.innerHTML = ressource1.innerHTML - prixItem2Lvl1;\n activationItemsShop();\n compteurRessourcePlateau1 = parseInt(ressource1.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem2lvl1Vide\").src= \"assets/img/hache1Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils1();\n }", "function createSoucoupe(n){\n //genere la position x dans le canvas\n function genereX(scale){\n let ppX = Math.random() * w;\n if(ppX < scale * 100) {\n return ppX + scale * 100;\n } else if (ppX > w - scale * 100){\n return ppX - scale * 100;\n } else {\n return ppX;\n }\n }\n\n /*\n\n //genere la position y dans le canvas\n function genereY(scale){\n let ppY = Math.random() * h;\n if(ppY < scale * 100) {\n return ppY + scale * 100;\n } else if (ppY > h - scale * 40){\n return ppY - scale * 40;\n } else {\n return ppY;\n }\n }*/\n\n //genere un échelle aléatoire != 0\n function genereScale(){\n let ps = Math.random() * 0.7;\n if (ps === 0){\n return ps + 0.3\n } else {\n return ps;\n }\n }\n\n //genere les n objets soucoupes\n for(i = 0; i < n; i++){\n let scale = genereScale(); //genere un échelle au hasard\n let posX = Math.floor(genereX(scale)); //position x\n //let posY = Math.floor(genereY(scale)); //position y\n let vitX = Math.floor(Math.random() * 6 - 12);\n let vitY = Math.floor(Math.random());\n let s = new Soucoupe(posX, -50, vitX, 1, scale);\n tabObjectSoucoupe.push(s);\n }\n\n }", "function genereTournoi(){\n\n selecteurMatch = -1;\n bd.tournoi.tours = [];\n joueurAttente = [];\n\n //init\n for (var i = 0; i < bd.joueurs.length; i++){\n bd.joueurs[i].adversaires = [];\n bd.joueurs[i].coequipiers = [];\n bd.joueurs[i].points = 0;\n }\n\n var nbMatch;\n for (var i = 0; i < bd.tournoi.nbTour; i++){\n mettreJoueursDansSac(); //on met tous les joueurs selectionné dans un sac et on mélange\n populateAllMatchs(); //on générre tous les matchs possibles à partir des joueurs dans sac\n\n //nombre de mathc par tour\n nbMatch = Math.min(\n Math.floor(sac.length / (typeTournoiListe.SIMPLE ? 2 : 4)), \n allMatchs.length,\n bd.tournoi.nbTerrain\n );\n\n //on teste tous les matchs en les priorisant\n for (var j = 0; j < allMatchs.length; j++){\n testContraintes(allMatchs[j]);\n }\n //on tri la liste\n allMatchs.sort((m1, m2) => m1.pointContrainte - m2.pointContrainte);\n var matchs = [];\n var currentMatch;\n for (var j = 0; j < nbMatch; j++){\n if (allMatchs.length == 0) break; //s'il n'y a plus de match dispo on sort\n currentMatch = allMatchs[0];\n matchs.push(currentMatch);\n //attribution adversaires\n for (var k = 0; k < currentMatch[\"equipeA\"].length; k++){\n j1 = currentMatch[\"equipeA\"][k];\n for (var m = 0; m < currentMatch[\"equipeB\"].length; m++){\n j2 = currentMatch[\"equipeB\"][m];\n if (!j1.adversaires.includes(j2)) j1.adversaires.push(j2); \n if (!j2.adversaires.includes(j1)) j2.adversaires.push(j1); \n }\n }\n //et coequipiers equipe A\n var j1, j2;\n for (var k = 0; k < currentMatch[\"equipeA\"].length; k++){\n j1 = currentMatch[\"equipeA\"][k];\n for (var m = 0; m < currentMatch[\"equipeA\"].length; m++){\n j2 = currentMatch[\"equipeA\"][m];\n if (j1 != j2){\n if (!j1.coequipiers.includes(j2)) j1.coequipiers.push(j2);\n if (!j2.coequipiers.includes(j1)) j2.coequipiers.push(j1);\n }\n }\n }\n //et coequipiers equipe B\n var j1, j2;\n for (var k = 0; k < currentMatch[\"equipeB\"].length; k++){\n j1 = currentMatch[\"equipeB\"][k];\n for (var m = 0; m < currentMatch[\"equipeB\"].length; m++){\n j2 = currentMatch[\"equipeB\"][m];\n if (j1 != j2){\n if (!j1.coequipiers.includes(j2)) j1.coequipiers.push(j2);\n if (!j2.coequipiers.includes(j1)) j2.coequipiers.push(j1);\n }\n }\n }\n //on supprime tous les match ayant des joueurs déjà affecté sur ce tour\n allMatchs = allMatchs.filter(match => \n match.equipeA.filter(joueur => currentMatch.equipeA.includes(joueur)).length == 0 && \n match.equipeB.filter(joueur => currentMatch.equipeB.includes(joueur)).length == 0 &&\n match.equipeA.filter(joueur => currentMatch.equipeB.includes(joueur)).length == 0 &&\n match.equipeB.filter(joueur => currentMatch.equipeA.includes(joueur)).length == 0\n );\n\n //on supprime du sac les joueurs affectés a currentMatch\n var currentIndexOf;\n for (var k = 0; k < currentMatch.equipeA.length; k++){\n currentIndexOf = sac.indexOf(currentMatch.equipeA[k]);\n if (currentIndexOf != -1) sac.splice(currentIndexOf, 1);\n }\n for (var k = 0; k < currentMatch.equipeB.length; k++){\n currentIndexOf = sac.indexOf(currentMatch.equipeB[k]);\n if (currentIndexOf != -1) sac.splice(currentIndexOf, 1);\n }\n\n }\n\n //on ajoute dans joueur attente les joueurs restant dans le sac\n var flag;\n for (var k = 0; k < sac.length; k++){\n flag = false;\n for (var m = 0; m < joueurAttente.length; m++) {\n if (joueurAttente[m].name == sac[k].name){\n joueurAttente[m][\"nb\"]++;\n flag = true;\n }\n }\n if (!flag) joueurAttente.push({\"name\": sac[k].name, \"nb\": 1});\n }\n\n bd.tournoi.tours.push({\"matchs\": matchs, \"joueurAttente\": sac});\n }\n\n}", "function generateRefugees() {\n let randomRefugeesNb = getRndInteger(10, 100);\n let randomColumn = getRndInteger(7, 33);\n\n const refugee = new Refugees({\n nbRefugees: randomRefugeesNb,\n gridRow: 30,\n gridColumn: randomColumn,\n });\n displayRefugees(refugee);\n }", "function gera_ean (){\n/* 37 */ \tvar data \t= new Date().getTime();\n/* 38 */ \tvar cod \t= (jQuery.randomBetween(1, 99999) * data)+\"\";\n/* 39 */ \tcod = \"27\"+cod.substr(-10);\n/* 40 */ \tcod += calc_ean_dv(cod);\n/* 41 */ \treturn cod;\n/* 42 */ }", "function generarPatron(tamaño) {\r\n\r\n secuencia = [];\r\n\r\n for (var i = 0; i < tamaño; i++) {\r\n secuencia[i] = Math.floor(Math.random() * 4 + 1);\r\n }\r\n\r\n}", "resumen_estado_nave(){\n this.ajuste_potencia();\n if (typeof this._potencia_disponible !== \"undefined\"){\n if (this._potencia_disponible){\n let estado_plasma = \"\";\n for (let i = 0; i < this._injectores.length; i++) {\n estado_plasma += \"Plasma \"+i.toString()+\": \";\n let total = this._injectores[i].get_plasma+this._injectores[i].get_extra_plasma;\n estado_plasma += total+\"mg/s \";\n }\n console.log(estado_plasma);\n\n for (let i = 0; i < this._injectores.length; i++) {\n if (this._injectores[i].get_danio_por<100){\n if (this._injectores[i].get_extra_plasma>0){\n console.log(\"Tiempo de vida: \"+this._injectores[i].tiempo_vuelo().toString()+\" minutos.\");\n } else {\n console.log(\"Tiempo de vida infinito!\");\n break;\n }\n }\n }\n } else {\n console.log(\"Unable to comply.\")\n console.log(\"Tiempo de vida 0 minutos.\")\n }\n } else {\n throw \"_potencia_disponible: NO DEFINIDA\";\n }\n }", "function achatItem2Lvl3() {\n affichagePrixItem2Lvl3.innerHTML = \"OBTENU\";\n boutonItem2Lvl3.disabled = true;\n boutonItem2Lvl3.style.border = \"inherit\";\n clickRessource2 = 6;\n ressource2.innerHTML = ressource2.innerHTML - prix1Item2Lvl3;\n ressource3.innerHTML = ressource3.innerHTML - prix2Item2Lvl3;\n activationItemsShop();\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau3 = parseInt(ressource3.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem2lvl3Vide\").src= \"assets/img/hache3Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils3();\n }", "function genereCombinaison() {\n combinaisonToFind = \"\";\n for (var i = 0; i < 4; i++) {\n\tcombinaisonToFind += Math.floor((Math.random() * 6));\n }\n}", "function amelioration(){\n return nbMultiplicateurAmelioAutoclick +9;\n}", "auxiliarFor() {\n //Se comienza escribiendo el nombre del metodo \n this.codigoTemporalMetodos += \"void auxiliarFor(){\\n\";\n /*\n En el siguiente fragmento se procederá a declarar variables locales para el método, dado que\n será recursivo, el usar variables globales afectará el flujo puesto que necesitamos conservar los distintos\n valores en cada iteración\n */\n this.codigoTemporalMetodos += \"double \";\n this.temporalGlobal.aumentar();\n this.codigoTemporalMetodos += this.temporalGlobal.retornarString();\n let contador = 2;\n this.temporalGlobal.aumentar();\n for (var i = 0; i < 8; i++) {\n this.codigoTemporalMetodos += \",\" + this.temporalGlobal.retornarString();\n this.temporalGlobal.aumentar();\n contador++;\n }\n this.codigoTemporalMetodos += \",t109696\";\n this.codigoTemporalMetodos += \";\\n\";\n //En este punto regresamos las variables a como se encontraban al principio para que la escritura siga normal \n this.temporalGlobal.contador = this.temporalGlobal.contador - contador;\n //Este asignacion de variable servirá para poder determinar el inicio de la etiqueta y todo su contenido \n this.codigoTemporalMetodos += this.temporalGlobal.retornarString() + \"=stack[(int)P];\\n\";\n let primeraVariable = this.temporalGlobal.retornarString();\n //Aumentamos el contador de el generador de variables temporales \n this.temporalGlobal.aumentar();\n //Hacemos la asignacion de tipo t2 = t1 \n this.codigoTemporalMetodos += this.temporalGlobal.retornarString() + \"=\" + primeraVariable + \";\\n\";\n let segundaVariable = this.temporalGlobal.retornarString();\n this.codigoTemporalMetodos += \"t109696=\" + primeraVariable + \";\\n\";\n //Se escribe la primera etiqueta para la lectura del nombre de la ewtiqueta \n this.codigoTemporalMetodos += \"L0:\\n\";\n this.temporalGlobal.aumentar();\n //Escribimos la variable pivote para ir recorriendo el nombre de la etiqueta \n this.codigoTemporalMetodos += this.temporalGlobal.retornarString() + \"= heap[(int)\" + primeraVariable + \"];\\n\";\n let terceraVariable = this.temporalGlobal.retornarString();\n //escribimos el condicional para verificar si ya hemos llegado al final de nuestra etiqueta \n this.codigoTemporalMetodos += \"if(\" + terceraVariable + \"==-1) goto L1;\\n\";\n //Se escribe el caracter actual del nombre de la etiqueta \n //Nos desplazamos en el siguiente caracter a imprimir del nombred de la etiqueta \n this.codigoTemporalMetodos += primeraVariable + \"=\" + primeraVariable + \"+1;\\n\";\n //Volvemos a iterar hacia la etiqueta inicial \n this.codigoTemporalMetodos += \"goto L0;\\n\";\n //Escribimos el codigo de la etiqueta cuando ya acabemos de escribir el nombre del nodo actual \n this.codigoTemporalMetodos += \"L1:\\n\";\n //Nos desplazamos hacia la siguiente posicion \n this.codigoTemporalMetodos += primeraVariable + \"=\" + primeraVariable + \"+1;\\n\";\n //Escribimos la etiqueta L2\n this.codigoTemporalMetodos += \"L2:\\n\";\n this.temporalGlobal.aumentar();\n //Asignamos el pivote respectivo \n this.codigoTemporalMetodos += this.temporalGlobal.retornarString() + \"=heap[(int)\" + primeraVariable + \"];\\n\";\n let cuartaVariable = this.temporalGlobal.retornarString();\n //Escribimos las condicionales para brincar hacia las etiquetas correspondientes de la escritura de ATRIBUTOS \n this.codigoTemporalMetodos += \"if(\" + cuartaVariable + \"==-77) goto L5;\\n\"; //Final de atributos\n this.codigoTemporalMetodos += \"if(\" + cuartaVariable + \"==-3) goto L4;\\n\"; //Final de nombre atributo\n this.codigoTemporalMetodos += \"if(\" + cuartaVariable + \"==-2) goto L3;\\n\"; //Final valor atributo\n // this.codigoTemporalMetodos += \"printf(\\\"%c\\\", (char)\" + cuartaVariable + \");\\n\"; //Imprimimos el nombre o valor del atributo\n //Seguimos desplazandonos a la siguiente posicion \n this.codigoTemporalMetodos += primeraVariable + \"=\" + primeraVariable + \"+1;\\n\";\n //Regresamos a la etiqueta de impresion de atributos para seguir iterando \n this.codigoTemporalMetodos += \"goto L2;\\n\";\n //Ahora se va a escribir el espacio entre atributos \n this.codigoTemporalMetodos += \"L3:\\n\";\n this.codigoTemporalMetodos += primeraVariable + \"=\" + primeraVariable + \"+1;\\n\";\n this.codigoTemporalMetodos += \"goto L2;\\n\";\n //Ahora se escribe el signo igual para asignarle el valor al atributo respectivo\n this.codigoTemporalMetodos += \"L4:\\n\";\n this.codigoTemporalMetodos += primeraVariable + \"=\" + primeraVariable + \"+1;\\n\";\n this.codigoTemporalMetodos += \"goto L2;\\n\";\n //Ahora se procede a escribir el codigo para el cierre del nombre de etiqueta luego de escribir sus atributos \n this.codigoTemporalMetodos += \"L5:\\n\";\n //Escribimos el simbolo > \n //Nos desplazamos en el siguiente caracter a imprimir \n this.codigoTemporalMetodos += primeraVariable + \"=\" + primeraVariable + \"+1;\\n\";\n //Aumentamos el contador global \n this.temporalGlobal.aumentar();\n this.codigoTemporalMetodos += this.temporalGlobal.retornarString() + \"=heap[(int)\" + primeraVariable + \"];\\n\";\n let quintaVariable = this.temporalGlobal.retornarString();\n //Escribimos el condicional para la verificacion de existencia de texto \n this.codigoTemporalMetodos += \"if(\" + quintaVariable + \"==-1) goto L9;\\n\";\n //Escribimos la rutina para la escritura del texto entre etiquetas \n this.codigoTemporalMetodos += \"L6:\\n\";\n //Aumentamos el contador \n this.temporalGlobal.aumentar();\n //Escribimos el nuevo pivote para escritura de texto \n this.codigoTemporalMetodos += this.temporalGlobal.retornarString() + \"=heap[(int)\" + primeraVariable + \"];\\n\";\n let sextaVariable = this.temporalGlobal.retornarString();\n //Escribimos el condicional para verificacion de finalizacion de texto\n this.codigoTemporalMetodos += \"if(\" + sextaVariable + \"==-1) goto L7;\\n\";\n //Escrbimos el caracter del texto entre etiquetas \n // this.codigoTemporalMetodos += \"printf(\\\"%c\\\", (char)\" + sextaVariable + \");\\n\"; //Imprimimos el nombre o valor del atributo\n //Seguimos desplazandonos a la siguiente posicion \n this.codigoTemporalMetodos += primeraVariable + \"=\" + primeraVariable + \"+1;\\n\";\n //Regresamos a la etiqueta de impresion de atributos para seguir iterando \n this.codigoTemporalMetodos += \"goto L6;\\n\";\n //Escribimos la etiqueta para la finalizacion de escritura de texto \n this.codigoTemporalMetodos += \"L7:\\n\";\n this.codigoTemporalMetodos += \"L8:\\n\";\n //Aumentamos el contador \n this.temporalGlobal.aumentar();\n this.codigoTemporalMetodos += this.temporalGlobal.retornarString() + \"= heap[(int)\" + segundaVariable + \"];\\n\";\n let septimaVariable = this.temporalGlobal.retornarString();\n this.codigoTemporalMetodos += \"if(\" + septimaVariable + \"==-1)goto L10;\\n\"; //fin de etiqueta con texto entre etique\n // this.codigoTemporalMetodos += \"printf(\\\"%c\\\", (char)\" + septimaVariable + \");\\n\";\n this.codigoTemporalMetodos += segundaVariable + \"=\" + segundaVariable + \"+1;\\n\";\n this.codigoTemporalMetodos += \"goto L8;\\n\";\n this.codigoTemporalMetodos += \"L10:\\n\";\n // this.codigoTemporalMetodos += \"printf(\\\"%c\\\", (char)62);\\n\";\n this.codigoTemporalMetodos += \"goto L500;\\n\";\n //Escribimos la etiqueta que se encargará de trabajar la recursividad para la impresión de todo el contenido \n this.codigoTemporalMetodos += \"L9:\\n\";\n //Nos desplazamos a la siguiente posicion para verificar si hay hijos \n this.codigoTemporalMetodos += primeraVariable + \"=\" + primeraVariable + \"+1;\\n\";\n //Aumentamos el contador \n this.temporalGlobal.aumentar();\n this.codigoTemporalMetodos += this.temporalGlobal.retornarString() + \"=heap[(int)\" + primeraVariable + \"];\\n\";\n // this.codigoTemporalMetodos += \"printf(\\\" % c\\\", (char)32);\\n\";\n let octavaVariable = this.temporalGlobal.retornarString();\n //Escribimos la etiqueta que contiene la recursividad \n this.codigoTemporalMetodos += \"L18:\\n\";\n //ESCRIBIMOS LAS CONDICIONALES PARA SABER SI FINALIZA LA RECURSIVIDAD O FINALIZA UN HIJO \n this.codigoTemporalMetodos += octavaVariable + \"=heap[(int)\" + primeraVariable + \"];\\n\";\n this.codigoTemporalMetodos += \"if(\" + octavaVariable + \"==-2) goto L14;\\n\";\n this.codigoTemporalMetodos += \"if(\" + octavaVariable + \"==-9) goto L499;\\n\";\n //Asignamos al puntero del stack la posicion para iniciar en la nueva iteracion \n this.codigoTemporalMetodos += \"P=\" + octavaVariable + \";\\n\";\n //Llamamos al método para manejar la recursividad \n this.codigoTemporalMetodos += \"auxiliarFor();\\n\";\n //No ubicamos en la siguiente posicion \n this.codigoTemporalMetodos += primeraVariable + \"=\" + primeraVariable + \"+1;\\n\";\n //Iteramos nuevamente\n this.codigoTemporalMetodos += \"goto L18;\\n\";\n //Escribimos el codigo para pasar de un hijo a otro \n this.codigoTemporalMetodos += \"L14:\\n\";\n this.codigoTemporalMetodos += primeraVariable + \"=\" + primeraVariable + \"+1;\\n\";\n this.codigoTemporalMetodos += \"goto L18;\\n\";\n //METODO PARA ESCRIBIR LA ETIQUETA FINAL DE UNA ETIQUETA CON HIJOS \n this.codigoTemporalMetodos += \"L499:\\n\";\n this.codigoTemporalMetodos += \"L498:\\n\";\n this.temporalGlobal.aumentar();\n this.codigoTemporalMetodos += this.temporalGlobal.retornarString() + \"=heap[(int)t109696];\\n\";\n let novenaVariable = this.temporalGlobal.retornarString();\n this.codigoTemporalMetodos += \"if(\" + novenaVariable + \"==-1) goto L497;\\n\";\n this.codigoTemporalMetodos += \"t109696 = t109696+1;\\n\";\n this.codigoTemporalMetodos += \"goto L498;\\n\";\n this.codigoTemporalMetodos += \"L497:\\n\";\n //FINALIZAMOS EL METODO \n this.codigoTemporalMetodos += \"L500:\\n\";\n this.codigoTemporalMetodos += \"return;\\n}\\n\";\n //En este punto está pendiente todavía la escritura de la finalizacion de etiqueta cuando esta tiene hijos \n }", "function newValues() {\n\tvalues = [];\n\tfor (var i = 0, t = 14; i < 4; i++) {\n\t\tvalues.push(Math.round(Math.random() * t) + (i + 1));\n\t}\n}", "function agregarZ(can){\n let cadena=' <tr><td><h6 class=\"Vars\" >y=</h6></td> ';\n for(let x=0;x<can;x++){\n cadena=cadena+' <td><input type=\"number\" min=\"0\" class=\"func\" id=\"v'+x+'\"><h6 class=\"Vars\" > x'+x+'</h6>+</td>';\n } \n cadena=cadena.slice(0,cadena.length-6);\n cadena=cadena+'</td></tr>';\n $('#funcionGeneral tbody ').append(cadena);\n }", "function InicializarHotZone()\n{\n faseActual = 0;\n cargando = true;\n idCharCarga = 0;\n idCharDescarga = 0;\n charsPorFase = Math.round(largoTexto / 4);\n charsUltimaFase = largoTexto - (charsPorFase * 3);\n tLoop = (dificultad.fases[faseActual].carga * 1000) / charsPorFase;\n}", "function crearSolicitudes() {\n var arraySolicitudes = [];\n for (var i = 1; i <= 104; i++) {\n arraySolicitudes.push(crearSolicitud(i));\n }\n return arraySolicitudes;\n }", "function comenzar()\n{\n numeroSecreto=(Math.floor(Math.random() *100) + 1); // Se Genera El Numero Secreto Random\n}", "function swieta_ruchome(year) \n{\n //wielkanoc\n var poniedzialek_wielkanocny_dzien, poniedzialek_wielkanocny_miesiac, boze_cialo_dzien, boze_cialo_miesiac,\n luty = l_dni(1, year), \n dzien_roku = 31 + luty, \n f = Math.floor,\n\t\tG = year % 19,\n\t\tC = f(year / 100),\n\t\tH = (C - f(C / 4) - f((8 * C + 13)/25) + 19 * G + 15) % 30,\n\t\tI = H - f(H/28) * (1 - f(29/(H + 1)) * f((21-G)/11)),\n\t\tJ = (year + f(year / 4) + I + 2 - C + f(C / 4)) % 7,\n\t\tL = I - J,\n\t\tmonth = 3 + f((L + 40)/44),\n day = L + 28 - 31 * f(month / 4);\n\n if( day==31 && month==3 )\n {\n poniedzialek_wielkanocny_dzien = 1;\n poniedzialek_wielkanocny_miesiac = 3;\n }\n else\n {\n poniedzialek_wielkanocny_dzien = day + 1;\n poniedzialek_wielkanocny_miesiac = month - 1;\n }\n\n if( month==3 )\n {\n dzien_roku += day;\n }\n else\n {\n dzien_roku = dzien_roku + 31 + day;\n }\n\n dzien_roku += 60;\n\n if( luty==28 && dzien_roku<=151)\n {\n boze_cialo_dzien = dzien_roku - 120;\n boze_cialo_miesiac = 4;\n }\n else if( luty==29 && dzien_roku<=152 )\n {\n boze_cialo_dzien = dzien_roku - 121;\n boze_cialo_miesiac = 4;\n }\n else if( luty==29 )\n {\n boze_cialo_dzien = dzien_roku - 152;\n boze_cialo_miesiac = 5;\n }\n else\n {\n boze_cialo_dzien = dzien_roku - 151;\n boze_cialo_miesiac = 5;\n }\n\n return [poniedzialek_wielkanocny_dzien, poniedzialek_wielkanocny_miesiac, boze_cialo_dzien, boze_cialo_miesiac];\n}", "function generateNum() {\n goalNumber = Math.floor((Math.random() * 120) + 19);\n }", "function generateSeq() {\r\n\r\n}", "function main(){\n\n for(let i = 0; i < 800/5; i ++){\n ar.push(parseInt(Math.round(Math.random()*500)));\n arORD.push(ar[i]);\n }\n}", "randomSize() {\n\t\tthis.randomNumber = Math.floor(Math.random() * 90) + 10;\n\t}", "function achatItem2Lvl2() {\n affichagePrixItem2Lvl2.innerHTML = \"OBTENU\";\n boutonItem2Lvl2.disabled = true;\n boutonItem2Lvl2.style.border = \"inherit\";\n clickRessource2 = 4;\n ressource1.innerHTML = ressource1.innerHTML - prix1Item2Lvl2;\n ressource2.innerHTML = ressource2.innerHTML - prix2Item2Lvl2;\n activationItemsShop();\n compteurRessourcePlateau1 = parseInt(ressource1.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem2lvl2Vide\").src= \"assets/img/hache2Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils2();\n }", "function zerarTransformacao () {\n botaoT = 0; \n botaoS = 0;\n botaoR = 0;\n}", "function tamanhoMosquito() {\n let classe = Math.floor(Math.random() * 3);\n\n switch (classe) {\n case 0:\n return 'mosca1';\n case 1:\n return 'mosca2';\n case 2:\n return 'mosca3';\n }\n}", "function generate (type ,num) {\n let result = [];\n let faculty = \"\";\n let amount = 0;\n for (let index = 0; index < num; index++) {\n\n faculty = faculties[Math.round(Math.random() * (faculties.length - 1))];\n amount = Math.round(Math.random() * (capacityLimits[1] - capacityLimits[0]) + capacityLimits[0]);\n\n result.push(\n newObj(type + index, faculty, amount)\n );\n }\n\n return result;\n}", "function tamanhoAleatorio() {\n let classe = Math.floor(Math.random() * 3)\n\n switch(classe) {\n case 0:\n return 'mosquito1'\n \n case 1:\n return 'mosquito2'\n \n case 2:\n return 'mosquito3'\n }\n}", "function nowa_plansza0(){\r\n opisPlanszy =\r\n\t\t\"000000000\" +\r\n\t\t\"000000000\" +\r\n\t\t\"000000000\" +\r\n\t\t\"000000000\" +\r\n\t\t\"000000000\" +\r\n\t\t\"000000000\" +\r\n\t\t\"000000000\" +\r\n\t\t\"000000000\" +\r\n\t\t\"000000000\";\r\n $(\"#plansza\").html(Plansza(opisPlanszy));\r\n rysujKrawedzie();\r\n przelacz_inputy(true);\r\n document.getElementById(\"stop_timer\").disabled = true;\r\n\tdocument.getElementById(\"cofnij\").disabled = true;\r\n\tdocument.getElementById(\"ponow\").disabled = true;\r\n\tdocument.getElementById(\"zapisz\").disabled = true;\r\n\tdocument.getElementById(\"hint\").disabled = true;\r\n\tdocument.getElementById(\"sprawdz\").disabled = true;\r\n}", "function generaArray () {\r\n var array = []\r\n\r\n for (var count = 0; count < 10; count++ ) {\r\n var numeroCasuale = Math.floor(Math.random() * 9) + 1;\r\n array.push(numeroCasuale);\r\n}\r\n return array.join(\"\")\r\n}", "function standardsMaker () {\n for (let index = 0; index < 300; index++) {\n console.log(\"Haré preguntas si estoy atascado\");\n }\n}", "function lottoGenerator() {\n const arr = []\n function rando(lot) {\n const ran = Math.floor(Math.random() * (60 - 1 + 1)) + 1\n return lot.includes(ran) ? rando(lot) : ran\n }\n for (let i = 0; i < 6; i++) {\n const ran = rando(arr)\n arr.push(ran)\n }\n return arr\n}", "function tamanhoAleatorio() {\n var classe = Math.floor(Math.random() * 3)\n\n // alterar a classe do elemento (borboleta)\n switch(classe) {\n case 0:\n return \"borboleta1\"\n case 1:\n return \"borboleta2\"\n case 2:\n return \"borboleta3\"\n\n }\n}", "gerarCnpj (pontuacao) {\n var cnpj;\n\t\n var n = 9;\n var n1 = this.getRandomNumber(n);\n var n2 = this.getRandomNumber(n);\n var n3 = this.getRandomNumber(n);\n var n4 = this.getRandomNumber(n);\n var n5 = this.getRandomNumber(n);\n var n6 = this.getRandomNumber(n);\n var n7 = this.getRandomNumber(n);\n var n8 = this.getRandomNumber(n);\n var n9 = 0; //randomiza(n);\n var n10 = 0; //randomiza(n);\n var n11 = 0; //randomiza(n);\n var n12 = 1; //randomiza(n);\n var d1 = n12*2+n11*3+n10*4+n9*5+n8*6+n7*7+n6*8+n5*9+n4*2+n3*3+n2*4+n1*5;\n d1 = 11 - ( this.mod(d1,11) );\n\n if (d1>=10){\n d1 = 0;\n }\n\n var d2 = d1*2+n12*3+n11*4+n10*5+n9*6+n8*7+n7*8+n6*9+n5*2+n4*3+n3*4+n2*5+n1*6;\n d2 = 11 - ( this.mod(d2,11) );\n\n if (d2>=10){\n d2 = 0;\n } \n\n var retorno = '';\n if (pontuacao){\n cnpj = ''+n1+n2+'.'+n3+n4+n5+'.'+n6+n7+n8+'/'+n9+n10+n11+n12+'-'+d1+d2;\n }else \n {cnpj = ''+n1+n2+n3+n4+n5+n6+n7+n8+n9+n10+n11+n12+d1+d2;}\n\n return cnpj;\n\n}", "function crearGrilla() {\n var div;\n for (let i = 0; i < 1749; i++) {\n div = document.createElement('div');\n grilla.appendChild(div);\n }\n}", "randomNaves() {\n return Math.floor(Math.random() * this.poscionNaves.length) + 0;\n }", "function generarCola(usuario,permiso) {\n\tconsole.log(\"generamos cola\");\n\tlet tabla = {\n\t\t\"datos\":[\n\t\t\t{\n\t\t\t\t\"Estado\":\"Genera permiso\",\n\t\t\t\t\"Contador\":0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Estado\":\"Pdte. Autoriz. Permiso\",\n\t\t\t\t\"Contador\":0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Estado\":\"Pdtes. Justificante\",\n\t\t\t\t\"Contador\":0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Estado\":\"Pdte. Autoriz. Justificante\",\n\t\t\t\t\"Contador\":0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Estado\":\"Ausencia finalizada\",\n\t\t\t\t\"Contador\":0\n\t\t\t}\n\t\t]\n\t};\n\tswitch (permiso) {\n\t\tcase \"Profesor\":\n\t\t\tpideDatos(\"peticion\",\"?usuario=\"+usuario,(data) => {\n\t\t\t\t\t//Convertimos a JSON los datos obtenidos\n\t\t\t\t\tlet json = JSON.parse(data);\n\t\t\t\t\t//Colocamos cada permiso en su lugar\n\t\t\t\t\tfor(let dato of json){\n\t\t\t\t\t\ttabla.datos[dato[\"estado_proceso\"]-1].Contador++;\n\t\t\t\t\t}\n\t\t\t\t\tprintDatos(tabla,\"#cola\");\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tbreak;\n\t\tcase \"Directivo\":\n\t\t\tpideDatos(\"peticion\",\"?\",\n\t\t\t\t(data) => {\n\t\t\t\t\t//Convertimos a JSON los datos obtenidos\n\t\t\t\t\tlet json = JSON.parse(data);\n\t\t\t\t\t//Colocamos cada permiso en su lugar\n\t\t\t\t\tfor(let dato of json){\n\t\t\t\t\t\tif (dato[\"estado_proceso\"]===1 || dato[\"estado_proceso\"]===3){\n\t\t\t\t\t\t\tif (dato.usuario===usuario){\n\t\t\t\t\t\t\t\ttabla.datos[dato[\"estado_proceso\"]-1].Contador++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttabla.datos[dato[\"estado_proceso\"]-1].Contador++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tprintDatos(tabla,\"#cola\");\n\t\t\t\t\t//json=JSON.parse(data);\n\t\t\t\t}\n\t\t\t);\n\n\n\t\t\tbreak;\n\t\tcase \"Admin\":\n\t\t\tpideDatos(\"peticion\",\"?\",\n\t\t\t\t(data) => {\n\t\t\t\t\t//Convertimos a JSON los datos obtenidos\n\t\t\t\t\tlet json = JSON.parse(data);\n\t\t\t\t\t//Colocamos cada permiso en su lugar\n\t\t\t\t\tfor(let dato of json){\n\t\t\t\t\t\ttabla.datos[dato[\"estado_proceso\"]-1].Contador++;\n\t\t\t\t\t}\n\t\t\t\t\tprintDatos(tabla,\"#cola\");\n\t\t\t\t\t//json=JSON.parse(data);\n\t\t\t\t}\n\t\t\t);\n\t\t\tbreak;\n\t}\n}", "function achatItem1Lvl2() {\n affichagePrixItem1Lvl2.innerHTML = \"OBTENU\";\n boutonItem1Lvl2.disabled = true;\n boutonItem1Lvl2.style.border = \"inherit\";\n clickRessource1 = 4;\n ressource1.innerHTML = ressource1.innerHTML - prix1Item1Lvl2;\n ressource2.innerHTML = ressource2.innerHTML - prix2Item1Lvl2;\n activationItemsShop();\n compteurRessourcePlateau1 = parseInt(ressource1.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem1lvl2Vide\").src= \"assets/img/lance2Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils2();\n }", "function fasesTorneo() {\n vm.paso = 3;\n obtenerFases();\n obtenerTiposDeFase();\n obtenerPenalizaciones();\n }" ]
[ "0.64151925", "0.63466394", "0.63394314", "0.62483096", "0.6232708", "0.619188", "0.6047631", "0.5987114", "0.59727186", "0.59648025", "0.5924548", "0.5900105", "0.5898745", "0.58840585", "0.5847552", "0.58471006", "0.58075136", "0.580641", "0.5797946", "0.57711625", "0.57690936", "0.5756062", "0.575224", "0.5740007", "0.57361484", "0.5723502", "0.5718726", "0.5709852", "0.5695943", "0.56924707", "0.5665706", "0.5656768", "0.5637106", "0.5630553", "0.56191915", "0.56179523", "0.5611295", "0.5608034", "0.55945003", "0.55933803", "0.5590332", "0.5588581", "0.5578117", "0.55624586", "0.5561003", "0.5547363", "0.55414504", "0.5538866", "0.55305845", "0.55291516", "0.5528491", "0.55284166", "0.55160534", "0.5513046", "0.55100644", "0.55078113", "0.55074", "0.5505616", "0.55007136", "0.5486392", "0.5485138", "0.5481357", "0.54772854", "0.54735863", "0.5472449", "0.54709506", "0.5470899", "0.54674685", "0.54643077", "0.5456399", "0.54549557", "0.5450419", "0.54463345", "0.54345906", "0.54336196", "0.5432333", "0.54317063", "0.5431423", "0.54301584", "0.5429611", "0.5425899", "0.542291", "0.54218966", "0.5420153", "0.54200095", "0.5415409", "0.5414975", "0.5412482", "0.54114467", "0.5404945", "0.5404559", "0.54017925", "0.539979", "0.5399045", "0.5398434", "0.5397447", "0.539716", "0.5396664", "0.53959304", "0.53921324", "0.53897613" ]
0.0
-1
Ubija ispod prosecne vrste
killBadSpecies() { let averageSum = this.getAvgFitnessSum(); for (let i = 1; i < this.species.length; i++) { if ((this.species[i].averageFitness / averageSum) * this.players.length < 1) { this.species.splice(i, 1); i--; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mostraNotas(){}", "efficacitePompes(){\n\n }", "function comportement (){\n\t }", "function Deplacement_ennemiLimitrophe(Territoire){\r\n\tif (Territoire.army < 2) {return false}\r\n for (var i=0 ; i < Territoire.voisins.length ; i++){\r\n if (Territoire.proprietaire != Territoire.voisins[i].proprietaire ){\r\n return true\r\n }\r\n }\r\n return false\r\n}", "function Deplacement_joueurpossedeterritoirenonisole(Id,carte) {\r\n\tvar possedeterritoirenonisole = false\r\n carte.forEach((territoire)=>{\r\n if(territoire.proprietaire==Id){\r\n var status = Deplacement_voisinLimitrophe(territoire)\r\n if (status){\r\n possedeterritoirenonisole = true\r\n }\r\n }\r\n })\r\n\treturn(possedeterritoirenonisole)\r\n}", "function rimuovi(){\n\n\tvar j = 0;\n\n\t// Per ogni elemento controllo la condizione\n\t// Se è idoneo, copio elemento in J\n\n\tfor(var i = 0; i<persone.length; i++){\n\t\tif(persone[i].altezza > 1.5) {\n\t\t\tpersone[j++] = persone[i];\n\t\t}\n\t}\n\t// Aggiorno array con valori nuovi messi in J\n\tpersone.length = j;\n\n\t// Visualizzo\n\tvisualizzaPersone();\n}", "function esProtesisf(diente, codigopieza){\n\t\t\n\t\tvar esProtesisf = false;\n\t\tvar color = 'blue';\n\t\tvar pdiente = \"\"; //primer diente\n\t\tvar udiente = \"\"; // ultimo diente\n\t\tvar protesisfcompleto = false;\n\t\tvar salida ='';\n\n\t\tvar esCor = false;\n\t\tvar color = 'blue';\n\n\t\tvar trat_protesisf = ko.utils.arrayFilter(vm.tratamientosAplicados(), function(t){\n\t\t\treturn t.tratamiento.id == codigopieza;\n\t\t});\t\n\n\t\ttry {\n\n \tfor (var i = 0; i <= trat_protesisf.length - 1; i++) {\n\t\t\tvar t = trat_protesisf[i];\n \n // Si esta completo el puente\n if (t.diente.id.indexOf('_') > -1) { \n\t\t pdiente = t.diente.id.substring(0, t.diente.id.indexOf('_'));\t\n\t\t\t udiente = t.diente.id.substring(t.diente.id.lastIndexOf('_')+3, t.diente.id.length - t.diente.id.lastIndexOf('_'));\n\n // si estan definidos ambos dientes del puente devuelvo el tratamiento\n\t\t\t if(pdiente>0 && udiente>0 && diente.id==pdiente){ \n\t\t\t \t esProtesisf = true;\n\t\t\t \t protesisfcompleto = true;\n\n\t\t if (t.tratamiento.id == \"01.09\" || t.tratamiento.id == \"01.03\" || t.tratamiento.id == \"01.10\"){\n\t\t\t\t\t color = t.tratamiento.color;\n\t\t } \n\t\t\t \t salida=[esProtesisf,color,pdiente,udiente, protesisfcompleto];\n\t\t\t }\n\t\t\t // con que uno este definido ya es puente\n\t\t\t if(pdiente>0 && udiente>0 && diente.id==pdiente){ \n\t\t\t \t esProtesisf = true;\n\t\t\t \t salida=[esProtesisf,color,pdiente,udiente, protesisfcompleto];\n\t\t\t }\n\t\t\t \n\t\t\t} \n\t\t};\n \n }\n catch(err) {\n\t\t \n\t\t}\n \treturn salida;\n\n\t}", "function tarkistaPari() {\r\n let ovatPari = ekaKortti.dataset.kehys === tokaKortti.dataset.kehys;\r\n //jos kortit ovat pari estetään niitä kääntymästä ja\r\n //jos kortit eivät ole pari käännetään ne takaisin\r\n ovatPari ? disable() : unflip();\r\n}", "function prikaziRezultat(){\r\n // na samom pocetku nije imao tacnih odgovora\r\n let brTacnih = 0;\r\n const listaPitanja = document.querySelectorAll(\".pitanje\")\r\n // prolazimo kroz globalni niz svih pitanja\r\n // tu poredimo odgovor koji je igrac dao na to pitanja sa tacnim odgovorom pitanja \r\n pitanja.forEach(function(trenutnoPitanje, pitanjeInd){\r\n // selektor koji trazi cekirani input na trenutno pitanje\r\n const selektor = `input[name=odgovor${pitanjeInd}]:checked`;\r\n // igrac je odgovorio ono sto je vrijednost cekiranog input-a (radio button-a)\r\n const odgovoreno = (document.querySelector(selektor) || {} ).value;\r\n\r\n // ako je ono sto je igrac odgovorio jednako tacnom odgovoru na trenutno pitanje\r\n // to znaci da je igrac tacno odgovorio i povecavamo ukupan broj tacnih odgovora\r\n \r\n if(odgovoreno === trenutnoPitanje.tacanOdgovor){\r\n brTacnih = brTacnih + 1;\r\n\r\n /* DOMACI */\r\n listaPitanja[pitanjeInd].style.color = \"green\"\r\n }else {\r\n listaPitanja[pitanjeInd].style.color = \"red\" \r\n } /* DOMACI */\r\n\r\n\r\n });\r\n // na kraju samo popunjavamo div za prikaz rezultata\r\n rezultatDiv.innerHTML = `rezultat: <h3>${brTacnih} od ${pitanja.length}</h3>`; \r\n}", "function pokreniKviz(){\r\n // niz koji popunjavamo tekstom pitanja i ponudjenim odgovorima\r\n // niz ce sadrzati HTML elemente\r\n const output = [];\r\n // prolazimo petljom kroz sve elemente niza pitanja\r\n // uzimamo pitanje koje je aktuelno u trenutnoj iteraciji i njegov indeks\r\n pitanja.forEach(function(trenutnoPitanje, pitanjeInd){\r\n // niz koji cemo popuniti odgovorima na trenutno pitanje\r\n const odgovori = []; \r\n // petlja koja prolazi svim odgovorima trenutnog pitanja\r\n for(slovo in trenutnoPitanje.odgovori){\r\n // u niz odgovora dodajemo HTML kod za prikaz ponudjenog odgovora\r\n // inputi za odgovor na isto pitanje moraju imati isti name atribut\r\n // odradjujemo da svaki od njih ima name=\"odogovor\"+indeks_trenutnog_pitanja\r\n // na taj nacin ce svi ponudjeni odgovori na pitanje sa indeksom 1 imati name=\"odgovor1\"\r\n // vrijednost odgovora je upravo ono slovo pod kojim je on i ponudjen\r\n // tekst je oblika: \" a : tekst_odgovora \"\r\n odgovori.push(\r\n `<label>\r\n <input type=\"radio\" name=\"odgovor${pitanjeInd}\" value=\"${slovo}\" >\r\n ${slovo} : ${trenutnoPitanje.odgovori[slovo]}\r\n </label>`\r\n );\r\n }\r\n // na kraju u output niz koji sadrzi sva pitanja i ponudjene odgovore dodajemo trenutno\r\n // trenutnoPitanje.pitanje je tekst pitanja\r\n // funkcija join od niza pravi string\r\n output.push(\r\n `\r\n <div class=\"pitanje\">${trenutnoPitanje.pitanje}</div>\r\n <div class=\"odgovori\"> ${odgovori.join('')} </div>\r\n `\r\n );\r\n });\r\n // na kraju popunjavamo div za prikaz pitanja i odgovora\r\n kvizDiv.innerHTML = output.join('');\r\n}", "function ispisCene(){\n \n let ispisCena=racunajCenu(findDestPrice(dest),brOsoba);\n document.querySelector(\"#cena\").innerHTML = `${ispisCena}&euro;`;\n }", "resumen_estado_nave(){\n this.ajuste_potencia();\n if (typeof this._potencia_disponible !== \"undefined\"){\n if (this._potencia_disponible){\n let estado_plasma = \"\";\n for (let i = 0; i < this._injectores.length; i++) {\n estado_plasma += \"Plasma \"+i.toString()+\": \";\n let total = this._injectores[i].get_plasma+this._injectores[i].get_extra_plasma;\n estado_plasma += total+\"mg/s \";\n }\n console.log(estado_plasma);\n\n for (let i = 0; i < this._injectores.length; i++) {\n if (this._injectores[i].get_danio_por<100){\n if (this._injectores[i].get_extra_plasma>0){\n console.log(\"Tiempo de vida: \"+this._injectores[i].tiempo_vuelo().toString()+\" minutos.\");\n } else {\n console.log(\"Tiempo de vida infinito!\");\n break;\n }\n }\n }\n } else {\n console.log(\"Unable to comply.\")\n console.log(\"Tiempo de vida 0 minutos.\")\n }\n } else {\n throw \"_potencia_disponible: NO DEFINIDA\";\n }\n }", "function ucitajPodatkeImpl(periodicna, vanredna){\r\n //ucitavanje podataka\r\n glavniNizP=periodicna;\r\n glavniNizV=vanredna;\r\n }", "function ActualiserPointsVie(){\n\t//les PDV diminuent si le joueur s'eloigne des artefacts (zoneSure) sans lumiere (torcheJoueur)\n\tif(transform.Find(\"torcheJoueur(Clone)\") == null && !zoneSure){\n\t\tif(vitesseCorruption < 0){\n\t\t\tvitesseCorruption = 0;\n\t\t}else{\n\t\t\tvitesseCorruption += Time.deltaTime/2;\n\t\t}\n\t\tpointsVie -= vitesseCorruption*Time.deltaTime;\n\t} else{\n\t\t//la vitesse de reduction des PDV diminue jusqu'a 0\n\t\tif(vitesseCorruption > 0){\n\t\t\tvitesseCorruption -= Time.deltaTime*2;\n\t\t}else{\n\t\t\tvitesseCorruption = 0;\n\t\t\t//soigne si la vitesse de corruption est 0 et le joueur a obtenu la potion\n\t\t\tif(Joueur.powerUpPotion){\n\t\t\t\tpointsVie += Time.deltaTime;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}\n\t//actualise l'element visuel\n\tbarreVie.fillAmount = pointsVie/pointsVieMax;\n}", "function reglaRebajaPrecios(){\n if(producto.super_avance.sellIn = 0)\n {\n precio_SuperAvance - 2;\n\n if(producto.fc_superduper.sellIn = 0){\n precio_FullSuperDuper - 2;\n\n if(producto.f_cobertura.sellIn = 0){\n precio_FullCobertura - 2;\n }\n }\n }else{\n }\n}", "niveauSuivant()\r\n\t{\r\n\t\tthis._termine = false;\r\n\t\tthis._gagne = false;\r\n\t\tthis._niveau++;\r\n\t\tthis.demarrerNiveau();\r\n\t}", "auxiliarPredicado(tipo, nombre, valor, objeto) {\n //Verificamos si lo que se buscó en el predicado es un atributo o etiqueta\n if (tipo == \"atributo\") {\n //Recorremos los atributos del objecto en cuestion\n for (let att of objeto.atributos) {\n //Si los nombres de atributos son iguales\n if (att.dameNombre() == nombre) {\n //Si los valores de los atributos son iguales al valor ingresado en el predicado\n if (att.dameValor() == valor) {\n //Guardamos el elemento que contiene el atributo\n this.consolaSalidaXPATH.push(objeto);\n //Esta linea de codigo para para verificar el nuevo punto de inicio de la consola final, para no redundar\n if (!this.controladorPredicadoInicio) {\n this.contadorConsola = this.consolaSalidaXPATH.length - 1;\n this.controladorPredicadoInicio = true;\n }\n } //Cierre comparacion valor\n } //Cierre comparacion nombre\n } //Cierre for para recorrer atributos\n for (let entry of objeto.hijos) {\n for (let att of entry.atributos) {\n //Si los nombres de atributos son iguales\n if (att.dameNombre() == nombre) {\n //Si los valores de los atributos son iguales al valor ingresado en el predicado\n if (att.dameValor() == valor) {\n //Guardamos el elemento que contiene el atributo\n this.consolaSalidaXPATH.push(objeto);\n //Esta linea de codigo para para verificar el nuevo punto de inicio de la consola final, para no redundar\n if (!this.controladorPredicadoInicio) {\n this.contadorConsola = this.consolaSalidaXPATH.length - 1;\n this.controladorPredicadoInicio = true;\n }\n } //Cierre comparacion valor\n } //Cierre comparacion nombre\n } //Ci\n }\n }\n else {\n //Si lo que se busca es una etiqueta en el predicado\n for (let entry of objeto.hijos) {\n //Recorremos cada uno de los hijos y verificamos el nombre de la etiqueta\n if (entry.dameID() == nombre) {\n //Sí hay concidencia, se procede a examinar si el valor es el buscado\n if (entry.dameValor().substring(1) == valor) {\n //Agregamos el objeto a la consola de salida\n this.consolaSalidaXPATH.push(objeto);\n //Al iguar que n fragmento anteriores, se establece el nuevo punto de inicio\n if (!this.controladorPredicadoInicio) {\n this.contadorConsola = this.consolaSalidaXPATH.length - 1;\n this.controladorPredicadoInicio = true;\n } //cierreControladorInicio\n } //CIERRE VALOR\n } //CIERREID\n } //CIERRE RECORRIDO DE HIJOS\n }\n //La siguiente linea comentada es para recursividad, pendiente de uso.\n }", "function ohodnot(frm)\r\n{\r\n\t// \r\n\t// nazov class pomocou ktorej sa hladaju input elementy\r\n\tvar MOZNOST_CLASS_NAME = 'odpoved';\r\n\r\n\t//\r\n\t// nazov triedy, ktorou bude oznaceny rodicovsky element spravnej odpovede\r\n\tvar SPRAVNA_CLASS_NAME = 'spravna';\r\n\t\r\n\t//\r\n\t// nazov triedy, ktorou bude oznaceny rodicovsky element spravnej odpovede\r\n\tvar NESPRAVNA_CLASS_NAME = 'nespravna';\t\r\n\r\n\r\n\t// \r\n\t// najdi vsetky odpovede\r\n\tvar odpovede = document.getElementsByClassName( MOZNOST_CLASS_NAME, frm);\r\n\t\r\n\t//\r\n\t// ziskaj z nich unique zoznam \"name\"\r\n\tvar nazvy = Array();\r\n\todpovede.each(function (item) { \r\n\t\tnazvy.push(item.name); \r\n\t});\r\n\tnazvy = nazvy.uniq();\r\n\t\r\n\t// \r\n\t// over ci su vsetky zaskrtnute\r\n\tfor (var i=0; i<nazvy.length; i++) {\r\n\t\tvar nazov = nazvy[i];\r\n\t\t\r\n\t\t\t\t\r\n\t\t// zoznam item v nich\r\n\t\tvar moznosti = frm.getInputs('radio', nazov);\r\n\t\t\r\n\t\t// prelistuj ich a zisti ci je aspon 1 zaskrtnuty (viac nemoze byt, lebo maju rovnake meno)\r\n\t\tvar zaskrtnute = false;\r\n\t\tvar spravne_moznosti = 0;\r\n\t\tmoznosti.each(function (moznost) {\r\n\t\t\tif (moznost.checked) {\r\n\t\t\t\tzaskrtnute = true;\r\n\t\t\t}\r\n\t\t\tif (moznost.value == 1) {\t\r\n\t\t\t\tspravne_moznosti++;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t// ak nie je zakrtnuty, tak zrus validaciu\r\n\t\tif (!zaskrtnute) {\r\n\t\t\talert('Musíte zodpovedať všetky otázky!');\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\n\t\tdocument.getElementById(nazov).style.visibility = 'visible';\r\n\t\t//\r\n\t\t// ak otazka nema ani jednu spravnu odpoved v kode, alebo ma viac moznosti\r\n\t\t// upozorni autora\r\n\t\tif (spravne_moznosti != 1) {\r\n\t\t\tif (spravne_moznosti > 1) {\r\n\t\t\t\talert('Otazka s parametrom name: '+ nazov + ' musi mat len 1 spravnu odpoved!');\r\n\t\t\t} else {\r\n\t\t\t\talert('Otazka s parametrom name: '+ nazov + ' musi mat 1 spravnu odpoved !');\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t};\r\n\t\r\n\t//\r\n\t// statistiky vyhodnocovania\r\n\tvar pocet_otazok = nazvy.length;\r\n\tvar pocet_nespravnych = 0;\r\n\tvar pocet_spravnych = 0;\r\n\t\r\n\t// \r\n\t// vyhodnot jednotlive moznosti\r\n\tnazvy.each(function (nazov) {\r\n\t\t\r\n\t\t// zoznam item v nich\r\n\t\tvar moznosti = frm.getInputs('radio', nazov);\r\n\t\t\r\n\t\t// prelistuj a ohodnot\r\n\t\tmoznosti.each(function (moznost) {\r\n\t\t\tif (moznost.checked) {\r\n\t\t\t\tif (moznost.value == 1) {\r\n\t\t\t\t\tpocet_spravnych++;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpocet_nespravnych++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\t\r\n\t// \r\n\t// zvyrazni spravne a nespravne vysledky\r\n\tnazvy.each(function (nazov) {\r\n\t\t\r\n\t\t// zoznam item v nich\r\n\t\tvar moznosti = frm.getInputs('radio', nazov);\r\n\t\t\r\n\t\t// prelistuj a ohodnot\r\n\t\tmoznosti.each(function (moznost) {\r\n\t\t\r\n\t\t\t// odstran predchadzajuce\r\n\t\t\tmoznost.parentNode.removeClassName(SPRAVNA_CLASS_NAME);\t\t\t\r\n\t\t\tmoznost.parentNode.removeClassName(NESPRAVNA_CLASS_NAME);\r\n\t\t\t\r\n\t\t\tif (moznost.checked) {\r\n\t\t\t\tif (moznost.value == 1) {\r\n\t\t\t\t\t// spravna odpoved + celkovo spravna\r\n\t\t\t\t\tmoznost.parentNode.addClassName(SPRAVNA_CLASS_NAME);\r\n\t\t\t\t\tmoznost.parentNode.parentNode.removeClassName(NESPRAVNA_CLASS_NAME);\r\n\t\t\t\t\tmoznost.parentNode.parentNode.removeClassName('otazka');\r\n\t\t\t\t\tmoznost.parentNode.parentNode.addClassName('otazka'+SPRAVNA_CLASS_NAME);\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// nespravna odpoved + celkovo nespravna\r\n\t\t\t\t\tmoznost.parentNode.addClassName(NESPRAVNA_CLASS_NAME);\r\n\t\t\t\t\tmoznost.parentNode.parentNode.removeClassName(SPRAVNA_CLASS_NAME);\r\n\t\t\t\t\tmoznost.parentNode.parentNode.removeClassName('otazka');\r\n\t\t\t\t\tmoznost.parentNode.parentNode.addClassName('otazka'+NESPRAVNA_CLASS_NAME);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (moznost.value == 1) {\r\n\t\t\t\t\t// spravna odpoved\r\n\t\t\t\t\tmoznost.parentNode.addClassName(SPRAVNA_CLASS_NAME);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\t\r\n\t//\r\n\t// zobraz vysledok za pomoci alert\r\n\tif (pocet_otazok == pocet_spravnych) {\r\n\t\talert('Gratulujem !!!, zodpovedali ste všetky otázky správne!');\r\n\t} else {\r\n\t\talert('Zodpovedali ste správne ' + pocet_spravnych + ' otázok z ' + pocet_otazok + ' možných.');\r\n\t}\r\n\t\r\n\t// \r\n\t// allways return false - do not redirect\r\n\treturn false;\r\n}", "nuevoCiclo() {\n let suma = 0;\n for (let i = 0; i < this.vecinos.length; i++) {\n if (this.vecinos[i].estado === 1) {\n suma++;\n }\n }\n\n // Aplicamos las normas\n this.estadoProx = this.estado; // Por defecto queda igual\n\n // Vida: tiene 3 vecinos\n if (this.estado === 0 && suma === 3) {\n this.estadoProx = 1;\n }\n\n // Muerte: menos de 2(soledad) o mas de 3 (inanicion)\n if (this.estado == 1 && (suma < 2 || suma > 3)) {\n this.estadoProx = 0;\n }\n }", "function proposer(element){\n\t\t\t\t\t\n\t\t\t\t\t// Si la couleur de fond est lightgreen, c'est qu'on a déja essayé - on quitte la fonction\n\t\t\t\t\tif(element.style.backgroundColor==\"lightGreen\" ||fini) return;\n\t\t\t\t\t\n\t\t\t\t\t// On récupere la lettre du clavier et on met la touche en lightgreen (pour signaler qu'elle est cliqu�e)\n\t\t\t\t\tvar lettre=element.innerHTML;\n\t\t\t\t\tchangeCouleur(element,\"lightGrey\");\n\t\t\t\t\t\n\t\t\t\t\t// On met la variable trouve false;\n\t\t\t\t\tvar trouve=false;\n\t\t\t\t\t\n\t\t\t\t\t// On parcours chaque lettre du mot, on cherche si on trouve la lettre s�l�ectionn�e au clavier\n\t\t\t\t\tfor(var i=0; i<tailleMot; i++) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Si c'est le cas :\n\t\t\t\t\t\tif(tableauMot[i].innerHTML==lettre) {\n\t\t\t\t\t\t\ttableauMot[i].style.visibility='visible';\t// On affiche la lettre\n\t\t\t\t\t\t\ttrouve=true;\n\t\t\t\t\t\t\tlettresTrouvees++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Si la lettre n'est pas présente, trouve vaut toujours false :\n\t\t\t\t\tif(!trouve){\n\t\t\t\t\t\tcoupsManques++;\n\t\t\t\t\t\tdocument.images['pendu'].src=\"asset/image/pendu_\"+coupsManques+\".jpg\"; // On change l'image du pendu\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Si on a rate 9 fois :\n\t\t\t\t\t\tif(coupsManques==8){\n\t\t\t\t\t\t\talert(\"Vous avez perdu !\");\n\t\t\t\t\t\t\tfor(var i=0; i<tailleMot; i++) tableauMot[i].style.visibility='visible';\n\t\t\t\t\t\t\tfini=true;\n\t\t\t\t\t\t\t// on affiche le mot, on fini le jeu\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(lettresTrouvees==tailleMot){\n\t\t\t\t\t\talert(\"Bravo ! Vous avez découvert le mot secret !\");\n\t\t\t\t\t\tfini=true;\n\t\t\t\t\t}\n\t\t\t\t}", "cambio(){\n\n productos.forEach(producto => {\n if(producto.nombre === this.productoSeleccionado) this.productoActual = producto;\n });\n\n //Ver si el producto actual tiene varios precios\n if(this.productoActual.variosPrecios){\n //Verificar si sobrepasa algun precio extra\n\n //Si es menor al tope del primer precio\n if(this.cantidadActual < this.productoActual.precios.primerPrecio.hasta){\n this.precioActual = this.productoActual.precios.primerPrecio.precio;\n //Seteamos el precio tachado a 0 de nuevo\n this.precioPorUnidadTachado = 0;\n }\n //Si es mayor o igual al tope del primer precio pero menor al tope del segundo\n else if(this.cantidadActual >= this.productoActual.precios.primerPrecio.hasta && this.cantidadActual < this.productoActual.precios.segundoPrecio.hasta){\n this.precioActual = this.productoActual.precios.segundoPrecio.precio;\n //Asignamos un nuevo precio tachado\n this.precioPorUnidadTachado = this.productoActual.precios.primerPrecio.precio;\n }\n //Si es igual o mayor al tope del segundo precio\n else if(this.cantidadActual >= this.productoActual.precios.segundoPrecio.hasta){\n this.precioActual = this.productoActual.precios.tercerPrecio.precio;\n //Asignamos un nuevo precio tachado\n this.precioPorUnidadTachado = this.productoActual.precios.primerPrecio.precio;\n }\n }\n }", "function ustawId(pole) {\r\n aktualnePole = pole.id; \r\n aktualnaWartosc = pole.value;\r\n}", "function siamoNellaPrimaSettimana() {\n return indiceSettimana == 0;\n }", "verificarPerdida(){\n if(this.grillaLlena()){\n let aux = this.clone();\n aux.grafica = new GraficaInactiva();\n //simulo movimiento a derecha\n aux.mover(new MovimientoDerecha(aux));\n if(aux.compareTo(this)){\n //simulo movimiento a izquierda\n aux.mover(new MovimientoIzquierda(aux));\n if(aux.compareTo(this)){\n //simulo movimiento a abajo\n aux.mover(new MovimientoAbajo(aux));\n if(aux.compareTo(this)){ \n //simulo movimiento a arriba\n aux.mover(new MovimientoArriba(aux));\n if(aux.compareTo(this))\n this.grafica.setPerdida();\n }\n } \n }\n }\n }", "function prikaziRezultat(){\n\n const tajmer = document.querySelector('#tajmer'); \n tajmer.style.display = \"none\";\n clearInterval(interval);\n\n let brTacnih=0;\n //const sviOdgovori = kvizDiv.querySelectorAll('.odgovori');\n\n pitanja.forEach(function(trenutnoPitanje, pitanjeIdn){\n const selektor = `input[name=odgovor${pitanjeIdn}]:checked`;\n const odgovoreno = (document.querySelector(selektor) || {}).value;\n\n console.log(odgovoreno, trenutnoPitanje.tacanOdgovor);\n\n //smjestanje pitanja u niz i pozivanje pojedinacnog\n const nizPitanja = document.querySelectorAll('.pitanje');\n const pojedinacnoPitanje = nizPitanja[pitanjeIdn];\n\n if(odgovoreno === trenutnoPitanje.tacanOdgovor){\n brTacnih++;\n pojedinacnoPitanje.classList.add('tacno_pitanje'); \n } else {\n pojedinacnoPitanje.classList.add('netacno_pitanje'); \n }\n });\n\n\n rezultatDiv.innerHTML = `Rezultat: <h3>${brTacnih} od ${pitanja.length}</h3>`\n}", "function ocen_statycznie()\n{\n return szachownica.ocena.material + (szachownica.ocena.faza_gry * szachownica.ocena.tablice + (70 - szachownica.ocena.faza_gry) * szachownica.ocena.tablice_koncowka) * 0.03;\n}", "function continuaEscriure ()\r\n{\r\n this.borra ();\r\n this.actual=\"\";\r\n this.validate=0;\r\n}", "function loadCorPri(idP) {\n var dilon=JSON.stringify(carRec[idP]);\n var noop = JSON.parse(dilon);\n $(\"#misdatosPri\").empty();\n $(\"#misdatosPri\").append(\n \" <h4>Destinatario: \"+noop.destino+\"</h4>\",\n \" <h4>Mensaje: \"+noop.mensaje+\"</h4>\",\n \" <h4>Fecha: \"+noop.fecha+\"</h4>\" \n );\n }", "function extraerNodoP(){\r\n\tvar nuevo = this.raiz;\r\n\tif(!this.vacia()){\r\n\t\tthis.raiz = this.raiz.sig;\r\n\t\t//window.alert(nuevo.nombre);\r\n\t}\r\n\treturn nuevo;\r\n\t\r\n}", "function AjPoFo() {\r\n \r\n if (perso.Por < 2) { //Test si assez d'argent\r\n alert(\"Vous n'avez pas assez d'argent\");\r\n console.log(\"Pas assez d'argent / nombre de potion = \"+ perso.Pinv[0]);\r\n } else {\r\n perso.Por -= 2; //Or du perso -2\r\n perso.Pinv[0] += 1; //Nombre de potion +1 \r\n document.getElementById('or').value = perso.Por; //affiche Or du perso dans la div caracteristique\r\n document.getElementById('nbPoFo').value = perso.Pinv[0]; //affiche le nombre de potion\r\n console.log(\"Achat d'une potion de force / nombre de potion = \"+ perso.Pinv[0]);\r\n }\r\n\r\n}", "function IndicadorRangoEdad () {}", "function condiçaoVitoria(){}", "popuniIzvjestaj() {\n this.vrijednost = Util.getRandomFloatIn(2, 10);\n this.vrijemeObroka = Util.randomDate(new Date(2012, 0, 1), new Date());\n }", "function comprovarEscriu () {\r\n this.validate=1;\r\n index=cerca(this.paraules,this.actual);\r\n this.capa.innerHTML=\"\";\r\n if (index != -1) {\r\n paraula = this.paraules[index];\r\n this.putImg (this.dirImg+\"/\"+paraula.imatge);\r\n this.capa.innerHTML += \"<br>\" + this.paraules[index].paraula.toUpperCase();\r\n this.putSound (paraula.so);\r\n this.ant = this.actual;\r\n this.actual = \"\";\r\n }\r\n else {\r\n this.putImg (\"imatges/error.gif\");\r\n this.putSound (\"so/error.wav\");\r\n this.actual = \"\";\r\n }\r\n}", "function desclickear(e){\n movible = false;\n figura = null;\n}", "function coherencia(objeto){\n // extrae las variables nesesarias para la evaluacion\n var estructura= objeto.structure;\n var nivelagregacion=objeto.aggregationlevel;\n var tipointeractividad=objeto.interactivitytype; \n var nivelinteractivo=objeto.interactivitylevel;\n var tiporecursoeducativo=objeto.learningresourcetype;\n \n //inicializa las reglas y las variables de los pesos\n var r=0;\n var pesor1=0;\n var pesor2=0;\n var pesor3=0;\n\n //verifica las reglas que se van a evaluar\n if (estructura===\"atomic\" && nivelagregacion===\"1\"){\n r++;\n pesor1=1;\n }else if (estructura===\"atomic\" && nivelagregacion===\"2\"){\n r++;\n pesor1=0.5;\n }else if (estructura===\"atomic\" && nivelagregacion===\"3\"){\n r++;\n pesor1=0.25;\n }else if (estructura===\"atomic\" && nivelagregacion===\"4\"){\n r++;\n pesor1=0.125;\n }else if (estructura===\"collection\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5;\n }else if (estructura===\"networked\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"hierarchical\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"linear\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"collection\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"networked\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"hierarchical\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"linear\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion ===\"4\") ){\n r++;\n pesor1=1; \n }\n\n if (tipointeractividad===\"active\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\" || \n nivelinteractivo===\"medium\" || \n nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n $r++;\n $pesor2=1; \n }else if (tipointeractividad===\"mixed\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\" || \n nivelinteractivo===\"medium\" || \n nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n r++;\n pesor2=1;\n }else if (tipointeractividad===\"expositive\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\") ){\n r++;\n pesor2=0;\n }else if (tipointeractividad===\"expositive\" && nivelinteractivo===\"medium\" ){\n r++;\n pesor2=0.5;\n }else if (tipointeractividad===\"expositive\" && ( nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n r++;\n pesor2=1;\n } \n if ( tipointeractividad===\"active\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\") ){\n r++;\n pesor3=1; \n }else if (tiporecursoeducativo===\"active\" && (tiporecursoeducativo===\"diagram\" || \n tiporecursoeducativo===\"figure\" || \n tiporecursoeducativo===\"graph\" || \n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\") ){\n r++;\n pesor3=0;\n \n }else if (tipointeractividad===\"expositive\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\") ){\n r++;\n pesor3=0; \n }else if (tipointeractividad===\"expositive\" && (tiporecursoeducativo===\"diagram\" || \n tiporecursoeducativo===\"figure\" || \n tiporecursoeducativo===\"graph\" || \n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\") ){\n r++;\n pesor3=1;\n }else if (tipointeractividad===\"mixed\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\" ||\n tiporecursoeducativo===\"diagram\" ||\n tiporecursoeducativo===\"figure\" ||\n tiporecursoeducativo===\"graph\" ||\n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\" )){\n r++;\n pesor3=1; \n } \n m_coherencia=0;\n if (r>0) {\n\n // hace la sumatoria de los pesos \n m_coherencia= ( pesor1 + pesor2 + pesor3) / r;\n \n \n //alert(mensaje);\n return m_coherencia;\n //echo \"* Coherencia de: \". m_coherencia.\"; \". evaluacion.\"<br><br>\";\n }else{\n \n return m_coherencia;\n \n }\n\n\n }", "posZahtMet()\n {\n this.posZah=!this.posZah;\n }", "function botonPrecionado(peso) {\n\n switch (peso) {\n case 10:\n addPeso(peso);\n break;\n case 7.5://6.6\n addPeso(peso);\n break;\n case 4.3://3.3\n addPeso(peso);\n break;\n case 0:\n addPeso(peso);\n break;\n default:\n }\n indicePregunta++;\n if(indicePregunta < preguntas.length){\n cambiarPregunta();\n }\n else {\n analizarAptitudes();\n // document.getElementById(\"con1\").value = 1\n // document.getElementById(\"con2\").value = 1\n // document.getElementById(\"con3\").value = 1\n // document.getElementById(\"con4\").value = 1\n // document.getElementById(\"con5\").value = 1\n // document.getElementById(\"con6\").value = 1\n\n //enviar resultados a\n document.getElementById(\"voc-form\").submit();\n\n }\n }", "function obliczPunkty(dane)\n{\n var ro = 1.21; // gęstośc czynnika\n var stosunek_et = [0.86, 0.98, 1, 0.966, 0.86]; // stosunek sprawności izentropowych\n\n var mi0 = (1 - (Math.sqrt(Math.sin(dane.beta2 * (Math.PI / 180))) / (Math.pow(dane.z, 0.7)))).toPrecision(3); // współczynnik zmniejszenia mocy wentylatora\n var u2 = ((dane.D2 * Math.PI * dane.n) / 60).toPrecision(3); // prędkość obwodowa wirnika\n var c2u = ((dane.deltapzn * 1000) / (ro * u2 * dane.etazn)).toPrecision(3); // prędkość zależna od ułopatkowania wirnika\n var fi2r = ((c2u * Math.tan(dane.alfa2 * Math.PI / 180)) / u2).toPrecision(3); // wskaźnik prędkości koła wirnikowego\n var fi2r0 = ((mi0 * fi2r) / (mi0 - (c2u / u2))).toPrecision(3); // wartośc wskaznika prędkości koła wirnikowego dla wartości zerowej charakterystyki koła wirnikowego\n var Qmax = (dane.Qzn * (fi2r0 / fi2r)).toPrecision(3); // przepływ maksymalny\n\n var krok = 0.6;\n\n var daneDoWykresu = {};\n daneDoWykresu.deltap = []; // tablica wartości sprężu (deltap)\n daneDoWykresu.Q = []; // tablica wartości wydajności\n daneDoWykresu.Q = []; // tablica wartości wydajności\n daneDoWykresu.eta = []; // etazn * stosunek_et\n\tdaneDoWykresu.wspQ = []; //współczynnik Q: 1-Q/Qmax\n\tdaneDoWykresu.mp = [] ; // tablica wartości mocy pobieranej\n\t\n /* obliczanie punktów charakterystyk */\n\t\n for (var i = 0; i < 5; i++)\n\t{\n daneDoWykresu.Q[i] = krok * dane.Qzn;\n daneDoWykresu.wspQ[i] = 1 - (daneDoWykresu.Q[i] / Qmax);\n daneDoWykresu.eta[i] = dane.etazn * stosunek_et[i];\n\t\tdaneDoWykresu.deltap[i] =((293/(273+dane.tc))*((ro * (Math.pow(u2, 2)) * mi0 * daneDoWykresu.wspQ[i] * daneDoWykresu.eta[i])) / 1000); // kPa\n\t\tdaneDoWykresu.mp[i] = ((daneDoWykresu.Q[i]*daneDoWykresu.deltap[i])/(daneDoWykresu.eta[i]*dane.etas))/100; // kW/100\n krok += 0.2;\n }\n return daneDoWykresu;\n}", "ispisiMi(){\r\n console.log(this.prefektura + \" \" + this.glavniGrad + \" \" + this.region + \" \" + this.ostrvo + \" \" + this.brojStanovnika);\r\n}", "function IA_sacrifier(){\n\t\t // IA sacrifie la carte de plus haut cout d'invocation\n\t\t //SSI aucune carte vide\n\t\t \n\t\t no=rechercherIdxCarteAdvCoutMax()\n\t\t if (no>=0){\n\t\t\tlaCarte = jeu_adv[no];\n\t\t \tsacrifierUneCarte(no,laCarte,false,true);\n\t\t}\n\t }", "function marcarComoReprovado(aluno) {\n aluno.reprovado = false;\n if(aluno.nota < 5){\n aluno.reprovado = true;\n }\n}", "async function naVrsti() {\n // Preveri za konec igre\n let zm = await zmagovalec();\n if (zm != \"undefined\") {\n if (Number(zm) == igralec) {\n location.replace('/igra/zmaga');\n } else {\n location.replace('/igra/zguba');\n }\n return;\n }\n\n // Posodobi stanje bitke\n await zapolniTabelo();\n\n lahkoNapada = true;\n\n document.getElementById(\"besedilo\").innerText = \"Tunkaj ladje!\";\n document.getElementById(\"hnapad\").classList.add(\"border-info\");\n document.getElementById(\"hdomace\").classList.remove(\"border-info\");\n }", "function PrzedmiotKsztalceniaSzczegoly(PrzedmiotyKsztalceniaService, ZajeciaService, $stateParams, $state) {\n\t\t\t/*jshint validthis: true */\n this.przedmiot = {nazwaPrzedmiotu: undefined, opiekunPrzedmiotu: undefined };\n var vm = this;\n var id = $stateParams.id;\n vm.id = id;\n\n vm.load = function() {\n if (id.match(/^\\d+$/)) {\n PrzedmiotyKsztalceniaService.get({id: id}).$promise.then(function(response) {\n vm.przedmiot = {\n id: response.id,\n nazwaPrzedmiotu: response.nazwaPrzedmiotu,\n opiekunPrzedmiotu: response.opiekunPrzedmiotu.email,\n kodyZajec: _.map(\n _.filter(response.zajecia, function(z) {return z.kodZajec != null}),\n function(zajecie) {\n return zajecie.kodZajec\n }).join(', ')\n };\n }, function(reason) {\n console.log(\"fail get(1)\");\n vm.error = 'global_problem_server';\n });\n\n ZajeciaService.getKursy(id).then(function(response) {\n console.log(\"kursy = \", response);\n vm.kursy = response;\n }, function(reason) {\n console.log(\"Blad = \", reason);\n vm.error_kursy = 'global_problem_server';\n });\n\n ZajeciaService.getGrupaKursow(id).then(function(response) {\n console.log(\"grupa kursow = \", response);\n vm.grupaKursow = response;\n }, function(reason) {\n console.log(\"blad = \", reason);\n vm.error_grupa = 'global_problem_server';\n vm.grupaKursow = undefined;\n });\n }\n };\n\n\n vm.selectKurs = function(kurs) {\n vm.selectedKurs = kurs;\n };\n\n vm.deleteKurs = function(id) {\n // TODO Modal\n console.log('usun zajecie = ', id);\n ZajeciaService.deleteZajecie(id).then(function(response) {\n console.log('Usunieto zajecia');\n vm.load();\n }, function (reason) {\n console.log('Blad = ', reason);\n });\n };\n\n vm.deleteGrupa = function(id) {\n vm.deleteKurs(id);\n };\n\n this.selectPrzedmiot = function(przedmiot) {\n vm.selectedPrzedmiot = przedmiot;\n };\n\n this.deletePrzedmiot = function(id) {\n PrzedmiotyKsztalceniaService.delete({id: id}).$promise.then(function (response) {\n console.log('usunieto');\n $state.go('przedmioty-ksztalcenia');\n }, function (reason) {\n console.log('problem = ', reason);\n });\n };\n\n vm.load();\n\n }", "function copiafyv(principal, copia) {\n try {\n /*Analizo primero el root principal */\n principal.lista_Nodo.forEach(function (element) {\n if (element.tipo == \"Clase\") {\n MYFPrincipal = [];\n MYFfCopia = [];\n /*por cada calse encontrada, la busco en el otro arbol*/\n copia.lista_Nodo.forEach(function (element2) {\n if (element2.tipo == \"Clase\") {\n /*Por cada clase que encuentro en el otro root compruebo si son los mismos*/\n if (element.descripcion == element2.descripcion) {\n /*recorro para encontrar los metodos y funciones de la clase principal*/\n element.lista_Nodo.forEach(function (element3) {\n if (element3.tipo == \"Funcion\") {\n MYFPrincipal.push(element3.descripcion);\n /*encontramos si tiene parametros la funcion*/\n element3.lista_Nodo.forEach(function (parametrosMF) {\n if (parametrosMF.tipo == \"Parametros\") {\n var parametroslst = returnLst(parametrosMF.lista_Nodo);\n element2.lista_Nodo.forEach(function (fmCopia) {\n if (fmCopia.tipo == \"Funcion\" && element3.tipodato == fmCopia.tipodato) {\n fmCopia.lista_Nodo.forEach(function (paramCopia) {\n if (paramCopia.tipo == \"Parametros\") {\n var parametroslstCopia = returnLst(paramCopia.lista_Nodo);\n if (parametroslst.toString() == parametroslstCopia.toString()) {\n console.log(\"las funciones \" + element3.descripcion + \" Son iguales en ambos archivos,por tener los mismos tipos de parametros en el mismo orden\" + \" de la calse \" + element.descripcion);\n MYFfCopia_Clase.push(element.descripcion);\n MYFfCopia.push(element3.descripcion);\n }\n }\n });\n }\n });\n }\n });\n }\n else if (element3.tipo == \"Metodo\") {\n MYFPrincipal.push(element3.descripcion);\n /*encontramos si tiene parametros la funcion*/\n element3.lista_Nodo.forEach(function (parametrosF) {\n if (parametrosF.tipo == \"Parametros\") {\n var parametroslstM = returnLst(parametrosF.lista_Nodo);\n element2.lista_Nodo.forEach(function (mCopia) {\n if (mCopia.tipo == \"Metodo\" && element3.descripcion == mCopia.descripcion) {\n mCopia.lista_Nodo.forEach(function (paramCopiaM) {\n if (paramCopiaM.tipo == \"Parametros\") {\n var parametroslstCopiaM = returnLst(paramCopiaM.lista_Nodo);\n if (parametroslstM.toString() == parametroslstCopiaM.toString()) {\n console.log(\"los metodos \" + element3.descripcion + \" Son iguales en ambos archivos,por tener los mismos tipos de parametros en el mismo orden\" + \" de la calse \" + element.descripcion);\n MYFfCopia.push(element3.descripcion);\n MYFfCopia.push(element3.descripcion);\n }\n }\n });\n }\n });\n }\n });\n }\n });\n if (MYFPrincipal.toString() == MYFfCopia.toString()) {\n console.log(\"las clases \" + element.descripcion + \" Son iguales en ambos archivos\");\n }\n }\n }\n });\n }\n });\n }\n catch (error) {\n }\n}", "constructor(ojos, boca, extremidades, duenio) {\n super(ojos, boca, extremidades);\n this.duenio = duenio;\n this.estaDomesticado = true;\n }", "function jeu_piocherDsPaquet(me){\n\t\tmy_logger((me?PROMPT_ME:PROMPT_IA)+\" Piocher une carte\");\n\t\t//piocher la première carte du paquet\n\t\tpioche = paquet2.cartes.shift();\n\t\tcarte_piochee=JSON.parse(pioche);\n\t\t\n\t\t//Si carte adv => en jeu pour ADV\n\t\t//\t\tSSI nb carteADV en jeu <4\n\t\tme = !(etreCarteAdv(carte_piochee));\n\t\tcimetiere = (compterCarteEnjeu(me)>=4);\n\t\t\n\t\tidxDispo = trouverIndiceDispo(me);\n\t\t\n\t\tif (!cimetiere && idxDispo!=-1){\t\t\t\t\t\t\n\t\t\tctrCarte=(me?cc_jeuMe:cc_jeuAdv);\n\t\t\tmy_logger((me?PROMPT_ME:PROMPT_IA)+\" \"+carte_piochee.nom+\" mise en jeu pour \"+(me?\"me\":\"adv\")+ \" en \"+idxDispo);\n\t\t\t\n\t\t\t//créer une carte pour ADV et afficher\n\t\t\tposerCarteEnJeu(carte_piochee,me,idxDispo);\n\t\t\t\n\t\t\tif (me){\n\t\t\t\tjeu_me[idxDispo]=carte_piochee;\n\t\t\t\tcc_jeuMe++;\n\t\t\t}else{\n\t\t\t\tjeu_adv[idxDispo]=carte_piochee;\n\t\t\t\tcc_jeuAdv++;\n\t\t\t}\t\t\t\t\t\t\n\t\t}else{\n\t\t\tsacrifierUneCarte(-1,carte_piochee,me,true);\n\n\t\t\talert((me?PROMPT_ME:PROMPT_IA)+\" \"+carte_piochee.nom+\" placée ds cimetière !\");\n\t\t}\n\t\tif (me){\n\t\t\tnbc_paquet_me--;\n\t\t}else{\n\t\t\tnbc_paquet_adv--;\n\t\t}\n\t }", "function _GeraPontosDeVida(modo, submodo) {\n if (modo != 'personagem' && modo != 'elite' && modo != 'comum') {\n Mensagem(Traduz('Modo') + ' ' + modo + ' ' + Traduz('invalido') + '. ' + Traduz('Deve ser elite, comum ou personagem.'));\n return;\n }\n // Para cada classe, rolar o dado.\n var total_pontos_vida = 0;\n // Primeiro eh diferente na elite e personagem.\n var primeiro = (modo == 'comum') ? false : true;\n for (var i = 0; i < gPersonagem.classes.length; ++i) {\n var info_classe = gPersonagem.classes[i];\n for (var j = 0; j < info_classe.nivel; ++j) {\n var pontos_vida_nivel = 0;\n var template_personagem = PersonagemTemplate();\n var dados_vida = template_personagem != null && 'dados_vida' in template_personagem ?\n template_personagem.dados_vida :\n tabelas_classes[info_classe.classe].dados_vida;\n if (primeiro) {\n if (modo == 'elite') {\n pontos_vida_nivel = dados_vida;\n } else if (modo == 'personagem') {\n // O modificador de constituicao eh subtraido aqui pq sera adicionado\n // no calculo de pontos de vida, nos bonus.\n pontos_vida_nivel = dados_vida +\n gPersonagem.atributos['constituicao'].valor -\n gPersonagem.atributos['constituicao'].modificador;\n } else {\n pontos_vida_nivel = submodo == 'tabelado' ? dados_vida / 2 : Rola(1, dados_vida);\n }\n primeiro = false;\n } else {\n pontos_vida_nivel = submodo == 'tabelado' ? dados_vida / 2 : Rola(1, dados_vida);\n\n }\n // Nunca pode ganhar menos de 1 ponto por nivel.\n if (pontos_vida_nivel < 1) {\n pontos_vida_nivel = 1;\n }\n total_pontos_vida += pontos_vida_nivel;\n }\n }\n gPersonagem.pontos_vida.total_dados = Math.floor(total_pontos_vida);\n}", "ajuste_potencia(){\n if (this.energia_disponible()){\n let danio_total = this.calcular_danio_total();\n let inyect_total = this.inyectores_disponibles();\n let plasma_inyector = (danio_total+this._plasma_requerido - inyect_total * limit_plasma)/this.inyectores_disponibles();\n for (let i = 0; i < this._injectores.length; i++) {\n if (this._injectores[i]._danio_por!==100){\n if (plasma_inyector<0){\n this._injectores[i].set_plasma = this._injectores[i].calcular_poder()+plasma_inyector;\n } else {\n this._injectores[i].set_plasma = this._injectores[i].calcular_poder();\n this._injectores[i].set_extra_plasma = plasma_inyector;\n\n }\n }\n }\n this._potencia_disponible = true;\n } else {\n this._potencia_disponible = false;\n\n }\n }", "esconder(){\n console.log(`${this._nombre} corre a ${this._velocidad}m/s y da un salto de ${this._salto}m y se esconde`)\n }", "estavacio()\r\n{\r\n //regresa verdadero si la cola esta vacia\r\n return this.items.length == 0;\r\n}", "function uspjesnost() {\n let brojRijesenih = 0;\n let procenat = 0;\n\n zadaci.forEach(zadatak => {\n if (zadatak.zavrsen === true) {\n brojRijesenih++;\n }\n })\n procenat = ((brojRijesenih / zadaci.length) * 100).toFixed(2);\n\n if (procenat < 50) {\n document.getElementById(\"uspesnost\").style.color = \"#DC143C\";\n } else {\n document.getElementById(\"uspesnost\").style.color = \"#00AD56\";\n }\n if (zadaci.length == 0) {\n document.getElementById('uspesnost').innerHTML = '';\n } else {\n document.getElementById('uspesnost').innerHTML = '<h6>Uspjesnost: ' + procenat + '%</h6>';\n }\n}", "getBuscaProfundidade(verticeEscolhido) {\n\t\tif(this.trep == 1) {\n\t\t\tlet lista = this.getRepresentacao()\n\t\t\tlet quantVertice = this.getQNos()\n\t\t\tlet principal = verticeEscolhido\n\t\t\tlet backtracking = [];\n\t\t\tlet buscaProf = [];\n\t\t\tlet arrayVertices = [];\n\t\t\tlet tempo = 0;\n\n\t\t //Criação de uma lista de array contendo todos os vertices diferentes do\n\t\t //vertice escolhido pelo usuário\n\t\t for(let i = 0; i < quantVertice; i++) {\n\t\t \tif(verticeEscolhido != i) arrayVertices.push(i);\n\t\t }\n\t\t /*Estrutura auxiliar de array bidimensional contendo na primeira posição da\n\t\t segunda dimensão um objeto tendo cor, tempo da primeira passagem,\n\t\t tempo da segunda passagem e antecessor. Na segunda posição da mesma dimensão a grafo*/\n\t\t for(let i = 0; i < quantVertice; i++){\n\t\t \tbuscaProf[i] = {\n\t\t \t\tcor: \"branco\",\n\t\t \t\ttempoInicial: \"indef\",\n\t\t \t\ttempoFinal: \"indef\",\n\t\t \t\tantecessor: \"indef\",\n\t\t \t\tadj: lista[i]\n\t\t \t}\n\t\t }\n while(arrayVertices.length > 0){\n\n\t\t \tif(buscaProf[verticeEscolhido].cor == \"branco\"){\n\n\t\t \t\tbuscaProf[verticeEscolhido].cor = \"cinza\"\n\t\t \t\tbuscaProf[verticeEscolhido].tempoInicial = ++tempo\n\t\t \t\tbuscaProf[verticeEscolhido].antecessor = null\n\n\t\t \t\tbacktracking.push(verticeEscolhido);\n\n\t\t \t\tvar verticeSecundario\n\n\t\t \t\twhile(backtracking.length > 0){\n\n\t\t \t\t\tif(buscaProf[verticeEscolhido].adj.length > 0){\n\n\t\t \t\t\t\tverticeSecundario = buscaProf[verticeEscolhido].adj.shift().vertice;\n\n\t\t \t\t\t\tif(buscaProf[verticeSecundario].cor == \"branco\"){\n\n\t\t \t\t\t\t\tbuscaProf[verticeSecundario].cor = \"cinza\"\n\t\t \t\t\t\t\tbuscaProf[verticeSecundario].tempoInicial = ++tempo\n\t\t \t\t\t\t\tbuscaProf[verticeSecundario].antecessor = verticeEscolhido\n\t\t \t\t\t\t\tbacktracking.push(verticeEscolhido)\n\t\t \t\t\t\t\tverticeEscolhido = verticeSecundario\n\t\t \t\t\t\t}\n\n\n\t\t \t\t\t}\n\t\t \t\t\telse{\n\t\t \t\t\t\tbuscaProf[verticeEscolhido].cor = \"preto\"\n\t\t \t\t\t\tbuscaProf[verticeEscolhido].tempoFinal = ++tempo\n\t\t \t\t\t\tverticeEscolhido = backtracking.pop()\n\n\t\t \t\t\t}\n\t\t \t\t}\n\n\t\t \t}\n\t\t \tverticeEscolhido = arrayVertices.shift();\n\t\t }\n\n\t\t buscaProf[principal].antecessor = null\n\n\t\t return buscaProf;\n\t\t}\n\t\telse {\n\t\t\tlet matriz = this.getRepresentacao()\n\t\t\tlet quantVertice = this.getQNos()\n\t\t\tlet principal = verticeEscolhido\n\t\t\tlet backtracking = []\n\t\t\tlet buscaProf = []\n\t\t\tlet arrayVertices = []\n\t\t\tlet tempo = 0\n\n\t\t\tfor(let i = 0; i < quantVertice; i++) {\n\t\t\t\tif(verticeEscolhido != i) arrayVertices.push(i);\n\t\t\t}\n\n\t\t\tfor(let j = 0; j < quantVertice; j++){\n\t\t\t\tvar obj = {\n\t\t\t\t\tcor: \"branco\",\n\t\t\t\t\ttempoInicial: \"indef\",\n\t\t\t\t\ttempoFinal: \"indef\",\n\t\t\t\t\tantecessor: \"indef\"\n\t\t\t\t}\n\t\t\t\tbuscaProf[j] = obj\n\t\t\t}\n //contador de vertices, recebe a quantidade de vértices - 1, para ir até o penúltimo na busca\n\t\t\tlet contVert = quantVertice - 1\n\n\t\t\twhile(contVert > 0){\n\t\t\t\tif(buscaProf[verticeEscolhido].cor == \"branco\"){\n\t\t\t\t\tbuscaProf[verticeEscolhido].cor = \"cinza\"\n\t\t\t\t\tbuscaProf[verticeEscolhido].tempoInicial = ++tempo\n\t\t\t\t\tbuscaProf[verticeEscolhido].antecessor = null\n\n\t\t\t\t\tbacktracking.push(verticeEscolhido)\n\n\t\t\t\t\tvar verticeSecundario\n\n\n\t\t\t\t\twhile(backtracking.length > 0){\n\n\t\t\t\t\t\tfor(verticeSecundario = 0; verticeSecundario < quantVertice; verticeSecundario++){\n\t\t\t\t\t\t\tif(matriz[verticeEscolhido][verticeSecundario] != \"inf\"){\n\t\t\t\t\t\t\t\tif(buscaProf[verticeSecundario].cor == \"branco\"){\n\t\t\t\t\t\t\t\t\tbuscaProf[verticeSecundario].cor = \"cinza\"\n\t\t\t\t\t\t\t\t\tbuscaProf[verticeSecundario].tempoInicial = ++tempo\n\t\t\t\t\t\t\t\t\tbuscaProf[verticeSecundario].antecessor = verticeEscolhido\n\n\t\t\t\t\t\t\t\t\tbacktracking.push(verticeEscolhido)\n\t\t\t\t\t\t\t\t\tverticeEscolhido = verticeSecundario\n\t\t\t\t\t\t\t\t\tbreak\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\n\t\t\t\t\t\tif(verticeSecundario == quantVertice){\n\t\t\t\t\t\t\tbuscaProf[verticeEscolhido].cor = \"preto\"\n\t\t\t\t\t\t\tbuscaProf[verticeEscolhido].tempoFinal = ++tempo\n\t\t\t\t\t\t\tverticeEscolhido = backtracking.pop()\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tverticeEscolhido = arrayVertices.shift();\n\t\t\t\tcontVert--\n\t\t\t}\n\n\t\t\tbuscaProf[principal].antecessor = null\n\t\t\treturn buscaProf\n\t\t}\n }", "function verificarServicio(objeto){\n\t\tvalorBS=$(objeto).val();\n\t\t/**OBTENENEMOS CANTIDAD SI EXISTE GUIAS DE REMISION RELACIONADAS**/\n\t\tvar total=$('input[id^=\"accionAsociacionGuiarem\"][value!=\"0\"]').length;\n\t\tif(total>0){\n\t\t\t/**si es servicio***/\n\t\t\tif(valorBS=='S'){\n\t\t\t\tdocument.getElementById(\"buscar_producto\").readOnly = false;\n\t\t\t\t$(\"#idDivAgregarProducto\").show(200);\n\t\t\t}\n\t\t\t/**si es Bien**/\n\t\t\tif(valorBS=='B'){\n\t\t\t\tdocument.getElementById(\"buscar_producto\").readOnly = true;\n\t\t\t\t$(\"#idDivAgregarProducto\").hide(200);\n\t\t\t}\n\t\t}\n\t}", "function posarBoleta(e) {\r\n// console.log(\"has clicat el \"+ e.target.getAttribute('id'));\r\n if (numDeClics==0) {\r\n //si guanya\r\n if (e.target.getAttribute('id')==aleatorio) {\r\n resultat(\"guany\", \"Felicitats :)\");\r\n // resultat(\"Felicitats :)\");\r\n //si perd\r\n }else{\r\n // resultat(\"Torna a provar! :S\");\r\n resultat(\"perd\", \"Torna a provar! :S\");\r\n\r\n }\r\n numDeClics=numDeClics+1;\r\n }\r\n}", "LiberarPreso(valor){\nthis.liberation=valor;\n }", "function Komunalne() {}", "function wyzerujOdp() {\n for (var i = 0; i < liczbapytan; i++) {\n odpUzytkownika[i] = \"\";\n czyOdpowiedziano[i] = false;\n }\n}", "function sveikinuosi( funkcijosPavadinimas ){\n console.log(\"Labutaitis\");\n if (funkcijosPavadinimas != null && funkcijosPavadinimas != undefined) {\n funkcijosPavadinimas();\n }\n}", "privado(){\r\n if(this.persona.datosDecision.totalSemanasCotizadas >= 1250){\r\n this.todaLaVida();\r\n this.diezYears();\r\n let valorpensiontv = this.persona.datosLiquidacion.pIBLtv * 0.9;\r\n let valorpension10 = this.persona.datosLiquidacion.pIBL10A * 0.9;\r\n if(valorpensiontv >= valorpension10){\r\n this.datosLiquidacion.valorPensionDecreto = valorpensiontv;\r\n this.persona.regimen = \"Decreto 758 de 1990 - IBL Toda la Vida\";\r\n }else{\r\n this.datosLiquidacion.valorPensionDecreto = valorpension10;\r\n this.persona.regimen = \"Decreto 758 de 1990 - IBL 10 años >= 1250 semanas\";\r\n }\r\n }else{\r\n this.diezYears();\r\n this.montoPension10();\r\n this.persona.regimen = \"Decreto 758 de 1990 - IBL 10 años\";\r\n }\r\n this.ley797();\r\n if(!this.regimentr){\r\n this.persona.regimen = \"Ley 797 de 2003\";\r\n }\r\n }", "function voltooienObject(){\n\tafspelenGeluid(\"schroeven_compleet\");\n\tobjectenCompleet++;\n\tvolgenInstructies = false;\n}", "function escoltaPregunta ()\r\n{\r\n if(this.validate) {\r\n this.capa.innerHTML=\"\";\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.capa.innerHTML+=\"<br>\"+this.paraules[index].paraula.toUpperCase();\r\n this.putSound (this.paraules[index].so);\r\n }\r\n else {\r\n this.capa.innerHTML = \"\"\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.putSound (this.paraules[index].so);\r\n this.capa.innerHTML += \"<br>\" + this.actual+this.putCursor ('black');\r\n }\r\n}", "function constroiEventos(){}", "async function naCakanju() {\n lahkoNapada = false;\n document.getElementById(\"besedilo\").innerText = \"Cakaj nasprotnika!\";\n document.getElementById(\"hdomace\").classList.add(\"border-info\");\n document.getElementById(\"hnapad\").classList.remove(\"border-info\");\n\n // Zacni cakanje da je igralec na vrsti\n zacniCakanje(`/igra/naVrsti/${id_igre}/${igralec}`, naVrsti, (el) => el != 'false');\n }", "function retourDeMonClic(idClique)\r\n {\r\n \r\n // console.log(idClique)+\" = clic\";\r\n // ex: e1, c1 ...\r\n\r\n // Affiche et garde la première lettre (position 0)\r\n let premiereLettreDeId = idClique.charAt(0); // ex: e\r\n\r\n\r\n// *********** Objectif retirer la première lettre pour avoir le numéro de l'id \r\n \r\n // Remplacer c ou e par rien\r\n let numeroId = idClique.replace(premiereLettreDeId, \"\");\r\n\r\n\r\n // On / off \r\n // (si = e + int et première lettre égal à e)\r\n\r\n if(idClique== (premiereLettreDeId + numeroId) && (premiereLettreDeId == \"e\")){\r\n\r\n x = document.getElementById(idClique).parentNode.nodeName;\r\n // console.log(x +\" lien parent\") // DIV\r\n\r\n let PointageCibleOn=document.getElementById(\"tache\"+numeroId);\r\n // console.log(numeroId + \" : id cliqué !\");\r\n\r\n let cibleIcon=document.getElementById(\"ico\"+numeroId);\r\n\r\n // Ajout du fond vert \"tache\"+numeroId\r\n PointageCibleOn.style.backgroundColor=\"rgba(232, 255, 117, 1)\";\r\n\r\n\r\n // ajout de class pour le design css\r\n\r\n cibleIcon.setAttribute(\"class\",\"far fa-check-circle\");\r\n\r\n// *********** Chercher le key de maListeDesTaches qui contient comme id: x le id cliqué \r\n \r\n for (let a = 0; a < maListeDesTaches.length; a++) {\r\n const element = maListeDesTaches[a];\r\n // console.log(element);\r\n\r\n// *********** Etat à true (pour mémoriser la couleur et ico validé)\r\n\r\n if (maListeDesTaches[a].id==numeroId) {\r\n // alert(\"L'array \"+a+\" à la valeur\"+maListeDesTaches[a].tache);\r\n maListeDesTaches[a].etat=true;\r\n console.log(maListeDesTaches)\r\n\r\n // ****** storage à sauver (mis à jour)\r\n localStorage.setItem(\"donnesSauvegardees\", JSON.stringify(maListeDesTaches));\r\n\r\n // break fonctionne également\r\n return;\r\n }\r\n }\r\n\r\n }\r\n\r\n// *********** Supprimer le Div cliqué\r\n\r\n if(idClique== (premiereLettreDeId + numeroId) && (premiereLettreDeId == \"c\")){\r\n\r\n function supprimerDiv() {\r\n \r\n // pointer le div tache et son numéro\r\n let myobj = document.getElementById(\"tache\"+numeroId);\r\n console.log(numeroId + \" Numéro Id cliqué\")\r\n\r\n // supprime la cible\r\n myobj.remove();\r\n\r\n\r\n// *********** supprimer la clef de id cliqué de l'objet ******************************************************************************\r\n \r\n // Supprimer de mon tableau id correspondant 1 = le nombre entrée(s) à supprimer\r\n maListeDesTaches.splice(numeroId, 1);\r\n\r\n // ****** storage à sauver (mis à jour)\r\n localStorage.setItem(\"donnesSauvegardees\", JSON.stringify(maListeDesTaches));\r\n }\r\n\r\n // Appel fonction\r\n supprimerDiv();\r\n\r\n\r\n } // fin condition if\r\n } // fin retourDeMonClic", "function Combat_attaquePossible (Territoire1,Territoire2) {\r\n var voisin = Combat_estVoisin(Territoire1,Territoire2) ;\r\n var assezArmees = (Territoire1.army > 1) ;\r\n var voisinsDifferents = (Territoire1.proprietaire != Territoire2.proprietaire);\r\n if (voisin && assezArmees && voisinsDifferents){\r\n return true\r\n }\r\n else {\r\n return false\r\n }\r\n}", "function preberiMeritveVitalnihZnakov() {\n\tsessionId = getSessionId();\n \n \n\tvar ehrId = $(\"#meritveVitalnihZnakovEHRid\").val();\n\t\n\t// Spodaj poskrbimo da so vrednosti ponovno \"\", ko izberemo drugega pacienta\n\t//prav tako ponovno skrijemo vrednosti, tako da se pokazejo sele ob pritisku na gumb\n document.getElementById(\"wikiTextBloodPressure\").innerHTML = \"\";\n document.getElementById(\"wikiTextDeath\").innerHTML = \"\";\n document.getElementById(\"wikiTextItm\").innerHTML = \"\";\n document.getElementById(\"wikiTextTveganja\").innerHTML = \"\";\n document.getElementById(\"wikiTextZdravje\").innerHTML = \"\";\n $(\"#wikiTextTveganja2\").html(\"\"); //lazje kot document.getelement blabla\n $(\"#wikiDetails\").hide();\n\n\tif (!ehrId || ehrId.trim().length == 0 ) {\n\t\t$(\"#preberiMeritveVitalnihZnakovSporocilo\").html(\"<span class='obvestilo \" +\n \"label label-warning fade-in'>Prosim vnesite zahtevan podatek!\");\n\t} else {\n\t \n\t\n\t\t$.ajax({\n\t\t\turl: baseUrl + \"/demographics/ehr/\" + ehrId + \"/party\",\n\t \ttype: 'GET',\n\t \theaders: {\"Ehr-Session\": sessionId},\n\t \tsuccess: function (data) {\n\t\t\t\tvar party = data.party;\n\t\t\t\t\n\n\t\t\t\t//pridobimo srcni utrip\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t url: baseUrl + \"/view/\" + ehrId + \"/\" + \"pulse\",\n\t\t\t\t\t type: 'GET',\n\t\t\t\t\t headers: {\"Ehr-Session\": sessionId},\n\t\t\t\t\t success: function (res) {\n\t\t\t\t var hintUtrip = \"<br>\";\n\t\t\t\t \n\t\t\t\t if (res[res.length-1].pulse > 100)\n\t\t\t\t \thintUtrip += \"<p class='bg-danger'>Vaš srčni utrip je povišan. Optimalen srčni utrip znaša 50 - 100 /min</p>\"\n\t\t\t\t \telse if (res[res.length-1].pulse < 50)\n\t\t\t\t hintUtrip += \"<p class='bg-danger'>Vaš srčni utrip je nizek. Optimalen srčni utrip znaša 50 - 100 /min/p>\"\n\t\t\t\t else\n\t\t\t\t \thintUtrip += \"<p class='bg-success'> Vaš srčni utrip je optimalen </p>\"\n\t\t\t\t \n\t\t\t\t\t document.getElementById('utrip').innerHTML = \"Vaš srčni utrip znaša \" + res[res.length-1].pulse + \" /min\" + hintUtrip;\n\t\t\t\t\t document.getElementById('utripNumber').innerHTML = res[res.length-1].pulse;\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t preveri() //pri vsakem klicu gremo v funkcijo \"preveri\", katera caka da se izvedejo vsi tej klici, potem pa nadaljuje z graficnim prikazom\n\t\t\t\t\t \n\t\t\t\t\t },\n\t\t\t\t\t});\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//zacetek ajaxa za tezo\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t url: baseUrl + \"/view/\" + ehrId + \"/\" + \"weight\",\n\t\t\t\t\t type: 'GET',\n\t\t\t\t\t headers: {\"Ehr-Session\": sessionId},\n\t\t\t\t\t success: function (res) {\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t document.getElementById('teza').innerHTML = \"<p class='bg-info'>Vaša teža znaša \" + res[res.length-1].weight + \" kg </p>\"\n\t\t document.getElementById('tezaNumber').innerHTML = res[res.length-1].weight;\n\t\t preveri()\n\t\t\t\t\t },\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t//zacetek ajaxa za zgornji tlak\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t url: baseUrl + \"/view/\" + ehrId + \"/\" + \"blood_pressure\",\n\t\t\t\t\t type: 'GET',\n\t\t\t\t\t headers: {\"Ehr-Session\": sessionId},\n\t\t\t\t\t success: function (res) {\n\t\t\t\t\t var hintTlak = \"<br>\";\n\t\t\t\t\t \n\t\t\t\t\t \tif (res[res.length-1].systolic > 140)\n\t\t\t\t\t \t\thintTlak += \" <p class='bg-danger'>Vaš zgornji krvni tlak je povišan. Optimalen sistolični tlak znaša 100 - 140 mm Hg</p>\"\n\t\t\t\t\t \telse if (res[res.length-1].systolic < 100)\n\t\t\t\t\t \t\thintTlak += \" <p class='bg-danger'>Vaš zgornji krvni tlak je nizek. Optimalen sistolični tlak znaša 100 - 140 mm Hg</p>\"\n\t\t\t\t\t \telse\n\t\t\t\t\t \t\thintTlak += \"<p class='bg-success'>Vaš zgornji krvni tlak je optimalen </p>\"\n\t\t\t\t\t \t\n\t\t\t\t\t \t\n\t\t document.getElementById('zgornjiTlak').innerHTML = \"Vaš zgornji krvni pritisk znaša \" + res[res.length-1].systolic + \" mm Hg\" + hintTlak\n\t\t document.getElementById(\"zgornjiTlakNumber\").innerHTML = res[res.length-1].systolic;\n\t\t preveri()\n\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//zacetek ajaxa za spodnji tlak\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t url: baseUrl + \"/view/\" + ehrId + \"/\" + \"blood_pressure\",\n\t\t\t\t\t type: 'GET',\n\t\t\t\t\t headers: {\"Ehr-Session\": sessionId},\n\t\t\t\t\t success: function (res) {\n\t\t\t\t\t \tvar hintSpodnji = \"<br>\"\n\t\t\t\t\t \t\n\t\t\t\t\t \tif (res[res.length-1].diastolic > 90)\n\t\t\t\t\t \t\thintSpodnji += \" <p class='bg-danger'>Vaš spodnji krvni tlak je povišan. Optimalen diastolični tlak znaša 60 - 90 mm Hg</p>\"\n\t\t\t\t\t \telse if (res[res.length-1].systolic < 60)\n\t\t\t\t\t \t\thintSpodnji += \" <p class='bg-danger'>Vaš spodnji krvni tlak je nizek. Optimalen diastolični tlak znaša 60 - 90 mm Hg</p>\"\n\t\t\t\t\t \telse\n\t\t\t\t\t \t\thintSpodnji += \"<p class='bg-success'>Vaš spodnji krvni tlak je optimalen </p>\"\n\t\t document.getElementById('spodnjiTlak').innerHTML = \"Vaš spodnji krvni pritisk znaša \" + res[res.length-1].diastolic + \" mm Hg\" + hintSpodnji\n\t\t document.getElementById(\"spodnjiTlakNumber\").innerHTML = res[res.length-1].diastolic;\n\t\t preveri()\n\t\t\t\t\t },\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t//zacetek ajaxa za višino\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t url: baseUrl + \"/view/\" + ehrId + \"/\" + \"height\",\n\t\t\t\t\t type: 'GET',\n\t\t\t\t\t headers: {\"Ehr-Session\": sessionId},\n\t\t\t\t\t success: function (res) {\n\t\t\t\t\t \n\t\t document.getElementById('visina').innerHTML = \"<p class='bg-info'>Vaša višina znaša \" + res[res.length-1].height + \" cm</p>\"\n\t\t document.getElementById(\"visinaNumber\").innerHTML = res[res.length-1].height;\n\t\t preveri()\n\t\t\t\t\t },\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t$(\"#overall, #details, #friendlyTip\").show();\n\t\t\n\t\t\t\n\t\n\t\t\t\t\n\t \t},\n\t \n\t\t});\n\t}\n\t\n}", "async function testePionJouable(i, j, login, hote, adversaire){\n \n // si le client est l'adversaire, c'est le blanc\n if(login===adversaire){\n \n let pionIJ=await getPion(i, j, hote, adversaire);\n \n if ((pionIJ===PION_BLANC)||(pionIJ===DAME_BLANC)){\n // pion haut droit\n if ((j<9)&&(i>0)){\n let pion1 = await getPion(i-1, j+1, hote, adversaire);\n if(pion1!=null){\n if(pion1===SANS_PION) return true;\n }\n }\n \n // pion haut gauche\n if ((j>0)&&(i>0)){\n let pion2 = await getPion(i-1, j-1, hote, adversaire);\n if(pion2!=null){\n if(pion2===SANS_PION) return true;\n }\n }\n \n // pion haut droit mangeable\n if ((j<8)&&(i>1)){\n let pion3, pion4;\n pion3 = await getPion(i-2, j+2, hote, adversaire);\n pion4 = await getPion(i-1, j+1, hote, adversaire); \n if ((pion3!=null)&&(pion4!=null)){\n if ((pion3===SANS_PION)&&(pion4===PION_NOIR)) return true;\n }\n }\n \n // pion haut gauche mangeable\n if ((j>1)&&(i>1)){\n let pion5, pion6;\n pion5 = await getPion(i-2, j-2, hote, adversaire);\n pion6 = await getPion(i-1, j-1, hote, adversaire); \n if((pion5===SANS_PION)&&(pion6===PION_NOIR)) return true;\n }\n \n // pion haut droit mangeable\n if ((j<8)&&(i>1)){\n let pion7, pion8;\n pion7 = await getPion(i-2, j+2, hote, adversaire);\n pion8 = await getPion(i-1, j+1, hote, adversaire);\n if ((pion7===SANS_PION)&&(pion8===DAME_NOIR)) return true;\n }\n \n // pion haut gauche mangeable\n if ((j>1)&&(i>1)){\n let pion9, pion10;\n pion9 = await getPion(i-2, j-2, hote, adversaire);\n pion10 = await getPion(i-1, j-1, hote, adversaire);\n if((pion9===SANS_PION)&&(pion10===DAME_NOIR)) return true;\n }\n \n // si c'est une dame (deplacement ou on veut)\n if (pionIJ===DAME_BLANC){\n // pion bas droit\n if ((j<9)&&(i<9)){\n let pion11 = await getPion(i+1, j+1, hote, adversaire);\n if (pion11===SANS_PION) return true; \n }\n \n // pion bas gauche\n if ((j>0)&&(i<9)){\n let pion12 = await getPion(i+1, j-1, hote, adversaire);\n if (pion12===SANS_PION) return true;\n }\n \n // pion bas droit mangeable\n if ((j<8)&&(i<8)){\n let pion13 = await getPion(i+1, j+1, hote, adversaire);\n let pion14 = await getPion(i+2, j+2, hote, adversaire);\n if((pion13===PION_NOIR)&&(pion14===SANS_PION)) return true;\n }\n \n // pion bas gauche mangeable\n if ((j>1)&&(i<8)){\n let pion15 = await getPion(i+1, j-1, hote, adversaire);\n let pion16 = await getPion(i+2, j-2, hote, adversaire); \n if((pion15===PION_NOIR)&&(pion16===SANS_PION)) return true;\n }\n \n // dame bas droit mangeable\n if ((j<8)&&(i<8)){\n let pion17 = await getPion(i+1, j+1, hote, adversaire);\n let pion18 = await getPion(i+2, j+2, hote, adversaire);\n if ((pion17==DAME_NOIR)&&(pion18===SANS_PION)) return true;\n }\n \n // dame bas gauche mangeable\n if ((j>1)&&(i<8)){\n let pion19 = await getPion(i+1, j-1, hote, adversaire);\n let pion20 = await getPion(i+2, j-2, hote, adversaire);\n if((pion19===DAME_NOIR)&&(pion20===SANS_PION)) return true;\n }\n }\n }\n }\n \n // si le client est l'hote, cest le pion noir\n if(login===hote){\n \n let pionIJ=await getPion(i, j, hote, adversaire);\n \n if((pionIJ===PION_NOIR)||(pionIJ===DAME_NOIR)){\n // pion bas droit\n if ((j<9)&&(i<9)){\n let pion1 = await getPion(i+1, j+1, hote, adversaire);\n if(pion1===SANS_PION) return true;\n }\n \n // pion bas gauche\n if ((j>0)&&(i<9)){\n let pion2 = await getPion(i+1, j-1, hote, adversaire);\n if(pion2===SANS_PION) return true;\n }\n \n // pion bas droit mangeable\n if ((j<8)&&(i<8)){\n let pion3 = await getPion(i+1, j+1, hote, adversaire);\n let pion4 = await getPion(i+2, j+2, hote, adversaire);\n if((pion3===PION_BLANC)&&(pion4===SANS_PION)) return true;\n }\n \n // pion bas gauche mangeable\n if ((j>1)&&(i<8)){\n let pion5 = await getPion(i+1, j-1, hote, adversaire);\n let pion6 = await getPion(i+2, j-2, hote, adversaire);\n if((pion5===PION_BLANC)&&(pion6===SANS_PION)) return true;\n }\n \n // dame bas droit mangeable\n if ((j<8)&&(i<8)){\n let pion7 = await getPion(i+1, j+1, hote, adversaire);\n let pion8 = await getPion(i+2, j+2, hote, adversaire);\n if((pion7===DAME_BLANC)&&(pion8===SANS_PION)) return true;\n }\n \n // dame bas gauche mangeable\n if ((j>1)&&(i<8)){\n let pion9 = await getPion(i+1, j-1, hote, adversaire);\n let pion10 = await getPion(i+2, j-2, hote, adversaire);\n if((pion9===DAME_BLANC)&&(pion10===SANS_PION)) return true;\n }\n \n // si c'est une dame (deplacement ou on veut)\n if (pionIJ===DAME_NOIR){\n // pion haut droit\n if ((j<9)&&(i>0)){\n let pion11 = await getPion(i-1, j+1, hote, adversaire);\n if (pion11===SANS_PION) return true;\n }\n \n // pion haut gauche\n if ((j>0)&&(i>0)){\n let pion12 = await getPion(i-1, j-1, hote, adversaire);\n if (pion12===SANS_PION) return true;\n }\n \n // pion haut droit mangeable\n if ((j<8)&&(i>1)){\n let pion13 = await getPion(i-2, j+2, hote, adversaire);\n let pion14 = await getPion(i-1, j+1, hote, adversaire);\n if((pion13===SANS_PION)&&(pion14===PION_BLANC)) return true;\n }\n \n // pion haut gauche mangeable\n if ((j>1)&&(i>1)){\n let pion15 = await getPion(i-2, j-2, hote, adversaire);\n let pion16 = await getPion(i-1, j-1, hote, adversaire);\n if ((pion15===SANS_PION)&&(pion16===PION_BLANC)) return true;\n }\n \n // dame haut droit mangeable\n if ((j<8)&&(i>1)){\n let pion17 = await getPion(i-2, j+2, hote, adversaire);\n let pion18 = await getPion(i-1, j+1, hote, adversaire);\n if((pion17===SANS_PION)&&(pion18===DAME_BLANC)) return true;\n }\n \n // dame haut gauche mangeable\n if ((j>1)&&(i>1)){\n let pion19 = await getPion(i-2, j-2, hote, adversaire);\n let pion20 = await getPion(i-1, j-1, hote, adversaire);\n if((pion19===SANS_PION)&&(pion20===DAME_BLANC)) return true;\n }\n }\n }\n }\n \n return false;\n}", "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}", "function ordenatuBerriak(berriako,prop, asc) {\n \n var berriab = berriako.Berriak.sort(function(a, b) {\n if (asc) {\n if (a[prop] > b[prop]) return 1;\n if (a[prop] < b[prop]) return -1;\n return 0;\n } else {\n if (b[prop] > a[prop]) return 1;\n if (b[prop] < a[prop]) return -1;\n return 0;\n }\n });\n //console.log(\"ORDENATU ONDOREN WORKERREAN\");\n berriako.Berriak = berriab;\n //console.log(berriab);\n berriab = '{ \"Berriak\" :' + JSON.stringify(berriab) + '}';\n //console.log(berriab);\n //console.log(\"ORDENATU ONDOREN WORKERREAN II\");\n //console.log(JSON.parse(berriab));\n // behin berriak ordenatuta, datuak itzuli !\n //postMessage(JSON.stringify(berriako));\n postMessage(JSON.stringify(berriab));\n //berriak ordenatuta objetua bistaratu kontsolan\n //console.log(\"workerrean eratutakoa\" + JSON.stringify(berriako) + berriako.Berriak);\n // behin ordenatuta dagoenean, BerriApp.js fitxategiari bidali, bistaratu dezan\n \n}", "function Combat_estVoisin(Territoire1,Territoire2){\r\n for(var i =0 ; i < Territoire1.voisins.length ;i++){\r\n if (Territoire1.voisins[i].nom == Territoire2.nom ) {\r\n return true\r\n }\r\n }\r\n return false\r\n}", "function ajoutPv_consta_entete_travaux(pv_consta_entete_travaux,suppression)\n {\n if (NouvelItemPv_consta_entete_travaux==false)\n {\n apiFactory.getAPIgeneraliserREST(\"pv_consta_entete_travaux/index\",'menu',\"getpv_consta_entete_travauxvalideById\",'id_pv_consta_entete_travaux',pv_consta_entete_travaux.id).then(function(result)\n {\n var pv_consta_entete_travaux_valide = result.data.response;\n if (pv_consta_entete_travaux_valide.length !=0)\n {\n var confirm = $mdDialog.confirm()\n .title('cette modification n\\'est pas autorisé.')\n .textContent(' Les données sont déjà validées ou rejetée')\n .ariaLabel('Lucky day')\n .clickOutsideToClose(true)\n .parent(angular.element(document.body))\n .ok('Fermer')\n \n $mdDialog.show(confirm).then(function()\n { \n vm.allpv_consta_entete_travaux = vm.allpv_consta_entete_travaux.filter(function(obj)\n {\n return obj.id !== pv_consta_entete_travaux.id;\n });\n vm.step_tranche_batiment_mpe = false; \n vm.step_tranche_latrine_mpe = false;\n vm.step_tranche_mobilier_mpe = false;\n\n vm.steprubriquebatiment_mpe = false;\n vm.steprubriquelatrine_mpe = false; \n vm.steprubriquemobilier_mpe = false;\n vm.stepdecompte =false;\n vm.steppv_consta_recap_travaux = false;\n\n vm.steppv_consta_batiment_travaux = false;\n vm.steppv_consta_latrine_travaux = false;\n vm.steppv_consta_mobilier_travaux = false;\n\n }, function() {\n //alert('rien');\n });\n }\n else\n {\n test_existancePv_consta_entete_travaux (pv_consta_entete_travaux,suppression); \n }\n }); \n } \n else\n {\n insert_in_basePv_consta_entete_travaux(pv_consta_entete_travaux,suppression);\n }\n }", "valideer () {\n var i = 0\n\n if (this.forms.length === 0) {\n for (i = 0; i < this.knoppen.length; i++) {\n schakelKnop(this.knoppen[i], false)\n }\n return false\n }\n\n for (i = 0; i < this.forms.length; i++) {\n if (!this.forms[i].status) {\n for (var j = 0; j < this.knoppen.length; j++) {\n schakelKnop(this.knoppen[j], false)\n }\n return false\n }\n }\n\n for (i = 0; i < this.knoppen.length; i++) {\n schakelKnop(this.knoppen[i], true)\n }\n\n return true\n }", "buscar(dato){\n if(this.primero == null){\n return false\n }else if(this.primero.dato == dato || this.ultimo.dato == dato){\n return true\n }else{\n return this._buscar(dato, this.primero.siguiente)\n }\n }", "expandidoTotalmente(){\n for (let hijo of this.hijos.values()){\n if(hijo.nodo === null) return false\n }\n\n return true\n }", "function PersonagemRenovaFeiticos() {\n for (var chave_classe in gPersonagem.feiticos) {\n if (!gPersonagem.feiticos[chave_classe].em_uso) {\n continue;\n }\n var slots_classe = gPersonagem.feiticos[chave_classe].slots;\n for (var nivel in slots_classe) {\n for (var indice = 0; indice < slots_classe[nivel].feiticos.length; ++indice) {\n slots_classe[nivel].feiticos[indice].gasto = false;\n }\n if ('feitico_dominio' in slots_classe[nivel] && slots_classe[nivel].feitico_dominio != null) {\n slots_classe[nivel].feitico_dominio.gasto = false;\n }\n if ('feitico_especializado' in slots_classe[nivel] && slots_classe[nivel].feitico_especializado != null) {\n slots_classe[nivel].feitico_especializado.gasto = false;\n }\n }\n }\n}", "finishOneOfProjects(norimoPabaigtiProjektoId) {\n // surasti projekta kurio id yra norimoPabaigtiProjektoId\n let iFoundThis = this.#currentProjects.find((projectObj) => projectObj.id === norimoPabaigtiProjektoId);\n if (iFoundThis === undefined) throw new Error(\"projekto su tokiu id nera: \" + norimoPabaigtiProjektoId);\n // console.log(\"iFoundThis\", iFoundThis);\n // cia mes jau turim rade konkretu objekta\n // iskviesti jam finisjProject metoda\n iFoundThis.finishProject();\n }", "function falso(){\n\tif(cont==2||cont==3||cont==5||cont==6||cont==7||cont==8||cont==10||cont==11||cont==13||cont==17||cont==19){\n\t\talert(\"ESA ES MI CHICA! CORRECTO\");\n\t\tpuntos = puntos + 1;\n\t}else{\n\t\talert(\"MALA NOVIA!!! ERROR\");\n\t}\n\tconsole.log(puntos);\n\tcambiarPagina();\n}", "function checkTirEnCours() {\n tirEnCours = false;\n equipes.forEach((e) => {\n e.joueurs.forEach((j) => {\n if (j.vitesse > 0) tirEnCours = true;\n });\n });\n }", "function indovina(){\n\n gino = get(posIniX, posIniY, beholder.width, beholder.height);\n classifier.classify(gino, gotResult);\n mappa = aCheAssimiglia(gino, daMappare);\n\n}", "function avantiDiUno(){\n\t\tvar fotoCorrente = $(\"img.active\");\n var fotoSuccessiva = fotoCorrente.next(\"img\");\n // devo valutare se l img successiva esiste, in caso contrario riparto dalla prima,poi faro l incontrario per il precedente..sfrutto le classi first e last assegnate.. uso .length per valutare l esistenza!!!\n if (fotoSuccessiva.length == 0) {\n fotoSuccessiva = $(\"img.first\");\n }\n fotoCorrente.removeClass(\"active\");\n fotoSuccessiva.addClass(\"active\");\n // faccio la stessa cosa con i pallini\n var pallinoCorrente = $(\"i.active\");\n var pallinoSuccessivo = pallinoCorrente.next(\"i\");\n if (pallinoSuccessivo.length == 0) {\n pallinoSuccessivo = $(\"i.first\");\n }\n pallinoCorrente.removeClass(\"active\");\n pallinoSuccessivo.addClass(\"active\");\n // faccio variare anche qui l avariabile creata sopra per allinere i cambiamenti di frecce e pallini...vorrei tornare indietro nel tempo e dirlo al me stesso di un ora fa!!!\n if(current_img<3)\n\t\t\tcurrent_img++;\n\t\telse\n\t\t\tcurrent_img=0;\n\n\t}", "tope() {\n if (!this.vacia()) {\n return this.element[this.cant - 1];\n } else {\n return null;\n }\n\n }", "function fasesTorneo() {\n vm.paso = 3;\n obtenerFases();\n obtenerTiposDeFase();\n obtenerPenalizaciones();\n }", "leerDatosProducto(producto){\n const infoProducto = {\n imagen : producto.querySelector('img').src,\n titulo : producto.querySelector('h2').textContent,\n precio : producto.querySelector('h4').textContent,\n id : producto.querySelector('a').getAttribute('data-id'),\n cantidad : 1\n }\n let productosLS;\n productosLS = this.obtenerProductosLocalStorage();\n productosLS.forEach(function(productoLS){\n if(productoLS.id === infoProducto.id){\n productosLS = productoLS.id;\n }\n });\n if(productosLS === infoProducto.id){\n Swal.fire({\n type: 'Epa chamo',\n title: '!! Epa chamo !!',\n text: 'Ya agregaste esta arepa',\n confirmButtonText: 'Sigue comprando mi pana',\n confirmButtonColor: 'rgba(255, 241, 48)'\n })\n }\n else{\n this.insertarCarrito(infoProducto);\n }\n }", "presupuesto_restante() {\n //console.log(cantidad_presupuesto);\n\n const restante_span = document.querySelector('span#restante');\n restante_span.innerHTML = `${cantidad_presupuesto.restante}`;\n this.comprobar_presupuesto();\n\n\n }", "provincia() {\n return super.informacion('provincia');\n }", "function getCuponesPorIndustria(idIndustria){\n\t\n}", "estVide() {\n return (this.suivants.estVide() && this.precedents.estVide());\n }", "function verifier_doublant(idPere,nom,id){\n get_object_by_id(idPere);\n for(var key in found.fils)\n if (found.fils[key].nom == nom && found.fils[key].id != id)\n {\n alert($(\"#msg_js #msg_js_cet_elem_existe_deja_dans_rep\").html());\n found={};\n return true;\n }\n found={};\n}", "buscarNodo(dato){\n if (this.tamanio == 0){\n console.log(\"No hay elementos en la lista.\")\n } else{\n let isEncontrado = false\n let aux = this.primero\n while(aux != null){\n if (aux.dato == dato){\n isEncontrado = true\n return aux.id \n }\n aux = aux.siguiente\n }\n\n if (isEncontrado == false){\n console.log(\"El elemento no se encuentra\")\n alert(\"El dato no se encuentra en la lista.\")\n }\n }\n }", "getPersonasPorSala(sala) {\n\n }", "function pisarTerreno(nuevo){\n // Recorrer cada terreno del jugador\n for(var a = 0; a < jugando.terrenos.length; a++){\n // Si el ID coincide con el nuevo terreno\n if(nuevo.id == jugando.terrenos[a][0]){\n // Si tiene un peso, entonces aplica\n if(jugando.terrenos[a][1] != \"\"){\n return true;\n }\n else{\n return false;\n }\n }\n }\n}", "function estPermutable(i,j) {\n\n if ((celluleEstVide(i,j-1)) // gauche\n || (celluleEstVide(i,j+1))// droite\n || (celluleEstVide(i-1,j)) // haut\n || (celluleEstVide(i+1,j))) // bas\n {\n return true;\n }\n return false;\n }", "function esquiver() \n{\n //Cas spéciaux : Mort, ou pas d'ennemi\n if (presenceEnnemi === 666){\n dialogBox(\"Eh me saoule pas là relance le jeu ou casse toi connard J'AI AUTRE CHOSE A FOUTRE LA.\")\n \n }else if(presenceEnnemi ===0){ \n dialogBox(\"Tu donnes l'impression de danser sur les chemins, c'est mignon mais ça va pas t'aider.\")\n }\n \n //PROCEDURE HABITUELLE\n else if (presenceEnnemi = 1, tourJoueur(tour)=== true){\n var Min= Number(personnage.esquive - 5)\n var Max= Number(personnage.esquive + 15)\n var Miin = Number(1)\n var Maax = Number(100)\n function getRndInterger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;}\n\njetEsquive = getRndInterger(Min, Max);\nvaleurEsquive = getRndInterger(Miin, Maax);\nconsole.log(\"jetEsquive du joueur : \"+jetEsquive+\" et la valeur minimale à avoir était \"+valeurEsquive);\n //Esquive réussie\n if (jetEsquive >= valeurEsquive){\n actionPerso = 2;\n } \n //Echec de l'esquive\n else if (jetEsquive < valeurEsquive){\n actionPerso = 3;\n }\nreactionEnnemi();\nresetSpecial();\n }\n \n}", "function pos_pianeti(njd,np){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) novembre 2010\n // calcola la posizione dei pianeti \n // njd= numero del giorno giuliano della data in T.U.\n // np= numero identificativo del pianeta 0,1,2,3,4,5,6,7,8 mercurio,venere... 2 per la Terra\n // coordinate geocentriche del pianeta riferite all'equinozio della data (njd).\n // calcola le principali perturbazioni planetarie.\n\n // new Array(Periodo , Long_media , Anomalia_media , Long_perielio , eccentr , Semiasse , Inclinazione , Long_nodo , dim_ang , magnitudine);\n // 0 1 2 3 4 5 6 7 8 9\n\n var tempo_luce=t_luce(njd,np);\n \n njd=njd-tempo_luce; // correzione per il tempo luce.\n\n var el_orb=orb_plan(njd,np); // recupera gli elementi orbitali del pianeta.\n\n var periodo= el_orb[0]; // periodo.\n var L= el_orb[1]; // longitudine media all'epoca.\n var AM_media= el_orb[2]; // anomalia media. \n var long_peri= el_orb[3]; // longitudine del perielio.\n var eccent= el_orb[4]; // eccentricità dell'orbita.\n var semiasse= el_orb[5]; // semiasse maggiore.\n var inclinaz= el_orb[6]; // inclinazione.\n var long_nodo= el_orb[7]; // longitudine del nodo.\n var dimens= el_orb[8]; // dimensioni apparenti.\n var magn= el_orb[9]; // magnitudine.\n\n \n var correzioni_orb=pos_pianeticr(njd,np); // calcolo delle correzioni per il pianeta (np).\n \n// Array(Delta_LP , Delta_R , Delta_LL , Delta_AS , Delta_EC , Delta_MM , Delta_LAT_ELIO);\n// 0 1 2 3 4 5 6 \n// lperiodo, rvett long. assemagg ecc M lat\n\n// CORREZIONI \n\n L=L+correzioni_orb[0]; // longitudine media.\n AM_media= AM_media+correzioni_orb[5]; // anomalia media + correzioni..\n semiasse= semiasse+correzioni_orb[3]; // semiasse maggiore.\n eccent= eccent+correzioni_orb[4]; // eccentricità.\n\n // LONGITUDINE ELIOCENTRICA DEL PIANETA ***************************************************** inizio:\n\n var M=AM_media; // anomalia media \n \n M=gradi_360(M); // intervallo 0-360;\n\n var E=eq_keplero(M,eccent); // equazione di Keplero.E[0]=Anomalia eccentrica E[1]=Anomalia vera in radianti.\n \n var rv=semiasse*(1-eccent*Math.cos(E[0])); // calcolo del raggio vettore (distanza dal Sole).\n rv=rv+correzioni_orb[1]; // raggio vettore più correzione.\n\n\n var U=gradi_360(L+Rda(E[1])-M-long_nodo); // argomento della latitudine.\n\n var long_eccliticay=Math.cos(Rad(inclinaz))*Math.sin(Rad(U));\n var long_eccliticax=Math.cos(Rad(U));\n\n var long_ecclitica=quadrante(long_eccliticay,long_eccliticax)+long_nodo;\n var l=gradi_360(long_ecclitica);\n l=l+correzioni_orb[2]; // longitudine del pianeta + correzione.\n\n // LONGITUDINE ELIOCENTRICA DEL PIANETA ********************************************************* fine: \n\n var b=Rda(Math.asin(Math.sin(Rad(U))*Math.sin(Rad(inclinaz)))); // latitudine ecclittica in gradi (b)\n\n // LONGITUDINE E RAGGIO VETTORE DEL SOLE *** inizio:\n\n njd=njd+tempo_luce; \n\n var eff_sole=pos_sole(njd);\n var LS=eff_sole[2]; // longitudine geocentrica del Sole.\n var RS=eff_sole[4]; // raggio vettore.\n \n // LONGITUDINE E RAGGIO VETTORE DEL SOLE *** fine: \n\n // longitudine geocentrica.\n\n var Y=rv*Math.cos(Rad(b))*Math.sin(Rad(l-LS));\n var X=rv*Math.cos(Rad(b))*Math.cos(Rad(l-LS))+RS;\n\n var long_geo=gradi_360(quadrante(Y,X)+LS); // longitudine geocentrica.\n\n var dist_p=Y*Y+X*X+(rv*Math.sin(Rad(b)))*(rv*Math.sin(Rad(b))); \n dist_p=Math.sqrt(dist_p); // distanza del pianeta dalla Terra.\n\n var beta=(rv/dist_p)*Math.sin(Rad(b));\n var lat_geo=Rda(Math.asin(beta));\n lat_geo=lat_geo+correzioni_orb[6]; // latitudine + correzione.\n\n \n// fase del pianeta.\n\nvar fase=0.5*(1+Math.cos(Rad(long_geo-long_ecclitica)));\n fase=fase.toFixed(2);\n\n// parallasse del pianeta in gradi.\n\nvar pa=(8.794/dist_p)/3600;\n\nvar coo_pl=trasf_ecli_equa(njd,long_geo,lat_geo); // coordinate equatoriali. \n\n // diametro apparente in secondi d'arco.\n\nvar diam_app=dimens/dist_p; \n\n// magnitudine del pianeta.\n\nvar magnitudine=(5*(Math.log(rv*dist_p/(magn*Math.sqrt(fase))))/2.302580)-27.7;\n magnitudine=magnitudine.toFixed(1);\n\nif (magnitudine==Infinity) {magnitudine=\"nd\"; }\n\nvar elongaz=elong(coo_pl[0],coo_pl[1],eff_sole[0],eff_sole[1]); // elongazione in gradi dal Sole.\n \n // calcolo dell'angolo di fase in gradi . \n\n var Dpt= dist_p; // distanza pianeta-terra.\n var Dts= RS; // distanza terra-sole.\n var Dps= rv; // distanza pianeta-sole.\n\n // teorema del coseno\n\n var delta_fase=(Dts*Dts+Dps*Dps-Dpt*Dpt)/(2*Dps*Dts);\n delta_fase=Math.acos(delta_fase); \n delta_fase=Rda(delta_fase);\n\n var angolo_fase=180-Math.abs(elongaz)-delta_fase; // angolo di fase in gradi.\n \nvar dati_pp= new Array(coo_pl[0],coo_pl[1],fase,magnitudine,dist_p,diam_app,elongaz,LS,RS,long_ecclitica,pa,rv,angolo_fase);\n// 0 1 2 3 4 5 6 7 8 9 10 11 12 \n\n\n\n// risultati: ARetta,Declinazione,fase,magnitudine,distanza pianeta,diametro apparente, elongazione, long. sole,raggio vettore Terra, longituddine elio. pianeta, parallase,dist sole-pianeta. \n\nreturn dati_pp;\n}", "function cumpleanosModificadonObjeto(persona) {\n persona.edad += 1;\n}", "function liczbaZnakow(zdanie, litera) {\n\n\n var policz = 0;\n\n for (i = 0; i < zdanie.length; i++) {\n\n if (zdanie[i] == litera) {\n policz++;\n }\n }\n return \"Litera \" + litera + \" wystepuje \" + policz + \" razy w zdaniu : \" + zdanie ;\n}", "function verRepeticion(cadena) {\n cargarCadenaMovimientos(cadena);\n // Muestro el primer movimiento de la partida\n crearEventosMovRepeticion();\n cargarTablero(1);\n estilosMovActualRep(0);\n}", "function cruzamiento(poblacion,seleccion,ciudades,elite)\n\t\t\t{\n\t\t\t\tvar numPobla = poblacion.length;\n\t\t\t\tvar indice1,indice2;\n\t\t\t\tvar k = 0;\n\t\t\t\tvar new_poblation = new Array();\n\t\t\t\t/*Genero nueva poblacion*/\n\t\t\t\twhile(k < parseInt(numPobla / 2))\n\t\t\t\t{\n\t\t\t\t\t//Escogo el metodo de seleccion para tener dos PADRES\n\t\t\t\t\tswitch(seleccion)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Torneo\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tdo{\n\t\t\t\t\t\t\t\tindice1 = torneo(poblacion,elite);\n\t\t\t\t\t\t\t\tindice2 = torneo(poblacion,elite);\n\t\t\t\t\t\t\t}while(indice1 == indice2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//Ranking\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//Aleatorio\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tdo{\n\t\t\t\t\t\t\t\tindice1 = parseInt( Math.random() * numPobla*elite);\n\t\t\t\t\t\t\t\tindice2 = parseInt( Math.random() * numPobla*elite);\n\t\t\t\t\t\t\t}while(indice1 == indice2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t//console.log(indice1);\n\t\t\t\t\t//console.log(indice2);\n\t\t\t\t\t/*Padres*/\n\t\t\t\t\tvar dad = poblacion[indice1].recorrido; \n\t\t\t\t\tvar mom = poblacion[indice2].recorrido;\n\t\t\t\t\t/*Camino para Hijos*/\n\t\t\t\t\tvar camino1 = new Array();\n\t\t\t\t\tvar camino2 = new Array();\n\t\t\t\t\t/*Numero entre 0 y numero de ciudades menos 1*/\n\t\t\t\t\tbp = parseInt( Math.random() * ciudades ); /*Punto de roptura*/\n\n\t\t\t\t/*-----------Genero 2 nuevos caminos-----------*/\n\t\t\t\t\t//Respaldo caminos de papa y mama hasta bp\n\t\t\t\t\tfor(var i = 0; i < bp; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcamino1.push(dad[i]);\n\t\t\t\t\t\tcamino2.push(mom[i]);\n\t\t\t\t\t}\n\t\t\t\t\tfor(var i = 0; i < ciudades; i++)\n\t\t\t\t\t{\t\n\t\t\t\t\t\t//Tomo el elemento a buscar en el segundo vector\n\t\t\t\t\t\tvar busca1 = mom[i];\n\t\t\t\t\t\tvar busca2 = dad[i];\n\t\t\t\t\t\tfor(var j = bp; j < ciudades; j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(busca1 == dad[j])\n\t\t\t\t\t\t\t\tcamino1.push(busca1);\n\t\t\t\t\t\t\tif(busca2 == mom[j])\n\t\t\t\t\t\t\t\tcamino2.push(busca2); \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t/*Hijos generados*/\n\t\t\t\t\tvar hijo1 = {recorrido: camino1, distancia: aptitud(camino1,region)}\n\t\t\t\t\tvar hijo2 = {recorrido: camino2,distancia : aptitud(camino2,region)}\n\n\t\t\t\t\tnew_poblation.push(hijo1);\n\t\t\t\t\tnew_poblation.push(hijo2);\n\t\t\t\t\tk++;\n\t\t\t\t}\n\t\t\t\treturn new_poblation;\n\t\t\t}", "function graczOberwal() {\r\n\r\n\t\t\t\t//zabieranie rebulla:\r\n\t\t\t\tif (DD_predkoscPocztkowaGracza >= 250) {\r\n\t\t\t\t\tDD_predkoscPocztkowaGracza -= 125;\r\n\t\t\t\t\tgracz.twoway(DD_predkoscPocztkowaGracza); //redukuj predkosc gracza\r\n\t\t\t\t\tDD_obrazeniaPocikskowGracz -= 0.05; //zredukuj obrazenia zadawane przez pociski gracza\r\n\r\n\t\t\t\t\t//dodaj napis o redukcji rebulla:\r\n\t\t\t\t\tvar bonusTekst = Crafty.e(\"2D, Canvas, Text, Delay, Motion\")\r\n\t\t\t\t\t\t.attr({ x: gracz.x - 25, y: gracz.y, z: 98 })\r\n\t\t\t\t\t\t.text('- REBULL')\r\n\t\t\t\t\t\t.textColor('gray')\r\n\t\t\t\t\t\t.textFont({ size: '15px', weight: 'bold' })\r\n\t\t\t\t\t\t.bind('EnterFrame', function (e) {\r\n\t\t\t\t\t\t\tthis.alpha -= 0.01;\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\t.delay(function () {\r\n\t\t\t\t\t\t\tthis.destroy();\r\n\t\t\t\t\t\t}, 1500, 0)\r\n\t\t\t\t\t\t;\r\n\t\t\t\t\tbonusTekst.velocity().y = -50;\r\n\r\n\t\t\t\t}\r\n\t\t\t\tif (DD_buforStrzalu <= 5) {\r\n\t\t\t\t\tDD_buforStrzalu += 1; //redukuj szybkosztrzelnosc\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//czerwona maska przy oberwaniu od przeciwnika:\r\n\t\t\t\tvar boli = Crafty.e('2D, Canvas, Image, Renderable, Delay')\r\n\t\t\t\t\t.attr({ x: 0, y: 0, w: 500, h: 300 })\r\n\t\t\t\t\t.image(\"assets/obrazki/ouch2.png\", \"no-repeat\")\r\n\t\t\t\t\t.delay(function () {\r\n\t\t\t\t\t\tthis.destroy();\r\n\t\t\t\t\t}, 150, 0)\r\n\t\t\t\t\t;\r\n\t\t\t\t// intensywnosc maski zalezy od ilosci pozostalego zycia:\r\n\t\t\t\tboli.alpha = (1 / gracz.zycie) * DD_fala;\r\n\t\t\t\treturn;\r\n\t\t\t}", "actualiser(jeu)\n\t{\n\t\t//Actualise le dessin du plateau de jeu\n\t\tjeu.dessiner(this._context);\n\n\t\t//Actualise les informations de partie\n\t\tthis.actualiserNiveau(jeu.getNiveau());\n\t\tthis.actualiserScore(jeu.getScore());\n\t\tthis.actualiserPointsDeVie(jeu.getPointsDeVie());\n\t\tthis.actualiserMunitions(jeu.getNombreMunitions());\n\t\tthis.actualiserBouclier(jeu.getShield());\n\t\tthis.actualiserHigh_score();\n\t}" ]
[ "0.5991874", "0.5929998", "0.58855665", "0.5880484", "0.5826916", "0.5814434", "0.58114797", "0.57789046", "0.57528603", "0.5747532", "0.5745941", "0.5696208", "0.5688028", "0.5653418", "0.5638048", "0.56352746", "0.5616234", "0.5600099", "0.5567552", "0.55365455", "0.5536464", "0.5534238", "0.5532189", "0.54982615", "0.5485937", "0.54807955", "0.547804", "0.54767066", "0.54696757", "0.54537463", "0.5449502", "0.54236746", "0.54155606", "0.54096115", "0.5407515", "0.5403385", "0.5384796", "0.5381456", "0.5373431", "0.5367641", "0.5364196", "0.5360739", "0.53599995", "0.5357262", "0.53550947", "0.53458047", "0.53420085", "0.5321583", "0.53213996", "0.53204614", "0.53112614", "0.5303981", "0.5303402", "0.5302573", "0.53016216", "0.5301047", "0.52985793", "0.52935594", "0.5289495", "0.5284888", "0.52730674", "0.5270692", "0.5266243", "0.52618396", "0.5258688", "0.5257258", "0.52504563", "0.52482206", "0.52430934", "0.52414054", "0.524133", "0.52287215", "0.5227349", "0.52267444", "0.5221904", "0.52149105", "0.5214599", "0.5214129", "0.521367", "0.5202323", "0.5198964", "0.5197097", "0.5196996", "0.5196512", "0.51962084", "0.5195119", "0.51935464", "0.5189902", "0.5188565", "0.5187261", "0.51827496", "0.51804477", "0.5177376", "0.5171701", "0.5171282", "0.5171207", "0.51710683", "0.51695955", "0.5162647", "0.51618356", "0.5157958" ]
0.0
-1
Vraca sumu svih prosecnih fitnesa u svim vrstama
getAvgFitnessSum() { let averageSum = 0; for (let s of this.species) { averageSum += s.averageFitness; } return averageSum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calculVitesseX(){\r\n //rajout de 1 facteur\r\n if (this.vitesseXFacteur < this.limiteFacteur){\r\n this.vitesseXFacteur +=1; // faire en fonction de la largeur du terrain\r\n }\r\n else {/*rien car la vitesse ne peux pas depasser la limite*/}\r\n }", "function hitungPVA() {\n\t\tvar MASKEr = document.getElementById(\"pva1\").value;\n\t\tvar MASKEi= document.getElementById(\"pva2\").value;\n\t\tvar MASKEn= document.getElementById(\"pva3\").value;\n\n\t\tvar Er = MASKEr.split(',').join('');\n\t\tvar Ei = MASKEi.split(',').join('');\n\t\tvar En = MASKEn.split(',').join('');\n\n\t\tvar Eip\t= Ei / 100;\n\t\tvar Efixed = (Math.pow(1+Eip,En)).toFixed(4);\n\t\tvar Epengalipva = (Efixed -1) / (Eip * Efixed);\n\t\tvar Epva = Er * Epengalipva;\n\t\tvar Erpva = Math.round(Epva);\n\t\tdocument.getElementById(\"outputPVA\").innerHTML = \n\t\t\"Faktor Pengali PV-annuitas : \\n\"+\n\t\t\"\t\t= (( 1 + i )^n + 1 ) / ( i x ( 1 + i )^n ) \\n\"+\n\t\t\"\t\t= (( 1 + \"+ Eip +\" )^\"+ En +\" + 1 ) / ( \"+ Eip +\" x ( 1 + \"+ Eip +\" )^\"+ En +\" ) \\n\"+\n\t\t\"\t\t= \"+ Epengalipva.toFixed(4) +\" \\n\"+\n\t\t\"Present Value Anuitas : \\n\"+\n\t\t\"\t\t= R x Faktor Pengali PV-annuitas \\n\"+\n\t\t\"\t\t= Rp. \"+ MASKEr +\" x \"+ Epengalipva.toFixed(4) +\"\\n\"+\n\t\t\"\t\t= \"+ uang(Erpva, \"Rp.\");\n\t}", "calcula(i){\n let vP = this.arrCamisas[i].camisap*10;\n let vM = this.arrCamisas[i].camisam*12;\n let vG = this.arrCamisas[i].camisag*15;\n\n let valortotal = vP+vM+vG;\n\n return valortotal;\n }", "function hitungFVA() {\n\t\tvar MASKBr = document.getElementById(\"fva1\").value;\n\t\tvar MASKBi = document.getElementById(\"fva2\").value;\n\t\tvar MASKBn = document.getElementById(\"fva3\").value;\n\n\t\tvar Br = MASKBr.split(',').join('');\n\t\tvar Bi = MASKBi.split(',').join('');\n\t\tvar Bn = MASKBn.split(',').join('');\n\n\t\tvar Bip = Bi / 100;\n\t\tvar Bpengalifv = ( (Math.pow(1+Bip,Bn)) - 1 ) / Bip;\n\t\tvar Bfva = Math.round(Br * Bpengalifv);\n\t\tdocument.getElementById(\"outputFVA\").innerHTML = \n\t\t\"Faktor Pengali FVanuitas : \\n\"+\n\t\t\"\t\t= ( ( 1 + i )^n - 1 ) / i \\n\"+\n\t\t\"\t\t= ( (1 + \"+ Bip +\")^\"+ Bn +\" - 1 ) / \"+ Bip +\" \\n\"+\n\t\t\"\t\t= \"+ Bpengalifv.toFixed(4) +\" \\n\"+\n\t\t\"Future Value Anuitas : \\n\"+\n\t\t\"\t\t= R x Faktor Pengali Fvanuitas \\n\"+\n\t\t\"\t\t= Rp. \"+ MASKBr +\" x \"+ Bpengalifv.toFixed(4) +\" \\n\"+\n\t\t\"\t\t= \"+ uang(Bfva, \"Rp.\");\n\t\t}", "function ocen_statycznie()\n{\n return szachownica.ocena.material + (szachownica.ocena.faza_gry * szachownica.ocena.tablice + (70 - szachownica.ocena.faza_gry) * szachownica.ocena.tablice_koncowka) * 0.03;\n}", "function leyes_vida(){\n\tcelulas_x2= new Array(50);\n\tfor(i=0;i<50;i++){\n\t\tcelulas_y2= new Array(50);\n\t\tfor(j=0;j<50;j++){\n\t\t\tsum=0;\n\t\t\tcelulas_y2[j]=evaluar(i,j,celulas_x,celulas_x[i][j],sum);\n\t\t\t//alert(\"resultado: \"+celulas_y2[j]);\n\t\t\t\n\t\t}//for j\n\t\tcelulas_x2[i]=celulas_y2;\n\t\t\n\t}//for i\n\tcelulas_x=celulas_x2;\n\t\n\timprimir_celulas(celulas_x);\n\t\n}", "function datosVenta() {\n let total = 0;\n let iva = 0;\n for (let i = 0; i < listaProductos.length; i++) {\n total += listaProductos[i].precio * listaProductos[i].cantidad;\n iva += ((listaProductos[i].precio * listaProductos[i].cantidad) * 0.16);\n }\n puntoVenta.registrarVenta(iva, total, listaProductos);\n}", "function ActualiserPointsVie(){\n\t//les PDV diminuent si le joueur s'eloigne des artefacts (zoneSure) sans lumiere (torcheJoueur)\n\tif(transform.Find(\"torcheJoueur(Clone)\") == null && !zoneSure){\n\t\tif(vitesseCorruption < 0){\n\t\t\tvitesseCorruption = 0;\n\t\t}else{\n\t\t\tvitesseCorruption += Time.deltaTime/2;\n\t\t}\n\t\tpointsVie -= vitesseCorruption*Time.deltaTime;\n\t} else{\n\t\t//la vitesse de reduction des PDV diminue jusqu'a 0\n\t\tif(vitesseCorruption > 0){\n\t\t\tvitesseCorruption -= Time.deltaTime*2;\n\t\t}else{\n\t\t\tvitesseCorruption = 0;\n\t\t\t//soigne si la vitesse de corruption est 0 et le joueur a obtenu la potion\n\t\t\tif(Joueur.powerUpPotion){\n\t\t\t\tpointsVie += Time.deltaTime;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}\n\t//actualise l'element visuel\n\tbarreVie.fillAmount = pointsVie/pointsVieMax;\n}", "function hitungLuasSegiEmpat(sisi){\n //tidak ada nilai balik\n var luas = sisi * sisi\n return luas\n}", "function atvd17(){\n \n let a = parseFloat(document.querySelector(\"#atvd17-1\").value);\n let b = parseFloat(document.querySelector(\"#atvd17-2\").value);\n let c = parseFloat(document.querySelector(\"#atvd17-3\").value);\n\n let de,x1=0,x2=0;\n \n\n de = (Math.pow(b, 2)) - (4*a*c);\n \n \n x1= (-b - Math.sqrt(de))/(2*a);\n \n x2= (-b + Math.sqrt(de))/(2*a);\n \n\n if(de<0){\n document.getElementById(\"raiz\").innerHTML = \"Não existe raiz real\";\n\n }else{\n document.getElementById(\"raiz\").innerHTML = \"VALOR DA PRIMEIRA RAIZ:\" + x1+ \" | \" + \"VALOR DA SEGUNDA RAIZ:\" + x2;\n \n }\n \n }", "function kiekReiketuTapetuRulonuKambariui(ilgis, plotis, aukstis) {\n const vienasRulonas = 10;\n \n // debugger\n // gauti visus sienu ir lubu plota\n let sienos = kambarioSienuPlotas(ilgis, plotis, aukstis);\n let grindysLubos = kabarioLubosGrindys(ilgis, plotis);\n // pagal gauta plota paskaiciuoti kiek rulonu reikes \n let kiekRulonu = (sienos + grindysLubos) / vienasRulonas;\n\n return kiekRulonu;\n}", "function viagem(limiteTanque, valorGasolina, kmPercorrido, destino){\n\n document.write(\"fizemos uma viagem para \" + destino +'<br>')\n document.write(\"A viagem foi de \" + kmPercorrido + 'km <br>')\n\n //Quantos km faz o tanque\n var kmTotalTanque = limiteTanque * 2\n document.write('O tanque do carro faz ' + kmTotalTanque + 'km <br>')\n\n console.log(kmTotalTanque)\n //Quantas vezes abastecer\n var qtsVzsAbastecer = Math.ceil(kmPercorrido / kmTotalTanque)\n document.write('Precisamos abastecer ' + qtsVzsAbastecer +'vez(es) <br>')\n console.log(qtsVzsAbastecer)\n //Quantos litros abastecer\n var qtsLitrosAbastecer = (kmPercorrido / 2) - limiteTanque\n document.write('Precisamos abastecer ' + qtsLitrosAbastecer +'litros <br>')\n console.log(qtsLitrosAbastecer)\n //valor gasto com a gasolina\n var gastoGasolina = qtsLitrosAbastecer * valorGasolina\n document.write('Gastamos R$' + gastoGasolina + ' com gasolina <br>')\n console.log(gastoGasolina)\n //quanto tempo durou a viagem\n var tempoViagem = Math.ceil(kmPercorrido / 60)\n document.write(\"A viagem demorou aproximadamente \" + tempoViagem + ' horas')\n console.log(tempoViagem)\n}", "function updateGesamtPreis() {\n \"use strict\";\n gesamtPreis = 0.0;\n warenkorb.forEach(WarenkorbRechner);\n /*Für jede option im Wk, werden in der Methode \"WarenkorbRechner\"\n die Preise Addiert*/\n var summeSite = document.getElementById(\"gesamtPreis\");\n //aktualisiere innerText mit neuem Preis\n summeSite.innerText = \"Gesamtpreis: \" + gesamtPreis.toFixed(2) + \"€\";\n}", "function caricaModello() {\n // CARICA MAPPA DISPLACEMENT\n mappaTemp = mappa;\n //mappaTemp.filter(BLUR, oggetto.Smooth);\n\n\n mappaTemp.loadPixels();\n let f = 0;\n let k = 0;\n for (let x = 0; x < mappaTemp.width-res; x+=res) {\n punti[f] = [];\n for (let y = 0; y < mappaTemp.height-res; y+=res) {\n let c = mappaTemp.get(x, y);\n let h = brightness(c);\n punti[f][k] = h;\n k++;\n }\n k=0;\n f++;\n }\n mappaTemp.updatePixels();\n\n // CARICA TEXTURE\n gino.loadPixels();\n let i = 0;\n let j = 0;\n for (let x = 1; x <= gino.width-res; x+=res) {\n voxel[i] = [];\n voxelBN[i] = [];\n for (let y = 1; y <= gino.height-res; y+=res) {\n let c = gino.get(x, y);\n let h = brightness(c);\n voxel[i][j] = c;\n voxelBN[i][j] = h;\n j++;\n }\n j=0;\n i++;\n }\n gino.updatePixels();\n}", "function dibujar_protesis_fija(canvas){\r\n\tif (i_inic<=i_final){\r\n\t//var px=87;\r\n\t//var py=129;\r\n\t//var numi=0;\r\n\t\r\n\tvar i= i_inic+1;\r\n\t var i_inic_s= i_inic+1;\r\n\t \r\n\t//dibujar diente sano antes de convencion\r\n\tdibujar_diente_sano_alr(canvas,pxi, pyi,i_inic);\r\n\tdibujar_diente_sano (canvas,cara1,i_inic);\r\n\tdibujar_diente_sano (canvas,cara2,i_inic);\r\n\tdibujar_diente_sano (canvas,cara3,i_inic);\r\n\tdibujar_diente_sano (canvas,cara4,i_inic);\r\n\tdibujar_diente_sano (canvas,cara5,i_inic);\r\n \r\n\t//dibujar diente sano en dientes medios\r\n\tfor ( i_inic_s; i_inic_s<i_final; i_inic_s++) {\r\n\t\t//dibujar diente sano antes de convencion\r\n\t\tdibujar_diente_sano_alr(canvas,pxi, pyi,i_inic_s);\r\n\t\tdibujar_diente_sano (canvas,cara1,i_inic_s);\r\n\t\tdibujar_diente_sano (canvas,cara2,i_inic_s);\r\n\t\tdibujar_diente_sano (canvas,cara3,i_inic_s);\r\n\t\tdibujar_diente_sano (canvas,cara4,i_inic_s);\r\n\t\tdibujar_diente_sano (canvas,cara5,i_inic_s);\r\n\t\t\r\n\t\t\r\n\t}\r\n\t//dibujar diente sano antes de convencion\r\n\tdibujar_diente_sano_alr(canvas,pxf, pyf,i_final);\r\n\tdibujar_diente_sano (canvas,cara1,i_final);\r\n\tdibujar_diente_sano (canvas,cara2,i_final);\r\n\tdibujar_diente_sano (canvas,cara3,i_final);\r\n\tdibujar_diente_sano (canvas,cara4,i_final);\r\n\tdibujar_diente_sano (canvas,cara5,i_final);\r\n\t\r\n\t//dibujar protesis fija en diente inicial\r\n\tdibujar_protesis_fija_inicial(canvas,protesisim,i_inic);\r\n\t\r\n\t//dibujar protesis fija en dientes medios\r\n\tfor ( i; i<i_final; i++) {\r\n\t\r\n\t\t//dibujar convencion\r\n\t\tdibujar_protesis_fija_media(canvas,protesisim,i);\r\n\t\t\r\n\t}\r\n\t\r\n\t//dibujar protesis fija en diente final\r\n\tdibujar_protesis_fija_final(canvas,protesisf,i_final);\r\n\t//\r\n\t\r\n\t\r\n\ti=0;\r\n\ti_inic=0;\r\n\ti_final=0;\r\n\tpxi=0;\r\n\tpxf=0;\r\n\tpyi=0;\r\n\tpyf=0;\r\n\tsw_punto_inic =false;\r\n\tsw_punto_final =false;\r\n\tsector_inicial=0;\r\n\tsector_final=0;\r\n\t//protesisf.length=0;\r\n\t//protesisim.length=0;\r\n\t\r\n\t\r\n\t}else{\r\n\t\tvar i= i_final+1;\r\n\t\tvar i_inic_s= i_final+1;\r\n\t\t \r\n\t\t//dibujar diente sano antes de convencion\r\n\t\tdibujar_diente_sano_alr(canvas,pxi, pyi,i_inic);\r\n\t\tdibujar_diente_sano (canvas,cara1,i_inic);\r\n\t\tdibujar_diente_sano (canvas,cara2,i_inic);\r\n\t\tdibujar_diente_sano (canvas,cara3,i_inic);\r\n\t\tdibujar_diente_sano (canvas,cara4,i_inic);\r\n\t\tdibujar_diente_sano (canvas,cara5,i_inic);\r\n\t \r\n\t\t//dibujar diente sano en dientes medios\r\n\t\tfor ( i_inic_s; i_inic_s<i_inic; i_inic_s++) {\r\n\t\t\t//dibujar diente sano antes de convencion\r\n\t\t\tdibujar_diente_sano_alr(canvas,pxi, pyi,i_inic_s);\r\n\t\t\tdibujar_diente_sano (canvas,cara1,i_inic_s);\r\n\t\t\tdibujar_diente_sano (canvas,cara2,i_inic_s);\r\n\t\t\tdibujar_diente_sano (canvas,cara3,i_inic_s);\r\n\t\t\tdibujar_diente_sano (canvas,cara4,i_inic_s);\r\n\t\t\tdibujar_diente_sano (canvas,cara5,i_inic_s);\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t//dibujar diente sano antes de convencion\r\n\t\tdibujar_diente_sano_alr(canvas,pxf, pyf,i_final);\r\n\t\tdibujar_diente_sano (canvas,cara1,i_final);\r\n\t\tdibujar_diente_sano (canvas,cara2,i_final);\r\n\t\tdibujar_diente_sano (canvas,cara3,i_final);\r\n\t\tdibujar_diente_sano (canvas,cara4,i_final);\r\n\t\tdibujar_diente_sano (canvas,cara5,i_final);\r\n\t\t//dibujar protesis fija en diente inicial\r\n\t\tdibujar_protesis_fija_inicial(canvas,protesisim,i_final);\r\n\t\t\r\n\t\t//dibujar protesis fija en dientes medios\r\n\t\tfor ( i; i<i_inic; i++) {\r\n\t\t\tdibujar_protesis_fija_media(canvas,protesisim,i);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//dibujar protesis fija en diente final\r\n\t\tdibujar_protesis_fija_final(canvas,protesisf,i_inic);\r\n\t\ti=0;\r\n\t\ti_inic=0;\r\n\t\ti_final=0;\r\n\t\tpxi=0;\r\n\t\tpxf=0;\r\n\t\tpyi=0;\r\n\t\tpyf=0;\r\n\t\tsw_punto_inic =false;\r\n\t\tsw_punto_final =false;\r\n\t\tsector_inicial=0;\r\n\t\tsector_final=0;\r\n\t\t//protesisf.length=0;\r\n\t\t//protesisim.length=0;\r\n\t\t\r\n\t}\r\n\t\r\n\t\r\n\r\n}", "ajuste_potencia(){\n if (this.energia_disponible()){\n let danio_total = this.calcular_danio_total();\n let inyect_total = this.inyectores_disponibles();\n let plasma_inyector = (danio_total+this._plasma_requerido - inyect_total * limit_plasma)/this.inyectores_disponibles();\n for (let i = 0; i < this._injectores.length; i++) {\n if (this._injectores[i]._danio_por!==100){\n if (plasma_inyector<0){\n this._injectores[i].set_plasma = this._injectores[i].calcular_poder()+plasma_inyector;\n } else {\n this._injectores[i].set_plasma = this._injectores[i].calcular_poder();\n this._injectores[i].set_extra_plasma = plasma_inyector;\n\n }\n }\n }\n this._potencia_disponible = true;\n } else {\n this._potencia_disponible = false;\n\n }\n }", "function skaiciuotiVidurki(mas) {\n var suma = 0;\n for (var i = 0; i < mas.length; i++) {\n suma += mas[i];\n }\n // return Math.round(suma / mas.length);\n var ats = suma / mas.length;\n ats = Math.round(ats);\n return ats;\n}", "function hitungVolumedanLuasPermukaanBalok(panjang, lebar, tinggi) {\n luasPermukaanBalok = 2 * ( (panjang * lebar) + (panjang * tinggi) + (lebar * tinggi) );\n volumeBalok = panjang * lebar * tinggi;\n document.write(\"Panjang : \" + panjang + \"<br/>\");\n document.write(\"Lebar : \" + lebar + \"<br/>\");\n document.write(\"Tinggi : \" + tinggi + \"<br/>\" + \"<br/>\");\n document.write(\"Volume Balok : \" + volumeBalok + \"<br/>\");\n document.write(\"Luas Permukaan Balok : \" + luasPermukaanBalok + \"<br/>\");\n}", "function fl_outToSumsum ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "function obliczPunkty(dane)\n{\n var ro = 1.21; // gęstośc czynnika\n var stosunek_et = [0.86, 0.98, 1, 0.966, 0.86]; // stosunek sprawności izentropowych\n\n var mi0 = (1 - (Math.sqrt(Math.sin(dane.beta2 * (Math.PI / 180))) / (Math.pow(dane.z, 0.7)))).toPrecision(3); // współczynnik zmniejszenia mocy wentylatora\n var u2 = ((dane.D2 * Math.PI * dane.n) / 60).toPrecision(3); // prędkość obwodowa wirnika\n var c2u = ((dane.deltapzn * 1000) / (ro * u2 * dane.etazn)).toPrecision(3); // prędkość zależna od ułopatkowania wirnika\n var fi2r = ((c2u * Math.tan(dane.alfa2 * Math.PI / 180)) / u2).toPrecision(3); // wskaźnik prędkości koła wirnikowego\n var fi2r0 = ((mi0 * fi2r) / (mi0 - (c2u / u2))).toPrecision(3); // wartośc wskaznika prędkości koła wirnikowego dla wartości zerowej charakterystyki koła wirnikowego\n var Qmax = (dane.Qzn * (fi2r0 / fi2r)).toPrecision(3); // przepływ maksymalny\n\n var krok = 0.6;\n\n var daneDoWykresu = {};\n daneDoWykresu.deltap = []; // tablica wartości sprężu (deltap)\n daneDoWykresu.Q = []; // tablica wartości wydajności\n daneDoWykresu.Q = []; // tablica wartości wydajności\n daneDoWykresu.eta = []; // etazn * stosunek_et\n\tdaneDoWykresu.wspQ = []; //współczynnik Q: 1-Q/Qmax\n\tdaneDoWykresu.mp = [] ; // tablica wartości mocy pobieranej\n\t\n /* obliczanie punktów charakterystyk */\n\t\n for (var i = 0; i < 5; i++)\n\t{\n daneDoWykresu.Q[i] = krok * dane.Qzn;\n daneDoWykresu.wspQ[i] = 1 - (daneDoWykresu.Q[i] / Qmax);\n daneDoWykresu.eta[i] = dane.etazn * stosunek_et[i];\n\t\tdaneDoWykresu.deltap[i] =((293/(273+dane.tc))*((ro * (Math.pow(u2, 2)) * mi0 * daneDoWykresu.wspQ[i] * daneDoWykresu.eta[i])) / 1000); // kPa\n\t\tdaneDoWykresu.mp[i] = ((daneDoWykresu.Q[i]*daneDoWykresu.deltap[i])/(daneDoWykresu.eta[i]*dane.etas))/100; // kW/100\n krok += 0.2;\n }\n return daneDoWykresu;\n}", "function instat() {\r\n // ********************************************************************\r\n // Initialize summation of variables\r\n // ********************************************************************\r\n fme[13] = 0.0;\r\n cgs[13] = 0.0;\r\n gp[13] = 0.0;\r\n pbt[13] = 0.0;\r\n pat[13] = 0.0;\r\n rex[13] = 0.0;\r\n for (let mo = 1; mo <= 3; mo++) {\r\n tfi[mo] = 0.0;\r\n };\r\n // ********************************************************************\r\n // Begin calculation of budget\r\n // ********************************************************************\r\n for (let mo = 1; mo <= 12; mo++) {\r\n dd[mo] = dd[13] / 12.0;\r\n fme[mo] = oli[mo] + rfe[mo] - ssi[mo] - rfr[mo] + sli[mo] + aex[mo] + per[mo];\r\n fme[13] = fme[13] + fme[mo];\r\n };\r\n for (let mo = 1; mo <= 13; mo++) {\r\n for (let i = 1; i <= n; i++) {\r\n const lm = mo - 1;\r\n if (mo <= 1) {\r\n tfi[mo] = tfi[mo] + puco[i] * bi[i][mo];\r\n }\r\n else {\r\n tfi[mo] = tfi[mo] + puc[i][lm] * bi[i][mo];\r\n };\r\n };\r\n };\r\n for (let mo = 1; mo <= 12; mo++) {\r\n const nm = mo + 1;\r\n cgs[mo] = tpc[mo] + tfi[mo] - tfi[nm];\r\n cgs[13] = cgs[13] + cgs[mo];\r\n gp[mo] = tsv[mo] - cgs[nm];\r\n gp[13] = gp[13] + gp[mo];\r\n };\r\n for (let mo = 1; mo <= 12; mo++) {\r\n pbt[mo] = gp[mo] - toe[mo] - fme[mo];\r\n pbt[13] = pbt[13] + pbt[mo];\r\n };\r\n ct[13] = 0.0;\r\n if (pbt[13] <= 25.0 && pbt[13] > 0.0) {\r\n ct[13] = 0.3 * pbt[13];\r\n };\r\n if (pbt[13] > 25.0) {\r\n ct[13] = 0.3 * 25 + 0.52 * (pbt[13] - 25.0);\r\n };\r\n for (let mo = 1; mo <= 12; mo++) {\r\n ct[mo] = ct[13] / 12.0;\r\n pat[mo] = pbt[mo] - ct[mo];\r\n rex[mo] = pat[mo] - dd[mo];\r\n rex[13] = rex[13] + rex[mo];\r\n pat[13] = pat[13] + pat[mo];\r\n };\r\n // ********************************************************************\r\n // Write out the budget\r\n // ********************************************************************\r\n write(`${fh(1)}${fx(40)}PROJECTED INCOME STATEMENT FOR BUDGET PERIOD MO = 13`); // 100\r\n write(`${fh(0)}${fx(18)}TOTAL SALES VOLUME ${fx(49)}TSV(13). ${ff(12, 6, tsv[13])}`); // 101\r\n write(`${fh(0)}${fx(19)}COST OF GOODS SOLD .`);\r\n write(`${fh(0)}${fx(23)}TOTAL PURCHASES OF`);\r\n write(`${fx(23)}(DIRECT) MATERIAL${fx(20)}TPV(13) . ${ff(10, 5, tpv[13])}`);\r\n write(`${fh(0)}${fx(23)}PLUS MATERIAL INVENTORY`);\r\n write(`${fx(23)}AT BEGINNING OF PERIOD${fx(15)}VMI(1) . ${ff(10, 5, vmi[1])}`);\r\n write(`${fh(0)}${fx(23)}MINUS TOTAL MATERIAL IN-`);\r\n write(`${fx(23)}VENTORY AT END OF PERIOD${fx(13)}VMI(13) . ${ff(10, 5, vmi[13])}`);\r\n write(`${fh(0)}${fx(23)}TOTAL (DIRECT) MATERIAL COST${fx(9)}TCM(13) .${fx(16)}${ff(12, 5, tcm[13])}`);\r\n write(`${fh(0)}${fx(23)}PLUS TOTAL (DIRECT)LABOR COST${fx(8)}TLC(13) .${fx(16)}${ff(12, 5, tlc[13])}`);\r\n write(`${fh(0)}${fx(23)}PLUS FACTORY OVERHEADS${fx(16)}FO(13) .${fx(16)}${ff(12, 5, fo[13])}`);\r\n write(`${fh(0)}${fx(23)}TOTAL PRODUCTION COSTS ${fx(40)}${ff(12, 6, tpc[13])}`); // 102\r\n write(`${fh(0)}${fx(23)}PLUS TOTAL FINISHED (AND`);\r\n write(`${fx(23)}PARTLY FINISHED) GOODS`);\r\n write(`${fx(23)}INVENTORY AT BEG. OF PERIOD${fx(10)}TFI(1) .${fx(16)}${ff(12, 5, tfi[1])}`);\r\n write(`${fh(0)}${fx(23)}MINUS TOTAL FINISHED (AND`);\r\n write(`${fx(23)}PARTLY FINISHED) GOODS`);\r\n write(`${fx(23)}INVENTORY AT END OF PERIOD${fx(11)}TFI(13) .${fx(16)}${ff(12, 5, tfi[13])}`);\r\n write(`${fh(0)}${fx(40)}COST OF GOODS SOLD CGS(13) .${fx(30)}${ff(12, 6, cgs[13])}`);\r\n write(`${fh(0)}${fx(19)}GROSS PROFIT (TSV(13)- CGS(13))${fx(37)}GP(13). ${ff(12, 6, gp[13])}`);\r\n write(`${fh(0)}${fx(19)}MINUS TOTAL`);\r\n write(`${fx(19)}OPERATING EXPENSES${fx(49)}TOE(13). ${ff(12, 6, toe[13])}`);\r\n write(`${fh(0)}${fx(19)}MINUS FINANCIAL`);\r\n write(`${fx(19)}MISCEL.EXPENSES (NET)${fx(46)}FME(13). ${ff(12, 6, fme[13])}`);\r\n write(`${fh(0)}${fx(19)}PROFIT BEFORE TAXES${fx(48)}PBT(13). ${ff(12, 6, pbt[13])}`); // 103\r\n write(`${fh(0)}${fx(19)}MINUS CORPORATION TAXES${fx(45)}CT(13). ${ff(12, 6, ct[13])}`);\r\n write(`${fh(0)}${fx(19)}PROFIT AFTER TAXES FOR BUDGET PERIOD${fx(31)}PAT(13). ${ff(12, 6, pat[13])}`);\r\n write(`${fh(0)}${fx(19)}DIVIDENDS DECLARED ${fx(48)} DD(13). ${ff(11, 6, dd[13])}`); // 104\r\n write(`${fh(0)}${fx(19)}CHANGES IN RETAINED EARNINGS${fx(39)}REX(13).${fx(6)}${ff(11, 6, rex[13])}`); // 105\r\n}", "cambio(){\n\n productos.forEach(producto => {\n if(producto.nombre === this.productoSeleccionado) this.productoActual = producto;\n });\n\n //Ver si el producto actual tiene varios precios\n if(this.productoActual.variosPrecios){\n //Verificar si sobrepasa algun precio extra\n\n //Si es menor al tope del primer precio\n if(this.cantidadActual < this.productoActual.precios.primerPrecio.hasta){\n this.precioActual = this.productoActual.precios.primerPrecio.precio;\n //Seteamos el precio tachado a 0 de nuevo\n this.precioPorUnidadTachado = 0;\n }\n //Si es mayor o igual al tope del primer precio pero menor al tope del segundo\n else if(this.cantidadActual >= this.productoActual.precios.primerPrecio.hasta && this.cantidadActual < this.productoActual.precios.segundoPrecio.hasta){\n this.precioActual = this.productoActual.precios.segundoPrecio.precio;\n //Asignamos un nuevo precio tachado\n this.precioPorUnidadTachado = this.productoActual.precios.primerPrecio.precio;\n }\n //Si es igual o mayor al tope del segundo precio\n else if(this.cantidadActual >= this.productoActual.precios.segundoPrecio.hasta){\n this.precioActual = this.productoActual.precios.tercerPrecio.precio;\n //Asignamos un nuevo precio tachado\n this.precioPorUnidadTachado = this.productoActual.precios.primerPrecio.precio;\n }\n }\n }", "function wykonaj_ruch_SI()\n{\n let ruchy = generuj_ruchy(), ruch_t;\n\n // sprawdzanie czy jest mat/pat\n if(ruchy.ruchy.length + ruchy.zbicia.length === 0)\n {\n if(czy_szach(szachownica.biale_ruch))\n {\n // mat, SI przegralo\n napisz_wynik(szachownica.biale_ruch ? 2 : 1);\n }\n else\n {\n // pat, remis\n napisz_wynik(3);\n }\n\n zablokowane = true;\n\n return;\n }\n\n // sprawdzanie pozostalych remisow\n if(szachownica.liczba_polowek_od_r > 100 || poprzednie_pozycje[szachownica.hash] >= 3 || !czy_wystarczajacy_material())\n {\n napisz_wynik(3);\n\n szachownica.biale_ruch = !szachownica.biale_ruch;\n zablokowane = true;\n\n return;\n }\n\n tablica_transp = new Map();\n\n let nr = Math.floor(Math.random() * (ruchy.ruchy.length + ruchy.zbicia.length));\n\n if(nr < ruchy.ruchy.length)\n ruch_t = ruchy.ruchy[nr];\n else\n ruch_t = ruchy.zbicia[nr - ruchy.ruchy.length];\n\n wykonaj_ruch(ruch_t);\n if(szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k] === 6 && ruch_t.wiersz_k === 7)\n {\n // promocja biale\n promuj_piona(ruch_t.wiersz_k, ruch_t.kolumna_k, Math.floor(Math.random() * 4) + 2);\n }\n else if(szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k] === 12 && ruch_t.wiersz_k === 0)\n {\n // promocja czarne\n promuj_piona(ruch_t.wiersz_k, ruch_t.kolumna_k, Math.floor(Math.random() * 4) + 8);\n }\n\n narysuj();\n}", "function calcHtotal() {\n\t//* G00 (PRODUTO B)\n\t$('#matGPF' + pad(0))\n\t\t\t.html(mESQ[0][0]+'<br>'+mESQ[0][1]+'<br>'+mESQ[0][2]+'<br>'+mESQ[0][3])\n\t$('#matCUT' + pad(0))\n\t\t\t.html(mCOD1[0][0]+'<br>'+mCOD1[0][1]+'<br>'+mCOD1[0][2]+'<br>'+mCOD1[0][3])\n\n\t//* PRIMEIRA À PENÚLTIMA\n\tfor (let index = 1; index < nGavs; index++) {\n\t\tlet nGPF = pad(index)\n\t\tlet source = document.getElementById('rngG' + nGPF)\n\t\tlet j = 1 * index\n\t\ttry {\n\t\t\tmESQ[j][0][0] = parseInt(source.value, 10)\n\t\t\t$('#codGPF' + pad(index)).html(calcCOD(index))\n\t\t\t$('#matGPF' + pad(index))\n\t\t\t.html(mESQ[index][0]+'<br>'+mESQ[index][1]+'<br>'+mESQ[index][2]+'<br>'+mESQ[index][3])\n\t\t\t$('#matCUT' + pad(index))\n\t\t\t.html(mCOD1[index][0]+'<br>'+mCOD1[index][1]+'<br>'+mCOD1[index][2]+'<br>'+mCOD1[index][3])\n\t\t\t\n\t\t\t//> Código incompleto\n\t\t\tif (mESQ[index][1][0] == 0 || (mESQ[index][2][0] == 0 && mESQ[index][3][0] == 0)\n\t\t\t\t|| ((mESQ[index][2][1] == index && mESQ[index][2][2] == 0) &&\n\t\t\t\t\t(mESQ[index][3][1] == index && mESQ[index][3][2] == 0))) {\n\t\t\t\t$('#codGPF' + pad(index)).css('opacity', 0.1)\n\t\t\t} else {\n\t\t\t\t$('#codGPF' + pad(index)).css('opacity', 1)\n\t\t\t}\n\t\t} catch (error) { }\n\t}\n\t//* ÚLTIMA GAVETA\n\t\t//_ console.log('nGavs='+nGavs)\n\t\tmESQ[nGavs][0][0] = 32\n\t\t$('#codGPF' + pad(nGavs)).html(calcCOD(nGavs))\n\t\t$('#matGPF' + pad(nGavs))\n\t\t.html(mESQ[nGavs][0] + '<br>' + mESQ[nGavs][1] + '<br>' + mESQ[nGavs][2] + '<br>' + mESQ[nGavs][3])\n\t\t$('#matCUT' + pad(nGavs))\n\t\t.html(mCOD1[nGavs][0] + '<br>' + mCOD1[nGavs][1] + '<br>' + mCOD1[nGavs][2] + '<br>' + mCOD1[nGavs][3])\n\t\t//> Código incompleto\n\t\tif (mESQ[nGavs][1][0]==0 || (mESQ[nGavs][2][0]==0 && mESQ[nGavs][3][0]==0)) {\n\t\t\t$('#codGPF' + pad(nGavs)).css('opacity', 0.1)\n\t\t} else {\n\t\t\t$('#codGPF' + pad(nGavs)).css('opacity', 1)\n\t\t}\n\n\thTotal = 0\n\tfor (let index = 1; index <= nGavs; index++) {\n\t\thTotal = hTotal + 1 * parseInt(mESQ[index][0][0])\n\t\tif (mESQ[index][0][0]=== NaN) { $('#z-flow-clog').html(index) } \n\t}\n\t//_ let target = document.getElementById('hTotal')\n\t//_ target.innerHTML = '&nbsp' + hTotal + 'mm'\n\t$('#hTotal').html('&nbsp' + hTotal + 'mm');\n\n\t$('#divESQ').css({ 'height': 220 + yOff * nGavs + \"px\" })\n}", "bouger()\r\n {\r\n this.gauche += Math.cos(this.angle) * this.vitesseX;\r\n this.haut += Math.sin(this.angle) * this.vitesseY;\r\n\r\n //Fonctions annexes\r\n this.limite();\r\n this.majHTML();\r\n }", "function completitud(oa, es){\n var titulo=0; var keyword=0; var descripcion=0; var autor=0;\n var tipoRE=0; var formato=0; var contexto=0; var idioma=0;\n var tipointer=0; var rangoedad=0; var nivelagregacion=0;\n var ubicacion=0; var costo=0; var estado=0; var copyright=0;\n\n // verifica que la variable tenga un valor y asigna el peso a las variables\n if (oa.title!=\"\") {\n titulo=0.15;\n }\n if (oa.keyword!=\"\") {\n keyword=0.14;\n }\n if (oa.description!=\"\") {\n descripcion=0.12;\n }\n if (oa.entity!=\"\") {\n autor=0.11;\n }\n if (oa.learningresourcetype!=\"\") {\n tipoRE=0.09;\n }\n if (oa.format!=\"\") {\n formato=0.08;\n }\n\n \n // hace la comprobacion cuantos contextos existe en el objeto\n var context=oa.context;\n // cuenta cuantas ubicaciones tiene el objeto\n var can=context.length;\n // asigna el nuevo peso que tendra cada contexto\n var pesocontexto=0.06/can;\n // comprueba que los contextos sean diferentes a vacio o a espacio \n for (var w=0; w <can ; w++) { \n if (context[w]!=\"\") {\n // calcula el nuevo peso para entregar para el calculo de la metrica\n contexto=contexto+pesocontexto;\n }\n }\n\n\n\n\n\n if (oa.language!=\"\") {\n idioma=0.05;\n }\n if (oa.interactivitytype!=\"\") {\n tipointer=0.04;\n }\n if (oa.typicalagerange!=\"\") {\n rangoedad=0.03;\n }\n if (oa.aggregationlevel!=\"\") {\n nivelagregacion=0.03;\n }\n // hace la comprobacion cuantas ubicaciones existe en el objeto\n var location=oa.location;\n // cuenta cuantas ubicaciones tiene el objeto\n var can=location.length;\n // asigna el nuevo peso que tendra cada ubicacion\n var peso=0.03/can;\n // comprueba que las ubicaciones sean diferentes a vacio o a espacio \n for (var i=0; i <can ; i++) { \n if (location[i]!=\"\") {\n // calcula el nuevo peso para entregar para el calculo de la metrica\n ubicacion=ubicacion+peso;\n }\n }\n \n\n if (oa.cost!=\"\") {\n costo=0.03;\n }\n if (oa.status!=\"\") {\n estado=0.02;\n }\n if (oa.copyrightandotherrestrictions!=\"\") {\n copyright=0.02;\n }\n\n \n \n // hace la sumatoria de los pesos \n var m_completitud=titulo + keyword + descripcion + autor + tipoRE + formato + contexto + idioma +\n tipointer + rangoedad + nivelagregacion + ubicacion + costo + estado + copyright;\n\n \n //alert(mensaje);\n return m_completitud;\n \n //echo \"* Completitud de: \".m_completitud.\"; \".evaluacion.\"<br>\";\n }", "function hitungLuasPersegi(sisi) {\n var luas = sisi * sisi;\n return luas;\n}", "function TinhTheoLoaiXe(sokm, tgcho, giaLoai1, giaLoai2, giaLoai3, tgChoTheoLoai) {\n var tien = 0;\n if (sokm <= 1) {\n tien = sokm * giaLoai1 + tgcho * tgChoTheoLoai;\n // console.log(tien);\n } else if (sokm > 1 && sokm < 21) {\n tien = giaLoai1 + (sokm - 1) * giaLoai2 + tgcho * tgChoTheoLoai;\n // console.log(tien);\n } else if (sokm >= 21) {\n tien = giaLoai1 + 19 * giaLoai2 + (sokm - 20) * giaLoai3 + tgcho * tgChoTheoLoai;\n // console.log(tien);\n }\n return document.getElementById('xuatTien').innerHTML = tien + ' vnđ';\n}", "function beratBadanWanita(tinggi){\r\n let ideal = (tinggi - 100) - (tinggi -100) * 0.15\r\n return `Wanita = ${ideal} Kg`; \r\n}", "function CalcolaCostoTotale() {\r\n var totale = 0.0;\r\n\t\t\tvar CostoPranzoAbbonamento = NumberEU(document.getElementById(\"prezzoAbbPranzo\").innerHTML);\r\n var CostoCenaAbbonamento = NumberEU(document.getElementById(\"prezzoAbbCena\").innerHTML);\r\n var CostoPranzoCenaAbbonamento = NumberEU(document.getElementById(\"prezzoAbbPranzoCena\").innerHTML);\r\n var CostoEventoSpecialeER = NumberEU(document.getElementById(\"prezzoEventoSpecialeER\").innerHTML);\r\n\t\t\t\r\n var Iscrizione = document.getElementById(\"Iscrizione\"); \r\n var PranzoAbbonamento = document.getElementById(\"AbbonamentoPranzo\");\r\n \tvar CenaAbbonamento = document.getElementById(\"AbbonamentoCena\");\r\n \tvar EventoSpecialeER = document.getElementById(\"EventoSpecialeER\");\r\n\r\n\t\t\tvar ruoloIscr = document.getElementById(\"RuoloIscritto\");\r\n\t\t\t\r\n\t\t\t// calcolo l'iscrizione\t\t\t\r\n\t\t\tif (IsStringNumeric(document.getElementById(\"prezzoIscrizione\").innerHTML)) {\r\n\t\t\t\tCostoIscrizione = document.getElementById(\"prezzoIscrizione\").innerHTML;\r\n\t\t\t} \r\n\t\t\tif (Iscrizione.checked){\r\n\t\t\t\ttotale += NumberEU(CostoIscrizione);\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t// calcolo i pranzi e le cene settimanali\r\n\t\t\tif (PranzoAbbonamento.checked && CenaAbbonamento.checked) {\r\n\t\t\t\t// abbonamento completo\r\n\t\t\t\ttotale += CostoPranzoCenaAbbonamento;\r\n\t\t\t} else {\t\t\t\r\n\t\t\t\tif (!PranzoAbbonamento.checked) {\r\n\t\t\t\t\t// pranzi singoli\r\n\t\t\t\t\tvar Pranzi = document.getElementsByName(\"Pranzo[]\");\r\n\t\t var CostoPranzi = document.getElementsByName(\"CostoPranzo[]\");\r\n\t\t var PranziGratis = document.getElementsByName(\"GratisPranzo[]\");\r\n\t\t for (i=0; i < PranziGratis.length; i++) {\r\n\t\t\t\t\t\tif (!PranziGratis[i].checked) {\r\n\t\t\t\t\t\t\tif (Pranzi[i].checked) {\r\n\t\t\t\t\t\t\t\tif (IsStringNumeric(CostoPranzi[i].value)) {\r\n\t\t\t\t\t\t\t\t\ttotale += NumberEU(CostoPranzi[i].value);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//abbonamento pranzo\r\n\t\t\t\t\ttotale += CostoPranzoAbbonamento;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (!CenaAbbonamento.checked) {\r\n\t\t\t\t\t// cene singole\r\n\t\t\t\t\tvar Cene = document.getElementsByName(\"Cena[]\");\r\n\t\t var CostoCene = document.getElementsByName(\"CostoCena[]\");\r\n\t\t var CeneGratis = document.getElementsByName(\"GratisCena[]\");\r\n\t\t for (i=0; i < CeneGratis.length; i++) {\r\n\t\t\t\t\t\tif (!CeneGratis[i].checked) {\r\n\t\t\t\t\t\t\tif (Cene[i].checked) {\r\n\t\t\t\t\t\t\t\tif (IsStringNumeric(CostoCene[i].value)) {\r\n\t\t\t\t\t\t\t\t\ttotale += NumberEU(CostoCene[i].value);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// abbonamento cena\r\n\t\t\t\t\ttotale += CostoCenaAbbonamento;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// calcolo la cena finale e gli ospiti\r\n\t\t\tif (document.getElementById(\"CenaFinale\").checked) {\r\n\t\t\t\tvar CostoCenaFinale = 0;\r\n\t\t\t\tvar NrOspiti = document.getElementById(\"NrOspiti\");\r\n\t var CostoTotale = document.getElementById(\"CostoTotaleEuroCalcolato\"); \r\n\t\t\t\tif (IsStringNumeric(document.getElementById(\"prezzoCenaFinale\").innerHTML)) {\r\n\t\t\t\t\tCostoCenaFinale = NumberEU(document.getElementById(\"prezzoCenaFinale\").innerHTML);\r\n\t\t\t\t}\r\n\t\t\t\tif (IsStringNumeric(NrOspiti.value)) {\r\n\t\t\t\t\t// se hanno l'abbonamento la cena finale e' gratis\t\t\t\t\t\r\n\t\t\t\t\tif (PranzoAbbonamento.checked && CenaAbbonamento.checked) {\t\t\t\t\t\r\n\t\t\t\t\t\ttotale += ((NrOspiti.value) * CostoCenaFinale);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\ttotale += ((NrOspiti.value) * CostoCenaFinale) + CostoCenaFinale;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// calcolo l'evento speciale\r\n\t\t\tif (EventoSpecialeER.checked) {\r\n\t\t\t\ttotale += CostoEventoSpecialeER;\r\n\t\t\t}\r\n\t\t\treturn totale;\r\n\t\t}", "function promedioFila(fila){\n var suma = 0;\n for (let index = 0; index < COLUMNAS; index++) {\n suma += matrix[fila][index];\n }\n return suma/COLUMNAS;\n}", "function principal(){\n\n borraCanvas();\n\n console.log(ratonX + ' - ' + ratonY);\n\n for(i=0; i<numParticulas;i++){\n particulas[i].actualiza();\n }\n\n}", "function botonPrecionado(peso) {\n\n switch (peso) {\n case 10:\n addPeso(peso);\n break;\n case 7.5://6.6\n addPeso(peso);\n break;\n case 4.3://3.3\n addPeso(peso);\n break;\n case 0:\n addPeso(peso);\n break;\n default:\n }\n indicePregunta++;\n if(indicePregunta < preguntas.length){\n cambiarPregunta();\n }\n else {\n analizarAptitudes();\n // document.getElementById(\"con1\").value = 1\n // document.getElementById(\"con2\").value = 1\n // document.getElementById(\"con3\").value = 1\n // document.getElementById(\"con4\").value = 1\n // document.getElementById(\"con5\").value = 1\n // document.getElementById(\"con6\").value = 1\n\n //enviar resultados a\n document.getElementById(\"voc-form\").submit();\n\n }\n }", "function hitungLuasSegitiga(alas,tinggi) {\n var luas = 1/2 * alas * tinggi;\n\n return luas;\n\n}", "function kelimasKvadratu(skaicius) {\n // atsakymas = skaicius * skaicius;\n atsakymas = Math.pow(skaicius, 2);\n console.log(atsakymas);\n}", "function optimal_compos_golden(adr)//mam sklad 7, szukam czy ktos na lawce sie nadaje//szukanie lepszego perfo-nie roz problem\n{\n if(adr==1)\n {\n \ttea = team1;//z tempo odczyt, a do tempz zapisuje;\n }\n else \n {\n \ttea = team2;//z tempo odczyt, a do tempz zapisuje;\n }\n//console.log(changes);\n var all_lawka = [];\n var item1 = [];\n var item2 = [];\n var item3 = [];\n var item4 = [];\n for(var i=1;i<=6;i++)//mam gwaracje, że przejdzie przez każdego R na ławce, ale dalej zawsze wybierze najlepszego\n {\t\n tea[0]=Array(0,0,0,0,0,0,0,0,0,0,0,0);\n item1 = [];item2 = [];item3 = [];item4 = [];\n\t\t\tfor(var j=8;j<=12;j++)\n\t\t\t{\n\t\t\t //item = [];\n if(tea[j][4]==\"R\" && i == 1)// i = 1 - sprawdzam każdego z ławki konkretnie za R\n\t\t\t {\n\t\t\t \tif(tea[j][11] > (tea[i][11]+1))\n {\n nadwyzka = tea[j][11] - tea[i][11];nadwyzka = zaokr(nadwyzka); \n item1 = [j, i, nadwyzka];\n all_lawka.unshift(item1);// \n }\n\t\t\t }\n if(tea[j][4]==\"A\" && i == 4)// i = 4\t\n\t\t\t {\n\t\t\t \tif(tea[j][6] > (tea[i][6]+1))\n {\n nadwyzka = tea[j][6] - tea[i][6];nadwyzka = zaokr(nadwyzka);\n item2 = [j, i, nadwyzka];\n all_lawka.unshift(item2);// \n }\n\t\t\t }\n item3 =[];\n if(tea[j][4]==\"P\" && (i == 2 || i == 5))// i = 2; i =5;\n\t\t\t {\n\t\t\t \tif( (tea[j][6]+tea[j][7])/2 > ((tea[i][6]+tea[i][7])/2)+1)\n {\n nadwyzka = (tea[j][6]+tea[j][7])/2 - ((tea[i][6]+tea[i][7])/2);nadwyzka = zaokr(nadwyzka);\n item3=[];\n item3 = [j, i, nadwyzka];\n test = all_lawka.unshift(item3);//\n //alert(\"test-length: \"+test+\" item: \"+item3);\n }\n\t\t\t }\n if(tea[j][4]==\"S\" && (i == 3 || i == 6))// i = 3; i =6;\n\t\t\t {\n\t\t\t \tif( (tea[j][6]+tea[j][9])/2 > ((tea[i][6]+tea[i][9])/2)+1)\n {\n nadwyzka = (tea[j][6]+tea[j][9])/2 - ((tea[i][6]+tea[i][9])/2);nadwyzka = zaokr(nadwyzka);\n item4 = [j, i, nadwyzka];\n all_lawka.unshift(item4);// \n }\n\t\t\t }\n } //end of for j=8..12\n //console.log(all_lawka);\n }//end of for i=1..6\n //sortowanie\n for(u=0; u<all_lawka.length; u++)\n {\n for(w=1; w<all_lawka.length; w++)\n {\n if(all_lawka[w][2] > all_lawka[w-1][2])\n {\n temp = all_lawka[w-1];\n all_lawka[w-1] = all_lawka[w];\n all_lawka[w] = temp;\n }\n }\n }\n //próba wykoanania zmiany\n for(u=0; u<all_lawka.length; u++)\n {\n out_id = all_lawka[u][1];\n in_id = all_lawka[u][0];\n out_nr = tea[out_id][3]; //na indeksie 1 mam wyznaczonego do zejścia - nr dla funkcji possible_change\n in_nr = tea[in_id][3]; //\n if(adr == 1)\n {\n if(possible_change(adr, out_nr, in_nr) < 6)\n {\nvar fffv = document.getElementById(\"screen3\").innerHTML;\ndocument.getElementById(\"screen3\").innerHTML=fffv+\"<br>(\"+pkt1+\":\"+pkt2+\") \"+tea[in_id][5]+\" za: \"+tea[out_id][5]+\" (stan: \"+mm1+\" : \"+mm2+\") \";\n//2021-01-13: nowy screen do zapisu zmian na czas seta\nvar fffv = document.getElementById(\"change_info1\").innerHTML;\ndocument.getElementById(\"change_info1\").innerHTML=fffv+\"<br>(\"+pkt1+\":\"+pkt2+\") \"+tea[in_id][5]+\" za \"+tea[out_id][5];\n change1(out_id,in_id); flag_golden1 = 1; return 0;\n }\n }\n else\n {\n if(possible_change(adr, out_nr, in_nr) < 6)\n {\nvar fffv = document.getElementById(\"screen6\").innerHTML;\ndocument.getElementById(\"screen6\").innerHTML=fffv+\"<br>(\"+pkt1+\":\"+pkt2+\") \"+tea[in_id][5]+\" za: \"+tea[out_id][5]+\" (stan: \"+mm1+\" : \"+mm2+\") \";\n//2021-01-13: nowy screen do zapisu zmian na czas seta\nvar fffv = document.getElementById(\"change_info2\").innerHTML;\ndocument.getElementById(\"change_info2\").innerHTML=fffv+\"<br>(\"+pkt1+\":\"+pkt2+\") \"+tea[in_id][5]+\" za \"+tea[out_id][5];\n change2(out_id,in_id); flag_golden2 = 1; return 0;\n }\n }\n }\n\n\n if(adr==1)\n {\n team1 = tea;\n }\n else \n {\n team2 = tea;\n }\n\n banch_ins();\n return 1;\n}", "function calcularTotal(){\n //borrar el precio \n total=0;\n //recorrer el array de la cesta y obtener el precio de cada producto\n for(let item of arrayCesta){\n let itemcesta=productos.filter(function(objetoproductos){\n return objetoproductos['tag']==item;\n });\n //se suma el total\n total=total+itemcesta[0]['precio'];\n }\n //mostrar el precio\n $total.textContent=total.toFixed(2);\n}", "function spindulioReiksme () {\n// let ivedimoLaukas = document.querySelector('div input');\n let r = document.querySelector('div input').value;\n let plotas= Math.PI*r*r\n\n// console.log(plotas);\ndocument.querySelector(\".apskritimo-plotas\").innerHTML = plotas;\n}", "function traceAvecP() {\n\tvar equation = document.getElementById('input').value;\n\tequation = equation.replace(/,/g, '.');\n\t// rempalce les \",\" par \".\"\n\tvar erreur = validation(equation);\n\tdocument.getElementById('btnresetter').disabled = false;\n\t//activation du bouton Reset\n\tif (erreur < 0) {\n\t\tdocument.getElementById('btnrnd').disabled = true;\n\t\t// on scelle le bouton de soummission\n\t\tpente = parametreA(tokenize(equation));\n\t\tordonnee = parametreB(tokenize(equation));\n\t\texp = exposant(tokenize(equation));\n\t\tzoomPlan(exp, pente, ordonnee);\n\t\tif (exp == 0) {\n\t\t\ttypeEquation = 0;\n\t\t\tdocument.getElementById('btnpente').disabled = false;\n\t\t\t//activation du bouton Pente\n\t\t\tdocument.getElementById('btnAfficOrd').disabled = false;\n\t\t\t//activation du bouton Ordonnee\n\t\t\tpointLineaire();\n\t\t} else if (exp != 0) {\n\t\t\ttypeEquation = 1;\n\t\t\tdocument.getElementById('btnAfficOrd').disabled = false;\n\t\t\t//activation du bouton Ordonnee\n\t\t\tdocument.getElementById('btnAxeStm').disabled = false;\n\t\t\t//activation du bouton Axe symétrie\n\t\t\tdocument.getElementById('btnAfficZero').disabled = false;\n\t\t\t//activation du bouton Les zéros\n\t\t\tpointQuadratique();\n\t\t}\n\n\t\t// affichage dynamique de l'ordonnée dans la bulle externe\n\t\tif (typeEquation == 1) {\n\t\t\tif (dynamiqueB() < 0 && dynamiqueC() < 0) {// si l'ordonnee ou la pente est une valeur negative, les mettre entre ()\n\t\t\t\tboard.on('update', function() {\n\t\t\t\t\tdocument.getElementById('ordonneeEquationQuadratique').innerHTML = \"y = \" + dynamiqueA() + 'x² +(' + dynamiqueB() + ')' + '+(' + dynamiqueC() + ')';\n\t\t\t\t});\n\t\t\t} else if (dynamiqueB() < 0 && dynamiqueC() >= 0) {\n\t\t\t\tboard.on('update', function() {\n\t\t\t\t\tdocument.getElementById('ordonneeEquationQuadratique').innerHTML = \"y = \" + dynamiqueA() + 'x² +(' + dynamiqueB() + ')' + \"+ \" + dynamiqueC();\n\t\t\t\t});\n\t\t\t} else if (dynamiqueC() < 0 && dynamiqueB() >= 0) {\n\t\t\t\tboard.on('update', function() {\n\t\t\t\t\tdocument.getElementById('ordonneeEquationQuadratique').innerHTML = \"y = \" + dynamiqueA() + 'x² + ' + dynamiqueB() + \"+(\" + dynamiqueC() + ')';\n\t\t\t\t});\n\t\t\t} else if (dynamiqueC() >= 0 && dynamiqueB() >= 0) {\n\t\t\t\tboard.on('update', function() {\n\t\t\t\t\tdocument.getElementById('ordonneeEquationQuadratique').innerHTML = \"y = \" + dynamiqueA() + 'x² + ' + dynamiqueB() + dynamiqueC();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tboard.on('update', function() {\n\t\t\t\tdocument.getElementById('ordonneeFormuleQuadratique').innerHTML = \"Ordonnée = \" + dynamiqueC();\n\t\t\t});\n\t\t}\n\t} else {// affichage des erreurs\n\t\tvar input = document.getElementById('input');\n\t\tinput.selectionStart = erreur;\n\t\tinput.selectionEnd = ++erreur;\n\t\tinput.focus();\n\t\tenterPr = false;\n\t}\n}", "function hitungLuasSegiTiga(alas,tinggi){\n var luas = 0.5 * alas * tinggi\n return luas\n}", "function mostrarprmaelementocequiv(habp,com){\n\n\t\t\t//////////////////////////////////PLAN HABILITADORAS ////////////////////////////////////////////////\t\t\t\n\t\t\t\t\t\t// ESFUERZO PROPIO PLAN EN BOLIVARES \t\t\t\t\t\n\t\t\t\t\t\tvar laborep = filtrarcostohab(habp,filtrolabor,5,com,1);\n\t\t\t\t\t\tvar bbep = filtrarcostohab(habp,filtrobb,5,com,1);\n\t\t\t\t\t\tvar mep = filtrarcostohab(habp,filtrom,5,com,1);\n\t\t\t\t\t\tvar scep = filtrarcostohab(habp,filtrosc,5,com,1);\n\t\t\t\t\t\tvar oep = filtrarcostohab(habp,filtroo,5,com,1);\n\t\t\t\t\t\tvar totalep = filtrartotal(laborep,bbep,mep,scep,oep);\n \n \t\t\t\t\t\t \t\t // ESFUERZOS PROPIOS PLAN EN DOLARES\n \t\t\t\t\t\t var laborepdol = filtrarcostohab(habp,filtrolabor,5,com,2);\n \t\t\t\t\t\t var bbepdol = filtrarcostohab(habp,filtrobb,5,com,2);\n \t\t\t\t\t\t var mepdol = filtrarcostohab(habp,filtrom,5,com,2);\n \t\t\t\t\t\t var scepdol = filtrarcostohab(habp,filtrosc,5,com,2);\n \t\t\t\t\t\t var oepdol = filtrarcostohab(habp,filtroo,5,com,2);\n \t\t\t\t\t\t var totalepdol = filtrartotal(laborepdol,bbepdol,mepdol,scepdol,oepdol);\n\n \t\t\t\t\t\t // DTTO ORIENTAL PLAN EN BOLIVARES\n\t\t\t\t\t \t var labordtto = filtrarcostohab(habp,filtrolabor,4,com,1);\n \t\t\t\t\t\t var bbdtto = filtrarcostohab(habp,filtrobb,4,com,1);\n \t\t\t\t\t\t var mdtto = filtrarcostohab(habp,filtrom,4,com,1);\n \t\t\t\t\t\t var scdtto = filtrarcostohab(habp,filtrosc,4,com,1);\n \t\t\t\t\t\t var odtto = filtrarcostohab(habp,filtroo,4,com,1);\n \t\t\t\t\t\t var totaldtto = filtrartotal(labordtto,bbdtto,mdtto,scdtto,odtto);\n\n \t\t\t\t\t\t // DTTO ORIENTAL PLAN EN DOLARES\n \t\t\t\t\t\t var labordttodol = filtrarcostohab(habp,filtrolabor,4,com,2);\n \t\t\t\t\t\t var bbdttodol = filtrarcostohab(habp,filtrobb,4,com,2);\n \t\t\t\t\t\t var mdttodol = filtrarcostohab(habp,filtrom,4,com,2);\n \t\t\t\t\t\t var scdttodol = filtrarcostohab(habp,filtrosc,4,com,2);\n \t\t\t\t\t\t var odttodol = filtrarcostohab(habp,filtroo,4,com,2);\n \t\t\t\t\t\t var totaldttodol = filtrartotal(labordttodol,bbdttodol,mdttodol,scdttodol,odttodol);\n\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL PLAN EN BOLIVARES\n \t\t\t\t\t\t var labordivo = filtrardivo(labordtto,laborep);\n \t\t\t\t\t\t var bbdivo = filtrardivo(bbdtto,bbep);\n \t\t\t\t\t\t var mdivo = filtrardivo(mdtto,mep);\n \t\t\t\t\t\t var scdivo = filtrardivo(scdtto,scep);\n \t\t\t\t\t\t var odivo = filtrardivo(odtto,oep);\n \t\t\t\t\t\t var totaldivo = filtrartotal(labordivo,bbdivo,mdivo,scdivo,odivo);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL PLAN EN DOLARES\n \t\t\t\t\t\t var labordivodol = filtrardivo(labordttodol,laborepdol);\n \t\t\t\t\t\t var bbdivodol = filtrardivo(bbdttodol,bbepdol);\n \t\t\t\t\t\t var mdivodol = filtrardivo(mdttodol,mepdol);\n \t\t\t\t\t\t var scdivodol = filtrardivo(scdttodol,scepdol);\n \t\t\t\t\t\t var odivodol = filtrardivo(odttodol,oepdol);\n \t\t\t\t\t\t var totaldivodol = filtrartotal(labordivodol,bbdivodol,mdivodol,scdivodol,odivodol);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL PLAN EN DOLARES EQUIVALENTES\n \t\t\t\t\t\t var labordivoDeqv = filtroequivalente(labordivo,labordivodol);\n \t\t\t\t\t\t var bbdivoDeqv = filtroequivalente(bbdivo,bbdivodol);\n \t\t\t\t\t\t var mdivoDeqv = filtroequivalente(mdivo,mdivodol);\n \t\t\t\t\t\t var scdivoDeqv = filtroequivalente(scdivo,scdivodol);\n \t\t\t\t\t\t var odivoDeqv = filtroequivalente(odivo,odivodol);\n \t\t\t\t\t\t var totaldivoDeqv = filtrartotal(labordivoDeqv,bbdivoDeqv,mdivoDeqv,scdivoDeqv,odivoDeqv);\n\n \t\t\t\t\t\t ////////////////////// FIN PLAN ////////////////////////////////////////////////\n \t\t\t\t\t\t var laborybbdivoDeqv = filtrardivo(labordivoDeqv,bbdivoDeqv);\n\n \t\t\t\t\t\t\n \t\t\t\t\t\tvar\tinformacion = cabeceracategoriaprmva('red-header','ELEMENTO DE COSTO');\n \t\t\t\t\t\t\tinformacion += mostrarcategoriaprmva('','Labor y Beneficios',laborybbdivoDeqv); \n \t\t\t\t\t\t\tinformacion += mostrarcategoriaprmva('','Materiales',mdivoDeqv);\n \t\t\t\t\t\t\tinformacion += mostrarcategoriaprmva('','Servicios y Contratos',scdivoDeqv);\n \t\t\t\t\t\t\tinformacion += mostrarcategoriaprmva('','Otros Costos y Gastos',odivoDeqv);\n \t\t\t\t\t\t\tinformacion += mostrarcategoriaprmva('red-header','Total',totaldivoDeqv); \n \t\t\t\t\treturn informacion;\n\n}", "function thememascot_fitVids() {\n $('body').fitVids();\n }", "function fl_outToGvina ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "function actualizarPrecio() {\n var precioModelo = precioModelos[almohadonNuevo.modelo];\n var precioForma = precioFormas[almohadonNuevo.forma];\n var precioColor = precioColores[almohadonNuevo.color];\n var precioTexto = 0;\n if (hayTexto)\n precioTexto = 50;\n var total = parseFloat(precioModelo)+parseFloat(precioForma)+parseFloat(precioColor)+parseFloat(precioTexto);\n $(\"#precioModelo\").text(\"$\"+precioModelo);\n $(\"#precioForma\").text(\"$\"+precioForma);\n $(\"#precioColor\").text(\"$\"+precioColor);\n $(\"#precioTexto\").text(\"$\"+precioTexto);\n $(\"#precioTotal\").text(\"$\"+total);\n}", "function calcularTasaMuerta(id) {\r\n //Obtener el valor de la Amortizacion\r\n var lista1 = document.getElementById(\"amortizacion1\");\r\n var amort_cf1 = lista1.options[lista1.selectedIndex].text;\r\n //Si el usuario ingresa el valor Efectivo anual\r\n if (id == \"EA1\") {\r\n \t\r\n //Si es mensual\r\n if (amort_cf1 == \"Mensual\") {\r\n\t\t\r\n tasa_ip_cf1 = (Math.pow((1 + (parseFloat(document.getElementById(\"tasa_EA_cf1\").value) / 100)), (30 / 360)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 12;\r\n tasa_ea_cf1 = (Math.pow((1 + (tasa_ip_cf1 / 100)), (360 / 30)) - 1) * 100;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n //alert(document.getElementById(\"tasa_EA_cf1\").value);\r\n \r\n\r\n } else {\r\n //Si es trimestral\r\n tasa_ip_cf1 = (Math.pow((1 + (parseFloat(document.getElementById(\"tasa_EA_cf1\").value) / 100)), (90 / 360)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 4;\r\n tasa_ea_cf1 = (Math.pow((1 + (tasa_ip_cf1 / 100)), (360 / 90)) - 1) * 100;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n }\r\n }\r\n\r\n if (id == \"NA1\") {\r\n //Si es mensual\r\n if (amort_cf1 == \"Mensual\") {\r\n tasa_ip_cf1 = (parseFloat(document.getElementById(\"tasa_NA_cf1\").value) / 12);\r\n tasa_ea_cf1 = (Math.pow((1 + (tasa_ip_cf1 / 100)), (360 / 30)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 12;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n } else {\r\n //Si es trimestral\r\n tasa_ip_cf1 = (parseFloat(document.getElementById(\"tasa_NA_cf1\").value) / 4);\r\n tasa_ea_cf1 = (Math.pow((1 + (tasa_ip_cf1 / 100)), (360 / 90)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 4;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n }\r\n }\r\n\r\n if (id == \"Ip1\") {\r\n //Si es mensual\r\n if (amort_cf1 == \"Mensual\") {\r\n tasa_ea_cf1 = (Math.pow((1 + (parseFloat(document.getElementById(\"tasa_Ip_cf1\").value) / 100)), (360 / 30)) - 1) * 100;\r\n tasa_ip_cf1 = (Math.pow((1 + (tasa_ea_cf1 / 100)), (30 / 360)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 12;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n } else {\r\n //Si es trimestral\r\n tasa_ea_cf1 = (Math.pow((1 + (parseFloat(document.getElementById(\"tasa_Ip_cf1\").value) / 100)), (360 / 90)) - 1) * 100;\r\n tasa_ip_cf1 = (Math.pow((1 + (tasa_ea_cf1 / 100)), (90 / 360)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 4;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n }\r\n }\r\n}", "function getPelnas(pajamos, mokesciai, mokesciai2){\nvar pelnas = (pajamos - (pajamos * mokesciai)) - (pajamos - (pajamos * mokesciai)) * mokesciai2;\n return pelnas;\n}", "function sum(awalderet, akhirderet, step){\n if(awalderet != null && akhirderet != null && step == null){ //jika step kosong maka nilainya 1\n step = 1;\n var tampung = rangeWithStep(awalderet, akhirderet, step);\n var total = 0;\n\n for(i = 0; i < tampung.length; i++){\n total += tampung [i]\n }\n return total;\n\n }//jika semua parameter tidak null maka masuk ke sini\n else if(awalderet != null && akhirderet != null && step != null){\n var tampung = rangeWithStep(awalderet, akhirderet, step);\n var total = 0;\n\n for(i = 0; i < tampung.length; i++){\n total += tampung [i]\n }\n return total;\n\n }//jika hanya terdapat parameter awalderet maka sum bernilai awalderet\n else if(awalderet != null && akhirderet == null && step == null){\n total = awalderet;\n return total;\n }//jika parameter kosong semua maka return 0;\n else{\n return 0;\n }\n\n}", "calcPay() {\n //filter\n // gaunu sarasa kuriame yra tik done projektai\n let doneProjektai = this.#currentProjects.filter((prObj) => prObj.projectDone === true);\n // console.log(\"doneProjektai\", doneProjektai);\n\n // paskaiciuoju bendra visu projektu kaina\n let moketinaSuma = doneProjektai.reduce((total, prObj) => total + prObj.price, 0);\n // console.log(\"moketinaSuma\", moketinaSuma);\n\n // gale turi likti currentProjects tik tie el kuriu done yra lygu false\n // console.table(this.#currentProjects);\n this.#currentProjects = this.#currentProjects.filter((prObj) => prObj.projectDone === false);\n // console.table(this.#currentProjects);\n // grazinti moketina suma\n return moketinaSuma;\n }", "function llogarit()\n{\n\n\tmerr();\n\n\tvar piket = 0;\n\n\tvar shumaKrediteve = 0;\n\n\tfor( var i = 0; i < fushatAktive.length; i++ )\n\t{\t\n\n\t\tvar kredit = LENDET[ fushatAktive[ i ].pozicioni ].kreditet;\n\n\t\tpiket += kredit * fushatAktive[ i ].vlera;\n\n\t\tshumaKrediteve += kredit;\n\n\t}\n\n\tif( gabim == true )\n\t{\n\n\t\tdocument.getElementById( \"pergjigja\" ).innerHTML = mesazhGabimi;\n\t}\n\telse\n\t{\t\n\t\tvar mesatarja = piket / shumaKrediteve;\n\n\t\tvar string = \"<br>Piket: \" + piket + \"<br>Kreditet: \" + shumaKrediteve + \"<br><b>Mesatarja: \" + mesatarja.toFixed( 2 ) + \"</b>\";\n\n\t\tdocument.getElementById( \"pergjigja\" ).innerHTML = string;\n\t}\n\n\t/// ngrirja e butonave\n\tdocument.querySelector( \"button\" ).disabled = true ;\n\n\tgabim = false;\n\n\tfushatAktive = [];\n}///FUND llogarit", "function evaluate(criterios){\n for(let criterio of criterios){\n let modelo = criterio.notas.modelo\n let resultado = criterio.resultado\n \n /*\n #1\n modelo: {\n peso: 1,\n intervalo: {\n tipo: discreto,\n valor: [0, 5]\n }\n }\n resultado: 3\n \n #2\n modelo: {\n peso: 2,\n lista: [{\n texto: Danificada,\n valor: -1\n }, {...}, ...]\n }\n resultado: [0, 3]\n\n #3\n modelo: {\n peso: 2,\n boleano: {\n texto: Pets,\n valor: true/false\n }\n }\n resultado: true\n */\n \n let normal;\n if(modelo.intervalo){\n normal = (resultado - modelo.intervalo.valor[0])/(modelo.intervalo.valor[1] - modelo.intervalo.valor[0])\n }else if(modelo.booleano){\n normal = +(resultado == modelo.booleano.valor) * modelo.booleano.peso\n }else if(modelo.lista){\n let soma = modelo.lista.filter((v, i) => {\n return i in resultado\n }).reduce((acc, cur) => {\n return acc + cur.valor\n }, 0)\n let lista_ordenada = modelo.lista.sort((a, b) => a.valor - b.valor)\n let len_lista = modelo.lista.length\n \n let minimo = lista_ordenada[0].valor\n let maximo = lista_ordenada[len_lista-1].valor\n \n normal = (soma - minimo) / (maximo - minimo)\n }\n \n criterio.normal = normal\n criterio.normal_ponderada = normal * modelo.peso \n }\n \n let peso_total = criterios.reduce((acc, cur) => {\n return acc + cur.notas.peso\n }, 0)\n let nota_normal_ponderada_total = criterios.reduce((acc, cur) => acc + cur.normal_ponderada, 0)\n \n let nota_final = nota_normal_ponderada_total / peso_total\n \n return {\n final: nota_final,\n criterios: criterios.map(c => {\n return {\n resultado: c.resultado,\n normal: c.normal,\n peso: c.notas.peso,\n ponderada: c.ponderada\n }\n })\n }\n }", "asistenciasTotalesPorDia(equipo){\n let len = equipo.length;\n let asistencia_total = [];\n let total_lunes=0;\n let total_martes=0;\n let total_miercoles=0;\n let total_jueves=0;\n let total_viernes=0;\n let total_sabado=0;\n let total_domingo=0;\n \n for (var i = 0; i <len; ++i) {\n total_lunes = total_lunes + (equipo[i].asistencia.lunes * equipo[i].factor_dias_laborados);\n total_martes = total_martes+ (equipo[i].asistencia.martes * equipo[i].factor_dias_laborados);\n total_miercoles = total_miercoles + (equipo[i].asistencia.miercoles * equipo[i].factor_dias_laborados);\n total_jueves = total_jueves + (equipo[i].asistencia.jueves * equipo[i].factor_dias_laborados);\n total_viernes = total_viernes + (equipo[i].asistencia.viernes * equipo[i].factor_dias_laborados);\n total_sabado = total_sabado + (equipo[i].asistencia.sabado * equipo[i].factor_dias_laborados);\n // total_domingo = total_domingo + (equipo[i].asistencia.domingo * equipo[i].factor_dias_laborados);\n }\n\n asistencia_total.push(total_lunes);\n asistencia_total.push(total_martes);\n asistencia_total.push(total_miercoles);\n asistencia_total.push(total_jueves);\n asistencia_total.push(total_viernes);\n asistencia_total.push(total_sabado);\n // asistencia_total.push(total_domingo);\n\n \n return asistencia_total;\n }", "function sumaRazFunc(niz, ajdi)\n{\n\tvar tmp = 0;\n\n\tif (niz[0] >= 0 && niz[6] >=0 && niz[7] >=0)\n\t{\n\t\ttmp = (niz[6] - niz[7])*niz[0];\n\t\tdocument.getElementById(ajdi).innerText=tmp;\n\tvar i1 = Number(document.getElementById(\"suma5\").innerText);\n\tvar i2 = Number(document.getElementById(\"suma6\").innerText);\n\tvar i3 = Number(document.getElementById(\"suma7\").innerText);\n\tvar i4 = Number(document.getElementById(\"suma8\").innerText);\n\n\ti1 = i1 + i2 + i3 + i4;\n\tdocument.getElementById(\"suma14\").innerText=i1;\n\n\t\n\tvar i1 = Number(document.getElementById(\"suma13\").innerText);\n\tvar i2 = Number(document.getElementById(\"suma14\").innerText);\n\tvar i3 = Number(document.getElementById(\"suma15\").innerText);\n\t\n\ti1 = i1 + i2 + i3;\n\tdocument.getElementById(\"konrez\").innerText=i1;\n\t}\n}", "calculPricePni(){\n this.panierPrice = 0;\n for (let product of this.list_panier) {\n var price = product.fields.price*product.quantit;\n this.panierPrice = this.panierPrice+price;\n }\n //on arrondi le price au deuxieme chiffre apres la virgule\n this.panierPrice = this.panierPrice.toFixed(2);\n }", "function DescuentoAusencia(){\n //recupero el valor de ausencia\n var sal_aus= document.getElementById(\"sal_aus\").value;\n var SaldoNeto= document.getElementById('sueldoNeto').value;\n //reestablece los valores al cambiar dias\n if(sal_aus > 0)\n {\n var suma=parseFloat(SaldoNeto) + parseFloat(sal_aus);\n document.getElementById(\"sueldoNeto\").value=suma;\n \n }\n var SueldoBrutoIni=document.getElementById('sueldoBruto').value;\n //calcula el jpornal diario\n var jornal=SueldoBrutoIni/30;\n //obtiene la cantidad de dias\n var dias=document.getElementById('DiaAusencia').value;\n //calcula jornal diario por cantidad de dias\n document.getElementById(\"sal_aus\").value=jornal*dias;\n //Actualiza el neto a cobrar\n var SaldoNeto= document.getElementById('sueldoNeto').value;\n document.getElementById(\"sueldoNeto\").value=SaldoNeto-(jornal*dias);\n //guardamos el valor de salario neto(esto se actualizara con cada descuento)\n var sueldoneto=document.getElementById('sueldoNeto').value;\n document.getElementById(\"sal_neto\").value=sueldoneto;\n \n \n }", "function uspjesnost() {\n let brojRijesenih = 0;\n let procenat = 0;\n\n zadaci.forEach(zadatak => {\n if (zadatak.zavrsen === true) {\n brojRijesenih++;\n }\n })\n procenat = ((brojRijesenih / zadaci.length) * 100).toFixed(2);\n\n if (procenat < 50) {\n document.getElementById(\"uspesnost\").style.color = \"#DC143C\";\n } else {\n document.getElementById(\"uspesnost\").style.color = \"#00AD56\";\n }\n if (zadaci.length == 0) {\n document.getElementById('uspesnost').innerHTML = '';\n } else {\n document.getElementById('uspesnost').innerHTML = '<h6>Uspjesnost: ' + procenat + '%</h6>';\n }\n}", "function staciakampoPlotas(ilgis, aukstis) {\n return ilgis * aukstis;\n}", "function hitungRetribusi() {\n var reqData = vm.formData.items;\n var req = {\n method: 'PUT',\n url: EnvironmentConfig.api + 'FormulaRetribusi/hitungRetribusi/' + permohonanIzinId,\n headers: {\n 'Content-Type': 'application/json; charset=UTF-8'\n },\n data: reqData\n };\n vm.enableSubmit = false;\n\n $http(req)\n .success(function (res) {\n vm.total = res.data.total;\n AppFactory.showToast(res.message);\n })\n .error(function (err) {\n AppFactory.showToast(err.message, 'error', err.errors);\n })\n .finally(function () {\n vm.enableSubmit = true;\n });\n }", "function coherencia(objeto){\n // extrae las variables nesesarias para la evaluacion\n var estructura= objeto.structure;\n var nivelagregacion=objeto.aggregationlevel;\n var tipointeractividad=objeto.interactivitytype; \n var nivelinteractivo=objeto.interactivitylevel;\n var tiporecursoeducativo=objeto.learningresourcetype;\n \n //inicializa las reglas y las variables de los pesos\n var r=0;\n var pesor1=0;\n var pesor2=0;\n var pesor3=0;\n\n //verifica las reglas que se van a evaluar\n if (estructura===\"atomic\" && nivelagregacion===\"1\"){\n r++;\n pesor1=1;\n }else if (estructura===\"atomic\" && nivelagregacion===\"2\"){\n r++;\n pesor1=0.5;\n }else if (estructura===\"atomic\" && nivelagregacion===\"3\"){\n r++;\n pesor1=0.25;\n }else if (estructura===\"atomic\" && nivelagregacion===\"4\"){\n r++;\n pesor1=0.125;\n }else if (estructura===\"collection\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5;\n }else if (estructura===\"networked\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"hierarchical\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"linear\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"collection\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"networked\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"hierarchical\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"linear\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion ===\"4\") ){\n r++;\n pesor1=1; \n }\n\n if (tipointeractividad===\"active\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\" || \n nivelinteractivo===\"medium\" || \n nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n $r++;\n $pesor2=1; \n }else if (tipointeractividad===\"mixed\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\" || \n nivelinteractivo===\"medium\" || \n nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n r++;\n pesor2=1;\n }else if (tipointeractividad===\"expositive\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\") ){\n r++;\n pesor2=0;\n }else if (tipointeractividad===\"expositive\" && nivelinteractivo===\"medium\" ){\n r++;\n pesor2=0.5;\n }else if (tipointeractividad===\"expositive\" && ( nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n r++;\n pesor2=1;\n } \n if ( tipointeractividad===\"active\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\") ){\n r++;\n pesor3=1; \n }else if (tiporecursoeducativo===\"active\" && (tiporecursoeducativo===\"diagram\" || \n tiporecursoeducativo===\"figure\" || \n tiporecursoeducativo===\"graph\" || \n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\") ){\n r++;\n pesor3=0;\n \n }else if (tipointeractividad===\"expositive\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\") ){\n r++;\n pesor3=0; \n }else if (tipointeractividad===\"expositive\" && (tiporecursoeducativo===\"diagram\" || \n tiporecursoeducativo===\"figure\" || \n tiporecursoeducativo===\"graph\" || \n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\") ){\n r++;\n pesor3=1;\n }else if (tipointeractividad===\"mixed\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\" ||\n tiporecursoeducativo===\"diagram\" ||\n tiporecursoeducativo===\"figure\" ||\n tiporecursoeducativo===\"graph\" ||\n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\" )){\n r++;\n pesor3=1; \n } \n m_coherencia=0;\n if (r>0) {\n\n // hace la sumatoria de los pesos \n m_coherencia= ( pesor1 + pesor2 + pesor3) / r;\n \n \n //alert(mensaje);\n return m_coherencia;\n //echo \"* Coherencia de: \". m_coherencia.\"; \". evaluacion.\"<br><br>\";\n }else{\n \n return m_coherencia;\n \n }\n\n\n }", "function Descuento20(){\n //recuperamos el valor descuento20 anterior\n var descuento20=document.getElementById(\"sal_pyt20\").value;\n //recuperamos el sueldo neto del input\n var SueldoNeto=document.getElementById('sueldoNeto').value;\n //si anteriormente ya tenia un valor, debe reestablecer\n if(descuento20 > 0)\n {\n var suma=parseFloat(SueldoNeto) + parseFloat(descuento20);\n document.getElementById(\"sueldoNeto\").value=suma;\n }\n //sueldo bruto inicial\n var SaldoBrutoIni=document.getElementById('sueldoBruto').value;\n //calcula el jpornal diario\n var jornal=SaldoBrutoIni/30;\n //obtiene dias de permisos/llegada tardia\n var dias= document.getElementById('descuento20').value;\n //descuento por dia de 20 %\n var descuento20=((jornal*20)/100)\n //obtener el valor actual del sal_pyt//esto se debe sumar al total de descuento sal aso\n //de 20, 40 y 50 por ciento.\n document.getElementById(\"sal_pyt20\").value=(descuento20*dias);\n //Actualiza el neto a cobrar\n var SaldoNeto= document.getElementById('sueldoNeto').value;\n document.getElementById(\"sueldoNeto\").value=SaldoNeto-(descuento20*dias);\n //guardamos el valor de salario neto(esto se actualizara con cada descuento)\n var sueldoneto=document.getElementById('sueldoNeto').value;\n document.getElementById(\"sal_neto\").value=sueldoneto;\n }", "function dvakrat(cislo) {\r\n return cislo * 2;\r\n}", "function calcularIva(){\n var tasaIva = 12;\n var monto = 300;\n var iva;\n\n //Calculo del Iva\n console.log(\"Calculo de iva: \")\n console.log(iva = (monto * tasaIva)/100);\n \n}", "function calculateProduksi() {\n var permintaan = document.getElementById('permintaan').value;\n var persediaan = document.getElementById('persediaan').value;\n\n document.write(defuzzyfikasi(permintaan, persediaan));\n }", "function calculocompraslocales(cant,costo)\n{\n var ret; \n var pu//preciounitario\n pu=costo/cant;// calculamos el costo unitario \n //if($(\"#nfact_imp\").val()!=\"SF\") //si tiene el texto SF es sin factura \n // ret=pu*glob_factorIVA; //confactura\n //else \n // ret=pu*glob_factorRET+pu; //sinfactura \n // return ret;\n\n}", "function testSerial() {\n emptyBoxes();\n testCommon();\n $(\"#serialBox\").append(\"<h3>Seriální koeficient korelace</h3>\");\n $(\"#serialBox\").append(\"$H_0: \\\\rho_k = 0$<br/>\");\n $(\"#serialBox\").append(\"$H_1: \\\\rho_k \\\\neq 0$ <br/><br/>\");\n\n // SERIALNI KORELACE\n $(\"#serialBox\").append(\"<table class='table table-striped table-condensed' id='serialTable'>\" +\n \"<tr><th>$k$</th><th>$r_k$</th><th>$r_k \\\\sqrt{n-k}$</th><th>Výsledek pro $\\\\alpha = 0,05$</th></tr></table>\");\n\n var cochSumri2 = 0;\n // TODO k < n\n for(k = 1; k <= 10; k++) {\n // Cinitel\n var pom1 = 0;\n for(i = 1; i <= n - k; i++) {\n var sumXj1 = 0;\n for(j = 1; j <= n - k; j++) {\n sumXj1 += listNumbers[j - 1];\n }\n\n var sumXj2 = 0;\n for(j = k; j <= n; j++) {\n sumXj2 += listNumbers[j - 1];\n }\n pom1 += (listNumbers[i - 1] - (1 / (n - k)) * sumXj1) * (listNumbers[i + k - 1] - (1 / (n - k)) * sumXj2);\n }\n var rkCov = pom1 / (n - k);\n\n // Jmenovatel leva cast\n var sum3 = 0;\n for(i = 1; i <= n - k; i++) {\n var sumXj3 = 0;\n for(j = 1; j <= n - k; j++) {\n sumXj3 += listNumbers[j - 1];\n }\n sum3 += (listNumbers[i - 1] - (1 / (n - k)) * sumXj3) * (listNumbers[i - 1] - (1 / (n - k)) * sumXj3);\n }\n var variance1 = (1 / (n - k)) * sum3;\n\n // Jmenovatel prava cast\n var sum4 = 0;\n for(i = 1; i <= n - k; i++) {\n var sumXj4 = 0;\n for(j = k; j <= n; j++) {\n sumXj4 += listNumbers[j - 1];\n }\n sum4 += (listNumbers[i + k - 1] - (1 / (n - k)) * sumXj4)\n * (listNumbers[i + k - 1] - (1 / (n - k)) * sumXj4);\n }\n var variance2 = (1 / (n - k)) * sum4;\n\n // Celkovy jmenovatel\n var overallDenominator = Math.sqrt(variance1 * variance2);\n\n var rk = rkCov / overallDenominator;\n cochSumri2 += rk * rk;\n var rkU = rk * Math.sqrt(n - k);\n\n var resultText;\n if (rkU > u0975) {\n resultText = \"<span class='text-red'><b>Zamítá</b></span> se hypotéza o nulovém koef. seriální korelace.\"\n } else {\n resultText = \"<span class='text-green'><b>Nezamítá</b></span> se hypotéza o nulovém koef. seriální korelace.\"\n }\n $(\"#serialTable\").append(\"<tr><td>\" + k + \"</td><td>\" + rk.toFixed(6) + \"</td><td>\"\n + rkU.toFixed(6) + \"</td><td>\" + resultText + \"</td></tr>\");\n }\n\n // VYSLEDKY COCHRANOVA TESTU\n var cochQ = n * cochSumri2;\n var Q0975_10 = 18.307;\n\n $(\"#serialBox\").append(\"<h3>Cochranův test</h3>\");\n $(\"#serialBox\").append(\"$H_0: \\\\rho_1 = \\\\rho_2 = \\\\ldots = \\\\rho_k = 0$ pro $i = 1, 2, \\\\ldots , k$<br/>\");\n $(\"#serialBox\").append(\"$H_1: \\\\rho_i \\\\neq 0$ pro al. jedno $i$ <br/><br/>\");\n $(\"#serialBox\").append(\"$Q = \\\\sum_{i=1}^k r_i^2 \\\\doteq \" + n + \"\\\\cdot\" + cochSumri2.toFixed(6) +\n \" \\\\doteq \" + cochQ.toFixed(3) + \"$<br/>\");\n $(\"#serialBox\").append(\"$Q_{1-{\\\\alpha / 2}, k} = Q_{0.975, 10} = \" + Q0975_10 + \"$<br/><br/>\");\n\n var resultRejected = cochQ > Q0975_10;\n if (resultRejected) {\n $(\"#serialBox\").append(\"$Q > Q_{1-{\\\\alpha / 2}, k}$<br/>\");\n $(\"#serialBox\").append(cochQ.toFixed(3) + \" $>$ \" + Q0975_10 + \"<br/><br/>\");\n $(\"#serialBox\").append(\"<span class='text-red'><b>Zamítá</b></span> se sdružená hypotéza.<br/><br/>\");\n } else {\n $(\"#serialBox\").append(\"$Q \\\\leq Q_{1-{\\\\alpha / 2}, k}$<br/>\");\n $(\"#serialBox\").append(cochQ.toFixed(3) + \" $\\\\leq$ \" + Q0975_10 + \"<br/><br/>\");\n $(\"#serialBox\").append(\"<span class='text-green'><b>Nezamítá</b></span> se sdružená hypotéza.<br/><br/>\");\n }\n\n refreshMathJax();\n}", "function calcular(){ \n\n\n \n let total = soma(rend) - soma(des)\n \n if( Number(rend) == 0 || Number(des) == 0 ) {\n erro.style.display = 'block'\n } else if(total >0) {\n res.style.display='block'\n form.style.display = 'none'\n botaodecalcular.style.display = 'none'\n document.body.style.background= '#0000FF'\n retorno.style.display = 'block'\n res.innerHTML+= `SALDO POSITVO`\n res.innerHTML+= ` <p> O final e de: R$${total.toFixed(2)}</p>`\n \n } else {\n res.style.display='block'\n form.style.display = 'none'\n botaodecalcular.style.display = 'none'\n document.body.style.background= '#FF0000'\n retorno.style.display = 'block'\n res.innerHTML+= `SALDO NEGATIVO \\u{2716}`\n res.innerHTML+= `<p> O saldo negativo e de: R$${total.toFixed(2)}</p> `\n }\n\n \n \n///Boatao para voltar ao formulario\n}", "function getTotalValue(interv)\n{\nvar total = 0;\nvar result = 0;\n\nfor (var i=0; i<clSize; i++) /*foreach element in the new linguistic scale*/\n\t{\n\ttotal += interv.vars[i];\n\tresult += interv.vars[i]*i; /*add i*intervalVector[i] to the total value of the solution*/\n\t}\n\nresult /= total;\nreturn result;\n}", "function resolver() {\n\n const n = parseInt(document.getElementById(\"n\").value); //número de ensaios\n const k = parseFloat(document.getElementById(\"k\").value); //número de casos de sucesso\n const p = parseFloat(document.getElementById(\"p\").value); //Porcentagem de caso de sucesso\n\n const numBinominal = nBinomial();\n\n const result = (numBinominal * ((p ** k) * (1 - p) ** (n - k))).toFixed(4);\n\n const resultSet = (result * 100).toFixed(2);\n\n resultado.textContent = `A probabilidade de sucesso é de: ${result}, em porcentagem: ${resultSet} %.`;\n}", "function fl_outToSufgania ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function vgaleToApotelesma() {\n event.preventDefault();\n const staTosa = parseFloat(document.querySelector(\".statosa\").value);\n const exoumeTosa = parseFloat(document.querySelector(\".exwtosa\").value);\n const staAlla = parseFloat(document.querySelector(\".staalla\").value);\n const zitoumenoValue = document.querySelector(\".stoixeia2\").value;\n //Apotelesma Praksi\n const apotelesmaTriwn = (staAlla / staTosa) * exoumeTosa;\n const roundResult = Math.floor(apotelesmaTriwn);\n if (roundResult < 0) {\n showValidation.classList.add(\"show\");\n showApotelesma.classList.add(\"hide\");\n }\n document.querySelector(\"#resultriwn\").value = roundResult;\n document.querySelector(\"#resultstoixeio\").value = zitoumenoValue;\n const showApotelesma = document.querySelector(\".koutiapotelesmatos\");\n if (roundResult === roundResult) {\n showApotelesma.classList.add(\"show\");\n theForm.classList.add(\"addheight\");\n } else {\n showApotelesma.classList.add(\"hide\");\n }\n}", "function calcularValorFinal(id_prato, valor) {\n let prato = $.map(pratos, function (n) {\n if (n.id_prato == id_prato) {\n return n;\n }\n });\n\n if ($(\"#promocaoIsPorcentagem:checked\").val())\n valorFinal = prato[0].vl_prato - calcularPorcentagem(prato[0].vl_prato, valor);\n else\n valorFinal = prato[0].vl_prato - valor;\n return valorFinal;\n }", "function refreshSomme(){\n // Sous total\n var sousTotal = 0;\n for(var p in panier){\n sousTotal += parseFloat(livres[panier[p].id].prix.replace(',','.'))*panier[p].nombre;\n }\n // Taxes\n var tps = sousTotal * TAXE_TPS;\n var tvq = sousTotal * TAXE_TVQ;\n // total\n var total = sousTotal + tps + tvq;\n \n // Affectation\n $(\"#panierSousTotal\").text(sousTotal.toFixed(2));\n $(\"#panierTPS\").text(tps.toFixed(2));\n $(\"#panierTVQ\").text(tvq.toFixed(2));\n $(\"#panierTotal\").text(total.toFixed(2));\n}", "function calculation () {\n omega = 2*Math.PI*ny; // Kreisfrequenz (1/s)\n if (dPhi == 0) i0 = u0/r; // Maximale Stromstärke (A, für Widerstand)\n else if (dPhi > 0) i0 = u0*omega*c; // Maximale Stromstärke (A, für Kondensator)\n else i0 = u0/(omega*l); // Maximale Stromstärke (A, für Spule)\n }", "function inicializar(){var v=document.getElementById(\"comprobacion\"); v.innerHTML=\"\"; nota=0.0;}", "function beregnC() {\n a = document.getElementById('a').value; /* Her får vi værdien af a hvor id i html taget er lig a */\n b = document.getElementById('b').value; /* Her får vi værdien af a hvor id i html taget er lig b */\n c = Math.sqrt((a * a) + (b * b));\n document.getElementById(\"cer\").innerHTML = \"C = \" + c.toFixed(2);\n /* retter punkterne i svg'en så trekanten bliver flyttet*/\n document.getElementById(\"retvinklettrekant\").setAttribute(\"points\", \"0,0 0,\" + a * 20 + \" \" + b * 20 + \",\" + a * 20);\n RetAreal = a * b / 2\n document.getElementById(\"Areal\").innerHTML = \"Areal = \" + RetAreal;\n}", "resumen_estado_nave(){\n this.ajuste_potencia();\n if (typeof this._potencia_disponible !== \"undefined\"){\n if (this._potencia_disponible){\n let estado_plasma = \"\";\n for (let i = 0; i < this._injectores.length; i++) {\n estado_plasma += \"Plasma \"+i.toString()+\": \";\n let total = this._injectores[i].get_plasma+this._injectores[i].get_extra_plasma;\n estado_plasma += total+\"mg/s \";\n }\n console.log(estado_plasma);\n\n for (let i = 0; i < this._injectores.length; i++) {\n if (this._injectores[i].get_danio_por<100){\n if (this._injectores[i].get_extra_plasma>0){\n console.log(\"Tiempo de vida: \"+this._injectores[i].tiempo_vuelo().toString()+\" minutos.\");\n } else {\n console.log(\"Tiempo de vida infinito!\");\n break;\n }\n }\n }\n } else {\n console.log(\"Unable to comply.\")\n console.log(\"Tiempo de vida 0 minutos.\")\n }\n } else {\n throw \"_potencia_disponible: NO DEFINIDA\";\n }\n }", "function totales()\n{\n var subtotal = 0;\n var total = 0.00;\n var totalcantidad = 0;\n var subcantidad = 0;\n var total_dinero = 0;\n var total_cantidad = 0;\n var sub_exento=0;\n $(\"#inventable>tbody tr\").each(function()\n {\n var compra = $(this).find(\".precio_compra\").val();\n var unidad = $(this).find(\".unidad\").val();\n var venta = $(this).find(\".precio_venta\").val();\n var cantidad = parseInt($(this).find(\".cant\").val());\n var vence = $(this).find(\".vence\").val();\n var exento = parseInt($(this).find(\".exento\").val());\n console.log(cantidad);\n if (isNaN(cantidad) == true)\n {\n cantidad = 0;\n }\n subtotal = compra * cantidad;\n\n totalcantidad += cantidad;\n if (isNaN(subtotal) == true)\n {\n subtotal = 0;\n }\n\n if(exento==1)\n {\n sub_exento=sub_exento+subtotal;\n }\n else\n {\n total += subtotal;\n }\n\n });\n if (isNaN(total) == true)\n {\n total = 0;\n }\n sumas_sin_iva=total;\n sumas_sin_iva=round(total, 2);\n\n if(isNaN(sub_exento))\n {\n sub_exento=0;\n }\n\n tipo_doc=$('#tipo_doc').val();\n\n percepcion = $('#percepcion').val();\n\n var monto_percepcion = $('#monto_percepcion').val();\n var iva = $('#porc_iva').val();\n\n total_percepcion=0;\n iva = round((total * iva), 4);\n sub_exento = round(sub_exento, 2);\n\n if (total >= monto_percepcion)\n total_percepcion = round((total * percepcion), 4);\n\n total += total_percepcion;\n if(tipo_doc=='CCF')\n {\n total += iva;\n }\n else\n {\n iva=0;\n\n }\n\n\n total+= sub_exento;\n total_dinero =parseFloat(total).toFixed(2);\n /*if(total_dinero=='0'){\n total_dinero=\"0.00\";\n }else{\n total_dinero=total_dinero =parseFloat(total).toFixed(2);;\n }*/\n total_cantidad = round(totalcantidad,2);\n $('#totcant').html(total_cantidad);\n $('#sumas_sin_iva').html(round(sumas_sin_iva,2));\n $('#subtotal').html(round((sumas_sin_iva+iva), 2));\n $('#iva').html(round(iva,2));\n $('#venta_exenta').html(sub_exento);\n $('#total_percepcion').html(round(total_percepcion, 2));\n $('#total_dinero').html(total_dinero);\n $('#totaltexto').load('compras.php?' + 'process=total_texto&total=' + total_dinero);\n}", "enhetspris() {\n return this.pris / this.antall;\n }", "function alfa_beta(glebia_ob, glebia_maks, glebia_maks_zapisz_ruch, alfa, beta)\n{\n let ruchy_teraz, element, bierka_zbita;\n\n if(tablica_transp[szachownica.hash])\n {\n if(tablica_transp.glebia > glebia_ob - glebia_maks)\n return tablica_transp[szachownica.hash].ocena;\n else if(tablica_transp.ruchy)\n ruchy_teraz = tablica_transp.ruchy;\n }\n\n if(!ruchy_teraz)\n ruchy_teraz = generuj_ruchy();\n\n // tu zrobic sortowanie ruchow\n\n if(glebia_ob <= glebia_maks_zapisz_ruch)\n element.ruchy = ruchy_teraz;\n \n if(szachownica.biale_ruch)\n {\n // wykonywanie zbic dla bialych\n for(let i = 0; i < ruchy_teraz.zbicia.length; i++)\n {\n let wiersz_p = ruchy_teraz.zbicia.wiersz_p, kolumna_p = ruchy_teraz.zbicia.kolumna_p;\n let wiersz_k = ruchy_teraz.zbicia.wiersz_k, kolumna_k = ruchy_teraz.zbicia.kolumna_k;\n let nr_kolumny_en_passant = szachownica.nr_kolumny_en_passant, bylo_w_przelocie = false, liczba_pol_ruch = szachownica.liczba_polowek_od_r;\n let nr_zbijanej = szachownica[wiersz_k][kolumna_k];\n let kopia_OOW = szachownica.mozna_roszada_biale_OO, kopia_OOOW = szachownica.mozna_roszada_biale_OOO;\n let kopia_OOB = szachownica.mozna_roszada_czarne_OO, kopia_OOOB = szachownica.mozna_roszada_czarne_OOO;\n let hash_kopia = szachownica.hash, ocena_kopia = szachownica.ocena;\n let poz_krol_biale = szachownica.poz_krol_biale, poz_krol_czarne = szachownica.poz_krol_czarne;\n\n if(szachownica.pola[wiersz_p][kolumna_p] === 6 && wiersz_p === 4 && kolumna_p !== kolumna_k && szachownica.pola[wiersz_k][kolumna_k] === 0) // bicie w przelocie\n {\n nr_kolumny_en_passant = szachownica.nr_kolumny_en_passant;\n bylo_w_przelocie = true;\n }\n\n wykonaj_ruch(ruchy_teraz.zbicia[i]);\n\n beta = Math.min(beta, alfa_beta(glebia_ob + 1, glebia_maks, glebia_maks_zapisz_ruch, alfa, beta));\n\n // cofnij ruch!!!\n if(bylo_w_przelocie)\n {\n szachownica.pola[wiersz_k][kolumna_k] = 0;\n szachownica.pola[wiersz_p][kolumna_p] = 6;\n szachownica.pola[wiersz_p][kolumna_k] = 12;\n }\n else\n {\n szachownica.pola[wiersz_p][kolumna_p] = szachownica.pola[wiersz_k][kolumna_k];\n szachownica.pola[wiersz_k][kolumna_k] = nr_zbijanej;\n }\n\n szachownica.hash = hash_kopia;\n szachownica.ocena = ocena_kopia;\n\n szachownica.biale_ruch = !szachownica.biale_ruch;\n szachownica.nr_kolumny_en_passant = nr_kolumny_en_passant;\n szachownica.liczba_polowek_od_r = liczba_pol_ruch;\n\n szachownica.mozna_roszada_biale_OO = kopia_OOW;\n szachownica.mozna_roszada_biale_OOO = kopia_OOOW;\n szachownica.mozna_roszada_czarne_OO = kopia_OOB;\n szachownica.mozna_roszada_czarne_OOO = kopia_OOOB;\n\n szachownica.poz_krol_biale = poz_krol_biale;\n szachownica.poz_krol_czarne = poz_krol_czarne;\n\n if(alfa >= beta)\n break;\n }\n\n // wykonywanie ruchow dla bialych\n if(glebia_ob <= glebia_maks && alfa < beta)\n {\n for(let i = 0; i < ruchy_teraz.ruchy.length; i++)\n {\n wykonaj_ruch(ruchy_teraz.ruchy[i]);\n\n if(szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k] === 6 && ruch_t.wiersz_k === 7)\n {\n // promocja biale\n for(let j = 2; j < 6; j++)\n {\n promuj_piona(ruch_t.wiersz_k, ruch_t.kolumna_k, j);\n\n beta = Math.min(beta, alfa_beta(glebia_ob + 1, glebia_maks, glebia_maks_zapisz_ruch, alfa, beta));\n\n // odpromuj piona!!!\n\n if(alfa >= beta)\n break;\n }\n }\n else\n {\n // normalny ruch biale\n beta = Math.min(beta, alfa_beta(glebia_ob + 1, glebia_maks, glebia_maks_zapisz_ruch, alfa, beta));\n }\n\n // cofnij ruch!!!\n\n if(alfa >= beta)\n break;\n }\n }\n\n element.glebia = glebia_maks - glebia_ob;\n element.ocena = beta;\n\n return beta;\n }\n else\n {\n // wykonywanie zbic dla czarnych\n for(let i = 0; i < ruchy_teraz.zbicia.length; i++)\n {\n wykonaj_ruch(ruchy_teraz.zbicia[i]);\n\n alfa = Math.max(alfa, alfa_beta(glebia_ob + 1, glebia_maks, glebia_maks_zapisz_ruch, alfa, beta));\n\n // cofnij ruch!!!\n\n if(alfa >= beta)\n break;\n }\n\n // wykonywanie ruchow dla czarnych\n if(glebia_ob <= glebia_maks && alfa < beta)\n {\n for(let i = 0; i < ruchy_teraz.ruchy.length; i++)\n {\n wykonaj_ruch(ruchy_teraz.ruchy[i]);\n\n if(szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k] === 6 && ruch_t.wiersz_k === 7)\n {\n // promocja biale\n for(let j = 2; j < 6; j++)\n {\n promuj_piona(ruch_t.wiersz_k, ruch_t.kolumna_k, j);\n\n beta = Math.max(beta, alfa_beta(glebia_ob + 1, glebia_maks, glebia_maks_zapisz_ruch, alfa, beta));\n\n // odpromuj piona!!!\n\n if(alfa >= beta)\n break;\n }\n }\n else\n {\n // normalny ruch biale\n alfa = Math.max(alfa, alfa_beta(glebia_ob + 1, glebia_maks, glebia_maks_zapisz_ruch, alfa, beta));\n }\n\n // cofnij ruch!!!\n\n if(alfa >= beta)\n break;\n }\n }\n\n element.glebia = glebia_maks - glebia_ob;\n element.ocena = alfa;\n\n return alfa;\n }\n}", "function reglaRebajaPrecios(){\n if(producto.super_avance.sellIn = 0)\n {\n precio_SuperAvance - 2;\n\n if(producto.fc_superduper.sellIn = 0){\n precio_FullSuperDuper - 2;\n\n if(producto.f_cobertura.sellIn = 0){\n precio_FullCobertura - 2;\n }\n }\n }else{\n }\n}", "genereazaVariabilaLognormala() {\n\t\t\t// Calculam media miu si dispersia sigma\n\t\t\tlet mu = this.calculeazaMediaMiu(this.getM, this.getS);\n\t\t\tlet sigma = this.calculeazaDispersiaSigmaPatrat(this.getM, this.getS);\n\t\t\t// Generam Z cu distributia normala N(0,1)\n\t\t\tlet Z = Normal.genereazaVariabilaNormala01();\n\t\t\t// Calculam X (sigma = sqrt(sigma patrat))\n\t\t\tlet X = mu + (Z * Math.sqrt(sigma));\n\t\t\t// Calculam si intoarcem pe Y cu distributia lognormala (miu, sigma)\n\t\t\treturn ( Math.pow(Math.E, X) );\n\t\t}", "function porEstuSupePuntos(generacion){\n var sumaScore=0;\n for(var i=0;i<generacion.students.length;i++){\n var sumaHse=0;\n var sumaTech=0;\n var total=0;\n for(var j=0;j<generacion.students[i]['sprints'].length;j++){\n var tech=generacion.students[i]['sprints'][j]['score']['tech'];\n var hse=generacion.students[i]['sprints'][j]['score']['hse'];\n\n sumaTech+=tech;\n sumaHse+=hse;\n }\n\n if((sumaHse/j)>840 && (sumaTech/j) >1260){\n sumaScore++;\n }\n var porcentaje=parseInt((sumaScore*100)/generacion.students.length);\n \n }\n return (porcentaje);\n}", "function fasesTorneo() {\n vm.paso = 3;\n obtenerFases();\n obtenerTiposDeFase();\n obtenerPenalizaciones();\n }", "function effemeridi_pianeti(np,TEMPO_RIF,LAT,LON,ALT,ITERAZIONI,STEP,LAN){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) ottobre 2011\n // funzione per il calcolo delle effemeridi del Sole.\n // Parametri utilizzati\n // np= numero identificativo del pianeta 0=Mercurio,1=Venere.....7=Nettuno\n // il valore np=2 (Terra) non deve essere utilizzato come parametro.\n // TEMPO_RIF= \"TL\" o \"TU\" tempo locale o tempo universale.\n // LAT= latitudine in gradi sessadecimali.\n // LON= longtudine in gradi sessadecimali.\n // ALT= altitudine in metri.\n // ITERAZIONE =numero di ripetizioni del calcolo.\n // STEP=salto \n // LAN=\"EN\" versione in inglese.\n \n \n var njd=calcola_jdUT0(); // numero del giorno giuliano all'ora 0 di oggi T.U.\n\n njd=njd+0.00078; // correzione per il Terrestrial Time.\n\n //njd=njd+t_luce(njd,np); // correzione tempo luce.\n \nvar data_ins=0; // data\nvar data_inser=0; // data\nvar numero_iterazioni=ITERAZIONI;\n\nvar fusoloc=-fuso_loc(); // recupera il fuso orario della località (compresa l'ora legale) e riporta l'ora del pc. come T.U.\n\nvar sorge=0;\nvar trans=0;\nvar tramn=0;\nvar azimuts=0;\nvar azimutt=0;\n\nvar effe_pianeta=0;\nvar ar_pianeta=0;\nvar de_pianeta=0;\nvar classetab=\"colore_tabellaef1\";\nvar istanti=0;\nvar magnitudine=0;\nvar fase=0;\nvar diametro=0;\nvar distanza=0;\nvar elongazione=0;\nvar costl=\"*\"; // nome della costellazione.\nvar parallasse=0;\nvar p_ap=0; // coordinate apparenti del pianeta.\n\nif (STEP==0) {STEP=1;}\n \n document.write(\"<table width=100% class='.table_effemeridi'>\");\n document.write(\" <tr>\");\n\n // versione in italiano.\n\n if (LAN!=\"EN\") // diverso da EN\n {\n document.write(\" <td class='colore_tabella'>Data:</td>\");\n document.write(\" <td class='colore_tabella'>Sorge:</td>\");\n document.write(\" <td class='colore_tabella'>Culmina:</td>\");\n document.write(\" <td class='colore_tabella'>Tramonta:</td>\");\n document.write(\" <td class='colore_tabella'>A. So.:</td>\");\n document.write(\" <td class='colore_tabella'>A. Tr.:</td>\");\n document.write(\" <td class='colore_tabella'>A. Retta:</td>\");\n document.write(\" <td class='colore_tabella'>Dec.:</td>\");\n document.write(\" <td class='colore_tabella'>Fase.</td>\");\n document.write(\" <td class='colore_tabella'>Dist.</td>\");\n document.write(\" <td class='colore_tabella'>Dia.</td>\");\n document.write(\" <td class='colore_tabella'>El.</td>\");\n document.write(\" <td class='colore_tabella'>Ma.</td>\");\n document.write(\" <td class='colore_tabella'>Cost.</td>\");\n }\n\n // versione in inglese.\n\nif (LAN==\"EN\")\n {\n\n document.write(\" <td class='colore_tabella'>Date:</td>\");\n document.write(\" <td class='colore_tabella'>Rise:</td>\");\n document.write(\" <td class='colore_tabella'>Transit:</td>\");\n document.write(\" <td class='colore_tabella'>Set:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Rise:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Set:</td>\");\n document.write(\" <td class='colore_tabella'>R.A.:</td>\");\n document.write(\" <td class='colore_tabella'>Dec.:</td>\");\n document.write(\" <td class='colore_tabella'>Ph.</td>\");\n document.write(\" <td class='colore_tabella'>Dist.</td>\");\n document.write(\" <td class='colore_tabella'>Dia.</td>\");\n document.write(\" <td class='colore_tabella'>El.</td>\");\n document.write(\" <td class='colore_tabella'>Ma.</td>\");\n document.write(\" <td class='colore_tabella'>Const.</td>\");\n\n }\n\n\n document.write(\" </tr>\");\n\n // ST_ASTRO_DATA Array(azimut_sorgere,azimut_tramonto,tempo_sorgere,tempo_transito,tempo_tramonto)\n // 0 1 2 3 4\n\n njd=njd-STEP;\n\n for (b=0; b<numero_iterazioni; b=b+STEP){\n njd=njd+STEP;\n effe_pianeta=pos_pianeti(njd,np); \n\n // calcola le coordinate apparenti nutazione e aberrazione.\n\n p_ap=pos_app(njd,effe_pianeta[0],effe_pianeta[1]);\n ar_pianeta= sc_ore(p_ap[0]); // ascensione retta in hh:mm:ss.\n de_pianeta=sc_angolo(p_ap[1],0); // declinazione. \n \n fase=effe_pianeta[2];\n magnitudine=effe_pianeta[3];\n distanza=effe_pianeta[4].toFixed(3);\n diametro=effe_pianeta[5].toFixed(1);\n elongazione=effe_pianeta[6].toFixed(1);\n costl=costell(effe_pianeta[0]); // costellazione.\n\n istanti=ST_ASTRO_DATA(njd,effe_pianeta[0],effe_pianeta[1],LON,LAT,ALT,0);\n\nif (TEMPO_RIF==\"TL\"){\n sorge=ore_24(istanti[2]+fusoloc);\n trans=ore_24(istanti[3]+fusoloc);\n tramn=ore_24(istanti[4]+fusoloc); }\n\nelse {\n sorge=ore_24(istanti[2]);\n trans=ore_24(istanti[3]);\n tramn=ore_24(istanti[4]); } \n\n sorge=sc_ore_hm(sorge); // istanti in hh:mm\n trans=sc_ore_hm(trans);\n tramn=sc_ore_hm(tramn);\n\n // formatta la data da inserire.\n\n data_ins=jd_data(njd);\n\n if (LAN!=\"EN\") {data_inser=Lnum(parseInt(data_ins[0]),2)+\":\"+Lnum(parseInt(data_ins[1]),2)+\" |\"+data_ins[3];} // versione in italiano.\n if (LAN==\"EN\") {data_inser=Lnum(parseInt(data_ins[0]),2)+\":\"+Lnum(parseInt(data_ins[1]),2)+\" |\"+data_ins[4];} // versione in inglese.\n\n azimuts=istanti[0].toFixed(1);\n azimutt=istanti[1].toFixed(1);\n\n if (b%2==0){classetab=\"colore_tabellaef2\"; }\n\n else {classetab=\"colore_tabellaef1\";}\n\n\n document.write(\" <tr>\");\n document.write(\" <td class='\"+classetab+\"'>\"+data_inser+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+sorge+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+trans+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+tramn+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+azimuts+\"&deg;</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+azimutt+\"&deg;</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+ar_pianeta+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+de_pianeta+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+fase+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+distanza+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+diametro+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+elongazione+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+magnitudine+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+costl+\"</td>\");\n\n document.write(\" </tr>\");\n\n }\n document.write(\" </table>\");\n\n\n}", "function calculateTotal_pr_cm() {\n //Aqui obtenemos el precio total llamando a nuestra funcion\n\t//Each function returns a number so by calling them we add the values they return together\n\t'use strict';\n var cakePrice = traerDensidadSeleccionada() * traerDensidadSeleccionada2() / getIndiceDeLogro() / 1000000, densidadimplantada = traerDensidadSeleccionada() / getIndiceDeLogro(), densidadobjetivo = traerDensidadSeleccionada();\n\t\t\t\t\n\t//Aqui configuramos los decimales que queremos que aparezcan en el resultado\n\tvar resultadodosdecimales1 = cakePrice.toFixed(2), resultadodosdecimales2 = densidadimplantada.toFixed(2), resultadodosdecimales3 = densidadobjetivo.toFixed(2);\n \n\t//Aqui exponemos el calculo\n\tvar divobj = document.getElementById('totalPrice_pr_cm');\n\tdivobj.style.display = 'block';\n\tdivobj.innerHTML = 'Você vai precisar plantar ' + resultadodosdecimales2 + ' sementes por hectare, que representa ' + resultadodosdecimales1 + ' sementes em um metro linear para atingir o seu alvo população de ' + resultadodosdecimales3;\n}", "function fl_outToLevivot ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.modern_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function trataColisoes()\n{\n //lateral esquerda - 1\n if(esfera.posicao[0] - esfera.raio < parametrosMesa.xMin)\n {\n if(ultimaColisao != 1)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 1;\n } \n }\n\n //lateral direita - 2\n if(esfera.posicao[0] + esfera.raio > parametrosMesa.xMax)\n {\n if(ultimaColisao != 2)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 2;\n } \n }\n\n //cima - 3\n if(esfera.posicao[1] - esfera.raio < parametrosMesa.zMax)\n {\n if(ultimaColisao != 3)\n {\n veloc[2] = -parametrosMesa.coeficienteRestituicao * veloc[2];\n ultimaColisao = 3; \n }\n \n }\n\n //corredor direito - 4\n if(esfera.posicao[1] - esfera.raio > -30)\n { \n if( ( (esfera.posicao[0] - esfera.raio < -19.75) && (esfera.posicao[0] + esfera.raio > -17.75) ) || \n ( (esfera.posicao[0] + esfera.raio > -18.75) && (esfera.posicao[0] - esfera.raio < -20.75) ) )\n {\n if(ultimaColisao != 4)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 4;\n } \n }\n \n\n //corredor esquerdo - 5\n if( (esfera.posicao[0] + esfera.raio > 19.04) && (esfera.posicao[0] - esfera.raio < 21.04) || \n (esfera.posicao[0] - esfera.raio < 20.04) && (esfera.posicao[0] + esfera.raio > 18.04) )\n {\n if(ultimaColisao != 5)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 5;\n } \n }\n }\n\n /*//corner direito - 6\n if(esfera.posicao[0] - esfera.posicao[1] >= 50)\n {\n if(ultimaColisao != 6)\n {\n //TODO \n var normal = [-0.7, 0, -0.7];\n var normalx2 = [-1.4, 0, -1.4];\n var cosseno = mult(normal, normalize(veloc));\n var quase = mult(normalx2, cosseno);\n var vetorRefletido = subtract(quase, normalize(veloc) );\n veloc[0] = vetorRefletido[0]; veloc[2] = vetorRefletido[2];\n ultimaColisao = 6;\n }\n }\n\n //corner esquerdo - 7\n if(-esfera.posicao[0] + esfera.posicao[1] >= 50){\n if(ultimaColisao != 7)\n {\n //TODO \n var normal = [-0.7, 0, -0.7];\n var normalx2 = [-1.4, 0, -1.4];\n var cosseno = mult(normal, normalize(veloc));\n var quase = mult(normalx2, cosseno);\n var vetorRefletido = subtract(quase, normalize(veloc) );\n veloc[0] = vetorRefletido[0]; veloc[2] = vetorRefletido[2];\n ultimaColisao = 7;\n }\n }*/\n}", "function PresionPlato(){\n\tvar carga = document.getElementById(\"carga\").value;\n\tvar radio = document.getElementById(\"radioPlato\").value;\n\tvar total = (carga/(Math.PI *Math.pow(radio,2)));\n\tvar total2 = total.toFixed(3);\n\tdocument.getElementById(\"presionPlato\").value = total2;\n\t//Reporte\n\tdocument.getElementById('recibeformulaPres').innerHTML = \"p = \"+carga+\" lb / (3.14 * \"+radio+\" in ^ 2)\";\n\tdocument.getElementById('recibeformulaPres1').innerHTML = \"p = \"+total.toFixed(3)+\" psi\";\n}", "function englobarymostrardivoep(habp,habr,habmv,habant,pplan,preal,pmv,pant,v3){\n\n\n \t//////////////////////////////////PLAN HABILITADORAS ////////////////////////////////////////////////\t\t\t\n\t\t\t\t\t\t// ESFUERZO PROPIO PLAN EN BOLIVARES \t\t\t\t\t\n\t\t\t\t\t\tvar laborepbsf = filtrarcostohab(habp,filtrolabor,5,'_p',1);\n\t\t\t\t\t\tvar bbepbsf = filtrarcostohab(habp,filtrobb,5,'_p',1);\n\t\t\t\t\t\tvar mepbsf = filtrarcostohab(habp,filtrom,5,'_p',1);\n\t\t\t\t\t\tvar scepbsf = filtrarcostohab(habp,filtrosc,5,'_p',1);\n\t\t\t\t\t\tvar oepbsf = filtrarcostohab(habp,filtroo,5,'_p',1);\n\t\t\t\t\t\tvar totalepbsf = filtrartotal(laborepbsf,bbepbsf,mepbsf,scepbsf,oepbsf);\n \n \t\t\t\t\t\t \t\t // ESFUERZOS PROPIOS PLAN EN DOLARES\n \t\t\t\t\t\t var laborepdol = filtrarcostohab(habp,filtrolabor,5,'_p',2);\n \t\t\t\t\t\t var bbepdol = filtrarcostohab(habp,filtrobb,5,'_p',2);\n \t\t\t\t\t\t var mepdol = filtrarcostohab(habp,filtrom,5,'_p',2);\n \t\t\t\t\t\t var scepdol = filtrarcostohab(habp,filtrosc,5,'_p',2);\n \t\t\t\t\t\t var oepdol = filtrarcostohab(habp,filtroo,5,'_p',2);\n \t\t\t\t\t\t var totalepdol = filtrartotal(laborepdol,bbepdol,mepdol,scepdol,oepdol);\n\n \t\t\t\t\t\t // DTTO ORIENTAL PLAN EN BOLIVARES\n\t\t\t\t\t \t var labordttobsf = filtrarcostohab(habp,filtrolabor,4,'_p',1);\n \t\t\t\t\t\t var bbdttobsf = filtrarcostohab(habp,filtrobb,4,'_p',1);\n \t\t\t\t\t\t var mdttobsf = filtrarcostohab(habp,filtrom,4,'_p',1);\n \t\t\t\t\t\t var scdttobsf = filtrarcostohab(habp,filtrosc,4,'_p',1);\n \t\t\t\t\t\t var odttobsf = filtrarcostohab(habp,filtroo,4,'_p',1);\n \t\t\t\t\t\t var totaldttobsf = filtrartotal(labordttobsf,bbdttobsf,mdttobsf,scdttobsf,odttobsf);\n\n \t\t\t\t\t\t // DTTO ORIENTAL PLAN EN DOLARES\n \t\t\t\t\t\t var labordttodol = filtrarcostohab(habp,filtrolabor,4,'_p',2);\n \t\t\t\t\t\t var bbdttodol = filtrarcostohab(habp,filtrobb,4,'_p',2);\n \t\t\t\t\t\t var mdttodol = filtrarcostohab(habp,filtrom,4,'_p',2);\n \t\t\t\t\t\t var scdttodol = filtrarcostohab(habp,filtrosc,4,'_p',2);\n \t\t\t\t\t\t var odttodol = filtrarcostohab(habp,filtroo,4,'_p',2);\n \t\t\t\t\t\t var totaldttodol = filtrartotal(labordttodol,bbdttodol,mdttodol,scdttodol,odttodol);\n\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL PLAN EN BOLIVARES\n \t\t\t\t\t\t var labordivobsf = filtrardivo(labordttobsf,laborepbsf);\n \t\t\t\t\t\t var bbdivobsf = filtrardivo(bbdttobsf,bbepbsf);\n \t\t\t\t\t\t var mdivobsf = filtrardivo(mdttobsf,mepbsf);\n \t\t\t\t\t\t var scdivobsf = filtrardivo(scdttobsf,scepbsf);\n \t\t\t\t\t\t var odivobsf = filtrardivo(odttobsf,oepbsf);\n \t\t\t\t\t\t var totaldivobsf = filtrartotal(labordivobsf,bbdivobsf,mdivobsf,scdivobsf,odivobsf);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL PLAN EN DOLARES\n \t\t\t\t\t\t var labordivodol = filtrardivo(labordttodol,laborepdol);\n \t\t\t\t\t\t var bbdivodol = filtrardivo(bbdttodol,bbepdol);\n \t\t\t\t\t\t var mdivodol = filtrardivo(mdttodol,mepdol);\n \t\t\t\t\t\t var scdivodol = filtrardivo(scdttodol,scepdol);\n \t\t\t\t\t\t var odivodol = filtrardivo(odttodol,oepdol);\n \t\t\t\t\t\t var totaldivodol = filtrartotal(labordivodol,bbdivodol,mdivodol,scdivodol,odivodol);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL PLAN EN DOLARES EQUIVALENTES\n \t\t\t\t\t\t var labordivoDeqv = filtroequivalente(labordivobsf,labordivodol);\n \t\t\t\t\t\t var bbdivoDeqv = filtroequivalente(bbdivobsf,bbdivodol);\n \t\t\t\t\t\t var mdivoDeqv = filtroequivalente(mdivobsf,mdivodol);\n \t\t\t\t\t\t var scdivoDeqv = filtroequivalente(scdivobsf,scdivodol);\n \t\t\t\t\t\t var odivoDeqv = filtroequivalente(odivobsf,odivodol);\n \t\t\t\t\t\t var totaldivoDeqv = filtrartotal(labordivoDeqv,bbdivoDeqv,mdivoDeqv,scdivoDeqv,odivoDeqv);\n\n \t\t\t\t\t\t ////////////////////// FIN PLAN ////////////////////////////////////////////////\n\n\n\n \t\t\t\t\t\t ////////////////REAL HABILITADORAS /////////////////////////\n\t\t\t\t\t\t\t\t// ESFUERZO PROPIO REAL EN BOLIVARES \n\t\t\t\t\t \t var laborepbsfr = filtrarcostohab(habr,filtrolabor,5,'_r',1);\n \t\t\t\t\t\t var bbepbsfr = filtrarcostohab(habr,filtrobb,5,'_r',1);\n \t\t\t\t\t\t var mepbsfr = filtrarcostohab(habr,filtrom,5,'_r',1);\n \t\t\t\t\t\t var scepbsfr = filtrarcostohab(habr,filtrosc,5,'_r',1);\n \t\t\t\t\t\t var oepbsfr = filtrarcostohab(habr,filtroo,5,'_r',1);\n \t\t\t\t\t\t var totalepbsfr = filtrartotal(laborepbsfr,bbepbsfr,mepbsfr,scepbsfr,oepbsfr);\n\n \t\t\t\t\t\t // ESFUERZOS PROPIOS REAL EN DOLARES\n \t\t\t\t\t\t var laborepdolr = filtrarcostohab(habr,filtrolabor,5,'_r',2);\n \t\t\t\t\t\t var bbepdolr = filtrarcostohab(habr,filtrobb,5,'_r',2);\n \t\t\t\t\t\t var mepdolr = filtrarcostohab(habr,filtrom,5,'_r',2);\n \t\t\t\t\t\t var scepdolr = filtrarcostohab(habr,filtrosc,5,'_r',2);\n \t\t\t\t\t\t var oepdolr = filtrarcostohab(habr,filtroo,5,'_r',2);\n \t\t\t\t\t\t var totalepdolr = filtrartotal(laborepdolr,bbepdolr,mepdolr,scepdolr,oepdolr);\n\n \t\t\t\t\t\t // DTTO ORIENTAL REAL EN BOLIVARES\n\t\t\t\t\t \t var labordttobsfr = filtrarcostohab(habr,filtrolabor,4,'_r',1);\n \t\t\t\t\t\t var bbdttobsfr = filtrarcostohab(habr,filtrobb,4,'_r',1);\n \t\t\t\t\t\t var mdttobsfr = filtrarcostohab(habr,filtrom,4,'_r',1);\n \t\t\t\t\t\t var scdttobsfr = filtrarcostohab(habr,filtrosc,4,'_r',1);\n \t\t\t\t\t\t var odttobsfr = filtrarcostohab(habr,filtroo,4,'_r',1);\n \t\t\t\t\t\t var totaldttobsfr = filtrartotal(labordttobsfr,bbdttobsfr,mdttobsfr,scdttobsfr,odttobsfr);\n\n \t\t\t\t\t\t // DTTO ORIENTAL REAL EN DOLARES\n \t\t\t\t\t\t var labordttodolr = filtrarcostohab(habr,filtrolabor,4,'_r',2);\n \t\t\t\t\t\t var bbdttodolr = filtrarcostohab(habr,filtrobb,4,'_r',2);\n \t\t\t\t\t\t var mdttodolr = filtrarcostohab(habr,filtrom,4,'_r',2);\n \t\t\t\t\t\t var scdttodolr = filtrarcostohab(habr,filtrosc,4,'_r',2);\n \t\t\t\t\t\t var odttodolr = filtrarcostohab(habr,filtroo,4,'_r',2);\n \t\t\t\t\t\t var totaldttodolr = filtrartotal(labordttodolr,bbdttodolr,mdttodolr,scdttodolr,odttodolr);\n\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN BOLIVARES\n \t\t\t\t\t\t var labordivobsfr = filtrardivo(labordttobsfr,laborepbsfr);\n \t\t\t\t\t\t var bbdivobsfr = filtrardivo(bbdttobsfr,bbepbsfr);\n \t\t\t\t\t\t var mdivobsfr = filtrardivo(mdttobsfr,mepbsfr);\n \t\t\t\t\t\t var scdivobsfr = filtrardivo(scdttobsfr,scepbsfr);\n \t\t\t\t\t\t var odivobsfr = filtrardivo(odttobsfr,oepbsfr);\n \t\t\t\t\t\t var totaldivobsfr = filtrartotal(labordivobsfr,bbdivobsfr,mdivobsfr,scdivobsfr,odivobsfr);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN DOLARES\n \t\t\t\t\t\t var labordivodolr = filtrardivo(labordttodolr,laborepdolr);\n \t\t\t\t\t\t var bbdivodolr = filtrardivo(bbdttodolr,bbepdolr);\n \t\t\t\t\t\t var mdivodolr = filtrardivo(mdttodolr,mepdolr);\n \t\t\t\t\t\t var scdivodolr = filtrardivo(scdttodolr,scepdolr);\n \t\t\t\t\t\t var odivodolr = filtrardivo(odttodolr,oepdolr);\n \t\t\t\t\t\t var totaldivodolr = filtrartotal(labordivodolr,bbdivodolr,mdivodolr,scdivodolr,odivodolr);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN DOLARES EQUIVALENTES\n \t\t\t\t\t\t var labordivoDeqvr = filtroequivalente(labordivobsfr,labordivodolr);\n \t\t\t\t\t\t var bbdivoDeqvr = filtroequivalente(bbdivobsfr,bbdivodolr);\n \t\t\t\t\t\t var mdivoDeqvr = filtroequivalente(mdivobsfr,mdivodolr);\n \t\t\t\t\t\t var scdivoDeqvr = filtroequivalente(scdivobsfr,scdivodolr);\n \t\t\t\t\t\t var odivoDeqvr = filtroequivalente(odivobsfr,odivodolr);\n \t\t\t\t\t\t var totaldivoDeqvr = filtrartotal(labordivoDeqvr,bbdivoDeqvr,mdivoDeqvr,scdivoDeqvr,odivoDeqvr);\n\n \t\t\t\t\t\t /////////////FIN REAL ////////////////////////////////////////////////\n\n \t\t\t\t\t\t //////////////// MEJOR VISION ///////////////////////////////////////////////\n \t\t\t\t\t\t // ESFUERZO PROPIO REAL EN BOLIVARES \n\t\t\t\t\t \t var laborepbsfmv = filtrarcostohab(habmv,filtrolabor,5,'_mv',1);\n \t\t\t\t\t\t var bbepbsfmv = filtrarcostohab(habmv,filtrobb,5,'_mv',1);\n \t\t\t\t\t\t var mepbsfmv = filtrarcostohab(habmv,filtrom,5,'_mv',1);\n \t\t\t\t\t\t var scepbsfmv = filtrarcostohab(habmv,filtrosc,5,'_mv',1);\n \t\t\t\t\t\t var oepbsfmv = filtrarcostohab(habmv,filtroo,5,'_mv',1);\n \t\t\t\t\t\t var totalepbsfmv = filtrartotal(laborepbsfmv,bbepbsfmv,mepbsfmv,scepbsfmv,oepbsfmv);\n \t\t\t\t\t\t \n \t\t\t\t\t\t // ESFUERZOS PROPIOS REAL EN DOLARES\n \t\t\t\t\t\t var laborepdolmv = filtrarcostohab(habmv,filtrolabor,5,'_mv',2);\n \t\t\t\t\t\t var bbepdolmv = filtrarcostohab(habmv,filtrobb,5,'_mv',2);\n \t\t\t\t\t\t var mepdolmv = filtrarcostohab(habmv,filtrom,5,'_mv',2);\n \t\t\t\t\t\t var scepdolmv = filtrarcostohab(habmv,filtrosc,5,'_mv',2);\n \t\t\t\t\t\t var oepdolmv = filtrarcostohab(habmv,filtroo,5,'_mv',2);\n \t\t\t\t\t\t var totalepdolmv = filtrartotal(laborepdolmv,bbepdolmv,mepdolmv,scepdolmv,oepdolmv);\n\n \t\t\t\t\t\t // DTTO ORIENTAL REAL EN BOLIVARES\n\t\t\t\t\t \t var labordttobsfmv = filtrarcostohab(habmv,filtrolabor,4,'_mv',1);\n \t\t\t\t\t\t var bbdttobsfmv = filtrarcostohab(habmv,filtrobb,4,'_mv',1);\n \t\t\t\t\t\t var mdttobsfmv = filtrarcostohab(habmv,filtrom,4,'_mv',1);\n \t\t\t\t\t\t var scdttobsfmv = filtrarcostohab(habmv,filtrosc,4,'_mv',1);\n \t\t\t\t\t\t var odttobsfmv = filtrarcostohab(habmv,filtroo,4,'_mv',1);\n \t\t\t\t\t\t var totaldttobsfmv = filtrartotal(labordttobsfmv,bbdttobsfmv,mdttobsfmv,scdttobsfmv,odttobsfmv);\n\n \t\t\t\t\t\t // DTTO ORIENTAL REAL EN DOLARES\n \t\t\t\t\t\t var labordttodolmv = filtrarcostohab(habmv,filtrolabor,4,'_mv',2);\n \t\t\t\t\t\t var bbdttodolmv = filtrarcostohab(habmv,filtrobb,4,'_mv',2);\n \t\t\t\t\t\t var mdttodolmv = filtrarcostohab(habmv,filtrom,4,'_mv',2);\n \t\t\t\t\t\t var scdttodolmv = filtrarcostohab(habmv,filtrosc,4,'_mv',2);\n \t\t\t\t\t\t var odttodolmv = filtrarcostohab(habmv,filtroo,4,'_mv',2);\n \t\t\t\t\t\t var totaldttodolmv = filtrartotal(labordttodolmv,bbdttodolmv,mdttodolmv,scdttodolmv,odttodolmv);\n\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN BOLIVARES\n \t\t\t\t\t\t var labordivobsfmv = filtrardivo(labordttobsfmv,laborepbsfmv);\n \t\t\t\t\t\t var bbdivobsfmv = filtrardivo(bbdttobsfmv,bbepbsfmv);\n \t\t\t\t\t\t var mdivobsfmv = filtrardivo(mdttobsfmv,mepbsfmv);\n \t\t\t\t\t\t var scdivobsfmv = filtrardivo(scdttobsfmv,scepbsfmv);\n \t\t\t\t\t\t var odivobsfmv = filtrardivo(odttobsfmv,oepbsfmv);\n \t\t\t\t\t\t var totaldivobsfmv = filtrartotal(labordivobsfmv,bbdivobsfmv,mdivobsfmv,scdivobsfmv,odivobsfmv);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN DOLARES\n \t\t\t\t\t\t var labordivodolmv = filtrardivo(labordttodolmv,laborepdolmv);\n \t\t\t\t\t\t var bbdivodolmv = filtrardivo(bbdttodolmv,bbepdolmv);\n \t\t\t\t\t\t var mdivodolmv = filtrardivo(mdttodolmv,mepdolmv);\n \t\t\t\t\t\t var scdivodolmv = filtrardivo(scdttodolmv,scepdolmv);\n \t\t\t\t\t\t var odivodolmv = filtrardivo(odttodolmv,oepdolmv);\n \t\t\t\t\t\t var totaldivodolmv = filtrartotal(labordivodolmv,bbdivodolmv,mdivodolmv,scdivodolmv,odivodolmv);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN DOLARES EQUIVALENTES\n \t\t\t\t\t\t var labordivoDeqvmv = filtroequivalente(labordivobsfmv,labordivodolmv);\n \t\t\t\t\t\t var bbdivoDeqvmv = filtroequivalente(bbdivobsfmv,bbdivodolmv);\n \t\t\t\t\t\t var mdivoDeqvmv = filtroequivalente(mdivobsfmv,mdivodolmv);\n \t\t\t\t\t\t var scdivoDeqvmv = filtroequivalente(scdivobsfmv,scdivodolmv);\n \t\t\t\t\t\t var odivoDeqvmv = filtroequivalente(odivobsfmv,odivodolmv);\n \t\t\t\t\t\t var totaldivoDeqvmv = filtrartotal(labordivoDeqvmv,bbdivoDeqvmv,mdivoDeqvmv,scdivoDeqvmv,odivoDeqvmv);\n\n \t\t\t\t\t\tvar aux=0;\n \t\t\t\t\t\t// labor y beneficio de real, MMBSF, MM$, MMEQUIV\n \t\t\t\t\t\tvar laborybbdivobsfr = filtrardivo(labordivobsfr,bbdivobsfr); \n \t\t\t\t\t\tvar laborybbdivodolr = filtrardivo(labordivodolr,bbdivodolr); \n \t\t\t\t\t\tvar laborybbdivoDeqvr= filtrardivo(labordivoDeqvr,bbdivoDeqvr);\n \t\t\t\t\t\t// labor y beneficio de plan MMBSF,MM$, MMEQUIV\n \t\t\t\t\t\tvar laborybbdivobsf = filtrardivo(labordivobsf,bbdivobsf); \n \t\t\t\t\t\tvar laborybbdivodol = filtrardivo(labordivodol,bbdivodol); \n \t\t\t\t\t\tvar laborybbdivoDeqv = filtrardivo(labordivoDeqv,bbdivoDeqv);\n \t\t\t\t\t\t// Labor y beneficio de mejor vision MMBSF, MM$, MMEQUIV\n \t\t\t\t\t\tvar laborybbdivobsfmv = filtrardivo(labordivobsfmv,bbdivobsfmv); \n \t\t\t\t\t\tvar laborybbdivodolmv = filtrardivo(labordivodolmv,bbdivodolmv); \n \t\t\t\t\t\tvar laborybbdivoDeqvmv = filtrardivo(labordivoDeqvmv,bbdivoDeqvmv);\n\n\n\n \t\t\t\t\t\t////////////// HABILITADORAS ANTEPROYECTOS //////////////////////////////\n \t\t\t\t\t\t// ESFUERZO PROPIO REAL EN BOLIVARES \n\t\t\t\t\t \t var laborepbsfant = filtrarcostohab(habant,filtrolabor,5,'_ant',1);\n \t\t\t\t\t\t var bbepbsfant = filtrarcostohab(habant,filtrobb,5,'_ant',1);\n \t\t\t\t\t\t var mepbsfant = filtrarcostohab(habant,filtrom,5,'_ant',1);\n \t\t\t\t\t\t var scepbsfant = filtrarcostohab(habant,filtrosc,5,'_ant',1);\n \t\t\t\t\t\t var oepbsfant = filtrarcostohab(habant,filtroo,5,'_ant',1);\n \t\t\t\t\t\t var totalepbsfant = filtrartotal(laborepbsfant,bbepbsfant,mepbsfant,scepbsfant,oepbsfant);\n \t\t\t\t\t\t \n \t\t\t\t\t\t // ESFUERZOS PROPIOS REAL EN DOLARES\n \t\t\t\t\t\t var laborepdolant = filtrarcostohab(habant,filtrolabor,5,'_ant',2);\n \t\t\t\t\t\t var bbepdolant = filtrarcostohab(habant,filtrobb,5,'_ant',2);\n \t\t\t\t\t\t var mepdolant = filtrarcostohab(habant,filtrom,5,'_ant',2);\n \t\t\t\t\t\t var scepdolant = filtrarcostohab(habant,filtrosc,5,'_ant',2);\n \t\t\t\t\t\t var oepdolant = filtrarcostohab(habant,filtroo,5,'_ant',2);\n \t\t\t\t\t\t var totalepdolant = filtrartotal(laborepdolant,bbepdolant,mepdolant,scepdolant,oepdolant);\n\n \t\t\t\t\t\t // DTTO ORIENTAL REAL EN BOLIVARES\n\t\t\t\t\t \t var labordttobsfant = filtrarcostohab(habant,filtrolabor,4,'_ant',1);\n \t\t\t\t\t\t var bbdttobsfant = filtrarcostohab(habant,filtrobb,4,'_ant',1);\n \t\t\t\t\t\t var mdttobsfant = filtrarcostohab(habant,filtrom,4,'_ant',1);\n \t\t\t\t\t\t var scdttobsfant = filtrarcostohab(habant,filtrosc,4,'_ant',1);\n \t\t\t\t\t\t var odttobsfant = filtrarcostohab(habant,filtroo,4,'_ant',1);\n \t\t\t\t\t\t var totaldttobsfant = filtrartotal(labordttobsfant,bbdttobsfant,mdttobsfant,scdttobsfant,odttobsfant);\n\n \t\t\t\t\t\t // DTTO ORIENTAL REAL EN DOLARES\n \t\t\t\t\t\t var labordttodolant = filtrarcostohab(habant,filtrolabor,4,'_ant',2);\n \t\t\t\t\t\t var bbdttodolant = filtrarcostohab(habant,filtrobb,4,'_ant',2);\n \t\t\t\t\t\t var mdttodolant = filtrarcostohab(habant,filtrom,4,'_ant',2);\n \t\t\t\t\t\t var scdttodolant = filtrarcostohab(habant,filtrosc,4,'_ant',2);\n \t\t\t\t\t\t var odttodolant = filtrarcostohab(habant,filtroo,4,'_ant',2);\n \t\t\t\t\t\t var totaldttodolant = filtrartotal(labordttodolant,bbdttodolant,mdttodolant,scdttodolant,odttodolant);\n\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN BOLIVARES\n \t\t\t\t\t\t var labordivobsfant = filtrardivo(labordttobsfant,laborepbsfant);\n \t\t\t\t\t\t var bbdivobsfant = filtrardivo(bbdttobsfant,bbepbsfant);\n \t\t\t\t\t\t var mdivobsfant = filtrardivo(mdttobsfant,mepbsfant);\n \t\t\t\t\t\t var scdivobsfant = filtrardivo(scdttobsfant,scepbsfant);\n \t\t\t\t\t\t var odivobsfant = filtrardivo(odttobsfant,oepbsfant);\n \t\t\t\t\t\t var totaldivobsfant = filtrartotal(labordivobsfant,bbdivobsfant,mdivobsfant,scdivobsfant,odivobsfant);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN DOLARES\n \t\t\t\t\t\t var labordivodolant = filtrardivo(labordttodolant,laborepdolant);\n \t\t\t\t\t\t var bbdivodolant = filtrardivo(bbdttodolant,bbepdolant);\n \t\t\t\t\t\t var mdivodolant = filtrardivo(mdttodolant,mepdolant);\n \t\t\t\t\t\t var scdivodolant = filtrardivo(scdttodolant,scepdolant);\n \t\t\t\t\t\t var odivodolant = filtrardivo(odttodolant,oepdolant);\n \t\t\t\t\t\t var totaldivodolant = filtrartotal(labordivodolant,bbdivodolant,mdivodolant,scdivodolant,odivodolant);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN DOLARES EQUIVALENTES\n \t\t\t\t\t\t var labordivoDeqvant = filtroequivalente(labordivobsfant,labordivodolant);\n \t\t\t\t\t\t var bbdivoDeqvant = filtroequivalente(bbdivobsfant,bbdivodolant);\n \t\t\t\t\t\t var mdivoDeqvant = filtroequivalente(mdivobsfant,mdivodolant);\n \t\t\t\t\t\t var scdivoDeqvant = filtroequivalente(scdivobsfant,scdivodolant);\n \t\t\t\t\t\t var odivoDeqvant = filtroequivalente(odivobsfant,odivodolant);\n \t\t\t\t\t\t var totaldivoDeqvant = filtrartotal(labordivoDeqvant,bbdivoDeqvant,mdivoDeqvant,scdivoDeqvant,odivoDeqvant);\n\n \t\t\t\t\t\t \n \t\t\t\t\t\t// Labor y beneficio de mejor vision MMBSF, MM$, MMEQUIV\n \t\t\t\t\t\tvar laborybbdivobsfant = filtrardivo(labordivobsfant,bbdivobsfant); \n \t\t\t\t\t\tvar laborybbdivodolant = filtrardivo(labordivodolant,bbdivodolant); \n \t\t\t\t\t\tvar laborybbdivoDeqvant = filtrardivo(labordivoDeqvant,bbdivoDeqvant);\n\n\n \t\t\t\t\t\t///////PLAN PROYECTOS////////////////////////////////////////////////////////////\n\n \t\t\t\t\t\t// CATEGORIA GEOFISICA\n \t\t\t\t\t\tvar pgeobsf = categoriaproyectos(pplan,geofisica,'_p',1);\n \t\t\t\t\t\tvar pgeodol = categoriaproyectos(pplan,geofisica,'_p',2);\n \t\t\t\t\t\tvar pgeoDeqv = filtroequivalente(pgeobsf,pgeodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE AVANZADA\n \t\t\t\t\t\tvar pperfavanzbsf = categoriaproyectos(pplan,perfavanz,'_p',1);\n \t\t\t\t\t\tvar pperfavanzdol = categoriaproyectos(pplan,perfavanz,'_p',2);\n \t\t\t\t\t\tvar pperfavanzDeqv = filtroequivalente(pperfavanzbsf,pperfavanzdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE DESARROLLO \n \t\t\t\t\t\tvar pperfdesarrobsf = categoriaproyectos(pplan,perfdesarro,'_p',1);\n \t\t\t\t\t\tvar pperfdesarrodol = categoriaproyectos(pplan,perfdesarro,'_p',2);\n \t\t\t\t\t\tvar pperfdesarroDeqv = filtroequivalente(pperfdesarrobsf,pperfdesarrodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION EXPLORATORIA\n \t\t\t\t\t\tvar pperfexplorabsf = categoriaproyectos(pplan,perfexplora,'_p',1);\n \t\t\t\t\t\tvar pperfexploradol = categoriaproyectos(pplan,perfexplora,'_p',2);\n \t\t\t\t\t\tvar pperfexploraDeqv = filtroequivalente(pperfexplorabsf,pperfexploradol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION ADICIONAL\n \t\t\t\t\t\tvar precupadicbsf = categoriaproyectos(pplan,recupadic,'_p',1);\n \t\t\t\t\t\tvar precupadicdol = categoriaproyectos(pplan,recupadic,'_p',2);\n \t\t\t\t\t\tvar precupadicDeqv = filtroequivalente(precupadicbsf,precupadicdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECOMPLETACION DE POZOS\n \t\t\t\t\t\tvar precompozosbsf = categoriaproyectos(pplan,recompozos,'_p',1);\n \t\t\t\t\t\tvar precompozosdol = categoriaproyectos(pplan,recompozos,'_p',2);\n \t\t\t\t\t\tvar precompozosDeqv = filtroequivalente(precompozosbsf,precompozosdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION SUPLEMENTARIA\n \t\t\t\t\t\tvar precupesuplebsf = categoriaproyectos(pplan,recupesuple,'_p',1);\n \t\t\t\t\t\tvar precupesupledol = categoriaproyectos(pplan,recupesuple,'_p',2);\n \t\t\t\t\t\tvar precupesupleDeqv = filtroequivalente(precupesuplebsf,precupesupledol);\n \t\t\t\t\t\t///////////////////////////\t\n \t\t\t\t\t\t// CATEGORIA INYECCCION ALTERNA DE VAPOR\n \t\t\t\t\t\tvar pinyectalternavaporbsf = categoriaproyectos(pplan,inyectalternavapor,'_p',1);\n \t\t\t\t\t\tvar pinyectalternavapordol = categoriaproyectos(pplan,inyectalternavapor,'_p',2);\n \t\t\t\t\t\tvar pinyectalternavaporDeqv = filtroequivalente(pinyectalternavaporbsf,pinyectalternavapordol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA LEVANTAMIENTO ARTIFICIAL\n \t\t\t\t\t\tvar plevantamientoartifbsf = categoriaproyectos(pplan,levantamientoartif,'_p',1);\n \t\t\t\t\t\tvar plevantamientoartifdol = categoriaproyectos(pplan,levantamientoartif,'_p',2);\n \t\t\t\t\t\tvar plevantamientoartifDeqv = filtroequivalente(plevantamientoartifbsf,plevantamientoartifdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA CONSERVACION Y UTILIZACION DEL GAS\n \t\t\t\t\t\tvar pconutigasbsf = categoriaproyectos(pplan,conutigas,'_p',1);\n \t\t\t\t\t\tvar pconutigasdol = categoriaproyectos(pplan,conutigas,'_p',2);\n \t\t\t\t\t\tvar pconutigasDeqv = filtroequivalente(pconutigasbsf,pconutigasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PLANTA DE LIQUIDOS GAS \n \t\t\t\t\t\tvar pplantliqgasbsf = categoriaproyectos(pplan,plantliqgas,'_p',1);\n \t\t\t\t\t\tvar pplantliqgasdol = categoriaproyectos(pplan,plantliqgas,'_p',2);\n \t\t\t\t\t\tvar pplantliqgasDeqv = filtroequivalente(pplantliqgasbsf,pplantliqgasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA INTALACIONES DE PRODUCCION\n \t\t\t\t\t\tvar pinstproducbsf = categoriaproyectos(pplan,instproduc,'_p',1);\n \t\t\t\t\t\tvar pinstproducdol = categoriaproyectos(pplan,instproduc,'_p',2);\n \t\t\t\t\t\tvar pinstproducDeqv = filtroequivalente(pinstproducbsf,pinstproducdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OLEODUCTO Y TERMINALES DE EMBARQUE\n \t\t\t\t\t\tvar poleoterminaembbsf = categoriaproyectos(pplan,oleoterminaemb,'_p',1);\n \t\t\t\t\t\tvar poleoterminaembdol = categoriaproyectos(pplan,oleoterminaemb,'_p',2);\n \t\t\t\t\t\tvar poleoterminaembDeqv = filtroequivalente(poleoterminaembbsf,poleoterminaembdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA ALMACENAMIENTO\n \t\t\t\t\t\tvar palmacenamientobsf = categoriaproyectos(pplan,almacenamiento,'_p',1);\n \t\t\t\t\t\tvar palmacenamientodol = categoriaproyectos(pplan,almacenamiento,'_p',2);\n \t\t\t\t\t\tvar palmacenamientoDeqv = filtroequivalente(palmacenamientobsf,palmacenamientodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA DESARROLLO URBANO\n \t\t\t\t\t\tvar pdesarrollourbabsf = categoriaproyectos(pplan,desarrollourba,'_p',1);\n \t\t\t\t\t\tvar pdesarrollourbadol = categoriaproyectos(pplan,desarrollourba,'_p',2);\n \t\t\t\t\t\tvar pdesarrollourbaDeqv = filtroequivalente(pdesarrollourbabsf,pdesarrollourbadol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PROTECCION INTEGRAL\n \t\t\t\t\t\tvar pproteccionintegbsf = categoriaproyectos(pplan,proteccioninteg,'_p',1);\n \t\t\t\t\t\tvar pproteccionintegdol = categoriaproyectos(pplan,proteccioninteg,'_p',2);\n \t\t\t\t\t\tvar pproteccionintegDeqv = filtroequivalente(pproteccionintegbsf,pproteccionintegdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PREVENCION Y CONTROL DE PERDIDAS\n \t\t\t\t\t\tvar ppcpbsf = categoriaproyectos(pplan,pcp,'_p',1);\n \t\t\t\t\t\tvar ppcpdol = categoriaproyectos(pplan,pcp,'_p',2);\n \t\t\t\t\t\tvar ppcpDeqv = filtroequivalente(ppcpbsf,ppcpdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA TELECOMUNICACIONES\n \t\t\t\t\t\tvar ptelecomunicacionesbsf = categoriaproyectos(pplan,telecomunicaciones,'_p',1);\n \t\t\t\t\t\tvar ptelecomunicacionesdol = categoriaproyectos(pplan,telecomunicaciones,'_p',2);\n \t\t\t\t\t\tvar ptelecomunicacionesDeqv = filtroequivalente(ptelecomunicacionesbsf,ptelecomunicacionesdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA AUTOMATIZACION INDUSTRIAL\n \t\t\t\t\t\tvar pautomatizacionindbsf = categoriaproyectos(pplan,automatizacionind,'_p',1);\n \t\t\t\t\t\tvar pautomatizacioninddol = categoriaproyectos(pplan,automatizacionind,'_p',2);\n \t\t\t\t\t\tvar pautomatizacionindDeqv = filtroequivalente(pautomatizacionindbsf,pautomatizacioninddol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA COMPUTACION Y SISTEMA\n \t\t\t\t\t\tvar pcomputaysistebsf = categoriaproyectos(pplan,computaysiste,'_p',1);\n \t\t\t\t\t\tvar pcomputaysistedol = categoriaproyectos(pplan,computaysiste,'_p',2);\n \t\t\t\t\t\tvar pcomputaysisteDeqv = filtroequivalente(pcomputaysistebsf,pcomputaysistedol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EDIFICACIONES E INSTALACIONES INDUSTRIALES\n \t\t\t\t\t\tvar pedifinstindustbsf = categoriaproyectos(pplan,edifinstindust,'_p',1);\n \t\t\t\t\t\tvar pedifinstindustdol = categoriaproyectos(pplan,edifinstindust,'_p',2);\n \t\t\t\t\t\tvar pedifinstindustDeqv = filtroequivalente(pedifinstindustbsf,pedifinstindustdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EQUIPOS\n \t\t\t\t\t\tvar pequiposbsf = categoriaproyectos(pplan,equipos,'_p',1);\n \t\t\t\t\t\tvar pequiposdol = categoriaproyectos(pplan,equipos,'_p',2);\n \t\t\t\t\t\tvar pequiposDeqv = filtroequivalente(pequiposbsf,pequiposdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OTRAS INVERSIONES\n \t\t\t\t\t\tvar potrasinvbsf = categoriaproyectos(pplan,otrasinv,'_p',1);\n \t\t\t\t\t\tvar potrasinvdol = categoriaproyectos(pplan,otrasinv,'_p',2);\n \t\t\t\t\t\tvar potrasinvDeqv = filtroequivalente(potrasinvbsf,potrasinvdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t \n \t\t\t\t\t\t\n \t\t\t\t\t\t///////REAL PROYECTOS////////////////////////////////////////////////////////////\n\n \t\t\t\t\t\t// CATEGORIA GEOFISICA\n \t\t\t\t\t\tvar rgeobsf = categoriaproyectos(preal,geofisica,'_p',1);\n \t\t\t\t\t\tvar rgeodol = categoriaproyectos(preal,geofisica,'_p',2);\n \t\t\t\t\t\tvar rgeoDeqv = filtroequivalente(rgeobsf,rgeodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE AVANZADA\n \t\t\t\t\t\tvar rperfavanzbsf = categoriaproyectos(preal,perfavanz,'_p',1);\n \t\t\t\t\t\tvar rperfavanzdol = categoriaproyectos(preal,perfavanz,'_p',2);\n \t\t\t\t\t\tvar rperfavanzDeqv = filtroequivalente(rperfavanzbsf,rperfavanzdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE DESARROLLO \n \t\t\t\t\t\tvar rperfdesarrobsf = categoriaproyectos(preal,perfdesarro,'_p',1);\n \t\t\t\t\t\tvar rperfdesarrodol = categoriaproyectos(preal,perfdesarro,'_p',2);\n \t\t\t\t\t\tvar rperfdesarroDeqv = filtroequivalente(rperfdesarrobsf,rperfdesarrodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION EXPLORATORIA\n \t\t\t\t\t\tvar rperfexplorabsf = categoriaproyectos(preal,perfexplora,'_p',1);\n \t\t\t\t\t\tvar rperfexploradol = categoriaproyectos(preal,perfexplora,'_p',2);\n \t\t\t\t\t\tvar rperfexploraDeqv = filtroequivalente(rperfexplorabsf,rperfexploradol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION ADICIONAL\n \t\t\t\t\t\tvar rrecupadicbsf = categoriaproyectos(preal,recupadic,'_p',1);\n \t\t\t\t\t\tvar rrecupadicdol = categoriaproyectos(preal,recupadic,'_p',2);\n \t\t\t\t\t\tvar rrecupadicDeqv = filtroequivalente(rrecupadicbsf,rrecupadicdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECOMPLETACION DE POZOS\n \t\t\t\t\t\tvar rrecompozosbsf = categoriaproyectos(preal,recompozos,'_p',1);\n \t\t\t\t\t\tvar rrecompozosdol = categoriaproyectos(preal,recompozos,'_p',2);\n \t\t\t\t\t\tvar rrecompozosDeqv = filtroequivalente(rrecompozosbsf,rrecompozosdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION SUPLEMENTARIA\n \t\t\t\t\t\tvar rrecupesuplebsf = categoriaproyectos(preal,recupesuple,'_p',1);\n \t\t\t\t\t\tvar rrecupesupledol = categoriaproyectos(preal,recupesuple,'_p',2);\n \t\t\t\t\t\tvar rrecupesupleDeqv = filtroequivalente(rrecupesuplebsf,rrecupesupledol);\n \t\t\t\t\t\t///////////////////////////\t\n \t\t\t\t\t\t// CATEGORIA INYECCCION ALTERNA DE VAPOR\n \t\t\t\t\t\tvar rinyectalternavaporbsf = categoriaproyectos(preal,inyectalternavapor,'_p',1);\n \t\t\t\t\t\tvar rinyectalternavapordol = categoriaproyectos(preal,inyectalternavapor,'_p',2);\n \t\t\t\t\t\tvar rinyectalternavaporDeqv = filtroequivalente(rinyectalternavaporbsf,rinyectalternavapordol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA LEVANTAMIENTO ARTIFICIAL\n \t\t\t\t\t\tvar rlevantamientoartifbsf = categoriaproyectos(preal,levantamientoartif,'_p',1);\n \t\t\t\t\t\tvar rlevantamientoartifdol = categoriaproyectos(preal,levantamientoartif,'_p',2);\n \t\t\t\t\t\tvar rlevantamientoartifDeqv = filtroequivalente(rlevantamientoartifbsf,rlevantamientoartifdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA CONSERVACION Y UTILIZACION DEL GAS\n \t\t\t\t\t\tvar rconutigasbsf = categoriaproyectos(preal,conutigas,'_p',1);\n \t\t\t\t\t\tvar rconutigasdol = categoriaproyectos(preal,conutigas,'_p',2);\n \t\t\t\t\t\tvar rconutigasDeqv = filtroequivalente(rconutigasbsf,rconutigasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PLANTA DE LIQUIDOS GAS \n \t\t\t\t\t\tvar rplantliqgasbsf = categoriaproyectos(preal,plantliqgas,'_p',1);\n \t\t\t\t\t\tvar rplantliqgasdol = categoriaproyectos(preal,plantliqgas,'_p',2);\n \t\t\t\t\t\tvar rplantliqgasDeqv = filtroequivalente(rplantliqgasbsf,rplantliqgasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA INTALACIONES DE PRODUCCION\n \t\t\t\t\t\tvar rinstproducbsf = categoriaproyectos(preal,instproduc,'_p',1);\n \t\t\t\t\t\tvar rinstproducdol = categoriaproyectos(preal,instproduc,'_p',2);\n \t\t\t\t\t\tvar rinstproducDeqv = filtroequivalente(rinstproducbsf,rinstproducdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OLEODUCTO Y TERMINALES DE EMBARQUE\n \t\t\t\t\t\tvar roleoterminaembbsf = categoriaproyectos(preal,oleoterminaemb,'_p',1);\n \t\t\t\t\t\tvar roleoterminaembdol = categoriaproyectos(preal,oleoterminaemb,'_p',2);\n \t\t\t\t\t\tvar roleoterminaembDeqv = filtroequivalente(roleoterminaembbsf,roleoterminaembdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA ALMACENAMIENTO\n \t\t\t\t\t\tvar ralmacenamientobsf = categoriaproyectos(preal,almacenamiento,'_p',1);\n \t\t\t\t\t\tvar ralmacenamientodol = categoriaproyectos(preal,almacenamiento,'_p',2);\n \t\t\t\t\t\tvar ralmacenamientoDeqv = filtroequivalente(ralmacenamientobsf,ralmacenamientodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA DESARROLLO URBANO\n \t\t\t\t\t\tvar rdesarrollourbabsf = categoriaproyectos(preal,desarrollourba,'_p',1);\n \t\t\t\t\t\tvar rdesarrollourbadol = categoriaproyectos(preal,desarrollourba,'_p',2);\n \t\t\t\t\t\tvar rdesarrollourbaDeqv = filtroequivalente(rdesarrollourbabsf,rdesarrollourbadol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PROTECCION INTEGRAL\n \t\t\t\t\t\tvar rproteccionintegbsf = categoriaproyectos(preal,proteccioninteg,'_p',1);\n \t\t\t\t\t\tvar rproteccionintegdol = categoriaproyectos(preal,proteccioninteg,'_p',2);\n \t\t\t\t\t\tvar rproteccionintegDeqv = filtroequivalente(rproteccionintegbsf,rproteccionintegdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PREVENCION Y CONTROL DE PERDIDAS\n \t\t\t\t\t\tvar rpcpbsf = categoriaproyectos(preal,pcp,'_p',1);\n \t\t\t\t\t\tvar rpcpdol = categoriaproyectos(preal,pcp,'_p',2);\n \t\t\t\t\t\tvar rpcpDeqv = filtroequivalente(rpcpbsf,rpcpdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA TELECOMUNICACIONES\n \t\t\t\t\t\tvar rtelecomunicacionesbsf = categoriaproyectos(preal,telecomunicaciones,'_p',1);\n \t\t\t\t\t\tvar rtelecomunicacionesdol = categoriaproyectos(preal,telecomunicaciones,'_p',2);\n \t\t\t\t\t\tvar rtelecomunicacionesDeqv = filtroequivalente(rtelecomunicacionesbsf,rtelecomunicacionesdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA AUTOMATIZACION INDUSTRIAL\n \t\t\t\t\t\tvar rautomatizacionindbsf = categoriaproyectos(preal,automatizacionind,'_p',1);\n \t\t\t\t\t\tvar rautomatizacioninddol = categoriaproyectos(preal,automatizacionind,'_p',2);\n \t\t\t\t\t\tvar rautomatizacionindDeqv = filtroequivalente(rautomatizacionindbsf,rautomatizacioninddol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA COMPUTACION Y SISTEMA\n \t\t\t\t\t\tvar rcomputaysistebsf = categoriaproyectos(preal,computaysiste,'_p',1);\n \t\t\t\t\t\tvar rcomputaysistedol = categoriaproyectos(preal,computaysiste,'_p',2);\n \t\t\t\t\t\tvar rcomputaysisteDeqv = filtroequivalente(rcomputaysistebsf,rcomputaysistedol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EDIFICACIONES E INSTALACIONES INDUSTRIALES\n \t\t\t\t\t\tvar redifinstindustbsf = categoriaproyectos(preal,edifinstindust,'_p',1);\n \t\t\t\t\t\tvar redifinstindustdol = categoriaproyectos(preal,edifinstindust,'_p',2);\n \t\t\t\t\t\tvar redifinstindustDeqv = filtroequivalente(redifinstindustbsf,redifinstindustdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EQUIPOS\n \t\t\t\t\t\tvar requiposbsf = categoriaproyectos(preal,equipos,'_p',1);\n \t\t\t\t\t\tvar requiposdol = categoriaproyectos(preal,equipos,'_p',2);\n \t\t\t\t\t\tvar requiposDeqv = filtroequivalente(requiposbsf,requiposdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OTRAS INVERSIONES\n \t\t\t\t\t\tvar rotrasinvbsf = categoriaproyectos(preal,otrasinv,'_p',1);\n \t\t\t\t\t\tvar rotrasinvdol = categoriaproyectos(preal,otrasinv,'_p',2);\n \t\t\t\t\t\tvar rotrasinvDeqv = filtroequivalente(rotrasinvbsf,rotrasinvdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t \n \t\t\t\t\t\t///////MEJOR VISION PROYECTOS////////////////////////////////////////////////////////////\n\n \t\t\t\t\t\t// CATEGORIA GEOFISICA\n \t\t\t\t\t\tvar mvgeobsf = categoriaproyectos(pmv,geofisica,'_p',1);\n \t\t\t\t\t\tvar mvgeodol = categoriaproyectos(pmv,geofisica,'_p',2);\n \t\t\t\t\t\tvar mvgeoDeqv = filtroequivalente(mvgeobsf,mvgeodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE AVANZADA\n \t\t\t\t\t\tvar mvperfavanzbsf = categoriaproyectos(pmv,perfavanz,'_p',1);\n \t\t\t\t\t\tvar mvperfavanzdol = categoriaproyectos(pmv,perfavanz,'_p',2);\n \t\t\t\t\t\tvar mvperfavanzDeqv = filtroequivalente(mvperfavanzbsf,mvperfavanzdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE DESARROLLO \n \t\t\t\t\t\tvar mvperfdesarrobsf = categoriaproyectos(pmv,perfdesarro,'_p',1);\n \t\t\t\t\t\tvar mvperfdesarrodol = categoriaproyectos(pmv,perfdesarro,'_p',2);\n \t\t\t\t\t\tvar mvperfdesarroDeqv = filtroequivalente(mvperfdesarrobsf,mvperfdesarrodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION EXPLORATORIA\n \t\t\t\t\t\tvar mvperfexplorabsf = categoriaproyectos(pmv,perfexplora,'_p',1);\n \t\t\t\t\t\tvar mvperfexploradol = categoriaproyectos(pmv,perfexplora,'_p',2);\n \t\t\t\t\t\tvar mvperfexploraDeqv = filtroequivalente(mvperfexplorabsf,mvperfexploradol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION ADICIONAL\n \t\t\t\t\t\tvar mvrecupadicbsf = categoriaproyectos(pmv,recupadic,'_p',1);\n \t\t\t\t\t\tvar mvrecupadicdol = categoriaproyectos(pmv,recupadic,'_p',2);\n \t\t\t\t\t\tvar mvrecupadicDeqv = filtroequivalente(mvrecupadicbsf,mvrecupadicdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECOMPLETACION DE POZOS\n \t\t\t\t\t\tvar mvrecompozosbsf = categoriaproyectos(pmv,recompozos,'_p',1);\n \t\t\t\t\t\tvar mvrecompozosdol = categoriaproyectos(pmv,recompozos,'_p',2);\n \t\t\t\t\t\tvar mvrecompozosDeqv = filtroequivalente(mvrecompozosbsf,mvrecompozosdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION SUPLEMENTARIA\n \t\t\t\t\t\tvar mvrecupesuplebsf = categoriaproyectos(pmv,recupesuple,'_p',1);\n \t\t\t\t\t\tvar mvrecupesupledol = categoriaproyectos(pmv,recupesuple,'_p',2);\n \t\t\t\t\t\tvar mvrecupesupleDeqv = filtroequivalente(mvrecupesuplebsf,mvrecupesupledol);\n \t\t\t\t\t\t///////////////////////////\t\n \t\t\t\t\t\t// CATEGORIA INYECCCION ALTERNA DE VAPOR\n \t\t\t\t\t\tvar mvinyectalternavaporbsf = categoriaproyectos(pmv,inyectalternavapor,'_p',1);\n \t\t\t\t\t\tvar mvinyectalternavapordol = categoriaproyectos(pmv,inyectalternavapor,'_p',2);\n \t\t\t\t\t\tvar mvinyectalternavaporDeqv = filtroequivalente(mvinyectalternavaporbsf,mvinyectalternavapordol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA LEVANTAMIENTO ARTIFICIAL\n \t\t\t\t\t\tvar mvlevantamientoartifbsf = categoriaproyectos(pmv,levantamientoartif,'_p',1);\n \t\t\t\t\t\tvar mvlevantamientoartifdol = categoriaproyectos(pmv,levantamientoartif,'_p',2);\n \t\t\t\t\t\tvar mvlevantamientoartifDeqv = filtroequivalente(mvlevantamientoartifbsf,mvlevantamientoartifdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA CONSERVACION Y UTILIZACION DEL GAS\n \t\t\t\t\t\tvar mvconutigasbsf = categoriaproyectos(pmv,conutigas,'_p',1);\n \t\t\t\t\t\tvar mvconutigasdol = categoriaproyectos(pmv,conutigas,'_p',2);\n \t\t\t\t\t\tvar mvconutigasDeqv = filtroequivalente(mvconutigasbsf,mvconutigasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PLANTA DE LIQUIDOS GAS \n \t\t\t\t\t\tvar mvplantliqgasbsf = categoriaproyectos(pmv,plantliqgas,'_p',1);\n \t\t\t\t\t\tvar mvplantliqgasdol = categoriaproyectos(pmv,plantliqgas,'_p',2);\n \t\t\t\t\t\tvar mvplantliqgasDeqv = filtroequivalente(mvplantliqgasbsf,mvplantliqgasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA INTALACIONES DE PRODUCCION\n \t\t\t\t\t\tvar mvinstproducbsf = categoriaproyectos(pmv,instproduc,'_p',1);\n \t\t\t\t\t\tvar mvinstproducdol = categoriaproyectos(pmv,instproduc,'_p',2);\n \t\t\t\t\t\tvar mvinstproducDeqv = filtroequivalente(mvinstproducbsf,mvinstproducdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OLEODUCTO Y TERMINALES DE EMBARQUE\n \t\t\t\t\t\tvar mvoleoterminaembbsf = categoriaproyectos(pmv,oleoterminaemb,'_p',1);\n \t\t\t\t\t\tvar mvoleoterminaembdol = categoriaproyectos(pmv,oleoterminaemb,'_p',2);\n \t\t\t\t\t\tvar mvoleoterminaembDeqv = filtroequivalente(mvoleoterminaembbsf,mvoleoterminaembdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA ALMACENAMIENTO\n \t\t\t\t\t\tvar mvalmacenamientobsf = categoriaproyectos(pmv,almacenamiento,'_p',1);\n \t\t\t\t\t\tvar mvalmacenamientodol = categoriaproyectos(pmv,almacenamiento,'_p',2);\n \t\t\t\t\t\tvar mvalmacenamientoDeqv = filtroequivalente(mvalmacenamientobsf,mvalmacenamientodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA DESARROLLO URBANO\n \t\t\t\t\t\tvar mvdesarrollourbabsf = categoriaproyectos(pmv,desarrollourba,'_p',1);\n \t\t\t\t\t\tvar mvdesarrollourbadol = categoriaproyectos(pmv,desarrollourba,'_p',2);\n \t\t\t\t\t\tvar mvdesarrollourbaDeqv = filtroequivalente(mvdesarrollourbabsf,mvdesarrollourbadol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PROTECCION INTEGRAL\n \t\t\t\t\t\tvar mvproteccionintegbsf = categoriaproyectos(pmv,proteccioninteg,'_p',1);\n \t\t\t\t\t\tvar mvproteccionintegdol = categoriaproyectos(pmv,proteccioninteg,'_p',2);\n \t\t\t\t\t\tvar mvproteccionintegDeqv = filtroequivalente(mvproteccionintegbsf,mvproteccionintegdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PREVENCION Y CONTROL DE PERDIDAS\n \t\t\t\t\t\tvar mvpcpbsf = categoriaproyectos(pmv,pcp,'_p',1);\n \t\t\t\t\t\tvar mvpcpdol = categoriaproyectos(pmv,pcp,'_p',2);\n \t\t\t\t\t\tvar mvpcpDeqv = filtroequivalente(mvpcpbsf,mvpcpdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA TELECOMUNICACIONES\n \t\t\t\t\t\tvar mvtelecomunicacionesbsf = categoriaproyectos(pmv,telecomunicaciones,'_p',1);\n \t\t\t\t\t\tvar mvtelecomunicacionesdol = categoriaproyectos(pmv,telecomunicaciones,'_p',2);\n \t\t\t\t\t\tvar mvtelecomunicacionesDeqv = filtroequivalente(mvtelecomunicacionesbsf,mvtelecomunicacionesdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA AUTOMATIZACION INDUSTRIAL\n \t\t\t\t\t\tvar mvautomatizacionindbsf = categoriaproyectos(pmv,automatizacionind,'_p',1);\n \t\t\t\t\t\tvar mvautomatizacioninddol = categoriaproyectos(pmv,automatizacionind,'_p',2);\n \t\t\t\t\t\tvar mvautomatizacionindDeqv = filtroequivalente(mvautomatizacionindbsf,mvautomatizacioninddol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA COMPUTACION Y SISTEMA\n \t\t\t\t\t\tvar mvcomputaysistebsf = categoriaproyectos(pmv,computaysiste,'_p',1);\n \t\t\t\t\t\tvar mvcomputaysistedol = categoriaproyectos(pmv,computaysiste,'_p',2);\n \t\t\t\t\t\tvar mvcomputaysisteDeqv = filtroequivalente(mvcomputaysistebsf,mvcomputaysistedol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EDIFICACIONES E INSTALACIONES INDUSTRIALES\n \t\t\t\t\t\tvar mvedifinstindustbsf = categoriaproyectos(pmv,edifinstindust,'_p',1);\n \t\t\t\t\t\tvar mvedifinstindustdol = categoriaproyectos(pmv,edifinstindust,'_p',2);\n \t\t\t\t\t\tvar mvedifinstindustDeqv = filtroequivalente(mvedifinstindustbsf,mvedifinstindustdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EQUIPOS\n \t\t\t\t\t\tvar mvequiposbsf = categoriaproyectos(pmv,equipos,'_p',1);\n \t\t\t\t\t\tvar mvequiposdol = categoriaproyectos(pmv,equipos,'_p',2);\n \t\t\t\t\t\tvar mvequiposDeqv = filtroequivalente(mvequiposbsf,mvequiposdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OTRAS INVERSIONES\n \t\t\t\t\t\tvar mvotrasinvbsf = categoriaproyectos(pmv,otrasinv,'_p',1);\n \t\t\t\t\t\tvar mvotrasinvdol = categoriaproyectos(pmv,otrasinv,'_p',2);\n \t\t\t\t\t\tvar mvotrasinvDeqv = filtroequivalente(mvotrasinvbsf,mvotrasinvdol);\n \t\t\t\t\t\t/////////////////////////// \t\n\n \t\t\t\t\t\t///////ANTEPROYECTO VISION PROYECTOS////////////////////////////////////////////////////////////\n\n \t\t\t\t\t\t// CATEGORIA GEOFISICA\n \t\t\t\t\t\tvar antgeobsf = categoriaproyectos(pant,geofisica,'_p',1);\n \t\t\t\t\t\tvar antgeodol = categoriaproyectos(pant,geofisica,'_p',2);\n \t\t\t\t\t\tvar antgeoDeqv = filtroequivalente(antgeobsf,antgeodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE AVANZADA\n \t\t\t\t\t\tvar antperfavanzbsf = categoriaproyectos(pant,perfavanz,'_p',1);\n \t\t\t\t\t\tvar antperfavanzdol = categoriaproyectos(pant,perfavanz,'_p',2);\n \t\t\t\t\t\tvar antperfavanzDeqv = filtroequivalente(antperfavanzbsf,antperfavanzdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE DESARROLLO \n \t\t\t\t\t\tvar antperfdesarrobsf = categoriaproyectos(pant,perfdesarro,'_p',1);\n \t\t\t\t\t\tvar antperfdesarrodol = categoriaproyectos(pant,perfdesarro,'_p',2);\n \t\t\t\t\t\tvar antperfdesarroDeqv = filtroequivalente(antperfdesarrobsf,antperfdesarrodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION EXPLORATORIA\n \t\t\t\t\t\tvar antperfexplorabsf = categoriaproyectos(pant,perfexplora,'_p',1);\n \t\t\t\t\t\tvar antperfexploradol = categoriaproyectos(pant,perfexplora,'_p',2);\n \t\t\t\t\t\tvar antperfexploraDeqv = filtroequivalente(antperfexplorabsf,antperfexploradol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION ADICIONAL\n \t\t\t\t\t\tvar antrecupadicbsf = categoriaproyectos(pant,recupadic,'_p',1);\n \t\t\t\t\t\tvar antrecupadicdol = categoriaproyectos(pant,recupadic,'_p',2);\n \t\t\t\t\t\tvar antrecupadicDeqv = filtroequivalente(antrecupadicbsf,antrecupadicdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECOMPLETACION DE POZOS\n \t\t\t\t\t\tvar antrecompozosbsf = categoriaproyectos(pant,recompozos,'_p',1);\n \t\t\t\t\t\tvar antrecompozosdol = categoriaproyectos(pant,recompozos,'_p',2);\n \t\t\t\t\t\tvar antrecompozosDeqv = filtroequivalente(antrecompozosbsf,antrecompozosdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION SUPLEMENTARIA\n \t\t\t\t\t\tvar antrecupesuplebsf = categoriaproyectos(pant,recupesuple,'_p',1);\n \t\t\t\t\t\tvar antrecupesupledol = categoriaproyectos(pant,recupesuple,'_p',2);\n \t\t\t\t\t\tvar antrecupesupleDeqv = filtroequivalente(antrecupesuplebsf,antrecupesupledol);\n \t\t\t\t\t\t///////////////////////////\t\n \t\t\t\t\t\t// CATEGORIA INYECCCION ALTERNA DE VAPOR\n \t\t\t\t\t\tvar antinyectalternavaporbsf = categoriaproyectos(pant,inyectalternavapor,'_p',1);\n \t\t\t\t\t\tvar antinyectalternavapordol = categoriaproyectos(pant,inyectalternavapor,'_p',2);\n \t\t\t\t\t\tvar antinyectalternavaporDeqv = filtroequivalente(antinyectalternavaporbsf,antinyectalternavapordol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA LEVANTAMIENTO ARTIFICIAL\n \t\t\t\t\t\tvar antlevantamientoartifbsf = categoriaproyectos(pant,levantamientoartif,'_p',1);\n \t\t\t\t\t\tvar antlevantamientoartifdol = categoriaproyectos(pant,levantamientoartif,'_p',2);\n \t\t\t\t\t\tvar antlevantamientoartifDeqv = filtroequivalente(antlevantamientoartifbsf,antlevantamientoartifdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA CONSERVACION Y UTILIZACION DEL GAS\n \t\t\t\t\t\tvar antconutigasbsf = categoriaproyectos(pant,conutigas,'_p',1);\n \t\t\t\t\t\tvar antconutigasdol = categoriaproyectos(pant,conutigas,'_p',2);\n \t\t\t\t\t\tvar antconutigasDeqv = filtroequivalente(antconutigasbsf,antconutigasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PLANTA DE LIQUIDOS GAS \n \t\t\t\t\t\tvar antplantliqgasbsf = categoriaproyectos(pant,plantliqgas,'_p',1);\n \t\t\t\t\t\tvar antplantliqgasdol = categoriaproyectos(pant,plantliqgas,'_p',2);\n \t\t\t\t\t\tvar antplantliqgasDeqv = filtroequivalente(antplantliqgasbsf,antplantliqgasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA INTALACIONES DE PRODUCCION\n \t\t\t\t\t\tvar antinstproducbsf = categoriaproyectos(pant,instproduc,'_p',1);\n \t\t\t\t\t\tvar antinstproducdol = categoriaproyectos(pant,instproduc,'_p',2);\n \t\t\t\t\t\tvar antinstproducDeqv = filtroequivalente(antinstproducbsf,antinstproducdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OLEODUCTO Y TERMINALES DE EMBARQUE\n \t\t\t\t\t\tvar antoleoterminaembbsf = categoriaproyectos(pant,oleoterminaemb,'_p',1);\n \t\t\t\t\t\tvar antoleoterminaembdol = categoriaproyectos(pant,oleoterminaemb,'_p',2);\n \t\t\t\t\t\tvar antoleoterminaembDeqv = filtroequivalente(antoleoterminaembbsf,antoleoterminaembdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA ALMACENAMIENTO\n \t\t\t\t\t\tvar antalmacenamientobsf = categoriaproyectos(pant,almacenamiento,'_p',1);\n \t\t\t\t\t\tvar antalmacenamientodol = categoriaproyectos(pant,almacenamiento,'_p',2);\n \t\t\t\t\t\tvar antalmacenamientoDeqv = filtroequivalente(antalmacenamientobsf,antalmacenamientodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA DESARROLLO URBANO\n \t\t\t\t\t\tvar antdesarrollourbabsf = categoriaproyectos(pant,desarrollourba,'_p',1);\n \t\t\t\t\t\tvar antdesarrollourbadol = categoriaproyectos(pant,desarrollourba,'_p',2);\n \t\t\t\t\t\tvar antdesarrollourbaDeqv = filtroequivalente(antdesarrollourbabsf,antdesarrollourbadol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PROTECCION INTEGRAL\n \t\t\t\t\t\tvar antproteccionintegbsf = categoriaproyectos(pant,proteccioninteg,'_p',1);\n \t\t\t\t\t\tvar antproteccionintegdol = categoriaproyectos(pant,proteccioninteg,'_p',2);\n \t\t\t\t\t\tvar antproteccionintegDeqv = filtroequivalente(antproteccionintegbsf,antproteccionintegdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PREVENCION Y CONTROL DE PERDIDAS\n \t\t\t\t\t\tvar antpcpbsf = categoriaproyectos(pant,pcp,'_p',1);\n \t\t\t\t\t\tvar antpcpdol = categoriaproyectos(pant,pcp,'_p',2);\n \t\t\t\t\t\tvar antpcpDeqv = filtroequivalente(antpcpbsf,antpcpdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA TELECOMUNICACIONES\n \t\t\t\t\t\tvar anttelecomunicacionesbsf = categoriaproyectos(pant,telecomunicaciones,'_p',1);\n \t\t\t\t\t\tvar anttelecomunicacionesdol = categoriaproyectos(pant,telecomunicaciones,'_p',2);\n \t\t\t\t\t\tvar anttelecomunicacionesDeqv = filtroequivalente(anttelecomunicacionesbsf,anttelecomunicacionesdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA AUTOMATIZACION INDUSTRIAL\n \t\t\t\t\t\tvar antautomatizacionindbsf = categoriaproyectos(pant,automatizacionind,'_p',1);\n \t\t\t\t\t\tvar antautomatizacioninddol = categoriaproyectos(pant,automatizacionind,'_p',2);\n \t\t\t\t\t\tvar antautomatizacionindDeqv = filtroequivalente(antautomatizacionindbsf,antautomatizacioninddol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA COMPUTACION Y SISTEMA\n \t\t\t\t\t\tvar antcomputaysistebsf = categoriaproyectos(pant,computaysiste,'_p',1);\n \t\t\t\t\t\tvar antcomputaysistedol = categoriaproyectos(pant,computaysiste,'_p',2);\n \t\t\t\t\t\tvar antcomputaysisteDeqv = filtroequivalente(antcomputaysistebsf,antcomputaysistedol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EDIFICACIONES E INSTALACIONES INDUSTRIALES\n \t\t\t\t\t\tvar antedifinstindustbsf = categoriaproyectos(pant,edifinstindust,'_p',1);\n \t\t\t\t\t\tvar antedifinstindustdol = categoriaproyectos(pant,edifinstindust,'_p',2);\n \t\t\t\t\t\tvar antedifinstindustDeqv = filtroequivalente(antedifinstindustbsf,antedifinstindustdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EQUIPOS\n \t\t\t\t\t\tvar antequiposbsf = categoriaproyectos(pant,equipos,'_p',1);\n \t\t\t\t\t\tvar antequiposdol = categoriaproyectos(pant,equipos,'_p',2);\n \t\t\t\t\t\tvar antequiposDeqv = filtroequivalente(antequiposbsf,antequiposdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OTRAS INVERSIONES\n \t\t\t\t\t\tvar antotrasinvbsf = categoriaproyectos(pant,otrasinv,'_p',1);\n \t\t\t\t\t\tvar antotrasinvdol = categoriaproyectos(pant,otrasinv,'_p',2);\n \t\t\t\t\t\tvar antotrasinvDeqv = filtroequivalente(antotrasinvbsf,antotrasinvdol);\n \t\t\t\t\t\t/////////////////////////// \t\n\n \t\t\t\t\t\tvar ptotalcatebsf = sumarcateogoria(pgeobsf,pperfavanzbsf,pperfdesarrobsf,pperfexplorabsf,precupadicbsf,precompozosbsf,precupesuplebsf,pinyectalternavaporbsf,plevantamientoartifbsf,pconutigasbsf,pplantliqgasbsf,pinstproducbsf,poleoterminaembbsf,palmacenamientobsf,pdesarrollourbabsf,pproteccionintegbsf,ppcpbsf,ptelecomunicacionesbsf,pautomatizacionindbsf,pcomputaysistebsf,pedifinstindustbsf,pequiposbsf,potrasinvbsf);\n \t\t\t\t\t\tvar ptotalcatedol = sumarcateogoria(pgeodol,pperfavanzdol,pperfdesarrodol,pperfexploradol,precupadicdol,precompozosdol,precupesupledol,pinyectalternavapordol,plevantamientoartifdol,pconutigasdol,pplantliqgasdol,pinstproducdol,poleoterminaembdol,palmacenamientodol,pdesarrollourbadol,pproteccionintegdol,ppcpdol,ptelecomunicacionesdol,pautomatizacioninddol,pcomputaysistedol,pedifinstindustdol,pequiposdol,potrasinvdol);\n \t\t\t\t\t\tvar ptotalcateDeqv = sumarcateogoria(pgeoDeqv,pperfavanzDeqv,pperfdesarroDeqv,pperfexploraDeqv,precupadicDeqv,precompozosDeqv,precupesupleDeqv,pinyectalternavaporDeqv,plevantamientoartifDeqv,pconutigasDeqv,pplantliqgasDeqv,pinstproducDeqv,poleoterminaembDeqv,palmacenamientoDeqv,pdesarrollourbaDeqv,pproteccionintegDeqv,ppcpDeqv,ptelecomunicacionesDeqv,pautomatizacionindDeqv,pcomputaysisteDeqv,pedifinstindustDeqv,pequiposDeqv,potrasinvDeqv);\n \t\t\t\t\t\tvar rtotalcatebsf = sumarcateogoria(rgeobsf,rperfavanzbsf,rperfdesarrobsf,rperfexplorabsf,rrecupadicbsf,rrecompozosbsf,rrecupesuplebsf,rinyectalternavaporbsf,rlevantamientoartifbsf,rconutigasbsf,rplantliqgasbsf,rinstproducbsf,roleoterminaembbsf,ralmacenamientobsf,rdesarrollourbabsf,rproteccionintegbsf,rpcpbsf,rtelecomunicacionesbsf,rautomatizacionindbsf,rcomputaysistebsf,redifinstindustbsf,requiposbsf,rotrasinvbsf);\n \t\t\t\t\t\tvar rtotalcatedol = sumarcateogoria(rgeodol,rperfavanzdol,rperfdesarrodol,rperfexploradol,rrecupadicdol,rrecompozosdol,rrecupesupledol,rinyectalternavapordol,rlevantamientoartifdol,rconutigasdol,rplantliqgasdol,rinstproducdol,roleoterminaembdol,ralmacenamientodol,rdesarrollourbadol,rproteccionintegdol,rpcpdol,rtelecomunicacionesdol,rautomatizacioninddol,rcomputaysistedol,redifinstindustdol,requiposdol,rotrasinvdol);\n \t\t\t\t\t\tvar rtotalcateDeqv = sumarcateogoria(rgeoDeqv,rperfavanzDeqv,rperfdesarroDeqv,rperfexploraDeqv,rrecupadicDeqv,rrecompozosDeqv,rrecupesupleDeqv,rinyectalternavaporDeqv,rlevantamientoartifDeqv,rconutigasDeqv,rplantliqgasDeqv,rinstproducDeqv,roleoterminaembDeqv,ralmacenamientoDeqv,rdesarrollourbaDeqv,rproteccionintegDeqv,rpcpDeqv,rtelecomunicacionesDeqv,rautomatizacionindDeqv,rcomputaysisteDeqv,redifinstindustDeqv,requiposDeqv,rotrasinvDeqv);\n \t\t\t\t\t\tvar mvtotalcatebsf = sumarcateogoria(mvgeobsf,mvperfavanzbsf,mvperfdesarrobsf,mvperfexplorabsf,mvrecupadicbsf,mvrecompozosbsf,mvrecupesuplebsf,mvinyectalternavaporbsf,mvlevantamientoartifbsf,mvconutigasbsf,mvplantliqgasbsf,mvinstproducbsf,mvoleoterminaembbsf,mvalmacenamientobsf,mvdesarrollourbabsf,mvproteccionintegbsf,mvpcpbsf,mvtelecomunicacionesbsf,mvautomatizacionindbsf,mvcomputaysistebsf,mvedifinstindustbsf,mvequiposbsf,mvotrasinvbsf);\n \t\t\t\t\t\tvar mvtotalcatedol = sumarcateogoria(mvgeodol,mvperfavanzdol,mvperfdesarrodol,mvperfexploradol,mvrecupadicdol,mvrecompozosdol,mvrecupesupledol,mvinyectalternavapordol,mvlevantamientoartifdol,mvconutigasdol,mvplantliqgasdol,mvinstproducdol,mvoleoterminaembdol,mvalmacenamientodol,mvdesarrollourbadol,mvproteccionintegdol,mvpcpdol,mvtelecomunicacionesdol,mvautomatizacioninddol,mvcomputaysistedol,mvedifinstindustdol,mvequiposdol,mvotrasinvdol);\n \t\t\t\t\t\tvar mvtotalcateDeqv = sumarcateogoria(mvgeoDeqv,mvperfavanzDeqv,mvperfdesarroDeqv,mvperfexploraDeqv,mvrecupadicDeqv,mvrecompozosDeqv,mvrecupesupleDeqv,mvinyectalternavaporDeqv,mvlevantamientoartifDeqv,mvconutigasDeqv,mvplantliqgasDeqv,mvinstproducDeqv,mvoleoterminaembDeqv,mvalmacenamientoDeqv,mvdesarrollourbaDeqv,mvproteccionintegDeqv,mvpcpDeqv,mvtelecomunicacionesDeqv,mvautomatizacionindDeqv,mvcomputaysisteDeqv,mvedifinstindustDeqv,mvequiposDeqv,mvotrasinvDeqv);\n \t\t\t\t\t\tvar anttotalcatebsf = sumarcateogoria(antgeobsf,antperfavanzbsf,antperfdesarrobsf,antperfexplorabsf,antrecupadicbsf,antrecompozosbsf,antrecupesuplebsf,antinyectalternavaporbsf,antlevantamientoartifbsf,antconutigasbsf,antplantliqgasbsf,antinstproducbsf,antoleoterminaembbsf,antalmacenamientobsf,antdesarrollourbabsf,antproteccionintegbsf,antpcpbsf,anttelecomunicacionesbsf,antautomatizacionindbsf,antcomputaysistebsf,antedifinstindustbsf,antequiposbsf,antotrasinvbsf);\n \t\t\t\t\t\tvar anttotalcatedol = sumarcateogoria(antgeodol,antperfavanzdol,antperfdesarrodol,antperfexploradol,antrecupadicdol,antrecompozosdol,antrecupesupledol,antinyectalternavapordol,antlevantamientoartifdol,antconutigasdol,antplantliqgasdol,antinstproducdol,antoleoterminaembdol,antalmacenamientodol,antdesarrollourbadol,antproteccionintegdol,antpcpdol,anttelecomunicacionesdol,antautomatizacioninddol,antcomputaysistedol,antedifinstindustdol,antequiposdol,antotrasinvdol);\n \t\t\t\t\t\tvar anttotalcateDeqv = sumarcateogoria(antgeoDeqv,antperfavanzDeqv,antperfdesarroDeqv,antperfexploraDeqv,antrecupadicDeqv,antrecompozosDeqv,antrecupesupleDeqv,antinyectalternavaporDeqv,antlevantamientoartifDeqv,antconutigasDeqv,antplantliqgasDeqv,antinstproducDeqv,antoleoterminaembDeqv,antalmacenamientoDeqv,antdesarrollourbaDeqv,antproteccionintegDeqv,antpcpDeqv,anttelecomunicacionesDeqv,antautomatizacionindDeqv,antcomputaysisteDeqv,antedifinstindustDeqv,antequiposDeqv,antotrasinvDeqv);\n\n\n \t\t\t\t\t\t for (var i=0; i < 12; i++) {\n \t\t\t\t\t\t \t\t\n \t\t\t\t\t\t \tif( laborybbdivoDeqvr[i] != 0 || mdivoDeqvr[i] != 0 || scdivoDeqvr[i] != 0 || odivoDeqvr[i]!= 0 ){\n \t\t\t\t\t\t \t\t//alert(aux);\n \t\t\t\t\t\t \t\taux++;\t\n \t\t\t\t\t\t \t}\n\n \t\t\t\t\t\t }// fin del for comprobar cual es la ejecución del real de los meses\n\n\n \t\t\t\t\t\t /// BLOQUE VISUAL DE LA TABLA\n \t\t\t\t\t\t \tvar informacion = motrarcabecera('red-header','leter',v3,meses[aux],'Parámetros Operacionales y Financieros');\n \t\t\t\t\t\t \tinformacion += descripciones('','Presupuesto de Inversiones',aux,ptotalcateDeqv,ptotalcatebsf,ptotalcatedol,ptotalcateDeqv,rtotalcatebsf,rtotalcatedol,rtotalcateDeqv,mvtotalcatebsf,mvtotalcatedol,mvtotalcateDeqv,anttotalcatebsf,anttotalcatedol,anttotalcateDeqv );\n \t\t\t\t\t\t \tinformacion += descripciones('','Presupuesto de Operaciones',aux,totaldivoDeqv,totaldivobsf,totaldivodol,totaldivoDeqv,totaldivobsfr,totaldivodolr,totaldivoDeqvr,totaldivobsfmv,totaldivodolmv,totaldivoDeqvmv,totaldivobsfant,totaldivodolant,totaldivobsfant);\n\t \t\t\t\t\t\t\n \t\t\t\t\t\t \tinformacion += '<tr>';\n\t \t\t\t\t\t\tfor (var i=0; i < 18 ; i++){\n\t \t\t\t\t\t\tinformacion += '<td>\t</td>';\n\t \t\t\t\t\t\t}\n\t \t\t\t\t\t\tinformacion += '</tr>';\n \t\t\t\t\t\t \tinformacion += motrarcabecera('red-header','leter',v3,meses[aux],'ELEMENTO DE COSTO');\n \t\t\t\t\t\t \tinformacion += descripciones('','Labor y Beneficios',aux,laborybbdivoDeqv,laborybbdivobsf,laborybbdivodol,laborybbdivoDeqv,laborybbdivobsfr,laborybbdivodolr,laborybbdivoDeqvr,laborybbdivobsfmv,laborybbdivodolmv,laborybbdivoDeqvmv,laborybbdivobsfant,laborybbdivodolant,laborybbdivoDeqvant );\n\t \t\t\t\t\t\tinformacion += descripciones('','Materiales',aux,mdivoDeqv,mdivobsf,mdivodol,mdivoDeqv,mdivobsfr,mdivodolr,mdivoDeqvr,mdivobsfmv,mdivodolmv,mdivoDeqvmv,mdivobsfant,mdivodolant,mdivoDeqvant );\n\t \t\t\t\t\t\tinformacion += descripciones('','Servicios y Contratos',aux,scdivoDeqv,scdivobsf,scdivodol,scdivoDeqv,scdivobsfr,scdivodolr,scdivoDeqvr,scdivobsfmv,scdivodolmv,scdivoDeqvmv,scdivobsfmv,scdivodolant,scdivoDeqvant );\n\t \t\t\t\t\t\tinformacion += descripciones('','Otros Costos y Gastos',aux,odivoDeqv,odivobsf,odivodol,odivoDeqv,odivobsfr,odivodolr,odivoDeqvr,odivobsfmv,odivodolmv,odivoDeqvmv,odivobsfant,odivodolant,odivoDeqvant );\n\t \t\t\t\t\t\tinformacion += descripciones('red-header','Total',aux,totaldivoDeqv,totaldivobsf,totaldivodol,totaldivoDeqv,totaldivobsfr,totaldivodolr,totaldivoDeqvr,totaldivobsfmv,totaldivodolmv,totaldivoDeqvmv,totaldivobsfant,totaldivodolant,totaldivobsfant);\n\t \t\t\t\t\t\tinformacion += '<tr>';\n\t \t\t\t\t\t\tfor (var i=0; i < 18 ; i++){\n\t \t\t\t\t\t\tinformacion += '<td>\t</td>';\n\t \t\t\t\t\t\t}\n\t \t\t\t\t\t\tinformacion += '</tr>';\n\t \t\t\t\t\t\tinformacion += motrarcabecera('red-header','leter',v3,meses[aux],'CATEGORIA ');\n\t \t\t\t\t\t\tinformacion += descripciones('','Geofisica',aux,pgeoDeqv,pgeobsf,pgeodol,pgeoDeqv,rgeobsf,rgeodol,rgeoDeqv,mvgeobsf,mvgeodol,mvgeoDeqv,antgeobsf,antgeodol,antgeoDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Perforación de Avanzada',aux,pperfavanzDeqv,pperfavanzbsf,pperfavanzdol,pperfavanzDeqv,rperfavanzbsf,rperfavanzdol,rperfavanzDeqv,mvperfavanzbsf,mvperfavanzdol,mvperfavanzDeqv,antperfavanzbsf,antperfavanzdol,antperfavanzDeqv );\n\t \t\t\t\t\t\tinformacion += descripciones('','Perforación de Desarrollo',aux,pperfdesarroDeqv,pperfdesarrobsf,pperfdesarrodol,pperfdesarroDeqv,rperfdesarrobsf,rperfdesarrodol,rperfdesarroDeqv,mvperfdesarrobsf,mvperfdesarrodol,mvperfdesarroDeqv,antperfdesarrobsf,antperfdesarrodol,antperfdesarroDeqv);\n\t\t\t\t\t\t\tinformacion += descripciones('','Perforación Exploratoria',aux,pperfexploraDeqv,pperfexplorabsf,pperfexploradol,pperfexploraDeqv,rperfexplorabsf,rperfexploradol,rperfexploraDeqv,mvperfexplorabsf,mvperfexploradol,mvperfexploraDeqv,antperfexplorabsf,antperfexploradol,antperfexploraDeqv);\n\t\t\t\t\t\t\tinformacion += descripciones('','Recuperación Adicional',aux,precupadicDeqv,precupadicbsf,precupadicdol,precupadicDeqv,rrecupadicbsf,rrecupadicdol,rrecupadicDeqv,mvrecupadicbsf,mvrecupadicdol,mvrecupadicDeqv,antrecupadicbsf,antrecupadicdol,antrecupadicDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Recompletación De Pozos',aux,precompozosDeqv,precompozosbsf,precompozosdol,precompozosDeqv,rrecompozosbsf,rrecompozosdol,rrecompozosDeqv,mvrecompozosbsf,mvrecompozosdol,mvrecompozosDeqv,antrecompozosbsf,antrecompozosdol,antrecompozosDeqv);\n\t\t\t\t\t\t\tinformacion += descripciones('','Recuperación Suplementaria',aux,precupesupleDeqv,precupesuplebsf,precupesupledol,precupesupleDeqv,rrecupesuplebsf,rrecupesupledol,rrecupesupleDeqv,mvrecupesuplebsf,mvrecupesupledol,mvrecupesupleDeqv,antrecupesuplebsf,antrecupesupledol,antrecupesupleDeqv);\n\t\t\t\t\t\t\tinformacion += descripciones('','Inyección Alterna De Vapor',aux,pinyectalternavaporDeqv,pinyectalternavaporbsf,pinyectalternavapordol,pinyectalternavaporDeqv,rinyectalternavaporbsf,rinyectalternavapordol,rinyectalternavaporDeqv,mvinyectalternavaporbsf,mvinyectalternavapordol,mvinyectalternavaporDeqv,antinyectalternavaporbsf,antinyectalternavapordol,antinyectalternavaporDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Levantamiento Artificial',aux,plevantamientoartifDeqv,plevantamientoartifbsf,plevantamientoartifdol,plevantamientoartifDeqv,rlevantamientoartifbsf,rlevantamientoartifdol,rlevantamientoartifDeqv,mvlevantamientoartifbsf,mvlevantamientoartifdol,mvlevantamientoartifDeqv,antlevantamientoartifbsf,antlevantamientoartifdol,antlevantamientoartifDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Conservación y Utilización del Gas',aux,pconutigasDeqv,pconutigasbsf,pconutigasdol,pconutigasDeqv,rconutigasbsf,rconutigasdol,rconutigasDeqv,mvconutigasbsf,mvconutigasdol,mvconutigasDeqv,antconutigasbsf,antconutigasdol,antconutigasDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Planta de Líquidos y Gas',aux,pplantliqgasDeqv,pplantliqgasbsf,pplantliqgasdol,pplantliqgasDeqv,rplantliqgasbsf,rplantliqgasdol,rplantliqgasDeqv,mvplantliqgasbsf,mvplantliqgasdol,mvplantliqgasDeqv,antplantliqgasbsf,antplantliqgasdol,antplantliqgasDeqv);\n\t\t\t\t\t\t\tinformacion += descripciones('','Instalaciones de Producción',aux,pinstproducDeqv,pinstproducbsf,pinstproducdol,pinstproducDeqv,rinstproducbsf,rinstproducdol,rinstproducDeqv,mvinstproducbsf,mvinstproducdol,mvinstproducDeqv,antinstproducbsf,antinstproducdol,antinstproducDeqv);\n\t\t\t\t\t\t\tinformacion += descripciones('','Oleoductos y Terminales de Embarque',aux,poleoterminaembDeqv,poleoterminaembbsf,poleoterminaembdol,poleoterminaembDeqv,roleoterminaembbsf,roleoterminaembdol,roleoterminaembDeqv,mvoleoterminaembbsf,mvoleoterminaembdol,mvoleoterminaembDeqv,antoleoterminaembbsf,antoleoterminaembdol,antoleoterminaembDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Almacenamiento',aux,palmacenamientoDeqv,palmacenamientobsf,palmacenamientodol,palmacenamientoDeqv,ralmacenamientobsf,ralmacenamientodol,ralmacenamientoDeqv,mvalmacenamientobsf,mvalmacenamientodol,mvalmacenamientoDeqv,antalmacenamientobsf,antalmacenamientodol,antalmacenamientoDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Desarrollo Urbano',aux,pdesarrollourbaDeqv,pdesarrollourbabsf,pdesarrollourbadol,pdesarrollourbaDeqv,rdesarrollourbabsf,rdesarrollourbadol,rdesarrollourbaDeqv,mvdesarrollourbabsf,mvdesarrollourbadol,mvdesarrollourbaDeqv,antdesarrollourbabsf,antdesarrollourbadol,antdesarrollourbaDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Protección Integral',aux,pproteccionintegDeqv,pproteccionintegbsf,pproteccionintegdol,pproteccionintegDeqv,rproteccionintegbsf,rproteccionintegdol,rproteccionintegDeqv,mvproteccionintegbsf,mvproteccionintegdol,mvproteccionintegDeqv,antproteccionintegbsf,antproteccionintegdol,antproteccionintegDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Prevención y Control de Pérdidas',aux,ppcpDeqv,ppcpbsf,ppcpdol,ppcpDeqv,rpcpbsf,rpcpdol,rpcpDeqv,mvpcpbsf,mvpcpdol,mvpcpDeqv,antpcpbsf,antpcpdol,antpcpDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Telecomunicaciones',aux,ptelecomunicacionesDeqv,ptelecomunicacionesbsf,ptelecomunicacionesdol,ptelecomunicacionesDeqv,rtelecomunicacionesbsf,rtelecomunicacionesdol,rtelecomunicacionesDeqv,mvtelecomunicacionesbsf,mvtelecomunicacionesdol,mvtelecomunicacionesDeqv,anttelecomunicacionesbsf,anttelecomunicacionesdol,anttelecomunicacionesDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Automatización Industrial',aux,pautomatizacionindDeqv,pautomatizacionindbsf,pautomatizacioninddol,pautomatizacionindDeqv,rautomatizacionindbsf,rautomatizacioninddol,rautomatizacionindDeqv,mvautomatizacionindbsf,mvautomatizacioninddol,mvautomatizacionindDeqv,antautomatizacionindbsf,antautomatizacioninddol,antautomatizacionindDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Computación y Sistemas',aux,pcomputaysisteDeqv,pcomputaysistebsf,pcomputaysistedol,pcomputaysisteDeqv,rcomputaysistebsf,rcomputaysistedol,rcomputaysisteDeqv,mvcomputaysistebsf,mvcomputaysistedol,mvcomputaysisteDeqv,antcomputaysistebsf,antcomputaysistedol,antcomputaysisteDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Edificaciones e Instalaciones Industriales',aux,pedifinstindustDeqv,pedifinstindustbsf,pedifinstindustdol,pedifinstindustDeqv,redifinstindustbsf,redifinstindustdol,redifinstindustDeqv,mvedifinstindustbsf,mvedifinstindustdol,mvedifinstindustDeqv,antedifinstindustbsf,antedifinstindustdol,antedifinstindustDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Equipos',aux,pequiposDeqv,pequiposbsf,pequiposdol,pequiposDeqv,requiposbsf,requiposdol,requiposDeqv,mvequiposbsf,mvequiposdol,mvequiposDeqv,antequiposbsf,antequiposdol,antequiposDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Otras Inversiones',aux,potrasinvDeqv,potrasinvbsf,potrasinvdol,potrasinvDeqv,rotrasinvbsf,rotrasinvdol,rotrasinvDeqv,mvotrasinvbsf,mvotrasinvdol,mvotrasinvDeqv,antotrasinvbsf,antotrasinvdol,antotrasinvDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('red-header','Total',aux,ptotalcateDeqv,ptotalcatebsf,ptotalcatedol,ptotalcateDeqv,rtotalcatebsf,rtotalcatedol,rtotalcateDeqv,mvtotalcatebsf,mvtotalcatedol,mvtotalcateDeqv,anttotalcatebsf,anttotalcatedol,anttotalcateDeqv );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\n\n\t \t\t\t\t\t\treturn informacion;\n\n }", "getResultatCodificat(){ // SI EL MÈTODE NO PASSA ALGUN VALOR, SE LI POSSA this. MÉS EL ATRIBUT CORRESPONENT.\n this.eliminarEspaisBlanc();\n this.senseAccent();\n for (var i = 0; i < this._entrada.length; i++){\n\n // IGUALEM LA LLARGADA DE LA CLAU A LA DE L'ENTRADA\n var y = 0;\n var max_lenght = this._entrada.length;\n while (this._entrada.length != this._clau.length){\n\n this._clau = this._clau + this._clau[y];\n\n if(y >= max_lenght){\n\n y = 0;\n }\n else{\n\n y++;\n }\n }\n\n // BUSQUEM ON ESTAN SITUATS TANT LA LLETRA DE L'ENTRADA COM DE LA CLAU\n var posicio_lletra_entrada = this._alfabet.indexOf(this._entrada[i]);\n var posicio_lletra_clau = this._alfabet.indexOf(this._clau[i]);\n\n // SUMEM LES DUES POSICIONS\n var suma_posicions = posicio_lletra_entrada + posicio_lletra_clau;\n\n // ANEM RESTANT MENTRE QUE EL MOD SIGUI MÉS GRAN QUE EL LENGTH DEL ABECEDARI\n while (suma_posicions >= this._alfabet.length){\n\n suma_posicions = suma_posicions - this._alfabet.length;\n }\n \n // ARA BUSQUEM LA LLETRA AMB LA QUAL SUBSTITUIREM L'ENTRADA\n this._resultat = this._resultat + this._alfabet[suma_posicions];\n }\n\n // RETORNEM EL RESULTAT\n return (document.form.sortida.value = this._resultat);\n }", "function calculatePoints(){\n professions.forEach((profession) =>{\n let sum = 0;\n for(let i = 0; i< profession.traits.length; i++){\n sum += profession.traits[i].points;\n }\n profession.score += sum;\n console.log(`Points for profession ${profession.profession}: ${profession.score}`);\n });\n professions = professions.sort(compare);\n testContainer.classList.add('hide');\n resultsContainer.classList.remove('hide');\n headingForTest.innerText = 'Ваші результати';\n // console.log(professions);\n drawCircles();\n showResults();\n}", "function Filtros(filtros){\n\n if(filtros==\"Normal\"){\n var ctx = canvasF.getContext('2d');\n ctx.drawImage(imgEspejo,0,0,canvasW, canvasH);\n \n }\n \n else if(filtros==\"Blanco y Negro\"){\n var ctx = canvasOrg.getContext('2d');\n let data= ctx.getImageData(0,0,canvasW,canvasH);\n for(let i =0; i<data.data.length; i++){\n let red= data.data[i*4];\n let blue= data.data[i*4+1];\n let green= data.data[i*4+2];\n let valor=(red+blue+green)/3\n\n data.data[i*4]=valor;\n data.data[i*4+1]=valor;\n data.data[i*4+2]=valor;\n }\n contextF.putImageData(data,0,0);\n \n }\n else if(filtros==\"Negativo\"){\n var ctx = canvasOrg.getContext('2d');\n let data= ctx.getImageData(0,0,canvasW,canvasH);\n for (var i = 0; i < data.data.length; i += 4) {\n data.data[i] = 255 - data.data[i]; // rojo\n data.data[i + 1] = 255 - data.data[i + 1]; // verde\n data.data[i + 2] = 255 - data.data[i + 2]; // azul\n }\n contextF.putImageData(data,0,0);\n \n }\n\n else if(filtros==\"Espejo\"){\n var ctx = canvasF.getContext('2d');\n ctx.translate(canvasW,0);\n ctx.scale(-1,1);\n ctx.drawImage(imgEspejo,0,0,canvasW, canvasH);\n normalway();\n }\n else if(filtros==\"Sepia\"){\n var ctx = canvasOrg.getContext('2d');\n let data= ctx.getImageData(0,0,canvasW,canvasH);\n \n for (var i = 0; i < data.data.length; i += 4) {\n var r, g, b;\n r = data.data[i];\n g = data.data[i + 1];\n b = data.data[i + 2];\n\n data.data[i] = 0.3 * (r + g + b);\n data.data[i + 1] = 0.25 * (r + g + b);\n data.data[i + 2] = 0.20 * (r + g + b);\n }\n contextF.putImageData(data,0,0);\n\n }\n\n else if(filtros==\"Rojo\"){\n //este es rojo con detalles negros\n //para hacer rojo con detalles \"normales\"/blancos se cambia el rojo quitando el 255 y agregando el +\n var ctx = canvasOrg.getContext('2d');\n let data= ctx.getImageData(0,0,canvasW,canvasH);\n for (var i = 0; i < data.data.length; i += 4) {\n data.data[i] = + data.data[i]; // rojo\n data.data[i + 1] = - data.data[i]; // verde\n data.data[i + 2] = - data.data[i]; // azul\n\n }\n contextF.putImageData(data,0,0);\n\n }\n else if(filtros==\"Rojo/Azul\"){\n var ctx = canvasOrg.getContext('2d');\n let data= ctx.getImageData(0,0,canvasW,canvasH);\n for (var i = 0; i < data.data.length; i += 4) {\n data.data[i] =255 - data.data[i]; // rojo\n data.data[i + 1] = - data.data[i]; // verde\n data.data[i + 2] = 255- data.data[i]; // azul\n\n }\n contextF.putImageData(data,0,0);\n\n }\n\n \n else if(filtros==\"Rojo Menta\"){\n var ctx = canvasOrg.getContext('2d');\n let data= ctx.getImageData(0,0,canvasW,canvasH);\n for (var i = 0; i < data.data.length; i += 4) {\n data.data[i] = 255- data.data[i]; // rojo\n data.data[i + 1] = 255- data.data[i]; // verde\n data.data[i + 2] = 255 - data.data[i]; // azul\n \n }\n contextF.putImageData(data,0,0);\n\n }\n else if(filtros==\"Rayos X\"){\n var ctx = canvasOrg.getContext('2d');\n let data= ctx.getImageData(0,0,canvasW,canvasH);\n for (var i = 0; i < data.data.length; i += 4) {\n data.data[i] =255 - data.data[i]; // rojo\n data.data[i + 1] = + data.data[i]; // verde\n data.data[i + 2] = + data.data[i]; // azul\n \n }\n contextF.putImageData(data,0,0);\n\n }\n }", "function Descuento40(){\n //recuperamos el valor descuento40 anterior\n var descuento40=document.getElementById(\"sal_pyt40\").value;\n //recuperamos el sueldo neto del input\n var SueldoNeto=document.getElementById('sueldoNeto').value;\n //si anteriormente ya tenia un valor, debe reestablecer\n if(descuento40 > 0)\n {\n var suma=parseFloat(SueldoNeto) + parseFloat(descuento40);\n document.getElementById(\"sueldoNeto\").value=suma;\n }\n //sueldo bruto inicial\n var SaldoBrutoIni=document.getElementById('sueldoBruto').value;\n //calcula el jpornal diario\n var jornal=SaldoBrutoIni/30;\n //obtiene dias de permisos/llegada tardia\n var dias= document.getElementById('descuento40').value;\n //descuento por dia de 40 %\n var descuento40=((jornal*40)/100)\n //actualizar valor de sal_pyt\n document.getElementById(\"sal_pyt40\").value=(descuento40*dias);\n //Actualiza el neto a cobrar\n var SaldoNeto= document.getElementById('sueldoNeto').value;\n document.getElementById(\"sueldoNeto\").value=SaldoNeto-(descuento40*dias);\n \n \n //guardamos el valor de salario neto(esto se actualizara con cada descuento)\n var sueldoneto=document.getElementById('sueldoNeto').value;\n document.getElementById(\"sal_neto\").value=sueldoneto;\n }", "function Descuento50(){\n //recuperamos el valor descuento50 anterior\n var descuento50=document.getElementById(\"sal_pyt50\").value;\n //recuperamos el sueldo neto del input\n var SueldoNeto=document.getElementById('sueldoNeto').value;\n //si anteriormente ya tenia un valor, debe reestablecer\n if(descuento50 > 0)\n {\n var suma=parseFloat(SueldoNeto) + parseFloat(descuento50);\n document.getElementById(\"sueldoNeto\").value=suma;\n }\n //sueldo bruto inicial\n var SaldoBrutoIni=document.getElementById('sueldoBruto').value;\n //calcula el jpornal diario\n var jornal=SaldoBrutoIni/30;\n //obtiene dias de permisos/llegada tardia\n var dias= document.getElementById('descuento50').value;\n //descuento por dia de 50 %\n var descuento50=((jornal*50)/100);\n \n //actualizar valor de sal_pyt\n document.getElementById(\"sal_pyt50\").value=(descuento50*dias);\n //Actualiza el neto a cobrar\n var SaldoNeto= document.getElementById('sueldoNeto').value;\n document.getElementById(\"sueldoNeto\").value=SaldoNeto-(descuento50*dias);\n \n \n \n //guardamos el valor de salario neto(esto se actualizara con cada descuento)\n var sueldoneto=document.getElementById('sueldoNeto').value;\n document.getElementById(\"sal_neto\").value=sueldoneto;\n }", "function calculateTotal_usa_cm() {\n //Aqui obtenemos el precio total llamando a nuestra funcion\n\t//Each function returns a number so by calling them we add the values they return together\n\t'use strict';\n var cakePrice = traerDensidadSeleccionada() * traerDensidadSeleccionada2() / getIndiceDeLogro() / 1000000, densidadimplantada = traerDensidadSeleccionada() / getIndiceDeLogro(), densidadobjetivo = traerDensidadSeleccionada();\n \n //Aqui configuramos los decimales que queremos que aparezcan en el resultado\n\tvar resultadodosdecimales1 = cakePrice.toFixed(2), resultadodosdecimales2 = densidadimplantada.toFixed(2), resultadodosdecimales3 = densidadobjetivo.toFixed(2);\n\t\n\t//Aqui exponemos el calculo\n\tvar divobj = document.getElementById('totalPrice');\n\tdivobj.style.display = 'block';\n\tdivobj.innerHTML = 'You will need to plant ' + resultadodosdecimales2 + ' seeds per hectare wich represents ' + resultadodosdecimales1 + ' seeds in a lineal meter for achieving your population target of ' + resultadodosdecimales3;\n}", "function nota_promedio(){\n\t\tvar sum = 0;\n\t\tvar pro = 0;\n\t\tfor(num = 0; num < alumnos.length; num ++){\n\t\t\tsum += (alumnos[num].nota);\n\t\t}\n\t\tpro = sum / 10;\n\t\tdocument.getElementById(\"promedio\").innerHTML = \"El Promedio es: <b>\" + pro.toFixed(2) + \"</b>\";\n\t}", "function sumarTotalPrecio(){\n\n\t\t\tvar precioItem = $('.nuevoPrecioProducto');\n\n\t\t\tvar arraySumarPrecio = [];\n\n\t\t\tfor (var i = 0; i < precioItem.length; i++){\n\n\t\t\t\tarraySumarPrecio.push(Number($(precioItem[i]).val()));\n\t\t\t\t\n\n\t\t\t}\n\n\t\t\tfunction sumarArrayPrecio(total, numero){\n\n\t\t\t\treturn total+numero;\n\n\n\t\t\t}\n\n\t\t\tvar sumaTotalPrecio = arraySumarPrecio.reduce(sumarArrayPrecio)\n\t\t\t\n\t\t\t$('#nuevoTotalVenta').val(sumaTotalPrecio);\n\t\t\t$('#totalVenta').val(sumaTotalPrecio);\n\t\t\t$('#nuevoTotalVenta').attr('total', sumaTotalPrecio);\n\t\t}", "function recargaFila(){\n\tsubPrecio = 0;\n\t$('#tabla tbody').find('tr').each(function(index, element){\n\t\tsubPrecio = parseFloat(subPrecio) + parseFloat($(this).find('td').eq(5).find('input').val());\n\t});\n\t$('#tabla tfoot').find('th').eq(1).find('input').val(subPrecio.toFixed(2));\n\n\tdes = $('#tabla tfoot').find('tr').eq(1).find('th').eq(1).find('input').val();\n\tif(des === '') des = 0;\n\n\tbon = $('#tabla tfoot').find('tr').eq(2).find('th').eq(1).find('input').val();\n\tif(bon === '') bon = 0;\n\n\ttotal = parseFloat(subPrecio)-parseFloat(des)-parseFloat(bon);\n\t$('#tabla tfoot').find('tr').eq(3).find('th').eq(1).find('input').val(total.toFixed(2));\n\n}", "function todasConversoes(inputIngrediente, valorML) {//botar console log lá em cima\n //[copoAmericano, xicara, copoRequeijao, colherSopa, colherSobremesa, colherCha, colherCafe]\n //let valorML =[200, 150, 250, 15, 10, 5, 2.5]//liquido. alterar conforme ingrediente escolhido. A variável será preenchida fora da função e será recebida como parâmetro\n let copoAmericanoML = valorML[0]//200\n let xicaraML = valorML[1]//150\n let copoRequeijaoML = valorML[2]//250\n let colherSopaML = valorML[3]//15\n let colherSobremesaML = valorML[4]//10\n let colherChaML = valorML[5]//5\n let colherCafeML = valorML[6]//2.5\n\n //copo americano\n let copoAmericano = inputIngrediente/copoAmericanoML\n let copoAmericanoInt = Math.trunc(copoAmericano)\n let copoAmericanoFloat = Number((copoAmericano-copoAmericanoInt).toFixed(2))\n let mlRestanteCA = copoAmericanoFloat*copoAmericanoML\n\n //xicara\n let xicara = inputIngrediente/xicaraML\n let xicaraInt = Math.trunc(xicara) //numero inteiro de xicaras\n let xicaraFloat = Number((xicara-xicaraInt).toFixed(2)) //somente os decimais de xicaras\n let mlRestanteX = xicaraFloat*xicaraML\n\n //copo requeijão\n let copoRequeijao = inputIngrediente/copoRequeijaoML\n let copoRequeijaoInt = Math.trunc(copoRequeijao)\n let copoRequeijaoFloat = Number((copoRequeijao-copoRequeijaoInt).toFixed(2))\n let mlRestanteCR = copoRequeijaoFloat*copoRequeijaoML\n\n //colher sopa\n let colherSopa = inputIngrediente/colherSopaML\n let colherSopaInt = Math.trunc(colherSopa)\n let colherSopaFloat = Number((colherSopa-colherSopaInt).toFixed(2))\n let mlRestanteCSp = colherSopaFloat*colherSopaML\n\n //colher sobremesa\n let colherSobremesa = inputIngrediente/colherSobremesaML\n let colherSobremesaInt = Math.trunc(colherSobremesa)\n let colherSobremesaFloat = Number((colherSobremesa-colherSobremesaInt).toFixed(2))\n let mlRestanteCSb = colherSobremesaFloat*colherSobremesaML\n\n //colher chá\n let colherCha = inputIngrediente/colherChaML\n let colherChaInt = Math.trunc(colherCha)\n let colherChaFloat = Number((colherCha-colherChaInt).toFixed(2))\n let mlRestanteCCh = colherChaFloat*colherChaML\n\n //colher café\n let colherCafe = inputIngrediente/colherCafeML\n let colherCafeInt = Math.trunc(colherCafe)\n let colherCafeFloat = Number((colherCafe-colherCafeInt).toFixed(2))\n let mlRestanteCCf = colherCafeFloat*colherCafeML\n\n return [copoAmericanoInt, mlRestanteCA, xicaraInt, mlRestanteX, copoRequeijaoInt, mlRestanteCR, colherSopaInt, mlRestanteCSp, colherSobremesaInt, mlRestanteCSb, colherChaInt, mlRestanteCCh, colherCafeInt, mlRestanteCCf] \n}", "function calcoloRisultato(nPc, nUt, sclt) {\n // Inizializzo una variabile che contenga la somma dei due numeri giocati\n var somma = nPc + nUt;\n console.log(\"La somma dei valori é: \" + somma);\n // Calcolo incrociato tra risultato numerico e la scelta del giocatore\n if(somma % 2 != 0 && sclt == pari ){\n console.log(\"Hai perso...\")\n }\n else{\n console.log(\"Hai vinto\")\n }\n\n }", "function PerkalianV2 (a, b) {\n //local variabel\n let hasil = a * b\n\n //give return value, spy value dr hasil bisa dipake diluar\n return hasil\n}", "function indovina(){\n\n gino = get(posIniX, posIniY, beholder.width, beholder.height);\n classifier.classify(gino, gotResult);\n mappa = aCheAssimiglia(gino, daMappare);\n\n}" ]
[ "0.6234949", "0.6215388", "0.6214699", "0.62072855", "0.6154536", "0.6128888", "0.60022205", "0.5992152", "0.5958583", "0.5939029", "0.59319997", "0.59251493", "0.5917981", "0.59012586", "0.58720964", "0.5853507", "0.5850155", "0.58134836", "0.58088577", "0.57654166", "0.5749774", "0.57401437", "0.57388586", "0.57327545", "0.57249546", "0.5712678", "0.57103163", "0.5684225", "0.56736565", "0.5670042", "0.5666336", "0.5665842", "0.564537", "0.5638141", "0.56341696", "0.56289387", "0.56158805", "0.56126493", "0.56107515", "0.5605262", "0.56020325", "0.55996263", "0.5596848", "0.5574792", "0.5573679", "0.55735487", "0.55686194", "0.5548932", "0.554243", "0.5538007", "0.55330276", "0.55285394", "0.5528201", "0.55270475", "0.55202657", "0.5518965", "0.5515158", "0.55109143", "0.5508644", "0.55081654", "0.55034506", "0.54996467", "0.54993826", "0.54903865", "0.5486937", "0.54749703", "0.5464497", "0.54632807", "0.54521227", "0.545105", "0.5448837", "0.5447215", "0.5436965", "0.5432317", "0.5432297", "0.5431835", "0.5430988", "0.5428195", "0.54238653", "0.542125", "0.54208255", "0.5420318", "0.541569", "0.5407409", "0.54046345", "0.5397211", "0.53948545", "0.5392344", "0.5391494", "0.5390779", "0.53879905", "0.5386949", "0.53861576", "0.5385808", "0.5385636", "0.5383009", "0.5382052", "0.5380887", "0.5379843", "0.53793174", "0.5373414" ]
0.0
-1
Ubija donju polovinu svake vrste
cullSpecies() { for (let s of this.species) { s.cull(); //Ubija donju polovinu vrste s.setAverage(); //Setuje prosecan fitnes } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function naVrsti() {\n // Preveri za konec igre\n let zm = await zmagovalec();\n if (zm != \"undefined\") {\n if (Number(zm) == igralec) {\n location.replace('/igra/zmaga');\n } else {\n location.replace('/igra/zguba');\n }\n return;\n }\n\n // Posodobi stanje bitke\n await zapolniTabelo();\n\n lahkoNapada = true;\n\n document.getElementById(\"besedilo\").innerText = \"Tunkaj ladje!\";\n document.getElementById(\"hnapad\").classList.add(\"border-info\");\n document.getElementById(\"hdomace\").classList.remove(\"border-info\");\n }", "function tarkistaPari() {\r\n let ovatPari = ekaKortti.dataset.kehys === tokaKortti.dataset.kehys;\r\n //jos kortit ovat pari estetään niitä kääntymästä ja\r\n //jos kortit eivät ole pari käännetään ne takaisin\r\n ovatPari ? disable() : unflip();\r\n}", "function pokreniKviz(){\r\n // niz koji popunjavamo tekstom pitanja i ponudjenim odgovorima\r\n // niz ce sadrzati HTML elemente\r\n const output = [];\r\n // prolazimo petljom kroz sve elemente niza pitanja\r\n // uzimamo pitanje koje je aktuelno u trenutnoj iteraciji i njegov indeks\r\n pitanja.forEach(function(trenutnoPitanje, pitanjeInd){\r\n // niz koji cemo popuniti odgovorima na trenutno pitanje\r\n const odgovori = []; \r\n // petlja koja prolazi svim odgovorima trenutnog pitanja\r\n for(slovo in trenutnoPitanje.odgovori){\r\n // u niz odgovora dodajemo HTML kod za prikaz ponudjenog odgovora\r\n // inputi za odgovor na isto pitanje moraju imati isti name atribut\r\n // odradjujemo da svaki od njih ima name=\"odogovor\"+indeks_trenutnog_pitanja\r\n // na taj nacin ce svi ponudjeni odgovori na pitanje sa indeksom 1 imati name=\"odgovor1\"\r\n // vrijednost odgovora je upravo ono slovo pod kojim je on i ponudjen\r\n // tekst je oblika: \" a : tekst_odgovora \"\r\n odgovori.push(\r\n `<label>\r\n <input type=\"radio\" name=\"odgovor${pitanjeInd}\" value=\"${slovo}\" >\r\n ${slovo} : ${trenutnoPitanje.odgovori[slovo]}\r\n </label>`\r\n );\r\n }\r\n // na kraju u output niz koji sadrzi sva pitanja i ponudjene odgovore dodajemo trenutno\r\n // trenutnoPitanje.pitanje je tekst pitanja\r\n // funkcija join od niza pravi string\r\n output.push(\r\n `\r\n <div class=\"pitanje\">${trenutnoPitanje.pitanje}</div>\r\n <div class=\"odgovori\"> ${odgovori.join('')} </div>\r\n `\r\n );\r\n });\r\n // na kraju popunjavamo div za prikaz pitanja i odgovora\r\n kvizDiv.innerHTML = output.join('');\r\n}", "function rimuovi(){\n\n\tvar j = 0;\n\n\t// Per ogni elemento controllo la condizione\n\t// Se è idoneo, copio elemento in J\n\n\tfor(var i = 0; i<persone.length; i++){\n\t\tif(persone[i].altezza > 1.5) {\n\t\t\tpersone[j++] = persone[i];\n\t\t}\n\t}\n\t// Aggiorno array con valori nuovi messi in J\n\tpersone.length = j;\n\n\t// Visualizzo\n\tvisualizzaPersone();\n}", "function ucitajPodatkeImpl(periodicna, vanredna){\r\n //ucitavanje podataka\r\n glavniNizP=periodicna;\r\n glavniNizV=vanredna;\r\n }", "function ActualiserPointsVie(){\n\t//les PDV diminuent si le joueur s'eloigne des artefacts (zoneSure) sans lumiere (torcheJoueur)\n\tif(transform.Find(\"torcheJoueur(Clone)\") == null && !zoneSure){\n\t\tif(vitesseCorruption < 0){\n\t\t\tvitesseCorruption = 0;\n\t\t}else{\n\t\t\tvitesseCorruption += Time.deltaTime/2;\n\t\t}\n\t\tpointsVie -= vitesseCorruption*Time.deltaTime;\n\t} else{\n\t\t//la vitesse de reduction des PDV diminue jusqu'a 0\n\t\tif(vitesseCorruption > 0){\n\t\t\tvitesseCorruption -= Time.deltaTime*2;\n\t\t}else{\n\t\t\tvitesseCorruption = 0;\n\t\t\t//soigne si la vitesse de corruption est 0 et le joueur a obtenu la potion\n\t\t\tif(Joueur.powerUpPotion){\n\t\t\t\tpointsVie += Time.deltaTime;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}\n\t//actualise l'element visuel\n\tbarreVie.fillAmount = pointsVie/pointsVieMax;\n}", "popuniIzvjestaj() {\n this.vrijednost = Util.getRandomFloatIn(2, 10);\n this.vrijemeObroka = Util.randomDate(new Date(2012, 0, 1), new Date());\n }", "function Komunalne() {}", "function obliczPunkty(dane)\n{\n var ro = 1.21; // gęstośc czynnika\n var stosunek_et = [0.86, 0.98, 1, 0.966, 0.86]; // stosunek sprawności izentropowych\n\n var mi0 = (1 - (Math.sqrt(Math.sin(dane.beta2 * (Math.PI / 180))) / (Math.pow(dane.z, 0.7)))).toPrecision(3); // współczynnik zmniejszenia mocy wentylatora\n var u2 = ((dane.D2 * Math.PI * dane.n) / 60).toPrecision(3); // prędkość obwodowa wirnika\n var c2u = ((dane.deltapzn * 1000) / (ro * u2 * dane.etazn)).toPrecision(3); // prędkość zależna od ułopatkowania wirnika\n var fi2r = ((c2u * Math.tan(dane.alfa2 * Math.PI / 180)) / u2).toPrecision(3); // wskaźnik prędkości koła wirnikowego\n var fi2r0 = ((mi0 * fi2r) / (mi0 - (c2u / u2))).toPrecision(3); // wartośc wskaznika prędkości koła wirnikowego dla wartości zerowej charakterystyki koła wirnikowego\n var Qmax = (dane.Qzn * (fi2r0 / fi2r)).toPrecision(3); // przepływ maksymalny\n\n var krok = 0.6;\n\n var daneDoWykresu = {};\n daneDoWykresu.deltap = []; // tablica wartości sprężu (deltap)\n daneDoWykresu.Q = []; // tablica wartości wydajności\n daneDoWykresu.Q = []; // tablica wartości wydajności\n daneDoWykresu.eta = []; // etazn * stosunek_et\n\tdaneDoWykresu.wspQ = []; //współczynnik Q: 1-Q/Qmax\n\tdaneDoWykresu.mp = [] ; // tablica wartości mocy pobieranej\n\t\n /* obliczanie punktów charakterystyk */\n\t\n for (var i = 0; i < 5; i++)\n\t{\n daneDoWykresu.Q[i] = krok * dane.Qzn;\n daneDoWykresu.wspQ[i] = 1 - (daneDoWykresu.Q[i] / Qmax);\n daneDoWykresu.eta[i] = dane.etazn * stosunek_et[i];\n\t\tdaneDoWykresu.deltap[i] =((293/(273+dane.tc))*((ro * (Math.pow(u2, 2)) * mi0 * daneDoWykresu.wspQ[i] * daneDoWykresu.eta[i])) / 1000); // kPa\n\t\tdaneDoWykresu.mp[i] = ((daneDoWykresu.Q[i]*daneDoWykresu.deltap[i])/(daneDoWykresu.eta[i]*dane.etas))/100; // kW/100\n krok += 0.2;\n }\n return daneDoWykresu;\n}", "function vise_manje(rec){\n\tdugme('#gotovo','disabled',false);\n\tdugme('#jos_druge_igre','disabled',false);\n\t$('#1').attr('src',karta2.slika);\n\tlet izraz;\n\trec==='higher' ? izraz=karta2.vrednost>karta1.vrednost : izraz=karta2.vrednost<karta1.vrednost;\n\tif(izraz){\n\t\tbrojac_druga++;\n\t\tkarta1=karta2;\n\t\tkarta2=spil2.deal_card();\n\t}else{\n\t\tbrojac_druga=0;\n\t\tdugme('#jos_druge_igre');\n\t}\n\tlet a=brojac_druga*dobitak;\n\tprikaz_dobitka(a);\n\tdugme('#vise');\n\tdugme('#manje');\n}", "function indovina(){\n\n gino = get(posIniX, posIniY, beholder.width, beholder.height);\n classifier.classify(gino, gotResult);\n mappa = aCheAssimiglia(gino, daMappare);\n\n}", "function preberiMeritveVitalnihZnakov() {\n\tsessionId = getSessionId();\n \n \n\tvar ehrId = $(\"#meritveVitalnihZnakovEHRid\").val();\n\t\n\t// Spodaj poskrbimo da so vrednosti ponovno \"\", ko izberemo drugega pacienta\n\t//prav tako ponovno skrijemo vrednosti, tako da se pokazejo sele ob pritisku na gumb\n document.getElementById(\"wikiTextBloodPressure\").innerHTML = \"\";\n document.getElementById(\"wikiTextDeath\").innerHTML = \"\";\n document.getElementById(\"wikiTextItm\").innerHTML = \"\";\n document.getElementById(\"wikiTextTveganja\").innerHTML = \"\";\n document.getElementById(\"wikiTextZdravje\").innerHTML = \"\";\n $(\"#wikiTextTveganja2\").html(\"\"); //lazje kot document.getelement blabla\n $(\"#wikiDetails\").hide();\n\n\tif (!ehrId || ehrId.trim().length == 0 ) {\n\t\t$(\"#preberiMeritveVitalnihZnakovSporocilo\").html(\"<span class='obvestilo \" +\n \"label label-warning fade-in'>Prosim vnesite zahtevan podatek!\");\n\t} else {\n\t \n\t\n\t\t$.ajax({\n\t\t\turl: baseUrl + \"/demographics/ehr/\" + ehrId + \"/party\",\n\t \ttype: 'GET',\n\t \theaders: {\"Ehr-Session\": sessionId},\n\t \tsuccess: function (data) {\n\t\t\t\tvar party = data.party;\n\t\t\t\t\n\n\t\t\t\t//pridobimo srcni utrip\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t url: baseUrl + \"/view/\" + ehrId + \"/\" + \"pulse\",\n\t\t\t\t\t type: 'GET',\n\t\t\t\t\t headers: {\"Ehr-Session\": sessionId},\n\t\t\t\t\t success: function (res) {\n\t\t\t\t var hintUtrip = \"<br>\";\n\t\t\t\t \n\t\t\t\t if (res[res.length-1].pulse > 100)\n\t\t\t\t \thintUtrip += \"<p class='bg-danger'>Vaš srčni utrip je povišan. Optimalen srčni utrip znaša 50 - 100 /min</p>\"\n\t\t\t\t \telse if (res[res.length-1].pulse < 50)\n\t\t\t\t hintUtrip += \"<p class='bg-danger'>Vaš srčni utrip je nizek. Optimalen srčni utrip znaša 50 - 100 /min/p>\"\n\t\t\t\t else\n\t\t\t\t \thintUtrip += \"<p class='bg-success'> Vaš srčni utrip je optimalen </p>\"\n\t\t\t\t \n\t\t\t\t\t document.getElementById('utrip').innerHTML = \"Vaš srčni utrip znaša \" + res[res.length-1].pulse + \" /min\" + hintUtrip;\n\t\t\t\t\t document.getElementById('utripNumber').innerHTML = res[res.length-1].pulse;\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t preveri() //pri vsakem klicu gremo v funkcijo \"preveri\", katera caka da se izvedejo vsi tej klici, potem pa nadaljuje z graficnim prikazom\n\t\t\t\t\t \n\t\t\t\t\t },\n\t\t\t\t\t});\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//zacetek ajaxa za tezo\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t url: baseUrl + \"/view/\" + ehrId + \"/\" + \"weight\",\n\t\t\t\t\t type: 'GET',\n\t\t\t\t\t headers: {\"Ehr-Session\": sessionId},\n\t\t\t\t\t success: function (res) {\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t document.getElementById('teza').innerHTML = \"<p class='bg-info'>Vaša teža znaša \" + res[res.length-1].weight + \" kg </p>\"\n\t\t document.getElementById('tezaNumber').innerHTML = res[res.length-1].weight;\n\t\t preveri()\n\t\t\t\t\t },\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t//zacetek ajaxa za zgornji tlak\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t url: baseUrl + \"/view/\" + ehrId + \"/\" + \"blood_pressure\",\n\t\t\t\t\t type: 'GET',\n\t\t\t\t\t headers: {\"Ehr-Session\": sessionId},\n\t\t\t\t\t success: function (res) {\n\t\t\t\t\t var hintTlak = \"<br>\";\n\t\t\t\t\t \n\t\t\t\t\t \tif (res[res.length-1].systolic > 140)\n\t\t\t\t\t \t\thintTlak += \" <p class='bg-danger'>Vaš zgornji krvni tlak je povišan. Optimalen sistolični tlak znaša 100 - 140 mm Hg</p>\"\n\t\t\t\t\t \telse if (res[res.length-1].systolic < 100)\n\t\t\t\t\t \t\thintTlak += \" <p class='bg-danger'>Vaš zgornji krvni tlak je nizek. Optimalen sistolični tlak znaša 100 - 140 mm Hg</p>\"\n\t\t\t\t\t \telse\n\t\t\t\t\t \t\thintTlak += \"<p class='bg-success'>Vaš zgornji krvni tlak je optimalen </p>\"\n\t\t\t\t\t \t\n\t\t\t\t\t \t\n\t\t document.getElementById('zgornjiTlak').innerHTML = \"Vaš zgornji krvni pritisk znaša \" + res[res.length-1].systolic + \" mm Hg\" + hintTlak\n\t\t document.getElementById(\"zgornjiTlakNumber\").innerHTML = res[res.length-1].systolic;\n\t\t preveri()\n\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//zacetek ajaxa za spodnji tlak\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t url: baseUrl + \"/view/\" + ehrId + \"/\" + \"blood_pressure\",\n\t\t\t\t\t type: 'GET',\n\t\t\t\t\t headers: {\"Ehr-Session\": sessionId},\n\t\t\t\t\t success: function (res) {\n\t\t\t\t\t \tvar hintSpodnji = \"<br>\"\n\t\t\t\t\t \t\n\t\t\t\t\t \tif (res[res.length-1].diastolic > 90)\n\t\t\t\t\t \t\thintSpodnji += \" <p class='bg-danger'>Vaš spodnji krvni tlak je povišan. Optimalen diastolični tlak znaša 60 - 90 mm Hg</p>\"\n\t\t\t\t\t \telse if (res[res.length-1].systolic < 60)\n\t\t\t\t\t \t\thintSpodnji += \" <p class='bg-danger'>Vaš spodnji krvni tlak je nizek. Optimalen diastolični tlak znaša 60 - 90 mm Hg</p>\"\n\t\t\t\t\t \telse\n\t\t\t\t\t \t\thintSpodnji += \"<p class='bg-success'>Vaš spodnji krvni tlak je optimalen </p>\"\n\t\t document.getElementById('spodnjiTlak').innerHTML = \"Vaš spodnji krvni pritisk znaša \" + res[res.length-1].diastolic + \" mm Hg\" + hintSpodnji\n\t\t document.getElementById(\"spodnjiTlakNumber\").innerHTML = res[res.length-1].diastolic;\n\t\t preveri()\n\t\t\t\t\t },\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t//zacetek ajaxa za višino\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t url: baseUrl + \"/view/\" + ehrId + \"/\" + \"height\",\n\t\t\t\t\t type: 'GET',\n\t\t\t\t\t headers: {\"Ehr-Session\": sessionId},\n\t\t\t\t\t success: function (res) {\n\t\t\t\t\t \n\t\t document.getElementById('visina').innerHTML = \"<p class='bg-info'>Vaša višina znaša \" + res[res.length-1].height + \" cm</p>\"\n\t\t document.getElementById(\"visinaNumber\").innerHTML = res[res.length-1].height;\n\t\t preveri()\n\t\t\t\t\t },\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t$(\"#overall, #details, #friendlyTip\").show();\n\t\t\n\t\t\t\n\t\n\t\t\t\t\n\t \t},\n\t \n\t\t});\n\t}\n\t\n}", "function fl_outToLevivot ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.modern_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function fl_outToGvina ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "async function naCakanju() {\n lahkoNapada = false;\n document.getElementById(\"besedilo\").innerText = \"Cakaj nasprotnika!\";\n document.getElementById(\"hdomace\").classList.add(\"border-info\");\n document.getElementById(\"hnapad\").classList.remove(\"border-info\");\n\n // Zacni cakanje da je igralec na vrsti\n zacniCakanje(`/igra/naVrsti/${id_igre}/${igralec}`, naVrsti, (el) => el != 'false');\n }", "_proximaImgVivo() {\n\t\t//mudar index (como vetor circular)\n\t\tthis._indexImgVivo = (this._indexImgVivo + 1) % this._vetorImgsVivo.length;\n\t\t//mudar img em formaGeometrica\n\t\tthis._colocarImgVivoAtual();\n\t}", "function zalogujDoKonsoli() {\n console.log('podpiete');\n}", "function wykonaj_ruch_SI()\n{\n let ruchy = generuj_ruchy(), ruch_t;\n\n // sprawdzanie czy jest mat/pat\n if(ruchy.ruchy.length + ruchy.zbicia.length === 0)\n {\n if(czy_szach(szachownica.biale_ruch))\n {\n // mat, SI przegralo\n napisz_wynik(szachownica.biale_ruch ? 2 : 1);\n }\n else\n {\n // pat, remis\n napisz_wynik(3);\n }\n\n zablokowane = true;\n\n return;\n }\n\n // sprawdzanie pozostalych remisow\n if(szachownica.liczba_polowek_od_r > 100 || poprzednie_pozycje[szachownica.hash] >= 3 || !czy_wystarczajacy_material())\n {\n napisz_wynik(3);\n\n szachownica.biale_ruch = !szachownica.biale_ruch;\n zablokowane = true;\n\n return;\n }\n\n tablica_transp = new Map();\n\n let nr = Math.floor(Math.random() * (ruchy.ruchy.length + ruchy.zbicia.length));\n\n if(nr < ruchy.ruchy.length)\n ruch_t = ruchy.ruchy[nr];\n else\n ruch_t = ruchy.zbicia[nr - ruchy.ruchy.length];\n\n wykonaj_ruch(ruch_t);\n if(szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k] === 6 && ruch_t.wiersz_k === 7)\n {\n // promocja biale\n promuj_piona(ruch_t.wiersz_k, ruch_t.kolumna_k, Math.floor(Math.random() * 4) + 2);\n }\n else if(szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k] === 12 && ruch_t.wiersz_k === 0)\n {\n // promocja czarne\n promuj_piona(ruch_t.wiersz_k, ruch_t.kolumna_k, Math.floor(Math.random() * 4) + 8);\n }\n\n narysuj();\n}", "function mursVdessin(tab, nx, pas){\r\n\tfor(i = 0; i < tab.length; ++i){\r\n\t\tcoord = mursVtoCoord(tab[i], nx);\r\n\t\t\r\n\t\tpu(); rt(90); fd(coord.x*pas);\r\n\t\trt(90); fd(coord.y*pas);\r\n\t\tpd(); fd(pas); pu();\r\n\t\tbk(pas); bk(coord.y*pas);\r\n\t\tlt(90); bk(coord.x*pas); lt(90);\r\n\t\tpd();\r\n\t}\r\n}", "function cruzamiento(poblacion,seleccion,ciudades,elite)\n\t\t\t{\n\t\t\t\tvar numPobla = poblacion.length;\n\t\t\t\tvar indice1,indice2;\n\t\t\t\tvar k = 0;\n\t\t\t\tvar new_poblation = new Array();\n\t\t\t\t/*Genero nueva poblacion*/\n\t\t\t\twhile(k < parseInt(numPobla / 2))\n\t\t\t\t{\n\t\t\t\t\t//Escogo el metodo de seleccion para tener dos PADRES\n\t\t\t\t\tswitch(seleccion)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Torneo\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tdo{\n\t\t\t\t\t\t\t\tindice1 = torneo(poblacion,elite);\n\t\t\t\t\t\t\t\tindice2 = torneo(poblacion,elite);\n\t\t\t\t\t\t\t}while(indice1 == indice2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//Ranking\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//Aleatorio\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tdo{\n\t\t\t\t\t\t\t\tindice1 = parseInt( Math.random() * numPobla*elite);\n\t\t\t\t\t\t\t\tindice2 = parseInt( Math.random() * numPobla*elite);\n\t\t\t\t\t\t\t}while(indice1 == indice2);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t//console.log(indice1);\n\t\t\t\t\t//console.log(indice2);\n\t\t\t\t\t/*Padres*/\n\t\t\t\t\tvar dad = poblacion[indice1].recorrido; \n\t\t\t\t\tvar mom = poblacion[indice2].recorrido;\n\t\t\t\t\t/*Camino para Hijos*/\n\t\t\t\t\tvar camino1 = new Array();\n\t\t\t\t\tvar camino2 = new Array();\n\t\t\t\t\t/*Numero entre 0 y numero de ciudades menos 1*/\n\t\t\t\t\tbp = parseInt( Math.random() * ciudades ); /*Punto de roptura*/\n\n\t\t\t\t/*-----------Genero 2 nuevos caminos-----------*/\n\t\t\t\t\t//Respaldo caminos de papa y mama hasta bp\n\t\t\t\t\tfor(var i = 0; i < bp; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tcamino1.push(dad[i]);\n\t\t\t\t\t\tcamino2.push(mom[i]);\n\t\t\t\t\t}\n\t\t\t\t\tfor(var i = 0; i < ciudades; i++)\n\t\t\t\t\t{\t\n\t\t\t\t\t\t//Tomo el elemento a buscar en el segundo vector\n\t\t\t\t\t\tvar busca1 = mom[i];\n\t\t\t\t\t\tvar busca2 = dad[i];\n\t\t\t\t\t\tfor(var j = bp; j < ciudades; j++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(busca1 == dad[j])\n\t\t\t\t\t\t\t\tcamino1.push(busca1);\n\t\t\t\t\t\t\tif(busca2 == mom[j])\n\t\t\t\t\t\t\t\tcamino2.push(busca2); \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t/*Hijos generados*/\n\t\t\t\t\tvar hijo1 = {recorrido: camino1, distancia: aptitud(camino1,region)}\n\t\t\t\t\tvar hijo2 = {recorrido: camino2,distancia : aptitud(camino2,region)}\n\n\t\t\t\t\tnew_poblation.push(hijo1);\n\t\t\t\t\tnew_poblation.push(hijo2);\n\t\t\t\t\tk++;\n\t\t\t\t}\n\t\t\t\treturn new_poblation;\n\t\t\t}", "function obrisi_sekvencu(kliknuta_kartica) {\r\n\t// koji igrac zeli ponovo da popuni kombinaciju\r\n\tvar br_igraca = nadji_igraca(kliknuta_kartica);\r\n\tif (br_igraca == 1) {\r\n\t\tlocalStorage.setItem(\"sekvenca_zemalja1\", \"\");\r\n\t\t//sekvenca_zemalja1 = [];\r\n\t}\r\n\r\n\tif (br_igraca == 2) {\r\n\t\tlocalStorage.setItem(\"sekvenca_zemalja2\", \"\");\r\n\t\t//sekvenca_zemalja2 = [];\r\n\t}\r\n\r\n\t//dohvati sve kartice kako bi ih sve obrisao\r\n\tvar _niz = document.querySelectorAll(\"div.kartica\");\r\n\r\n\r\n\tvar vracen_fokus_na_prvu_karticu = 0;\r\n\t// 4 za po svakog igraca posto smo dohvatili sve kartice, a zelimo da brisemo samo za jednog\r\n\tfor (let i = 0; i < 8; i++) {\r\n\t\tlet vlasnik__niz = nadji_igraca(_niz[i]);\r\n\t\tif (vlasnik__niz != br_igraca) continue;\r\n\t\telse {\r\n\t\t\t// kada obrise sekvencu da se ispise ? na kartici\r\n\t\t\t_niz[i].innerHTML = \"<img class='icon' src='skocko-dodatno/upitnik2.png' alt='?'>\";\r\n\t\t\t_niz[i].classList.remove(mesto_fokusa[br_igraca]);\r\n\r\n\t\t\t// prva na koju naidjemo je zapravo prva kartica od tog igraca i na nju treba da se vratimo kada sve obrisemo\r\n\t\t\tif (vracen_fokus_na_prvu_karticu == 0) {\r\n\t\t\t\t_niz[i].classList.add(mesto_fokusa[br_igraca]);\r\n\t\t\t\tvracen_fokus_na_prvu_karticu = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "liikuta(nimi, suunta){\n for (var i = 0; i < this.hahmot.length; i++){\n var h = this.hahmot[i];\n if (h.nimi == nimi) {\n if (suunta == suunnat.OIKEA) {\n if (this.onkoEtanoita(h.x + 1,h.y)) return;\n if (++h.x >= this.leveys) {\n h.x = 0;\n }\n }\n if (suunta == suunnat.VASEN) {\n if (this.onkoEtanoita(h.x - 1,h.y)) return;\n if (--h.x < 0) {\n h.x = this.leveys - 1;\n }\n }\n if (suunta == suunnat.YLOS) {\n if (this.onkoEtanoita(h.x,h.y - 1)) return;\n if (--h.y < 0) {\n h.y = 0;\n }\n }\n if (suunta == suunnat.ALAS) {\n if (this.onkoEtanoita(h.x, h.y + 1)) return;\n if (++h.y >= this.korkeus) {\n h.y = this.korkeus - 1;\n }\n }\n }\n } \n if (typeof this.pelihahmo == 'undefined') return;\n var h = this.pelihahmo;\n if (h.nimi == nimi) {\n if (suunta == suunnat.OIKEA) {\n if (++h.x >= this.leveys) {\n h.x = 0;\n }\n pisteet++;\n }\n if (suunta == suunnat.VASEN) {\n if (--h.x < 0) {\n h.x = this.leveys - 1;\n }\n pisteet--;\n }\n if (suunta == suunnat.YLOS) {\n if (--h.y < 0) {\n h.y = 0;\n }\n }\n if (suunta == suunnat.ALAS) {\n if (++h.y >= this.korkeus) {\n h.y = this.korkeus - 1;\n }\n }\n }\n }", "function FimJogo(){\n\t\tswitch(_vitoria){\n\t\t\tcase 1:AnunciarVitoria(1);p1.Vencer();break;\n\t\t\tcase 2:AnunciarVitoria(2);p2.Vencer();break;\n\t\t\tcase 4:AnunciarVitoria(3);p3.Vencer();break;\n\t\t\tcase 8:AnunciarVitoria(4);p4.Vencer();break;\n\t\t\tcase 0:AnunciarVitoria(0);AnimacaoEmpate();break;\n\t\t\tdefault:if(_minutos==0 && _segundos==0){AnunciarVitoria(0);AnimacaoEmpate();}break;\n\t\t}\n\t}", "function fasesTorneo() {\n vm.paso = 3;\n obtenerFases();\n obtenerTiposDeFase();\n obtenerPenalizaciones();\n }", "function predstaveni2(jmeno) {\n console.log(\"Ahoj\");\n console.log(\"Moje jmeno je \" + jmeno)\n console.log(\"Jak se mas?\")\n}", "function sortirajSveOpadajuce() {\r\n let tempNiz = nizPrikazanihProizvoda;\r\n tempNiz.sort((a,b) => {\r\n if(a.cena == b.cena)\r\n return 0;\r\n return a.cena > b.cena ? -1 : 1;\r\n });\r\n prikaziProizvode(tempNiz);\r\n}", "function caricaModello() {\n // CARICA MAPPA DISPLACEMENT\n mappaTemp = mappa;\n //mappaTemp.filter(BLUR, oggetto.Smooth);\n\n\n mappaTemp.loadPixels();\n let f = 0;\n let k = 0;\n for (let x = 0; x < mappaTemp.width-res; x+=res) {\n punti[f] = [];\n for (let y = 0; y < mappaTemp.height-res; y+=res) {\n let c = mappaTemp.get(x, y);\n let h = brightness(c);\n punti[f][k] = h;\n k++;\n }\n k=0;\n f++;\n }\n mappaTemp.updatePixels();\n\n // CARICA TEXTURE\n gino.loadPixels();\n let i = 0;\n let j = 0;\n for (let x = 1; x <= gino.width-res; x+=res) {\n voxel[i] = [];\n voxelBN[i] = [];\n for (let y = 1; y <= gino.height-res; y+=res) {\n let c = gino.get(x, y);\n let h = brightness(c);\n voxel[i][j] = c;\n voxelBN[i][j] = h;\n j++;\n }\n j=0;\n i++;\n }\n gino.updatePixels();\n}", "function sortirajSveRastuce() {\r\n let tempNiz = nizPrikazanihProizvoda;\r\n tempNiz.sort((a,b) => {\r\n if(a.cena == b.cena)\r\n return 0;\r\n return a.cena < b.cena ? -1 : 1;\r\n });\r\n prikaziProizvode(tempNiz);\r\n}", "function prikaziRezultat(){\r\n // na samom pocetku nije imao tacnih odgovora\r\n let brTacnih = 0;\r\n const listaPitanja = document.querySelectorAll(\".pitanje\")\r\n // prolazimo kroz globalni niz svih pitanja\r\n // tu poredimo odgovor koji je igrac dao na to pitanja sa tacnim odgovorom pitanja \r\n pitanja.forEach(function(trenutnoPitanje, pitanjeInd){\r\n // selektor koji trazi cekirani input na trenutno pitanje\r\n const selektor = `input[name=odgovor${pitanjeInd}]:checked`;\r\n // igrac je odgovorio ono sto je vrijednost cekiranog input-a (radio button-a)\r\n const odgovoreno = (document.querySelector(selektor) || {} ).value;\r\n\r\n // ako je ono sto je igrac odgovorio jednako tacnom odgovoru na trenutno pitanje\r\n // to znaci da je igrac tacno odgovorio i povecavamo ukupan broj tacnih odgovora\r\n \r\n if(odgovoreno === trenutnoPitanje.tacanOdgovor){\r\n brTacnih = brTacnih + 1;\r\n\r\n /* DOMACI */\r\n listaPitanja[pitanjeInd].style.color = \"green\"\r\n }else {\r\n listaPitanja[pitanjeInd].style.color = \"red\" \r\n } /* DOMACI */\r\n\r\n\r\n });\r\n // na kraju samo popunjavamo div za prikaz rezultata\r\n rezultatDiv.innerHTML = `rezultat: <h3>${brTacnih} od ${pitanja.length}</h3>`; \r\n}", "function volar(golondrina, distancia) {\n \n return{\n energia: golondrina.energia - (2*distancia), \n nombre:golondrina.nombre}\n}", "function luoRuoka() {\n ruokaX = satunnainenKymppi(0, gameCanvas.width - 10);\n ruokaY = satunnainenKymppi(0, gameCanvas.height - 10);\n snake.forEach(function(snakeOsa) {\n if (ruokaX == snakeOsa.x && ruokaY == snakeOsa.y) {\n luoRuoka();\n }\n });\n}", "function fl_outToSelek ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function lisaaJoukkueTilasto(tilasto, joukkue, tulos, pvm){\n\n\t// Jos joukkuella ei ole aikaisempia merkintöjä, alustetaan merkinnät\n\tif( !(joukkue in tilasto) ){\n\t\ttilasto[joukkue] = [0,0,0];\t// Nolla voittoa, tasapeliä, tappiota\n\t}\n\n\t// Lisätään: voitto\n\tif(tulos === \"voitto\"){\n\t\ttilasto[joukkue][0] = tilasto[joukkue][0] + 1;\n\n\t} else if(tulos === \"tasapeli\"){\t// Lisätään: tasapeli\n\t\ttilasto[joukkue][1] = tilasto[joukkue][1] + 1;\n\n\t} else if(tulos === \"tappio\"){ // Lisätään: tappio\n\t\ttilasto[joukkue][2] = tilasto[joukkue][2] + 1;\n\n\t} else{\n\t\talert(\"Virhe! Päiväyksellä \" + pvm + \" oli peli, jolla ei ollut voittajaa, häviäjää eikä tasapelin pelannutta.\")\n\t}\n\n\treturn tilasto;\n}", "function kiekReiketuTapetuRulonuKambariui(ilgis, plotis, aukstis) {\n const vienasRulonas = 10;\n \n // debugger\n // gauti visus sienu ir lubu plota\n let sienos = kambarioSienuPlotas(ilgis, plotis, aukstis);\n let grindysLubos = kabarioLubosGrindys(ilgis, plotis);\n // pagal gauta plota paskaiciuoti kiek rulonu reikes \n let kiekRulonu = (sienos + grindysLubos) / vienasRulonas;\n\n return kiekRulonu;\n}", "nuevoCiclo() {\n let suma = 0;\n for (let i = 0; i < this.vecinos.length; i++) {\n if (this.vecinos[i].estado === 1) {\n suma++;\n }\n }\n\n // Aplicamos las normas\n this.estadoProx = this.estado; // Por defecto queda igual\n\n // Vida: tiene 3 vecinos\n if (this.estado === 0 && suma === 3) {\n this.estadoProx = 1;\n }\n\n // Muerte: menos de 2(soledad) o mas de 3 (inanicion)\n if (this.estado == 1 && (suma < 2 || suma > 3)) {\n this.estadoProx = 0;\n }\n }", "function sortirajSveOpadajuce() {\r\n console.log(\"SORTIRANJE\");\r\n console.log(nizPrikazanihProizvoda);\r\n let tempNiz = nizPrikazanihProizvoda;\r\n tempNiz.sort((a,b) => {\r\n if(a.cena == b.cena)\r\n return 0;\r\n return a.cena > b.cena ? -1 : 1;\r\n });\r\n prikaziProizvode(tempNiz);\r\n}", "function dogadjaj(nivo) {\r\n const polje = document.querySelector(`#${nivo} .polje`);\r\n //Dodavanje dogadjaja polju\r\n polje.addEventListener('click', function (event) {\r\n //event.target tamo gde kliknemo:\r\n let klik = event.target;\r\n //ne dozvoljavamo da se selektuje ceo deo section iza kartica, vec samo kartica moze, i to samo jednom\r\n if (klik.nodeName === 'SECTION' || klik.parentNode.classList.contains('selected')) {\r\n return;\r\n };\r\n if (moves < 2) {\r\n moves++;\r\n if (moves === 1) {\r\n //Definisanje prvog pokusaja\r\n prvi = klik.parentNode.dataset.name;\r\n console.log(prvi);\r\n klik.parentNode.classList.add('selected');\r\n } else {\r\n //Definisanje drugog pokusaja\r\n drugi = klik.parentNode.dataset.name;\r\n console.log(drugi);\r\n klik.parentNode.classList.add('selected');\r\n\r\n brojac();\r\n console.log(brojPokusaja);\r\n };\r\n //Ako oba pokusaja nisu prazni...\r\n if (prvi !== '' && drugi !== '') {\r\n //i prvi i drugi pokusaj su pogodjeni\r\n if (prvi === drugi) {\r\n //niz u koji ubacujemo uparene kartice\r\n upareneKartice.push(izabrano);\r\n console.log(upareneKartice);\r\n\r\n //pozivanje funkcije match sa odlaganjem\r\n setTimeout(match, 1200);\r\n //pozivanje funkcije resetPokusaja\r\n setTimeout(resetPokusaja, 1200);\r\n } else {\r\n setTimeout(resetPokusaja, 1200);\r\n };\r\n };\r\n //Set previous target to clicked (I'll assign the clicked value to prevousTarget after the first click.)\r\n prethodniKlik = klik;\r\n };\r\n otvaranje(nivo);\r\n });\r\n}", "function etsiLajiHavainnot(laji){\n\t\tvar aputaulukko=[];\n\t\tfor(var i in havainnotTaulukko){ \t\t\t\t//käydään kaikki havainnot läpi yksi kerrallaan\n\t\t\tif (havainnotTaulukko[i].laji==laji){\t\t//jos objektin lajinimi vastaa parametrina saatua nimeä\n\t\t\t\taputaulukko.push(havainnotTaulukko[i]);\t//objekti aputaulukkoon\n\t\t\t}\n\t\t}\n\t\thavainnotTaulukko=aputaulukko;\t\t\t\t\t//havaintoTaulukosta lajikohtainen\n\t}", "function upisiVrednosti(vrednosti, sadrzaj){\n for(var kljuc in vrednosti){\n sadrzaj = sadrzaj.replace(\"{{\" + kljuc + \"}}\", vrednosti[kljuc]);\n }\n return sadrzaj;\n} // upisiVrednosti", "function mojaFunkcija(){\n console.log('Zdarvo svete!');\n}", "function rencontre(pnj, textePnj) { // fonction gérant la collision avec un pnj \n\n\tif (joueur.posX + joueur.largeur > pnj.posX2 && joueur.posX - tailleTuile < pnj.posX2 && joueur.posY + joueur.hauteur > pnj.posY2 && joueur.posY - tailleTuile < pnj.posY2) {\n\t\tconsole.log(pnj.name);\n\n\t\tswitch(dir) { // on va évaluer la direction du personnage joueur\n\t\t\tcase 1: \n\t\t\t\tjoueur.posX -= 1; // on enlève 1 à la position posX du joueur pour qu'il se décale horizontalement par rapport au pnj\n\t\t\t\t// pnj.v=0; // on arrête le déplacement du pnj en mettant sa vitesse à 0\n\t\t\t\t// dirPnj=0; // on le fait regarder de face\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tjoueur.posX += 1; // on ajoute 1 à la position posX du joueur pour qu'il se décale horizontalement par rapport au pnj\n\t\t\t\t// pnj.v=0; //on arrête le déplacement du pnj en mettant sa vitesse à 0\n\t\t\t\t // dirPnj=0; // on le fait regarder de face\n\t\t\t\tbreak;\n\n\t \t\tcase 0: \n\t\t\t\tjoueur.posY -= 1; // on enlève 1 à la position posY du joueur pour qu'il se décale verticalement par rapport au pnj\n\t\t\t\t// pnj.v=0; //on arrête le déplacement du pnj en mettant sa vitesse à 0\n\t\t\t\t // dirPnj=0; // on le fait regarder de face\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tjoueur.posY += 1; // on ajoute 1 à la position posY du joueur pour qu'il se décale verticalementement par rapport au pnj\n\t\t\t\t// pnj.v=0; //on arrête le déplacement du pnj en mettant sa vitesse à 0\n\t\t\t\t // dirPnj=0; // on le fait regarder de face\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (pnj.collision == 0) {\n\t\t\tbulleTexte(pnj.texte, pnj.posX2, pnj.posY2); // affiche une \"bulle\" de dialogue\n\n\t\t}\n\n\t\tpnj.collision += 1; // permettra de savoir ensuite qu'on a touché le pnj\n\n\t\tconsole.log(pnj.collision+\" - pnj !\");\n\n\t}\n}", "function ocen_statycznie()\n{\n return szachownica.ocena.material + (szachownica.ocena.faza_gry * szachownica.ocena.tablice + (70 - szachownica.ocena.faza_gry) * szachownica.ocena.tablice_koncowka) * 0.03;\n}", "function jelKenta(niz)\n{\n\t/* make a set from an array */\n\tvar skup = napraviSet(niz);\n\tvar tmpn = Array.from(skup);\n\ttmpn.sort();\n\n\tif(skup.size === 5)\n\t{\n\t\tconsole.log(tmpn[4]);\n\t\t/* kandidat za kentu */\n\t\tif((tmpn[4] - tmpn[0]) === 4)\n\t\t{\n\t\t\t/* velika ili mala kenta? */\n\t\t\tif(tmpn[0] === 1)\n\t\t\t\treturn 75;\n\t\t\telse\n\t\t\t\treturn 80;\n\t\t}\n\t\telse\n\t\t\treturn 0;\n\t}\n\telse\n\t\treturn 0;\n\n}", "function prikaziRezultat(){\n\n const tajmer = document.querySelector('#tajmer'); \n tajmer.style.display = \"none\";\n clearInterval(interval);\n\n let brTacnih=0;\n //const sviOdgovori = kvizDiv.querySelectorAll('.odgovori');\n\n pitanja.forEach(function(trenutnoPitanje, pitanjeIdn){\n const selektor = `input[name=odgovor${pitanjeIdn}]:checked`;\n const odgovoreno = (document.querySelector(selektor) || {}).value;\n\n console.log(odgovoreno, trenutnoPitanje.tacanOdgovor);\n\n //smjestanje pitanja u niz i pozivanje pojedinacnog\n const nizPitanja = document.querySelectorAll('.pitanje');\n const pojedinacnoPitanje = nizPitanja[pitanjeIdn];\n\n if(odgovoreno === trenutnoPitanje.tacanOdgovor){\n brTacnih++;\n pojedinacnoPitanje.classList.add('tacno_pitanje'); \n } else {\n pojedinacnoPitanje.classList.add('netacno_pitanje'); \n }\n });\n\n\n rezultatDiv.innerHTML = `Rezultat: <h3>${brTacnih} od ${pitanja.length}</h3>`\n}", "function fl_outToOznei_aman ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function sortirajSveRastuce() {\r\n console.log(\"SORTIRANJE\");\r\n console.log(nizPrikazanihProizvoda);\r\n let tempNiz = nizPrikazanihProizvoda;\r\n tempNiz.sort((a,b) => {\r\n if(a.cena == b.cena)\r\n return 0;\r\n return a.cena < b.cena ? -1 : 1;\r\n });\r\n prikaziProizvode(tempNiz);\r\n}", "function pasveikinaKauna() {\n console.log(\"Labas vakaras Kaune!\");\n}", "function volverAlJuego() {\n \n vidas--;\n\n var contadorVidas = document.querySelector(\".vidas\");\n\n contadorVidas.innerHTML = vidas;\n\n // Si las vidas se terminan, logicamente el juego termina\n if (vidas == 0) {\n finalizarJuego();\n }\n\n // Posicionamos al jugador en la casilla de salida\n posicionarJugador();\n\n // Indicamos a la momia que el personaje se encuentra en el tablero\n personajeEnTablero = true;\n}", "function ujebTomu(x) {\r\n //ulozi id tuknuteho luda\r\n let pes = document.getElementById(x);\r\n\r\n //ak uz nie je otvoreny nejaky iny zamestnanec\r\n if (otvoreny == \"nikto\") {\r\n //ulozi aktualne otvoreneho luda\r\n otvoreny = pes;\r\n x = '#' + x;\r\n\r\n //zmaze css pre zatvorenu tablicku - ci uz pc alebo mobil\r\n $(x).removeClass(\"mobileLudo\");\r\n $(x).removeClass(\"normLudo\");\r\n\r\n //prida css pre otvorenu tablicku\r\n if ($(window).width() < 1000) {\r\n //pre mobil otvori \"fullscreen\" zobrazenie luda\r\n $('body div').hide();\r\n //vypne moznost kliknut na logo v mavbare kym je otvoreny nejaky ludo\r\n $('.mavbar a').attr(\"onclick\", \"\");\r\n\r\n let picus = \"#BL\" + pes.id;\r\n $(picus).show();\r\n $(picus).find(\"div\").show();\r\n $('.mavbar').show();\r\n $('.mavbar #menuButton').hide();\r\n } else {\r\n //pre pc\r\n $(x).addClass(\"bigLudo\");\r\n $(x).find('.dlhyOpis').show();\r\n }\r\n\r\n //ukaze kontakt danej osoby\r\n $(x).find(\".bengoroKontakt\").show();\r\n //ukaze tlacitka pre email a zatvorenie tablicky\r\n $(x).find(\".miniButtony\").show();\r\n //ukaze zvysok opisneho textu\r\n $(x).find(\".quiestce\").find(\"span\").removeClass(\"hidden\");\r\n } else {\r\n //ak uz bol nejaky ludo otvoreny v momente kliknutia tak ho zavre\r\n //a otvori aktualne tuknuteho luda\r\n odjebTomu(otvoreny.id);\r\n ujebTomu(pes.id);\r\n otvoreny = pes\r\n }\r\n\r\n //riesi marginy medzi ludo divmi - obdlzniky nalavo maju mat margin right\r\n if ($(x).hasClass(\"lavo\")) {\r\n $('.lavo').each(function() {\r\n if ($(this).index() > $(x).index() &&\r\n $(this).parent().attr(\"id\") == $(x).parent().attr(\"id\")) {\r\n $(this).removeClass(\"medzeraNapravo\");\r\n }\r\n })\r\n\r\n $('.pravo').each(function() {\r\n if ($(this).index() > $(x).index() &&\r\n $(this).parent().attr(\"id\") == $(x).parent().attr(\"id\")) {\r\n $(this).addClass('medzeraNapravo');\r\n }\r\n })\r\n }\r\n}", "function realizarInversion() {\n \n rangos = rango.getRango()\n // Ya estamos haciendo una/s inversion/es\n if (realizandoInversion == true){}\n \n // Podemos realizar inversiones\n else {\n \n realizandoInversion = true\n\n // Hacemos algunas comprobaciones\n // TODO Añadir que solo cojas aquellos que tengan keys\n comprobarPreInversion(function(superanComprobaciones){\n \n console.log('Superan las comprobaciones: ', superanComprobaciones)\n \n // Obtenemos los mejores valores para invertir de cada usuario\n obtenerValoresOptimosXUsuario(superanComprobaciones,function(monedasXUsuario,mejoresValores){\n \n // Obtenemos las monedas no penalizadas de cada usuario\n obtenerNoPenalizadasXUsuario(monedasXUsuario,superanComprobaciones,function(noPenalizadasXUsuario){\n \n // Solo compraremos aquellas monedas que no tengamos\n seleccionMonedasNuevas(noPenalizadasXUsuario,superanComprobaciones,function(noCompradasXUsuario){\n \n // Filtramos por el crecimiento de la moneda en las ultimas 3horas\n filtrarCrecimienPositivo(noCompradasXUsuario,{minutos:[180],intervalos:[5]},function(primerCrecPositivo){\n \n console.log('Primer crecPositivo ' , primerCrecPositivo)\n \n // Filtramos de nuevo por el crecimiento de la moneda en los ultimos 30min\n filtrarCrecimienPositivo(primerCrecPositivo,{minutos:[30],intervalos:[5]},function(segundoCrecPositivo){\n \n console.log('Segundo crec positivo ', segundoCrecPositivo)\n\n // Calculamos la cantidad de operaciones que podemos hacer\n calcularNumeroOperaciones(segundoCrecPositivo,function(opsXUsuario,parametros){\n \n // Elegimos las monedas que vamos a comprar\n // de manera aleatoria\n elegirMonedas(segundoCrecPositivo,opsXUsuario,function(monedasElegidasXUsuario){\n \n console.log(' ')\n console.log('Preparamos compras ',monedasElegidasXUsuario)\n console.log(' ')\n \n // Preparamos las compras (precios,cantidades,moneda..etc)\n prepararCompra(monedasElegidasXUsuario,parametros,function(comprasXUsuario){\n \n // Compramos las monedas elegidas\n comprarMonedas(comprasXUsuario,function(compradas,usuariosConCompras){\n\n // Calculamos la cantidad gastada por cada usuario\n prepararActualizacionSaldo(compradas,function(gastadoXUsuario){\n\n // Actualizamos el saldo de cada usuario\n actualizarSaldo(gastadoXUsuario,function(errores,params){\n\n if (errores){console.log('Ha habido problemas a la hora de actualizar el saldo')}\n \n // Añadimos las monedas al seguimiento de compras\n crearSeguimientoCompras(compradas,params)\n\n })\n }) \n })\n })\n }) \n })\n })\n })\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n })\n })\n })\n })\n }\n}", "function dibujarFresado117(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\tEAction.handleUserMessage(\"ha entrado 11111111111111111 \");\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3]\n\t\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (var n=0; n<4 ;n=n+1){\n\t\tif (pliegueInferior<plieguesInf[n]){\n\t\t\tpliegueInferior=plieguesInf[n]\n }\n }\n\t\n\t\n\t\n\t//Puntos trayectoria \n\t\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\t\n\tvar fresado16 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior) \n\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado22 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\n\t\n\t\n\tvar fresado2 = new RVector(pos.x+alaIzquierda,pos.y)\n\t\n var line = new RLineEntity(document, new RLineData( fresado16 , fresado14 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado12 , fresado19 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado18 , fresado11 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado17 , fresado21 ));\n\top_fresado.addObject(line,false);\n\n\t\n\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1){\n\t\t//var fresado10 = new RVector(pos.x+alaIzquierda,pos.y+pliegueInferior+alaInferior) \n\t\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t//var fresado2 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\t//dibujarFresado_auxiliar(doc,fresado10,fresado1)\n var line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t op_fresado.addObject(line,false);\n\n\t\t//dibujarFresado_auxiliar(doc,fresado2,fresado11)\n }\n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)){\n\t\tvar fresado4 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n var line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t op_fresado.addObject(line,false);\n\n }\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3)){\n\t\tvar fresado6 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueDer,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n var line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t op_fresado.addObject(line,false);\n\n }\n\t\n\t\n\t\n\t\n\t\n\t//Puntos extra para esta pieza\n\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueDer,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\tvar fresado8 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueDer,pos.y+alaInferior+pliegueInferior-pliegueDer)\n var line = new RLineEntity(document, new RLineData( fresado7 , fresado8 ));\n\top_fresado.addObject(line,false);\n\n\t\n\tvar fresado9 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueDer,pos.y+alaInferior+pliegueInferior+pliegueDer)\n\tvar fresado10 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueDer,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n var line = new RLineEntity(document, new RLineData( fresado9 , fresado10 ));\n\top_fresado.addObject(line,false);\n\t\n\n var line = new RLineEntity(document, new RLineData( fresado21 , fresado10 ));\n\top_fresado.addObject(line,false);\n\t\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior)\n var line = new RLineEntity(document, new RLineData( fresado20 , fresado11 ));\n\top_fresado.addObject(line,false);\n\n\t\n\t\n\t\n\t\n\t\n\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)){\n\t\tvar fresado25 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)){\n\t\tvar fresado31 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado29 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\tvar fresado33 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }\n }\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado37 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado35 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado39 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }\n }\n\t\n\t\n\tvar fresado2 = new RVector(pos.x+alaIzquierda,pos.y)\n\tvar fresado25 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado2 , fresado25 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\t\n\n\treturn op_fresado; \n}", "function liczbaZnakow(zdanie, litera) {\n\n\n var policz = 0;\n\n for (i = 0; i < zdanie.length; i++) {\n\n if (zdanie[i] == litera) {\n policz++;\n }\n }\n return \"Litera \" + litera + \" wystepuje \" + policz + \" razy w zdaniu : \" + zdanie ;\n}", "function filtrirajSearch(vrednost) {\r\n $.ajax({\r\n url : \"assets/log/proizvodi.json\",\r\n method : \"GET\",\r\n type : \"json\",\r\n success : function(data) {\r\n let pretrazeniProizvodi = [];\r\n data.forEach(proizvod => {\r\n if(proizvod.naziv.indexOf(vrednost) == 0){\r\n pretrazeniProizvodi.push(proizvod);\r\n }\r\n });\r\n if(pretrazeniProizvodi == []){\r\n prikaziProizvode(data);\r\n }\r\n else{\r\n prikaziProizvode(pretrazeniProizvodi);\r\n }\r\n },\r\n error : function(xhr, error, status) {\r\n alert(status);\r\n }\r\n });\r\n}", "function vratiUtakmice() {\n fetch(\"http://localhost:3000/vratiBezOcene\")\n .then(response => {\n if (!response.ok)\n throw new Error(\"Greska u povezivanju! \" + response.statusText);\n else {\n return response.json();\n }\n })\n .then(data => oceniSudiju(data))\n .catch(error => console.log(\"Greska u povracaju podataka! \" + error));\n}", "function ohodnot(frm)\r\n{\r\n\t// \r\n\t// nazov class pomocou ktorej sa hladaju input elementy\r\n\tvar MOZNOST_CLASS_NAME = 'odpoved';\r\n\r\n\t//\r\n\t// nazov triedy, ktorou bude oznaceny rodicovsky element spravnej odpovede\r\n\tvar SPRAVNA_CLASS_NAME = 'spravna';\r\n\t\r\n\t//\r\n\t// nazov triedy, ktorou bude oznaceny rodicovsky element spravnej odpovede\r\n\tvar NESPRAVNA_CLASS_NAME = 'nespravna';\t\r\n\r\n\r\n\t// \r\n\t// najdi vsetky odpovede\r\n\tvar odpovede = document.getElementsByClassName( MOZNOST_CLASS_NAME, frm);\r\n\t\r\n\t//\r\n\t// ziskaj z nich unique zoznam \"name\"\r\n\tvar nazvy = Array();\r\n\todpovede.each(function (item) { \r\n\t\tnazvy.push(item.name); \r\n\t});\r\n\tnazvy = nazvy.uniq();\r\n\t\r\n\t// \r\n\t// over ci su vsetky zaskrtnute\r\n\tfor (var i=0; i<nazvy.length; i++) {\r\n\t\tvar nazov = nazvy[i];\r\n\t\t\r\n\t\t\t\t\r\n\t\t// zoznam item v nich\r\n\t\tvar moznosti = frm.getInputs('radio', nazov);\r\n\t\t\r\n\t\t// prelistuj ich a zisti ci je aspon 1 zaskrtnuty (viac nemoze byt, lebo maju rovnake meno)\r\n\t\tvar zaskrtnute = false;\r\n\t\tvar spravne_moznosti = 0;\r\n\t\tmoznosti.each(function (moznost) {\r\n\t\t\tif (moznost.checked) {\r\n\t\t\t\tzaskrtnute = true;\r\n\t\t\t}\r\n\t\t\tif (moznost.value == 1) {\t\r\n\t\t\t\tspravne_moznosti++;\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t// ak nie je zakrtnuty, tak zrus validaciu\r\n\t\tif (!zaskrtnute) {\r\n\t\t\talert('Musíte zodpovedať všetky otázky!');\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\n\t\tdocument.getElementById(nazov).style.visibility = 'visible';\r\n\t\t//\r\n\t\t// ak otazka nema ani jednu spravnu odpoved v kode, alebo ma viac moznosti\r\n\t\t// upozorni autora\r\n\t\tif (spravne_moznosti != 1) {\r\n\t\t\tif (spravne_moznosti > 1) {\r\n\t\t\t\talert('Otazka s parametrom name: '+ nazov + ' musi mat len 1 spravnu odpoved!');\r\n\t\t\t} else {\r\n\t\t\t\talert('Otazka s parametrom name: '+ nazov + ' musi mat 1 spravnu odpoved !');\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t};\r\n\t\r\n\t//\r\n\t// statistiky vyhodnocovania\r\n\tvar pocet_otazok = nazvy.length;\r\n\tvar pocet_nespravnych = 0;\r\n\tvar pocet_spravnych = 0;\r\n\t\r\n\t// \r\n\t// vyhodnot jednotlive moznosti\r\n\tnazvy.each(function (nazov) {\r\n\t\t\r\n\t\t// zoznam item v nich\r\n\t\tvar moznosti = frm.getInputs('radio', nazov);\r\n\t\t\r\n\t\t// prelistuj a ohodnot\r\n\t\tmoznosti.each(function (moznost) {\r\n\t\t\tif (moznost.checked) {\r\n\t\t\t\tif (moznost.value == 1) {\r\n\t\t\t\t\tpocet_spravnych++;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpocet_nespravnych++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\t\r\n\t// \r\n\t// zvyrazni spravne a nespravne vysledky\r\n\tnazvy.each(function (nazov) {\r\n\t\t\r\n\t\t// zoznam item v nich\r\n\t\tvar moznosti = frm.getInputs('radio', nazov);\r\n\t\t\r\n\t\t// prelistuj a ohodnot\r\n\t\tmoznosti.each(function (moznost) {\r\n\t\t\r\n\t\t\t// odstran predchadzajuce\r\n\t\t\tmoznost.parentNode.removeClassName(SPRAVNA_CLASS_NAME);\t\t\t\r\n\t\t\tmoznost.parentNode.removeClassName(NESPRAVNA_CLASS_NAME);\r\n\t\t\t\r\n\t\t\tif (moznost.checked) {\r\n\t\t\t\tif (moznost.value == 1) {\r\n\t\t\t\t\t// spravna odpoved + celkovo spravna\r\n\t\t\t\t\tmoznost.parentNode.addClassName(SPRAVNA_CLASS_NAME);\r\n\t\t\t\t\tmoznost.parentNode.parentNode.removeClassName(NESPRAVNA_CLASS_NAME);\r\n\t\t\t\t\tmoznost.parentNode.parentNode.removeClassName('otazka');\r\n\t\t\t\t\tmoznost.parentNode.parentNode.addClassName('otazka'+SPRAVNA_CLASS_NAME);\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// nespravna odpoved + celkovo nespravna\r\n\t\t\t\t\tmoznost.parentNode.addClassName(NESPRAVNA_CLASS_NAME);\r\n\t\t\t\t\tmoznost.parentNode.parentNode.removeClassName(SPRAVNA_CLASS_NAME);\r\n\t\t\t\t\tmoznost.parentNode.parentNode.removeClassName('otazka');\r\n\t\t\t\t\tmoznost.parentNode.parentNode.addClassName('otazka'+NESPRAVNA_CLASS_NAME);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (moznost.value == 1) {\r\n\t\t\t\t\t// spravna odpoved\r\n\t\t\t\t\tmoznost.parentNode.addClassName(SPRAVNA_CLASS_NAME);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\t\r\n\t//\r\n\t// zobraz vysledok za pomoci alert\r\n\tif (pocet_otazok == pocet_spravnych) {\r\n\t\talert('Gratulujem !!!, zodpovedali ste všetky otázky správne!');\r\n\t} else {\r\n\t\talert('Zodpovedali ste správne ' + pocet_spravnych + ' otázok z ' + pocet_otazok + ' možných.');\r\n\t}\r\n\t\r\n\t// \r\n\t// allways return false - do not redirect\r\n\treturn false;\r\n}", "function vietuSukeitimas (i, j) {\n if (i >= 0 && j >= 0 && i !== j){\n var x = prekiautojai[i];\n prekiautojai[i] = prekiautojai[j];\n prekiautojai[j] = x;\n console.log(prekiautojai);\n } else {\n return \"Iveskite 0, teigiama reiksme ir skirtingas reiksmes\"\n }\n}", "function sakrij(){\n\tskriveno= window.setTimeout(zatvoriPodmeni, vrijeme);\n}", "function Nevis() {}", "function Nevis() {}", "function Nevis() {}", "function sveikinuosi( funkcijosPavadinimas ){\n console.log(\"Labutaitis\");\n if (funkcijosPavadinimas != null && funkcijosPavadinimas != undefined) {\n funkcijosPavadinimas();\n }\n}", "function hitungLuasPersegiPanjang (panjang,lebar){\n //tidak ada nilai balik\n var luas = panjang * lebar\n return luas\n}", "function hitungLuasSegiEmpat(sisi){\n //tidak ada nilai balik\n var luas = sisi * sisi\n return luas\n}", "function pos_pianeti(njd,np){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) novembre 2010\n // calcola la posizione dei pianeti \n // njd= numero del giorno giuliano della data in T.U.\n // np= numero identificativo del pianeta 0,1,2,3,4,5,6,7,8 mercurio,venere... 2 per la Terra\n // coordinate geocentriche del pianeta riferite all'equinozio della data (njd).\n // calcola le principali perturbazioni planetarie.\n\n // new Array(Periodo , Long_media , Anomalia_media , Long_perielio , eccentr , Semiasse , Inclinazione , Long_nodo , dim_ang , magnitudine);\n // 0 1 2 3 4 5 6 7 8 9\n\n var tempo_luce=t_luce(njd,np);\n \n njd=njd-tempo_luce; // correzione per il tempo luce.\n\n var el_orb=orb_plan(njd,np); // recupera gli elementi orbitali del pianeta.\n\n var periodo= el_orb[0]; // periodo.\n var L= el_orb[1]; // longitudine media all'epoca.\n var AM_media= el_orb[2]; // anomalia media. \n var long_peri= el_orb[3]; // longitudine del perielio.\n var eccent= el_orb[4]; // eccentricità dell'orbita.\n var semiasse= el_orb[5]; // semiasse maggiore.\n var inclinaz= el_orb[6]; // inclinazione.\n var long_nodo= el_orb[7]; // longitudine del nodo.\n var dimens= el_orb[8]; // dimensioni apparenti.\n var magn= el_orb[9]; // magnitudine.\n\n \n var correzioni_orb=pos_pianeticr(njd,np); // calcolo delle correzioni per il pianeta (np).\n \n// Array(Delta_LP , Delta_R , Delta_LL , Delta_AS , Delta_EC , Delta_MM , Delta_LAT_ELIO);\n// 0 1 2 3 4 5 6 \n// lperiodo, rvett long. assemagg ecc M lat\n\n// CORREZIONI \n\n L=L+correzioni_orb[0]; // longitudine media.\n AM_media= AM_media+correzioni_orb[5]; // anomalia media + correzioni..\n semiasse= semiasse+correzioni_orb[3]; // semiasse maggiore.\n eccent= eccent+correzioni_orb[4]; // eccentricità.\n\n // LONGITUDINE ELIOCENTRICA DEL PIANETA ***************************************************** inizio:\n\n var M=AM_media; // anomalia media \n \n M=gradi_360(M); // intervallo 0-360;\n\n var E=eq_keplero(M,eccent); // equazione di Keplero.E[0]=Anomalia eccentrica E[1]=Anomalia vera in radianti.\n \n var rv=semiasse*(1-eccent*Math.cos(E[0])); // calcolo del raggio vettore (distanza dal Sole).\n rv=rv+correzioni_orb[1]; // raggio vettore più correzione.\n\n\n var U=gradi_360(L+Rda(E[1])-M-long_nodo); // argomento della latitudine.\n\n var long_eccliticay=Math.cos(Rad(inclinaz))*Math.sin(Rad(U));\n var long_eccliticax=Math.cos(Rad(U));\n\n var long_ecclitica=quadrante(long_eccliticay,long_eccliticax)+long_nodo;\n var l=gradi_360(long_ecclitica);\n l=l+correzioni_orb[2]; // longitudine del pianeta + correzione.\n\n // LONGITUDINE ELIOCENTRICA DEL PIANETA ********************************************************* fine: \n\n var b=Rda(Math.asin(Math.sin(Rad(U))*Math.sin(Rad(inclinaz)))); // latitudine ecclittica in gradi (b)\n\n // LONGITUDINE E RAGGIO VETTORE DEL SOLE *** inizio:\n\n njd=njd+tempo_luce; \n\n var eff_sole=pos_sole(njd);\n var LS=eff_sole[2]; // longitudine geocentrica del Sole.\n var RS=eff_sole[4]; // raggio vettore.\n \n // LONGITUDINE E RAGGIO VETTORE DEL SOLE *** fine: \n\n // longitudine geocentrica.\n\n var Y=rv*Math.cos(Rad(b))*Math.sin(Rad(l-LS));\n var X=rv*Math.cos(Rad(b))*Math.cos(Rad(l-LS))+RS;\n\n var long_geo=gradi_360(quadrante(Y,X)+LS); // longitudine geocentrica.\n\n var dist_p=Y*Y+X*X+(rv*Math.sin(Rad(b)))*(rv*Math.sin(Rad(b))); \n dist_p=Math.sqrt(dist_p); // distanza del pianeta dalla Terra.\n\n var beta=(rv/dist_p)*Math.sin(Rad(b));\n var lat_geo=Rda(Math.asin(beta));\n lat_geo=lat_geo+correzioni_orb[6]; // latitudine + correzione.\n\n \n// fase del pianeta.\n\nvar fase=0.5*(1+Math.cos(Rad(long_geo-long_ecclitica)));\n fase=fase.toFixed(2);\n\n// parallasse del pianeta in gradi.\n\nvar pa=(8.794/dist_p)/3600;\n\nvar coo_pl=trasf_ecli_equa(njd,long_geo,lat_geo); // coordinate equatoriali. \n\n // diametro apparente in secondi d'arco.\n\nvar diam_app=dimens/dist_p; \n\n// magnitudine del pianeta.\n\nvar magnitudine=(5*(Math.log(rv*dist_p/(magn*Math.sqrt(fase))))/2.302580)-27.7;\n magnitudine=magnitudine.toFixed(1);\n\nif (magnitudine==Infinity) {magnitudine=\"nd\"; }\n\nvar elongaz=elong(coo_pl[0],coo_pl[1],eff_sole[0],eff_sole[1]); // elongazione in gradi dal Sole.\n \n // calcolo dell'angolo di fase in gradi . \n\n var Dpt= dist_p; // distanza pianeta-terra.\n var Dts= RS; // distanza terra-sole.\n var Dps= rv; // distanza pianeta-sole.\n\n // teorema del coseno\n\n var delta_fase=(Dts*Dts+Dps*Dps-Dpt*Dpt)/(2*Dps*Dts);\n delta_fase=Math.acos(delta_fase); \n delta_fase=Rda(delta_fase);\n\n var angolo_fase=180-Math.abs(elongaz)-delta_fase; // angolo di fase in gradi.\n \nvar dati_pp= new Array(coo_pl[0],coo_pl[1],fase,magnitudine,dist_p,diam_app,elongaz,LS,RS,long_ecclitica,pa,rv,angolo_fase);\n// 0 1 2 3 4 5 6 7 8 9 10 11 12 \n\n\n\n// risultati: ARetta,Declinazione,fase,magnitudine,distanza pianeta,diametro apparente, elongazione, long. sole,raggio vettore Terra, longituddine elio. pianeta, parallase,dist sole-pianeta. \n\nreturn dati_pp;\n}", "function dvakrat(cislo) {\r\n return cislo * 2;\r\n}", "function upisNajaFunc()\n{\n\t/* ako je br bacanja veci od 1, nije najavljeno nedozvoljen upis */\n\tif (brojBacanja > 1 && indNajave < 1)\n\t{\n\t\talert(\"Niste najavili!\");\n\t\treturn;\n\t}\n\t/* u suprotnom u prvom smo bacanju i zelimo da najavimo */\n\telse if (brojBacanja == 1 && indNajave < 1)\n\t{\n\t\tindNajave = Number(this.id.slice(1, ));\n\n\t\t/* manipulate css for different background color */\n\t\tvar elm = document.getElementById(this.id);\n\t\telm.className = (elm.className == \"najaKlik\") ? \"polje naja\" : \"najaKlik\";\n\t\treturn;\n\t}\n\telse if (brojBacanja === 0)\n\t\treturn;\n\n\t/* get the value of the field clicked */\n\tvar vred = Number(this.id.slice(1, ));\n\n\t/* if not equal, user did not announce that field */\n\tif (vred != indNajave)\n\t{\n\t\talert(\"Niste TO najavili!\");\n\t\treturn; \n\t}\n\t\n\n\t///* see if the previous field is not -1 */\n\t///* else disable writting to preserve order */\n\t//if(vred < 12 && kNaja[vred] < 0)\n\t//{\n\t//\talert(\"Nedozvoljen upis!\");\n\t//\treturn;\n\t//}\n\t\n\t/* did we already write into this field */\n\tif(kNaja[vred-1] >= 0)\n\t{\n\t\talert(\"Vec ste upisali u ovo polje!\");\n\t\treturn;\n\t}\n\n\tvar tmp = 0;\n\tvar tmpNiz = [];\n\n\t/* splice izabraneKockice and baceneKockice */\n\tfor(var i=0; i<5; ++i)\n\t{\n\t\tif (Number(izabraneKockice[i].innerText))\n\t\t\ttmpNiz.push(Number(izabraneKockice[i].innerText));\n\t}\n\n\tfor(var i=0; i<5; ++i)\n\t{\n\t\tif (Number(baceneKockice[i].innerText))\n\t\t\ttmpNiz.push(Number(baceneKockice[i].innerText));\n\t}\n\n\tif(tmpNiz.length != 5)\n\t\talert(\"Niz nije 5! vec: \" + tmpNiz.length);\n\n\t/* decide which field was clicked: broj, maxmin ili igra */\n\tswitch(vred)\n\t{\n\t\tcase 1:\n\t\tcase 2:\n\t\tcase 3:\n\t\tcase 4:\n\t\tcase 5:\n\t\tcase 6:\n\t\t\tfor(var i=0; i<5; ++i)\n\t\t\t{\n\t\t\t\tif(tmpNiz[i] == vred)\n\t\t\t\t\ttmp += tmpNiz[i]\n\t\t\t}\n\t\t\tkNaja[vred-1] = tmp;\n\t\t\tsumaKolFunc(kNaja, \"suma4\");\n\t\t\tsumaRazFunc(kNaja, \"suma8\")\n\t\t\tbreak;\n\t\tcase 7:\n\t\tcase 8:\n\t\t\ttmp = zbir(tmpNiz);\n\t\t\tkNaja[vred-1] = tmp;\n\t\t\t/* suma8 */\n\t\t\tsumaRazFunc(kNaja, \"suma8\")\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\ttmp = jelFul(tmpNiz);\n\t\t\tkNaja[vred-1] = tmp;\n\t\t\tsumaIgFunc(kNaja, \"suma12\");\n\t\t\tbreak;\n\t\tcase 10:\n\t\t\ttmp = jelPoker(tmpNiz);\n\t\t\tkNaja[vred-1] = tmp;\n\t\t\tsumaIgFunc(kNaja, \"suma12\");\n\t\t\tbreak;\n\t\tcase 11:\n\t\t\ttmp = jelKenta(tmpNiz);\n\t\t\tkNaja[vred-1] = tmp;\n\t\t\tsumaIgFunc(kNaja, \"suma12\");\n\t\t\tbreak;\n\t\tcase 12:\n\t\t\ttmp = jelYamb(tmpNiz);\n\t\t\tkNaja[vred-1] = tmp;\n\t\t\tsumaIgFunc(kNaja, \"suma12\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\n\t/* write number of vred thrown */\n\tdocument.getElementById(this.id).innerText=Number(tmp);\n\n\t/* manipulate css for different background color */\n\tvar elm = document.getElementById(this.id);\n\telm.className = (elm.className == \"najaKlik\") ? \"polje naja\" : \"najaKlik\";\n\tindNajave = 0;\n\tresetuj(izabraneKockice, baceneKockice);\n\n}", "function dibujarFresado115(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3, pliegueInf4]\n\t\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (n=1 ; n<4 ; n=n+1){\n\t\tif (pliegueInferior<plieguesInf[n]) {\n\t\t\tpliegueInferior=plieguesInf[n]\n\t\t}\n\t}\n\t\n\t\n\t\n\t//Puntos trayectoria\t\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior)\n\t\n\tvar fresado16 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior) \n\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado22 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado2 = new RVector(pos.x+alaIzquierda,pos.y)\n\t\n\t\n\tvar line = new RLineEntity(document, new RLineData( fresado16 , fresado14 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado20 , fresado13 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado12 , fresado19 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado18 , fresado11 ));\n\top_fresado.addObject(line,false);\n\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado21 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1) {\n\t\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)) {\n\t\tvar fresado4 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t\top_fresado.addObject(line,false);\n\t}\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3*2)) {\n\t\tvar fresado6 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t//anchura4 - Inferior\n\tif (anchura4>pliegueInf4) {\n\t\tvar fresado8 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar fresado9 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t\n\t\n\n\t\n\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)) {\n\t\tvar fresado25 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) { //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)) {\n\t\tvar fresado31 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado29 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\tvar fresado33 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2) {\n\t\tvar fresado37 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado35 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\tvar fresado39 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior) {\n\t\tvar fresado43 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado44 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado41 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado42 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\tvar fresado2 = new RVector(pos.x+alaIzquierda,pos.y)\n\tvar fresado25 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado25 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\treturn op_fresado; \n}", "function otvaranje(nivo) {\r\n otvoreneKartice.push(izabrano);\r\n //aktiviranje tajmera klikom na prvu karticu:\r\n let duzina = otvoreneKartice.length;\r\n if (duzina === 1) {\r\n timer();\r\n };\r\n //broj razlicitih kartica u zavisnosti od nivoa:\r\n let brojRazlicitihKartica;\r\n if (nivo === 'easy') {\r\n brojRazlicitihKartica = easy_razliciteKartice;\r\n\r\n } else if (nivo === 'medium') {\r\n brojRazlicitihKartica = medium_razliciteKartice;\r\n \r\n } else {\r\n brojRazlicitihKartica = hard_razliciteKartice;\r\n }\r\n //kad se upare sve kartice pozivanje modala:\r\n if (upareneKartice.length == brojRazlicitihKartica) {\r\n clearInterval(interval);\r\n setTimeout(() => cestitamo(nivo), 1500);\r\n };\r\n}", "function graczOberwal() {\r\n\r\n\t\t\t\t//zabieranie rebulla:\r\n\t\t\t\tif (DD_predkoscPocztkowaGracza >= 250) {\r\n\t\t\t\t\tDD_predkoscPocztkowaGracza -= 125;\r\n\t\t\t\t\tgracz.twoway(DD_predkoscPocztkowaGracza); //redukuj predkosc gracza\r\n\t\t\t\t\tDD_obrazeniaPocikskowGracz -= 0.05; //zredukuj obrazenia zadawane przez pociski gracza\r\n\r\n\t\t\t\t\t//dodaj napis o redukcji rebulla:\r\n\t\t\t\t\tvar bonusTekst = Crafty.e(\"2D, Canvas, Text, Delay, Motion\")\r\n\t\t\t\t\t\t.attr({ x: gracz.x - 25, y: gracz.y, z: 98 })\r\n\t\t\t\t\t\t.text('- REBULL')\r\n\t\t\t\t\t\t.textColor('gray')\r\n\t\t\t\t\t\t.textFont({ size: '15px', weight: 'bold' })\r\n\t\t\t\t\t\t.bind('EnterFrame', function (e) {\r\n\t\t\t\t\t\t\tthis.alpha -= 0.01;\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\t.delay(function () {\r\n\t\t\t\t\t\t\tthis.destroy();\r\n\t\t\t\t\t\t}, 1500, 0)\r\n\t\t\t\t\t\t;\r\n\t\t\t\t\tbonusTekst.velocity().y = -50;\r\n\r\n\t\t\t\t}\r\n\t\t\t\tif (DD_buforStrzalu <= 5) {\r\n\t\t\t\t\tDD_buforStrzalu += 1; //redukuj szybkosztrzelnosc\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//czerwona maska przy oberwaniu od przeciwnika:\r\n\t\t\t\tvar boli = Crafty.e('2D, Canvas, Image, Renderable, Delay')\r\n\t\t\t\t\t.attr({ x: 0, y: 0, w: 500, h: 300 })\r\n\t\t\t\t\t.image(\"assets/obrazki/ouch2.png\", \"no-repeat\")\r\n\t\t\t\t\t.delay(function () {\r\n\t\t\t\t\t\tthis.destroy();\r\n\t\t\t\t\t}, 150, 0)\r\n\t\t\t\t\t;\r\n\t\t\t\t// intensywnosc maski zalezy od ilosci pozostalego zycia:\r\n\t\t\t\tboli.alpha = (1 / gracz.zycie) * DD_fala;\r\n\t\t\t\treturn;\r\n\t\t\t}", "function zmien_ocene(ruch_t)\n{\n let nr_bierki_p = szachownica.pola[ruch_t.wiersz_p][ruch_t.kolumna_p];\n let nr_bierki_k = szachownica.pola[ruch_t.wiersz_k][ruch_t.kolumna_k];\n\n if(nr_bierki_k !== 0)\n zmien_ocene_usun(ruch_t.wiersz_k, ruch_t.kolumna_k);\n\n szachownica.ocena.tablice += wartosc_tabela(ruch_t.wiersz_k, ruch_t.kolumna_k, nr_bierki_p) - wartosc_tabela(ruch_t.wiersz_p, ruch_t.kolumna_p, nr_bierki_p);\n szachownica.ocena.tablice_koncowka += wartosc_tabela_konc(ruch_t.wiersz_k, ruch_t.kolumna_k, nr_bierki_p) - wartosc_tabela_konc(ruch_t.wiersz_p, ruch_t.kolumna_p, nr_bierki_p);\n}", "function dibujarFresado118(modelo,di,pos,document){\n\t\n\t\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3, pliegueInf4, pliegueInf5]\n\tEAction.handleUserMessage(\"ha entrado 11111111111111111 \");\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (n=0;n<5;n=n+1){ \n\t\tif (pliegueInferior<plieguesInf[n]){\n\t\t\tpliegueInferior=plieguesInf[n]\n\t\t}\n\t}\n\t\n\t\n\t\n\t//Puntos trayectoria \n\t\n\t\n\tvar fresado11 = new RVector(pos.x-anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x-anchura1-anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x-anchura1-anchura2-anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4,pos.y+alaInferior+pliegueInferior)\n\tvar fresado15 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior) //nuevo\n\t\n\t\n\t\n\tvar fresado16 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior) \n\tvar fresado17 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x-anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x-anchura1-anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x-anchura1-anchura2-anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado22 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior+alturaPlaca) //muevo\n\t\n\tvar fresado23 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\n\t\n\t\n\t\n\t\n\tif (anchura5>pliegueInf5){ \n\t\tvar fresado14b = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior-pliegueInf5-alaInferior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado14b , fresado23 ));\n\t\top_fresado.addObject(line,false);\n\n\t}else{\n\t\tvar line = new RLineEntity(document, new RLineData( fresado15 , fresado23 ));\n\t\top_fresado.addObject(line,false);\n\t}\n\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado16 , fresado15 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado15 , fresado22 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado13 , fresado20 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado12 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado22 ));\n\t\top_fresado.addObject(line,false);\n\n\t\n\t\n\t\n\tEAction.handleUserMessage(\"ha entrado 44444444444444444444444444 \");\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1){\n\t\t//var fresado10 = new RVector(pos.x,pos.y+pliegueInferior+alaInferior) \n\t\tvar fresado1 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t//var fresado2 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x-anchura1+pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\t//dibujarFresado_auxiliar(doc,fresado10,fresado1)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t//dibujarFresado_auxiliar(doc,fresado2,fresado11)\n\t}\n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)){ \n\t\tvar fresado4 = new RVector(pos.x-anchura1-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x-anchura1-anchura2+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t\top_fresado.addObject(line,false);\n\n\t}\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3*2)){ \n\t\tvar fresado6 = new RVector(pos.x-anchura1-anchura2-pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x-anchura1-anchura2-anchura3+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t//anchura4 - Inferior\n\tif (anchura4>(pliegueInf4*2)){ \n\t\tvar fresado8 = new RVector(pos.x-anchura1-anchura2-anchura3-pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar fresado9 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4+pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t} \n\n\t//anchura4 - Inferior\n\tif (anchura5>pliegueInf5){ \n\t\tvar fresado10 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-pliegueInf5,pos.y+alaInferior+pliegueInferior-pliegueInf5)\n\t\tvar fresado11 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior-pliegueInf5)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado10 , fresado11 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t} \n\t\n\t\n\t\n\n\tEAction.handleUserMessage(\"ha entrado 555555555555555555555555555555555555555555555555 \");\n\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)){ \n\t\tvar fresado25 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x-anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado27 = new RVector(pos.x-anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x-anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)){ \n\t\tvar fresado31 = new RVector(pos.x-anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x-anchura1-anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado29 = new RVector(pos.x-anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x-anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado33 = new RVector(pos.x-anchura1-anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x-anchura1-anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado37 = new RVector(pos.x-anchura1-anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x-anchura1-anchura2-anchura3+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado35 = new RVector(pos.x-anchura1-anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x-anchura1-anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado39 = new RVector(pos.x-anchura1-anchura2-anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x-anchura1-anchura2-anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior*2){ \n\t\tvar fresado43 = new RVector(pos.x-anchura1-anchura2-anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado44 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado41 = new RVector(pos.x-anchura1-anchura2-anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado42 = new RVector(pos.x-anchura1-anchura2-anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado45 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado46 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado45 , fresado46 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura5 - Superior\n\tif (anchura5>pliegueSuperior){ \n\t\tvar fresado49 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado50 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado49 , fresado50 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado47 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado48 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado47 , fresado48 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t\n\treturn op_fresado;\n\t\n\t\n\t\n\t\n\t\n}", "function hitungLuasPersegi(sisi) {\n var luas = sisi * sisi;\n return luas;\n}", "function jeden() {\n\n //deklaracja zmiennej zmienna1 - zmienna lokalna dla funkcji jeden\n var zmienna1 = 1;\n\n //Deklaracja funkcji dwa we wnętrzu funkcji jeden. stworzenie nowego zakresu dla funkcji dwa\n function dwa() {\n\n //wypisanie do konsoli zawartości zmiennej jeden - jest to zmienna dostępne z poziomu funkcji dwa\n console.log(zmienna1);\n\n //deklaracja zmienna2 jako zmiennej lokalnej dla zakresu dwa\n var zmienna2 = 3;\n }\n\n //wywołanie funkcji dwa w ramach wykonywania funkcji jeden\n dwa();\n\n //wypisanie do do konsoli zawartosci zmiennej2 - niedostępnej z poziomu funkcji jeden ponieważ jest zadeklarowana jako zmienna lokalna dla funkcji dwa\n console.log(zmienna2)\n}", "function visUre() {\n container.textContent = \"\";\n alleUre.forEach((ur) => {\n if (filter == ur.Farve || filter == \"alle\") {\n let klon = temp.cloneNode(true).content;\n klon.querySelector(\"img\").src = \"images/\" + ur.Billede + \".webp\";\n klon.querySelector(\".navn\").textContent = ur.Navn;\n klon.querySelector(\".farve\").textContent = ur.Farve;\n klon.querySelector(\".pris\").textContent = ur.Pris + \",-\";\n klon.querySelector(\"article\").addEventListener(\"click\", () => {\n location.href = \"produkter_detaljer.html?id=\" + ur._id;\n });\n\n container.appendChild(klon);\n }\n });\n}", "function wyzerujOdp() {\n for (var i = 0; i < liczbapytan; i++) {\n odpUzytkownika[i] = \"\";\n czyOdpowiedziano[i] = false;\n }\n}", "movimientochamp()\n {\n \n if(this.disminuyendoVelocidad && this.speed > -this.limitspeed){\n this.speed -= this.aceleracion; //Disminuye Vel\n this.disminuyendoVelocidad = false;\n }\n\n if(this.aumentandoVelocidad){\n this.speed += this.aceleracion; //Aumenta vel.\n this.aumentandoVelocidad = false;\n }\n this.moverse();\n }", "function dibujarPuntoLienzoRutas(lon,lat,id){\r\n limpiarCapaNuevaRuta();\r\n var marca = new Array();\r\n var punto = new OpenLayers.Geometry.Point(lon,lat);\r\n punto.transform( new OpenLayers.Projection( \"EPSG:4326\" ),\r\n new OpenLayers.Projection( \"EPSG:900913\" ) );\r\n \r\n var puntoParada = new OpenLayers.Feature.Vector( punto, {\r\n id : ''+id\r\n });\r\n puntoParada.id = id;\r\n marca.push(puntoParada);\r\n lienzoRutas.addFeatures(marca);\r\n}", "getKandidatiByOglasPrijava(id) {\n return this.http.get(this.oglasPath + '/' + id + '/kandidati');\n }", "function PrzedmiotKsztalceniaSzczegoly(PrzedmiotyKsztalceniaService, ZajeciaService, $stateParams, $state) {\n\t\t\t/*jshint validthis: true */\n this.przedmiot = {nazwaPrzedmiotu: undefined, opiekunPrzedmiotu: undefined };\n var vm = this;\n var id = $stateParams.id;\n vm.id = id;\n\n vm.load = function() {\n if (id.match(/^\\d+$/)) {\n PrzedmiotyKsztalceniaService.get({id: id}).$promise.then(function(response) {\n vm.przedmiot = {\n id: response.id,\n nazwaPrzedmiotu: response.nazwaPrzedmiotu,\n opiekunPrzedmiotu: response.opiekunPrzedmiotu.email,\n kodyZajec: _.map(\n _.filter(response.zajecia, function(z) {return z.kodZajec != null}),\n function(zajecie) {\n return zajecie.kodZajec\n }).join(', ')\n };\n }, function(reason) {\n console.log(\"fail get(1)\");\n vm.error = 'global_problem_server';\n });\n\n ZajeciaService.getKursy(id).then(function(response) {\n console.log(\"kursy = \", response);\n vm.kursy = response;\n }, function(reason) {\n console.log(\"Blad = \", reason);\n vm.error_kursy = 'global_problem_server';\n });\n\n ZajeciaService.getGrupaKursow(id).then(function(response) {\n console.log(\"grupa kursow = \", response);\n vm.grupaKursow = response;\n }, function(reason) {\n console.log(\"blad = \", reason);\n vm.error_grupa = 'global_problem_server';\n vm.grupaKursow = undefined;\n });\n }\n };\n\n\n vm.selectKurs = function(kurs) {\n vm.selectedKurs = kurs;\n };\n\n vm.deleteKurs = function(id) {\n // TODO Modal\n console.log('usun zajecie = ', id);\n ZajeciaService.deleteZajecie(id).then(function(response) {\n console.log('Usunieto zajecia');\n vm.load();\n }, function (reason) {\n console.log('Blad = ', reason);\n });\n };\n\n vm.deleteGrupa = function(id) {\n vm.deleteKurs(id);\n };\n\n this.selectPrzedmiot = function(przedmiot) {\n vm.selectedPrzedmiot = przedmiot;\n };\n\n this.deletePrzedmiot = function(id) {\n PrzedmiotyKsztalceniaService.delete({id: id}).$promise.then(function (response) {\n console.log('usunieto');\n $state.go('przedmioty-ksztalcenia');\n }, function (reason) {\n console.log('problem = ', reason);\n });\n };\n\n vm.load();\n\n }", "actualiser(jeu)\n\t{\n\t\t//Actualise le dessin du plateau de jeu\n\t\tjeu.dessiner(this._context);\n\n\t\t//Actualise les informations de partie\n\t\tthis.actualiserNiveau(jeu.getNiveau());\n\t\tthis.actualiserScore(jeu.getScore());\n\t\tthis.actualiserPointsDeVie(jeu.getPointsDeVie());\n\t\tthis.actualiserMunitions(jeu.getNombreMunitions());\n\t\tthis.actualiserBouclier(jeu.getShield());\n\t\tthis.actualiserHigh_score();\n\t}", "function muuta_joukkueen_muokkaukseksi(e) {\n\t// Otetaan talteen ketä klikattiin ja etsitään data.joukkueet -rakenteesta oikea joukkue.\n\tlet joukkue = e.target;\n\tli_edit = joukkue;\n\tlet oik_data;\n\tfor (let i = 0; i < data.joukkueet.length; i++) {\n\t\tif (data.joukkueet[i].nimi === joukkue.textContent) {\n\t\t\toik_data = i; break;\n\t\t}\n\t}\n\t\n\tjoukkue_edit = oik_data;\n\t\n\t//Asetetaan joukkuelomakkeeseen nimi ja aika oikein.\n\tdocument.getElementById(\"jNimi\").value = data.joukkueet[oik_data].nimi;\n\tdocument.getElementById(\"luontiAika\").value = data.joukkueet[oik_data].luontiaika.replace(\" \",\"T\").substring(0,16);\n\t// Asetetaan joukkueen leimaukset\n\tfor (let i = 0; i < leimaus.length; i++) {\n\t\tlet loytyi = false;\n\t\tfor (let j = 0; j < data.joukkueet[oik_data].leimaustapa.length; j++) {\n\t\t\tif (leimaus[i].getAttribute(\"value\") === data.joukkueet[oik_data].leimaustapa[j]) {\n\t\t\t\tloytyi = true;\n\t\t\t}\n\t\t}\n\t\tif (loytyi)\n\t\t\tleimaus[i].checked = true;\n\t\telse\n\t\t\tleimaus[i].checked = false;\n\t}\n\t// Jos sarjoja on enintään 4 niin sarja-input on radio-nappeina, jolloin joudutaan looppaamaan ne läpi\n\tif (data.sarjat.length <= 4) {\n\t\tfor (let i = 0; i < sarja.length; i++) {\n\t\t\tif (parseInt(sarja[i].getAttribute(\"value\")) === parseInt(data.joukkueet[oik_data].sarja))\n\t\t\t\tsarja[i].checked = true;\n\t\t\telse\n\t\t\t\tsarja[i].checked = false;\n\t\t}\n\t} else { // Kun sarjoja on enemmän kuin 4 niin voidaan asettaa select elementille value.\n\t\tsarja.value = data.joukkueet[oik_data].sarja;\n\t}\n\t// Haetaan jäsenten tiedot ja varmistetaan vielä ettei lisäillä enempää jäseniä kuin on tarkoitus.\n\tfor (let i = 0; i < data.joukkueet[oik_data].jasenet.length; i++) {\n\t\tif (i < jasenet.length)\n\t\t\tjasenet[i].value = data.joukkueet[oik_data].jasenet[i];\n\t}\n\t\n\t// Tyhjennetään leimattujen rastien taulu ja lisätään sinne yksi uusi tyhjä rivi, jotta käyttäjä voi luoda taas uuden joukkueen uusilla rastitiedoilla\n\tlet taulu = document.getElementById(\"rastitaulu\");\n\twhile(taulu.firstChild) {\n\t\ttaulu.removeChild(taulu.firstChild);\n\t}\n\t\n\t// Taulun tyhjennys poisti otsikotkin, joten luodaan ne takaisin.\n\tlet tr = document.createElement(\"tr\");\n\tlet th = document.createElement(\"th\");\n\tth.textContent = \"Rasti\";\n\ttr.appendChild(th);\n\tth = document.createElement(\"th\");\n\tth.textContent = \"Aika\";\n\ttr.appendChild(th);\n\tth = document.createElement(\"th\");\n\tth.textContent = \"Poista\";\n\ttr.appendChild(th);\n\ttaulu.appendChild(tr);\n\t// Lisätään esitäytettyjä rivejä joukkueen rasteista.\n\tfor (let i = 0; i < data.joukkueet[oik_data].rastit.length; i++) {\n\t\tsyota_rasti_rivi(data.joukkueet[oik_data].rastit[i].id,data.joukkueet[oik_data].rastit[i].aika);\n\t}\n\t// Lisätään vielä tyhjä rivi jotta käyttäjä voi lisätä itse rasteja lisää.\n\tlisaa_rasti_rivi();\n}", "function upisSlobFunc()\n{\n\n\tif (brojBacanja === 0)\n\t\treturn;\n\n\tif (indNajave > 0)\n\t{\n\t\talert(\"Igrali ste najavu!\")\n\t\treturn;\n\t}\n\n\t/* get the value of the field clicked */\n\tvar vred = Number(this.id.slice(1, ));\n\n\t///* see if the previous field is not -1 */\n\t///* else disable writting to preserve order */\n\t//if(vred > 1 && kDole[vred-2] < 0)\n\t//{\n\t//\talert(\"Nedozvoljen upis!\");\n\t//\treturn;\n\t//}\n\t\n\t/* did we already write into this field */\n\tif(kSlob[vred-1] >= 0)\n\t{\n\t\talert(\"Vec ste upisali u ovo polje!\");\n\t\treturn;\n\t}\n\n\tvar tmp = 0;\n\tvar tmpNiz = [];\n\n\t/* splice izabraneKockice and baceneKockice */\n\tfor(var i=0; i<5; ++i)\n\t{\n\t\tif (Number(izabraneKockice[i].innerText))\n\t\t\ttmpNiz.push(Number(izabraneKockice[i].innerText));\n\t}\n\n\tfor(var i=0; i<5; ++i)\n\t{\n\t\tif (Number(baceneKockice[i].innerText))\n\t\t\ttmpNiz.push(Number(baceneKockice[i].innerText));\n\t}\n\n\tif(tmpNiz.length != 5)\n\t\talert(\"Niz nije 5! vec: \" + tmpNiz.length);\n\n\t/* decide which field was clicked: broj, maxmin ili igra */\n\tswitch(vred)\n\t{\n\t\tcase 1:\n\t\tcase 2:\n\t\tcase 3:\n\t\tcase 4:\n\t\tcase 5:\n\t\tcase 6:\n\t\t\tfor(var i=0; i<5; ++i)\n\t\t\t{\n\t\t\t\tif(tmpNiz[i] == vred)\n\t\t\t\t\ttmp += tmpNiz[i]\n\t\t\t}\n\t\t\tkSlob[vred-1] = tmp;\n\t\t\tsumaKolFunc(kSlob, \"suma2\");\n\t\t\tsumaRazFunc(kSlob, \"suma6\")\n\t\t\tbreak;\n\t\tcase 7:\n\t\tcase 8:\n\t\t\ttmp = zbir(tmpNiz);\n\t\t\tkSlob[vred-1] = tmp;\n\t\t\tsumaRazFunc(kSlob, \"suma6\")\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\ttmp = jelFul(tmpNiz);\n\t\t\tkSlob[vred-1] = tmp;\n\t\t\tsumaIgFunc(kSlob, \"suma10\");\n\t\t\tbreak;\n\t\tcase 10:\n\t\t\ttmp = jelPoker(tmpNiz);\n\t\t\tkSlob[vred-1] = tmp;\n\t\t\tsumaIgFunc(kSlob, \"suma10\");\n\t\t\tbreak;\n\t\tcase 11:\n\t\t\ttmp = jelKenta(tmpNiz);\n\t\t\tkSlob[vred-1] = tmp;\n\t\t\tsumaIgFunc(kSlob, \"suma10\");\n\t\t\tbreak;\n\t\tcase 12:\n\t\t\ttmp = jelYamb(tmpNiz);\n\t\t\tkSlob[vred-1] = tmp;\n\t\t\tsumaIgFunc(kSlob, \"suma10\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\n\t/* write number of vred thrown */\n\tdocument.getElementById(this.id).innerText=Number(tmp);\n\n\tresetuj(izabraneKockice, baceneKockice);\n}", "function sukeistiMasayvoElementus(nr1, nr2) {\nlet y = prekiautojai[nr1];\nprekiautojai[nr1] = prekiautojai[nr2];\nprekiautojai[nr2] = y;\n\n}", "function verifMangerPomme() {\n if (xPomme == xSerp && yPomme == ySerp) {\n initPositionPomme();\n tempsPomme = 0;\n score += 10 + 3*bodySerp.length;\n niveau += Math.trunc(score/300);\n tailleBody +=5;\n afficheScore();\n }else if (tempsPomme++ > tempsMaxPomme) {\n initPositionPomme();\n tempsPomme = 0;\n }\n }", "function fl_outToRimon ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t\n\t\t}}", "function avancer_polygone() {\n\n\tfor (var p = 0; p<18; p++) {\n\n\t\tpolygone[p][1] = polygone[p][1] + vitesse_ver_route;\t\t/* on fait avancer le point verticalement */\n\n\t\tif (polygone[p][1] > 100) {\t\t\t\t/* test : si le point est sorti en bas de l'écran, on le redessine en haut */\n\t\t\tvitesse_lat_route = vitesse_lat_route + Math.floor(3*Math.random())/10 - 0.1;\n\t\t\tif (vitesse_lat_route > 1 || vitesse_lat_route < -1) {\n\t\t\t\tvitesse_lat_route = 0;\t\t\t/* rétroaction négative pour éviter une trop grande difficulté */\n\t\t\t}\n\t\t\tif (xroute+vitesse_lat_route <0 \n\t\t\t\t|| xroute+vitesse_lat_route+largeur > 100) {\n\t\t\t\t\tvitesse_lat_route = -vitesse_lat_route;\t\t/* pour faire tourner la route dans l'autre sens si on atteind le bord */\n\t\t\t}\n\t\t\txroute = xroute + vitesse_lat_route;\n\t\t\tpolygone[p][0] = xroute;\n\t\t\tpolygone[p][1] = polygone[p][1] % 100;\n\t\t\tpremierpoint = p;\n\t\t}\n\t}\n\n}", "function ustawId(pole) {\r\n aktualnePole = pole.id; \r\n aktualnaWartosc = pole.value;\r\n}", "function dibujarFresado119(modelo,di,pos,document){\n\t\n\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\t\n\t//Puntos trayectoria \n\tvar fresado1 = new RVector(pos.x,pos.y+alaInferior)\n\tvar fresado2 = new RVector(pos.x,pos.y)\n\tvar fresado3 = new RVector(pos.x+anchura1,pos.y+alaInferior)\n\tvar fresado4 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior)\n\tvar fresado5 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior)\n\tvar fresado6 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior)\n\tvar fresado7 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior)\n\tvar fresado8 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+alturaPlaca)\n\tvar fresado9 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+anchura5,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado10 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado11 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4,pos.y+alaInferior+alturaPlaca)\n\tvar fresado12 = new RVector(pos.x+anchura1+anchura2+anchura3+anchura4-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado13 = new RVector(pos.x+anchura1+anchura2+anchura3+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado14 = new RVector(pos.x+anchura1+anchura2+anchura3,pos.y+alaInferior+alturaPlaca)\n\tvar fresado15 = new RVector(pos.x+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado16 = new RVector(pos.x+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado17 = new RVector(pos.x+anchura1+anchura2,pos.y+alaInferior+alturaPlaca)\n\tvar fresado18 = new RVector(pos.x+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado19 = new RVector(pos.x+anchura1+pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado20 = new RVector(pos.x+anchura1,pos.y+alaInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+anchura1-pliegueSuperior,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado22 = new RVector(pos.x,pos.y+alaInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado23 = new RVector(pos.x,pos.y+alaInferior+alturaPlaca)\n\n\t\tvar line = new RLineEntity(document, new RLineData( fresado2 , fresado22 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado20 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado17 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado11 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado7 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado22 , fresado21 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado16 , fresado15 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado13 , fresado12 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado10 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado23 , fresado8 ));\n\t\top_fresado.addObject(line,false);\n\n\n\treturn op_fresado; \n\n}", "async function zapolniTabelo() {\n /**\n * Funkcija ki pobarva celico\n * @param {HTMLElement} el Element celice ki jo barvamo\n * @param {String} tip Tip celice ki nam pove kako naj pobarvamo\n */\n function pobarvajPolje(el, tip) {\n switch (tip) {\n case \".\": el.classList = \"bg-info\"; el.innerText = \"\"; break;\n case \"#\": el.classList = \"bg-secondary\"; el.innerText = \"#\"; break;\n case \"X\": el.classList = \"bg-danger\"; el.innerText = \"X\"; break;\n case \"O\": el.classList = \"bg-info\"; el.innerText = \"O\"; break;\n }\n }\n\n // Pridobi podatke iz streznika in jih preberi\n const sb = JSON.parse(await stanjeBojisca());\n const domace = sb.domace;\n const tuje = sb.tuje[0];\n\n // Ustrezno pobarvaj obe tabeli\n for (let y = 0; y < 15; y++) {\n for (let x = 0; x < 15; x++) {\n let el_napad = at(napadalnaTabela, x, y);\n let el_domace = at(domacaTabela, x, y);\n\n pobarvajPolje(el_napad, tuje[y][x]);\n pobarvajPolje(el_domace, domace[y][x]);\n }\n }\n }", "function novaTela(resultado, nome){\n\t\t//Verifica se é aluno ou professor\n\t\tvar objetos = JSON.parse(resultado);\n\t\tvar gv = JSON.parse(objetos[0]);\n\t\t$(\"footer\").empty();\n\t\tconsole.log(gv.bandeira1);\n\t\tif (gv.bandeira1 == 1) {\n\t\t\t//aluno\n\t\t\ttelaAluno(objetos, nome);\n\t\t}else if (gv.bandeira1 == 2){\n\t\t\t//Professor\n\t\t\ttelaProfessor(objetos);\n\t\t}\n\n\t}", "function provjera(aktivnostiSpisak, pocetak, kraj) {\n for (var i = 0; i < aktivnostiSpisak.length; i++) {\n let p = aktivnostiSpisak[i].pocetak;\n let k = aktivnostiSpisak[i].kraj;\n if (((pocetak <= p) && (kraj > p) && (kraj <= k)) ||\n ((pocetak >= p) && (pocetak < k) && (kraj >= k)) ||\n ((pocetak > p) && (kraj < k)) ||\n ((pocetak < p) && (kraj > k)) ||\n ((pocetak == p) && (kraj == k))) {\n return true;\n }\n\n }\n return false;\n }", "function esProtesisf(diente, codigopieza){\n\t\t\n\t\tvar esProtesisf = false;\n\t\tvar color = 'blue';\n\t\tvar pdiente = \"\"; //primer diente\n\t\tvar udiente = \"\"; // ultimo diente\n\t\tvar protesisfcompleto = false;\n\t\tvar salida ='';\n\n\t\tvar esCor = false;\n\t\tvar color = 'blue';\n\n\t\tvar trat_protesisf = ko.utils.arrayFilter(vm.tratamientosAplicados(), function(t){\n\t\t\treturn t.tratamiento.id == codigopieza;\n\t\t});\t\n\n\t\ttry {\n\n \tfor (var i = 0; i <= trat_protesisf.length - 1; i++) {\n\t\t\tvar t = trat_protesisf[i];\n \n // Si esta completo el puente\n if (t.diente.id.indexOf('_') > -1) { \n\t\t pdiente = t.diente.id.substring(0, t.diente.id.indexOf('_'));\t\n\t\t\t udiente = t.diente.id.substring(t.diente.id.lastIndexOf('_')+3, t.diente.id.length - t.diente.id.lastIndexOf('_'));\n\n // si estan definidos ambos dientes del puente devuelvo el tratamiento\n\t\t\t if(pdiente>0 && udiente>0 && diente.id==pdiente){ \n\t\t\t \t esProtesisf = true;\n\t\t\t \t protesisfcompleto = true;\n\n\t\t if (t.tratamiento.id == \"01.09\" || t.tratamiento.id == \"01.03\" || t.tratamiento.id == \"01.10\"){\n\t\t\t\t\t color = t.tratamiento.color;\n\t\t } \n\t\t\t \t salida=[esProtesisf,color,pdiente,udiente, protesisfcompleto];\n\t\t\t }\n\t\t\t // con que uno este definido ya es puente\n\t\t\t if(pdiente>0 && udiente>0 && diente.id==pdiente){ \n\t\t\t \t esProtesisf = true;\n\t\t\t \t salida=[esProtesisf,color,pdiente,udiente, protesisfcompleto];\n\t\t\t }\n\t\t\t \n\t\t\t} \n\t\t};\n \n }\n catch(err) {\n\t\t \n\t\t}\n \treturn salida;\n\n\t}", "function dwa() {\n \n //wypisanie do konsoli zawartości zmienna1, zdeklarowanej w funkcji nadrzednej, wartośc zostanie pobrana poprzez hoisting\n console.log(zmienna1);\n \n //Deklaracja i przypisanie w funkcji wewnetrznej\n var zmienna2 = 3;\n }", "function chercheCaseVide () {\n let objet;\n for (let i = 0; i < plateau.length; i++) {\n for (let j = 0; j < plateau.length; j++) {\n if (plateau[i][j] === 16) {\n $('.row' + i + ' .cas' + j).addClass(\"celluleVide\");\n $('.row' + i + ' .cas' + j).text(\" \");\n objet = {\"i\":i,\"j\":j};\n } else {\n $('.row' + i + ' .cas' + j).removeClass(\"celluleVide\");\n }\n }\n } return objet;\n }", "function ispisiKateogorijeProizvoda(kat, katProizvod, deoStrane){\n let html = \"\";\n\n kat.forEach(k => {\n let katPoId = katProizvod.filter(el => el.idKat == k.id);\n html += `<h5 class=\"text-center pt-2 pb-2\">${k.naziv}</h5>\n ${chbFilterKategorije(katPoId)} `; \n \n });\n html += chbFilterPaketAkcija();\n\n $(\"[name='paket']\").click(filtrirajPoPaketima);\n $(\"[name='popust']\").click(filtrirajPoPopustu);\n \n $(deoStrane).html(html);\n $(\"[name='kategorije']\").click(filterPoKategorijama);\n}", "function pos_luna(njd){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) ottobre 2010.\n // funzione per il calcolo della posizione della Luna.\n // njd= numero dei giorni giuliani per il T.U. di Greenwich.\n // coordinate equatoriali geocentriche per l'equinozio della data.\n\nvar T=(njd-2415020.0)/36525;\n\nvar L1=270.434164+481267.8831*T-0.001133*T*T+0.0000019*T*T*T; // longitudine media.\n\nvar M=358.475833+35999.04975*T-0.000150*T*T-0.0000033*T+T*T; // anomalia media del Sole\n\nvar M1=296.104608+477198.8491*T+0.009192*T*T+0.0000144*T*T*T; // anomalia media della Luna\n\nvar D=350.737486+445267.1142*T-0.001436*T*T+0.0000019*T*T*T; // elongazione media della Luna\n\nvar F=11.250889+483202.0251*T-0.003211*T*T-0.0000003*T*T*T; // distanza media della Luna dal suo nodo ascendente.\n\nvar N=259.183275-1934.1420*T+0.002078*T*T+0.0000022*T*T*T; // longitudine media del nodo ascendente della Luna.\n\n// termini additivi di correzione.\n\nvar Delta=0.003964*Math.sin(Rad(346.560+132.870*T-0.0091731*T*T));\n\nL1=L1+0.000233*Math.sin(Rad(51.2+20.2*T))+Delta;\n M= M-0.001778*Math.sin(Rad(51.2+20.2*T));\nM1=M1+0.000817*Math.sin(Rad(51.2+20.2*T))+Delta;\n D= D+0.002011*Math.sin(Rad(51.2+20.2*T))+Delta;\n\nL1=L1+0.001964*Math.sin(Rad(N));\nM1=M1+0.002541*Math.sin(Rad(N));\n D= D+0.001964*Math.sin(Rad(N));\n F= F-0.024691*Math.sin(Rad(N));\n F= F-0.004328*Math.sin(Rad(N+275.05-2.30*T));\n F= F+Delta;\n\nvar e=1-0.002495*T-0.00000752*T*T;\n\n// Calcola la Longitudine ecclittica.\n\nvar Long=L1+6.288750*Math.sin(Rad(M1))\n +1.274018*Math.sin(Rad(2*D-M1))\n +0.658309*Math.sin(Rad(2*D))\n +0.213616*Math.sin(Rad(2*M1))\n -0.185596*Math.sin(Rad(M))*e\n -0.114336*Math.sin(Rad(2*F))\n +0.058793*Math.sin(Rad(2*D-2*M1))\n +0.057212*Math.sin(Rad(2*D-M-M1))*e\n +0.053320*Math.sin(Rad(2*D+M1))\n +0.045874*Math.sin(Rad(2*D-M))*e\n +0.041024*Math.sin(Rad(M1-M))*e\n -0.034718*Math.sin(Rad(D))\n -0.030465*Math.sin(Rad(M+M1))*e\n +0.015326*Math.sin(Rad(2*D-2*F))\n -0.012528*Math.sin(Rad(2*F+M1))\n -0.010980*Math.sin(Rad(2*F-M1))\n +0.010674*Math.sin(Rad(4*D-M1))\n +0.010034*Math.sin(Rad(3*M1))\n +0.008548*Math.sin(Rad(4*D-2*M1))\n -0.007910*Math.sin(Rad(M-M1+2*D))*e\n -0.006783*Math.sin(Rad(2*D+M))*e\n +0.005162*Math.sin(Rad(M1-D))\n -0.005000*Math.sin(Rad(M+D))*e\n +0.004049*Math.sin(Rad(M1-M+2*D))*e\n +0.003996*Math.sin(Rad(2*M1+2*D))\n +0.003862*Math.sin(Rad(4*D))\n +0.003665*Math.sin(Rad(2*D-3*M1))\n +0.002695*Math.sin(Rad(2*M1-M))*e\n +0.002602*Math.sin(Rad(M1-2*F-2*D))\n +0.002396*Math.sin(Rad(2*D-M-2*M1))*e\n -0.002349*Math.sin(Rad(M1+D))\n +0.002249*Math.sin(Rad(2*D-2*M))*e*e\n -0.002125*Math.sin(Rad(2*M1+M))*e \n -0.002079*Math.sin(Rad(2*M))*e*e \n +0.002059*Math.sin(Rad(2*D-M1-2*M))*e*e\n -0.001773*Math.sin(Rad(M1+2*D-2*F))\n -0.001595*Math.sin(Rad(2*F+2*D))\n +0.001220*Math.sin(Rad(4*D-M-M1))*e\n -0.001110*Math.sin(Rad(2*M1+2*F))\n +0.000892*Math.sin(Rad(M1-3*D))\n -0.000811*Math.sin(Rad(M+M1+2*D))*e\n +0.000761*Math.sin(Rad(4*D-M-2*M1))*e\n +0.000717*Math.sin(Rad(M1-2*M))*e*e\n +0.000704*Math.sin(Rad(M1-2*M-2*D))*e*e\n +0.000693*Math.sin(Rad(M-2*M1+2*D))*e\n +0.000598*Math.sin(Rad(2*D-M-2*F))*e\n +0.000550*Math.sin(Rad(M1+4*D))\n +0.000538*Math.sin(Rad(4*M1))\n +0.000521*Math.sin(Rad(4*D-M))*e\n +0.000486*Math.sin(Rad(2*M1-D));\n \n// Calcolo della Latitudine ecclittica.\n\nvar Beta= 5.128189*Math.sin(Rad(F))\n +0.280606*Math.sin(Rad(M1+F))\n +0.277693*Math.sin(Rad(M1-F))\n +0.173238*Math.sin(Rad(2*D-F))\n +0.055413*Math.sin(Rad(2*D+F-M1))\n +0.046272*Math.sin(Rad(2*D-F-M1))\n +0.032573*Math.sin(Rad(2*D+F))\n +0.017198*Math.sin(Rad(2*M1+F))\n +0.009267*Math.sin(Rad(2*D+M1-F))\n +0.008823*Math.sin(Rad(2*M1-F))\n +0.008247*Math.sin(Rad(2*D-M-F))*e\n +0.004323*Math.sin(Rad(2*D-F-2*M1))\n +0.004200*Math.sin(Rad(2*D+F+M1))\n +0.003372*Math.sin(Rad(F-M-2*D))*e\n +0.002472*Math.sin(Rad(2*D+F-M-M1))*e\n +0.002222*Math.sin(Rad(2*D+F-M))*e\n +0.002072*Math.sin(Rad(2*D-F-M-M1))*e\n +0.001877*Math.sin(Rad(F-M+M1))*e\n +0.001828*Math.sin(Rad(4*D-F-M1))\n -0.001803*Math.sin(Rad(F+M))*e\n -0.001750*Math.sin(Rad(3*F))\n +0.001570*Math.sin(Rad(M1-M-F))*e\n -0.001487*Math.sin(Rad(F+D))\n -0.001481*Math.sin(Rad(F+M+M1))*e\n +0.001417*Math.sin(Rad(F-M-M1))*e\n +0.001350*Math.sin(Rad(F-M))*e\n +0.001330*Math.sin(Rad(F-D))\n +0.001106*Math.sin(Rad(F+3*M1))\n +0.001020*Math.sin(Rad(4*D-F))\n +0.000833*Math.sin(Rad(F+4*D-M1))\n +0.000781*Math.sin(Rad(M1-3*F))\n +0.000670*Math.sin(Rad(F+4*D-2*M1))\n +0.000606*Math.sin(Rad(2*D-3*F))\n +0.000597*Math.sin(Rad(2*D+2*M1-F))\n +0.000492*Math.sin(Rad(2*D+M1-M-F))*e\n +0.000450*Math.sin(Rad(2*M1-F-2*D))\n +0.000439*Math.sin(Rad(3*M1-F))\n +0.000423*Math.sin(Rad(F+2*D+2*M1))\n +0.000422*Math.sin(Rad(2*D-F-3*M1))\n -0.000367*Math.sin(Rad(M+F+2*D-M1))*e\n -0.000353*Math.sin(Rad(M+F+2*D))*e\n +0.000331*Math.sin(Rad(F+4*D))\n +0.000317*Math.sin(Rad(2*D+F-M+M1))*e\n +0.000306*Math.sin(Rad(2*D-2*M-F))*e*e\n -0.000283*Math.sin(Rad(M1+3*F));\n\n var omega1=0.0004664*Math.cos(Rad(N));\n var omega2=0.0000754*Math.cos(Rad(N+275.05-2.30));\n\n var Lat=Beta*(1-omega1-omega2); // latitudine ecclittica.\n\n // Calcolo della parallasse.\n\n var parallasse=0.950724\n +0.051818*Math.cos(Rad(M1))\n +0.009531*Math.cos(Rad(2*D-M1))\n +0.007843*Math.cos(Rad(2*D))\n +0.002824*Math.cos(Rad(2*M1))\n +0.000857*Math.cos(Rad(2*D+M1))\n +0.000533*Math.cos(Rad(2*D-M))*e\n +0.000401*Math.cos(Rad(2*D-M-M1))*e\n +0.000320*Math.cos(Rad(M1-M))*e\n -0.000271*Math.cos(Rad(D))\n -0.000264*Math.cos(Rad(M1+M))*e\n -0.000198*Math.cos(Rad(2*F-M1))\n +0.000173*Math.cos(Rad(3*M1))\n +0.000167*Math.cos(Rad(4*D-M1))\n -0.000111*Math.cos(Rad(M))*e\n +0.000103*Math.cos(Rad(4*D-2*M1))\n -0.000084*Math.cos(Rad(2*M1-2*D))\n -0.000083*Math.cos(Rad(2*D+M))*e\n +0.000079*Math.cos(Rad(2*D+2*M1))\n +0.000072*Math.cos(Rad(4*D))\n +0.000064*Math.cos(Rad(2*D-M+M1))*e\n -0.000063*Math.cos(Rad(2*D+M-M1))*e\n +0.000041*Math.cos(Rad(M+D))*e\n +0.000035*Math.cos(Rad(2*M1-M))*e\n -0.000033*Math.cos(Rad(3*M1-2*D))\n -0.000030*Math.cos(Rad(M1+D))\n -0.000029*Math.cos(Rad(2*F-2*D))\n -0.000029*Math.cos(Rad(2*M1+M))*e\n +0.000026*Math.cos(Rad(2*D-2*M))*e*e\n -0.000023*Math.cos(Rad(2*F-2*D+M1))\n +0.000019*Math.cos(Rad(4*D-M-M1))*e;\n\n Long=gradi_360(Long); // La longitudine all'interno dell'intervallo 0-360.\n\n var dati_luna=trasf_ecli_equa(njd,Long,Lat); // calcola le coordinate equatoriali geocentriche.\n\n // dati del Sole.\n\n var dat_sole=pos_sole(njd); // calcola la longitudine del sole\n var Long_sole=dat_sole[2]; // longitudine vera del sole.\n \n // CALCOLO DELLA FASE E DELL'ELONGAZIONE\n\n var Elongazione=elong(dati_luna[0],dati_luna[1],dat_sole[0],dat_sole[1]); // elongazione in gradi dal Sole.\n\n var Fase_luna=0.5*(1-Math.cos(Rad(Elongazione))); // FASE\n \n var dist_luna=6378.14/Math.sin(Rad(parallasse));\n dist_luna=dist_luna.toFixed(0); // Distanza in Km.\n\n var dim_app=Math.atan(3476.2/dist_luna); \n dim_app=Rda(dim_app)*3600;\n dim_app=dim_app.toFixed(2); // Diametro apparente in secondi d'arco.\n\n // elenco delle variabili restituite dalla funzione [pos_luna].\n\n // dati_luna[0]= ascensione retta già in ore decimali (diviso per 15).\n // dati_luna[1]= declinazione in gradi sessadecimali.\n dati_luna[2]= Long; // in gradi sessadecimali.\n dati_luna[3]= Fase_luna; // fase lunare.\n dati_luna[4]= Elongazione; // elongazione in gradi sessadecimali.\n dati_luna[5]= parallasse; // parallasse della Luna in gradi. \n dati_luna[6]= dim_app; // diametro apparente in secondi d'arco.\n dati_luna[7]= dist_luna; // distanza della Luna in Km. \n\n return dati_luna;\n\n}", "function zapisiSePodatke(ehrId){\n \t\t $.ajaxSetup({\n \t\t headers: {\"Ehr-Session\": sessionId}\n \t\t });\n \t\t \tvar podatki = {\n \t\t\t// Struktura predloge je na voljo na naslednjem spletnem naslovu:\n // https://rest.ehrscape.com/rest/v1/template/Vital%20Signs/example\n \t\t \"ctx/language\": \"en\",\n \t\t \"ctx/territory\": \"SI\",\n \t\t \n \t\t \"vital_signs/height_length/any_event/body_height_length\": visina,\n \t\t \"vital_signs/body_weight/any_event/body_weight\": teza,\n \t\t \"vital_signs/pulse/any_event/rate|magnitude\": srcniUtrip,\n \t\t \"vital_signs/pulse/any_event/rate|unit\":\"/min\",\n \t\t \"vital_signs/blood_pressure/any_event/systolic\": zgornjiTlak,\n \t\t \"vital_signs/blood_pressure/any_event/diastolic\": spodnjiTlak,\n \t\t};\n \t\tvar parametriZahteve = {\n \t\t ehrId: ehrId,\n \t\t templateId: 'Vital Signs',\n \t\t format: 'FLAT',\n \t\t // committer: merilec\n \t\t};\n \t\t$.ajax({\n \t\t url: baseUrl + \"/composition?\" + $.param(parametriZahteve),\n \t\t type: 'POST',\n \t\t contentType: 'application/json',\n \t\t data: JSON.stringify(podatki),\n \t\t success: function (res) {\n \t\t document.getElementById(\"kreiraniEHRji\").innerHTML += \"<p class='bg-success'> <b>Generiran vpis:</b> \"+ime+\" \"+priimek+\",<b> EHR-Id:</b> \"+ ehrId + \"</p>\"\n \t\t },\n \t\t \n \n \t\t });\n \t\t }", "function fl_outToSufgania ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t\n\t\t}}", "function getRaspored() {\n var data, dataL;\n data = fetchRasp(smjena);\n dataL = data.length;\n trajanje = trajanjeFn(data[0]);\n\n // Biranje između učenika i profesora\n if (osoba == \"Učenik\") {\n getUcenik(data, dataL);\n } else if (osoba == \"Profesor\" && smjena != \"A/B\") {\n getProfesor(data, dataL);\n } else {\n getProfesorAB(data);\n }\n }", "function restaVotos (obj){\n let resta = obj.votos_positivos - obj.votos_negativos;\n console.log(resta);\n}", "function dibujarFresado128(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\n\t//Puntos fresado\n\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior) \n\tvar fresado2 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInferior,pos.y+alaInferior)\n\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInferior,pos.y+alaInferior)\n\tvar fresado4 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior)\n\t\n\tvar fresado5 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior)\n\tvar fresado6 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\t\n\tvar fresado8 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado9 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado10 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado11 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\n\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado11 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado5 , fresado7 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado10 ));\n\t\top_fresado.addObject(line,false);\n\n\t\n\t\n\t\t\n\t\n\t//anchura1 //superior\n\tif (anchura1>pliegueSuperior){ \n\t\t//var fresado12 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado12 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado19 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado20 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado20 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\n\t//anchura2 //superior\n\tif (anchura2>pliegueSuperior){ \n\t\t//var fresado13 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado13 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado21 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado22 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado22 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\n\t\t}\n\t}\n\t\n\t\n\t\n\t//anchura1 //inferior\n\tif (anchura1>pliegueInferior){ \n\t\t//var fresado12 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado2 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado15 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInferior+margenFresado,pos.y+alaInferior)\n\t\t\tvar fresado16 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInferior+margenFresado,pos.y)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado15 , fresado16 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura2 //inferior\n\tif (anchura2>pliegueInferior){ \n\t\t//var fresado12 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado3 , fresado4 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado17 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInferior-margenFresado,pos.y+alaInferior)\n\t\t\tvar fresado18 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInferior-margenFresado,pos.y)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado18 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t}\n\t}\n\t\n\t\n\t\n\t\n\n\treturn op_fresado; \n\n}" ]
[ "0.65396804", "0.62866277", "0.62442654", "0.61705977", "0.6155482", "0.6117599", "0.60125554", "0.5963607", "0.5949079", "0.5923952", "0.59168214", "0.59164137", "0.5882406", "0.58366066", "0.58339584", "0.58339113", "0.5800258", "0.5781609", "0.57718915", "0.575292", "0.57385355", "0.57264596", "0.57132965", "0.5704236", "0.5684273", "0.5667594", "0.56544006", "0.56490374", "0.56425613", "0.5637592", "0.5629751", "0.5612086", "0.56086296", "0.56049186", "0.55857164", "0.5582422", "0.5571905", "0.5568922", "0.55527186", "0.5552444", "0.55425954", "0.55398476", "0.55391717", "0.5527386", "0.55179566", "0.5517158", "0.5512822", "0.5503253", "0.5488981", "0.54885596", "0.5480553", "0.54803944", "0.5480257", "0.547414", "0.547368", "0.54646516", "0.5451904", "0.54509103", "0.54509103", "0.54509103", "0.54453903", "0.5433323", "0.54214066", "0.540781", "0.54076695", "0.5406136", "0.53999335", "0.5398484", "0.53927386", "0.53902143", "0.5388812", "0.5381703", "0.5368163", "0.5356551", "0.53531104", "0.53524756", "0.5348879", "0.5342979", "0.534221", "0.53405523", "0.53405213", "0.53387797", "0.5336057", "0.53349775", "0.53243357", "0.53184605", "0.5315433", "0.5314587", "0.5308292", "0.5302682", "0.52966934", "0.52890646", "0.5288085", "0.52822685", "0.5280072", "0.52773035", "0.52745056", "0.52532464", "0.52486867", "0.5246945", "0.5244667" ]
0.0
-1
this part is more like a temporary stay in this file, would moving to a independent 'setting page' someday.
constructor(props){ super(props); this.state = { }; this.style={ selfCom_Setting_: { width: '100%', height: '100%', position: 'absolute', top: '0%', left: '0%' }, selfCom_Setting_email_: { width: '70%', height: '24%', position: 'absolute', top: '25%', left: '6%', boxSizing: 'border-box', }, selfCom_Setting_pass: { position: 'absolute', top: '69%', left: '76%', boxSizing: 'border-box', } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _settings_page() {\n}", "function additionalSettings(){\n\n\n}", "function settingSetup(){\n\tif(settings.get('network') === undefined){ settings.set('network', 'bitmark'); }\n\tif(settings.get('auto_update') === undefined){ settings.set('auto_update', true); }\n if(settings.get('directory') === undefined){ settings.set('directory', dataDir); }\n if(containerState === undefined){containerState='norun';}\n if(prevState === undefined){prevState='undefined';}\n}", "function settingsSetup() {\n updateSettingsValues();\n }", "function saveSettings(){\n\n showMenu();\n\n for (key in settingTmp){\n if (settingTmp.hasOwnProperty(key)){\n setting[key] = settingTmp[key];\n }\n }\n\n PopupModule.hide();\n }", "function synchSettings() {\r\n copyMWValues(['language', 'FBName', 'newRevList', 'oldRevList']);\r\n}", "function newProjectSettings() {\n\t generatedCode.chosenHeader = chosenFonts.list()[0];\n \tgeneratedCode.chosenParagraph = chosenFonts.list()[1];\n \tgeneratedCode.headerLink = \"<link href='\" + $rootScope.style1 + \"' rel='stylesheet' type='text/css'>\";\n \tgeneratedCode.paragraphLink = \"<link href='\" + $rootScope.style2 + \"' rel='stylesheet' type='text/css'>\";\n \tgeneratedCode.username = user.username;\n\t}", "function initSettings() {\n\t\tns.settings.exampleSetting = 1337;\n\t}", "function saveSettings() {\n var settings = [];\n if (options.orderby != defaults.orderby) {\n settings.push('\"orderby\":\"' + options.orderby + '\"');\n }\n if (options.thsize != defaults.thsize) {\n settings.push('\"thsize\":\"' + options.thsize + '\"');\n }\n if (options.extended != defaults.extended) {\n settings.push('\"extended\":' + (options.extended ? 'true' : 'false'));\n }\n if (options.proxy != defaults.proxy) {\n settings.push('\"proxy\":' + (options.proxy ? 'true' : 'false'));\n }\n if (settings.length > 0) {\n settings = '{' + settings.join(',') + '}';\n $.cookie('4cat', settings, {\n expires: 30,\n path: options.cookiePath,\n domain: options.cookieDomain\n });\n }\n else {\n $.cookie('4cat', null, {\n path: options.cookiePath,\n domain: options.cookieDomain\n });\n }\n }", "function Configuration() {\r\n\tif(!Form.checkCurrentMode(0, true)) return;\r\n\tForm.addForm();\r\n\tForm.all_or_this = 0;\t// all ****** pages\r\n\tForm.main_or_sub = 0;\t// main pages\r\n\tForm.option_check = false;\r\n\tLoadCurrentConf();\r\n\tSetCurrentConf();\r\n\tForm.option_check = true;\r\n\tForm.openForm();\r\n}", "function settings(){\n window.location = \"./settings.html\";\n}", "function set_basic_settings(){ \r\n var saved_settings=[\"USERNAME\", \"RACE\",\r\n \r\n \"SPECIAL_LOCATIONS\",\"VILLAGES\",\"USE_TIMELINE\",\"USE_ALLY_LINES\",\r\n \"USE_CUSTOM_SIDEBAR\",\"USE_MARKET_COLORS\",\"USE_ENHANCED_RESOURCE_INFO\",\r\n \"USE_EXTRA_VILLAGE\",\"USE_SERVER_TIME\",\"USE_DEBUG_MODE\", \r\n \"SHOW_TIMELINE_REPORT_INFO\", \"COLLAPSE_TIMELINE\",\r\n \r\n \"TIMELINE_SIZES_HISTORY\",\"TIMELINE_SIZES_FUTURE\", \"TIMELINE_DISTANCE_HISTORY\",\r\n \"TIMELINE_SIZES_HEIGHT\", \"TIMELINE_SIZES_WIDTH\", \"TIME_DIFFERENCE\",\r\n \"TIMELINE_COLLAPSED_WIDTH\", \"TIMELINE_COLOR\", \"KEEP_TIMELINE_UPDATED\",\r\n \"TIMELINE_SCALE_WARP\",\r\n\r\n \"BUILDING_COLOR\", \"ATTACK_COLOR\", \"REPORT_COLOR\",\r\n \"MARKET_COLOR\", \"RESEARCH_COLOR\", \"PARTY_COLOR\"\r\n ];\r\n\r\n for (i in saved_settings) {\r\n var v = saved_settings[i];\r\n x = GM_getValue(prefix(v)); \r\n if (x!==undefined && x!==\"\") {\r\n try {\r\n eval(v+\"=\"+x);\r\n } catch (e) {\r\n eval(v+\"=x\"); \r\n }\r\n }\r\n }\r\n TIMELINE_EVENT_COLORS = [BUILDING_COLOR, ATTACK_COLOR, REPORT_COLOR, MARKET_COLOR, RESEARCH_COLOR, PARTY_COLOR];\r\n }", "function settings()\r\n\t\t{\r\n\t\t\tdocument.getElementById('menu').style.display = \"none\";\r\n\t\t\tdocument.getElementById('settings').style.display = \"initial\";\r\n\t\t}", "function open_settings() {\n var dialog = new wkof.Settings({\n script_id: 'doublecheck',\n title: 'Double-Check Settings',\n on_save: init_ui,\n pre_open: settings_preopen,\n content: {\n tabAnswers: {type:'page',label:'Answers',content:{\n grpChangeAnswers: {type:'group',label:'Change Answer',content:{\n allow_retyping: {type:'checkbox',label:'Allow retyping answer',default:true,hover_tip:'When enabled, you can retype your answer by pressing Escape or Backspace.'},\n allow_change_incorrect: {type:'checkbox',label:'Allow changing to \"incorrect\"',default:true,hover_tip:'When enabled, you can change your answer\\nto \"incorrect\" by pressing the \"-\" key.'},\n allow_change_correct: {type:'checkbox',label:'Allow changing to \"correct\"',default:true,hover_tip:'When enabled, you can change your answer\\nto \"correct\" by pressing the \"+\" key.'},\n show_corrected_answer: {type:'checkbox',label:'Show corrected answer',default:false,hover_tip:'When enabled, pressing \\'+\\' to correct your answer puts the\\ncorrected answer in the input field. Pressing \\'+\\' multiple\\ntimes cycles through all acceptable answers.'},\n }},\n grpCarelessMistakes: {type:'group',label:'Careless Mistakes',content:{\n typo_action: {type:'dropdown',label:'Typos in meaning',default:'ignore',content:{ignore:'Ignore',warn:'Warn/shake',wrong:'Mark wrong'},hover_tip:'Choose an action to take when meaning contains typos.'},\n wrong_answer_type_action: {type:'dropdown',label:'Wrong answer type',default:'warn',content:{warn:'Warn/shake',wrong:'Mark wrong'},hover_tip:'Choose an action to take when reading was entered instead of meaning, or vice versa.'},\n wrong_number_n_action: {type:'dropdown',label:'Wrong number of n\\'s',default:'warn',content:{warn:'Warn/shake',wrong:'Mark wrong'},hover_tip:'Choose an action to take when you type the wrong number of n\\'s in certain reading questions.'},\n small_kana_action: {type:'dropdown',label:'Big kana instead of small',default:'warn',content:{warn:'Warn/shake',wrong:'Mark wrong'},hover_tip:'Choose an action to take when you type a big kana instead of small (e.g. ゆ instead of ゅ).'},\n kanji_reading_for_vocab_action: {type:'dropdown',label:'Kanji reading instead of vocab',default:'warn',content:{warn:'Warn/shake',wrong:'Mark wrong'},hover_tip:'Choose an action to take when the reading of a kanji is entered for a single character vocab word instead of the correct vocab reading.'},\n kanji_meaning_for_vocab_action: {type:'dropdown',label:'Kanji meaning instead of vocab',default:'warn',content:{warn:'Warn/shake',wrong:'Mark wrong'},hover_tip:'Choose an action to take when the meaning of a kanji is entered for a single character vocab word instead of the correct vocab meaning.'},\n }},\n }},\n tabMistakeDelay: {type:'page',label:'Mistake Delay',content:{\n grpDelay: {type:'group',label:'Delay Next Question',content:{\n delay_wrong: {type:'checkbox',label:'Delay when wrong',default:true,refresh_on_change:true,hover_tip:'If your answer is wrong, you cannot advance\\nto the next question for at least N seconds.'},\n delay_multi_meaning: {type:'checkbox',label:'Delay when multiple meanings',default:false,hover_tip:'If the item has multiple meanings, you cannot advance\\nto the next question for at least N seconds.'},\n delay_slightly_off: {type:'checkbox',label:'Delay when answer has typos',default:false,hover_tip:'If your answer contains typos, you cannot advance\\nto the next question for at least N seconds.'},\n delay_period: {type:'number',label:'Delay period (in seconds)',default:1.5,hover_tip:'Number of seconds to delay before allowing\\nyou to advance to the next question.'},\n }},\n }},\n tabBurnReviews: {type:'page',label:'Burn Reviews',content:{\n grpBurnReviews: {type:'group',label:'Burn Reviews',content:{\n warn_burn: {type:'dropdown',label:'Warn before burning',default:'never',content:{never:'Never',cheated:'If you changed answer',always:'Always'},hover_tip:'Choose when to warn before burning an item.'},\n burn_delay_period: {type:'number',label:'Delay after warning (in seconds)',default:1.5,hover_tip:'Number of seconds to delay before allowing\\nyou to advance to the next question after seeing a burn warning.'},\n }},\n }},\n tabLightning: {type:'page',label:'Lightning',content:{\n grpLightning: {type:'group',label:'Lightning Mode',content:{\n show_lightning_button: {type:'checkbox',label:'Show \"Lightning Mode\" button',default:true,hover_tip:'Show the \"Lightning Mode\" toggle\\nbutton on the review screen.'},\n lightning_enabled: {type:'checkbox',label:'Enable \"Lightning Mode\"',default:true,refresh_on_change:true,hover_tip:'Enable \"Lightning Mode\", which automatically advances to\\nthe next question if you answer correctly.'},\n srs_msg_period: {type:'number',label:'SRS popup time (in seconds)',default:1.2,min:0,hover_tip:'How long to show SRS up/down popup when in lightning mode. (0 = don\\'t show)'},\n }},\n }},\n tabAutoInfo: {type:'page',label:'Item Info',content:{\n grpAutoInfo: {type:'group',label:'Show Item Info',content:{\n autoinfo_correct: {type:'checkbox',label:'After correct answer',default:false,hover_tip:'Automatically show the Item Info after correct answers.', validate:validate_autoinfo_correct},\n autoinfo_incorrect: {type:'checkbox',label:'After incorrect answer',default:false,hover_tip:'Automatically show the Item Info after incorrect answers.', validate:validate_autoinfo_incorrect},\n autoinfo_multi_meaning: {type:'checkbox',label:'When multiple meanings',default:false,hover_tip:'Automatically show the Item Info when an item has multiple meanings.', validate:validate_autoinfo_correct},\n autoinfo_slightly_off: {type:'checkbox',label:'When answer has typos',default:false,hover_tip:'Automatically show the Item Info when your answer has typos.', validate:validate_autoinfo_correct},\n }},\n }},\n }\n });\n dialog.open();\n }", "function resetSettings()\n {\n my.settings.unit = my.UNIT.MAIN\n }", "function setPageSetting(setting,value) {\n if (autoTrimpSettings.hasOwnProperty(setting) == false) {\n return false;\n }\n if (autoTrimpSettings[setting].type == 'boolean') {\n // debug('found a boolean');\n autoTrimpSettings[setting].enabled = value;\n document.getElementById(setting).setAttribute('class', 'settingsBtn settingBtn' + autoTrimpSettings[setting].enabled);\n } else if (autoTrimpSettings[setting].type == 'value') {\n // debug('found a value');\n autoTrimpSettings[setting].value = value;\n } else if (autoTrimpSettings[setting].type == 'dropdown') {\n autoTrimpSettings[setting].selected = value;\n }\n updateCustomButtons();\n saveSettings();\n checkSettings();\n}", "function restoreSettings()\n{\n var tmp = System.Gadget.Settings.readString(\"user_name\");\n\tif (tmp != \"\") userName = tmp;\n\ttmp = System.Gadget.Settings.readString(\"api_key\");\n\tif (tmp != \"\") apiKey = tmp;\n\ttmp = System.Gadget.Settings.readString(\"poll_freq\");\n\tif (tmp != \"\") pollFreq = tmp;\n\tvar nameField = document.getElementById(\"user_name\");\n\tnameField.value = userName;\n\tvar keyField = document.getElementById(\"api_key\");\n\tkeyField.value = apiKey;\n\tvar pollField = document.getElementById(\"poll_freq\");\n\tpollField.value = pollFreq;\n\tSystem.Gadget.onSettingsClosing = SettingsClosing;\n}", "function mainPageSetupRepeat() {\n hideGenres(globalUserSettings);\n handleContinueWatching(globalUserSettings);\n}", "static _getSettings(page) {\n // Util.purgeSettings();\n const allValues = GM_listValues();\n if (MP.DEBUG) {\n console.log('_getSettings(', page, ')\\nStored GM keys:', allValues);\n }\n Object.keys(page).forEach((scope) => {\n Object.keys(page[Number(scope)]).forEach((setting) => {\n const pref = page[Number(scope)][Number(setting)];\n if (MP.DEBUG) {\n console.log('Pref:', pref.title, '| Set:', GM_getValue(`${pref.title}`), '| Value:', GM_getValue(`${pref.title}_val`));\n }\n if (pref !== null && typeof pref === 'object') {\n const elem = (document.getElementById(pref.title));\n const cases = {\n checkbox: () => {\n elem.setAttribute('checked', 'checked');\n },\n textbox: () => {\n elem.value = GM_getValue(`${pref.title}_val`);\n },\n dropdown: () => {\n elem.value = GM_getValue(pref.title);\n },\n };\n if (cases[pref.type] && GM_getValue(pref.title))\n cases[pref.type]();\n }\n });\n });\n }", "function generateSettings (done) {\n nconf.argv()\n .env()\n .file({\n file: 'www/build/js/settings.js',\n format: {\n stringify: function (obj, replacer, spacing) {\n return 'window.Settings = ' + JSON.stringify(obj, replacer || null, spacing || 2);\n },\n parse: function(value) {\n return JSON.parse(value.replace('window.Settings = ', ''));\n }\n }\n });\n\n nconf.set('apiEndpoint', nconf.get('TANGO_API_ENDPOINT'));\n nconf.set('apiToken', nconf.get('TANGO_API_TOKEN'));\n nconf.set('awsAccessKeyId', nconf.get('AWS_ACCESS_KEY'));\n nconf.set('awsSecretAccessKey', nconf.get('AWS_SECRET_KEY'));\n nconf.set('awsRegion', nconf.get('AWS_REGION'));\n nconf.set('oneSignalKey', nconf.get('ONE_SIGNAL_KEY'));\n nconf.set('googleProjectNumber', nconf.get('GOOGLE_PROJECT_NUMBER'));\n nconf.set('facebookAppId', nconf.get('FACEBOOK_APP_ID'));\n\n nconf.save(function (err) {\n if (err) console.log(err);\n else done();\n });\n}", "function deliriumkit(settings){\r\n\t/**\r\n\t * Incluir el archivo con las funciones basicas\r\n\t */\r\n\tif (settings) {\r\n\t\tfor (option in settings){ \r\n\t\t\tthis.settings[option] = settings[option]; \r\n\t\t}\r\n\t}\t\r\n}", "function setSavedOptions() {\n log('Getting saved options.');\n GM_setValue(\"opt_loggingEnabled\", opt_loggingEnabled);\n GM_setValue(\"opt_hidefedded\", opt_hidefedded);\n GM_setValue(\"opt_hidefallen\", opt_hidefallen);\n GM_setValue(\"opt_hidetravel\", opt_hidetravel);\n GM_setValue(\"opt_showcaymans\", opt_showcaymans);\n GM_setValue(\"opt_hidehosp\", opt_hidehosp);\n GM_setValue(\"opt_disabled\", opt_disabled);\n }", "function postSetGUIConfig() {\n\tvar values = null;\n\tif (values != null) {\n\t\t// initialize defaults\n\t\tbulk_value_edit = false;\n\t\tcell_value_edit = false;\n\t\t$('#enableEdit').css('display', 'none');\n\t\tfile_download = false;\n\t\tview_tags = false;\n\t\tview_URL = false;\n\t\t\n\t\tif (values.contains('bulk_value_edit')) {\n\t\t\tbulk_value_edit = true;\n\t\t}\n\t\tif (values.contains('cell_value_edit')) {\n\t\t\tcell_value_edit = true;\n\t\t\t$('#enableEdit').css('display', '');\n\t\t}\n\t\tif (values.contains('file_download')) {\n\t\t\tfile_download = true;\n\t\t}\n\t\tif (values.contains('view_tags')) {\n\t\t\tview_tags = true;\n\t\t}\n\t\tif (values.contains('view_URL')) {\n\t\t\tview_URL = true;\n\t\t}\n\t} else {\n\t\tbulk_value_edit = true;\n\t\tcell_value_edit = true;\n\t\t$('#enableEdit').css('display', '');\n\t\tfile_download = true;\n\t\tview_tags = true;\n\t\tview_URL = true;\n\t}\n}", "function save_options(){\r\n var _url = doc[$elem]('custom-url');\r\n var url = _url[_val];\r\n if (url == \"\") {\r\n url = aboutPages[0];\r\n }\r\n\r\n save(true, url);\r\n}", "function restore_options() {\n $(\"#theme\").val(\"blue\");\n $(\"#font_size\").val(\"0.9em\");\n $(\"#popup_width\").val(\"610\");\n $(\"#popup_height\").val(\"620\");\n $(\"#bookmark_url\").val(\"http://www.google.com/bookmarks/\");\n $(\"#sig_url\").val(\"http://www.google.com/bookmarks/find\");\n}", "function _setup()\n{\n // Load all settings.\n var variables = GM_listValues();\n for (var i=0; i<variables.length; i++)\n {\n var name = variables[i].split(':');\n var pref = name[0],\n name = name[1];\n if (pref == 'settings')\n {\n common.settings[name] = GM_getValue('settings:' + name);\n if (common.settingsConfig && common.settingsConfig[name] && common.settingsConfig[name].fromString)\n {\n common.settings[name] = common.settingsConfig[name].fromString(common.settings[name]);\n }\n }\n }\n\n var process = 'processed-' + common.apiname;\n\n // Bind the ready handler for the settings page.\n $('body').bind('DOMNodeInserted', function()\n {\n $('#settings-frame:not([' + process + '])').each(function()\n {\n $(this).attr(process, 'yes');\n $(this).load(_setupSettings);\n // Prevent hiding of additional settings if more than ~7 additional settings (or even less if they belong to multiple scripts) are present.\n $(this).css({\n 'overflow': 'visible',\n 'height': '100%',\n });\n });\n });\n \n // If the baseCSS is specified, add it.\n if (baseCSS)\n {\n $('head').append(createCSS(baseCSS));\n }\n \n // Apply all settings.\n for (var name in common.settings)\n {\n setSetting(name, common.settings[name]);\n }\n\n // Run the script-specific setup function.\n setup();\n}", "function saveSettings() {\r\n\t\t//Get values from page form elements and save\r\n\t\tGM_setValue(\"wTorrent_FQDN\",settingsWindow.document.getElementById(\"wtorrent_host\").value);\r\n\t\tGM_setValue(\"wTorrent_Port\",settingsWindow.document.getElementById(\"wtorrent_port\").value);\r\n\t\tGM_setValue(\"wTorrent_User\",settingsWindow.document.getElementById(\"wtorrent_username\").value);\r\n\t\tGM_setValue(\"wTorrent_Pass\",settingsWindow.document.getElementById(\"wtorrent_password\").value);\r\n\t\tGM_setValue(\"wTorrent_SSL\",settingsWindow.document.getElementById(\"wtorrent_ssl\").checked);\r\n\t\tGM_setValue(\"wTorrent_PrivateLinks\",settingsWindow.document.getElementById(\"wtorrent_showprivatelinks\").checked);\r\n\t\tGM_setValue(\"wTorrent_AllwaysPrivateLinks\",settingsWindow.document.getElementById(\"wtorrent_alwaysdownloadprivate\").checked);\r\n\t\tGM_setValue(\"wTorrent_AutoStartTorrents\",settingsWindow.document.getElementById(\"wtorrent_autostarttorrents\").checked);\r\n\t\tGM_setValue(\"wTorrent_DownloadDirectory\",settingsWindow.document.getElementById(\"wtorrent_downloaddirectory\").value);\r\n \r\n alert(\"Settings Updated\") //Alert user\r\n \r\n settingsWindow.close() //Close Settings Window\r\n \r\n // refresh values from configuration\r\n\t\tlocation.reload(true);\r\n\t\t// wtorrent_host = GM_getValue(\"wTorrent_FQDN\",\"wtorrent\") ; \r\n\t\t// wtorrent_port = GM_getValue(\"wTorrent_Port\",\"80\");\r\n\t\t// wtorrent_username = GM_getValue(\"wTorrent_User\",\"\"); \r\n\t\t// wtorrent_password = GM_getValue(\"wTorrent_Pass\",\"\");\r\n\t\t// wtorrent_ssl = GM_getValue(\"wTorrent_SSL\",false);\r\n\t\t// wtorrent_showprivatelinks = GM_getValue(\"wTorrent_PrivateLinks\",false);\r\n\t\t// wtorrent_alwaysdownloadprivate = GM_getValue(\"wTorrent_AllwaysPrivateLinks\",false);\r\n\t\t// wtorrent_autostarttorrents = GM_getValue(\"wTorrent_AutoStartTorrents\",true);\r\n\t\t// wtorrent_downloaddirectory = GM_getValue(\"wTorrent_DownloadDirectory\",\"default\");\r\n }", "function updateSettings(){\n document.documentElement.style.setProperty(`--accent`, settings.accentColor);\n document.documentElement.style.setProperty(`--bg-color`, settings.bgColor );\n if(settings.bgHidden == 'false'){\n document.documentElement.style.setProperty(`--bg-image`, `url(${settings.bgImage})` );\n }else{\n document.documentElement.style.setProperty(`--bg-image`, `url('')` );\n\n }\n\n}", "function checkSettings () {\n// If no setting found\n settings.defaultSettings(true)\n // Apply them\n applySettings()\n // Set theme\n setTheme(settings.mobySettings.Theme)\n}", "migrateSettings () {\n if (atom.config.get('recent-project-switcher.closeEditorsOnSwitch')) {\n atom.config.set('recent-project-switcher.closeEditorsOnSwitch', undefined)\n }\n }", "function openSettings() {\n let cfg = getConfigObject(true);\n $(\"#txtChannel\").val(cfg.Channels.join(\",\"));\n $(\"#txtNick\").val(cfg.Name || Strings.NAME_AUTOGEN);\n if (cfg.Pass && cfg.Pass.length > 0) {\n $(\"#txtPass\").attr(\"disabled\", \"disabled\").hide();\n $(\"#txtPassDummy\").show();\n }\n $(\"#selDebug\").val(`${cfg.Debug}`);\n $(\"#settings\").fadeIn();\n }", "function restore_options() {\n\ntry\n {\n\tvar servers = getLocalStorage(\"teamcitysettings\");\n\tvar server = servers[0]||{};\n\t\n setOptionFromElement(\"host\",server.host||\"\");\n setOptionFromElement(\"username\",server.username||\"\");\n setOptionFromElement(\"password\",server.password||\"\");\n showBuildTypeIds(server);\n }catch(err){\n\tconsole.log(\"Error exception\");\n }\n}", "function settingsInit() {\r\n\tvar settingsCookie = cookieRead('settings');\r\n\t\r\n\t// If the cookie exists, read it into settings, otherwise load the defaults\r\n\ttry {\r\n\t\tsettings = JSON.parse( decodeURIComponent(settingsCookie) );\r\n\t\t\r\n\t\tif ( settingsUpdate() )\r\n\t\t\tsettingsSave();\r\n\t\t\t\r\n\t} catch (err) {\r\n\t\talert('Your saved settings are corrupt, so the defaults have been loaded instead.\\nIf you have saved your settings, try to import them.\\nError: '+err);\r\n\t\tcookieDelete('settings');\r\n\t\tindexReload();\r\n\t}\r\n\t\r\n\tsettingsElements = {};\t\t\r\n}", "CONFIG_PAGE_COPY_SETTINGS(state) {\n state.settingsCopy = Object.assign({}, state.settings);\n }", "function settingsUpdate() {\r\n\t// 0.8 >> 0.9\r\n\tif ( typeof(settings.motw) != 'undefined' ) {\r\n\t\tsettings.style.disable_motw = settings.motw;\r\n\t\tdelete settings.motw;\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\t// 1.1 >> 1.2\r\n\tif ( typeof(settings.style.hide_time_created) == 'undefined' ) {\r\n\t\tsettings.style.hide_time_created = true;\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\treturn false;\r\n}", "function setup() {\n wkof.Menu.insert_script_link({name:'doublecheck',submenu:'Settings',title:'Double-Check',on_click:open_settings});\n\n var defaults = {\n allow_retyping: true,\n allow_change_correct: false,\n show_corrected_answer: false,\n allow_change_incorrect: false,\n typo_action: 'ignore',\n wrong_answer_type_action: 'warn',\n wrong_number_n_action: 'warn',\n small_kana_action: 'warn',\n kanji_reading_for_vocab_action: 'warn',\n kanji_meaning_for_vocab_action: 'warn',\n delay_wrong: true,\n delay_multi_meaning: false,\n delay_slightly_off: false,\n delay_period: 1.5,\n warn_burn: 'never',\n burn_delay_period: 1.5,\n show_lightning_button: true,\n lightning_enabled: false,\n srs_msg_period: 1.2,\n autoinfo_correct: false,\n autoinfo_incorrect: false,\n autoinfo_multi_meaning: false,\n autoinfo_slightly_off: false\n }\n return wkof.Settings.load('doublecheck', defaults)\n .then(init_ui.bind(null, true /* first_time */));\n }", "function ConfigurationSubPage() {\r\n\tif(!Form.checkCurrentMode(0, true)) return;\r\n\tForm.addForm();\r\n\tForm.all_or_this = 0;\t// all ****** pages\r\n\tForm.main_or_sub = 1;\t// sub pages\r\n\tForm.option_check = false;\r\n\tLoadCurrentConf();\r\n\tSetCurrentConf();\r\n\tForm.option_check = true;\r\n\tForm.openForm();\r\n}", "function defaultsClick() {\n Common.defaultSettings();\n setControlValues();\n Common.setTheme(document.getElementById('theme').value);\n}", "function startSettings() {\n alert('I don\\'t do anything yet.');\n }", "function restore_options() {\n\trestore_local(\"sense_facebook\");\n\trestore_local(\"sense_google\");\n\trestore_local(\"sense_twitter\");\n\trestore_local(\"sense_youtube\");\n\trestore_local(\"sense_4Chan\");\n\trestore_local(\"sense_selector\");\n\trestore_local(\"sense_color\");\n\trestore_local(\"api_key\");\n\tsave_options();\n}", "writeConfig(title, config) {\n return; // fix later\n }", "function aboutSetup(){\n\n}", "function setDefaults() {\n\tconfig.all = {\n\t\ttitleStyle: {\n\t\t\t'font-src': 'http://fonts.googleapis.com/css?family=Chango',\n\t\t\t'font-family': 'Chango, cursive',\n\t\t\t'color': '#000000',\n\t\t\t'font-size': '48px'\n\t\t},\n\t\ttimerStyle: {\n\t\t\t'background-color': '#32cd32',\n\t\t\t'font-src': 'http://fonts.googleapis.com/css?family=Chango',\n\t\t\t'font-family': 'Chango, cursive',\n\t\t\t'color': '#000000',\n\t\t\t'font-size': '48px'\n\t\t},\n\t\ttimers: [],\n\t\twindowSettings: {\n\t\t\twidth: 650,\n\t\t\theight: 350\n\t\t},\n\t\tusername: '',\n\t\tpassword: '',\n\t\tchannel: '',\n\t\tidInc: 0,\n\t\tactiveID: null\n\t}\n}", "function settings(e) {\n e.detail.applicationcommands = {\n \"divAccount\": { href: \"accountSettings.html\", title: \"Account\" },\n \"divPrivacy\": { href: \"privacySettings.html\", title: \"Privacy\" },\n };\n WinJS.UI.SettingsFlyout.populateSettings(e);\n }", "function save_options() {\n\tif (!woas.config.permit_edits) {\n\t\talert(woas.i18n.READ_ONLY);\n\t\treturn false;\n\t}\n\twoas.cfg_commit();\n\twoas.set_current(\"Special::Advanced\", true);\n}", "function setSettings(obj) {\n Setting_AddToTop = (obj.Set_AddToTop !== undefined && obj.Set_AddToTop !== null && obj.Set_AddToTop !== \"\") ? obj.Set_AddToTop : Setting_AddToTop;\n Setting_IncludeUpDown = (obj.Set_IncludeUpDown !== undefined && obj.Set_IncludeUpDown !== null && obj.Set_IncludeUpDown !== \"\") ? obj.Set_IncludeUpDown : Setting_IncludeUpDown;\n Setting_IncludeEdit = (obj.Set_IncludeEdit !== undefined && obj.Set_IncludeEdit !== null && obj.Set_IncludeEdit !== \"\") ? obj.Set_IncludeEdit : Setting_IncludeEdit;\n Setting_IncludeDelete = (obj.Set_IncludeDelete !== undefined && obj.Set_IncludeDelete !== null && obj.Set_IncludeDelete !== \"\") ? obj.Set_IncludeDelete : Setting_IncludeDelete;\n Setting_UseNgBlur = (obj.Set_UseNgBlur !== undefined && obj.Set_UseNgBlur !== null && obj.Set_UseNgBlur !== \"\") ? obj.Set_UseNgBlur : Setting_UseNgBlur;\n Setting_PointToOriginalArr = (obj.Set_PointToOriginalArr !== undefined && obj.Set_PointToOriginalArr !== null && obj.Set_PointToOriginalArr !== \"\") ? obj.Set_PointToOriginalArr : Setting_PointToOriginalArr;\n Setting_UseInputBoxForEditable = (obj.Set_UseInputBoxForEditable !== undefined && obj.Set_UseInputBoxForEditable !== null && obj.Set_UseInputBoxForEditable !== \"\") ? obj.Set_UseInputBoxForEditable : Setting_UseInputBoxForEditable;\n }", "function qll_system_settings_import()\r\n{\r\n\tsett=$('#QLLMenuSettingsField').attr('value').split(\";\");\r\n\t\r\n\tif(sett.length<=1)\r\n\t{\t\r\n\t\tqll_fun_showAlertBox('ALARM', qll_lang[40]);\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tvar line= new Array();\r\n\t\r\n\tfor(var k in sett)\r\n\t{\r\n\t\tif(sett[k].length==0)\r\n\t\t{\tcontinue;\t}\r\n\r\n\t\tline[k]=sett[k].split(\"=\");\r\n\t\t\r\n\t\tif(line[k].length!==2)\r\n\t\t{\r\n\t\t\talert(qll_lang[40]);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tline[k][0]=qll_fun_unsafe(line[k][0]);\r\n\t\tline[k][1]=qll_fun_unsafe(line[k][1]);\r\n\t}\r\n\t\r\n\tif(line[0][0]!='QLLVersion' || parseInt(line[0][1])!=GM_getValue(\"QLLVersion\",qll_version*10000000))\r\n\t{\r\n\t\talert(qll_lang[40]);\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tqll_system_settings_delete();\r\n\t\r\n\tfor(k in line)\r\n\t{\r\n\t\tif(line[k][1].length==0)\r\n\t\t{\tcontinue;\t}\r\n\t\t\r\n\t\tswitch(line[k][1])\r\n\t\t{\r\n\t\t\tcase 'true': line[k][1]=true; break;\r\n\t\t\tcase 'false': line[k][1]=false; break;\r\n\t\t\tdefault: if(isFinite(parseInt(line[k][1]))) line[k][1]=parseInt(line[k][1]); break;\r\n\t\t}\r\n\t\tGM_setValue(line[k][0],line[k][1]);\r\n\t}\r\n\t\r\n\talert(qll_lang[39]);\r\n}", "function roomSettings() {\n\t// output: Gold%20Coast\n\n\t// window.location = \"settings/roomSettings.html\";\n}", "function setup() {\n\t\t type = getCookie(\"practical\");\n\t\t option = document.getElementById(\"types\");\n\t\t window.location = type;\n\n\t\t}", "function exportSettings(content) {\n top.consoleRef=window.open('','settings-export',\n 'width=500,height=850'\n +',menubar=0'\n +',toolbar=0'\n +',status=0'\n +',scrollbars=1'\n +',resizable=1', true);\n top.consoleRef.document.writeln(\n '<html><head><title>ditbi Settings Export</title></head>'\n +'<body bgcolor=white onLoad=\"self.focus()\">'\n +content\n +'</body></html>');\n top.consoleRef.document.close();\n }", "function makeSettings() {\n\t\tvar i,\n\t\t\tdata = $.data(element, colorbox);\n\t\t\n\t\tif (data == null) {\n\t\t\tsettings = $.extend({}, defaults);\n\t\t\tif (console && console.log) {\n\t\t\t\tconsole.log('Error: cboxElement missing settings object')\n\t\t\t}\n\t\t} else {\n\t\t\tsettings = $.extend({}, data); \t\t\n\t\t}\n\t\t\n\t\tfor (i in settings) {\n\t\t\tif ($.isFunction(settings[i]) && i.slice(0, 2) !== 'on') { // checks to make sure the function isn't one of the callbacks, they will be handled at the appropriate time.\n\t\t\t\tsettings[i] = settings[i].call(element);\n\t\t\t}\n\t\t}\n\t\t\n\t\tsettings.rel = settings.rel || element.rel || 'nofollow';\n\t\tsettings.href = settings.href || $(element).attr('href');\n\t\tsettings.title = settings.title || element.title;\n\t\t\n\t\tif (typeof settings.href === \"string\") {\n\t\t\tsettings.href = $.trim(settings.href);\n\t\t}\n\t}", "function main() {\r\n initFlags();\r\n fixMarkup();\r\n changeLayout();\r\n initConfiguration();\r\n}", "function saveSettingsValues() {\n browser.storage.local.set({delayBeforeClean: document.getElementById(\"delayBeforeCleanInput\").value});\n\n browser.storage.local.set({activeMode: document.getElementById(\"activeModeSwitch\").checked});\n\n browser.storage.local.set({statLoggingSetting: document.getElementById(\"statLoggingSwitch\").checked});\n\n browser.storage.local.set({showNumberOfCookiesInIconSetting: document.getElementById(\"showNumberOfCookiesInIconSwitch\").checked});\n\n browser.storage.local.set({notifyCookieCleanUpSetting: document.getElementById(\"notifyCookieCleanUpSwitch\").checked});\n\n browser.storage.local.set({contextualIdentitiesEnabledSetting: document.getElementById(\"contextualIdentitiesEnabledSwitch\").checked});\n\n page.onStartUp();\n}", "function setupPage() {\n clearAlerts();\n loadOptions();\n document.getElementById('save').addEventListener('click', saveOptions);\n document.getElementById('defaults').addEventListener('click', saveDefaultOptions);\n}", "function ggr2Settings()\n{ \n this.save = saveSettingToDisk;\n this.load = loadSettingFromDisk;\n this.car_model = '';\n this.car_color = '';\n}", "function saveConfig() {\r\n\tvar err=0;\r\n\t\r\n\ttrace(\"saveConfig() storing the settings\");\r\n\r\n\ted2kDlMethod = GM_config.get('ed2kDlMethod');\r\n\r\n\temuleUrl = GM_config.get('emuleUrl');\r\n\tif(emuleUrl.charAt(emuleUrl.length-1) != '/') {\r\n\t\tGM_config.set(\"emuleUrl\", emuleUrl + '/');\r\n\t\temuleUrl += '/';\r\n\t}\r\n\r\n\temulePwd = GM_config.get('emulePwd');\r\n\tif(emulePwd=='' && ed2kDlMethod=='emule') {\r\n\t\talert(\"A password is mandatory to submit new link to emule via web URL.\\nPlease choose another method or specify the password.\");\r\n\t\tGM_config.set(\"emulePwd\",\"something\");\r\n\t\temulePwd = GM_config.get('emulePwd');\r\n\t\terr=-1;\r\n\t}\r\n\r\n\temuleCat = strToCat(GM_config.get('emuleCat'));\r\n\tif(emuleCat==-1) {\r\n\t\talert(\"Category value invalid. Reverting back to the default value (*default=0)\");\r\n\t\tGM_config.set('emuleCat', '*default=0');\r\n\t\temuleCat = strToCat('*default=0');\r\n\t}\r\n\r\n\tpopupPos = GM_config.get('popupPos');\r\n\r\n\tpopupHeight = GM_config.get('popupHeight');\r\n\tif (popupHeight > 0 && popupHeight < 40 ) {\r\n\t\talert(\"With a 'Max Popup Height' beetween 0 < x < 40px, you won't be able to press the Settings button. So we consider this value as 0 (unlimited)\");\r\n\t\tGM_config.set(\"popupHeight\",0);\r\n\t\tpopupHeight = 0;\r\n\t}\r\n\r\n\tpopupWidth = GM_config.get('popupWidth');\r\n\tif (popupWidth > 0 && popupWidth < 100 ) {\r\n\t\talert(\"With a 'Max Popup Width' beetween 0 < x < 100 px, you won't be able to press the Settings button. So we consider this value as 0 (unlimited)\");\r\n\t\tGM_config.set(\"popupWidth\",0);\r\n\t\tpopupWidth = 0;\r\n\t}\r\n\r\n\teditCol = GM_config.get('editCol');\r\n\teditRow = GM_config.get('editRow');\r\n\r\n\tif (GM_config.get('editMaxLength') < editMaxLength) {\r\n\t\talert(\"MaxLength must be superior to \" + editMaxLength);\r\n\t\tGM_config.set(\"editMaxLength\",editMaxLength);\r\n\t}\r\n\telse {\r\n\t\teditMaxLength = GM_config.get('editMaxLength');\r\n\t}\r\n\r\n\tif (err<0) {\r\n\t\tGM_config.open();\r\n\t\tsaveConfig();\r\n\t}\r\n\r\n\treturn err;\r\n}", "function ConfigurationWithID() {\r\n\tif(!Form.checkCurrentMode(0, true)) return;\r\n\tForm.addForm();\r\n\tForm.all_or_this = 1;\t// this ****** pages\r\n\tForm.main_or_sub = 0;\t// main pages\r\n\tForm.option_check = false;\r\n\tLoadCurrentConf();\r\n\tSetCurrentConf();\r\n\tForm.option_check = true;\r\n\tForm.openForm();\r\n}", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get({\n wpt_base_url: \"http://www.webpagetest.org/\"\n }, function(items) {\n document.getElementById('wpt_base_url').value = items.wpt_base_url;\n document.getElementById('wpt_base_url').disabled = false;\n });\n}", "function injectSettings() {\r\n\t\tvar menu = document.getElementById(\"top\");\r\n\t\tmenu = (menu ? menu.getElementsByTagName(\"menu\")[0] : undefined);\r\n\r\n\t\tif (!menu) {\r\n\t\t\tdanbNotice(\"Better Better Booru: The settings panel link could not be created.\", \"error\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar link = document.createElement(\"a\");\r\n\t\tlink.href = \"#\";\r\n\t\tlink.innerHTML = \"BBB Settings\";\r\n\t\tlink.addEventListener(\"click\", function(event) {\r\n\t\t\tif (!bbb.el.menu.window) {\r\n\t\t\t\tloadSettings();\r\n\t\t\t\tcreateMenu();\r\n\t\t\t}\r\n\r\n\t\t\tevent.preventDefault();\r\n\t\t}, false);\r\n\r\n\t\tvar item = document.createElement(\"li\");\r\n\t\titem.appendChild(link);\r\n\r\n\t\tvar menuItems = menu.getElementsByTagName(\"li\");\r\n\t\tmenu.insertBefore(item, menuItems[menuItems.length - 1]);\r\n\r\n\t\twindow.addEventListener(\"resize\", adjustMenuTimer, false);\r\n\t}", "function loadSettings()\n {\n if (typeof localStorage.unit != 'undefined') {\n my.settings.unit = localStorage.unit\n }\n }", "function toggleDevOptions() {\n returnURL.val('auto#');\n lang.val('default');\n lang.parent().parent().toggle();\n referer.parent().parent().toggle();\n returnURL.parent().parent().toggle();\n oauthState.parent().parent().hide();\n}", "function configureSettings() {\n // Load all the saved settings into the preferences object.\n PREF_OBJ.load();\n return true;\n}", "function settings() {\n\n\t$('.slimScrollDiv').hide();\n\t$('#back-top').hide();\n\t$('#sidebar-top').show();\n\t$('#delete-message').hide();\n\t$('#compose-message').show();\n\t$('#process-send').hide();\n\n\t//flag currrent page as LIST\n\t$('.message-elem').hide();\n\t$('.current-page').attr('id', 'list');\t\n\t$('#folder-name').html('Settings');\n\t$('.loading-messages').hide();\n\t$('#message-settings').show();\n\n\t//get settings variables from local storage\n\twindow.url \t\t= localStorage.getItem('url');\n \twindow.interval = parseInt(localStorage.getItem('interval'));\n\t//populate fields, URL\n\t$('#settings-url').val(window.url);\n\n\t//populate fields, INTERVAL\n\t$('#settings-interval option').\n\t\tremoveAttr('selected').\n\t\tfilter('[value='+window.interval+']').\n\t\tattr('selected', true);\n\t\n\t$('#settings-interval-button span').html(window.interval);\n\n\t//on click save settings button\n\t$('#save-settings').click(function() {\n\t\t//save new settigns to local storage\n\t\tlocalStorage.setItem('url', \t\t$('#settings-url').val());\n\t\tlocalStorage.setItem('interval', \t$('#settings-interval').val());\n\t\t//then update the GLOBAL VARIABLES\n\t\twindow.url \t\t= localStorage.getItem('url');\n \t\twindow.interval = localStorage.getItem('interval');\n \t\tSOAP_URL \t\t= window.url; \n \t\t\n \t\tcheckInbox();\n\n\t\tnotification('Settings successfully saved');\t\n\t});\n\n\treturn false;\n}", "function loadUserSettings(){\n\t\tvar user = wialon.core.Session.getInstance().getCurrUser();\n\t\tvar settings = user.getCustomProperty('__app__logbook_settings', '{}');\n\t\tsettings = JSON.parse(settings);\n\t\thome = office = {\n\t\t\t'name': '',\n\t\t\t'id': ''\n\t\t};\n\t\thoh = payment = false;\n\t\theader_tmpl = footer_tmpl = 1;\n\t\tpayment_less = payment_more = payment_mileage = 0;\n\n\t\tif (settings['geofences']) {\n\t\t\tif (settings['geofences']['home']) {\n\t\t\t\thome = settings['geofences']['home'];\n\t\t\t}\n\n\t\t\tif (settings['geofences']['office']) {\n\t\t\t\toffice = settings['geofences']['office'];\n\t\t\t}\n\t\t}\n\t\tif (settings['print']) {\n\t\t\tif (settings['print']['hoh']) {\n\t\t\t\thoh = settings['print']['hoh'];\n\t\t\t}\n\t\t\tif (settings['print']['payment']) {\n\t\t\t\tpayment = settings['print']['payment'];\n\t\t\t}\n\t\t\tif (settings['print']['header_tmpl']) {\n\t\t\t\theader_tmpl = settings['print']['header_tmpl'];\n\t\t\t}\n\t\t\tif (settings['print']['footer_tmpl']) {\n\t\t\t\tfooter_tmpl = settings['print']['footer_tmpl'];\n\t\t\t}\n\t\t\tif (settings['print']['payment_less']) {\n\t\t\t\tpayment_less = parseFloat(settings['print']['payment_less']);\n\t\t\t}\n\t\t\tif (settings['print']['payment_more']) {\n\t\t\t\tpayment_more = parseFloat(settings['print']['payment_more']);\n\t\t\t}\n\t\t\tif (settings['print']['payment_mileage']) {\n\t\t\t\tpayment_mileage = parseInt(settings['print']['payment_mileage']);\n\t\t\t}\n\t\t}\n\t\t// ui settings\n\t\tif (settings['ui_flags']) {\n\t\t\tui_flags = settings['ui_flags'];\n\t\t}\n\t\t// mileage\n\t\tif (settings['mileage_values']) {\n\t\t\tmileage_values = settings['mileage_values'];\n\t\t}\n\t}", "function restoreOptions() {\n\tchrome.storage.sync.get(['savedOnce', 'displayType', 'increment', 'contentIsVisible', 'staticView', 'secretMenu'], function(data) {\n\t\tsavedOnce = data.savedOnce;\n\t\tdisplayType = data.displayType;\n\t\tincrement = data.increment;\n\t\tcontentIsVisible = data.contentIsVisible;\n\t\tstaticView = data.staticView;\n\t\tsecretMenu = data.secretMenu;\n\n\t\tif (displayType == \"fill\") { document.getElementById(\"fillRadio\").checked=true;\n\t\t\t} else { document.getElementById(\"fillRadio\").checked=false; }\n\t\tif (displayType == \"hybrid\") { document.getElementById(\"hybridRadio\").checked=true;\n\t\t\t} else { document.getElementById(\"hybridRadio\").checked=false; }\n\t\tif (displayType == \"none\") { document.getElementById(\"noneRadio\").checked=true;\n\t\t\t} else { document.getElementById(\"noneRadio\").checked=false; }\n\t\tif (displayType == \"yellowHybrid\") { document.getElementById(\"yellowHybridRadio\").checked=true;\n\t\t\t} else { document.getElementById(\"yellowHybridRadio\").checked=false; }\n\t\tif (displayType == \"blackHybrid\") { document.getElementById(\"blackHybridRadio\").checked=true;\n\t\t\t} else { document.getElementById(\"blackHybridRadio\").checked=false; }\n\n\t\tif (isNaN(increment)) { document.getElementById(\"incrementField\").value = 50;\n\t\t} else { document.getElementById(\"incrementField\").value = increment;\n\t\t}\n\n\t\tif (contentIsVisible) { \n\t\t\tdocument.getElementById(\"showArticleContentCheckbox\").checked=true;\n\t\t} else { \n\t\t\tdocument.getElementById(\"showArticleContentCheckbox\").checked=false; \n\t\t\thideWikiContent();\n\t\t}\n\n\t\tif (staticView) { \n\t\t\tdocument.getElementById(\"staticViewCheckbox\").checked=true;\n\t\t} else { \n\t\t\tdocument.getElementById(\"staticViewCheckbox\").checked=false; \n\n\t\t\t// If staticView is false, then turn on bind parallax effect to scroll\n\t\t\t$(document).ready(function() {\t\n\t\t\t $(window).bind('scroll',function(e){\n\t\t\t \tscrolled = $(window).scrollTop();\n\t\t\t\t\t// Go through each wikilink...\n\t\t\t\t\tfor (index = 0; index < wikilinks.length; index++) {\n\t\t\t\t\t\tmoveCircles(index);\n\t\t\t\t }\n\t\t\t });\n\t\t\t});\n\n\t\t}\n\n\t\tif (secretMenu) { $(\"#displayChoicesHidden\").css(\"display\",\"inline-block\"); }\n\n\t\t// If settings have never been saved, automatically set fill = true, increment = 50, contentIsVisible = true, staticView = false\n\t\tif (!savedOnce) {\n\t\t\tchrome.storage.sync.set({\"displayType\": \"hybrid\"}, function() {});\n\t\t\tchrome.storage.sync.set({\"increment\": 50}, function() {});\n\t\t\tdisplayType = \"hybrid\";\n\t\t\tdocument.getElementById(\"hybridRadio\").checked=true;\n\t\t\t$(\"#optionsForm\").slideToggle();\n\t\t\tincrement = 50;\n\t\t\tcontentIsVisible = true;\n\t\t\tstaticView = false;\n\t\t} \n\n\t});\n}", "function addSettings() {\n if (!$(\".gt2-settings\").length) {\n let elem = `\n <div class=\"gt2-settings-header\">\n <div class=\"gt2-settings-back\">\n <div></div>\n ${getSvg(\"arrow\")}\n </div>\n ${SCRIPT_NAME} v${GM_info.script.version}\n </div>\n <div class=\"gt2-settings\">\n <div class=\"gt2-settings-sub-header\">${getLocStr(\"settingsHeaderTimeline\")}</div>\n ${getSettingTogglePart(\"forceLatest\")}\n ${getSettingTogglePart(\"disableAutoRefresh\")}\n ${getSettingTogglePart(\"keepTweetsInTL\")}\n ${getSettingTogglePart(\"biggerPreviews\")}\n <div class=\"gt2-settings-seperator\"></div>\n\n <div class=\"gt2-settings-sub-header\">${getLocStr(\"statsTweets\")}</div>\n ${getSettingTogglePart(\"hideTranslateTweetButton\")}\n ${getSettingTogglePart(\"tweetIconsPullLeft\")}\n <div class=\"gt2-settings-seperator\"></div>\n\n <div class=\"gt2-settings-sub-header\">${getLocStr(\"settingsHeaderSidebars\")}</div>\n ${getSettingTogglePart(\"stickySidebars\")}\n ${getSettingTogglePart(\"smallSidebars\")}\n ${getSettingTogglePart(\"hideTrends\")}\n ${getSettingTogglePart(\"leftTrends\")}\n ${getSettingTogglePart(\"show10Trends\")}\n <div class=\"gt2-settings-seperator\"></div>\n\n <div class=\"gt2-settings-sub-header\">${getLocStr(\"navProfile\")}</div>\n ${getSettingTogglePart(\"legacyProfile\")}\n ${getSettingTogglePart(\"squareAvatars\")}\n ${getSettingTogglePart(\"enableQuickBlock\")}\n ${getSettingTogglePart(\"leftMedia\")}\n <div class=\"gt2-settings-seperator\"></div>\n\n <div class=\"gt2-settings-sub-header\">${getLocStr(\"settingsHeaderGlobalLook\")}</div>\n ${getSettingTogglePart(\"hideFollowSuggestions\", `\n <div class=\"${GM_getValue(\"opt_gt2\").hideFollowSuggestions ? \"\" : \"gt2-hidden\"}\" data-setting-name=\"hideFollowSuggestionsSel\">\n ${[\"topics\", \"users\", \"navLists\"].map((e, i) => {\n let x = Math.pow(2, i)\n return `<div>\n <span>${getLocStr(e)}</span>\n <div class=\"gt2-setting-toggle ${(GM_getValue(\"opt_gt2\").hideFollowSuggestionsSel & x) == x ? \"gt2-active\" : \"\"}\" data-hfs-type=\"${x}\">\n <div></div>\n <div>${getSvg(\"tick\")}</div>\n </div>\n </div>\n `}).join(\"\")}\n </div>\n `)}\n ${getSettingTogglePart(\"fontOverride\", `\n <div class=\"gt2-setting-input\" data-setting-name=\"fontOverrideValue\">\n <input type=\"text\" value=\"${GM_getValue(\"opt_gt2\").fontOverrideValue}\">\n </div>\n `)}\n ${getSettingTogglePart(\"colorOverride\", `<div class=\"gt2-pickr\"></div>`)}\n ${getSettingTogglePart(\"hideMessageBox\")}\n ${getSettingTogglePart(\"rosettaIcons\")}\n ${getSettingTogglePart(\"favoriteLikes\")}\n <div class=\"gt2-settings-seperator\"></div>\n\n <div class=\"gt2-settings-sub-header\">${getLocStr(\"settingsHeaderOther\")}</div>\n ${getSettingTogglePart(\"updateNotifications\")}\n ${getSettingTogglePart(\"expandTcoShortlinks\")}\n </div>\n `\n let $s = $(\"main section[aria-labelledby=detail-header]\")\n if ($s.length) {\n $s.prepend(elem)\n } else {\n $(\"main > div > div > div\").append(`\n <section>${elem}</section>\n `)\n }\n // add color pickr\n Pickr.create({\n el: \".gt2-pickr\",\n theme: \"classic\",\n lockOpacity: true,\n useAsButton: true,\n appClass: \"gt2-color-override-pickr\",\n inline: true,\n default: `rgb(${GM_getValue(\"opt_gt2\").colorOverrideValue})`,\n components: {\n preview: true,\n hue: true,\n interaction: {\n hex: true,\n rgba: true,\n hsla: true,\n hsva: true,\n cmyk: true,\n input: true\n }\n }\n })\n .on(\"change\", e => {\n let val = e.toRGBA().toString(0).slice(5, -4)\n GM_setValue(\"opt_gt2\", Object.assign(GM_getValue(\"opt_gt2\"), { colorOverrideValue: val}))\n document.documentElement.style.setProperty(\"--color-override\", val)\n })\n disableTogglesIfNeeded()\n }\n }", "function goToSettings(){\n\tif(SOUNDS_MODE){\n\t\taudioClick.play();\t\n\t}\n\t\n\t//load data\n\tvar player = getCurrentPlayer();\n\t\n\tmtbImport(\"settings.js\");\n\tbuildSettingsView();\n\tviewSettings.fireEvent('updateSettingsUI', {player:player});\n\tviewSettings.animate(anim_in);\n}", "function ac_showConfigPanel() {\n\tac_switchTool(\"cfg\");\n}", "function makeSettings() {\n\t\tvar i,\n\t\t\tdata = $.data(element, colorbox);\n\t\t\n\t\tif (data == null) {\n\t\t\tsettings = $.extend({}, defaults);\n\t\t\tif (console && console.log) {\n\t\t\t\tconsole.log('Error: cboxElement missing settings object');\n\t\t\t}\n\t\t} else {\n\t\t\tsettings = $.extend({}, data);\n\t\t}\n\t\t\n\t\tfor (i in settings) {\n\t\t\tif ($.isFunction(settings[i]) && i.slice(0, 2) !== 'on') { // checks to make sure the function isn't one of the callbacks, they will be handled at the appropriate time.\n\t\t\t\tsettings[i] = settings[i].call(element);\n\t\t\t}\n\t\t}\n\t\t\n\t\tsettings.rel = settings.rel || element.rel || $(element).data('rel') || 'nofollow';\n\t\tsettings.href = settings.href || $(element).attr('href');\n\t\tsettings.title = settings.title || element.title;\n\t\t\n\t\tif (typeof settings.href === \"string\") {\n\t\t\tsettings.href = $.trim(settings.href);\n\t\t}\n\t}", "function loadPageVariables() {\r\n \"use strict\";\r\n var tmp = JSON.parse(localStorage.getItem('TrimpzSettings'));\r\n if (tmp !== null) {\r\n trimpzSettings = tmp;\r\n }\r\n}", "function saveOptions() {\n\tlocalStorage[\"default_folder_id\"] = $('#folder_list :selected').val();\n\tlocalStorage[\"dial_columns\"] = $('#dial_columns :selected').val();\n\tlocalStorage[\"dial_width\"] = $('#dial_width :selected').val();\n\tsaveCheckbox('drag_and_drop');\n\tsaveCheckbox('force_http');\n\tsaveCheckbox('show_advanced');\n\tsaveCheckbox('show_new_entry');\n\tsaveCheckbox('show_folder_list');\n\tsaveCheckbox('show_subfolder_icons');\n\tlocalStorage[\"thumbnail_url\"] = $('#thumbnail_url').val();\n\n\twindow.location = \"newtab.html\";\n}", "function startup_checks(quiet)\n {\n\tvar start_page = \"https://github.com/lemonsqueeze/scriptweeder/wiki/scriptweeder-userjs-installed-!\";\t\n\tif (in_iframe()) // don't redirect to start page in iframes.\n\t return;\n\t\n // first run, send to start page\n if (global_setting('mode') == '') // will work with old settings\t\n {\n\t // userjs_only: can't wait until we get there, userjs on https may not be enabled ...\t \n set_global_setting('version_number', version_number);\n set_global_setting('version_type', version_type);\n set_global_setting('mode', default_mode);\n\t default_filter_settings();\t \n\n\t if (!quiet)\n\t\tlocation.href = start_page;\t \n }\n\t\n\t// userjs_only: upgrade from 1.44 or before\n\tif (global_setting('version_number') == '')\n\t{\n\t set_global_setting('version_number', version_number);\n\t set_global_setting('version_type', version_type);\n\t // didn't exist:\n\t set_global_setting('helper_blacklist',\tserialize_name_hash(default_helper_blacklist) );\n\t}\n\n\t// upgrade from previous version\n\tif (global_setting('version_number') != version_number)\n\t{\n\t var from = global_setting('version_number');\n\t set_global_setting('version_number', version_number);\n\n\t // 1.5.2 style upgrade\n\t if (cmp_versions(from, \"1.5.2\") && global_setting('style') != '')\n\t {\n\t\tset_global_setting('style', '');\n\t\talert(\"ScriptWeeder 1.5.2 upgrade notice:\\n\\n\" +\n\t\t \"The interface changed a bit, updated custom styles are available on the wiki page.\");\n\t }\n\t}\n\n\t// convert pre 1.5.1 list settings format\n\tif (global_setting('whitelist')[0] == '.')\n\t convert_old_list_settings();\n }", "function saveSettings() {\n localStorage.setItem(\"emailToggle\", emailToggleButton.checked);\n localStorage.setItem(\"privacyToggle\", privacyToggleButton.checked);\n localStorage.setItem(\"timezone\", select.value);\n}", "function restoreOptions() {\n\tdocument.getElementById(\"mail\").value = chrome.extension.getBackgroundPage().settings.getMail();\n\tdocument.getElementById(\"url\").value = chrome.extension.getBackgroundPage().settings.getURL();\n\tdocument.getElementById(\"contextMenu\").checked = chrome.extension.getBackgroundPage().settings.isContextMenu();\n\tdocument.getElementById(\"insertIntoPage\").checked = chrome.extension.getBackgroundPage().settings.isInsertIntoPage();\n\tdocument.getElementById(\"copyToClipboard\").checked = chrome.extension.getBackgroundPage().settings.isCopyToClipboard();\n\tdocument.getElementById(\"dateFormat\").value = chrome.extension.getBackgroundPage().settings.getDateFormat();\n }", "function saveconfig() {\n // sauvegarde des options de la fenêtre de configuration\n display_button = npn_cb_button.checked;\n GM.setValue(\"display_button\", display_button);\n button_icon = npn_in_button.value.trim();\n if(button_icon === \"\") {\n button_icon = default_icon;\n }\n GM.setValue(\"button_icon\", button_icon);\n mass_opener = npn_cb_mass.checked;\n GM.setValue(\"mass_opener\", mass_opener);\n max_tab = parseInt(npn_in_maxtab.value.trim(), 10);\n max_tab = Math.max(max_tab, 1);\n max_tab = Math.min(max_tab, 99);\n if(isNaN(max_tab)) max_tab = default_max_tab;\n GM.setValue(\"max_tab\", max_tab);\n reverse_order = npn_cb_reverseorder.checked;\n GM.setValue(\"reverse_order\", reverse_order);\n color_gradient = npn_cb_gradient.checked;\n GM.setValue(\"color_gradient\", color_gradient);\n color_start_type = npn_rd_color_start_auto.checked ? \"auto\" :\n npn_rd_color_start_trans.checked ? \"trans\" : \"perso\";\n GM.setValue(\"color_start_type\", color_start_type);\n color_start_perso = npn_co_color_start_perso.value.toLowerCase();\n GM.setValue(\"color_start_perso\", color_start_perso);\n color_end_type = npn_rd_color_end_auto.checked ? \"auto\" :\n npn_rd_color_end_trans.checked ? \"trans\" : \"perso\";\n GM.setValue(\"color_end_type\", color_end_type);\n color_end_perso = npn_co_color_end_perso.value.toLowerCase();\n GM.setValue(\"color_end_perso\", color_end_perso);\n limit_type = npn_rd_limit_fixed.checked ? \"fixed\" : \"auto\";\n GM.setValue(\"limit_type\", limit_type);\n fixed_limit = parseInt(npn_in_limit_fixed.value.trim(), 10);\n fixed_limit = Math.max(fixed_limit, 1);\n fixed_limit = Math.min(fixed_limit, 99999);\n if(isNaN(fixed_limit)) fixed_limit = default_fixed_limit;\n GM.setValue(\"fixed_limit\", fixed_limit);\n progress_type = npn_rd_progress_lin.checked ? \"lin\" : \"log\";\n GM.setValue(\"progress_type\", progress_type);\n smaller_text = npn_cb_smallertext.checked;\n GM.setValue(\"smaller_text\", smaller_text);\n go_top = npn_cb_gotop.checked;\n hash_haut = go_top ? \"#haut\" : \"\";\n GM.setValue(\"go_top\", go_top);\n refresh_click = npn_cb_refreshclick.checked;\n GM.setValue(\"refresh_click\", refresh_click);\n delay_click = parseInt(npn_in_refreshclick.value.trim(), 10);\n delay_click = Math.max(delay_click, 1);\n delay_click = Math.min(delay_click, 99);\n if(isNaN(delay_click)) delay_click = default_delay_click;\n GM.setValue(\"delay_click\", delay_click);\n display_totals = npn_cb_displaytotals.checked;\n GM.setValue(\"display_totals\", display_totals);\n refresh_page = npn_cb_refreshpage.checked;\n GM.setValue(\"refresh_page\", refresh_page);\n delay_page = parseInt(npn_in_refreshpage.value.trim(), 10);\n delay_page = Math.max(delay_page, 1);\n delay_page = Math.min(delay_page, 99);\n if(isNaN(delay_page)) delay_page = default_delay_page;\n GM.setValue(\"delay_page\", delay_page);\n // réinitialisation des computed colors\n computed_colors = {};\n // masquage de la fenêtre de configuration\n hideconfig();\n // application des nouveaux paramètres\n apply_config();\n}", "function setPage() {\n setNavigation();\n $('#tabs').tabs();\n resetGeneralDetailsForm();\n resetReportBugsForm();\n getAdminDetails();\n loadTermsOfUseDetails();\n}", "function settings(path, url, options) {\n // A. URL fill material\n preURL = \"\\\"\"\n postURL = \"\\\"\"\n var urlComp = preURL + url + postURL;\n // B. put date as folder name\n // command \"-O\" determines the a target folder\n // here relative path e.g. = \"./2016-12-24\"\n var preFolder = \"-O \\\"./\";\n // Daten -> look \"Workaround TIMESTAMP\" -> basic format is \"YYYY-MM-DD\"\n var date = fnToISO();\n var postFolder = \"\\\"\";\n var folder = preFolder + date + postFolder;\n // C. Options\n // value \"options\" is a parameter from above and won't be changed in this function\n\n // D. Return the terminal command as a strings\n return specifics = path + \" \" + urlComp + \" \" + folder + \" \" + options;\n}", "function openSettingsWindow() { //Create settings window\r\n\t\r\n //Define html for settings window\r\n var settingsHTML=\"<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.0 Transitional//EN\\\" \\\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\\\">\\n\\n<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\" lang=\\\"en-gb\\\" xml:lang=\\\"en-gb\\\">\\n<head>\\n <meta content=\\\"text/html; charset=ISO-8859-1\\\" http-equiv=\\\"content-type\\\" />\\n <title>wTorrent Options</title>\\n <style type=\\\"text/css\\\">\\n body {\\n\t\tbackground-color: rgb(212, 208, 200);\\n }\\n body,input,select {\\n font-size: 10pt;\\n font-family: Arial;\\n }\\n input.text {\\n\t\twidth: 100%;\\n\t\tmargin-bottom: 4px;\\n\t}\\n\tinput.checkbox {\\n\t\tmargin-bottom: 4px;\\n\t}\\n\tp.small {\\n\t\tfont-size: 6pt;\\n\t\tmargin: 0; padding: 0; margin-bottom: 4px;\\n\t}\\n </style>\\n</head>\\n\\n<body>\\n\\n\t<div style=\\\"width: 275px;\\\">\\n\\n\t\t<div style=\\\"text-align: center;\\\">\\n\t\t\t<h1>wTorrent Options</h1>\\n\t\t</div>\\n\\n\t\t<hr />\\n\t \\n\t\t<label>wTorrent Host Name or IP</label><br />\\n\t\t<input class=\\\"text\\\" type=\\\"text\\\" name=\\\"wtorrent_host\\\" id=\\\"wtorrent_host\\\" value=\\\"\\\" /><br />\\n\\n\t\t<label>wTorrent Port</label><br />\\n\t\t<input class=\\\"text\\\" type=\\\"text\\\" name=\\\"wtorrent_port\\\" id=\\\"wtorrent_port\\\" value=\\\"\\\" /><br />\\n\t\t\\n\t\t<input class=\\\"checkbox\\\" type=\\\"checkbox\\\" value=\\\"true\\\" name=\\\"wtorrent_ssl\\\" id=\\\"wtorrent_ssl\\\" /><label for=\\\"wtorrent_ssl\\\">Use SSL to connect to wTorrent?</label>\\n\t\t<p class=\\\"small\\\">Checking this will cause you to use an SSL (https) connection for wTorrent.</p>\\n\\n\t\t<label>wTorrent User Name</label><br />\\n\t\t<input class=\\\"text\\\" type=\\\"text\\\" name=\\\"wtorrent_username\\\" id=\\\"wtorrent_username\\\" value=\\\"\\\" /><br />\\n\t\t\\n\t\t<label>wTorrent Password</label><br />\\n\t\t<input class=\\\"text\\\" type=\\\"password\\\" name=\\\"wtorrent_password\\\" id=\\\"wtorrent_password\\\" value=\\\"\\\" /><br />\\n\t\t\\n\t\t<label>wTorrent Download Directory</label><br />\\n\t\t<input class=\\\"text\\\" type=\\\"text\\\" name=\\\"wtorrent_downloaddirectory\\\" id=\\\"wtorrent_downloaddirectory\\\" value=\\\"\\\" /><br />\\n\t\t<p class=\\\"small\\\">Download directory should be set to \\\"default\\\" to accept the default setting configured in wTorrent, or changed to an absolute path. You must allow files to be saved to a non-standard source when not using \\\"default\\\".</p>\\n\t\t\\n\t\t<input class=\\\"checkbox\\\" type=\\\"checkbox\\\" value=\\\"true\\\" name=\\\"wtorrent_alwaysdownloadprivate\\\" id=\\\"wtorrent_alwaysdownloadprivate\\\" /><label for=\\\"wtorrent_alwaysdownloadprivate\\\">Allways add in private mode?</label>\\n\t\t<p class=\\\"small\\\">This takes precedence over \\\"Show links for private mode add\\\" preference. If this is checked only the wTorrent icon will show and it will always add in private mode</p>\\n\\n\t\t<input class=\\\"checkbox\\\" type=\\\"checkbox\\\" value=\\\"true\\\" name=\\\"wtorrent_showprivatelinks\\\" id=\\\"wtorrent_showprivatelinks\\\" /><label for=\\\"wtorrent_showprivatelinks\\\">Show links for private mode add?</label>\\n\t\t<p class=\\\"small\\\">Checking this will show a \\\"lock\\\" icon for adding torrents in private mode.</p>\\n\\n\t\t<input class=\\\"checkbox\\\" type=\\\"checkbox\\\" value=\\\"true\\\" name=\\\"wtorrent_autostarttorrents\\\" id=\\\"wtorrent_autostarttorrents\\\" /><label for=\\\"wtorrent_autostarttorrents\\\">Auto-Start torrents?</label><br />\\n\\n\t\t<br />\\n\t\t<hr />\\n\t\t<input id=\\\"save\\\" value=\\\"Save Changes\\\" type=\\\"button\\\" />\\n\\n\t\t<input value=\\\"Cancel\\\" onclick=\\\"window.close()\\\" type=\\\"button\\\" />\\n\t</div>\\n</body>\\n</html>\";\r\n\r\n //Add default variable values to settins window html\r\n settingsHTML=settingsHTML.replace(/id=\"wtorrent_host\" value=\"\"/,'id=\"wtorrent_host\" value=\"'+wtorrent_host+'\"')\r\n settingsHTML=settingsHTML.replace(/id=\"wtorrent_port\" value=\"\"/,'id=\"wtorrent_port\" value=\"'+wtorrent_port+'\"')\r\n settingsHTML=settingsHTML.replace(/id=\"wtorrent_username\" value=\"\"/,'id=\"wtorrent_username\" value=\"'+wtorrent_username+'\"')\r\n settingsHTML=settingsHTML.replace(/id=\"wtorrent_password\" value=\"\"/,'id=\"wtorrent_password\" value=\"'+wtorrent_password+'\"')\r\n settingsHTML=settingsHTML.replace(/id=\"wtorrent_downloaddirectory\" value=\"\"/,'id=\"wtorrent_downloaddirectory\" value=\"'+wtorrent_downloaddirectory+'\"')\r\n\t\t\r\n\t\tif (wtorrent_ssl) { settingsHTML=settingsHTML.replace(/id=\"wtorrent_ssl\"/,'id=\"wtorrent_ssl\" checked=\"checked\"'); }\r\n if (wtorrent_alwaysdownloadprivate) { settingsHTML=settingsHTML.replace(/id=\"wtorrent_alwaysdownloadprivate\"/,'id=\"wtorrent_alwaysdownloadprivate\" checked=\"checked\"'); }\r\n if (wtorrent_showprivatelinks) { settingsHTML=settingsHTML.replace(/id=\"wtorrent_showprivatelinks\"/,'id=\"wtorrent_showprivatelinks\" checked=\"checked\"'); }\r\n if (wtorrent_autostarttorrents) { settingsHTML=settingsHTML.replace(/id=\"wtorrent_autostarttorrents\"/,'id=\"wtorrent_autostarttorrents\" checked=\"checked\"'); }\r\n \r\n //Open Settings window\r\n settingsWindow=window.open(\"\",\"settingsWindow\",\"height=520,width=298,left=100,top=100,resizable=yes,scrollbars=no,toolbar=no,status=no\")\r\n settingsWindow.document.write(settingsHTML) //Write html to window\r\n settingsWindow.document.close() //Close document to writing\r\n\r\n //Add Settings Window Listeners\r\n settingsWindow.document.getElementById(\"save\").addEventListener(\"click\", saveSettings, false); //Add click event listener to Save Settings button, calls saveSettings()\r\n settingsWindow.addEventListener(\"unload\", cleanupSettingsListeners, false); //Add unload event listener to window, calls cleanupListeners()\r\n }", "function saveSettings() {\n $('#settings').removeClass('opensettings');\n}", "function _onEveryPage() {\n _updateConfig();\n\t_defineCookieDomain();\n\t_defineAgencyCDsValues();\n}", "function init() {\n\t\tif (!localStorage.getItem(SETTINGS_NAME)){\n\t\t\tlocalStorage.setItem(SETTINGS_NAME, JSON.stringify({}))\n\t\t}\n\n\t\t$('#importButton').click(() => {\n\t\t\tlet importSuccess = importSettingsHanlder($('textarea#importExportTextarea').val())\n\t\t\tif (importSuccess) {\n\t\t\t\tmarkProblem('textarea#importExportTextarea', false)\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmarkProblem('textarea#importExportTextarea', true)\n\t\t\t}\n\t\t})\n\n\t\t$('#exportButton').click(() => {\n\t\t\t$('textarea#importExportTextarea').val(exportSettings())\n\t\t})\n\n\t\t$('#downloadSettingsLink').click(() => {\n\t\t\tlet link = document.getElementById('downloadSettingsLink');\n\t\t\tlink.href = makeTextFile(localStorage.getItem(SETTINGS_NAME))\n\t\t\t$('#downloadSettingsLink').attr('download', `rph-tools-settings.txt`)\n\t\t})\n\n\t\t$('#importFileInput').change(() => {\n\t\t\tlet file = $(\"#importFileInput\")[0].files[0];\n\t\t\t(async () => {\n\t\t\t\tfileContent = await file.text();\n\t\t\t\tlet successfulImport = importSettingsHanlder(fileContent)\n\n\t\t\t\tif (successfulImport === false) {\n\t\t\t\t\t$('#importSettingsStatus').first().text('There was a problem with the import')\t\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$('#importSettingsStatus').first().text('Import successful')\n\t\t\t\t}\n\t\t\t})();\n\t\t})\n\t\n\n\t\t$('#printSettingsButton').click(() => {\n\t\t\tprintSettings()\n\t\t})\n\n\t\t$('#deleteSettingsButton').click(() => {\n\t\t\tdeleteSettingsHanlder()\n\t\t})\n\t}", "function addDefaultSettings(action, settings) {\n if (action == \"com.vantdev.r3sd.toggleboxoptionbutton\")\n {\n if (!settings.hasOwnProperty(\"box_option\")) {\n settings.box_option = BOX_OPTIONS.DO_NOTHING;\n }\n }\n else if (action == \"com.vantdev.r3sd.requestboxbutton\")\n {\n if (!settings.hasOwnProperty(\"serve_penalty\")) settings.serve_penalty = false;\n if (!settings.hasOwnProperty(\"driver_change\")) settings.driver_change = false;\n if (!settings.hasOwnProperty(\"front_tires\")) settings.front_tires = false;\n if (!settings.hasOwnProperty(\"rear_tires\")) settings.rear_tires = false;\n if (!settings.hasOwnProperty(\"fix_bodywork\")) settings.fix_bodywork = false;\n if (!settings.hasOwnProperty(\"fix_front_aero\")) settings.fix_front_aero = false;\n if (!settings.hasOwnProperty(\"fix_rear_aero\")) settings.fix_rear_aero = false;\n if (!settings.hasOwnProperty(\"fix_suspension\")) settings.fix_suspension = false;\n if (!settings.hasOwnProperty(\"refuel_option\")) settings.refuel_option = BOX_OPTIONS.DO_NOTHING;\n if (!settings.hasOwnProperty(\"use_toggle_buttons_only\")) settings.use_toggle_buttons_only = false;\n if (!settings.hasOwnProperty(\"request_box\")) settings.request_box = false;\n if (!settings.hasOwnProperty(\"close_pit_menu\")) settings.close_pit_menu = false;\n }\n\n return settings;\n}", "function saveExtSettings() {\n var settings = {\n \"showFoldersInList\": showFoldersInList,\n \"showSortDataInList\": showSortDataInList,\n \"numberOfFiles\": numberOfFiles,\n \"zoomFactor\": zoomFactor,\n \"orderBy\": orderBy\n };\n localStorage.setItem('perpectiveGridSettings', JSON.stringify(settings));\n }", "function restore_options() {\n chrome.storage.sync.get(\n\t\tchrome.extension.getBackgroundPage().defaultSettings, \n \t\tfunction (settings) {\n \t\t\tdocument.getElementById(settings.o_theme).checked = true;\n \t\t\tdocument.getElementById(settings.o_live_output).checked = true;\n \t\t\tfor (let i = 0; i < settings.o_live_direction.length; i++) {\n \t\t\t\tdocument.getElementById(settings.o_live_direction[i]).checked = true;\n \t\t\t}\n \t\t\tfor (let i = 0; i < settings.o_live_type.length; i++) {\n \t\t\t\tdocument.getElementById(settings.o_live_type[i]).checked = true;\n \t\t\t}\n \t\t\tdocument.getElementById(settings.o_live_donation).checked = true;\n\n \t\t\tchrome.extension.getBackgroundPage().currentSettings = settings;\n \t\t}\n \t);\n}", "_initializeDefaultSettings(settings) {\r\n for (let name in argvOptions) {\r\n let option = argvOptions[name];\r\n\r\n let realName = name;\r\n if (option.name) {\r\n realName = option.name;\r\n }\r\n\r\n if (!_.has(settings, realName)) {\r\n if (realName == 'paths') {\r\n settings['paths'] = { '' : path.resolve('') };\r\n }\r\n else if (_.has(option, 'default')) {\r\n settings[realName] = option['default'];\r\n }\r\n else if (option.type == 'flag') {\r\n // Flags default to false\r\n settings[realName] = false;\r\n }\r\n else if (option.type == 'array') {\r\n settings[realName] = [];\r\n }\r\n }\r\n }\r\n }", "function setupDefault() {\n}", "_ensureClientSettings() {\n if (!this.settings.autoboard) { this.toggleSetting(\"autoboard\"); }\n if (this.settings.bell) { this.toggleSetting(\"bell\"); }\n if (!this.settings.moreboards) { this.toggleSetting(\"moreboards\"); }\n if (!this.settings.notify) { this.toggleSetting(\"notify\"); }\n if (!this.settings.report) { this.toggleSetting(\"report\"); }\n this.setBoardstyle(3); // we don't get this to check w/ the other settings (although we could pull it)\n }", "function setDefaultCurrentSettings(settings) {\r\n\t\tdebug('setDefaultCurrentSettings');\r\n\t\tcurrentSettings = $.extend(true, {}, $.fn.nyroModal.settings, settings);\r\n\t\tcurrentSettings.selector = '';\r\n\t\tcurrentSettings.borderW = 0;\r\n\t\tcurrentSettings.borderH = 0;\r\n\t\tcurrentSettings.resizable = true;\r\n\t\tsetMargin();\r\n\t}", "function save_options() {\n\tsetLocal(\"sense_facebook\");\n\tsetLocal(\"sense_google\");\n\tsetLocal(\"sense_twitter\");\n\tsetLocal(\"sense_youtube\");\n\tsetLocal(\"sense_4Chan\");\n\tsetLocal(\"sense_selector\");\n\tsetLocal(\"sense_color\");\n\tcheckAPI();\n}", "function showGlobalConfig() {\n $(\"#global-setting\").show();\n $(\"#global-setting .modal-body\").html(\"\");\n settingTextarea = monaco.editor.create($(\"#global-setting .modal-body\")[0], {\n language: 'json',\n value:formatJson(JSON.stringify(rocketUser.setting)),\n wordWrap: 'on', //自行换行\n verticalHasArrows: true,\n horizontalHasArrows: true,\n scrollBeyondLastLine: false,\n contextmenu:false,\n automaticLayout: true,\n fontSize:13,\n minimap: {\n enabled: false // 关闭小地图\n }\n\n });\n}", "function updateSettingsFile() {\r\n\tvar fileId = BumpTop.openFile(\"sharingTemp.json\", \"w\");\r\n\tvar settings = $.map(tabArray, function (tab) { \r\n\t\treturn tab.dropAccessParams; \r\n\t});\r\n\tvar fileContents = JSON.stringify(settings);\r\n\tBumpTop.writeFile(fileId, fileContents);\r\n\tBumpTop.renameAndCloseFile(fileId, \"sharing.json\");\r\n}", "function scriptConfig() {\r\n\ttrace(\"scriptConfig() configuring the dialog\");\r\n\t\r\n\t// Configure Settings dialog\r\n\tGM_config.init('Emule Linker Settings dialog', {\r\n\t\t'section1' : { section: ['ed2k download mode', 'Please refer to your emule/amule/mldonkey configuration'], label: '', type: 'hidden'},\r\n\t\t/*'ed2kDlMethod': { label: 'Ed2k Download Method', title: 'local: local application that handle ed2k links (default)\\nemule: remote emule (via web frontend)\\namule: remote amule (via web frontend)\\nmldonkey: remote mldonkey (via web frontend)\\ncustom: custom server implementation (experimental)', type:'radio', options:['local','emule','amule','mldonkey','custom'], default: ed2kDlMethod },*/\r\n\t\t'ed2kDlMethod': { label: 'Ed2k Download Method', title: 'local: local application that handle ed2k links (default)\\nemule: remote emule (via web frontend)\\namule: remote amule (via web frontend)\\nmldonkey: remote mldonkey (via web frontend)\\ncustom: custom server implementation (experimental)', type:'select', options:{'local':'your system default','emule':'(remote) emule','amule':'(remote) amule','mldonkey':'(remote) mldonkey','custom':'custom (experimental)'}, default: ed2kDlMethod}, // default value doesn't work with a dropdown menu => see bugfix in the lib\r\n\t\t'emuleUrl': { label: 'Emule Url', title : 'The complete url of your emule web server ending by a / (example: http://127.0.0.1:4711/)', type: 'text', default: emuleUrl },\r\n\t\t'emulePwd': { label: 'Emule Password', title : 'the password you choose to access your emule web server', type: 'text', default: emulePwd },\r\n\t\t'emuleCat': { label: 'Category', title : 'categories available in your emule/amule application. You can add categories using the following template:\\ncategory_name1=corresponding_index_in_emule;category_name2=...\\nAdding a * before the name specify the default choice.\\nIf you don\\'t know what you are doing just specify this: *default=0', type: 'text', default: catToStr(emuleCat) },\r\n\t\t'section2' : { section: ['Popup Configuration', 'modify how the popup is displayed'], label: '', type: 'hidden'},\r\n\t\t'popupPos': { label: 'Popup Position', title : 'choosing \\'absolute\\', the popup will stay at the top. Choosing fixed, the popup will follow as you scroll within the page', type: 'radio', options:['absolute','fixed'], default: popupPos },\r\n\t\t'popupHeight': { label: 'Max Popup Height in px (0=unlimited)', title : 'Max height of the popup in pixels (0=unlimited)', type: 'int', default: popupHeight },\r\n\t\t'popupWidth': { label: 'Max Popup Width in px (0=unlimited)', title : 'Max width of the popup in pixels (0=unlimited)', type: 'int', default: popupWidth },\r\n\t\t'section3' : { section: ['Edit box Configuration', 'modify how the edit box is displayed'], label: '', type: 'hidden'},\r\n\t\t'editCol': { label: 'Number of columns', title : 'number of columns', type: 'radio', type: 'int', default: editCol },\r\n\t\t'editRow': { label: 'Number of rows', title : 'Number of rows', type: 'int', default: editRow },\r\n\t\t'editMaxLength': { label: 'MaxLength', title : 'Max number of char in the text area', type: 'int', 'default': editMaxLength },\r\n\t\t}, \r\n\t\t{\r\n\t\t//open: function() { GM_config.sections2tabs(); }, // not working (not included into the library)\r\n\t\tsave: function() { location.reload(); } // reload the page when configuration was changed\r\n\t\t}\r\n\t);\r\n\t\r\n\t// invoke the dialog\r\n\tif (GM_getValue(\"emule_config\", 0)<1)\r\n\t{\r\n\t\ttrace(\"scriptConfig() invoking the dialog\");\r\n\t\tGM_config.open();\r\n\t\tGM_setValue(\"emule_config\",1);\r\n\t}\r\n\r\n\t// store the settings\r\n\tsaveConfig();\r\n\r\n}", "function getSettingsAndStart() {\n chrome.storage.local.get(null, function (settings) {\n // Begin parsing and injecting views\n if (window.location.href.indexOf('spryker-simplicity') !== -1) {\n if (window.location.href.indexOf('merge_requests') !== -1) {\n if ($.isNumeric(window.location.pathname.split('/')[4])) {\n addPipelineButton()\n addEnvironmentButton()\n }\n }\n }\n })\n}", "function setOptions() {\n if(typeof window.dev === 'undefined' || typeof window.dev.i18n === 'undefined') {\n importScriptPage('MediaWiki:I18n-js/code.js', 'dev');\n }\n mw.hook('dev.i18n').add(function(i18no) {\n i18no.loadMessages('u:soap:MediaWiki:Custom-Reports/i18n.json').done(function(i18n) {\n options = {\n\n /* \n //BEGIN EXAMPLE\n example: {\n page: 'Page name the form is for',\n buttonText: 'Text for button to open form',\n form: 'HTML form for reporting users. Each input/textarea should have an id. any optional inputs should be marked with the `optional` class. If any attributes need URI encoding, the relevant inputs should have the `data-encode` attribute set to `true`.',\n // this is where the input ids in the form are matched to numbers\n // for use in the summary/submitted text\n formParams: {\n '$1': 'foo',\n '$2': 'bar'\n },\n submitText: 'Text to submit to the page. Any form parameters can be inserted via the key names in `formParams`',\n summary: 'Text used for the edit summary. Any form parameters can be inserted via the key names in `formParams`',\n sectionTitle: 'Text used as the section title. Any form parameters can be inserted via the key names in `formParams`'\n },\n // END EXAMPLE\n */\n\n profile: {\n page: 'Report:User_profile_headers',\n buttonText: i18n.msg(\"buttonProfile\").escape(),\n form: '<form class=\"WikiaForm ReportForm\" method=\"\" name=\"\" id=\"profile\">' +\n '<fieldset>' +\n '<div class=\"rf-wrapper\">' +\n '<div class=\"rf-section\" style=\"color:#F00;font-size:16px;\"><b>' + i18n.msg(\"formSocial\").escape() + '</b></div>' +\n '<div class=\"rf-section\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"formWikiName\").escape() + '</b></div>' +\n '<input id=\"wikiname\" class=\"rf-wikiname optional\" type=\"text\" placeholder=\"' + i18n.msg(\"formphWikiName\").escape() + '\"/>' +\n '</div>' + \n '<div class=\"rf-section\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"formWikiURL\").escape() + '</b></div>' +\n '<input id=\"wikiurl\" class=\"rf-wikiurl\" type=\"text\" placeholder=\"soap.fandom.com\"/>' +\n '</div>' +\n '<div class=\"rf-section\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"formUsername\").escape() + '</b> ' + i18n.msg(\"formOfBadUser\").escape() + ' (' + i18n.msg(\"formMultipleUsers\").escape() + ')</div>' +\n '<textarea name=\"\" id=\"user\" class=\"rf-wikiuser\" type=\"text\" placeholder=\"Rappy 4187\\nDucksoup\"></textarea>' +\n '</div>' +\n '<div class=\"rf-section\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"formReason\").escape() + '</b></div>' +\n '<textarea name=\"\" id=\"comment\" placeholder=\"' + i18n.msg(\"formphReason\").escape() + '\" class=\"optional\"></textarea>' +\n '</div>' +\n '<div class=\"rf-section\">' +\n '<div class=\"rf-checkbox rf-socks\"><input type=\"checkbox\" id=\"socks\" class=\"option-input optional\"/><label for=\"socks\">' + i18n.msg(\"formSockpuppet\").escape() + '</label>' + \n '<div class=\"rf-section rf-socks-box\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"formUsername\").escape() + '</b> ' + i18n.msg(\"formOfSock\").escape() +\n '<textarea name=\"\" id=\"sockusers\" class=\"rf-socks optional\" type=\"text\" placeholder=\"Rappy 4187\\nDucksoup\"></textarea>' +\n '</div>' +\n '</div>' +\n '</div>' + \n '<div class=\"rf-section\" style=\"color:#F00; font-size:16px; display:none;\" id=\"formAnon\"><b>' + i18n.msg(\"formAnon\").escape() + '</b></div>' +\n '</div>' +\n '</fieldset>' +\n '</form>',\n formParams: {\n '$1': 'wikiurl',\n '$2': 'wikiname',\n '$3': 'user',\n '$4': 'comment',\n '$5': 'user', // for different styling\n '$7': 'socks',\n '$8': 'sockusers'\n },\n submitText: '{{Report profile|$1\\n' +\n '|$4\\n' +\n '|$3\\n' +\n '$7$8' +\n '|' + c.wgUserName + '|' + '~~' + '~~' + '~}}',\n summary: 'New profile report ($2, $5)',\n sectionTitle: '$2'\n },\n vandalism: {\n page: 'Report:Vandalism',\n buttonText: i18n.msg(\"buttonVandalism\").escape(),\n form: '<form class=\"WikiaForm ReportForm\" method=\"\" name=\"\" id=\"vandalism\">' +\n '<fieldset>' +\n '<div class=\"rf-wrapper\">' +\n '<div class=\"rf-section\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"formWikiName\").escape() + '</b></div>' +\n '<input id=\"wikiname\" class=\"rf-wikiname optional\" type=\"text\" placeholder=\"SOAP Wiki\"/>' +\n '</div>' + \n '<div class=\"rf-section\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"formWikiURL\").escape() + '</b></div>' +\n '<input id=\"wikiurl\" class=\"rf-wikiurl\" type=\"text\" placeholder=\"soap.fandom.com\"/>' +\n '</div>' +\n '<div class=\"rf-section\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"formUsername\").escape() + '</b> ' + i18n.msg(\"formOfBadUser\").escape() + ' (' + i18n.msg(\"formMultipleUsers\").escape() + ')</div>' +\n '<textarea name=\"\" id=\"user\" class=\"rf-wikiuser\" type=\"text\" placeholder=\"Merrystar\\nBertH\"></textarea>' +\n '</div>' +\n '<div class=\"rf-section\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"formReason\").escape() + '</b></div>' +\n '<textarea name=\"\" id=\"comment\" placeholder=\"' + i18n.msg(\"formphReason\").escape() + '\" class=\"optional\"></textarea>' +\n '</div>' +\n '<div class=\"rf-section\">' +\n '<div class=\"rf-checkbox\"><input type=\"checkbox\" id=\"crosswiki\" class=\"option-input optional\"/><label for=\"crosswiki\">' + i18n.msg(\"formCrossWiki\").escape() + '</label></div>' +\n '</div>' + \n '<div class=\"rf-section\">' +\n '<div class=\"rf-checkbox rf-socks\"><input type=\"checkbox\" id=\"socks\" class=\"option-input optional\"/><label for=\"socks\">' + i18n.msg(\"formSockpuppet\").escape() + '</label>' + \n '<div class=\"rf-section rf-socks-box\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"formUsername\").escape() + '</b> ' + i18n.msg(\"formOfSock\").escape() +\n '<textarea name=\"\" id=\"sockusers\" class=\"rf-socks optional\" type=\"text\" placeholder=\"Rappy 4187\\nDucksoup\"></textarea>' +\n '</div>' +\n '</div>' +\n '</div>' + \n '<div class=\"rf-section\" style=\"color:#F00; font-size:16px; display:none;\" id=\"formAnon\"><b>' + i18n.msg(\"formAnon\").escape() + '</b></div>' +\n '</div>' +\n '</fieldset>' +\n '</form>',\n formParams: {\n '$1': 'wikiurl',\n '$2': 'wikiname',\n '$3': 'user',\n '$4': 'comment',\n '$5': 'user', // for different styling\n '$6': 'crosswiki',\n '$7': 'socks',\n '$8': 'sockusers'\n },\n submitText: '{{Report vandalism|$1\\n' +\n '|$4\\n' +\n '|$3\\n' +\n '$6$7$8' +\n '|' + c.wgUserName + '|' + '~~' + '~~' + '~}}',\n summary: 'New vandalism report ($1, $5)',\n sectionTitle: '$5 at $2'\n },\n spam: {\n page: 'Report:Spam',\n buttonText: i18n.msg(\"buttonSpam\").escape(),\n form: '<form class=\"WikiaForm ReportForm\" method=\"\" name=\"\" id=\"spam\">' +\n '<fieldset>' +\n '<div class=\"rf-wrapper\">' +\n '<div class=\"rf-section\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"formWikiName\").escape() + '</b></div>' +\n '<input id=\"wikiname\" class=\"rf-wikiname optional\" type=\"text\" placeholder=\"' + i18n.msg(\"formphWikiName\").escape() + '\"/>' +\n '</div>' + \n '<div class=\"rf-section\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"formWikiURL\").escape() + '</b></div>' +\n '<input id=\"wikiurl\" class=\"rf-wikiurl\" type=\"text\" placeholder=\"soap.fandom.com\"/>' +\n '</div>' +\n '<div class=\"rf-section\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"formUsername\").escape() + '</b> ' + i18n.msg(\"formOfBadUser\").escape() + ' (' + i18n.msg(\"formMultipleUsers\").escape() + ')</div>' +\n '<textarea name=\"\" id=\"user\" class=\"rf-wikiuser\" type=\"text\" placeholder=\"Rappy 4187\\nDucksoup\"></textarea>' +\n '</div>' +\n '<div class=\"rf-section\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"formReason\").escape() + '</b></div>' +\n '<textarea name=\"\" id=\"comment\" placeholder=\"' + i18n.msg(\"formphReason\").escape() + '\" class=\"optional\"></textarea>' +\n '</div>' +\n '<div class=\"rf-section\">' +\n '<div class=\"rf-checkbox\"><input type=\"checkbox\" id=\"crosswiki\" class=\"option-input optional\"/><label for=\"crosswiki\">' + i18n.msg(\"formCrossWiki\").escape() + '</label></div>' +\n '</div>' + \n '<div class=\"rf-section\" style=\"color:#F00; font-size:16px; display:none;\" id=\"formAnon\"><b>' + i18n.msg(\"formAnon\").escape() + '</b></div>' +\n '</div>' +\n '</fieldset>' +\n '</form>',\n formParams: {\n '$1': 'wikiurl',\n '$2': 'wikiname',\n '$3': 'user',\n '$4': 'comment',\n '$5': 'user', // for different styling\n '$6': 'crosswiki',\n },\n submitText: '{{Report spam|$1\\n' +\n '|$4\\n' +\n '|$3\\n' +\n '$6' +\n '|' + c.wgUserName + '|' + '~~' + '~~' + '~}}',\n summary: 'New spam report ($1, $5)',\n sectionTitle: '$5 at $2'\n },\n phalanx: {\n page: 'Report:Spam_filter_problems',\n buttonText: i18n.msg(\"buttonFalsePositive\").escape(),\n form: '<form class=\"WikiaForm ReportForm\" method=\"\" name=\"\" id=\"phalanx\">' +\n '<fieldset>' +\n '<div class=\"rf-wrapper\">' +\n '<div class=\"rf-section\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"formWikiName\").escape() + '</b></div>' +\n '<input id=\"wikiname\" class=\"rf-wikiname optional\" type=\"text\" placeholder=\"' + i18n.msg(\"formphWikiName\").escape() + '\"/>' +\n '</div>' + \n '<div class=\"rf-section\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"formWikiPage\").escape() + '</b></div>' +\n '<input id=\"wikiurl\" class=\"rf-wikiurl\" type=\"text\" placeholder=\"soap.fandom.com\"/>' +\n '<span class=\"rf-httpend\">/wiki/</span>' +\n '<input id=\"wikipage\" class=\"rf-wikiurl\" type=\"text\" placeholder=\"Report:Spam_filter_problems\"/>' +\n '</div>' +\n '<div class=\"rf-section\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"formBlockID\").escape() + '</b></div>' +\n '<input id=\"blockid\" class=\"rf-wikiurl\" type=\"text\" placeholder=\"12345\" data-encode=\"true\"/>' +\n '</div>' +\n '<div class=\"rf-section\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"formPhalanxReason\").escape() + '</b></div>' +\n '<textarea name=\"\" id=\"comment\" placeholder=\"' + i18n.msg(\"formphReason\").escape() + '\" class=\"optional\"></textarea>' +\n '</div>' +\n '<div class=\"rf-section\" style=\"color:#F00; font-size:16px; display:none;\" id=\"formAnon\"><b>' + i18n.msg(\"formAnon\").escape() + '</b></div>' +\n '</div>' +\n '</fieldset>' +\n '</form>',\n formParams: {\n '$1': 'wikiurl',\n '$2': 'wikiname',\n '$5': 'wikipage',\n '$3': 'blockid',\n '$4': 'comment'\n },\n submitText: '{{Report filter|$1\\n' +\n '|$5\\n' +\n '|$3\\n' + \n '|$4\\n' + \n '|' + c.wgUserName + '|' + '~~' + '~~' + '~}}',\n summary: 'New filter report ($2, #$3)',\n sectionTitle: 'Block #$3 on $2'\n },\n wiki: {\n page: 'Report:Wiki',\n buttonText: i18n.msg(\"buttonWiki\").escape(),\n form: '<form class=\"WikiaForm ReportForm\" method=\"\" name=\"\" id=\"wiki\">' +\n '<fieldset>' +\n '<div class=\"rf-wrapper\">' +\n '<div class=\"rf-section\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"formWikiName\").escape() + '</b></div>' +\n '<input id=\"wikiname\" class=\"rf-wikiname optional\" type=\"text\" placeholder=\"' + i18n.msg(\"formphWikiName\").escape() + '\"/>' +\n '</div>' + \n '<div class=\"rf-section\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"formWikiURL\").escape() + '</b></div>' +\n '<input id=\"wikiurl\" class=\"rf-wikiurl\" type=\"text\" placeholder=\"soap.fandom.com\"/>' +\n '</div>' +\n '<div class=\"rf-section\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"formReason\").escape() + '</b></div>' +\n '<input name=\"\" id=\"comment\" type=\"text\" placeholder=\"' + i18n.msg(\"formphReason\").escape() + '\" class=\"optional\"></input>' +\n '</div>' +\n '<div class=\"rf-section\"><div class=\"rf-section-title\"><b>' + i18n.msg(\"GuidelinesTitle\").plain() + '</b></div>' +\n i18n.msg(\"GuidelinesText\").plain() +\n '</div>' +\n '<div class=\"rf-section\" style=\"color:#F00; font-size:16px; display:none;\" id=\"formAnon\"><b>' + i18n.msg(\"formAnon\").escape() + '</b></div>' +\n '</div>' +\n '</fieldset>' +\n '</form>',\n formParams: {\n '$1': 'wikiname',\n '$2': 'wikiurl',\n '$3': 'comment'\n },\n submitText: '{{badwiki|$2|$3}}',\n summary: 'New bad wiki report ([[w:c:$2|$1]], comment: $3)',\n sectionTitle: ''\n },\n };\n reportDropdown = '<div class=\"wds-dropdown\">' + \n '<div class=\"wds-dropdown__toggle wds-button\">' + \n '<span>' + i18n.msg(\"buttonReport\").escape() + '</span>' + \n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" class=\"wds-icon wds-icon-tiny wds-dropdown__toggle-chevron\"><path d=\"M1 3h10L6 9z\"></path></svg>' + \n '</div>' + \n '<div class=\"wds-dropdown__content\">' + \n '<ul class=\"wds-list wds-is-linked\" id=\"rf-dropdown-list\">' + \n '</ul>' + \n '</div>' + \n '</div>'\n }).done(init);\n });\n }", "function restore_prev_settings() {\n tagpro.group.socket.emit(\"setting\", {\"name\": \"map\", \"value\": settings.get('map')});\n tagpro.group.socket.emit(\"setting\", {\"name\": \"time\", \"value\": settings.get('time')});\n tagpro.group.socket.emit(\"setting\", {\"name\": \"caps\", \"value\": settings.get('caps')});\n\n /* var settings = GM_getValue('ELTP_settings');\n for(var i = 0; i < settings.length; i++) {\n tagpro.group.socket.emit(\"setting\", {\"name\": settings[i].name, \"value\": GM_getValue('ELTP_' + settings[i])});\n }*/\n}", "function toggleConfKeepLayout(){\n\ttoggleConfBool('layout', keepLayout);\n\tredirect(link[posActual]);\n}", "function setUpPage() {\n\t\"use strict\";\n\tremoveSelectDefault();\n\tcreateEventListeners();\n\tgeneratePlaceholder();\n}", "getSettings () {\r\n\t\tvar defaultSettings = {\r\n\t\t\tenableEmojiHovering: true,\r\n\t\t\tenableEmojiStatisticsButton: true\r\n\t\t};\r\n\t\tvar settings = BDfunctionsDevilBro.loadAllData(this.getName(), \"settings\");\r\n\t\tvar saveSettings = false;\r\n\t\tfor (var key in defaultSettings) {\r\n\t\t\tif (settings[key] == null) {\r\n\t\t\t\tsettings[key] = settings[key] ? settings[key] : defaultSettings[key];\r\n\t\t\t\tsaveSettings = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (saveSettings) {\r\n\t\t\tBDfunctionsDevilBro.saveAllData(settings, this.getName(), \"settings\");\r\n\t\t}\r\n\t\treturn settings;\r\n\t}", "function initSettings() {\n const PUBLIC_CONFIGURE_SETTINGS = [\n {\n key: SETTING_KEYS.TOOLTIP_POSITION,\n settings: {\n name: i18n('settings.TOOLTIP_POSITION.name'),\n hint: i18n('settings.TOOLTIP_POSITION.hint'),\n type: String,\n config: true,\n default: 'right',\n choices: {\n top: i18n('settings.TOOLTIP_POSITION.choices.top'),\n right: i18n('settings.TOOLTIP_POSITION.choices.right'),\n bottom: i18n('settings.TOOLTIP_POSITION.choices.bottom'),\n left: i18n('settings.TOOLTIP_POSITION.choices.left'),\n overlay: i18n('settings.TOOLTIP_POSITION.choices.overlay'),\n surprise: i18n('settings.TOOLTIP_POSITION.choices.surprise'),\n doubleSurprise: i18n('settings.TOOLTIP_POSITION.choices.doubleSurprise'),\n },\n },\n },\n {\n key: SETTING_KEYS.FONT_SIZE,\n settings: {\n name: i18n('settings.FONT_SIZE.name'),\n hint: i18n('settings.FONT_SIZE.hint'),\n type: Number,\n config: true,\n range: {\n min: 1,\n step: 0.1,\n max: 2.5,\n },\n default: 1.2,\n },\n },\n {\n key: SETTING_KEYS.MAX_ROWS,\n settings: {\n name: i18n('settings.MAX_ROWS.name'),\n hint: i18n('settings.MAX_ROWS.hint'),\n type: Number,\n config: true,\n range: {\n min: 1,\n step: 1,\n max: 20,\n },\n default: 5,\n },\n },\n {\n key: SETTING_KEYS.DATA_SOURCE,\n settings: {\n name: i18n('settings.DATA_SOURCE.name'),\n hint: i18n('settings.DATA_SOURCE.hint'),\n type: String,\n scope: 'world',\n config: true,\n restricted: true,\n default: 'actor.data.data',\n },\n },\n {\n key: SETTING_KEYS.DARK_THEME,\n settings: {\n name: i18n('settings.DARK_THEME.name'),\n hint: i18n('settings.DARK_THEME.hint'),\n type: Boolean,\n config: true,\n default: false,\n },\n },\n {\n key: SETTING_KEYS.SHOW_ALL_ON_ALT,\n settings: {\n name: i18n('settings.SHOW_ALL_ON_ALT.name'),\n hint: i18n('settings.SHOW_ALL_ON_ALT.hint'),\n type: Boolean,\n scope: 'world',\n config: true,\n restricted: true,\n default: true,\n },\n },\n {\n key: SETTING_KEYS.SHOW_TOOLTIP_FOR_HIDDEN_TOKENS,\n settings: {\n name: i18n('settings.SHOW_TOOLTIP_FOR_HIDDEN_TOKENS.name'),\n hint: i18n('settings.SHOW_TOOLTIP_FOR_HIDDEN_TOKENS.hint'),\n type: Boolean,\n scope: 'world',\n config: true,\n restricted: true,\n default: false,\n },\n },\n {\n key: SETTING_KEYS.DEBUG_OUTPUT,\n settings: {\n name: i18n('settings.DEBUG_OUTPUT.name'),\n hint: i18n('settings.DEBUG_OUTPUT.hint'),\n type: Boolean,\n scope: 'world',\n config: true,\n restricted: true,\n default: false,\n },\n },\n ];\n const HIDDEN_CONFIGURE_SETTINGS = [\n {\n key: SETTING_KEYS.GM_SETTINGS,\n settings: {\n type: Object,\n scope: 'world',\n restricted: true,\n default: {},\n },\n },\n {\n key: SETTING_KEYS.PLAYER_SETTINGS,\n settings: {\n type: Object,\n scope: 'world',\n restricted: true,\n default: {},\n },\n },\n {\n key: SETTING_KEYS.ACTORS,\n settings: {\n type: Object,\n scope: 'world',\n restricted: true,\n default: [],\n },\n },\n {\n key: SETTING_KEYS.CLIPBOARD,\n settings: {\n type: Object,\n default: [],\n },\n },\n ];\n\n registerTooltipManager();\n registerSettings([...PUBLIC_CONFIGURE_SETTINGS, ...HIDDEN_CONFIGURE_SETTINGS]);\n}", "function mostrarSettings(){\n\ttry{\n\t\tif(get('wcr_settings')) return; //if the screen is already open, do nothing\n\n\t\tdataCache = null; //force q to load everything again, in case they changed something in another tab\n\n\t\t//editable properties of site settings\n\t\tvar propsSitio = {\n\t\t\turl:{ desc: 'URL', title: \"Define what sites will use these settings\",\n\t\t\t\ttipos:{\n\t\t\t\t\tstr:{ desc: 'Beginning of URL',\n\t\t\t\t\t\tval:{ elem: 'input', title: \"Beginning of the url without the http://www.\", size: 60 }\n\t\t\t\t\t},\n\t\t\t\t\tre:{ desc: \"RegExp\",\n\t\t\t\t\t\tval:{ elem: 'input', title: \"Regular expression that matches the url\", size: 60 }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\timg:{ desc:'Image', title:\"Method for obtaining the main image\",\n\t\t\t\ttipos:{\n\t\t\t\t\tdef:{ desc: 'Default',\n\t\t\t\t\t\tval:{ elem: 'span', html: '&lt;img&gt; that is the only one with a \"src\" containing one of the following strings: \"/comics/\", \"/comic/\", \"/strips/\", \"/strip/\", \"/archives/\", \"/archive/\", \"/wp-content/uploads/\", \"comics\", \"comic\", \"strips\", \"strip\", \"archives\", \"archive\", \"/manga/\"' }\n\t\t\t\t\t},\n\t\t\t\t\tstr:{ desc: 'Beginning of src',\n\t\t\t\t\t\tval:{ elem: 'input', title: \"Beginning of the &quot;src&quot; attribute of the &lt;img&gt;\", size: 60 }\n\t\t\t\t\t},\n\t\t\t\t\tre:{ desc: 'RegExp',\n\t\t\t\t\t\tval:{ elem: 'input', title: \"Regular expression that captures the whole &lt;img&gt; (or at least the &quot;src&quot; and &quot;title&quot; attributes)\", size: 50 },\n\t\t\t\t\t\tgrp:{ elem: 'input', title: \"Number of the group that captured the &lt;img&gt;\", size: 1 }\n\t\t\t\t\t},\n\t\t\t\t\txp:{ desc: 'XPath',\n\t\t\t\t\t\tval:{ elem: 'input', title: \"XPath query that returns the &lt;img&gt;\", size: 60 }\n\t\t\t\t\t},\n\t\t\t\t\tcss:{ desc: 'CSS selector',\n\t\t\t\t\t\tval:{ elem: 'input', title: \"CSS query that returns the &lt;img&gt;\", size: 60 }\n\t\t\t\t\t},\n\t\t\t\t\tfn:{ desc: 'function(html, pos)',\n\t\t\t\t\t\tval:{ elem: 'textarea', title: \"Function that receives the html of the page and its position relative to the starting page (0 being where you started reading), and returns the &lt;img&gt; element (either as string or object)\", rows:3, cols:45 }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tback:{ desc: 'Back', title: 'Method for obtaining the link to the previous page',\n\t\t\t\ttipos:{\n\t\t\t\t\tdef:{ desc: 'Default',\n\t\t\t\t\t\tval:{ elem: 'span', html: '&lt;a&gt; that has the word \"back\" or \"prev\" somewhere in its innerHTML or one of its attributes' }\n\t\t\t\t\t},\n\t\t\t\t\tstr:{ desc: 'XPath condition',\n\t\t\t\t\t\tval:{ elem: 'input', title: 'Condition for the following XPath query: //a[condition]/@href', size: 60 }\n\t\t\t\t\t},\n\t\t\t\t\tre:{ desc: 'RegExp',\n\t\t\t\t\t\tval:{ elem: 'input', title: \"Regular expression that captures the URL of the previous page\", size: 50 },\n\t\t\t\t\t\tgrp:{ elem: 'input', title: \"Number of the group that captured the URL\", size: 1 }\n\t\t\t\t\t},\n\t\t\t\t\txp:{ desc: 'XPath',\n\t\t\t\t\t\tval:{ elem: 'input', title: \"XPath query that returns the URL of the previous page, or the &lt;a&gt; element that links to it\", size: 60 }\n\t\t\t\t\t},\n\t\t\t\t\tcss:{ desc: 'CSS selector',\n\t\t\t\t\t\tval:{ elem: 'input', title: \"CSS query that returns the &lt;a&gt; element that links to the previous page\", size: 60 }\n\t\t\t\t\t},\n\t\t\t\t\tfn:{ desc: 'function(html, pos)',\n\t\t\t\t\t\tval:{ elem: 'textarea', title: \"Function that receives the html of the page and its position relative to the starting page (0 being where you started reading), and returns the URL of the previous page\", rows:3, cols:45 }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tnext:{ desc: 'Next', title: 'Method for obtaining the link to the next page',\n\t\t\t\ttipos:{\n\t\t\t\t\tdef:{ desc: 'Default',\n\t\t\t\t\t\tval:{ elem: 'span', html: '&lt;a&gt; that has the word \"next\" somewhere in its innerHTML or one of its attributes' }\n\t\t\t\t\t},\n\t\t\t\t\tstr:{ desc: 'XPath condition',\n\t\t\t\t\t\tval:{ elem: 'input', title: 'Condition for the following XPath query: //a[condition]/@href', size: 60 }\n\t\t\t\t\t},\n\t\t\t\t\tre:{ desc: 'RegExp',\n\t\t\t\t\t\tval:{ elem: 'input', title: \"Regular expression that captures the URL of the next page\", size: 50 },\n\t\t\t\t\t\tgrp:{ elem: 'input', title: \"Number of the group that captured the URL\", size: 1 }\n\t\t\t\t\t},\n\t\t\t\t\txp:{ desc: 'XPath',\n\t\t\t\t\t\tval:{ elem: 'input', title: \"XPath query that returns the URL of the next page, or the &lt;a&gt; element that links to it\", size: 60 }\n\t\t\t\t\t},\n\t\t\t\t\tcss:{ desc: 'CSS selector',\n\t\t\t\t\t\tval:{ elem: 'input', title: \"CSS query that returns the &lt;a&gt; element that links to the next page\", size: 60 }\n\t\t\t\t\t},\n\t\t\t\t\tfn:{ desc: 'function(html, pos)',\n\t\t\t\t\t\tval:{ elem: 'textarea', title: \"Function that receives the html of the page and its position relative to the starting page (0 being where you started reading), and returns the URL of the next page\", rows:3, cols:45 }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tfirst:{ desc: 'First', title: 'Method for obtaining the link to the first page',\n\t\t\t\ttipos:{\n\t\t\t\t\tdef:{ desc: 'Default',\n\t\t\t\t\t\tval:{ elem: 'span', html: '&lt;a&gt; that has the word \"first\" somewhere in its innerHTML or one of its attributes' }\n\t\t\t\t\t},\n\t\t\t\t\tstr:{ desc: 'XPath condition',\n\t\t\t\t\t\tval:{ elem: 'input', title: 'Condition for the following XPath query: //a[condition]/@href', size: 60 }\n\t\t\t\t\t},\n\t\t\t\t\tre:{ desc: 'RegExp',\n\t\t\t\t\t\tval:{ elem: 'input', title: \"Regular expression that captures the URL of the first page\", size: 50 },\n\t\t\t\t\t\tgrp:{ elem: 'input', title: \"Number of the group that captured the URL\", size: 1 }\n\t\t\t\t\t},\n\t\t\t\t\txp:{ desc: 'XPath',\n\t\t\t\t\t\tval:{ elem: 'input', title: \"XPath query that returns the URL of the first page, or the &lt;a&gt; element that links to it\", size: 60 }\n\t\t\t\t\t},\n\t\t\t\t\tcss:{ desc: 'CSS selector',\n\t\t\t\t\t\tval:{ elem: 'input', title: \"CSS query that returns the &lt;a&gt; element that links to the first page\", size: 60 }\n\t\t\t\t\t},\n\t\t\t\t\tfn:{ desc: 'function(html)',\n\t\t\t\t\t\tval:{ elem: 'textarea', title: \"Function that receives the html of the page and returns the URL of the first page\", rows:3, cols:45 }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tlast:{ desc: 'Last', title: 'Method for obtaining the link to the last page',\n\t\t\t\ttipos:{\n\t\t\t\t\tdef:{ desc: 'Default',\n\t\t\t\t\t\tval:{ elem: 'span', html: '&lt;a&gt; that has the word \"last\", \"latest\", \"newest\" or \"today\" somewhere in its innerHTML or one of its attributes' }\n\t\t\t\t\t},\n\t\t\t\t\tstr:{ desc: 'XPath condition',\n\t\t\t\t\t\tval:{ elem: 'input', title: 'Condition for the following XPath query: //a[condition]/@href', size: 60 }\n\t\t\t\t\t},\n\t\t\t\t\tre:{ desc: 'RegExp',\n\t\t\t\t\t\tval:{ elem: 'input', title: \"Regular expression that captures the URL of the last page\", size: 50 },\n\t\t\t\t\t\tgrp:{ elem: 'input', title: \"Number of the group that captured the URL\", size: 1 }\n\t\t\t\t\t},\n\t\t\t\t\txp:{ desc: 'XPath',\n\t\t\t\t\t\tval:{ elem: 'input', title: \"XPath query that returns the URL of the last page, or the &lt;a&gt; element that links to it\", size: 60 }\n\t\t\t\t\t},\n\t\t\t\t\tcss:{ desc: 'CSS selector',\n\t\t\t\t\t\tval:{ elem: 'input', title: \"CSS query that returns the &lt;a&gt; element that links to the last page\", size: 60 }\n\t\t\t\t\t},\n\t\t\t\t\tfn:{ desc: 'function(html)',\n\t\t\t\t\t\tval:{ elem: 'textarea', title: \"Function that receives the html of the page and returns the URL of the last page\", rows:3, cols:45 }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tfixurl:{ desc: 'Fix URL', title: 'Fix URLs coming from a link or img.src for sites that may need it (like relative URLs that don\\'t behave normally, or links from http://something.com to http://www.something.com that wouldn\\'t work because of cross site request limitations)',\n\t\t\t\ttipos:{\n\t\t\t\t\tdef:{ desc: 'Default',\n\t\t\t\t\t\tval:{ elem: 'span', html: 'Do nothing' }\n\t\t\t\t\t},\n\t\t\t\t\tfn:{ desc: 'function(url, img, link, pos)',\n\t\t\t\t\t\tval: { elem: 'textarea', title: 'Function that receives an URL, and flags telling if it came from an img.src or link to another page, and returns the fixed url', rows:3, cols:45 }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\textra:{ desc: 'Extra Content', title: 'Other content besides the main image to get from each page',\n\t\t\t\ttipos:{\n\t\t\t\t\tstr:{ desc: 'Literal string',\n\t\t\t\t\t\tval:{ elem: 'input', title: 'HTML string, this will be output literally', size: 60 }\n\t\t\t\t\t},\n\t\t\t\t\tre:{ desc: 'RegExp',\n\t\t\t\t\t\tval:{ elem: 'input', title: \"Regular expression that captures the desired content\", size: 50 },\n\t\t\t\t\t\tgrp:{ elem: 'input', title: \"Number of the group that captured the content\", size: 1 }\n\t\t\t\t\t},\n\t\t\t\t\txp:{ desc: 'XPath',\n\t\t\t\t\t\tval:{ elem: 'input', title: \"XPath query that returns the desired content\", size: 60 },\n\t\t\t\t\t\tarr:{ elem: 'select', html: '<option value=\"\">First element</option><option value=\"1\">List of elements</option>'},\n\t\t\t\t\t\tglue:{ elem: 'input', title: 'String to put between each pair of elements returned', size: 20},\n\t\t\t\t\t\tfirst:{ elem: 'input', title: 'Index of the first element to return (starting from 0, negative means counting from the last)', size: 1},\n\t\t\t\t\t\tlast:{ elem: 'input', title: 'Index of the last element to return (starting from 0, negative means counting from the last)', size: 1}\n\t\t\t\t\t},\n\t\t\t\t\tcss:{ desc: 'CSS selector',\n\t\t\t\t\t\tval:{ elem: 'input', title: \"CSS query that returns the desired content\", size: 60 },\n\t\t\t\t\t\tarr:{ elem: 'select', html: '<option value=\"\">First element</option><option value=\"1\">List of elements</option>'},\n\t\t\t\t\t\tglue:{ elem: 'input', title: 'String to put between each pair of elements returned', size: 20},\n\t\t\t\t\t\tfirst:{ elem: 'input', title: 'Index of the first element to return (starting from 0, negative means counting from the last)', size: 1},\n\t\t\t\t\t\tlast:{ elem: 'input', title: 'Index of the last element to return (starting from 0, negative means counting from the last)', size: 1}\n\t\t\t\t\t},\n\t\t\t\t\tfn:{ desc: 'function(html, pos)',\n\t\t\t\t\t\tval:{ elem: 'textarea', title: \"Function that receives the html of the page and its position relative to the starting page (0 being where you started reading), and returns the desired content\", rows:3, cols:45 }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\txelem:{ desc: 'Extras Container', title: 'Element for placing the extra content when using the full layout',\n\t\t\t\ttipos:{\n\t\t\t\t\tdef:{ desc: 'Default',\n\t\t\t\t\t\tval:{ elem: 'span', html: 'Inside the WCR container (between the image and the back/next buttons)' }\n\t\t\t\t\t},\n\t\t\t\t\tstr:{ desc: 'XPath',\n\t\t\t\t\t\tval: { elem: 'input', title: 'XPath query that returns the element where the extra content will be placed as its innerHTML', size:60 }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tlayelem:{ desc: 'Layout Container', title: 'Element for placing the image and the rest of the script content when using the full layout',\n\t\t\t\ttipos:{\n\t\t\t\t\tdef:{ desc: 'Default',\n\t\t\t\t\t\tval:{ elem: 'span', html: 'Where the original image was' }\n\t\t\t\t\t},\n\t\t\t\t\tstr:{ desc: 'XPath',\n\t\t\t\t\t\tval: { elem: 'input', title: 'XPath query that returns the element where the content will be placed as its innerHTML', size:60 }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tjs:{ desc: 'Custom Action', title: 'Custom function to execute after each page change',\n\t\t\t\ttipos:{\n\t\t\t\t\tdef:{ desc: 'Default',\n\t\t\t\t\t\tval:{ elem: 'span', html: 'Do nothing' }\n\t\t\t\t\t},\n\t\t\t\t\tfn:{ desc: 'function(dir)',\n\t\t\t\t\t\tval: { elem: 'textarea', title: 'Function that receives the direction in which the page was changed (0 when the starting page is loaded, 1 when going forward and -1 when going backwards)', rows:3, cols:45 }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tstyle:{ desc: 'Custom CSS', title: 'Custom CSS styles',\n\t\t\t\ttipos:{\n\t\t\t\t\tdef:{ desc: 'Default',\n\t\t\t\t\t\tval:{ elem: 'span', html: 'Don\\'t change anything' }\n\t\t\t\t\t},\n\t\t\t\t\tstr:{ desc: 'CSS rules',\n\t\t\t\t\t\tval: { elem: 'textarea', title: 'CSS rules', rows:3, cols:45 }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tbgcol:{ desc: 'Background Color',\n\t\t\t\ttipos:{\n\t\t\t\t\tdef:{ desc: 'Default',\n\t\t\t\t\t\tval:{ elem: 'span', html: 'Keep original' }\n\t\t\t\t\t},\n\t\t\t\t\tstr:{ desc: 'Custom',\n\t\t\t\t\t\tval: { elem: 'input', title: '#RRGGBB or #RGB', size:6 }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\ttxtcol:{ desc: 'Text Color',\n\t\t\t\ttipos:{\n\t\t\t\t\tdef:{ desc: 'Default',\n\t\t\t\t\t\tval:{ elem: 'span', html: 'Keep original' }\n\t\t\t\t\t},\n\t\t\t\t\tstr:{ desc: 'Custom',\n\t\t\t\t\t\tval: { elem: 'input', title: '#RRGGBB or #RGB', size:6 }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscrollx:{ desc: 'Default Horizontal Autoscroll', title: 'Scroll to this position of the image each time you change the page',\n\t\t\t\ttipos:{\n\t\t\t\t\tdef:{ desc: 'Default',\n\t\t\t\t\t\tval:{ elem: 'span', html: 'Left' }\n\t\t\t\t\t},\n\t\t\t\t\tstr:{ desc: 'Relative to image',\n\t\t\t\t\t\tval: { elem: 'select', html: '<option value=\"L\">Left</option><option value=\"R\">Right</option><option value=\"M\">Middle</option>' }\n\t\t\t\t\t},\n\t\t\t\t\tnum:{ desc: 'Pixels',\n\t\t\t\t\t\tval: { elem: 'input', title: 'X coordinate in pixels', size: 5 }\n\t\t\t\t\t},\n\t\t\t\t\tfn:{ desc: 'function()',\n\t\t\t\t\t\tval:{ elem: 'textarea', title: \"Function that returns the numbers of pixels to scroll\", rows:3, cols:45 }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tscrolly:{ desc: 'Default Vertical Autoscroll', title: 'Scroll to this position of the image each time you change the page',\n\t\t\t\ttipos:{\n\t\t\t\t\tdef:{ desc: 'Default',\n\t\t\t\t\t\tval:{ elem: 'span', html: 'Top' }\n\t\t\t\t\t},\n\t\t\t\t\tstr:{ desc: 'Relative to image',\n\t\t\t\t\t\tval: { elem: 'select', html: '<option value=\"U\">Top</option><option value=\"D\">Bottom</option><option value=\"M\">Middle</option>' }\n\t\t\t\t\t},\n\t\t\t\t\tnum:{ desc: 'Pixels',\n\t\t\t\t\t\tval: { elem: 'input', title: 'Y coordinate in pixels', size: 5 }\n\t\t\t\t\t},\n\t\t\t\t\tfn:{ desc: 'function()',\n\t\t\t\t\t\tval:{ elem: 'textarea', title: \"Function that returns the numbers of pixels to scroll\", rows:3, cols:45 }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tlayout:{ desc: 'Default Layout', title: 'Layout to use when no custom layout settings are defined for this site',\n\t\t\t\ttipos:{\n\t\t\t\t\tdef:{ desc: 'Default',\n\t\t\t\t\t\tval:{ elem: 'span', html: 'Use default settings' }\n\t\t\t\t\t},\n\t\t\t\t\tbool:{ desc: 'Custom',\n\t\t\t\t\t\tval: { elem: 'select', html: '<option value=\"false\">Minimalistic</option><option value=\"true\">Keep original</option>' }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t//types of updates\n\t\tvar listaTipos = [\n\t\t\t'Bug fixes (Firefox)',\n\t\t\t'Bug fixes (Other browsers)',\n\t\t\t'New features',\n\t\t\t'New sites',\n\t\t\t'Fixes for old sites',\n\t\t\t'Graphic changes',\n\t\t\t'New options'];\n\t\tvar t, tiposUp = {};\n\t\tfor(t=0; t<listaTipos.length;t++) tiposUp[1<<t] = listaTipos[t];\n\t\ttiposUp[(1<<16)-(1<<t)] = 'Other stuff (???)';\n\n\t\t//configurable keys\n\t\tvar teclas = {\n\t\t\tback: ['Back', 'Go back 1 page'],\n\t\t\tnext: ['Next', 'Go forward 1 page'],\n\t\t\tscroll_left: ['Scroll left', ''],\n\t\t\tscroll_right: ['Scroll right', ''],\n\t\t\tscroll_up: ['Scroll up', ''],\n\t\t\tscroll_down: ['Scroll down', ''],\n\t\t\treload: ['Reload', 'Reload the current page (in old browsers, pressing the reload button will take you back to where you started). F5 will always do this (unless set to another action)'],\n\t\t\tset_bm: ['Set as only bookmark', 'Delete other bookmarks and add this page, so that the next time you visit the site you will be taken back to this page'],\n\t\t\tadd_bm: ['Add to bookmarks', ''],\n\t\t\tlayout: ['Toggle layout', 'Switch between the &quot;clean layout&quot; (show only image and buttons) and &quot;full layout&quot; (show the whole original page)'],\n\t\t\tbotones: ['Toggle buttons', 'Switch between showing or hiding all the script\\'s buttons (back/next, bookmarks, settings, etc...)'],\n\t\t\tfit: ['Toggle Fit-to-screen', 'Switch between always showing the image in its original size or fitting it to the screen when needed'],\n\t\t\tslide: ['Toggle Slideshow', 'Start or stop the slideshow mode (pages turn automatically after the selected time). Slideshow will also stop by pressing ESC or manually turning a page'],\n\t\t\tdebug_mode: ['Toggle debug mode', 'In debug mode you\\'ll get alerts to see what isn\\'t working. Useful when adding new sites'],\n\t\t\tdebug_info: ['Debug info (on debug mode)', 'Show a list of URLs of the preloaded pages and images']\n\t\t};\n\n\t\tvar arrcursores = ['default', 'none', 'context-menu', 'help', 'pointer', 'progress', 'wait', 'cell', 'crosshair', 'text', 'vertical-text', 'alias', 'copy', 'move', 'no-drop', 'not-allowed', 'all-scroll', 'col-resize', 'row-resize', 'n-resize', 'e-resize', 's-resize', 'w-resize', 'ne-resize', 'nw-resize', 'se-resize', 'sw-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize'];\n\t\tif(isFirefox()) arrcursores.push('-moz-grab', '-moz-grabbing', '-moz-zoom-in', '-moz-zoom-out');\n\t\tif(isWebKit()) arrcursores.push('-webkit-grab', '-webkit-grabbing', '-webkit-zoom-in', '-webkit-zoom-out');\n\t\tvar cursores = {\n\t\t\t'1': 'Left green arrow',\n\t\t\t'2': 'Right green arrow',\n\t\t\t'5': 'Left blue arrow',\n\t\t\t'6': 'Right blue arrow',\n\t\t\t'3': 'Custom cursor #1',\n\t\t\t'4': 'Custom cursor #2'\n\t\t};\n\t\tfor(var c=0; c<arrcursores.length; c++) cursores[arrcursores[c]] = arrcursores[c];\n\n\t\t//general options\n\t\tvar opsGeneral = {\n\t\t\tclickImgNavigates:{ desc:'Click image to navigate', title:'If enabled, clicking the image will let you go to the next or previous page',\n\t\t\t\tdef: defaultSettings.clickImgNavigates ? '1' : '0',\n\t\t\t\tvals:{\n\t\t\t\t\t'0':'Disabled',\n\t\t\t\t\t'1':'Enabled'\n\t\t\t\t}\n\t\t\t},\n\t\t\tclick_img_izq:{ desc:'Click left half of image to go back', title:'If enabled, clicking the left half of the image will take you to the previous page, and the right half to the next one. Otherwise, clicking anywhere will always take you to the next page',\n\t\t\t\tdef: defaultSettings.clikLeftHalfGoesBack ? '1' : '0',\n\t\t\t\tvals:{\n\t\t\t\t\t'0':'Disabled',\n\t\t\t\t\t'1':'Enabled'\n\t\t\t\t}\n\t\t\t},\n\t\t\tflipControlsManga:{ desc:'Flip controls for mangas', title:'If enabled, flips the controls (L/R arrows, L/R image click, back/next buttons) for mangas or other right-to-left content',\n\t\t\t\tdef: defaultSettings.flipControlsManga ? '1' : '0',\n\t\t\t\tvals:{\n\t\t\t\t\t'0':'Disabled',\n\t\t\t\t\t'1':'Enabled'\n\t\t\t\t}\n\t\t\t},\n\t\t\toverwrite_links:{ desc:'Overwrite links', title:'If enabled, overwrites the original back/next links (when using the original layout) to work like the script\\'s buttons',\n\t\t\t\tdef:'1',\n\t\t\t\tvals:{\n\t\t\t\t\t'0':'Disabled',\n\t\t\t\t\t'1':'Enabled'\n\t\t\t\t}\n\t\t\t},\n\t\t\tgoToBookmark:{ desc: 'Go to bookmark', title: 'If you have 1 bookmark saved for a site, asks you if you want to go there when you visit the site',\n\t\t\t\tdef: defaultSettings.goToBookmark ? '1' : '0',\n\t\t\t\tvals:{\n\t\t\t\t\t'0':'Disabled',\n\t\t\t\t\t'1':'Enabled'\n\t\t\t\t}\n\t\t\t},\n\t\t\tscroll_rate:{ desc:'Scroll rate', title:'Number of pixels to scroll when using the keyboard', def:'50'},\n\t\t\tb64_images:{ desc:'Force cache (experimental)', title:'Chache images as base64 strings, so the browser doesn\\'t unload them to save memory',\n\t\t\t\tdef:'0',\n\t\t\t\tvals:{\n\t\t\t\t\t'0':'Disabled',\n\t\t\t\t\t'1':'Enabled'\n\t\t\t\t}\n\t\t\t},\n\t\t\tuseHistoryAPI:{ desc: 'Use browser history', title: 'Changes the URL and keeps track of the visited pages in the browser history, so you can navigate with the browser\\'s back/forward buttons as usual',\n\t\t\t\tdef: '1',\n\t\t\t\tvals:{\n\t\t\t\t\t'0':'Disabled',\n\t\t\t\t\t'1':'Enabled'\n\t\t\t\t}\n\t\t\t},\n\t\t\tmoveWhileLoading:{ desc: 'Force loading next page', title: 'Lets you move to the next or previous page before the image for that page has finished loading',\n\t\t\t\tdef: defaultSettings.moveWhileLoading ? '1' : '0',\n\t\t\t\tvals:{\n\t\t\t\t\t'0':'Disabled',\n\t\t\t\t\t'1':'Enabled'\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t_grp_fit:{ desc:'AutoZoom', title:'Automatically zoom the image, either shrinking or expanding it to make it fit in the screen' },\n\t\t\tfit:{ desc:'Fit image to screen', title:'Apply options below to fit the image to the screen (if none of them are selected and you enable this option, you will be prompted to select the settings the first time you visit each site). This setting can also be toggled for this site with a keyboard shortcut (+ by default)',\n\t\t\t\tdef: defaultSettings.autozoom ? '1' : '0',\n\t\t\t\tvals:{\n\t\t\t\t\t'0':'Disabled',\n\t\t\t\t\t'1':'Enabled'\n\t\t\t\t}\n\t\t\t},\n\t\t\tachw:{ desc:'Shrink to fit width', title:'If the image is wider than the window, it will be shrunk to fit the screen without needing to scroll',\n\t\t\t\tdef: defaultSettings.shrinkWidth ? '1' : '0',\n\t\t\t\tvals:{\n\t\t\t\t\t'0':'Never shrink',\n\t\t\t\t\t'1':'Shrink when needed'\n\t\t\t\t}\n\t\t\t},\n\t\t\tachh:{ desc:'Shrink to fit height', title:'If the image is longer than the window, it will be shrunk to fit the screen without needing to scroll',\n\t\t\t\tdef: defaultSettings.shrinkHeight ? '1' : '0',\n\t\t\t\tvals:{\n\t\t\t\t\t'0':'Never shrink',\n\t\t\t\t\t'1':'Shrink when needed'\n\t\t\t\t}\n\t\t\t},\n\t\t\tagrw:{ desc:'Expand to fit width', title:'If the image is smaller than the window, it will be expanded to fit the screen',\n\t\t\t\tdef: defaultSettings.expandWidth ? '1' : '0',\n\t\t\t\tvals:{\n\t\t\t\t\t'0':'Never expand',\n\t\t\t\t\t'1':'Expand when needed'\n\t\t\t\t}\n\t\t\t},\n\t\t\tagrh:{ desc:'Expand to fit height', title:'If the image is smaller than the window, it will be expanded to fit the screen',\n\t\t\t\tdef: defaultSettings.expandHeight ? '1' : '0',\n\t\t\t\tvals:{\n\t\t\t\t\t'0':'Never expand',\n\t\t\t\t\t'1':'Expand when needed'\n\t\t\t\t}\n\t\t\t},\n\t\t\tmaxScale:{ desc:'Max scale', title: 'Maximum scale (as a percentage, > 100) to which the image should be expanded (leave blank for no limit)'},\n\t\t\tminScale:{ desc:'Min scale', title: 'Minimum scale (as a percentage, < 100) to which the image should be shrunk (leave blank for no limit)'},\n\t\t\tmaxScaleReset:{ desc:'Over max scale', title: 'Action to be taken when the AutoZoom would expand the image over the max scale',\n\t\t\t\tdef: '0',\n\t\t\t\tvals: {\n\t\t\t\t\t'0': 'Keep the max scale',\n\t\t\t\t\t'1': 'Reset to original size'\n\t\t\t\t}\n\t\t\t},\n\t\t\tminScaleReset:{ desc:'Under min scale', title: 'Action to be taken when the AutoZoom would shrink the image over the min scale',\n\t\t\t\tdef: '0',\n\t\t\t\tvals: {\n\t\t\t\t\t'0': 'Keep the min scale',\n\t\t\t\t\t'1': 'Reset to original size'\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t_grp_scroll:{ desc: 'AutoScroll', title:'Scroll to this position of the image each time you change the page' },\n\t\t\tscrollx:{ desc:'Horizontal', title:'Scroll to this position of the image each time you change the page',\n\t\t\t\tvals:{\n\t\t\t\t\t'L':'Left',\n\t\t\t\t\t'R':'Right',\n\t\t\t\t\t'M':'Middle'\n\t\t\t\t}\n\t\t\t},\n\t\t\tscrolly:{ desc:'Vertical', title:'Scroll to this position of the image each time you change the page',\n\t\t\t\tvals:{\n\t\t\t\t\t'U':'Top',\n\t\t\t\t\t'D':'Bottom',\n\t\t\t\t\t'M':'Middle'\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t_grp_prefetch:{ desc:'Page Preloading', title:'Adjust the number of pages to preload in each direction' },\n\t\t\tprefetch_der:{ desc:'Forward', title:'The number of next pages to preload (>0)',\n\t\t\t\tdef:defaultSettings.prefetchNext},\n\t\t\tprefetch_izq:{ desc:'Backwards', title:'The number of previous pages to preload (>0)',\n\t\t\t\tdef:defaultSettings.prefetchBack},\n\t\t\tprefetch_start_der:{ desc:'Initial forward', title:'The number of next pages to preload (>0) when the page is first loaded (to avoid wasting bandwith if you only wanted to see that page)',\n\t\t\t\tdef:defaultSettings.prefetchNextStart},\n\t\t\tprefetch_start_izq:{ desc:'Initial backwards', title:'The number of previous pages to preload (>0) when the page is first loaded (to avoid wasting bandwith if you only wanted to see that page)',\n\t\t\t\tdef:defaultSettings.prefetchBackStart},\n\t\t\tprefetchNoNext:{ desc:'Prefetch when no next page', title:'Disable this to stop preloading the previous page when visiting the last page (ie, the next page was not found)',\n\t\t\t\tdef:defaultSettings.prefetchNoNext ? '1' : '0',\n\t\t\t\tvals:{\n\t\t\t\t\t'0':'Disabled',\n\t\t\t\t\t'1':'Enabled'\n\t\t\t\t}}\n\t\t};\n\n\t\t//visual options\n\t\tvar opsLayout = {\n\t\t\tlayout:{ desc:'Layout', title:'Minimalistic layout will show only the image, the defined extra content, and this script\\'s buttons. Keeping the original layout will stuff that same content in the place where the image used to be, leaving the rest of the page untouched. This setting can also be toggled for this site with a keyboard shortcut (- by default)',\n\t\t\t\tdef: defaultSettings.fullLayout ? '1' : '0',\n\t\t\t\tvals:{\n\t\t\t\t\t'0':'Minimalistic',\n\t\t\t\t\t'1':'Keep original'\n\t\t\t\t}\n\t\t\t},\n\t\t\tbotones:{ desc:'Buttons', title:'Show or hide all the script\\'s buttons (back/next, bookmarks, settings, etc...). This setting can also be toggled for this site with a keyboard shortcut (Shift + - by default)',\n\t\t\t\tdef: defaultSettings.showButtons ? '1' : '0',\n\t\t\t\tvals:{\n\t\t\t\t\t'0':'Hide',\n\t\t\t\t\t'1':'Show'\n\t\t\t\t}\n\t\t\t},\n\t\t\tdim:{ desc:'Screen Dimmer', title:'Add a shadow to the rest of the site so the image (or script content) gets a better focus',\n\t\t\t\tdef: '0',\n\t\t\t\tvals:{\n\t\t\t\t\t'0':'Disabled',\n\t\t\t\t\t'S':'Focus script content',\n\t\t\t\t\t'I':'Focus image'\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t_grp_border:{ desc: 'Border', title:'Space to leave around the image (affects AutoScroll and AutoZoom)' },\n\t\t\tbordex:{ desc:'Horizontal border', title:'Extra pixels to the left/right of the image',\n\t\t\t\tdef: defaultSettings.borderLR },\n\t\t\tbordey:{ desc:'Vertical border', title:'Extra pixels to the top/bottom of the image',\n\t\t\t\tdef: defaultSettings.borderUD },\n\n\t\t\t_grp_cursor:{ desc:'Cursors', title:'Change the cursor according to the current state' },\n\t\t\tchcursor_img:{ desc:'Change over image', title:'Enable/Disable this to see a different cursor over the image depending on the state, or always the same one',\n\t\t\t\tdef:'1',\n\t\t\t\tvals:{\n\t\t\t\t\t'0':'Disabled',\n\t\t\t\t\t'1':'Enabled'\n\t\t\t\t}\n\t\t\t},\n\t\t\tchcursor_btns:{ desc:'Change over buttons', title:'Enable/Disable this to see a different cursor over the back/next buttons depending on the state, or always the same one',\n\t\t\t\tdef:'1',\n\t\t\t\tvals:{\n\t\t\t\t\t'0':'Disabled',\n\t\t\t\t\t'1':'Enabled'\n\t\t\t\t}\n\t\t\t},\n\t\t\tcursor_back:{ desc:'Previous page', title:'Cursor for the previous page', def:'1', vals: cursores },\n\t\t\tcursor_next:{ desc:'Next page', title:'Cursor for the next page', def:'2', vals: cursores },\n\t\t\tcursor_loading:{ desc:'Loading', title:'Cursor for when the next page is loading', def:'progress', vals: cursores },\n\t\t\tcursor_nolink:{ desc:'No link', title:'Cursor for when there is no next page', def:'not-allowed', vals: cursores },\n\t\t\tcursor_noimg:{ desc:'No image', title:'Cursor for when there is a next page but it has no image', def:'pointer', vals: cursores },\n\t\t\tcursor_custom_3:{ desc:'Custom cursor #1', title:'Custom image to use in the above options, either as an url or base64 (suggested size of 32x32 px, hotspot is at 16,16)'},\n\t\t\tcursor_custom_4:{ desc:'Custom cursor #2', title:'Custom image to use in the above options, either as an url or base64 (suggested size of 32x32 px, hotspot is at 16,16)'}\n\t\t};\n\n\t\tvar divsets = document.createElement('div');\n\t\tdivsets.id = 'wcr_settings';\n\t\tdivsets.style.textAlign = 'center';\n\t\tdivsets.innerHTML =\n\t\t\t'<div style=\"position:fixed; z-index:232322; background:#000; top:0; left:0; right:0; bottom:0; opacity:0.8;\"></div>'+\n\t\t\t'<div id=\"wcr_settings_popup\" style=\"position:absolute; left:50%; z-index:232323; background-color:#fff; color:#000; padding: 20px;max-width: 800px; min-width: 800px;\">'+\n\t\t\t\t'<div id=\"wcr_settings_links\">'+\n\t\t\t\t\t'<span class=\"wcr_general\">General</span> | '+\n\t\t\t\t\t'<span class=\"wcr_layout\">Graphic settings</span> | '+\n\t\t\t\t\t'<span class=\"wcr_sitio\">Site settings</span> | '+\n\t\t\t\t\t'<span class=\"wcr_teclas\">Keyboard shortcuts</span>'+\n\t\t\t\t'</div><hr class=\"wcr_settings_hr\" />'+\n\t\t\t\t'<div id=\"wcr_settings_content\" style=\"text-align:left\">'+\n\t\t\t\t\t'<div class=\"wcr_general\">'+htmlLayout(opsGeneral, 'general')+'</div>'+\n\t\t\t\t\t'<div class=\"wcr_layout\">'+htmlLayout(opsLayout, 'layout')+'</div>'+\n\t\t\t\t\t'<div class=\"wcr_sitio\">'+htmlSitio(propsSitio)+'</div>'+\n\t\t\t\t\t'<div class=\"wcr_teclas\">'+htmlTeclas(teclas)+'</div>'+\n\t\t\t\t'</div><hr class=\"wcr_settings_hr\" />'+\n\t\t\t\t'<div>'+\n\t\t\t\t\t'Import / Export '+\n\t\t\t\t\t'<select id=\"wcr_set_sel_impexp\">'+\n\t\t\t\t\t\t'<option value=\"\">data for '+dominioData()+'</option>'+\n\t\t\t\t\t\t'<option value=\"default\">default settings</option>'+\n\t\t\t\t\t\t'<option value=\"all\">ALL data</option>'+\n\t\t\t\t\t'</select> '+\n\t\t\t\t\t'<button id=\"wcr_set_btn_impexp\">GO</button><br>'+\n\t\t\t\t\t'Reset '+\n\t\t\t\t\t'<select id=\"wcr_set_sel_reset\">'+\n\t\t\t\t\t\t'<option value=\"\">data for '+dominioData()+'</option>'+\n\t\t\t\t\t\t'<option value=\"default\">default settings</option>'+\n\t\t\t\t\t\t'<option value=\"all\">ALL data</option>'+\n\t\t\t\t\t'</select> '+\n\t\t\t\t\t'<button id=\"wcr_set_btn_reset\">GO</button>'+\n\t\t\t\t'</div><br/>'+\n\t\t\t\t'<div>'+\n\t\t\t\t\t'<button id=\"wcr_set_btn_guardar\">Save</button> '+\n\t\t\t\t\t'<button id=\"wcr_set_btn_aplicar\">Apply</button> '+\n\t\t\t\t\t'<button id=\"wcr_set_btn_cancelar\">Cancel</button>'+\n\t\t\t\t'</div>'+\n\t\t\t'</div>'+\n\t\t\t'<style>'+\n\t\t\t\t'#wcr_settings_popup *{color:#000; font-size: 12px !important; font-family: Verdana, Arial, Helvetica, sans-serif !important;}'+\n\t\t\t\t'.wcr_tr_vert_group, .wcr_td_hori_group{height: 25px; padding: 0px;}'+\n\t\t\t\t'.wcr_td_vert_group{height: 25px; width: 224px !important; padding: 0px;}'+\n\t\t\t\t'.wcr_settings_td_label{text-align: center;height: 24px; padding: 0px;}'+\n\t\t\t\t'.wcr_settings_hr{margin: 4px 2px 4px}'+\n\t\t\t\t'#wcr_sel_confpag, #wcr_set_sel_impexp, #wcr_set_sel_reset{width: 50% !important}'+\n\t\t\t\t'#wcr_general_tabla, #wcr_layout_tabla{width: 100%; border-spacing: 2px}'+\n\t\t\t\t'#wcr_settings_popup input, #wcr_settings_popup select, #wcr_settings_popup textarea{background-color:#fff; width: 95%;}'+\n\t\t\t\t'#wcr_settings_links span{cursor:pointer; text-decoration:underline;}'+\n\t\t\t\t'div{position:static; float:none;}'+\n\t\t\t\t'#wcr_settings [title]{cursor:help;}'+\n\t\t\t\t'#wcr_settings tr:nth-of-type(odd){background-color:#fff; color:#000;}'+\n\t\t\t\t'#wcr_settings tr:nth-of-type(even){background-color:#eef; color:#000;}'+\n\t\t\t\t'#wcr_settings tr.wcr_settings_group{background-color:#ccf; color:#000; text-align:center; font-style:italic;}'+\n\t\t\t\t'.wcr_settings_group td:nth-of-type(1):not([colspan]){background-color:#fff;}'+\n\t\t\t'</style>';\n\t\tdocument.body.appendChild(divsets);\n\n\t\tinitLayout(opsGeneral, 'general');\n\t\tinitLayout(opsLayout, 'layout');\n\t\tinitSitio(propsSitio);\n\t\tinitTeclas(teclas);\n\n\t\t//set events for tabs / save / cancel\n\t\tvar tabs = xpath('//div[@id=\"wcr_settings_links\"]/span', document, true);\n\t\tfor(var i=0; i<tabs.length; i++)\n\t\t\tsetEvt(tabs[i], 'click', function(evt){\n\t\t\t\tcambiarTabSettings(evt.target.className);\n\t\t\t});\n\n\t\tfor(var o in opsGeneral) opsLayout[o] = opsGeneral[o];\n\t\tsetEvt('wcr_set_btn_guardar', 'click', function(){\n\t\t\tif(guardarSettings(teclas, propsSitio, tiposUp, opsLayout)){\n\t\t\t\tredirect(link[posActual]);\n\t\t\t}\n\t\t});\n\t\tsetEvt('wcr_set_btn_aplicar', 'click', function(){\n\t\t\tguardarSettings(teclas, propsSitio, tiposUp, opsLayout);\n\t\t});\n\t\tsetEvt('wcr_set_btn_cancelar', 'click', function(){\n\t\t\tdocument.body.removeChild(divsets);\n\t\t});\n\t\tsetEvt('wcr_set_btn_impexp', 'click', function(){\n\t\t\tif(confirm('Save the changes?')) guardarSettings(teclas, propsSitio, tiposUp, opsLayout);\n\n\t\t\tvar dominio = get('wcr_set_sel_impexp').value;\n\t\t\tvar data = dominio == 'all' ?\n\t\t\t\tGM_getValue('wcr.settings', '') :\n\t\t\t\tJSON.stringify(getData('', '', dominio));\n\t\t\tvar resp = prompt(\n\t\t\t\t'Copy this and save it somewhere to export your settings.\\n' +\n\t\t\t\t'Replace this with your saved settings to restore them.', data);\n\t\t\tif(resp && resp != data && confirm('Are you sure you want to replace your current settings?')){\n\t\t\t\ttry{\n\t\t\t\t\tvar nuevaData = JSON.parse(resp);\n\t\t\t\t\tif(dominio == 'all') GM_setValue('wcr.settings', resp);\n\t\t\t\t\telse setData('', nuevaData, dominio);\n\t\t\t\t\talert('Settings updated successfully');\n\t\t\t\t\tredirect(link[posActual]);\n\t\t\t\t}\n\t\t\t\tcatch(e){\n\t\t\t\t\talert('Error parsing the settings, nothing has been changed');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tsetEvt('wcr_set_btn_reset', 'click', function(){\n\t\t\tvar msgConfirm = 'This will reset all data for '+dominioData()+': graphic options, bookmarks, and last visited page.\\nYou may want to export and backup your settings first...\\n\\nAre you sure you want to delete this data?';\n\t\t\tvar msgOK = 'All settings for '+dominioData()+' cleared';\n\t\t\tvar dominio = get('wcr_set_sel_reset').value;\n\t\t\tif(dominio == 'all'){\n\t\t\t\tmsgConfirm = 'This will reset EVERYTHING to the default settings, and all data will be lost for all sites.\\nYou may want to export and backup your settings first...\\n\\nAre you REALLY sure you want to do delete this data?';\n\t\t\t\tmsgOK = 'Everything is gone... everything...\\n\\n\\n\\n...forever';\n\t\t\t}\n\t\t\telse if(dominio == 'default'){\n\t\t\t\tmsgConfirm = 'This will reset all the default graphic options and keyboard shortcuts settings.\\nYou may want to export and backup your settings first...\\n\\nAre you sure you want to do delete this data?';\n\t\t\t\tmsgOK = 'All default settings cleared';\n\t\t\t}\n\n\t\t\tif(confirm(msgConfirm)){\n\t\t\t\tif(dominio == 'all') GM_deleteValue('wcr.settings');\n\t\t\t\telse delData('', dominio);\n\t\t\t\talert(msgOK);\n\t\t\t\tredirect(link[posActual]);\n\t\t\t}\n\t\t});\n\n\t\tcambiarTabSettings(tabSettingActual);\n\t}\n\tcatch(e){\n\t\talert('Error while initializing the settings window: ' + e);\n\t\tif(get('wcr_settings')) document.body.removeChild(get('wcr_settings'));\n\t}\n}", "setClean() {\n this.set('originalModuleEnabled', this.moduleEnabled);\n this.setupSettings();\n this.setupHotkeys();\n }" ]
[ "0.7138184", "0.6283134", "0.6170119", "0.6125169", "0.6111438", "0.6037352", "0.59966815", "0.59806174", "0.5917414", "0.5916246", "0.5869842", "0.58078647", "0.5799425", "0.5796724", "0.57943803", "0.5762157", "0.5746978", "0.5728973", "0.5726674", "0.5718057", "0.57178485", "0.5714483", "0.57013273", "0.56867063", "0.56638503", "0.5660129", "0.5599127", "0.5594449", "0.55666167", "0.55639786", "0.5563395", "0.5557339", "0.5543595", "0.554272", "0.5538521", "0.5538054", "0.5530502", "0.55253905", "0.5521631", "0.5520736", "0.5512541", "0.5509476", "0.55062884", "0.5478296", "0.5471873", "0.5464852", "0.5456951", "0.5444456", "0.54428476", "0.5438936", "0.5434161", "0.5423074", "0.54227394", "0.5413033", "0.5412695", "0.5411867", "0.5410911", "0.5402325", "0.53990155", "0.53950757", "0.5393714", "0.539324", "0.5386988", "0.53815573", "0.5376155", "0.5373216", "0.5373159", "0.5372783", "0.5369419", "0.53677803", "0.5362453", "0.53590614", "0.53565544", "0.535221", "0.5347803", "0.5342186", "0.5339939", "0.5335815", "0.5333722", "0.5329854", "0.532933", "0.5324282", "0.53240085", "0.53230053", "0.53224134", "0.5321725", "0.5317482", "0.53146076", "0.53142345", "0.53112537", "0.5297067", "0.5296749", "0.52949315", "0.5283905", "0.52828956", "0.5281843", "0.5281369", "0.5274653", "0.5272364", "0.5271227", "0.5269882" ]
0.0
-1
Anchor method for updating
update(delta) {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function UpdateAnchorsHandler() { }", "set anchor(value) {}", "get anchor() {}", "anchor() {\n this.__anchors++;\n }", "anchor() {\n this.__anchors++;\n }", "anchor() {\n this.__anchors++;\n }", "anchor() {\n this.__anchors++;\n }", "update() {\n\tlet usp = new search.URLSearchParams(location.hash)\n\tfor (let node of this.anchors) {\n\t let params = new search.URLSearchParams(node.hash)\n\t usp.set('m', params.get('m'))\n\t node.href = '#?' + usp.toString()\n\t}\n }", "setAnchorPostion(anchor, newX, newY) {\n anchor.html.attr(\"cx\", newX).attr(\"cy\", newY);\n }", "function updateDropDownAnchor(section)\n {\n // Label\n $('span.label', drop_down_anchor).html(section.label);\n\n // Href\n drop_down_anchor.attr('href', '#' + section.id);\n }", "_onAnchorUpdate()\n {\n this._transformID = -1;\n }", "_onAnchorUpdate() {\n this._transformID = -1;\n this._transformTrimmedID = -1;\n }", "function updateLink() {\n const url = urlInput.value;\n const name = nameInput.value;\n editBookmark({url, name, key}, () => {\n renderBookmarks(pagination.currentPage);\n cancelEdit();\n });\n }", "addAnchor() {\n const data = {\n action: 'addAnchor',\n value: null\n };\n this.postMessage(data);\n }", "function editEndpointAnchorsHref($node) {\n // Get data\n var pluginData = getElasticSearchData($node);\n // Loop trough links\n $(pluginData.settings.endpointAnchorTarget).each(function () {\n // Store element\n $anchor = $(this);\n // If not active\n var anchorEndpoint = getQueryString(pluginData.settings.endpointQueryParam, $anchor.attr(\"href\"));\n if (anchorEndpoint !== endpoint) {\n // Check for cookie\n var cookieValue = getElasticSearchCookie(pluginData.settings.cookiePrefix + anchorEndpoint);\n // If cookie value is defined\n if (cookieValue !== null && cookieValue !== \"\") {\n // Update href\n $anchor.attr(\"href\", $anchor.attr(\"href\") + cookieValue);\n }\n }\n });\n }", "get anchor() { return this.$anchor.pos }", "onClickAdvanced() {\n location.hash = '/content/json/' + this.model.id;\n }", "function update_link() {\r\n\t$('#side_navi').append('<p><a href=\"#\" id=\"farmer_update\" onclick=\"update_script()\">Update '+SCRIPT.name+'</a></p>');\r\n}", "function alterAnchor(e){\n\t// Prevent native scroll event.\n\te.preventDefault();\n\tvar destination = document.getElementById(e.target.classList[0]);\n\t// Find distance from top of page.\n\tvar body = document.body.getBoundingClientRect().top;\n\t// Find distance from top of element to scroll to.\n\tvar element = destination.getBoundingClientRect().top;\n\t// Find difference.\n\tvar newLoc = element - body - 25;\n\t// Go there.\n\t// window.scrollTo(0, newLoc);\n\tsmoothScroll(-body, newLoc);\n}", "function anchorLink(element) {\n // Prevent default behaviour\n event.preventDefault();\n\n // Setting variables\n var original_target = element,\n target = $(original_target),\n scrollTopAmount = Math.ceil(target.offset().top),\n scrollUntilHeight2 = 0,\n scrollUntilHeight = 0;\n\n // Add or reduce height from scrollTop\n $('.sticky-parent').each(function () {\n // Add height\n if ( target.isAfter( $(this) ) ) {\n scrollUntilHeight2 += $(this).outerHeight();\n }\n scrollUntilHeight = scrollUntilHeight2;\n })\n scrollTopAmount -= scrollUntilHeight;\n window.location.hash = original_target;\n $('html,body').animate({scrollTop: scrollTopAmount }, plugin.settings.scrollTopDuration);\n }", "function update(){\r\n //needs to update server with link/navigation information\r\n //ajax\r\n}", "function reloadAndGotoAnchor() {\n window.location.href='/#statistics';\n window.location.reload();\n}", "function $anchor(parent, id, cl, text, href) {\n\tlet a = $new(parent, 'a', id, cl, text);\n\tif (href) a.href = href;\n\treturn a;\n}", "changeAnchorPart( arg_map ) {\n var\n anchor_map_revise = this.copyAnchorMap(),\n bool_return = true,\n key_name, key_name_dep;\n\n // Begin merge changes into anchor map\n KEYVAL:\n for ( key_name in arg_map ) {\n if ( arg_map.hasOwnProperty( key_name ) ) {\n\n // skip dependent keys during iteration\n if ( key_name.indexOf( '_' ) === 0 ) { continue KEYVAL; }\n\n // update independent key value\n anchor_map_revise[key_name] = arg_map[key_name];\n\n // update matching dependent key\n key_name_dep = '_' + key_name;\n if ( arg_map[key_name_dep] ) {\n anchor_map_revise[key_name_dep] = arg_map[key_name_dep];\n }\n else {\n delete anchor_map_revise[key_name_dep];\n delete anchor_map_revise['_s' + key_name_dep];\n }\n }\n }\n // End merge changes into anchor map\n\n // Begin attempt to update URI; revert if not successful\n try {\n $.uriAnchor.setAnchor( anchor_map_revise );\n }\n catch ( error ) {\n // replace URI with existing state\n $.uriAnchor.setAnchor( this.stateMap.anchor_map,null,true );\n bool_return = false;\n }\n // End attempt to update URI...\n\n return bool_return;\n }", "function anchor(url){\n\twindow.location.href= url;\n}", "get anchor() {\n return this.$anchor.pos;\n }", "function onClick(target){\n updateTitle(target);\n updatePage(target);\n}", "function enableAnchor(anchor) {\n anchor.style.pointerEvents = \"all\";\n anchor.style.cursor = \"pointer\";\n anchor.className = \"button game-mode-button back-color-1\";\n}", "function setHref(lnk,q){\n\turl = DBEDIT_MODULE_URL +\"&dba=118\";\n\tDBEDIT_TABLE_NAME = (dbObject.tableName)?dbObject.tableName:DBEDIT_TABLE_NAME;\n\tif(!DBEDIT_TABLE_NAME && !DBEDIT_DB_ID) return false;\n\turl+= (DBEDIT_DB_ID)?'&db='+DBEDIT_DB_ID:'';\n\turl+= (DBEDIT_TABLE_NAME) ? '&tbl='+DBEDIT_TABLE_NAME : '';\n\turl+= q;\n\tlnk.set({'href':url});\n}", "function scrollTo_anchor(action) {\n if (action.target.nodeName === \"A\") {\n const allSecId = action.target.getAttribute(\"data-id\");\n const allSec = document.getElementById(allSecId);\n allSec.scrollIntoView({ behavior: \"smooth\" });\n }\n}", "_update() {\n window.location.pathname = this._current().url;\n }", "function getAnchor(e) {\n let el = e.target;\n while (el && !el.href) {\n el = el.parentNode;\n }\n if (el) {\n e.preventDefault();\n history.pushState(null, null, el.href); // Modify current url to become url of link.\n changePage();\n }\n }", "function offsetAnchor() {\r\n\tif (location.hash.length !== 0) {\r\n\t\twindow.scrollTo(window.scrollX, window.scrollY - 100);\r\n\t}\r\n}", "anchorClick(){\n \n var app = this;\n var anchor = $('#ul-scroll').find('a');\n\n anchor.on('click', function(){\n\n var idom = $(this).children().attr('id');\n var ctp = idom.replace(\"divpage-\", \"\");\n\n app.counter = parseInt(ctp);\n app.currentPage = app.counter;\n\n app.hoverList(app.counter);\n\n console.log(app.hoverList(app.counter));\n\n // var divanchor = app.$divanchor;\n\n // if (divanchor.hasClass('actual-Session')) {\n \n // $('.actual-Session').css({\n // \"background-color\" : \"rgba(255, 255, 255, 0)\"\n // });\n \n // divanchor.removeClass('actual-Session');\n // }\n \n // $('#divpage-' + app.counter).addClass('actual-Session');\n \n // $('.actual-Session').css({\n // \"background-color\" : \"white\"\n // });\n });\n }", "function offsetAnchor() {\n if (location.hash.length !== 0) {\n // window.scrollTo(window.scrollX, window.scrollY - 140);\n $(\"html\").animate({ scrollTop: $(location.hash).offset().top - 160 }, 500);\n }\n }", "function offsetAnchor() {\n if (location.hash.length !== 0) {\n window.scrollTo(window.scrollX, window.scrollY - 100);\n }\n}", "function linkUpdate ( flag ) {\r\n\r\n\t\tvar trigger = $.inArray(flag, triggerPos);\r\n\r\n\t\t// The API might not have been set yet.\r\n\t\tif ( $Target[0].linkAPI && $Target[0].linkAPI[flag] ) {\r\n\t\t\t$Target[0].linkAPI[flag].change(\r\n\t\t\t\t$Values[trigger],\r\n\t\t\t\t$Handles[trigger].children(),\r\n\t\t\t\t$Target\r\n\t\t\t);\r\n\t\t}\r\n\t}", "function offsetAnchor() {\n if (location.hash.length !== 0) {\n window.scrollTo(window.scrollX, window.scrollY - 100);\n }\n}", "function offsetAnchor() {\n if (location.hash.length !== 0) {\n window.scrollTo(window.scrollX, window.scrollY - 100);\n }\n}", "function scrollToAnchor(){\n\n //getting the anchor link in the URL and deleting the `#`\n var value = window.location.hash.replace('#', '').split('/');\n var section = decodeURIComponent(value[0]);\n var slide = decodeURIComponent(value[1]);\n /* nectar addition */ \n if(section && $('.vc_row[data-fullscreen-anchor-id=\"'+section+'\"]').length > 0){ //if theres any #\n /* nectar addition end */ \n if(options.animateAnchor){\n scrollPageAndSlide(section, slide);\n }else{\n FP.silentMoveTo(section, slide);\n }\n }\n }", "function offsetAnchor() {\n if (location.hash.length !== 0) {\n window.scrollTo(window.scrollX, window.scrollY - 100)\n }\n}", "function href(editor, v) {\n\t\tvar a = getFirstAnchor(editor);\n\t\tif (!v)\n\t\t\treturn a ? a.href : '';\n\t\telse if (a)\n\t\t\ta.href = v;\n\t}", "function goToAnchor(anchor) {\n if (anchor) {\n window.scrollTo(0, $('a[name=' + anchor + ']').offset().top - 120);\n }\n }", "function offsetAnchor() {\n if (location.hash.length !== 0) {\n window.scrollTo(window.scrollX, window.scrollY - 110);\n }\n}", "function linkUpdate ( flag ) {\n\n\t\tvar trigger = $.inArray(flag, triggerPos);\n\n\t\t// The API might not have been set yet.\n\t\tif ( $Target[0].linkAPI && $Target[0].linkAPI[flag] ) {\n\t\t\t$Target[0].linkAPI[flag].change(\n\t\t\t\t$Values[trigger],\n\t\t\t\t$Handles[trigger].children(),\n\t\t\t\t$Target\n\t\t\t);\n\t\t}\n\t}", "function anchorClick() {\n var marker = markerForUrl( this.href );\n if( marker ) {\n if( /\\bZOOM\\b/.exec( this.className ) ) {\n var mapType = marker.mapType || marker.ezmap.map.getCurrentMapType();\n var zoomLevel;\n if( marker.span ) {\n zoomLevel = mapType.getSpanZoomLevel(\n marker.point, marker.span, marker.ezmap.viewsize );\n }\n else {\n zoomLevel = marker.ezmap.map.getZoom();\n }\n marker.ezmap.map.setCenter( marker.point, zoomLevel, mapType );\n }\n marker.doOpen();\n return false;\n }\n else {\n return true;\n }\n }", "function setup_queue_link(element)\n{\n element.addEvent(\"click\", function(event) {\n var id = event.target.get('id');\n var name = id.substr(6);\n\n location.href = mlisturl + \"/\" + name;\n });\n}", "function updateRoute() {\n\n}", "if (this.props.anchorRef) {\n const {height, width} = this.props.anchorRef.getBoundingClientRect();\n\n if (this.anchorHeight !== height || this.anchorWidth !== width) {\n this.anchorHeight = height;\n this.anchorWidth = width;\n this.popper && this.popper.scheduleUpdate();\n }\n }", "function _adminLink(href, table, id, callback, anchor) {\n anchor = _createElement('a');\n if (id) anchor.id = table + id;\n // href will always be appended with id\n anchor.href = href + id;\n _setInnerHTML(anchor, table);\n if (callback) gU.on(anchor, 'click', callback);\n return anchor;\n }", "function ajxUpdateLinkDone() { \n document.location.href=\"index.php\";\n }", "scrollAnchor(e, respond = null) {\n let targetID;\n if (e) {\n e.preventDefault();\n targetID = respond ? respond.getAttribute('href') : this.getAttribute('href');\n targetID = `#${targetID.split('#').pop()}`;\n } else {\n targetID = '#' + respond;\n }\n\n const targetAnchor = document.querySelector(targetID);\n if (!targetAnchor) return;\n targetAnchor.scrollIntoView({\n behavior: 'smooth'\n });\n }", "function scrollToAnchor(aid) {\n\t\tvar aName = $(\"a[name='\"+ aid +\"']\");\n\t\t$(\"html,body\").animate({scrollTop: aName.offset().top}, 'slow');\n\t}", "function updateURL() {\n var link = baseUrl,\n delim = \"?\";\n\n /* Appends all the query parameters to the link (a query parameter can be\n * excluded by setting it to null) */\n UtilDict.forEachEntry(parameters, function (key, value) {\n if (value) { // Value cannot be null or the empty String\n link += delim + value;\n if (delim === \"?\") {\n //first param has a question mark in front of it. all others have an &\n delim = \"&\";\n }\n }\n });\n\n // Need to add an extra \"&\" to the query if we have an anchor, otherwise\n // the last query will contain the anchors\n if (!UtilDict.isEmpty(anchors)) {\n link += \"&\";\n }\n\n // Anchors have to be at the end\n UtilDict.forEachEntry(anchors, function (key, value) {\n link += \"#\" + value;\n });\n\n if (isShortLinkMode) {\n if (linkPaneTextbox.is(\":visible\")) {\n getlinkloadinganimation.show();\n\n jQuery.urlShortener({\n longUrl: link,\n success: function (shortUrl) {\n setNewUrl(shortUrl);\n getlinkloadinganimation.hide();\n },\n error: function (err) {\n console.error(JSON.stringify(err));\n getlinkloadinganimation.hide();\n }\n });\n }\n } else {\n setNewUrl(link);\n }\n\n //update lang href with current bookmark url\n updateLangHref(link);\n\n //trigger event indicating bookmark is complete. pass bookmark as arg\n topic.publish(EventManager.BookmarkLink.BOOKMARK_GENERATED, {\n link: link\n });\n }", "buildAnchors() {\r\n this.buildPointAnchors();\r\n }", "function setUrl(nextAnchor) {\n status.currentUrl = status.nextUrl || window.location.href;\n status.nextUrl = nextAnchor ? nextAnchor.attr('href') : $(options.link).attr('href');\n }", "function updateAnchorItemsPositions() {\n for (var k = 0; k < anchorBlocks.length; k++) {\n var item = anchorBlocks[k];\n var blockTop = 0;\n var blockH = _utility.wndH;\n if (item.$block.length) {\n blockTop = item.$block.offset().top;\n blockH = item.$block.innerHeight();\n }\n item.activate = blockTop - _utility.wndH / 2;\n item.deactivate = blockTop + blockH - _utility.wndH / 2;\n }\n }", "renderAnchor() {\n return html `\n <slot></slot>\n `;\n }", "['click .method-container a'](e, $el) {\n\t\tToc.goToHash($el.attr('href'));\n\t}", "function scrollToAnchor(aid){\n\t\tvar aTag = $(\"a[name='\"+ aid +\"']\");\n\t\t$('html,body').animate({scrollTop: aTag.offset().top},'slow');\n\t}", "function scrollToAnchor(aid){\n\t\tvar aTag = $(\"a[name='\"+ aid +\"']\");\n\t\t$('html,body').animate({scrollTop: aTag.offset().top},'slow');\n\t}", "function updateAnchorItemsPositions() {\n for (var k = 0; k < anchorBlocks.length; k++) {\n var item = anchorBlocks[k];\n var blockTop = 0;\n var blockH = wndH;\n if (item.$block.length) {\n blockTop = item.$block.offset().top;\n blockH = item.$block.innerHeight();\n }\n item.activate = blockTop - wndH / 2;\n item.deactivate = blockTop + blockH - wndH / 2;\n }\n }", "function swapAnchor (whichLayer, newAnchor) {\n\n\t\t// Layer Transform Group\n\tvar layerTransformGrp = whichLayer.property(\"ADBE Transform Group\");\n\n\t\t// Position Layer Anchor Point\n\tvar theLayerAnchor = layerTransformGrp.property(\"ADBE Anchor Point\");\n\ttheLayerAnchor.setValue(newAnchor);\n\n}", "render() {\n let anchorAttributes = {\n class: {\n [this.activeClass]: this.match !== null,\n },\n onClick: this.handleClick.bind(this)\n };\n if (this.anchorClass) {\n anchorAttributes.class[this.anchorClass] = true;\n }\n if (this.custom === 'a') {\n anchorAttributes = Object.assign(Object.assign({}, anchorAttributes), { href: this.url, title: this.anchorTitle, role: this.anchorRole, tabindex: this.anchorTabIndex, 'aria-haspopup': this.ariaHaspopup, id: this.anchorId, 'aria-posinset': this.ariaPosinset, 'aria-setsize': this.ariaSetsize, 'aria-label': this.ariaLabel });\n }\n return (index.h(this.custom, Object.assign({}, anchorAttributes), index.h(\"slot\", null)));\n }", "function updateLink(node, opts) {\n \tlet href = opts.href || node.getAttribute(\"href\");\n\n \t// Destination must start with '/' or '#/'\n \tif (href && href.charAt(0) == \"/\") {\n \t\t// Add # to the href attribute\n \t\thref = \"#\" + href;\n \t} else if (!href || href.length < 2 || href.slice(0, 2) != \"#/\") {\n \t\tthrow Error(\"Invalid value for \\\"href\\\" attribute: \" + href);\n \t}\n\n \tnode.setAttribute(\"href\", href);\n\n \tnode.addEventListener(\"click\", event => {\n \t\t// Prevent default anchor onclick behaviour\n \t\tevent.preventDefault();\n\n \t\tif (!opts.disabled) {\n \t\t\tscrollstateHistoryHandler(event.currentTarget.getAttribute(\"href\"));\n \t\t}\n \t});\n }", "function look_ruby_scroll_update_url() {\r\n var single = $('.single');\r\n if (single.length > 0) {\r\n var post_outer = single.find('.single-post-outer');\r\n if (post_outer.length > 1) {\r\n post_outer.each(function() {\r\n var post_outer_el = $(this);\r\n var url = post_outer_el.data('post_url');\r\n var title = post_outer_el.data('post_title');\r\n\r\n new Waypoint.Inview({\r\n element: post_outer_el,\r\n enter: function() {\r\n look_ruby_update_url(url, title);\r\n }\r\n });\r\n })\r\n }\r\n }\r\n }", "function updatePage(pair, forceback) {\n var loc = window.location;\n var newhash = pair.large.attr(params.anchorName);\n var curhash = loc.pathname.replace(\"/\",\"\");\n //dlog(\"Updating hash - current: \"+curhash+ \" new: \"+newhash);\n if (newhash == curhash) {\n //dlog(\"No need to update\");\n return;\n }\n if (\"pushState\" in history) {\n if (!curhash || forceback) {\n //dlog(\"new location to \"+newhash);\n history.pushState({state: 1}, document.title, newhash);\n } else {\n //dlog(\"update location to \"+newhash);\n history.replaceState({state: 1}, document.title, newhash);\n }\n }\n }", "updateRoute() {\n this.props.updateRoute(this.props.index,\n this.agency, this.line, this.direction, this.time);\n }", "function clickActiveLink() {\r\n var splitID = this.id.split(\"_\");\r\n replaceContent(splitID[1] + \"/\" + splitID[2], this.title);\r\n if (boxStatus == 0) {\r\n showBox();\r\n } \r\n}", "function scrollToAnchor(aid){\n var aTag = $(aid);\n $('html,body').animate({scrollTop: (aTag.offset().top-100)},'slow');\n }", "updateActiveLink() {\n if (!this._items) {\n return;\n }\n const items = this._items.toArray();\n for (let i = 0; i < items.length; i++) {\n if (items[i].active) {\n this.selectedIndex = i;\n this._changeDetectorRef.markForCheck();\n return;\n }\n }\n // The ink bar should hide itself if no items are active.\n this.selectedIndex = -1;\n this._inkBar.hide();\n }", "function scrollToAnchor(){\r\n var anchors = getAnchorsURL();\r\n var sectionAnchor = anchors.section;\r\n var slideAnchor = anchors.slide;\r\n\r\n if(sectionAnchor){ //if theres any #\r\n if(options.animateAnchor){\r\n scrollPageAndSlide(sectionAnchor, slideAnchor);\r\n }else{\r\n silentMoveTo(sectionAnchor, slideAnchor);\r\n }\r\n }\r\n }", "function scrollToAnchor(){\r\n var anchors = getAnchorsURL();\r\n var sectionAnchor = anchors.section;\r\n var slideAnchor = anchors.slide;\r\n\r\n if(sectionAnchor){ //if theres any #\r\n if(options.animateAnchor){\r\n scrollPageAndSlide(sectionAnchor, slideAnchor);\r\n }else{\r\n silentMoveTo(sectionAnchor, slideAnchor);\r\n }\r\n }\r\n }", "function scrollToAnchor(){\r\n var anchors = getAnchorsURL();\r\n var sectionAnchor = anchors.section;\r\n var slideAnchor = anchors.slide;\r\n\r\n if(sectionAnchor){ //if theres any #\r\n if(options.animateAnchor){\r\n scrollPageAndSlide(sectionAnchor, slideAnchor);\r\n }else{\r\n silentMoveTo(sectionAnchor, slideAnchor);\r\n }\r\n }\r\n }", "function scrollTo(anchor) {\n event.preventDefault();\n\n // Get offset from top of anchor point\n topY = anchor.offsetTop;\n\n // Tween to anchor point\n TweenLite.to(window, 1, {\n scrollTo: {\n y: topY,\n offsetY: 10\n },\n force3D: true\n });\n }", "function updateLink(node, opts) {\n \tlet href = opts.href || node.getAttribute('href');\n\n \t// Destination must start with '/' or '#/'\n \tif (href && href.charAt(0) == '/') {\n \t\t// Add # to the href attribute\n \t\thref = '#' + href;\n \t} else if (!href || href.length < 2 || href.slice(0, 2) != '#/') {\n \t\tthrow Error('Invalid value for \"href\" attribute: ' + href);\n \t}\n\n \tnode.setAttribute('href', href);\n\n \tnode.addEventListener('click', event => {\n \t\t// Prevent default anchor onclick behaviour\n \t\tevent.preventDefault();\n\n \t\tif (!opts.disabled) {\n \t\t\tscrollstateHistoryHandler(event.currentTarget.getAttribute('href'));\n \t\t}\n \t});\n }", "update(){}", "update(){}", "update(){}", "function activateLink(e){\n // remove/add .active\n let activeLink = document.getElementsByClassName('active')[0] ? \n document.getElementsByClassName('active')[0] : \n null;\n\n if(activeLink){\n activeLink.removeAttribute('class');\n }\n e.target.setAttribute('class', 'active');\n\n // get the paragraph\n let content = new Content();\n content.getParagraphByIndex(e.target.id);\n\n // change the url in the address bar\n window.history.pushState(\"\", \"\", e.target.id);\n}", "function goToAnchor(mixAnchor)\n{\n if (empty(mixAnchor))\n return;\n window.location.href = window.location.href + '#' + mixAnchor;\n}", "function onHashChange() {\n\t\tupdateActiveTab();\n\t\tupdateActiveSection();\n\t}", "function scrollToAnchor(){\n //getting the anchor link in the URL and deleting the `#`\n var value = window.location.hash.replace('#', '').split('/');\n var section = decodeURIComponent(value[0]);\n var slide = decodeURIComponent(value[1]);\n\n if(section){ //if theres any #\n if(options.animateAnchor){\n scrollPageAndSlide(section, slide);\n }else{\n FP.silentMoveTo(section, slide);\n }\n }\n }", "function addAnchorR() {\n var pole = addStreetPostsR();\n\n pole.lightPost.position.z = -4770;\n pole.light.position.z = -4770;\n}", "updateURL (to, from) {\n this.$emit('updateURL', to, from, this)\n }", "function scrollToAnchor(){\n var anchors = getAnchorsURL();\n var sectionAnchor = anchors.section;\n var slideAnchor = anchors.slide;\n\n if(sectionAnchor){ //if theres any #\n if(options.animateAnchor){\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n }else{\n silentMoveTo(sectionAnchor, slideAnchor);\n }\n }\n }", "function scrollToAnchor(){\n var anchors = getAnchorsURL();\n var sectionAnchor = anchors.section;\n var slideAnchor = anchors.slide;\n\n if(sectionAnchor){ //if theres any #\n if(options.animateAnchor){\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n }else{\n silentMoveTo(sectionAnchor, slideAnchor);\n }\n }\n }", "function scrollToAnchor(){\n var anchors = getAnchorsURL();\n var sectionAnchor = anchors.section;\n var slideAnchor = anchors.slide;\n\n if(sectionAnchor){ //if theres any #\n if(options.animateAnchor){\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n }else{\n silentMoveTo(sectionAnchor, slideAnchor);\n }\n }\n }", "function deriveAnchor(edge, index, ep, conn) {\n return options.anchor ? options.anchor : options.deriveAnchor(edge, index, ep, conn);\n }", "function updateHashInUrl(href) {\n var hashInUrl = href;\n if (href.indexOf('/feature/') !== -1) {\n hashInUrl = href.substring(18);\n }\n\n lastClickElementHref = hashInUrl;\n window.location.hash = '#' + hashInUrl;\n}", "function scrollToAnchor() {\n var anchors = getAnchorsURL();\n var sectionAnchor = anchors.section;\n var slideAnchor = anchors.slide;\n\n if (sectionAnchor) { //if theres any #\n if (options.animateAnchor) {\n scrollPageAndSlide(sectionAnchor, slideAnchor);\n } else {\n silentMoveTo(sectionAnchor, slideAnchor);\n }\n }\n }", "function setAnchorAsButton(anchor){anchor.setAttribute(\"role\",\"button\");anchor.tabIndex=0;}// eslint-disable-next-line es/no-object-assign -- safe", "function updateSectionLocation(node, anchorTag) {\n return dispatchSectionLocations({\n action: 'update',\n payload: {\n node,\n anchorTag,\n },\n });\n }", "function updateLink() {\n\tif(document.getElementById(\"link_span\").childElementCount > 0) {\n\t\tvar url = parseURL(document.getElementById(\"link_span\").firstChild.href);\n\t\turl.params[\"lat\"] = unsafeWindow._c09.getCenter().lat();\n\t\turl.params[\"lng\"] = unsafeWindow._c09.getCenter().lng();\n\t\turl.params[\"zoom\"] = unsafeWindow._c09.getZoom();\n\t\tvar newUrl = url.protocol+\"://\"+url.host+\"/?\";\n\t\tfor(key in url.params) {\n\t\t\tnewUrl += key+\"=\"+url.params[key]+\"&\";\n\t\t}\n\t\tconsole.log(newUrl);\n\t\tdocument.getElementById(\"link_span\").firstChild.href = newUrl;\n\t}\n}", "function scrollToAnchor(aid){\n var aTag = $(aid);\n var offSet = aTag.offset().top - 50;\n $('html,body').animate({scrollTop: offSet},'fast');\n }", "function scrollToAnchor(){\r\n //getting the anchor link in the URL and deleting the `#`\r\n var value = window.location.hash.replace('#', '').split('/');\r\n var sectionAnchor = decodeURIComponent(value[0]);\r\n var slideAnchor = decodeURIComponent(value[1]);\r\n\r\n if(sectionAnchor){ //if theres any #\r\n if(options.animateAnchor){\r\n scrollPageAndSlide(sectionAnchor, slideAnchor);\r\n }else{\r\n silentMoveTo(sectionAnchor, slideAnchor);\r\n }\r\n }\r\n }", "function scrollToAnchor(){\r\n //getting the anchor link in the URL and deleting the `#`\r\n var value = window.location.hash.replace('#', '').split('/');\r\n var sectionAnchor = decodeURIComponent(value[0]);\r\n var slideAnchor = decodeURIComponent(value[1]);\r\n\r\n if(sectionAnchor){ //if theres any #\r\n if(options.animateAnchor){\r\n scrollPageAndSlide(sectionAnchor, slideAnchor);\r\n }else{\r\n silentMoveTo(sectionAnchor, slideAnchor);\r\n }\r\n }\r\n }", "click(e){\r\n if ( this.url ){\r\n bbn.fn.link(this.url);\r\n }\r\n else{\r\n this.$emit('click', e);\r\n }\r\n }", "function updateA(gallery) {\n function createKeyValue(key, value, isURL = false) {\n function addLink(link) {\n const linkElem = document.createElement('a');\n linkElem.setAttribute('href', link);\n linkElem.appendChild(document.createTextNode(link));\n return linkElem;\n }\n const keyElem = document.createElement('strong');\n keyElem.appendChild(document.createTextNode(key+\": \"));\n const valueElem = document.createElement('span');\n if(isURL)\n valueElem.appendChild(addLink(value));\n else \n valueElem.appendChild(document.createTextNode(value));\n const liTag = document.createElement('li');\n liTag.appendChild(keyElem);\n liTag.appendChild(valueElem);\n return liTag;\n }\n const aDiv = document.querySelector(\".a\");\n clearDiv(aDiv);\n const list = document.createElement('ul');\n list.appendChild(createKeyValue(\"Gallery Name\", gallery.nameEn));\n list.appendChild(createKeyValue(\"Link\", gallery.link, true));\n list.appendChild(createKeyValue(\"Address\", `${gallery.location.address}, ${gallery.location.city} ${gallery.location.country}`));\n aDiv.appendChild(list);\n}", "function attachPageTargetForClickToScroll(pageTarget,anchor) {\n\n const idAttribute = pageTarget.getAttribute(\"id\");\n anchor.setAttribute('id','navlink'+idAttribute);\n //anchor.setAttribute('href',`#${idAttribute}`);\n}", "get anchor() {\n return new FudgeCore.Vector3(this.jointAnchor.x, this.jointAnchor.y, this.jointAnchor.z);\n }" ]
[ "0.72916204", "0.69752336", "0.6894827", "0.6742493", "0.6742493", "0.6742493", "0.6742493", "0.6624592", "0.6604059", "0.64496326", "0.6418013", "0.63974416", "0.6310246", "0.6221733", "0.6213902", "0.6185177", "0.6141847", "0.61350256", "0.6090274", "0.6022484", "0.6017475", "0.5994277", "0.5905553", "0.58630264", "0.5826645", "0.58171284", "0.5790429", "0.5772086", "0.5747118", "0.5744804", "0.5736386", "0.572017", "0.5719185", "0.570034", "0.5692464", "0.5681026", "0.5674206", "0.5669739", "0.5669739", "0.56621", "0.5655355", "0.56496507", "0.5646353", "0.5628438", "0.56281763", "0.56058216", "0.55898744", "0.55870885", "0.55819285", "0.55810493", "0.5574214", "0.5571927", "0.5565796", "0.55643046", "0.55624145", "0.5554431", "0.554523", "0.5533796", "0.55311364", "0.55304277", "0.55304277", "0.552068", "0.55119085", "0.550435", "0.55024475", "0.5500229", "0.5500097", "0.5492345", "0.54865015", "0.54862636", "0.54779285", "0.54769933", "0.54769933", "0.54769933", "0.54661304", "0.54654396", "0.5459873", "0.5459873", "0.5459873", "0.5457208", "0.54552764", "0.54498", "0.54404616", "0.54273343", "0.5427021", "0.54265314", "0.54265314", "0.54265314", "0.54260075", "0.5420191", "0.5412383", "0.5395765", "0.53915423", "0.5387809", "0.5387", "0.53842837", "0.53842837", "0.53795856", "0.53766185", "0.5371881", "0.5365188" ]
0.0
-1
Anchor method for rendering
render(delta, spriteBatch) {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n let anchorAttributes = {\n class: {\n [this.activeClass]: this.match !== null,\n },\n onClick: this.handleClick.bind(this)\n };\n if (this.anchorClass) {\n anchorAttributes.class[this.anchorClass] = true;\n }\n if (this.custom === 'a') {\n anchorAttributes = Object.assign(Object.assign({}, anchorAttributes), { href: this.url, title: this.anchorTitle, role: this.anchorRole, tabindex: this.anchorTabIndex, 'aria-haspopup': this.ariaHaspopup, id: this.anchorId, 'aria-posinset': this.ariaPosinset, 'aria-setsize': this.ariaSetsize, 'aria-label': this.ariaLabel });\n }\n return (index.h(this.custom, Object.assign({}, anchorAttributes), index.h(\"slot\", null)));\n }", "get anchor() {}", "render (h) {\n return h('a', {\n attrs: {\n href: this.to\n },\n on: {\n click: this.guardEvent\n }\n }, [this.$slots.default])\n }", "renderAnchor() {\n return html `\n <slot></slot>\n `;\n }", "function $anchor(parent, id, cl, text, href) {\n\tlet a = $new(parent, 'a', id, cl, text);\n\tif (href) a.href = href;\n\treturn a;\n}", "set anchor(value) {}", "anchor() {\n this.__anchors++;\n }", "anchor() {\n this.__anchors++;\n }", "anchor() {\n this.__anchors++;\n }", "anchor() {\n this.__anchors++;\n }", "click(e){\r\n if ( this.url ){\r\n bbn.fn.link(this.url);\r\n }\r\n else{\r\n this.$emit('click', e);\r\n }\r\n }", "function theme_anchor(url, text, options)\n{\n id = 'anchor-' + Math.random();\n\n if (typeof options != 'undefined') {\n if (options.id)\n id = options.id;\n\n if (options.buttons == 'extra-small')\n button_class = 'btn btn-xs btn-primary';\n else if (options.buttons)\n button_class = 'btn btn-sm btn-primary';\n }\n\n return '<a href=\"' + url + '\" id=\"' + id + '\" class=\"' + button_class + '\">' + text + '</a>';\n}", "['click .method-container a'](e, $el) {\n\t\tToc.goToHash($el.attr('href'));\n\t}", "get anchor() { return this.$anchor.pos }", "function anchor(url){\n\twindow.location.href= url;\n}", "function goToAnchor(mixAnchor)\n{\n if (empty(mixAnchor))\n return;\n window.location.href = window.location.href + '#' + mixAnchor;\n}", "anchorClick(){\n \n var app = this;\n var anchor = $('#ul-scroll').find('a');\n\n anchor.on('click', function(){\n\n var idom = $(this).children().attr('id');\n var ctp = idom.replace(\"divpage-\", \"\");\n\n app.counter = parseInt(ctp);\n app.currentPage = app.counter;\n\n app.hoverList(app.counter);\n\n console.log(app.hoverList(app.counter));\n\n // var divanchor = app.$divanchor;\n\n // if (divanchor.hasClass('actual-Session')) {\n \n // $('.actual-Session').css({\n // \"background-color\" : \"rgba(255, 255, 255, 0)\"\n // });\n \n // divanchor.removeClass('actual-Session');\n // }\n \n // $('#divpage-' + app.counter).addClass('actual-Session');\n \n // $('.actual-Session').css({\n // \"background-color\" : \"white\"\n // });\n });\n }", "function formAnchorHtml(href, label) {\r\n\treturn \"<div class='linkContainer'>\" + label + \": <a href='\" + href + \"' target='_blank'>\" + href + \"</a></div>\";\r\n}", "render(){\r\n var item = document.createElement('li')\r\n var a = document.createElement('a')\r\n a.href = this.url\r\n a.innerText = this.text\r\n item.appendChild(a)\r\n // realizati aici structura HTML:\r\n /**\r\n * <li>\r\n * <a href=\"url\">text</a>\r\n * </li>\r\n */\r\n return item;\r\n }", "function makeViewLink(text)\n{\n const link = makeLink(text, \"javascript:void(0)\");\n link.attr(\"id\", text);\n link.addClass(\"view\");\n return link;\n}", "function _adminLink(href, table, id, callback, anchor) {\n anchor = _createElement('a');\n if (id) anchor.id = table + id;\n // href will always be appended with id\n anchor.href = href + id;\n _setInnerHTML(anchor, table);\n if (callback) gU.on(anchor, 'click', callback);\n return anchor;\n }", "render() {\n return html`\n <a tabindex=\"-1\" href=\"${this.url}\">\n <paper-button id=\"wrapper\" role=\"link\" noink>\n ${this.icon\n ? html`\n <iron-icon icon=\"${this.icon}\"></iron-icon>\n `\n : ``}\n <span class=\"title\">${this.title}</span>\n ${this.trackIcon\n ? html`\n <iron-icon id=\"track\" icon=\"${this.trackIcon}\"></iron-icon>\n `\n : ``}\n </paper-button>\n </a>\n `;\n }", "function anchorClick() {\n var marker = markerForUrl( this.href );\n if( marker ) {\n if( /\\bZOOM\\b/.exec( this.className ) ) {\n var mapType = marker.mapType || marker.ezmap.map.getCurrentMapType();\n var zoomLevel;\n if( marker.span ) {\n zoomLevel = mapType.getSpanZoomLevel(\n marker.point, marker.span, marker.ezmap.viewsize );\n }\n else {\n zoomLevel = marker.ezmap.map.getZoom();\n }\n marker.ezmap.map.setCenter( marker.point, zoomLevel, mapType );\n }\n marker.doOpen();\n return false;\n }\n else {\n return true;\n }\n }", "function openlink(upperCase){\n clickAnchor(upperCase,getItem(\"link\"));\n}", "function getAnchor(e) {\n let el = e.target;\n while (el && !el.href) {\n el = el.parentNode;\n }\n if (el) {\n e.preventDefault();\n history.pushState(null, null, el.href); // Modify current url to become url of link.\n changePage();\n }\n }", "cellLink(e){\n return <Link className=\"reporte-link\" to={\"/reporte/\"+this.state.selectedCuentaLbl+\"/\"+ e}>\n {e}\n </Link>\n }", "function link() {\n var LINKY_URL_REGEXP =\n /((ftp|https?):\\/\\/|(www\\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\\S*[^\\s.;,(){}<>\"”’]$/;\n var sub = selection.anchorNode.data.substring(0, selection.anchorOffset - 1);\n if (LINKY_URL_REGEXP.test(sub)) {\n var matchs = sub.match(LINKY_URL_REGEXP);\n if (matchs && matchs.length) {\n var st = selection.anchorOffset - matchs[0].length - 1;\n range.setStart(selection.anchorNode, st);\n scope.doCommand(null, {\n name: 'createLink',\n param: matchs[0]\n });\n }\n }\n }", "function createAnchor(html, index) {\n const a = document.createElement('a');\n a.href = '#';\n a.innerHTML = html;\n a.onclick = onHeadigClick(this, index);\n return a;\n}", "render() {\n return (\n <a href=\"http://localhost:5000/login-recommendations\">\n get show recommendations!\n </a>\n )\n }", "addAnchor() {\n const data = {\n action: 'addAnchor',\n value: null\n };\n this.postMessage(data);\n }", "render() { \n const { to, children } = this.props;\n return (\n <a href={to} onClick={this.handleClick} className=\"Navbar-nav-link\">\n {children}\n </a>\n )\n }", "function makeLinksClickable () {\n // Bring the layer with arrows forward.\n var $links = getLinkLayer();\n $divViewControlLayer.append($links);\n\n if (properties.browser === 'mozilla') {\n // A bug in Firefox? The canvas in the div element with the largest z-index.\n $divViewControlLayer.append($canvas);\n } else if (properties.browser === 'msie') {\n $divViewControlLayer.insertBefore($divLabelDrawingLayer);\n }\n }", "function anchorClicked(e) {\n e.preventDefault();\n const selectedBookEl = document.getElementById('selectedBook');\n if (!selectedBookEl) return;\n\n const self = this;\n const cell = self.parentElement;\n const row = cell.parentElement;\n const data = row.querySelectorAll('td');\n\n // Generate HTML details of selected book\n let bookData = `<ul class=\"book-details\">`;\n for (const field of data) {\n // console.log(field); // each <td>\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement\n bookData += `<li><b>${field.dataset.value}</b>: ${field.innerText}</li>`;\n }\n bookData += `</ul>`;\n\n selectedBookEl.innerHTML = bookData; // render\n}", "_createAnchor() {\n const anchor = this._document.createElement('div');\n this._toggleAnchorTabIndex(this._enabled, anchor);\n anchor.classList.add('cdk-visually-hidden');\n anchor.classList.add('cdk-focus-trap-anchor');\n anchor.setAttribute('aria-hidden', 'true');\n return anchor;\n }", "_createAnchor() {\n const anchor = this._document.createElement('div');\n this._toggleAnchorTabIndex(this._enabled, anchor);\n anchor.classList.add('cdk-visually-hidden');\n anchor.classList.add('cdk-focus-trap-anchor');\n anchor.setAttribute('aria-hidden', 'true');\n return anchor;\n }", "_createAnchor() {\n const anchor = this._document.createElement('div');\n this._toggleAnchorTabIndex(this._enabled, anchor);\n anchor.classList.add('cdk-visually-hidden');\n anchor.classList.add('cdk-focus-trap-anchor');\n anchor.setAttribute('aria-hidden', 'true');\n return anchor;\n }", "function enableAnchor(anchor) {\n anchor.style.pointerEvents = \"all\";\n anchor.style.cursor = \"pointer\";\n anchor.className = \"button game-mode-button back-color-1\";\n}", "function getAnchorUrl(slug) {\n return \"#\" + slug;\n} // /#/Section/Button", "function goToAnchor(anchor) {\n if (anchor) {\n window.scrollTo(0, $('a[name=' + anchor + ']').offset().top - 120);\n }\n }", "_createAnchor() {\n const anchor = this._document.createElement('div');\n\n this._toggleAnchorTabIndex(this._enabled, anchor);\n\n anchor.classList.add('cdk-visually-hidden');\n anchor.classList.add('cdk-focus-trap-anchor');\n anchor.setAttribute('aria-hidden', 'true');\n return anchor;\n }", "function onClick(link){\n \n}", "setAnchorPostion(anchor, newX, newY) {\n anchor.html.attr(\"cx\", newX).attr(\"cy\", newY);\n }", "render() {\n var mailtoLink = \"mailto:\";\n mailtoLink += config.app.adminEmail;\n mailtoLink += \"?subject=\";\n mailtoLink += this.props.l(\"app.reportEmailSubject\");\n mailtoLink += \": \" + this.props.currentUserId;\n mailtoLink += \" > \" + this.props.otherUserId;\n mailtoLink += \"&body=\";\n mailtoLink += this.props.l(\"app.reportEmailBody\");\n\n return (\n <a href={mailtoLink}>\n {this.props.l(\"app.report\")}\n </a>\n )\n }", "detectAnchor(): void\n\t{\n\t\t[...document.querySelectorAll('a')].map(node => {\n\t\t\tlet href = Dom.attr(node, 'href');\n\t\t\tif (href)\n\t\t\t{\n\t\t\t\thref = href.toString();\n\t\t\t}\n\t\t\tif (href && href.indexOf(':'))\n\t\t\t{\n\t\t\t\tconst hrefPref = href.split(':')[0];\n\t\t\t\tif (['callto', 'tel', 'mailto'].includes(hrefPref))\n\t\t\t\t{\n\t\t\t\t\tEvent.bind(node, 'click', () => {\n\t\t\t\t\t\tthis.sendLabel('', 'addressClick', hrefPref);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "getAnchor(uid){\n\t\t// XRAnchor? getAnchor(DOMString uid);\n\t\treturn this._session.reality._getAnchor(uid)\n\t}", "toLinkUrl() {\r\n return this.urlPath + this._stringifyAux() +\r\n (isPresent(this.child) ? this.child._toLinkUrl() : '');\r\n }", "getHref() {\n switch (this.type) {\n case \"room\":\n return \"room.html?\" + this.id + \"+\" + this.title.split(' ').join('_');\n case \"device\":\n return \"device.html?\" + this.id + \"+\" + this.title.split(' ').join('_');\n default:\n return \"home.html\";\n }\n }", "function deriveAnchor(edge, index, ep, conn) {\n return options.anchor ? options.anchor : options.deriveAnchor(edge, index, ep, conn);\n }", "render() {//calling a function fruom index.js\n return(\n <div>\n \n <h1 className =\"laura\">Research</h1>\n <Link to=\"/awards\">Awards</Link><br/>\n <Link to=\"/presentations\">Presentations</Link><br/>\n <Link to=\"/publications\">Publications</Link><br/>\n <Link to=\"/research\">Research</Link><br/>\n <Link to=\"/teaching\">Teaching</Link><br/>\n </div>\n )\n }", "render() {\n return (\n <a href=\"#\" onClick={this.goToUser}>\n {this.props.name}\n </a>\n );\n }", "function createAnchor(name, text, count, url, d) {\n\n let a = document.createElement(\"a\");\n a.setAttribute(\"class\", \"bubble-action\");\n a.setAttribute(\"href\", url);\n\n\n let svg = document.createElementNS(NS, \"svg\");\n svg.setAttribute(\"class\", \"octicon octicon-\" + name);\n svg.setAttribute(\"viewBox\", \"0 0 14 16\");\n svg.setAttribute(\"version\", \"1.1\");\n svg.setAttribute(\"width\", \"24\");\n svg.setAttribute(\"height\", \"16\");\n svg.setAttribute(\"aria-hidden\", \"true\");\n\n\n let path = document.createElementNS(NS, \"path\");\n path.setAttribute(\"fill-rule\", \"evenodd\");\n path.setAttribute(\"d\", d);\n\n svg.appendChild(path);\n\n\n let span = document.createElement(\"span\");\n span.setAttribute(\"class\", \"Counter\");\n span.appendChild(document.createTextNode(count));\n\n a.appendChild(svg);\n a.appendChild(document.createTextNode(\" \" + text + \" \"));\n a.append(span);\n\n return a;\n}", "scrollAnchor(e, respond = null) {\n let targetID;\n if (e) {\n e.preventDefault();\n targetID = respond ? respond.getAttribute('href') : this.getAttribute('href');\n targetID = `#${targetID.split('#').pop()}`;\n } else {\n targetID = '#' + respond;\n }\n\n const targetAnchor = document.querySelector(targetID);\n if (!targetAnchor) return;\n targetAnchor.scrollIntoView({\n behavior: 'smooth'\n });\n }", "function href(editor, v) {\n\t\tvar a = getFirstAnchor(editor);\n\t\tif (!v)\n\t\t\treturn a ? a.href : '';\n\t\telse if (a)\n\t\t\ta.href = v;\n\t}", "function generateAnchor(url, name) {\n let anchor = document.createElement(\"a\");\n anchor.href = url;\n anchor.innerText = name;\n anchor.id = \"save-as\";\n return anchor;\n}", "function anchorLink(element) {\n // Prevent default behaviour\n event.preventDefault();\n\n // Setting variables\n var original_target = element,\n target = $(original_target),\n scrollTopAmount = Math.ceil(target.offset().top),\n scrollUntilHeight2 = 0,\n scrollUntilHeight = 0;\n\n // Add or reduce height from scrollTop\n $('.sticky-parent').each(function () {\n // Add height\n if ( target.isAfter( $(this) ) ) {\n scrollUntilHeight2 += $(this).outerHeight();\n }\n scrollUntilHeight = scrollUntilHeight2;\n })\n scrollTopAmount -= scrollUntilHeight;\n window.location.hash = original_target;\n $('html,body').animate({scrollTop: scrollTopAmount }, plugin.settings.scrollTopDuration);\n }", "function addAnchorTags() {\n anchors.options = {\n visible: 'touch'\n }\n\n anchors.add('.content-main h2, .content-main h3, .content-main h4, .content-main h5, .content-main h6');\n}", "_render()\n {\n if (this.isDisabled())\n return;\n\n this._setContentSizeCss();\n this._setDirection();\n const paragraph = html`<p>${this.text}</p>`;\n let anchor = \"\";\n let action = \"\";\n if (this.link && this.linkText)\n anchor = html`<a href=\"${this.link}\" target=\"_blank\">${this.linkText}</a>`;\n if (this.action && this.actionText)\n action = html`${anchor ? \" | \" : \"\"}<a href=\"javascript:void(0)\" @click=${this.action}>${this.actionText}</a>`;\n let heading = \"\";\n if (this.heading)\n heading = html`<h4>${this.heading}</h4>`;\n\n render(html`${heading}${paragraph}<div id=\"links\">${anchor}${action}</div>`, this.tooltipElem);\n }", "function anchor({ id, text, cls, href } = {}) {\n\treturn new Anchor({ id, text, cls, href });\n}", "function anchor({ id, text, cls, href } = {}) {\n\treturn new Anchor({ id, text, cls, href });\n}", "function anchorLinkDirective($rootRouter) {\n return {\n restrict: 'E',\n link: function (scope, element) {\n // If the linked element is not an anchor tag anymore, do nothing\n if (element[0].nodeName.toLowerCase() !== 'a') {\n return;\n }\n\n // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.\n var hrefAttrName = Object.prototype.toString.call(element.prop('href')) === '[object SVGAnimatedString]' ?\n 'xlink:href' : 'href';\n\n element.on('click', function (event) {\n if (event.which !== 1) {\n return;\n }\n\n var href = element.attr(hrefAttrName);\n var target = element.attr('target');\n var isExternal = (['_blank', '_parent', '_self', '_top'].indexOf(target) > -1);\n\n if (href && $rootRouter.recognize(href) && !isExternal) {\n $rootRouter.navigateByUrl(href);\n event.preventDefault();\n }\n });\n }\n };\n }", "function _getLink(text, enabled, urlFormat, index) {\n if (enabled == false)\n return J.FormatString(' <a class=\"button-white\" style=\"filter:Alpha(Opacity=60);opacity:0.6;\" href=\"javascript:void(0);\"><span>{0}</span></a>',\n text);\n else\n return J.FormatString(' <a class=\"button-white\" href=\"javascript:window.location.href=\\'' + urlFormat + '\\';\"><span>{1}</span></a>', index, text);\n }", "function mk_link(text) {\r\n var a = $e('a')\r\n a.style.background = null\r\n a.style.backgroundColor = null\r\n a.href = '#'\r\n a.appendChild( $t(text) )\r\n return a\r\n}", "buildAnchors() {\r\n this.buildPointAnchors();\r\n }", "function a() {\n return {\n restrict: 'E',\n link: function (scope, elem, attrs) {\n if (attrs.ngClick || attrs.href === '' || attrs.href === '#') {\n elem.on('click', function (e) {\n e.preventDefault();\n });\n }\n }\n }\n }", "function AnchorJS(a) {\n \"use strict\";\n this.options = a || {},\n this._applyRemainingDefaultOptions = function(a) {\n this.options.icon = this.options.hasOwnProperty(\"icon\") ? a.icon: \"&#xe9cb\",\n this.options.visible = this.options.hasOwnProperty(\"visible\") ? a.visible: \"hover\",\n this.options.placement = this.options.hasOwnProperty(\"placement\") ? a.placement: \"right\",\n this.options[\"class\"] = this.options.hasOwnProperty(\"class\") ? a[\"class\"] : \"\"\n },\n this._applyRemainingDefaultOptions(a),\n this.add = function(a) {\n var b, c, d, e, f, g, h, i, j, k, l, m, n, o;\n if (this._applyRemainingDefaultOptions(this.options), a) {\n if (\"string\" != typeof a) throw new Error(\"The selector provided to AnchorJS was invalid.\")\n } else a = \"h1, h2, h3, h4, h5, h6\";\n if (b = document.querySelectorAll(a), 0 === b.length) return ! 1;\n for (this._addBaselineStyles(), c = document.querySelectorAll(\"[id]\"), d = [].map.call(c,\n function(a) {\n return a.id\n }), f = 0; f < b.length; f++) {\n if (b[f].hasAttribute(\"id\")) e = b[f].getAttribute(\"id\");\n else {\n g = b[f].textContent,\n h = g.replace(/[^\\w\\s-]/gi, \"\").replace(/\\s+/g, \"-\").replace(/-{2,}/g, \"-\").substring(0, 32).replace(/^-+|-+$/gm, \"\").toLowerCase(),\n k = h,\n j = 0;\n do void 0 !== i && (k = h + \"-\" + j),\n i = d.indexOf(k),\n j += 1;\n while ( - 1 !== i);\n i = void 0,\n d.push(k),\n b[f].setAttribute(\"id\", k),\n e = k\n }\n l = e.replace(/-/g, \" \"),\n m = '<a class=\"anchorjs-link ' + this.options[\"class\"] + '\" href=\"#' + e + '\" aria-label=\"Anchor link for: ' + l + '\" data-anchorjs-icon=\"' + this.options.icon + '\"></a>',\n n = document.createElement(\"div\"),\n n.innerHTML = m,\n o = n.childNodes,\n \"always\" === this.options.visible && (o[0].style.opacity = \"1\"),\n \"&#xe9cb\" === this.options.icon && (o[0].style.fontFamily = \"anchorjs-icons\", o[0].style.fontStyle = \"normal\", o[0].style.fontVariant = \"normal\", o[0].style.fontWeight = \"normal\"),\n \"left\" === this.options.placement ? (o[0].style.position = \"absolute\", o[0].style.marginLeft = \"-1em\", o[0].style.paddingRight = \"0.5em\", b[f].insertBefore(o[0], b[f].firstChild)) : (o[0].style.paddingLeft = \"0.375em\", b[f].appendChild(o[0]))\n }\n return this\n },\n this.remove = function(a) {\n for (var b, c = document.querySelectorAll(a), d = 0; d < c.length; d++) b = c[d].querySelector(\".anchorjs-link\"),\n b && c[d].removeChild(b);\n return this\n },\n this._addBaselineStyles = function() {\n if (null === document.head.querySelector(\"style.anchorjs\")) {\n var a, b = document.createElement(\"style\"),\n c = \" .anchorjs-link { opacity: 0; text-decoration: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }\",\n d = \" *:hover > .anchorjs-link, .anchorjs-link:focus { opacity: 1; }\",\n e = ' @font-face { font-family: \"anchorjs-icons\"; font-style: normal; font-weight: normal; src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBTUAAAC8AAAAYGNtYXAWi9QdAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5Zgq29TcAAAF4AAABNGhlYWQEZM3pAAACrAAAADZoaGVhBhUDxgAAAuQAAAAkaG10eASAADEAAAMIAAAAFGxvY2EAKACuAAADHAAAAAxtYXhwAAgAVwAAAygAAAAgbmFtZQ5yJ3cAAANIAAAB2nBvc3QAAwAAAAAFJAAAACAAAwJAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpywPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6cv//f//AAAAAAAg6cv//f//AAH/4xY5AAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAACADEARAJTAsAAKwBUAAABIiYnJjQ/AT4BMzIWFxYUDwEGIicmND8BNjQnLgEjIgYPAQYUFxYUBw4BIwciJicmND8BNjIXFhQPAQYUFx4BMzI2PwE2NCcmNDc2MhcWFA8BDgEjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAEAAAABAACiToc1Xw889QALBAAAAAAA0XnFFgAAAADRecUWAAAAAAJTAsAAAAAIAAIAAAAAAAAAAQAAA8D/wAAABAAAAAAAAlMAAQAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAACAAAAAoAAMQAAAAAACgAUAB4AmgABAAAABQBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEADgAAAAEAAAAAAAIABwCfAAEAAAAAAAMADgBLAAEAAAAAAAQADgC0AAEAAAAAAAUACwAqAAEAAAAAAAYADgB1AAEAAAAAAAoAGgDeAAMAAQQJAAEAHAAOAAMAAQQJAAIADgCmAAMAAQQJAAMAHABZAAMAAQQJAAQAHADCAAMAAQQJAAUAFgA1AAMAAQQJAAYAHACDAAMAAQQJAAoANAD4YW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzVmVyc2lvbiAxLjAAVgBlAHIAcwBpAG8AbgAgADEALgAwYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzUmVndWxhcgBSAGUAZwB1AGwAYQByYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzRm9udCBnZW5lcmF0ZWQgYnkgSWNvTW9vbi4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format(\"truetype\"); }',\n f = \" [data-anchorjs-icon]::after { content: attr(data-anchorjs-icon); }\";\n b.className = \"anchorjs\",\n b.appendChild(document.createTextNode(\"\")),\n a = document.head.querySelector('[rel=\"stylesheet\"], style'),\n void 0 === a ? document.head.appendChild(b) : document.head.insertBefore(b, a),\n b.sheet.insertRule(c, b.sheet.cssRules.length),\n b.sheet.insertRule(d, b.sheet.cssRules.length),\n b.sheet.insertRule(f, b.sheet.cssRules.length),\n b.sheet.insertRule(e, b.sheet.cssRules.length)\n }\n }\n}", "function onAnchorClick(e) { // 756\n var event = e || window.event; // 757\n var target = event.target || event.srcElement; // 758\n var defaultPrevented = \"defaultPrevented\" in event ? event['defaultPrevented'] : event.returnValue === false; // 759\n if (target && target.nodeName === \"A\" && !defaultPrevented) { // 760\n var current = parseURL(); // 761\n var expect = parseURL(target.getAttribute(\"href\", 2)); // 762\n var isEqualBaseURL = current._href.split('#').shift() === expect._href.split('#').shift(); // 763\n if (isEqualBaseURL) { // 764\n if (current._hash !== expect._hash) { // 765\n historyObject.location.hash = expect._hash; // 766\n } // 767\n scrollToAnchorId(expect._hash); // 768\n if (event.preventDefault) { // 769\n event.preventDefault(); // 770\n } else { // 771\n event.returnValue = false; // 772\n } // 773\n } // 774\n } // 775\n } // 776", "function leadsLink(val){\n\n //debugger;\n return '<li><a href=\"#page\" class=\"dynamic\" id=\"'+key+'\"><h2>' + val.name + '</h2><p>' + val.email + '</p><p class=\"ui-li-aside\"><strong>' + val.date +'</strong></p></a></li>';\n \n }", "static applyAnchorUrl(reflection, container) {\n if (!reflection.url || !DefaultTheme.URL_PREFIX.test(reflection.url)) {\n const anchor = DefaultTheme.getUrl(reflection, container, \".\");\n reflection.url = container.url + \"#\" + anchor;\n reflection.anchor = anchor;\n reflection.hasOwnDocument = false;\n }\n reflection.traverse((child) => {\n if (child instanceof index_1.DeclarationReflection) {\n DefaultTheme.applyAnchorUrl(child, container);\n }\n });\n }", "get anchor() {\n return this.$anchor.pos;\n }", "link(options = {}) {\n if (!options || (options && !options.href) || !this.isValid()) {\n return;\n }\n\n if (window.getSelection && !window.getSelection().toString()) {\n console.warn(\"no text selected..\");\n return null;\n }\n const unwrapAtags = (linkElements) => {\n linkElements.forEach(link => {\n Array.from(link.querySelectorAll(\"a\")).forEach(aTag => aTag.unwrap());\n const closestATag = link.parentElement ? link.parentElement.__closest(\"a\") : null;\n if (closestATag) {\n var a = Object(_utilis_splitHTML__WEBPACK_IMPORTED_MODULE_2__[\"splitHTML\"])(link, closestATag, {\n tag: \"a\"\n });\n if (a) {\n a.center.unwrap();\n }\n // closestATag.unwrap();\n }\n });\n }\n const setTargetToTag = (linkElements, renderedLink, _target) => {\n linkElements.forEach(aTag => {\n aTag.href = renderedLink;\n if (_target) {\n aTag.setAttribute(\"target\", _target);\n }\n });\n }\n const setProtocol = (_protocol, newURL) => {\n _protocol = _protocol.replace(/:/g, \"\");\n _protocol = _protocol.replace(/\\/\\//g, \"\");\n _protocol += \":\";\n if (_protocol.includes(\"http\")) {\n _protocol += \"//\";\n } else {\n }\n newURL.push(_protocol);\n return _protocol;\n }\n\n\n const { href = \"\", protocol = \"\", target = \"\" } = options;\n\n const linkElements = Object(_services_range_service__WEBPACK_IMPORTED_MODULE_0__[\"wrapRangeWithElement\"])(\"a\");\n let newURL = [];\n const Atag = Object(_services_link_service__WEBPACK_IMPORTED_MODULE_9__[\"createTempLinkElement\"])(href);\n let _href = Object(_services_link_service__WEBPACK_IMPORTED_MODULE_9__[\"resetURL\"])(href.trim());\n\n let _protocol = protocol.trim() || Atag.protocol;\n let _target = null;\n const testTarget = _services_link_service__WEBPACK_IMPORTED_MODULE_9__[\"TARGETS\"][target.trim().toLowerCase()];\n if (testTarget) {\n _target = testTarget;\n }\n if (_protocol.trim()) {\n _protocol = setProtocol(_protocol, newURL);\n }\n if (_href) {\n newURL.push(_href);\n }\n const renderedLink = newURL.join(\"\");\n unwrapAtags(linkElements);\n setTargetToTag(linkElements, renderedLink, _target);\n const { firstFlag, lastFlag } = Object(_services_range_service__WEBPACK_IMPORTED_MODULE_0__[\"setSelectionFlags\"])(linkElements[0], linkElements[linkElements.length - 1]); //Set Flag at last\n Object(_services_range_service__WEBPACK_IMPORTED_MODULE_0__[\"setSelectionBetweenTwoNodes\"])(firstFlag, lastFlag);\n linkElements.forEach(aTag=>{\n Object(_services_textEditor_service__WEBPACK_IMPORTED_MODULE_4__[\"normalizeElement\"])(aTag.parentElement);// merge siblings and parents with child as possible.. \n })\n }", "function onClick() {return thisObj.load(this.href);}", "function onClick() {return thisObj.load(this.href);}", "function anchor(url, attrs) {\n\tvar text = escape(url),\n\t\thref = url;\n\n\t// Ensure protocol at beginning of url\n\tif (!/^[a-zA-Z]{1,6}:/.test(href)) {\n\t\thref = 'http://' + href;\n\t}\n\n\tvar attrsString = [attributes({ href: href }), attributes(attrs)]\n\t\t.filter(Boolean)\n\t\t.join(\" \");\n\n\treturn \"<a \"+ attrsString + \">\" + text + \"</a>\";\n}", "function viewLinkRenderer(entityKind) {\n\treturn function(value) {\n\t\tif (value != null) {\n\t\t\treturn \"<a href=\\\"\" + Application.getViewUrl(value, entityKind) + \"\\\">\" + value + \"</a>\";\n\t\t}\n\t\treturn \"\";\n\t};\n}", "function activateLink(e){\n // remove/add .active\n let activeLink = document.getElementsByClassName('active')[0] ? \n document.getElementsByClassName('active')[0] : \n null;\n\n if(activeLink){\n activeLink.removeAttribute('class');\n }\n e.target.setAttribute('class', 'active');\n\n // get the paragraph\n let content = new Content();\n content.getParagraphByIndex(e.target.id);\n\n // change the url in the address bar\n window.history.pushState(\"\", \"\", e.target.id);\n}", "createAnchor(paper, x, y, style, r = AnchorsComponent.DEFAULT_ANCHOR_RADIUS) {\r\n const a = paper.circle(x, y, r);\r\n a.addClass(\"anchorStyle\");\r\n if (style !== undefined && style !== \"\") {\r\n a.addClass(style);\r\n }\r\n return a;\r\n }", "getLinkAnchors(mode) {\n const attrs = this.state.attributes;\n return [\n {\n element: this.object._id,\n points: [\n {\n x: attrs.x,\n y: attrs.y,\n xAttribute: \"x\",\n yAttribute: \"y\",\n direction: { x: mode == \"begin\" ? 1 : -1, y: 0 }\n }\n ]\n }\n ];\n }", "function createkeyanchor(meal) {\n var makeKeyAnchor = $(dc('a'))\n .attr('id', 'keyAnchor')\n .attr('class', 'carousel_caption keyAnchor grid_2')\n .html('Make Key Photo');\n \n // Make this general & use same code for delete [0] case\n makeKeyAnchor.click(function() {\n \n // ajax for username, mealts, and keyts\n elm.makekeypicture(function(success, pinfo) {\n \n if(success) {\n \n // Update mongo on the server\n makeKeyPicAjax(meal, pinfo);\n \n // Set the display picture\n if(setgriddisplay) {\n setgriddisplay(meal, pinfo);\n }\n }\n });\n });\n return makeKeyAnchor;\n }", "getAnchor() {\n this._assertInitialized();\n return this.marker;\n }", "render() {\n const path = this.props.linkData.path;\n const title = this.props.linkData.title\n return (\n <li><Link to={path}>{title}</Link></li>\n );\n }", "function _(e){var t=document.createElement(\"a\");return t.href=e,t}", "function pagerHomePageLink() {\n 'use strict';\n var link = document.createElement('div');\n link.id = 'pagerGoHome';\n link.innerHTML = '<a href=\"../../\">Home</a>';\n return link;\n}", "function onAnchorClick(event) {\n chrome.tabs.create({\n selected: true,\n url: event.srcElement.href\n });\n return false;\n}", "function onAnchorClick(event) {\n chrome.tabs.create({\n selected: true,\n url: event.srcElement.href\n });\n return false;\n}", "function attachPageTargetForClickToScroll(pageTarget,anchor) {\n\n const idAttribute = pageTarget.getAttribute(\"id\");\n anchor.setAttribute('id','navlink'+idAttribute);\n //anchor.setAttribute('href',`#${idAttribute}`);\n}", "render(){\n return (\n <nav>\n <ul className=\"navbar\">\n <Link to='/' style={{textDecoration: \"none\"}}>\n <li className=\"title\">Tick-it</li>\n </Link>\n {this.linkButton()}\n </ul>\n </nav>\n )\n }", "@method createNavigationLinkHTML(contents, path) {\n if (typeof contents != \"string\") {\n // Retrieve the HTML for the element.\n var tempDiv = I3.ui.create(\"div\");\n tempDiv.appendChild(contents);\n contents = tempDiv.innerHTML;\n }\n var eventParams = I3.browser.isIE() ? \"\" : \"event\";\n return '<a href=\"#' + path +\n '\" onclick=\"return I3.ui.onNavigationClick(' + eventParams +\n ');\">' + contents + '</a>';\n }", "function listItemWithAnchor(anchor) {\n // They give me element like this:\n // <a href=\"https://google.com\">google.com</a>\n const li = document.createElement(\"li\");\n li.appendChild(anchor);\n // I give them an element like this:\n // <li>\n // <a href=\"https://google.com\">google.com</a>\n // </li> \n return li;\n}", "navigateHyperlink() {\n let fieldBegin = this.getHyperlinkField();\n if (fieldBegin) {\n this.fireRequestNavigate(fieldBegin);\n }\n }", "function scrollTo_anchor(action) {\n if (action.target.nodeName === \"A\") {\n const allSecId = action.target.getAttribute(\"data-id\");\n const allSec = document.getElementById(allSecId);\n allSec.scrollIntoView({ behavior: \"smooth\" });\n }\n}", "function UpdateAnchorsHandler() { }", "function renderLink(url) {\n let card = document.createElement(\"div\");\n card.classList.add('card');\n\n let newLink = document.createElement(\"div\");\n newLink.innerHTML = '<a href=\"'+url+'\">'+url+'</a>';\n // newLink.classList.add(\"bg-success\");\n\n card.appendChild(newLink);\n\n let linkSection = document.querySelector('#linkSection');\n linkSection.appendChild(card); \n}", "function Anchor(props) {\n const contentRef = useRef(null)\n\n return (\n <div ref={contentRef} className=\"anchor\">\n <div className=\"content\">{props.children}</div>\n <Toolip className=\"toolip\" targetRef={contentRef}>\n TOOLIP\n </Toolip>\n </div>\n )\n}", "function toAnchorNode(node, id) {\n setNodeAttr(node, 'id', id);\n mergeNodeAttr(node, 'class', classNames.anchor);\n\n const linkNode = tree.createElement('a', ns.html, [\n {\n name: 'class',\n value: classNames.anchorLink,\n },\n {\n name: 'href',\n value: `#${id}`,\n },\n {\n name: 'aria-hidden',\n value: 'true',\n },\n ]);\n\n const iconNode = tree.createElement('span', ns.html, [\n {\n name: 'class',\n value: classNames.anchorIcon,\n },\n ]);\n\n tree.appendChild(node, linkNode);\n tree.appendChild(linkNode, iconNode);\n}", "function NavLink(params) {\n\n const users = [\n {id: 1, name: 'Tom'},\n {id: 2, name: 'Jerry'},\n {id: 3, name: 'Doggo'},\n {id: 4, name: 'Bruno'}\n ]\n\n return(\n <div>\n <Link to=\"/\">Hooks</Link> &nbsp;&nbsp;&nbsp;\n <Link to=\"/Ref\">Ref</Link> &nbsp;&nbsp; &nbsp;\n <Link to=\"/HOC\">HOC</Link> &nbsp;&nbsp; &nbsp;\n <Link to=\"/Comp\">No Comp Route</Link> &nbsp; &nbsp;\n {/* By using anchor tag, page reloads to change content and breaks SPA rule. Thats why we use react library function Link*/}\n <a href=\"/Comp\">Wrong Way to Route in SPA(Reload)</a><br></br>\n\n {\n users.map((ele, index) => \n <Link key={index} to={ \"/user/\" + ele.id}> <span>{ele.name}</span> &nbsp; &nbsp; </Link>\n )\n }\n\n </div>\n )\n}", "displayActionButton() {\n return (\n // <Link to={`/collections/${this.props.collectionId}`}>\n <button\n className=\"form-button red-button\"\n type=\"submit\"\n onClick={this.handleSubmit}\n >\n {this.props.buttonText}\n </button>\n // </Link>\n )\n }", "translateAnchorLinks(text)\n {\n let hashWithoutAnchorAndHashMark = this.windowHashWithoutAnchor().substring(1);\n if (_.startsWith(hashWithoutAnchorAndHashMark, \"#\"))\n {\n hashWithoutAnchorAndHashMark = hashWithoutAnchorAndHashMark.substring(1);\n }\n\n let regexp = new RegExp(\"(.*<\\\\s*a[^>]+href\\\\s*=\\\\s*[\\\"']#)([^\\\"'\"\n + this.anchorChar + \"]*)([\\\"'][^>]*>.*)\", \"\");\n let replacement = \"$1\" + hashWithoutAnchorAndHashMark + this.paramSeparator\n + this.anchorChar + \"=\" + \"$2$3\";\n text = simpleUtils.replaceLoop(regexp, replacement, text);\n\n regexp = new RegExp(\"(.*<\\\\s*a[^>]+name\\\\s*=\\\\s*[\\\"'])([^\\\"'\"\n + this.anchorChar + \"]*)([\\\"'][^>]*>.*)\", \"\");\n replacement = \"$1\" + hashWithoutAnchorAndHashMark + this.paramSeparator\n + this.anchorChar + \"=\" + \"$2$3\";\n text = simpleUtils.replaceLoop(regexp, replacement, text);\n\n return text;\n }", "function createLink(name, text) {\n let className = `link-${name}`;\n \n const link = document.createElement('div');\n link.classList.add(className);\n link.textContent = text;\n link.addEventListener('click', () => {\n console.log(`clicked link: ${name}`);\n let el;\n if(name === \"About-Me\") {\n el = document.querySelector('.about-me-container');\n } else if(name === \"Projects\") {\n el = document.querySelector('.projects-container');\n } else if(name === 'Contact') {\n el = document.querySelector('.contact-container');\n }\n\n if(el != undefined) {\n el.scrollIntoView({behavior: \"smooth\"});\n }\n });\n \n return link;\n }", "displayUserView() {\n const questionnaire = this.props.questionnaire\n\n return(\n <div className=\"questionnaire-row\">\n <Link to={`/questionnaires/${questionnaire.id}`}\n onClick={ () => { this.props.fetchQuestionnaire(questionnaire.id) }}\n >\n <h3>\n { questionnaire.attributes.name }\n </h3>\n </Link>\n </div>\n )\n }", "function scrollToAnchor(){\n\n //getting the anchor link in the URL and deleting the `#`\n var value = window.location.hash.replace('#', '').split('/');\n var section = decodeURIComponent(value[0]);\n var slide = decodeURIComponent(value[1]);\n /* nectar addition */ \n if(section && $('.vc_row[data-fullscreen-anchor-id=\"'+section+'\"]').length > 0){ //if theres any #\n /* nectar addition end */ \n if(options.animateAnchor){\n scrollPageAndSlide(section, slide);\n }else{\n FP.silentMoveTo(section, slide);\n }\n }\n }", "pageLink(num) {\n let name;\n if(num === this.props.page)name='active';\n else name='';\n \n return (\n <li key={'page'+num} id={name}>\n <a onClick={() => this.props.fetchOrders(num)}>{num}</a>\n </li>\n )\n }" ]
[ "0.7293357", "0.725551", "0.6827036", "0.67869955", "0.6448339", "0.6386757", "0.6336245", "0.6336245", "0.6336245", "0.6336245", "0.6198019", "0.61884713", "0.614755", "0.61313796", "0.6124272", "0.6094945", "0.60794866", "0.6052326", "0.6043256", "0.6003522", "0.59908676", "0.59836626", "0.597176", "0.5969112", "0.5968302", "0.5944599", "0.593861", "0.59206736", "0.590543", "0.58977854", "0.5875484", "0.5867688", "0.5856255", "0.58003014", "0.58003014", "0.58003014", "0.5789114", "0.5788822", "0.57876855", "0.57814777", "0.5781074", "0.57805574", "0.5765957", "0.5759331", "0.57560456", "0.575513", "0.5749747", "0.57430494", "0.574304", "0.5741085", "0.57350373", "0.57267064", "0.5720846", "0.56982654", "0.5698005", "0.568917", "0.568404", "0.5676472", "0.5676472", "0.5659911", "0.56560606", "0.5655697", "0.56525195", "0.5635774", "0.5630504", "0.56261486", "0.56256634", "0.5621981", "0.56216085", "0.56099623", "0.5601666", "0.5601666", "0.5600834", "0.55987346", "0.55971354", "0.5594998", "0.5586903", "0.5579778", "0.5575832", "0.5575735", "0.5575576", "0.5575244", "0.5572517", "0.5572517", "0.5559035", "0.55557483", "0.5555651", "0.5542804", "0.5541402", "0.5538083", "0.55303705", "0.5522433", "0.55200994", "0.5517456", "0.5516694", "0.5507295", "0.5501562", "0.5497165", "0.549671", "0.5495223", "0.54952055" ]
0.0
-1
! ZRender, a high performance 2d drawing library. Copyright (c) 2013, Baidu Inc. All rights reserved. LICENSE
function Ni(t){delete Li[t]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawSurface() {\n wgl.takeBufferData(positionLocation, positionBuffer, 3, gl.FLOAT, false, 0, 0);\n wgl.takeBufferData(normalLocation, normalBuffer, 3, gl.FLOAT, false, 0, 0);\n gl.drawArrays(gl.TRIANGLES, 0, 6 * (map.points.length - 1) * (map.points.length - 1));\n }", "render(renderParameters) {\r\n\t\t\t\t var tileSize = this.layer.tileInfo.size[0];\r\n\t\t\t\t var state = renderParameters.state;\r\n\t\t\t\t var pixelRatio = state.pixelRatio;\r\n\t\t\t\t var width = state.size[0];\r\n\t\t\t\t var height = state.size[1];\r\n\t\t\t\t var context = renderParameters.context;\r\n\t\t\t\t var coords = [0, 0];\r\n\r\n\t\t\t\t context.fillStyle = \"rgba(0,0,0,0.25)\";\r\n\t\t\t\t context.fillRect(0, 0, width * pixelRatio, height * pixelRatio);\r\n\t\t\t\t }", "draw() { }", "draw() { }", "draw() { }", "function UpdateRender() {\r\n // Set background\r\n BackContextHandle.fillRect(0, 0, CanvasWidth, CanvasHeight);\r\n\r\n // RenderSquares\r\n BackContextHandle.save();\r\n RenderSquares();\r\n BackContextHandle.restore();\r\n\r\n // Swap the backbuffer with the frontbuffer\r\n var ImageData = BackContextHandle.getImageData(0, 0, CanvasWidth, CanvasHeight);\r\n ContextHandle.putImageData(ImageData, 0, 0);\r\n}", "drawOffscreen() { }", "function b2Draw()\r\n{\r\n}", "function setupDraw() {\n // Stop the 3D view from rendering\n continueRender = 0;\n //Check to see if Draw setup has already been run\n if(startupDraw == 1)\n {\n // Check if View mode has been run, if it has then we remove View Mode's listeners\n if(startupView == 0)\n {\n\n }\n canvas.onmousemove = null;\n canvas.onmousedown = null;\n window.onmouseup = null;\n\n //setup click and drag listeners\n canvas.addEventListener(\"mousedown\", checkPoint, false);\n canvas.addEventListener(\"mousemove\", movePoint, false);\n canvas.addEventListener(\"mouseup\", endMove, false);\n\n document.getElementById(\"demo\").innerHTML = \"Draw Mode\";\n\n // This will enable the correct menu for draw mode\n document.getElementById(\"drawMenu\").style.display = \"block\";\n document.getElementById(\"viewMenu\").style.display = \"none\";\n gl.enable(gl.DEPTH_TEST);\n \n // Load shaders\n programId = initShaders(gl, \"2d-vertex-shader\", \"2d-fragment-shader\");\n \n // ######Create vertex buffer objects --- ADD CODE HERE #######\n var positionAttributeLocation = gl.getAttribLocation(programId, \"a_position\");\n var resolutionUniformLocation = gl.getUniformLocation(programId, \"u_resolution\");\n colorLocation = gl.getUniformLocation(programId, \"u_color\");\n \n //setup buffer for control points line and bezier curve\n var positionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n\n //tell atribute how to get data out of it, first turn the attribute on\n gl.enableVertexAttribArray(positionAttributeLocation);\n //specify how to pull the data out\n var size = 2; // 2 components per iteration\n var type = gl.FLOAT; // the data is 32bit floats\n var normalize = false; // don't normalize the data\n var stride = 0; // 0 = move forward size * sizeof(type) each iteration to get the next position\n var offset = 0; // start at the beginning of the buffer\n gl.vertexAttribPointer(\n positionAttributeLocation, size, type, normalize, stride, offset)\n\n\n gl.useProgram(programId);\n // set the resolution so we use pixels instead of default 0 to 1\n gl.uniform2f(resolutionUniformLocation, gl.canvas.width, gl.canvas.height);\n\n // Ensure OpenGL viewport is resized to match canvas dimensions\n gl.viewportWidth = canvas.width;\n gl.viewportHeight = canvas.height;\n gl.lineWidth(1);\n\n // Set screen clear color to R, G, B, alpha; where 0.0 is 0% and 1.0 is 100%\n gl.clearColor(0.8, 0.8, 0.8, 1.0);\n \n // Enable color; required for clearing the screen\n gl.clear(gl.COLOR_BUFFER_BIT);\n startupDraw = 0;\n drawMethod();\n }\n else {\n drawMethod();\n }\n} // End of setupDraw()", "function render(){\n\tcanvas.clearRect(0,0, canvas.canvas.width, canvas.canvas.height)\n\tcanvas.strokeStyle = '#000000';\n\tcanvas.lineJoin = 'round';\n\tcanvas.lineWidth = 3;\n\t// lays down the drawing background first.\n\tif (back) {\n\t\tcanvas.drawImage(back,0,0);\n\t}\n\t// paints and retains painting order so everything renders correctly\n\t// uses the array of objects to determine what should be rendered\n\tfor(let i = 0; i < strokeOrder.length; i+=1){\n\t\t// draws standard painting\n\t\tif(strokeOrder[i].type ==='paint') {\n\t\t\tcanvas.beginPath();\n\t\t\tif(strokeOrder[i].paintPress && i){\n\t\t\t\tcanvas.moveTo(strokeOrder[i-1].paintX, strokeOrder[i-1].paintY);\n\t\t\t}else{\n\t\t\t\tcanvas.moveTo(strokeOrder[i].paintX-1, strokeOrder[i].paintY);\n\t\t}\n\t\tcanvas.lineTo(strokeOrder[i].paintX, strokeOrder[i].paintY)\n\t\tcanvas.closePath();\n\t\tcanvas.strokeStyle=strokeOrder[i].saveColor;\n\t\tcanvas.lineWidth=strokeOrder[i].saveSize;\n\t\tcanvas.stroke(); \n\t\t// draws the spray emoji\n\t\t} else if (strokeOrder[i].type ==='spray'){\n\t\t\tcanvas.drawImage(strokeOrder[i].src,strokeOrder[i].x,strokeOrder[i].y);\n\t\t// draws square shape\n\t\t} else if (strokeOrder[i].type=== 'square') {\n\t\t\tcanvas.lineWidth = 5;\n\t\t\tcanvas.strokeStyle = strokeOrder[i].color;\n\t\t\tcanvas.strokeRect(strokeOrder[i].x, strokeOrder[i].y, 50, 50);\n\t\t// draws circle shape\n\t\t} else if (strokeOrder[i].type === 'circle'){\n\t\t\tcanvas.beginPath();\n\t\t\tcanvas.lineWidth = 5;\n\t\t\tcanvas.strokeStyle = strokeOrder[i].color;\n\t\t\tcanvas.arc(strokeOrder[i].x, strokeOrder[i].y,25,0,2*Math.PI);\n\t\t\tcanvas.stroke();\n\t\t// draws triangle shape\n\t\t} else if (strokeOrder[i].type === 'triangle') {\n\t\t\tcanvas.beginPath();\n\t\t\tcanvas.lineWidth = 5;\n\t\t\tcanvas.strokeStyle = strokeOrder[i].color;\n\t\t\tcanvas.moveTo(strokeOrder[i].x, strokeOrder[i].y);\n\t\t\tcanvas.lineTo(strokeOrder[i].x +50, strokeOrder[i].y);\n\t\t\tcanvas.lineTo(strokeOrder[i].x +25, strokeOrder[i].y-35);\n\t\t\tcanvas.lineTo(strokeOrder[i].x, strokeOrder[i].y);\n\t\t\tcanvas.stroke();\n\t\t// draws lines\n\t\t} else if (strokeOrder[i].type === 'line'){\n\t\t\tcanvas.beginPath();\n\t\t\tcanvas.moveTo(strokeOrder[i].startX, strokeOrder[i].startY);\n\t\t\tcanvas.lineTo(strokeOrder[i].endX, strokeOrder[i].endY);\n\t\t\tcanvas.lineWidth = strokeOrder[i].lineSize;\n\t\t\tcanvas.strokeStyle = strokeOrder[i].lineColor;\n\t\t\tcanvas.stroke();\n\t\t}\n\t}\n\t}", "function render() {\n\tclearCanvas();\n\tRenderer.draw();\n\t\n\t\t\n}", "RenderInit() {\n this.canvas.width = this.size;\n this.canvas.height = this.size;\n this.context = this.canvas.getContext(\"2d\");\n this.buffer = this.size / this.gamestate.layout.length;\n this.draw();\n this.drawKey();\n this.drawExit();\n this.drawPlayers();\n this.drawAdversaries();\n }", "function render() {\r\n gl.clear(gl.COLOR_BUFFER_BIT);\r\n gl.drawArrays(gl.POINTS, 0, 2);\r\n}", "_draw() {\n\n }", "render2d(){\n const ctx = this.canvas2dctx;\n\n ctx.clearRect(0,0,this.state.width,this.state.height);\n\n ctx.strokeStyle = \"white\";\n ctx.lineWidth = 2.0;\n ctx.font = \"16px sans-serif\";\n ctx.fillStyle = \"white\";\n\n for (let i = 0; i < this.text2d.length; i ++){\n const {text,vec, withline } = this.text2d[i];\n let v2 = this.convertWorldToScreenXY(vec);\n if( withline){\n ctx.beginPath();\n ctx.moveTo(v2.x,v2.y); ctx.lineTo(v2.x+30, v2.y-30); ctx.lineTo(v2.x+30+ctx.measureText(text).width, v2.y-30);\n ctx.stroke();\n ctx.fillText(text, v2.x+30, v2.y-30-3);\n }else{\n ctx.fillText(text, v2.x-ctx.measureText(text).width/2, v2.y-3);\n }\n }\n }", "function allthere(){\n\n // settings.\n var gridres = 128, totX = 4096,\n totY = 391, pbrtShowrender = true,\n pbrtBounces = 2, pbrtBatch = 1,\n pbrtSamples = Math.floor((parseInt(document.location.hash.slice(1)) || 200) / pbrtBatch);\n var pbrtGrid = { // grid 外框\n bbox: new Float32Array(\n [-16.35320053100586, -3.3039399147033692, -13.719999885559082, 31.68820018768311, 13.706639957427978, 24.6798002243042])\n };\n\n // Shader helpers.\n function createShader(gl, source, type) { var shader=gl.createShader(type); gl.shaderSource(shader, source); gl.compileShader(shader); return shader; }\n function createProgram(gl, vertexShaderSource, fragmentShaderSource) {\n var program = gl.createProgram();\n gl.attachShader(program, createShader(gl, vertexShaderSource, gl.VERTEX_SHADER)); \n gl.attachShader(program, createShader(gl, fragmentShaderSource, gl.FRAGMENT_SHADER));\n gl.linkProgram(program);\n return program;\n };\n\n // Offscreen float buffers.\n function createOffscreen(gl,width,height) {\n var colorTexture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, colorTexture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA32F, width, height, 0, gl.RGBA, gl.FLOAT, null);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.bindTexture(gl.TEXTURE_2D, null);\n\n var depthBuffer = gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer);\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, width, height);\n gl.bindRenderbuffer(gl.RENDERBUFFER, null);\n\n var framebuffer = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, colorTexture, 0);\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthBuffer);\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n return {\n framebuffer:framebuffer,colorTexture:colorTexture,depthBuffer:depthBuffer,width:width,height:height,gl:gl,\n bind : function() { this.gl.bindFramebuffer(this.gl.FRAMEBUFFER, this.framebuffer); this.gl.viewport(0,0,this.width,this.height); },\n unbind : function() { this.gl.bindFramebuffer(this.gl.FRAMEBUFFER, null); },\n delete : function() { this.gl.deleteRenderbuffer(this.depthBuffer); this.gl.deleteFramebuffer(this.framebuffer); this.gl.deleteTexture(this.colorTexture); }\n }\n }\n\n // setup output canvas, gl context and offscreen.\n var canvas = m(document.body.appendChild(document.createElement('canvas')),{width:800,height:450});\n m(canvas.style,{width:'800px',height:'450px'});\n var gl = canvas.getContext('webgl2'); if (!gl) alert('webGL2 required !');\n var ext1 = gl.getExtension('EXT_color_buffer_float'); if (!ext1) alert('videocard required');\n var ofscreen1 = createOffscreen(gl,canvas.width,canvas.height);\n \n // Shaders for accumulation and tonemap.\n var vs2=`#version 300 es\n #define POSITION_LOCATION 0\n precision lowp float;\n layout(location = POSITION_LOCATION) in vec3 position;\n void main() { gl_Position = vec4(position, 1.0); }`;\n\n var fs2=`#version 300 es\n precision lowp float;\n precision lowp sampler2D;\n uniform sampler2D accum;\n uniform float count; // 采样次数的倒数 相当于除以采样次数\n out vec4 color;\n void main() { color = vec4(sqrt(texelFetch(accum,ivec2(gl_FragCoord.xy),0).rgb*count),1.0); }\n `;\n\n // Actual Path tracing shaders.\n var vs=`#version 300 es\n #define POSITION_LOCATION 0\n precision highp float;\n precision highp int;\n uniform mat4 MVP;\n layout(location = POSITION_LOCATION) in vec3 position;\n out vec3 origin;\n void main()\n {\n origin = (MVP * vec4(0.0,0.0,0.0,1.0)).xyz;\n gl_Position = vec4(position, 1.0);\n }`;\n\n var fs=`#version 300 es\n precision highp float;\n precision highp int;\n precision highp sampler3D;\n precision highp sampler2D;\n\n #define EPSILON 0.000001\n\n uniform vec2 resolution;\n uniform float inseed;\n uniform int incount;\n \n uniform mat4 MVP, proj;\n\n uniform sampler3D grid;\n uniform sampler2D tris;\n uniform vec3 bbina, bbinb;\n\n vec3 bboxA, bboxB;\n\n in vec3 origin;\n out vec4 color;\n \n uint N = ${pbrtSamples}u, i;\n\n float seed;\n float minc(const vec3 x) { return min(x.x,min(x.y,x.z)); }\n \n float random_ofs=0.0;\n vec3 cosWeightedRandomHemisphereDirectionHammersley( const vec3 n ) {\n float x = float(i)/float(N); \n i = (i << 16u) | (i >> 16u);\n i = ((i & 0x55555555u) << 1u) | ((i & 0xAAAAAAAAu) >> 1u);\n i = ((i & 0x33333333u) << 2u) | ((i & 0xCCCCCCCCu) >> 2u);\n i = ((i & 0x0F0F0F0Fu) << 4u) | ((i & 0xF0F0F0F0u) >> 4u);\n i = ((i & 0x00FF00FFu) << 8u) | ((i & 0xFF00FF00u) >> 8u);\n vec2 r = vec2(x,(float(i) * 2.32830643653086963e-10 * 6.2831) + random_ofs);\n vec3 uu=normalize(cross(n, vec3(1.0,1.0,0.0))), vv=cross( uu, n );\n float sqrtx = sqrt(r.x);\n return normalize(vec3( sqrtx*cos(r.y)*uu + sqrtx*sin(r.y)*vv + sqrt(1.0-r.x)*n ));\n }\n\n vec4 trace( inout vec3 realori, const vec3 dir) {\n float len=0.0,l,b,mint=1000.0;\n vec2 minuv, mintri, cpos;\n vec3 scaler=vec3(bbinb/${gridres}.0)/dir,orig=realori,v0,v1,v2;\n for (int i=0;i<150;i++){\n vec3 txc=(orig-bboxA)*bboxB;\n if ( txc != clamp(txc,0.0,1.0)) break;\n vec3 tex=textureLod(grid,txc,0.0).rgb;\n for(int tri=0; tri<512; tri++) { \n if (tex.b<=0.0) break; cpos=tex.rg; tex.rb+=vec2(3.0/4096.0,-1.0); \n v1 = textureLodOffset(tris,cpos,0.0,ivec2(1,0)).rgb;\n v2 = textureLodOffset(tris,cpos,0.0,ivec2(2,0)).rgb;\n vec3 P = cross(dir,v2); float det=dot(v1,P); if (det>-EPSILON) continue;\n v0 = textureLod(tris,cpos,0.0).rgb;\n vec3 T=realori-v0; float invdet=1.0/det; float u=dot(T,P)*invdet; if (u < 0.0 || u > 1.0) continue;\n vec3 Q=cross(T,v1); float v=dot(dir,Q)*invdet; if(v<0.0||u+v>1.0) continue;\n float t=dot(v2, Q)*invdet; if (t>EPSILON && t<mint) { mint=t; mintri=cpos; minuv=vec2(u,v); } \n }\n b=max(0.0,-tex.b-1.0); txc=fract(txc*${gridres}.0);\n l=minc(scaler*mix(b+1.0-txc,-b-txc,vec3(lessThan(dir,vec3(0.0)))))+EPSILON*50.0;\n len += l;\n if (mint <= len) {\n realori += dir*(mint);\n mintri += vec2(0.0,1.0/4.0);\n vec3 n0 = -textureLod(tris,mintri,0.0).rgb;\n vec3 n1 = -textureLodOffset(tris,mintri,0.0,ivec2(1,0)).rgb;\n vec3 n2 = -textureLodOffset(tris,mintri,0.0,ivec2(2,0)).rgb;\n return vec4(normalize(n0*(1.0-minuv.x-minuv.y) + n1*minuv.x + n2*minuv.y),mint); \n } \n orig += dir*l;\n }\n return vec4(0.0); \n }\n \n void main()\n {\n bboxA=bbina; bboxB=1.0/bbinb; i=uint(incount);\n vec2 fc = vec2(gl_FragCoord.xy), fcu=fc/resolution;\n seed = inseed +fcu.x+fcu.y; \n vec2 aa = fract(sin(vec2(seed,seed+0.1))*vec2(43758.5453123,22578.1459123));\n random_ofs = fract(gl_FragCoord.x * gl_FragCoord.y * inseed + aa.x)*6.2831;\n vec4 view = proj * vec4((fc+aa)/(resolution/2.0)-1.0,0.0,1.0);\n view = normalize(MVP*vec4(view.xyz/view.w,0.0));\n vec3 orig=origin,v1=(bboxA-orig)/view.xyz,v2=v1+(bbinb-vec3(0.2))/view.xyz,far=max(v1,v2),near=min(v1,v2);\n float en=max(near.x,max(near.y,near.z)), ex=min(far.x,min(far.y,far.z));\n if (ex < 0.0 || en > ex) { color=vec4(1.0); return; }\n orig += max(0.0,en)*view.xyz;\n vec4 hit=trace(orig,view.xyz);\n if (hit.w <= 0.0) { color.rgb = vec3(1.0); return; }\n hit=trace(orig, -cosWeightedRandomHemisphereDirectionHammersley(hit.xyz));\n if (hit.w <= 0.0) { color.rgb = vec3(0.8); return; }\n }`;\n\n // Upload polygon and acceleration data.\n var texture = gl.createTexture(); // grid\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_3D, texture);\n gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_3D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texImage3D( gl.TEXTURE_3D, 0, gl.RGB32F, gridres, gridres, gridres, 0, gl.RGB, gl.FLOAT, map ); \n\n var texture2 = gl.createTexture(); // trangle\n gl.activeTexture(gl.TEXTURE1);\n gl.bindTexture(gl.TEXTURE_2D, texture2);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texImage2D( gl.TEXTURE_2D, 0, gl.RGB32F, totX, totY*4, 0, gl.RGB, gl.FLOAT, polyData ); \n\n // Create the path tracing program, grab the uniforms.\n var program = createProgram(gl, vs, fs);\n var mvpLocation = gl.getUniformLocation(program, 'MVP');\n var pLocation = gl.getUniformLocation(program, 'proj');\n var uniformgridLocation = gl.getUniformLocation(program, 'grid');\n var uniformtrisLocation = gl.getUniformLocation(program, 'tris');\n var uniformSeed = gl.getUniformLocation(program, 'inseed');\n var uniformCount = gl.getUniformLocation(program, 'incount');\n var uniformbbaLocation = gl.getUniformLocation(program, 'bbina');\n var uniformbbbLocation = gl.getUniformLocation(program, 'bbinb');\n var uniformresLocation = gl.getUniformLocation(program, 'resolution');\n\n // Create the accumulation program, grab thos uniforms.\n var program2 = createProgram(gl, vs2, fs2);\n var uniformAccumLocation = gl.getUniformLocation(program2, 'accum');\n var uniformCountLocation = gl.getUniformLocation(program2, 'count');\n\n // Setup the quad that will drive the rendering.\n var vertexPosBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPosBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 0, 1, -1, 0, 1, 1, 0, 1, 1, 0, -1, 1, 0, -1, -1, 0]), gl.STATIC_DRAW);\n gl.bindBuffer(gl.ARRAY_BUFFER, null); \n\n var vertexArray = gl.createVertexArray();\n gl.bindVertexArray(vertexArray);\n var vertexPosLocation = 0;\n gl.enableVertexAttribArray(vertexPosLocation);\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexPosBuffer);\n gl.vertexAttribPointer(vertexPosLocation, 3, gl.FLOAT, false, 0, 0);\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n gl.bindVertexArray(null);\n\n // Setup some matrices (stole values from jimmy|rig)\n //相机矩阵 \n var matrix = new Float32Array(\n [6.123234262925839e-17, 0, 1, 0,\n -0.8660253882408142, 0.5, 5.302876566937394e-17, 0,\n -0.5, -0.8660253882408142, 3.0616171314629196e-17, 0,\n 6.535898208618164, 19.320507049560547, -4.0020835038019837e-16, 1]);\n // 场景矩阵\n var matrix2 = new Float32Array([1.7777777910232544, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, -0.49950000643730164, 0, 0, 1, 0.5005000233650208]);\n var viewportMV = new Float32Array(matrix); \n var accum_count=1, diff=true, abort=false;\n\n // frame handler. \n function frame() {\n // Do we need to restart rendering (i.e. viewport change)\n if (diff) { // 如果视角变化,设置新的矩阵,清空framebuffer重新渲染\n matrix.set(viewportMV);\n ofscreen1.bind(); gl.clear(gl.COLOR_BUFFER_BIT); ofscreen1.unbind();\n accum_count=1;\n abort=undefined;\n diff=false;\n }\n\n // Render more samples.\n if (!abort) { \n // Bind the offscreen and render a new sample.\n ofscreen1.bind();\n gl.useProgram(program);\n gl.uniformMatrix4fv(mvpLocation, false, matrix);\n gl.uniformMatrix4fv(pLocation, false, matrix2);\n gl.uniform1i(uniformgridLocation, 0);\n gl.uniform1i(uniformtrisLocation, 1);\n gl.uniform3fv(uniformbbaLocation, pbrtGrid.bbox.slice(0,3));\n gl.uniform3fv(uniformbbbLocation, pbrtGrid.bbox.slice(3,6));\n gl.uniform2fv(uniformresLocation, new Float32Array([canvas.width,canvas.height]));\n gl.uniform1f(uniformSeed,Math.random());\n gl.uniform1i(uniformCount,(accum_count)%pbrtSamples);\n\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_3D, texture); // grid\n gl.activeTexture(gl.TEXTURE1);\n gl.bindTexture(gl.TEXTURE_2D, texture2); // trangle\n\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE,gl.ONE);\n gl.bindVertexArray(vertexArray);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.bindVertexArray(null);\n gl.disable(gl.BLEND);\n ofscreen1.unbind();\n\n // Display progress (mixdown from float to ldr) \n gl.useProgram(program2);\n gl.uniform1i(uniformAccumLocation, 0);\n gl.uniform1f(uniformCountLocation, 1.0/accum_count);\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, ofscreen1.colorTexture);\n\n gl.bindVertexArray(vertexArray);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n gl.bindVertexArray(null);\n\n gl.bindTexture(gl.TEXTURE_2D, null);\n\n // Stop if we're done.\n if (++accum_count>pbrtSamples) abort =true;\n }\n requestAnimationFrame(frame);\n }\n requestAnimationFrame(frame);\n\n var angle=-Math.PI/2, angle2=Math.PI/3,zoom=0;\n canvas.oncontextmenu =function(e) { e.preventDefault(); e.stopPropagation(); }\n canvas.onmousemove = function(e) {\n if (!e.buttons) return;\n if (e.buttons==1) { angle += e.movementX/100; angle2 += e.movementY/100; } else { zoom += e.movementX/10; }\n viewportMV = t(rX(rY(i(),angle),angle2),[0,4,-20+zoom]);\n diff = true;\n }\n }", "function draw() {}", "function draw() {}", "draw() {}", "draw() {}", "draw() {}", "draw() {}", "function init() {\r\n Draw() ;\r\n}", "blitFrom(c){\n this.context.clearRect(0,0,this.canvas.width,this.canvas.height);\n if (this.opt.tall){\n this.context.drawImage(c.canvas, 0, 0, c.canvas.width/2, c.canvas.height, 0, 0, this.canvas.width, this.canvas.height/2);\n this.context.drawImage(c.canvas, c.canvas.width/2, 0, c.canvas.width/2, c.canvas.height, 0, this.canvas.height/2, this.canvas.width, this.canvas.height/2);\n } else {\n this.context.drawImage(c.canvas, 0, 0, c.canvas.width, c.canvas.height, 0, 0, c.canvas.width/(c.zoom/this.zoom), c.canvas.height/(c.zoom/this.zoom))\n }\n if (this.opt.grid){\n for (let x = 0; x < this.canvas.width/this.zoom; ++x){\n if (x % 16 == 15 && x != this.tWidth-1){\n this.context.fillStyle = \"#AA0000\";\n }else{\n this.context.fillStyle = \"#AAAAAA\";\n }\n this.context.fillRect((x+1)*this.zoom-((x%8==7)?2:1),0,(x%8==7)?2:1,this.canvas.height);\n }\n for (let y = 0; y < this.canvas.height/this.zoom; ++y){\n if (y % 16 == 15 && y != this.tWidth-1){\n this.context.fillStyle = \"#BB0000\";\n }else{\n this.context.fillStyle = \"#AAAAAA\";\n }\n this.context.fillRect(0,(y+1)*this.zoom-((y%8==7)?2:1),this.canvas.width,(y%8==7)?2:1);\n }\n }\n this.drawCallback();\n }", "function render3d() {\n\n createBezierCurves();\n\n // create all models\n var models = [];\n curves.forEach((c)=>{\n models.push(new BezierModel(c.vertices));\n });\n points = [];\n normals = [];\n colors = [];\n texCoordsArray = [];\n // build the main object\n buildObjects({objects:models});\n\n // load colors, points, and normals to buffer\n loadVertices(program);\n loadColors(program);\n loadNormals(program);\n loadTextureArray(program);\n\n}", "function render() {\n\t\tdraw.custom(function(canvas, context) {\n\t\t\tbullets.forEach(function(bullet, index, bulletList) {\n\t\t\t\tgetSides(bullet, bullet.angle);\n\t\t\t\tcontext.fillStyle = \"black\";\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.moveTo(bullet.points[0].x + bullet.x, bullet.points[0].y + bullet.y);\n\t\t\t\tfor (var i = 1; i < bullet.points.length; i++) {\n\t\t\t\t\tcontext.lineTo(bullet.points[i].x + bullet.x, bullet.points[i].y + bullet.y);\n\t\t\t\t}\n\t\t\t\tcontext.closePath();\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.fill();\n\n\t\t\t});\n\t\t\ttanks.forEach(function(tank, index, tankList) {\n\t\t\t\tgetSides(tank, tank.angle);\n\t\t\t\tcontext.fillStyle = \"black\";\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.moveTo(tank.points[0].x + tank.x, tank.points[0].y + tank.y);\n\t\t\t\tfor (var i = 1; i < tank.points.length; i++) {\n\t\t\t\t\tcontext.lineTo(tank.points[i].x + tank.x, tank.points[i].y + tank.y);\n\t\t\t\t}\n\t\t\t\tcontext.closePath();\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.fill();\n\t\t\t});\n\t\t\teffects.forEach(function(effect, index, effectList) {\n\t\t\t\tfor (var i = 0; i < effect.particles.length; i++) {\n\t\t\t\t\tvar particle = effect.particles[i];\n\t\t\t\t\tgetSides(particle, particle.angle);\n\t\t\t\t\tcontext.fillStyle = \"black\";\n\t\t\t\t\tcontext.beginPath();\n\t\t\t\t\tcontext.moveTo(particle.points[0].x + particle.x, particle.points[0].y + particle.y);\n\t\t\t\t\tfor (var e = 1; e < particle.points.length; e++) {\n\t\t\t\t\t\tcontext.lineTo(particle.points[e].x + particle.x, particle.points[e].y + particle.y);\n\t\t\t\t\t}\n\t\t\t\t\tcontext.closePath();\n\t\t\t\t\tcontext.stroke();\n\t\t\t\t\tcontext.fill();\n\t\t\t\t}\n\t\t\t});\n\t\t\tmap.forEach(function(wall, index, walls) {\n\t\t\t\tgetSides(wall, wall.angle);\n\t\t\t\tcontext.fillStyle = \"black\";\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.moveTo(wall.points[0].x + wall.x, wall.points[0].y + wall.y);\n\t\t\t\tfor (var i = 1; i < wall.points.length; i++) {\n\t\t\t\t\tcontext.lineTo(wall.points[i].x + wall.x, wall.points[i].y + wall.y);\n\t\t\t\t}\n\t\t\t\tcontext.closePath();\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.fill();\n\t\t\t});\n\t\t});\n\t}", "function Renderer3D(image, points)\n{\n\tthis.canvas = createCanvas(0, 0, 1, 1);\n\tthis.ctx = this.canvas.getContext(\"2d\");\n\tthis.image = image;\n\tthis.transform = null;\n\tthis.iw = 0;\n\tthis.ih = 0;\n\tthis.points = points;\n\tthis.bounds = [];//just the right order of points\n\tthis.offsetx = 0;\n\tthis.offsety = 0;\n\t\n\t//\n\tthis.options = {\n\t wireframe: false,\n\t image: 'images/image1.jpg',\n\t subdivisionLimit: 3,\n\t patchSize: 128\n\t};\n\t//Update the display to match a new point configuration.\n this.update = update;\n\tthis.divide = divide;\n\tthis.getCanvas = getCanvas;\n\tthis.testObjectClick = testObjectClick;\n\tfunction getCanvas(){\n\t\treturn this.canvas;\n\t}\n\tfunction testObjectClick(pt){\n\t\treturn(isPointInPoly(this.bounds, pt));\n\t}\n\tfunction update() {\n\t // Get extents.\n\t var minX = Infinity, maxX = -Infinity, minY = Infinity, maxY = -Infinity;\n\t for (var i = 0; i < 4; i++)\n\t {\n\t\tminX = Math.min(minX, Math.floor(this.points[i][0]));\n\t\tmaxX = Math.max(maxX, Math.ceil(this.points[i][0]));\n\t\tminY = Math.min(minY, Math.floor(this.points[i][1]));\n\t\tmaxY = Math.max(maxY, Math.ceil(this.points[i][1]));\n\t }\n\t \n\t minX--; minY--; maxX++; maxY++;\n\t this.offsetX = minX;\n\t this.offsetY = minY;\n\t \n\t var width = maxX - minX;\n\t var height = maxY - minY;\n\n\t // Reshape canvas.\n\t this.canvas.style.left = minX +'px';\n\t this.canvas.style.top = minY +'px';\n\t this.canvas.width = width;\n\t this.canvas.height = height;\n\t \n\t // Measure texture.\n\t this.iw = this.image.width;\n\t this.ih = this.image.height;\n\n\t // Set up basic drawing context.\n\t this.ctx = this.canvas.getContext(\"2d\");\n\t this.ctx.translate(-minX, -minY);\n\t this.ctx.clearRect(minX, minY, width, height);\n\t this.ctx.strokeStyle = \"rgb(220,0,100)\";\n\n\t this.transform = getProjectiveTransform(points);\n\n\t // Begin subdivision process.\n\t var ptl = this.transform.transformProjectiveVector([0, 0, 1]);\n\t var ptr = this.transform.transformProjectiveVector([1, 0, 1]);\n\t var pbl = this.transform.transformProjectiveVector([0, 1, 1]);\n\t var pbr = this.transform.transformProjectiveVector([1, 1, 1]);\n\n\t this.ctx.beginPath();\n\t this.ctx.moveTo(ptl[0], ptl[1]);\n\t this.ctx.lineTo(ptr[0], ptr[1]);\n\t this.ctx.lineTo(pbr[0], pbr[1]);\n\t this.ctx.lineTo(pbl[0], pbl[1]);\n\t this.ctx.closePath();\n\t this.ctx.clip();\n\n\t this.bounds.length = 0;\n\t this.bounds.push(new jsPoint(ptl[0], ptl[1]));\n\t this.bounds.push(new jsPoint(ptr[0], ptr[1]));\n\t this.bounds.push(new jsPoint(pbr[0], pbr[1]));\n\t this.bounds.push(new jsPoint(pbl[0], pbl[1]));\n\t \n\t this.divide(0, 0, 1, 1, ptl, ptr, pbl, pbr, this.options.subdivisionLimit);\n\n\t \n\t if (this.options.wireframe) {\n\t\tthis.ctx.beginPath();\n\t\tthis.ctx.moveTo(ptl[0], ptl[1]);\n\t\tthis.ctx.lineTo(ptr[0], ptr[1]);\n\t\tthis.ctx.lineTo(pbr[0], pbr[1]);\n\t\tthis.ctx.lineTo(pbl[0], pbl[1]);\n\t\tthis.ctx.closePath();\n\t\tthis.ctx.stroke();\n\t }\n\t}\n\t//Render a projective patch.\n\tfunction divide(u1, v1, u4, v4, p1, p2, p3, p4, limit) {\n\t // See if we can still divide.\n\t if (limit) {\n\t\t// Measure patch non-affinity.\n\t\tvar d1 = [p2[0] + p3[0] - 2 * p1[0], p2[1] + p3[1] - 2 * p1[1]];\n\t\tvar d2 = [p2[0] + p3[0] - 2 * p4[0], p2[1] + p3[1] - 2 * p4[1]];\n\t\tvar d3 = [d1[0] + d2[0], d1[1] + d2[1]];\n\t\tvar r = Math.abs((d3[0] * d3[0] + d3[1] * d3[1]) / (d1[0] * d2[0] + d1[1] * d2[1]));\n\n\t\t// Measure patch area.\n\t\td1 = [p2[0] - p1[0] + p4[0] - p3[0], p2[1] - p1[1] + p4[1] - p3[1]];\n\t\td2 = [p3[0] - p1[0] + p4[0] - p2[0], p3[1] - p1[1] + p4[1] - p2[1]];\n\t\tvar area = Math.abs(d1[0] * d2[1] - d1[1] * d2[0]);\n\n\t\t// Check area > patchSize pixels (note factor 4 due to not averaging d1 and d2)\n\t\t// The non-affinity measure is used as a correction factor.\n\t\tif ((u1 == 0 && u4 == 1) || ((.25 + r * 5) * area > (this.options.patchSize * this.options.patchSize))) {\n\t\t // Calculate subdivision points (middle, top, bottom, left, right).\n\t\t var umid = (u1 + u4) / 2;\n\t\t var vmid = (v1 + v4) / 2;\n\t\t var pmid = this.transform.transformProjectiveVector([umid, vmid, 1]);\n\t\t var pt = this.transform.transformProjectiveVector([umid, v1, 1]);\n\t\t var pb = this.transform.transformProjectiveVector([umid, v4, 1]);\n\t\t var pl = this.transform.transformProjectiveVector([u1, vmid, 1]);\n\t\t var pr = this.transform.transformProjectiveVector([u4, vmid, 1]);\n\n\t\t // Subdivide.\n\t\t limit--;\n\t\t this.divide(u1, v1, umid, vmid, p1, pt, pl, pmid, limit);\n\t\t this.divide(umid, v1, u4, vmid, pt, p2, pmid, pr, limit);\n\t\t this.divide(u1, vmid, umid, v4, pl, pmid, p3, pb, limit);\n\t\t this.divide(umid, vmid, u4, v4, pmid, pr, pb, p4, limit);\n\n\t\t if (this.options.wireframe) {\n\t\t\tthis.ctx.beginPath();\n\t\t\tthis.ctx.moveTo(pt[0], pt[1]);\n\t\t\tthis.ctx.lineTo(pb[0], pb[1]);\n\t\t\tthis.ctx.stroke();\n\n\t\t\tthis.ctx.beginPath();\n\t\t\tthis.ctx.moveTo(pl[0], pl[1]);\n\t\t\tthis.ctx.lineTo(pr[0], pr[1]);\n\t\t\tthis.ctx.stroke();\n\t\t }\n\n\t\t return;\n\t\t}\n\t }\n\n\t // Render this patch.\n\t this.ctx.save();\n\n\t // Set clipping path.\n\t this.ctx.beginPath();\n\t this.ctx.moveTo(p1[0], p1[1]);\n\t this.ctx.lineTo(p2[0], p2[1]);\n\t this.ctx.lineTo(p4[0], p4[1]);\n\t this.ctx.lineTo(p3[0], p3[1]);\n\t this.ctx.closePath();\n\t //this.ctx.clip();\n\t \n\t // Get patch edge vectors.\n\t var d12 = [p2[0] - p1[0], p2[1] - p1[1]];\n\t var d24 = [p4[0] - p2[0], p4[1] - p2[1]];\n\t var d43 = [p3[0] - p4[0], p3[1] - p4[1]];\n\t var d31 = [p1[0] - p3[0], p1[1] - p3[1]];\n\t \n\t // Find the corner that encloses the most area\n\t var a1 = Math.abs(d12[0] * d31[1] - d12[1] * d31[0]);\n\t var a2 = Math.abs(d24[0] * d12[1] - d24[1] * d12[0]);\n\t var a4 = Math.abs(d43[0] * d24[1] - d43[1] * d24[0]);\n\t var a3 = Math.abs(d31[0] * d43[1] - d31[1] * d43[0]);\n\t var amax = Math.max(Math.max(a1, a2), Math.max(a3, a4));\n\t var dx = 0, dy = 0, padx = 0, pady = 0;\n\t \n\t // Align the this.transform along this corner.\n\t switch (amax) {\n\t\tcase a1:\n\t\t this.ctx.transform(d12[0], d12[1], -d31[0], -d31[1], p1[0], p1[1]);\n\t\t // Calculate 1.05 pixel padding on vector basis.\n\t\t if (u4 != 1) padx = 1.05 / Math.sqrt(d12[0] * d12[0] + d12[1] * d12[1]);\n\t\t if (v4 != 1) pady = 1.05 / Math.sqrt(d31[0] * d31[0] + d31[1] * d31[1]);\n\t\t break;\n\t\tcase a2:\n\t\t this.ctx.transform(d12[0], d12[1], d24[0], d24[1], p2[0], p2[1]);\n\t\t // Calculate 1.05 pixel padding on vector basis.\n\t\t if (u4 != 1) padx = 1.05 / Math.sqrt(d12[0] * d12[0] + d12[1] * d12[1]);\n\t\t if (v4 != 1) pady = 1.05 / Math.sqrt(d24[0] * d24[0] + d24[1] * d24[1]);\n\t\t dx = -1;\n\t\t break;\n\t\tcase a4:\n\t\t this.ctx.transform(-d43[0], -d43[1], d24[0], d24[1], p4[0], p4[1]);\n\t\t // Calculate 1.05 pixel padding on vector basis.\n\t\t if (u4 != 1) padx = 1.05 / Math.sqrt(d43[0] * d43[0] + d43[1] * d43[1]);\n\t\t if (v4 != 1) pady = 1.05 / Math.sqrt(d24[0] * d24[0] + d24[1] * d24[1]);\n\t\t dx = -1;\n\t\t dy = -1;\n\t\t break;\n\t\tcase a3:\n\t\t // Calculate 1.05 pixel padding on vector basis.\n\t\t this.ctx.transform(-d43[0], -d43[1], -d31[0], -d31[1], p3[0], p3[1]);\n\t\t if (u4 != 1) padx = 1.05 / Math.sqrt(d43[0] * d43[0] + d43[1] * d43[1]);\n\t\t if (v4 != 1) pady = 1.05 / Math.sqrt(d31[0] * d31[0] + d31[1] * d31[1]);\n\t\t dy = -1;\n\t\t break;\n\t }\n\t \n\t // Calculate image padding to match.\n\t var du = (u4 - u1);\n\t var dv = (v4 - v1);\n\t var padu = padx * du;\n\t var padv = pady * dv;\n\t this.ctx.drawImage(\n\t\timage,\n\t\tu1 * this.iw,\n\t\tv1 * this.ih,\n\t\tMath.min(u4 - u1 + padu, 1) * this.iw,\n\t\tMath.min(v4 - v1 + padv, 1) * this.ih,\n\t\tdx, dy,\n\t\t//1 + padx, 1 + pady\n\t\t1, 1\n\t );\n\n\t this.ctx.restore();\n\t}\n}", "function UpdateRender() {\n // Set background\n BackContextHandle.fillRect(0, 0, CanvasWidth, CanvasHeight);\n\n // Render\n BackContextHandle.save();\n Render();\n BackContextHandle.restore();\n\n // Swap the backbuffer with the frontbuffer\n var ImageData = BackContextHandle.getImageData(0, 0, CanvasWidth, CanvasHeight);\n ContextHandle.putImageData(ImageData, 0, 0);\n}", "function draw(){\n\t\t// Needed to comply with Tool Delegate design pattern\n\t}", "function draw() {\n\t\t\t// Adjust render settings if we switched to multiple viewports or vice versa\n\t\t\tif (medeactx.frame_flags & medeactx.FRAME_VIEWPORT_UPDATED) {\n\t\t\t\tif (medeactx.GetEnabledViewportCount()>1) {\n\t\t\t\t\tmedeactx.gl.enable(medeactx.gl.SCISSOR_TEST);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tmedeactx.gl.disable(medeactx.gl.SCISSOR_TEST);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Perform rendering\n\t\t\tvar viewports = medeactx.GetViewports();\n\t\t\tfor(var vn = 0; vn < viewports.length; ++vn) {\n\t\t\t\tviewports[vn].Render(medeactx,dtime);\n\t\t\t}\n\t\t}", "function ProceduralRenderer3(){}", "function Renderer() {}", "function render() {\n\tctx.beginPath();\n\tctx.fillRect(-width, -height, 2*width, 2*height);\n\tctx.beginPath();\n\tdraw(document.getElementById('num').value, -10, -50, 10, -50);\n}", "renderFrame(){\n // calculate fps\n let now = Date.now();\n this.fps = Math.round( 1000/ (now-this.lastFrameTimestamp) );\n this.lastFrameTimestamp = now;\n\n // calculate average fps\n if( this.fpsLast.length < 60 ) this.fpsLast.push( this.fps );\n else{\n let sum = this.fpsLast.reduce(function(a, b) { return a + b }, 0);\n let average = sum / this.fpsLast.length;\n this.fpsAverage = Math.round( average );\n this.fpsLast= [];\n }\n\n if( this.edgeScrolling ) this.__edgeScrollingHandler();\n\n // clear viewport\n this.Context.clearRect(0, 0, this.Canvas.width/this.Scale.current, this.Canvas.height/this.Scale.current);\n //\n // OPTIMIZATIONS TOSO: render only inscreen tiles\n // render in invisible canvas and dumpmcntent whennscene is ready\n //\n // Iterate columns from right to left\n for (var column =this.Map.columns-1; column >=0 ; column--){\n // Iteraterows from top to bottom\n for (var row =0; row < this.Map.rows ; row++){\n // each cell can have multiple sprites, iterate them...\n for (var layer = 0; layer < this.Map.tileData[row][column].length; layer++){\n this.renderTile( this.Map.tileData[row][column][layer], column, row);\n\n //this.Context.globalAlpha = 0.10;\n //this.renderTile( 7, column, row );\n //this.Context.globalAlpha = 1;\n }\n }\n }\n\n if(this.showProfiler) this.renderProfiler();\n\n let focusedTile = this.getTileFromCoords(this.Mouse.x, this.Mouse.y);\n if(focusedTile){\n this.Context.globalAlpha = 0.40;\n this.renderTile( 7, focusedTile.column, focusedTile.row );\n this.Context.globalAlpha = 1;\n }\n }", "draw() {\n var c2 = document.getElementById(this.canvasId);\n\n if (c2 instanceof HTMLCanvasElement) {\n var ctx2 = c2.getContext('2d');\n }\n else {\n throw 'c2 is not a canvas';\n }\n\n var c1 = document.createElement('canvas');\n\n if (c1 instanceof HTMLCanvasElement) {\n c1.width = this.size;\n c1.height = this.size;\n var ctx1 = c1.getContext('2d');\n\n if (ctx1 === null || ctx1 === undefined) {\n throw 'ctx1 is null';\n }\n\n var pixelData1 = new Array(this.size * this.size);\n\n var imgData = ctx1.createImageData(this.size, this.size);\n for (var i = 0; i < this.size; i++) {\n for (var j = 0; j < this.size; j++) {\n var k = j * this.size;\n\n var position = this.positions[i + k];\n var pixelData = position.getPixelData();\n pixelData1[i + k] = {};\n\n // Get pixel data for each pass\n // foreach pass\n // px = pass.getPixelData(position, pixelData, i + k);\n $(this.passes).each(function(i : number, pass : WP.WorldPass) {\n pass.getPixelData(position);\n pixelData1[i + k].r = pixelData.r;\n pixelData1[i + k].g = pixelData.g;\n pixelData1[i + k].b = pixelData.b;\n });\n\n }\n }\n console.log(pixelData);\n\n for (var i = 0; i < imgData.data.length; i+= 4) {\n var j = i/4;\n\n var r = pixelData1[j].r;\n if (r != null) {\n imgData.data[i] = r;\n }\n var g = pixelData1[j].g;\n if (g != null) {\n imgData.data[i+1] = g;\n }\n var b = pixelData1[j].b;\n if (b != null) {\n imgData.data[i+2] = b;\n }\n\n imgData.data[i+3] = 255;\n\n }\n ctx1.putImageData(imgData, 0, 0);\n\n //ctx2.mozImageSmoothingEnabled = false;\n //ctx2.webkitImageSmoothingEnabled = false;\n //ctx2.msImageSmoothingEnabled = false;\n //ctx2.imageSmoothingEnabled = false;\n if (ctx2 instanceof CanvasRenderingContext2D) {\n ctx2.drawImage(c1, 0, 0, this.size * 2, this.size * 2);\n }\n else {\n throw 'ctx2 is not a canvas rendering context';\n }\n\n }\n\n }", "function draw() {\n\tvar meshes = io.meshes();\n\tvar fibres = io.fibres();\n\t\n\tgl.enable(gl.DEPTH_TEST);\n\tgl.depthFunc(gl.LEQUAL);\n gl.clearDepth(1);\n \n var peels = mygl.peels();\n var peelFramebuffer = mygl.peelFramebuffer();\n //***************************************************************************************************\n //\n // Pass 1 - draw opaque objects\n //\n //***************************************************************************************************/\n\tvariables.webgl.minorMode = 4;\n\t// set render target to C0\n\tgl.bindFramebuffer( gl.FRAMEBUFFER, peelFramebuffer );\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, peels['C0'], 0);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n if ( scene.getValue( 'showSlices' ) ) {\n\t\tdrawSlices();\n\t}\n\t$.each(meshes, function() {\n\t\tif ( this.type === \"mesh\" && ( this.display || this.display2 ) && this.transparency == 1.0 ) {\n\t\t\tdrawMesh(this);\n\t\t}\n\t});\n\t\n\t$.each(meshes, function() {\n\t\tif ( this.type === \"texmesh\" && ( this.display || this.display2 ) && this.transparency == 1.0 ) {\n\t\t\tdrawTexMesh(this);\n\t\t}\n\t});\n\t\n\t$.each(fibres, function() {\n\t\tif (( this.display || this.display2 ) && this.transparency == 1.0 ) {\n\t\t\tdrawFibers(this);\n\t\t}\n\t});\n\tgl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n\tvariables.webgl.minorMode = 5;\n\t// set render target to D0\n\tgl.bindFramebuffer( gl.FRAMEBUFFER, peelFramebuffer );\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, peels['D0'], 0);\n gl.clearColor(variables.backgroundColor[0], variables.backgroundColor[1], variables.backgroundColor[2], 0.0);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n \n\tif ( scene.getValue( 'showSlices' ) ) {\n\t\tdrawSlices();\n\t}\n\t\n\t$.each(meshes, function() {\n\t\tif ( this.type === \"mesh\" && ( this.display || this.display2 ) && this.transparency == 1.0 ) {\n\t\t\tdrawMeshTransp(this);\n\t\t}\n\t});\n\t\n\t$.each(meshes, function() {\n\t\tif ( this.type === \"texmesh\" && ( this.display || this.display2 ) && this.transparency == 1.0 ) {\n\t\t\tdrawTexMeshTransp(this);\n\t\t}\n\t});\n\t\n\t$.each(fibres, function() {\n\t\tif (( this.display || this.display2 ) && this.transparency == 1.0 ) {\n\t\t\tdrawFibersTransp(this);\n\t\t}\n\t});\n\tgl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\t\n\t//***************************************************************************************************\n //\n // Pass 2\n //\n //***************************************************************************************************/\n\tvariables.webgl.minorMode = 9;\n\t// set render target to C1\n\tgl.bindFramebuffer( gl.FRAMEBUFFER, peelFramebuffer );\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, peels['C1'], 0);\n gl.clearColor(variables.backgroundColor[0], variables.backgroundColor[1], variables.backgroundColor[2], 0.0);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\t\n\t$.each(meshes, function() {\n\t\tif ( this.type === \"mesh\" && ( this.display || this.display2 ) && this.transparency < 1.0 ) {\n\t\t\tdrawMesh(this);\n\t\t}\n\t});\n\n\t$.each(fibres, function() {\n\t\tif (( this.display || this.display2 ) && this.transparency < 1.0 ) {\n\t\t\tdrawFibers(this);\n\t\t}\n\t});\n\tgl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\t\n\tvariables.webgl.minorMode = 6;\n\t// set render target to D1\n\tgl.bindFramebuffer( gl.FRAMEBUFFER, peelFramebuffer );\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, peels['D1'], 0);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\t\n\t$.each(meshes, function() {\n\t\tif ( this.type === \"mesh\" && ( this.display || this.display2 ) && this.transparency < 1.0 ) {\n\t\t\tdrawMeshTransp(this);\n\t\t}\n\t});\n\t$.each(fibres, function() {\n\t\tif (( this.display || this.display2 ) && this.transparency < 1.0 ) {\n\t\t\tdrawFibersTransp(this);\n\t\t}\n\t});\n\tgl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\t\n\t//***************************************************************************************************\n //\n // Pass 3\n //\n //***************************************************************************************************/\n\tvariables.webgl.minorMode = 10;\n\t// set render target to C2\n\tgl.bindFramebuffer( gl.FRAMEBUFFER, peelFramebuffer );\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, peels['C2'], 0);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\t\n\t$.each(meshes, function() {\n\t\tif ( this.type === \"mesh\" && ( this.display || this.display2 ) && this.transparency < 1.0 ) {\n\t\t\tdrawMesh(this);\n\t\t}\n\t});\n\t\n\t$.each(fibres, function() {\n\t\tif (( this.display || this.display2 ) && this.transparency < 1.0 ) {\n\t\t\tdrawFibers(this);\n\t\t}\n\t});\n\tgl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\t\n\tvariables.webgl.minorMode = 7;\n\t// set render target to D2\n\tgl.bindFramebuffer( gl.FRAMEBUFFER, peelFramebuffer );\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, peels['D2'], 0);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\t\n\t$.each(meshes, function() {\n\t\tif ( this.type === \"mesh\" && ( this.display || this.display2 ) && this.transparency < 1.0 ) {\n\t\t\tdrawMeshTransp(this);\n\t\t}\n\t});\n\t$.each(fibres, function() {\n\t\tif (( this.display || this.display2 ) && this.transparency < 1.0 ) {\n\t\t\tdrawFibersTransp(this);\n\t\t}\n\t});\n\tgl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\t\n\t//***************************************************************************************************\n //\n // Pass 4\n //\n //***************************************************************************************************/\n\tvariables.webgl.minorMode = 11;\n\t// set render target to C3\n\tgl.bindFramebuffer( gl.FRAMEBUFFER, peelFramebuffer );\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, peels['C3'], 0);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\t\n\t$.each(meshes, function() {\n\t\tif ( this.type === \"mesh\" && ( this.display || this.display2 ) && this.transparency < 1.0 ) {\n\t\t\tdrawMesh(this);\n\t\t}\n\t});\n\t\n\t\n\t$.each(fibres, function() {\n\t\tif (( this.display || this.display2 ) && this.transparency < 1.0 ) {\n\t\t\tdrawFibers(this);\n\t\t}\n\t});\n\tgl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\t\n\tvariables.webgl.minorMode = 8;\n\t// set render target to D1b\n\tgl.bindFramebuffer( gl.FRAMEBUFFER, peelFramebuffer );\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, peels['D1'], 0);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\t\n\t$.each(meshes, function() {\n\t\tif ( this.type === \"mesh\" && ( this.display || this.display2 ) && this.transparency < 1.0 ) {\n\t\t\tdrawMeshTransp(this);\n\t\t}\n\t});\n\t$.each(fibres, function() {\n\t\tif (( this.display || this.display2 ) && this.transparency < 1.0 ) {\n\t\t\tdrawFibersTransp(this);\n\t\t}\n\t});\n\tgl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\t\n\t//***************************************************************************************************\n //\n // Pass 5\n //\n //***************************************************************************************************/\n\tvariables.webgl.minorMode = 12;\n\t// set render target to C3\n\tgl.bindFramebuffer( gl.FRAMEBUFFER, peelFramebuffer );\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, peels['D2'], 0);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\t\n\t$.each(meshes, function() {\n\t\tif ( this.type === \"mesh\" && ( this.display || this.display2 ) && this.transparency < 1.0 ) {\n\t\t\tdrawMesh(this);\n\t\t}\n\t});\n\t$.each(fibres, function() {\n\t\tif (( this.display || this.display2 ) && this.transparency < 1.0 ) {\n\t\t\tdrawFibers(this);\n\t\t}\n\t});\n\tgl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\t\n\t\n\t//***************************************************************************************************\n //\n // Pass 6 - merge previous results and render on quad\n //\n //***************************************************************************************************/\t\n\tgl.useProgram(shaders['merge']);\n\tgl.enableVertexAttribArray(shaders['merge'].aVertexPosition);\n\t\n\tvar posBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, posBuffer);\n\t\n\tvar vertices = [ -gl.viewportWidth, -10, 0, \n\t gl.viewportWidth, -10, 0,\n\t gl.viewportWidth, gl.viewportHeight, 0,\n\t -gl.viewportWidth0, gl.viewportHeight, 0 ];\n\t\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n\tgl.vertexAttribPointer(shaders['merge'].aVertexPosition, 3, gl.FLOAT, false, 0, 0);\n\tgl.uniform2f(shaders['merge'].uCanvasSize, gl.viewportWidth, gl.viewportHeight);\n\t\n\tgl.activeTexture( gl.TEXTURE2 );\n\tgl.bindTexture( gl.TEXTURE_2D, peels['C0'] );\n\tgl.uniform1i(shaders['merge'].C0, 2);\n\t\n\tgl.activeTexture( gl.TEXTURE6 );\n\tgl.bindTexture( gl.TEXTURE_2D, peels['C1'] );\n\tgl.uniform1i(shaders['merge'].C1, 6);\n\t\n\tgl.activeTexture( gl.TEXTURE7 );\n\tgl.bindTexture( gl.TEXTURE_2D, peels['C2'] );\n\tgl.uniform1i(shaders['merge'].C2, 7);\n\t\n\tgl.activeTexture( gl.TEXTURE8 );\n\tgl.bindTexture( gl.TEXTURE_2D, peels['C3'] );\n\tgl.uniform1i(shaders['merge'].C3, 8);\n\t\n\tgl.activeTexture( gl.TEXTURE5 );\n\tgl.bindTexture( gl.TEXTURE_2D, peels['D2'] );\n\tgl.uniform1i(shaders['merge'].D2, 5);\n\t\n\tvar vertexIndexBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, vertexIndexBuffer);\n\tvar vertexIndices = [ 0, 1, 2, 0, 2, 3 ];\n\tgl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(vertexIndices), gl.STATIC_DRAW);\n\n\tgl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0);\n}", "function Draw_Init(obj)\r\n{\r\n\tvar canvas3d = document.getElementById(\"ID_CANVAS_3D\");\r\n\tcanvas3d.setAttribute(\"hidden\",\"\");\r\n\tCreateCanvas();\r\n if(obj != undefined)\r\n {\r\n BoundBoxs =[];\r\n // ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n //ctx.clearRect(0,0,obj.width,obj.height);\r\n// m_worldPos.x =0;\r\n// m_worldPos.y =0;\r\n// m_mouseOldPos.x = 0;\r\n// m_mouseOldPos.y = 0;\r\n mousewheelevt=(/Firefox/i.test(navigator.userAgent))? \"DOMMouseScroll\" : \"mousewheel\"\r\n \r\n if (canvas.attachEvent) //if IE (and Opera depending on user setting)\r\n {\r\n canvas.attachEvent(\"on\"+mousewheelevt, onmousewheel);\r\n }\r\n else if (canvas.addEventListener) //WC3 browsers\r\n {\r\n canvas.addEventListener(mousewheelevt, onmousewheel, false);\r\n }\r\n \r\n// m_bAutoscale =false;\r\n //캔버스 사이즈 와 svg 사이즈를 비교한다\r\n //큰축을 기준으로 스케일을 만든다.\r\n \r\n// m_wordldScale.x =1;\r\n// m_wordldScale.y=1;\r\n }\r\n}", "function renderCanvas()\n {\n if (drawing)\n {\n context.moveTo(lastPos.x, lastPos.y);\n context.lineTo(mousePos.x, mousePos.y);\n context.stroke();\n lastPos = mousePos;\n }\n }", "function updateDraw() {\n terrain.draw();\n car.draw();\n colorText(mouseX, mouseY, \"(\"+Math.floor(mouseX / 120)+\", \"+Math.floor(mouseY / 80)+\")\", 12, 'white');\n}", "display() {\n strokeWeight(1);\n stroke(200);\n fill(200);\n beginShape();\n for (let i = 0; i < this.surface.length; i++) {\n let v = scaleToPixels(this.surface[i]);\n vertex(v.x, v.y);\n }\n vertex(width, height);\n vertex(0, height);\n endShape(CLOSE);\n }", "draw() {\n\n }", "function render() {\r\n // Dessine une frame\r\n drawFrame();\r\n\r\n // Affiche le niveau\r\n drawLevel();\r\n\r\n //Dessine l'angle de la souris\r\n renderMouseAngle();\r\n\r\n // Dessine le player\r\n drawPlayer();\r\n\r\n }", "function draw() {\r\n \r\n}", "function cw_drawScreen() {\n ctx.clearRect(0,0,canvas.width,canvas.height);\n ctx.save();\n ctx.translate(400, 200);\n ctx.scale(1.5*zoom, -zoom);\n cw_drawFloor(floorBody);\n //cw_drawFloor(boxBody);\n cw_drawCar(carBody);\n ctx.restore();\n}", "function Main() {\r\n \r\n//....................................Set up viewport\r\n canvas1 = document.getElementById(\"canvas1\");\r\n\r\n //disable right click context menu on canvas\r\n canvas1.oncontextmenu=function() {return false;};\r\n\r\n GL = WebGLUtils.setupWebGL(canvas1, { depth: true, preserveDrawingBuffer: true });\r\n camera=new CCamera();\r\n\r\n line=new CLine(GL, canvas1);\r\n sprite=new CSprite(GL);\r\n glsel=new SelectionEngine(GL);\r\n \r\n//.....................................Resizing mechanics\r\n width = $(\"#candiv\").innerWidth();\r\n height = $(\"#candiv\").innerHeight(); \r\n\r\n canvas1.width=width;\r\n canvas1.height=height;\r\n\r\n\r\n $(window).resize(function () {\r\n width = $(\"#candiv\").innerWidth();\r\n height = $(\"#candiv\").innerHeight();\r\n\r\n canvas1.width=width;\r\n canvas1.height=height;\r\n });\r\n\r\n//........................................Mouse interactions\r\n $(canvas1).mousedown(OnMouseDown);\r\n $(canvas1).mouseup(OnMouseUp);\r\n $(canvas1).mousemove(OnMouseMove);\r\n\r\n\r\n//.....................................Set Up Shaders\r\n SetUpShaders(GL);\r\n SetUpUserInterface(GL);\r\n//..........................................Start rendering recurcion\r\n CreateUI();\r\n setInterval(function(){RequestUpdate();},500);\r\n OnFrameUpdate();\r\n\r\n}", "function draw() {\n \n}", "draw() {\n }", "function draw() {\n \n}", "function Renderer(args) {\n\n\n}", "renderSSAO(scene, camera, { clear = true, draw = true } = { clear: true, draw: true }) {\n if (clear) {\n this.ctx.clearRect(0, 0, this.canvasWidth, this.canvasHeight)\n this.imgData = this.ctx.getImageData(0, 0, this.canvasWidth, this.canvasHeight)\n this.data = this.imgData.data\n this.zBuffer.fill(-Infinity)\n }\n\n let { imgData, data } = this\n\n // setup\n let { model, light } = scene\n let { shader } = model\n let { viewportTr } = camera\n\n shader.updateUniform({\n uniM: camera.uniM,\n lightDir: light.dir,\n })\n\n let renderingTime = new Date()\n let coords = []\n\n let width = camera.vW\n let height = camera.vH\n\n // first pass, using depth shader\n\n for (let fi = 0; fi < model.faces.length; fi++) {\n for (let vi = 0; vi < 3; vi++) {\n coords[vi] = shader.vertex(fi, vi)\n }\n triangleWithZBuffer(...coords, shader, this.zBuffer, data, this.canvasWidth, viewportTr, draw)\n }\n\n // second pass\n\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n if (this.zBuffer[(height - 1 - y) * width + x] < -1e5) continue\n\n let bufferIdx = (width - 1 - y) * width + x\n\n let total = 0\n // - 1e-4 for preventing extra round due to the float type\n // from ssloy's\n for (let deg = 0; deg < 2 * Math.PI - 1e-4; deg += Math.PI / 4) {\n let dx = Math.round(Math.cos(deg))\n let dy = Math.round(Math.sin(deg))\n\n let tx = x + dx\n let ty = y + dy\n let tIdx = (width - 1 - ty) * width + tx\n let diffZ = this.zBuffer[tIdx] - this.zBuffer[bufferIdx]\n\n if (diffZ < 0) {\n total += Math.PI / 2\n continue\n }\n let maxElevationAngle = Math.atan(diffZ / Math.sqrt(dx ** 2 + dy ** 2))\n total += Math.PI / 2 - maxElevationAngle\n }\n\n total /= Math.PI * 4\n total *= 255\n\n // total = Math.pow(total, 100) * 255\n data[bufferIdx * 4 + 0] = total\n data[bufferIdx * 4 + 1] = total\n data[bufferIdx * 4 + 2] = total\n }\n }\n\n console.log(\"render: \", new Date() - renderingTime, \"ms\")\n this.ctx.putImageData(imgData, 0, 0)\n }", "draw(){\n push();\n\n beginShape();\n texture(this.texture);\n textureWrap(MIRROR);\n //draw as a rectangle, divide by 2 for width and height\n vertex(this.getX() - (this.w/2.0), this.getY() - (this.h/2.0),CENTER,TOP_EDGE); //bottom right, CCW, Need UV coordinates for texture mapping\n vertex(this.getX() + (this.w/2.0), this.getY() - (this.h/2.0),RIGHT_EDGE,TOP_EDGE); //for some reason this starts on bottom right?\n vertex(this.getX() + (this.w/2.0), this.getY() + (this.h/2.0),RIGHT_EDGE,CENTER);\n vertex(this.getX() - (this.w/2.0), this.getY() + (this.h/2.0),CENTER,CENTER);\n\n endShape(CLOSE);\n\n pop();\n }", "function game_draw() {\r\n /*\r\n\tthis.BackSurfaceDraw();\r\n\r\n\tobCtrl.draw();\r\n\r\n\tthis.FrontSurfaceDraw();\r\n\r\n\treturn;\r\n */\r\n\t //\t work2.putImageTransform(tex_bg, 0, scroll_y - (480 * (1 - scrollsw)), 1, 0, 0, -1);\r\n\r\n\t scenechange = true;\r\n \r\n\t if ((scroll_x != dev.gs.world_x) || (scroll_y != dev.gs.world_y)) {\r\n\r\n\t scenechange = false;\r\n\r\n\t scroll_x = dev.gs.world_x;\r\n\t scroll_y = dev.gs.world_y;\r\n\t }\r\n\t \r\n //scenechange = false;\r\n\t if (!scenechange) {\r\n\r\n\t for (var i in mapChip) {\r\n\t var mc = mapChip[i];\r\n\r\n\t //\t if ((dev.gs.in_view(mc.x, mc.y)) || (dev.gs.in_view(mc.x + mc.w, mc.y)) ||\r\n\t // (dev.gs.in_view(mc.x, mc.y + mc.h)) || (dev.gs.in_view(mc.x + mc.w, mc.y + mc.h))||\r\n\t // (dev.gs.in_view(mc.x + mc.w/2, mc.y + mc.h/2))) {\r\n\r\n\t if (dev.gs.in_stage_range(mc.x, mc.y, mc.w, mc.h)) {\r\n\t mc.view = true;//視界に入っている(当たり判定有効扱いの為のフラグ)\r\n\t var w = dev.gs.worldtoView(mc.x, mc.y);\r\n\r\n\t //work2.putchr(Number(mc.type).toString(16), w.x, w.y);\r\n\r\n\t if (mc.visible) {//表示するマップチップ(当たり判定用で表示しないものもあるため)\r\n\t var wfg = false;\r\n\t if (mc.type == 11) wfg = true;\r\n\t //if (Boolean(tex_bg[mc.no])) {\r\n\t if (Boolean(bgData[mc.no])) {\r\n\t if (wfg) {\r\n\t forgroundBG.putPattern(tex_bg, bgData[mc.no], w.x, w.y - 24, mc.w, mc.h);\r\n\t //work2.putPattern(tex_bg, bgData[mc.no], w.x, w.y, mc.w, mc.h);\r\n\t } else {\r\n\t work2.putPattern(tex_bg, bgData[mc.no], w.x, w.y, mc.w, mc.h);\r\n\t }\r\n\r\n\t //work2.putchr(Number(mc.no).toString(), w.x, w.y);\r\n\t } else {\r\n\t var cl = {}\r\n\t cl.x = w.x;\r\n\t cl.y = w.y;\r\n\t cl.w = mc.w;\r\n\t cl.h = mc.h;\r\n\r\n\t cl.draw = function (device) {\r\n\t device.beginPath();\r\n\r\n\t device.strokeStyle = \"green\";\r\n\t device.lineWidth = 1;\r\n\t device.rect(this.x, this.y, this.w, this.h);\r\n\t device.stroke();\r\n\t }\r\n\r\n\t work2.putFunc(cl);\r\n\t //work2.putchr(Number(mc.no).toString(), w.x, w.y);\r\n\t }\r\n\t }\r\n\t //壁の当たり判定有無確認用のデバックコード\r\n /*\r\n\t if (mc.c) {\r\n\t var cl = {}\r\n\t cl.x = w.x;\r\n\t cl.y = w.y;\r\n\t cl.w = mc.w;\r\n\t cl.h = mc.h;\r\n\r\n\t cl.draw = function (device) {\r\n\t device.beginPath();\r\n\r\n\t device.strokeStyle = \"green\";\r\n\t device.lineWidth = 1;\r\n\t device.rect(this.x, this.y, this.w, this.h);\r\n\t device.stroke();\r\n\t }\r\n\r\n\t work2.putFunc(cl);\r\n\r\n\t }\r\n */\r\n\t // work2.putchr(Number(mc.type).toString(16), w.x, w.y);\r\n\t } else {\r\n\t mc.view = false;\r\n\t }\r\n\t //\t work2.putImage(tex_bg, 0, scroll_y - 480);\r\n\t //\t work2.putImage(tex_bg, 0, scroll_y);\r\n\t }\r\n\r\n\t //obCtrl.drawPoint(forgroundBG, lampf);//Forgroundへ表示\r\n\r\n\t //縮小マップ枠\r\n /*\r\n\t var cl = {}\r\n\t cl.draw = function (device) {\r\n\t device.beginPath();\r\n\t device.fillStyle = \"rgba(0,0,0,0.3)\";\r\n\t device.fillRect(dev.layout.map_x, dev.layout.map_y, 150, 150);\r\n\t }\r\n */\r\n \r\n\t forgroundBG.putFunc(SubmapframeDraw);\r\n\r\n\t obCtrl.drawPoint(forgroundBG, lampf); //Forgroundへ表示\r\n\r\n\t //一番下の行消す(clipすんのがいいかも\r\n /*\r\n\t var cl = {}\r\n\t cl.draw = function (device) {\r\n\t device.beginPath();\r\n\t device.fillStyle = \"rgba(0,0,0,0.5)\";\r\n\t device.fillRect(0, 480 - 36, 640 - 13* 13, 36);\r\n\t }\r\n */\r\n\t forgroundBG.putFunc(ButtomlineBackgroundDraw);\r\n \r\n work2.clear(\"black\");\r\n\t work2.draw();\r\n\t work2.reset();\r\n\r\n\t forgroundBG.clear();\r\n\t forgroundBG.draw();\r\n\t forgroundBG.reset();\r\n }\r\n\r\n //==この↑は背景描画\r\n\t obCtrl.draw();\r\n//\t obCtrl.drawPoint(work);\r\n\r\n\t //== ここから文字表示画面(出来るだけ書き換えを少なくする)\r\n\t //プライオリティ最前面の画面追加したので\r\n\t var scdispview = false;\r\n \r\n\t fdrawcnt++;\r\n\t if ((fdrawcnt % 6) == 0) {\r\n\t fdrawcnt = 0;\r\n\t scdispview = true;\r\n\t }\r\n \r\n\t //var scdispview = true;\r\n\r\n\t if (scdispview) {\r\n\r\n\t //work3.putchr(\"a\", mapsc.flame / 20, mapsc.flame / 20);\r\n\r\n\t //work3.clear();\r\n\t //work3.draw();\r\n\t //work3.reset();\r\n\r\n\t var wtxt = [];\r\n\t /*\r\n\t if (!lampf) {\r\n\t work3.fill(0, 0, work3.cw, work3.ch, \"blue\"); // , \"darkblue\");\r\n\t } else {\r\n\t work3.fill(0, 0, work3.cw, work3.ch); // , \"darkblue\");\r\n\t }\r\n\t */\r\n\r\n\t work3.fill(dev.layout.hiscore_x + 12 * 6, dev.layout.hiscore_y, 12 * 7, 32); // , \"darkblue\");\r\n\r\n\t wt = ehighscore.read(state.Result.highscore);\r\n\t work3.putchr(\"Hi-Sc:\" + wt, dev.layout.hiscore_x, dev.layout.hiscore_y);\r\n\r\n\t wt = escore.read(obCtrl.score);\r\n\t work3.putchr(\"Score:\" + wt, dev.layout.score_x, dev.layout.score_y);\r\n\r\n\t //残機表示\r\n\t var zc = 2 - dead_cnt;\r\n\r\n\t if (zc < 3) {\r\n\t for (var i = 0; i < 2 - dead_cnt; i++) {\r\n\t work3.put(\"Mayura1\", dev.layout.zanki_x + i * 32, dev.layout.zanki_y);\r\n\t }\r\n\t } else {\r\n\t work3.put(\"Mayura1\", dev.layout.zanki_x, dev.layout.zanki_y);\r\n\t work3.putchr(\"x\" + zc, dev.layout.zanki_x + 16, dev.layout.zanki_y);\r\n\t }\r\n\r\n\t //ball表示\r\n\t if (Boolean(obCtrl.item[20])) {\r\n\t var n = obCtrl.item[20];\r\n\t if (n <= 8) {\r\n\t //n = 16;\r\n\r\n\t for (var i = 0; i < n; i++) {\r\n\t work3.put(\"Ball1\",\r\n dev.layout.zanki_x + i * 20 + 288, dev.layout.zanki_y - 8);\r\n\t }\r\n\t } else {\r\n\t work3.put(\"Ball1\",\r\n dev.layout.zanki_x + 288, dev.layout.zanki_y - 8);\r\n\r\n\t work3.putchr8(\"x\" + n, dev.layout.zanki_x + 288 + 10, dev.layout.zanki_y - 12);\r\n\t }\r\n\t }\r\n\r\n\t //取得アイテム表示\r\n\t if (Boolean(obCtrl.itemstack)) {\r\n\r\n\t var wchr = { 20: \"Ball1\", 23: \"BallB1\", 24: \"BallS1\", 25: \"BallL1\" }\r\n\t var witem = [];\r\n\r\n\t for (var i in obCtrl.itemstack) {\r\n\t var w = obCtrl.itemstack[i];\r\n\t witem.push(w);\r\n\t }\r\n\r\n\t work3.putchr8(\"[X]\", dev.layout.zanki_x + 132 - 16, dev.layout.zanki_y - 16);\r\n\t n = witem.length;\r\n\r\n\t if (n >= 18) n = 18;\r\n\t //if (n >= 7) n = 7;\r\n\r\n\t for (var i = 0; i < n; i++) {\r\n\r\n\t if (i == 0) {\r\n\t work3.put(wchr[witem[witem.length - 1 - i]],\r\n dev.layout.zanki_x + i * 20 + 132, dev.layout.zanki_y);\r\n\t //640 - (12 * 12), 479 - 32 + 5);\r\n\t } else {\r\n\t work3.put(wchr[witem[witem.length - 1 - i]],\r\n dev.layout.zanki_x + i * 20 + 136, dev.layout.zanki_y + 8);\r\n\t }\r\n\t }\r\n\r\n\t }\r\n\r\n\t n = 0;\r\n\t if (Boolean(obCtrl.item[22])) {\r\n\t n = obCtrl.item[22];\r\n\t }\r\n\t if (n > 0) work3.put(\"Key\", dev.layout.zanki_x + 64, dev.layout.zanki_y);\r\n\r\n\t var wweapon = [\"Wand\", \"Knife\", \"Axe\", \"Boom\", \"Spear\"];\r\n\r\n\t if (!Boolean(state.Game.player.weapon)) state.Game.player.weapon = 0;\r\n\r\n\t work3.putchr8(\"[Z]\", dev.layout.zanki_x + 96 - 16, dev.layout.zanki_y - 16);\r\n\t work3.put(wweapon[state.Game.player.weapon], dev.layout.zanki_x + 96, dev.layout.zanki_y);\r\n\r\n\t work3.putchr(\"Floor \" + mapsc.stage, dev.layout.stage_x, dev.layout.stage_y);\r\n\r\n\t work3.putchr(\"Time:\" + Math.floor((7200 - mapsc.flame) / 6), dev.layout.time_x, dev.layout.time_y);\r\n\r\n\t //work3.putchr8(\"ITEM\", dev.layout.hp_x , dev.layout.hp_y - 40);\r\n\r\n\t var w_hp = (state.Game.player.hp > 0) ? state.Game.player.hp : 0;\r\n\r\n\t HpbarDraw.hp = w_hp; \r\n HpbarDraw.mhp = state.Game.player.maxhp;\r\n HpbarDraw.br = state.Game.player.barrier;\r\n\t //var cl = { hp: w_hp, mhp: state.Game.player.maxhp, br: state.Game.player.barrier }\r\n /*\r\n\t cl.draw = function (device) {\r\n\t device.beginPath();\r\n\t device.fillStyle = (this.br)?\"skyblue\":\"limegreen\";\r\n\t device.lineWidth = 1;\r\n\t device.fillRect(dev.layout.hp_x + 1, dev.layout.hp_y + 1, this.hp, 14);\r\n\t device.stroke();\r\n\r\n\t device.beginPath();\r\n\t device.strokeStyle = \"white\"; ;\r\n\t device.lineWidth = 1;\r\n\t device.rect(dev.layout.hp_x, dev.layout.hp_y, this.mhp, 15);\r\n\t device.stroke();\r\n\t }\r\n */\r\n\t work3.putFunc(HpbarDraw);\r\n \r\n\t //work3.putchr(w_st, dev.layout.hp_x + 16 - w_st.length * 12, dev.layout.hp_y - 12);\r\n var wst = \"HP:\" + w_hp + \"/\" + state.Game.player.maxhp;\r\n\r\n if (state.Game.player.barrier) {\r\n wst = \"!!SHIELD!!\"; \r\n }\r\n\t work3.putchr8(wst, dev.layout.hp_x + 8, dev.layout.hp_y + 4);\r\n\t }\r\n\r\n if (obCtrl.interrapt && (obCtrl.SIGNAL == 1)) {\r\n work3.putchr(\" == PAUSE ==\", 320 - 50, 200);\r\n work3.putchr(\"Push <Z>key or [Space] \", 320 - 100, 220);\r\n work3.putchr(\" Return game.\", 320 - 50, 240);\r\n work3.putchr(\"Push <Q>key /\", 320 - 100, 260);\r\n work3.putchr(\"Save and Quit.\", 320 - 50, 280); \r\n\r\n } else {\r\n work3.fill(320 - 100, 200, 12 * 24, 20 * 5);\r\n }\r\n\r\n //work.putchr(dev.sound.info() + \".\" + dev.sound.running(), 320 - 50, 260);\r\n \r\n\r\n //debug true の場合以下表示\r\n if (state.Config.debug) {\r\n var wtxt = [];\r\n\r\n\t wtxt.push(\"o:\" + obCtrl.cnt() + \"/\" + obCtrl.num() + \"/\" + obCtrl.nonmove);\r\n\t wtxt.push(\"f:\" + mapsc.flame);\r\n\r\n\t if (obCtrl.interrapt) {\r\n\t wtxt.push(\"interrapt:\" + obCtrl.SIGNAL);\r\n\t } else {\r\n\t wtxt.push(\"running:\" + obCtrl.SIGNAL);\r\n\t }\r\n\r\n\t for (i in obCtrl.item) {\r\n\t wtxt.push(\"item[\" + i + \"]:\" + obCtrl.item[i]);\r\n\t }\r\n /*\r\n\t for (i in obCtrl.combo) {\r\n\t wtxt.push(\"combo[\" + i + \"]:\" + obCtrl.combo[i]);\r\n\t }\r\n\r\n\t for (i in obCtrl.combomax) {\r\n\t wtxt.push(\"combomax[\" + i + \"]:\" + obCtrl.combomax[i]);\r\n\t }\r\n */\r\n\t var n1 = 0;\r\n\t for (i in obCtrl.total) {\r\n\t if (i == 2) n1 = obCtrl.total[i];\r\n\t }\r\n\r\n\t var n2 = 1;\r\n\t for (i in obCtrl.obCount) {\r\n\t if (i == 2) n2 = obCtrl.obCount[i];\r\n\t }\r\n\t //wtxt.push(\"rate:\" + Math.floor((n1 / n2) * 100) + \"par\");\r\n\r\n\t //wtxt.push(\"hidan:\" + obCtrl.hidan);\r\n\r\n\t wtxt.push(\"wx,wy:\" + Math.floor(dev.gs.world_x) + \",\" + Math.floor(dev.gs.world_y));\r\n\r\n\t wtxt.push(\"play:\" + Math.floor(dev.sound.info()) + \".\" + dev.sound.running() );\r\n\r\n\t for (var s in wtxt) {\r\n\t work.putchr8(wtxt[s], dev.layout.status_x, dev.layout.status_y + 8 * s);\r\n\t }\r\n\t }\r\n\r\n\t if (scdispview) {\r\n//\t work3.clear();\r\n\t //\t work3.fill(480, 0, 5, 480, \"blue\");\r\n\t work3.fill(0, 480-48, 640, 48);//, \"darkblue\");\r\n\t work3.draw();\r\n\t work3.reset();\r\n\t }\r\n\r\n\r\n\t //mapdisp = false;\r\n\t if (!mapdisp) {\r\n\r\n\t work3.fill(dev.layout.map_x, dev.layout.map_y, 150, 150);\r\n\r\n\t var cl = {};\r\n\r\n\t cl.mcp = mapChip;\r\n\r\n\t cl.draw = function (device) {\r\n\r\n\t for (var i = 0, loopend = this.mcp.length; i < loopend; i++) {\r\n\r\n\t var mc = this.mcp[i];\r\n\t if ((mc.visible) && ((mc.type == 11) || (mc.type == 12))) {\r\n\t device.beginPath();\r\n\t device.strokeStyle = (mc.type == 12) ? \"orange\" : \"blue\";\r\n\t device.lineWidth = 1;\r\n\t device.rect(dev.layout.map_x + mc.x / 20, dev.layout.map_y + mc.y / 20, 2, 2);\r\n\t device.stroke();\r\n\t }\r\n\t }\r\n\r\n\t }\r\n\t work3.putFunc(cl);\r\n\r\n /*\r\n\t for (var i in mapChip) {\r\n\t var mc = mapChip[i];\r\n\t if ((mc.visible) && ((mc.type == 11) || (mc.type == 12))) {//表示するマップチップ(当たり判定用で表示しないものもあるため)\r\n\r\n\t var cl = {}\r\n\t cl.x = mc.x / 20;\r\n\t cl.y = mc.y / 20;\r\n\t cl.w = 1; //mc.w / 20;\r\n\t cl.h = 1; //mc.h / 20;\r\n\t cl.c = (mc.type == 12) ? \"orange\" : \"blue\";\r\n\r\n\t cl.draw = function (device) {\r\n\t device.beginPath();\r\n\t device.strokeStyle = this.c;\r\n\t device.lineWidth = 1;\r\n\t device.rect(dev.layout.map_x + this.x, dev.layout.map_y + this.y, this.w, this.h);\r\n\t device.stroke();\r\n\t }\r\n\r\n\t work3.putFunc(cl);\r\n\t }\r\n\t }\r\n */\r\n\t mapdisp = true;\r\n\t } \r\n \r\n\r\n\t}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw(){\t\n\trequestAnimationFrame(draw); //allows for maximum use of the hardwares potential\n}", "function render() {\r\n\tgl.clear(gl.COLOR_BUFFER_BIT);\r\n\tgl.drawArrays(gl.TRIANGLES, 0, 9);\r\n}", "function ProceduralRenderer3() { }", "function ProceduralRenderer3() { }", "render() {\n render(offscreenCanvas);\n }", "function renderCanvas2() {\n\n if (drawing) {\n ctx.moveTo(lastPos.x, lastPos.y);\n ctx.lineTo(mousePos.x, mousePos.y);\n ctx.stroke();\n lastPos = mousePos;\n }\n}", "function draw() {\n \n\n \n}", "doDraw(offset) {\n super.doDraw(offset);\n let pp = [this.pos[0] - 64 - offset, this.pos[1] - 128];\n let image = \"gobbo-\";\n if (this.dir == 1){\n image+=\"r\";\n } else {\n image+=\"l\";\n }\n drawImage(Graphics[image], pp);\n \n }", "function draw() {\n \n\tvar red = 0; // Color value defined\n\tvar green = 1;\n\tvar blue = 2;\n\tvar alpha = 3;\n\n\tvar iter = 81;\n\n\tif(os){ // if oscillation is set true by oscillate(), then do oscilation of \n\t\t\t\t\t\t\t\t\t\t// julia set by using sin(angle) to set real c and cos(angle) to set imaginary c.\n\t\tcx =0.7885*cos(angle);\n\t\tcy =0.7785*sin(angle);\n\t\tangle+= 0.04;\n\t}\n\n\tvar zy = 0.0;\n\tvar zx = 0.0;\n\n loadPixels(); \n\n\n // Interate through the window demision. 'width' and 'hieght' are the with and height of our window\n for (var y = 0; y < height; y++) {\n\n for (var x = 0; x < width; x++) {\n\n\t zy = map(y, 0, height, min_i , max_i); // use map() to scale the range so it will be from \n\t\tzx = map(x, 0, width, minReal, maxReal); // minReal to maxReal and min_i to max_i\n\t\t\n\t\tif(!os && !clicked){ // if neither of 'os' or 'clicked' is true, cy and cx (real and imaginary c) will be the scale of zy and zx.\n\t\t\tcy = zy;\n\t\t\tcx = zx;\n\t\t}\n\t\t\n var counter= 0;\n\n\t\t// calculate the mandelbrot / julia set using:\n\t\t// mandelbrot: f(z) = z^2 + c where c is changing\n\t\t// julia: f(z) = z^2 + c where c is constant\n\t\twhile ((zx * zx + (zy * zy) < 16.0) && counter < iter) {\n\n\t\t\tvar zx_temp = zx * zx - zy * zy +cx\n\n\t\t\tzy = 2.0 * zx * zy+cy;\n\t\t\tzx = zx_temp;\n\n\t\t\t++counter;\n\t\t}\n\t\t\n\t var color = 255;\n\n\t\tif(counter !=iter){\n\t\t\tcolor = counter;\n\t\t}\n\n var pix = (x + y * width) * 4;\n\n pixels[pix + red] = sin(color)%255; // set pixels\n pixels[pix + green] = color;\n pixels[pix + blue] = color;\n\n pixels[pix+alpha] = 255;\n }\n }\n\n updatePixels(); \n}", "function renderCanvas() {\n\t\tif (drawing) {\n\t\t\tctx.moveTo(lastPos.x, lastPos.y);\n\t\t\tctx.lineTo(mousePos.x, mousePos.y);\n\t\t\tctx.stroke();\n\t\t\tlastPos = mousePos;\n\t\t}\n\t}", "function renderCanvas() {\n\t\tif (drawing) {\n\t\t\tctx.moveTo(lastPos.x, lastPos.y);\n\t\t\tctx.lineTo(mousePos.x, mousePos.y);\n\t\t\tctx.stroke();\n\t\t\tlastPos = mousePos;\n\t\t}\n\t}", "function renderCanvas() {\n\t\tif (drawing) {\n\t\t\tctx.moveTo(lastPos.x, lastPos.y);\n\t\t\tctx.lineTo(mousePos.x, mousePos.y);\n\t\t\tctx.stroke();\n\t\t\tlastPos = mousePos;\n\t\t}\n\t}", "function renderCanvas() {\n\t\tif (drawing) {\n\t\t\tctx.moveTo(lastPos.x, lastPos.y);\n\t\t\tctx.lineTo(mousePos.x, mousePos.y);\n\t\t\tctx.stroke();\n\t\t\tlastPos = mousePos;\n\t\t}\n\t}", "function ObjectOrientedRenderer3(){}", "function render()\n{\n requestAnimationFrame(render);\n\n\tctx.clearRect(0, 0, width, height);\n drawTiles();\n\tgui.draw(ctx, mouse);\n}", "function renderCanvas() {\n if (drawing) {\n ctx.moveTo(lastPos.x, lastPos.y);\n ctx.lineTo(mousePos.x, mousePos.y);\n ctx.stroke();\n lastPos = mousePos;\n }\n }", "function ObjectOrientedRenderer3() {}", "function ObjectOrientedRenderer3() {}", "function ObjectOrientedRenderer3() {}", "function render() {\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n if (params.polygonOffset) {\n gl.polygonOffset(1, 1);\n }\n gl.uniform3fv(uColor, [1.0, 0.0, 0.0]);\n gl.drawArrays(gl.TRIANGLES, 0, 3);\n\n\n if (params.polygonOffset) {\n gl.polygonOffset(0, 1);\n }\n gl.uniform3fv(uColor, [0.0, 0.0, 1.0]);\n gl.drawArrays(gl.TRIANGLES, 3, 3);\n}", "render(webGLRenderer) {}", "render() {\n this.context.drawImage(this.buffer.canvas, 0, 0, this.buffer.canvas.width, this.buffer.canvas.height, 0, 0, this.context.canvas.width, this.context.canvas.height);\n }", "function ProceduralRenderer3() {}", "function ProceduralRenderer3() {}", "function ProceduralRenderer3() {}", "function draw()\n{\n \n}", "function render_user_interface()\n{\n mycanvas_context.drawImage(m_canvas, 0, 0);\n}", "static draw3D()\n {\n RPM.gameStack.draw3D();\n }", "function draw(time){\r\n\tif(!use2D){\r\n\t\tctx.setBuffer(null);\r\n\t\tctx.viewport(0, 0, ctx.viewportWidth, ctx.viewportHeight);\r\n\t\tvar alpha = clearColor[3];\r\n\t\tctx.clearColor(clearColor[0]*alpha, clearColor[1]*alpha, clearColor[2]*alpha, alpha);\r\n\t\tctx.clear(ctx.COLOR_BUFFER_BIT | ctx.DEPTH_BUFFER_BIT);\r\n\t\t\r\n\t\tctx.setBuffer(colorBuffer);\r\n\t\tctx.viewport(0, 0, ctx.viewportWidth, ctx.viewportHeight);\r\n\t\t//ctx.clearColor(clearColor[0]*alpha, clearColor[1]*alpha, clearColor[2]*alpha, alpha);\r\n\t\tctx.clearColor(0,0,0,0);\r\n\t\tctx.clear(ctx.COLOR_BUFFER_BIT | ctx.DEPTH_BUFFER_BIT);\r\n\t}else{\r\n\t\tctx.clearRect(0,0,canvas.width,canvas.height);\r\n\t\tctx.fillStyle = rgb(clearColor);\r\n\t\tctx.globalAlpha = clearColor[3];\r\n\t\tctx.fillRect(0,0,canvas.width,canvas.height);\r\n\t}\r\n\t\r\n\tmat4.ortho(pMatrix, -0, 1*aspectRatio, -1, 0, -1, 1);\r\n\tmat4.identity(mvMatrix);\r\n\t\r\n\tif(useStates){\r\n\t\tStates.draw(ctx);\r\n\t}\r\n\t\r\n\t//Draw the stateless world\r\n\tworld.transform(ctx);\r\n\tworld.draw(ctx);\r\n\tworld.unTransform(ctx);\r\n\t\r\n\tif(!use2D){\r\n\t\tctx.clearColor(0, 0, 0, 0);\r\n\t\teffects.apply(ctx, colorBuffer);\r\n\t\t\r\n\t\tctx.useProgram(shaderProgram);\r\n\t\t\r\n\t\tctx.bindTexTo(colorBuffer.texture, shaderProgram.samplerUniform);\r\n\t\t\r\n\t\tctx.uniform1f(shaderProgram.alpha, 1.0);\r\n\t\t\r\n\t\tctx.setBuffer(null);\r\n\t\t\r\n\t\tctx.drawScreenBuffer(shaderProgram);\r\n\t}\r\n\t\r\n\tif(showConsole){\r\n\t\tif(!use2D){\r\n\t\t\tbrineConsole = document.getElementById(\"console\");\r\n\t\t\tif(brineConsole != null && brineConsole != undefined){\r\n\t\t\t\tvar text = \"\";\r\n\t\t\t\tfor(var node = log.head; node !== null; node = node.link){\r\n\t\t\t\t\ttext = node.item+\"<br/>\"+text;\r\n\t\t\t\t}\r\n\t\t\t\tbrineConsole.innerHTML = text;\r\n\t\t\t}\r\n\t\t\tbrineConsole.style.visibility = \"visible\";\r\n\t\t}else{\r\n\t\t\tctx.fillStyle = \"#ffffff\";\r\n\t\t\tctx.globalAlpha = 0.25;\r\n\t\t\tctx.fillRect(0,0,canvas.width,canvas.height);\r\n\t\t\tctx.globalAlpha = 1.0;\r\n\t\t\tctx.fillStyle = \"#000000\";\r\n\t\t\t//ctx.shadowBlur = 3;\r\n\t\t\tctx.shadowColor = \"#ffffff\";\r\n\t\t\tvar lineHeight = 18;\r\n\t\t\tvar lineNumber = 0;\r\n\t\t\tfor(var node = log.head; node !== null; node = node.link){\r\n\t\t\t\tvar line = node.item;\r\n\t\t\t\t//ctx.font=\"16px Arial\";\r\n\t\t\t\t//ctx.strokeText(line, 5, canvas.height-(log.length-lineNumber)*12);\r\n\t\t\t\tctx.font = lineHeight+\"px Arial\";\r\n\t\t\t\tctx.fillText(line, 5, canvas.height-(log.length-lineNumber)*lineHeight);\r\n\t\t\t\tlineNumber++;\r\n\t\t\t}\r\n\t\t\tctx.shadowBlur = 0;\r\n\t\t}\r\n\t}else{\r\n\t\tif(brineConsole != null && brineConsole != undefined && !use2D){\r\n\t\t\tbrineConsole.innerHTML = \"\";\r\n\t\t\tbrineConsole.style.visibility = \"hidden\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tvar timeDiff = time-oldDrawTime;\r\n\tbrineFPS = Math.round((1000/timeDiff)*10)/10;\r\n\tfpsCounter.html = \"FPS: \"+brineFPS;\r\n\toldDrawTime = time;\r\n}", "function render() {\n\n var baseSegment = findSegment(position);\n var basePercent = Util.percentRemaining(position, segmentLength);\n var playerSegment = findSegment(position+playerZ);\n var playerPercent = Util.percentRemaining(position+playerZ, segmentLength);\n var playerY = Util.interpolate(playerSegment.p1.world.y, playerSegment.p2.world.y, playerPercent);\n var maxy = height;\n\n var x = 0;\n var dx = - (baseSegment.curve * basePercent);\n\n // Clear the canvas\n ctx.clearRect(0, 0, width, height);\n\n // Order the background layers\n if (currentBackground == 0) {\n // Build the list of positions in the image to extract the appropriate background\n // Depending on the current background, load as current the night or day version\n background_pos_cur = [BACKGROUND.SKY, BACKGROUND.HILLS, BACKGROUND.TREES];\n background_pos_next = [BACKGROUND.SKY2, BACKGROUND.HILLS2, BACKGROUND.TREES2];\n } else {\n background_pos_cur = [BACKGROUND.SKY2, BACKGROUND.HILLS2, BACKGROUND.TREES2];\n background_pos_next = [BACKGROUND.SKY, BACKGROUND.HILLS, BACKGROUND.TREES];\n }\n // Draw the background layers\n if (!changeBackgroundFlag) {\n // No switching, we draw one set of backgrounds\n Render.background(ctx, background, width, height, background_pos_cur[0], skyOffset, resolution * skySpeed * playerY, 1.0);\n Render.background(ctx, background, width, height, background_pos_cur[1], hillOffset, resolution * hillSpeed * playerY, 1.0);\n Render.background(ctx, background, width, height, background_pos_cur[2], treeOffset, resolution * treeSpeed * playerY, 1.0);\n } else {\n // else we are in the process of switching, do a progressive blending\n // continue the blending\n changeBackgroundCurrentAlpha += 0.01; // increase the alpha for one, and decrease for the next background set\n Render.background(ctx, background, width, height, background_pos_cur[0], skyOffset, resolution * skySpeed * playerY, 1.0-changeBackgroundCurrentAlpha);\n Render.background(ctx, background, width, height, background_pos_cur[1], hillOffset, resolution * hillSpeed * playerY, 1.0-changeBackgroundCurrentAlpha);\n Render.background(ctx, background, width, height, background_pos_cur[2], treeOffset, resolution * treeSpeed * playerY, 1.0-changeBackgroundCurrentAlpha);\n Render.background(ctx, background, width, height, background_pos_next[0], skyOffset, resolution * skySpeed * playerY, changeBackgroundCurrentAlpha);\n Render.background(ctx, background, width, height, background_pos_next[1], hillOffset, resolution * hillSpeed * playerY, changeBackgroundCurrentAlpha);\n Render.background(ctx, background, width, height, background_pos_next[2], treeOffset, resolution * treeSpeed * playerY, changeBackgroundCurrentAlpha);\n if (changeBackgroundCurrentAlpha >= 1.0) {\n // blending is done, disable the flags and reinit all related vars\n // Note: it is important to still do the drawing (and not put it in an if statement) because else the last drawing won't be done, there will be no background for a split-second and this will produce a flickering effect\n currentBackground = (currentBackground + 1) % 2\n changeBackgroundCurrentAlpha = 0.0;\n changeBackgroundFlag = false;\n }\n }\n\n var n, i, segment, car, sprite, spriteScale, spriteX, spriteY;\n\n for(n = 0 ; n < drawDistance ; n++) {\n\n segment = segments[(baseSegment.index + n) % segments.length];\n segment.looped = segment.index < baseSegment.index;\n segment.fog = Util.exponentialFog(n/drawDistance, fogDensity);\n segment.clip = maxy;\n\n Util.project(segment.p1, (playerX * roadWidth) - x, playerY + cameraHeight, position - (segment.looped ? trackLength : 0), cameraDepth, width, height, roadWidth);\n Util.project(segment.p2, (playerX * roadWidth) - x - dx, playerY + cameraHeight, position - (segment.looped ? trackLength : 0), cameraDepth, width, height, roadWidth);\n\n x = x + dx;\n dx = dx + segment.curve;\n\n if ((segment.p1.camera.z <= cameraDepth) || // behind us\n (segment.p2.screen.y >= segment.p1.screen.y) || // back face cull\n (segment.p2.screen.y >= maxy)) // clip by (already rendered) hill\n continue;\n\n Render.segment(ctx, width, lanes,\n segment.p1.screen.x,\n segment.p1.screen.y,\n segment.p1.screen.w,\n segment.p2.screen.x,\n segment.p2.screen.y,\n segment.p2.screen.w,\n segment.fog,\n segment.color);\n\n maxy = segment.p1.screen.y;\n }\n\n for(n = (drawDistance-1) ; n > 0 ; n--) {\n segment = segments[(baseSegment.index + n) % segments.length];\n\n for(i = 0 ; i < segment.cars.length ; i++) {\n car = segment.cars[i];\n sprite = car.sprite;\n spriteScale = Util.interpolate(segment.p1.screen.scale, segment.p2.screen.scale, car.percent);\n spriteX = Util.interpolate(segment.p1.screen.x, segment.p2.screen.x, car.percent) + (spriteScale * car.offset * roadWidth * width/2);\n spriteY = Util.interpolate(segment.p1.screen.y, segment.p2.screen.y, car.percent);\n Render.sprite(ctx, width, height, resolution, roadWidth, sprites, car.sprite, spriteScale, spriteX, spriteY, -0.5, -1, segment.clip);\n }\n\n for(i = 0 ; i < segment.sprites.length ; i++) {\n sprite = segment.sprites[i];\n spriteScale = segment.p1.screen.scale;\n spriteX = segment.p1.screen.x + (spriteScale * sprite.offset * roadWidth * width/2);\n spriteY = segment.p1.screen.y;\n Render.sprite(ctx, width, height, resolution, roadWidth, sprites, sprite.source, spriteScale, spriteX, spriteY, (sprite.offset < 0 ? -1 : 0), -1, segment.clip);\n }\n\n if (segment == playerSegment) {\n Render.player(ctx, width, height, resolution, roadWidth, sprites, speed/maxSpeed,\n cameraDepth/playerZ,\n width/2,\n (height/2) - (cameraDepth/playerZ * Util.interpolate(playerSegment.p1.camera.y, playerSegment.p2.camera.y, playerPercent) * height/2),\n speed * (keyLeft ? -1 : keyRight ? 1 : 0),\n playerSegment.p2.world.y - playerSegment.p1.world.y);\n }\n }\n\t\t\t\n // start horizon tilt\n if (enableTilt) {\n rotation=0;\n if (baseSegment.curve==0) {\n rotation=-currentRotation;\n currentRotation=0;\n } else {\n newrot = Math.round(baseSegment.curve*speed/maxSpeed*100)/100;\n rotation=newrot - currentRotation ;\n currentRotation = newrot ;\n }\n if (rotation!=0) {\n //ctx.save(); // doesn't help with moire problem\n ctx.translate(canvas.width/2,canvas.height/2);\n ctx.rotate(-rotation*(Math.PI/90));\n ctx.translate(-canvas.width/2,-canvas.height/2);\n //ctx.restore();\n }\n }\n\n // Draw \"Game Over\" screen\n if (gameOverFlag) {\n ctx.font = \"3em Arial\";\n ctx.fillStyle = \"magenta\";\n ctx.textAlign = \"center\";\n ctx.fillText(\"GAME OVER\", canvas.width/2, canvas.height/2);\n ctx.fillText(\"(refresh to restart)\", canvas.width/2, canvas.height/1.5);\n }\n }", "function render () {\n\n\t\tfunction pushMatrix (fn) {\n\t\t\tp.push();\n\t\t\tfn();\n\t\t\tp.pop();\n\t\t}\n\n\t\t// Draw Horizontal Lines\n\t\tpushMatrix(function () {\n\t\t\tp.strokeCap(p.ROUND);\n\t\t\tp.stroke(121, 192, 242);\t\t\t\t// Light Blue\n\t\t\tp.translate(p.width/2, p.height/2);\t\t// Translate to center\n\n\t\t\t// Set strokeweight to decrease proportionally to the stretch factor\n\t\t\tvar base_stroke_weight = 2;\n\t\t\tvar stroke_weight = base_stroke_weight - (a_l_de.value * base_stroke_weight);\n\t\t\tp.strokeWeight(stroke_weight);\n\n\t\t\tvar spacing = 60;\t\t\t\t\t\t// Set space around Es\n\t\t\t// Mult by -1 for left line\n\t\t\tvar displacement_start = a_l_ds.value * (p.width / 2) + spacing;\n\t\t\tvar displacement_end = a_l_de.value * (p.width / 2) + spacing;\n\n\t\t\tp.line(-displacement_end, 0, -displacement_start, 0);\t\t// Left Line\n\t\t\tp.line(displacement_end, 0, displacement_start, 0);\t\t// Right Line\n\t\t});\n\n\t\t// Assemble Logo!\n\n\t\t// Rotate E\n\t\tpushMatrix(function () {\n\n\t\t\tp.tint(255, 255); // Opacity (255)\n\t\t\t\n\t\t\tp.translate(p.width / 2, p.height / 2);\n\t\t\tp.rotate(p.radians(a_ed_r.value));\t\t// All rotations must occur here!!!\n\t\t\tp.scale(0.75, 0.75);\n\n\t\t\t// For Dots\n\t\t\tpushMatrix(function () {\n\n\t\t\t\tp.translate(-41.25,-42.65); \t\t// Center offset\n\t\t\t\tp.scale(0.15,0.15);\n\n\t\t\t\t// Polar Coordinates\n\t\t\t\tvar r = a_d_d.value;\t\t\t\t// Origin Offset \t{start: 300, end: 265}\n\t\t\t\tvar angle = p.radians(a_d_r.value);\t\t// Angle Offset\t\t{start: 0, end: 77}\n\t\t\t\tvar x = p.cos(angle) * r;\t\t\t\t// Multiply r * -1 for other Dot\n\t\t\t\tvar y = p.sin(angle) * r;\n\n\t\t\t\t// Top Dot\n\t\t\t\tpushMatrix(function () {\n\t\t\t\t\tp.scale(1, 1);\n\t\t\t\t\t\n\t\t\t\t\tp.translate(x,y);\n\t\t\t\t\tp.translate(276,283); \t\t// Center on Es\n\t\t\t\t\tp.scale(a_d_s.value, a_d_s.value); \t// Each scale <-- Parametric\n\t\t\t\t\tp.image(dot, -50, -50); \t// Center around origin\n\t\t\t\t});\n\n\t\t\t\t// Bottom Dot\n\t\t\t\tpushMatrix(function () {\n\t\t\t\t\tp.scale(1, 1);\n\t\t\t\t\t\n\t\t\t\t\tp.translate(-x,-y);\n\t\t\t\t\tp.translate(276, 283); \t\t// Center on Es, experimentally determined\n\t\t\t\t\tp.scale(a_d_s.value, a_d_s.value); \t// Each scale <-- Parametric\n\t\t\t\t\tp.image(dot2, -50, -50); \t// Center around origin\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t// For Es\n\t\t\tpushMatrix(function () {\n\t\t\t\tp.scale(a_e_s.value, a_e_s.value); \t// Global scale\n\t\t\t\tp.translate(-41.25,-42.65); \t\t// Center offset, experimentally determined\n\t\t\t\tp.scale(0.15,0.15);\n\t\t\t\t\n\t\t\t\t// Bottom E\n\t\t\t\tp.image(E, 100, 100);\n\n\t\t\t\t// Top E\n\t\t\t\tpushMatrix(function () {\n\t\t\t\t\tp.translate(200, 0);\n\t\t\t\t\tp.image(E2, 0, 0);\n\t\t\t\t});\n\t\t\t});\n\n\t\t});\n\n\t\tpushMatrix(function () {\n\t\t\tp.fill(255);\n\t\t\tp.noStroke();\n\t\t\tp.translate(p.width/2, p.height/2);\n\t\t});\n\n\t\tif (global_animator.value >= 1) {\n\t\t\tp.noLoop();\n\t\t}\n\t}", "renderScene(scene) {\n let flatScene = this.projectScene(scene)\n\n let polygonList = []\n flatScene.addToList(polygonList)\n //polygonList.sort((a, b) => (a === b)? 0 : a? -1 : 1)\n polygonList.sort(function(a, b) {\n if(a.getAverageDepth() < b.getAverageDepth()) {\n return 1\n } else if(a.getAverageDepth() > b.getAverageDepth()) {\n return -1\n } else if(a.justOutline && !b.justOutline) {//Both are same depth, sort by outline or not\n return -1\n } else return 1\n })\n // polygonList.sort((a,b) => (a.getAverageDepth() < b.getAverageDepth()) ? 1 : -1 || (a.justOutline === b.justOutline)? 0 : a.justOutline? 1 : -1)\n \n let context = this.canvas.getContext(\"2d\")\n \n context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n //Clear context first? \n for(let i = 0; i < polygonList.length; i++) {\n let polygon = polygonList[i] \n polygon.render(context)\n }\n }", "function draw() {\n}", "function draw() {\n}", "function draw() {\n}", "function draw() {\n}", "function draw() {\n}", "function setColors2(gl) {\n\n gl.bufferData(\n gl.ARRAY_BUFFER,\n new Uint8Array([\n // left column front\n 200, 70, 120,\n 200, 70, 120,\n 200, 70, 120,\n 200, 70, 120,\n 200, 70, 120,\n 200, 70, 120,\n\n // top rung front\n 200, 70, 120,\n 200, 70, 120,\n 200, 70, 120,\n 200, 70, 120,\n 200, 70, 120,\n 200, 70, 120,\n\n // middle rung front\n 200, 70, 120,\n 200, 70, 120,\n 200, 70, 120,\n 200, 70, 120,\n 200, 70, 120,\n 200, 70, 120,\n\n // left column back\n 80, 70, 200,\n 80, 70, 200,\n 80, 70, 200,\n 80, 70, 200,\n 80, 70, 200,\n 80, 70, 200,\n\n // top rung back\n 80, 70, 200,\n 80, 70, 200,\n 80, 70, 200,\n 80, 70, 200,\n 80, 70, 200,\n 80, 70, 200,\n\n // middle rung back\n 80, 70, 200,\n 80, 70, 200,\n 80, 70, 200,\n 80, 70, 200,\n 80, 70, 200,\n 80, 70, 200,\n\n // top\n 70, 200, 210,\n 70, 200, 210,\n 70, 200, 210,\n 70, 200, 210,\n 70, 200, 210,\n 70, 200, 210,\n\n // top rung right\n 200, 200, 70,\n 200, 200, 70,\n 200, 200, 70,\n 200, 200, 70,\n 200, 200, 70,\n 200, 200, 70,\n\n // under top rung\n 210, 100, 70,\n 210, 100, 70,\n 210, 100, 70,\n 210, 100, 70,\n 210, 100, 70,\n 210, 100, 70,\n\n // between top rung and middle\n 210, 160, 70,\n 210, 160, 70,\n 210, 160, 70,\n 210, 160, 70,\n 210, 160, 70,\n 210, 160, 70,\n\n // top of middle rung\n 70, 180, 210,\n 70, 180, 210,\n 70, 180, 210,\n 70, 180, 210,\n 70, 180, 210,\n 70, 180, 210,\n\n // right of middle rung\n 100, 70, 210,\n 100, 70, 210,\n 100, 70, 210,\n 100, 70, 210,\n 100, 70, 210,\n 100, 70, 210,\n\n // bottom of middle rung.\n 76, 210, 100,\n 76, 210, 100,\n 76, 210, 100,\n 76, 210, 100,\n 76, 210, 100,\n 76, 210, 100,\n\n // right of bottom\n 140, 210, 80,\n 140, 210, 80,\n 140, 210, 80,\n 140, 210, 80,\n 140, 210, 80,\n 140, 210, 80,\n\n // bottom\n 90, 130, 110,\n 90, 130, 110,\n 90, 130, 110,\n 90, 130, 110,\n 90, 130, 110,\n 90, 130, 110,\n\n // left side\n 160, 160, 220,\n 160, 160, 220,\n 160, 160, 220,\n 160, 160, 220,\n 160, 160, 220,\n 160, 160, 220]),\n gl.STATIC_DRAW);\n}" ]
[ "0.6581787", "0.6546497", "0.65223056", "0.65223056", "0.65223056", "0.6495967", "0.64545876", "0.6426752", "0.64223933", "0.6346952", "0.6334454", "0.63129914", "0.6310721", "0.6300453", "0.6299124", "0.62815106", "0.62755704", "0.62755704", "0.6267502", "0.6267502", "0.6267502", "0.6267502", "0.62629294", "0.6233807", "0.62335396", "0.62298465", "0.6216389", "0.62061846", "0.6201504", "0.61799175", "0.6179668", "0.6165365", "0.6158964", "0.61445457", "0.61424714", "0.6127025", "0.61256444", "0.6118225", "0.61164904", "0.6115335", "0.61134773", "0.61113036", "0.61104023", "0.61097777", "0.6107971", "0.61034346", "0.6101735", "0.60983074", "0.6096802", "0.60898757", "0.6076281", "0.60756814", "0.60722107", "0.60722107", "0.60722107", "0.60722107", "0.60722107", "0.60722107", "0.60722107", "0.60722107", "0.60722107", "0.60722107", "0.60722107", "0.60711175", "0.6068995", "0.6064662", "0.6064662", "0.60615456", "0.6060356", "0.60473454", "0.6046173", "0.6043566", "0.60326874", "0.60326874", "0.60326874", "0.60326874", "0.60311836", "0.6029495", "0.6025198", "0.6022123", "0.6022123", "0.6022123", "0.6018935", "0.6010364", "0.6003851", "0.599632", "0.599632", "0.599632", "0.5992413", "0.59884113", "0.59772646", "0.59648156", "0.5963048", "0.5956187", "0.59537864", "0.5953202", "0.5953202", "0.5953202", "0.5953202", "0.5953202", "0.595319" ]
0.0
-1
! vuerouter v3.5.3 (c) 2021 Evan You
function i(t,e){for(var n in e)t[n]=e[n];return t}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "function jj(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function version(){ return \"0.13.0\" }", "function TM(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function BO(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "private internal function m248() {}", "function Es(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Uk(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function yh(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"graticule.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Qw(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function iP(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "vampireWithName(name) {\n \n }", "function fyv(){\n \n }", "function Bv(e){let{basename:t,children:n,window:r}=e,l=X.exports.useRef();l.current==null&&(l.current=gv({window:r}));let o=l.current,[i,u]=X.exports.useState({action:o.action,location:o.location});return X.exports.useLayoutEffect(()=>o.listen(u),[o]),X.exports.createElement(Fv,{basename:t,children:n,location:i.location,navigationType:i.action,navigator:o})}", "function cO(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function ow(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Wx(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Ak(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "function vT(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "upgrade() {}", "function PD(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Hr(e,t){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function dp(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Rb(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Ek(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "transient private internal function m185() {}", "function JV(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function jx(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "transient final protected internal function m174() {}", "function vI(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"style.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function hA(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function SigV4Utils() { }", "function __vue_normalize__(a,b,c,d,e){var f=(\"function\"==typeof c?c.options:c)||{};// For security concerns, we use only base name in production mode.\nreturn f.__file=\"/Users/hadefication/Packages/vue-chartisan/src/components/Pie.vue\",f.render||(f.render=a.render,f.staticRenderFns=a.staticRenderFns,f._compiled=!0,e&&(f.functional=!0)),f._scopeId=d,f}", "function $S(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function VI(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "protected internal function m252() {}", "updated() {}", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }" ]
[ "0.5826432", "0.5783646", "0.5761382", "0.5714104", "0.56972057", "0.5668579", "0.56480795", "0.559433", "0.5578421", "0.5549824", "0.55136424", "0.5491717", "0.54752815", "0.54628813", "0.5451074", "0.539044", "0.53702855", "0.53666264", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.5360071", "0.53533614", "0.53477776", "0.53361845", "0.5333446", "0.5326447", "0.53227127", "0.5319553", "0.5298129", "0.5297441", "0.5275164", "0.5256549", "0.5255813", "0.5252842", "0.5248856", "0.52219296", "0.52168494", "0.520677", "0.5204768", "0.5170155", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982", "0.5141982" ]
0.0
-1
interface and a POSIXlike interface. (The POSIXlike calls are implemented on top of the ncurseslike calls, not the other way round.)
function VT100(wd, ht, scr_id) { var r; var c; var scr = document.getElementById(scr_id); this.wd_ = wd; this.ht_ = ht; this.scrolled_ = 0; this.bkgd_ = { mode: VT100.A_NORMAL, fg: VT100.COLOR_WHITE, bg: VT100.COLOR_BLACK }; this.c_attr_ = { mode: VT100.A_NORMAL, fg: VT100.COLOR_WHITE, bg: VT100.COLOR_BLACK }; this.text_ = new Array(ht); this.attr_ = new Array(ht); for (r = 0; r < ht; ++r) { this.text_[r] = new Array(wd); this.attr_[r] = new Array(wd); } this.scr_ = scr; this.cursor_vis_ = true; this.grab_events_ = false; this.getch_isr_ = undefined; this.key_buf_ = []; this.echo_ = true; this.esc_state_ = 0; // Internal debug setting. this.debug_ = 0; this.clear(); this.refresh(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function system() { }", "function Terminal () {}", "function rc(){}", "function os_func() {\n this.execCommand = function (cmd, callback) {\n exec(cmd, (error, stdout, stderr) => {\n if (error) {\n console.error(`exec error: ${error}`);\n return;\n }\n\n callback(stdout);\n });\n };\n }", "_bootstrap() {\n // This code executes in the jsdom global scope\n this.term = new Terminal({\n cols: this.width - this.iwidth,\n rows: this.height - this.iheight,\n scrollback: this.options.scrollback !== \"none\" ?\n this.options.scrollback : this.height - this.iheight,\n });\n this.term._core.cursorState = 1;\n\n /* monkey-patch XTerm to prevent it from effectively rendering\n anything to the Virtual DOM, as we just grab its character buffer.\n The alternative would be to listen on the XTerm \"refresh\" event,\n but this way XTerm would uselessly render the DOM elements. */\n this.term._core.refresh = (start, end) => {\n /* enforce a new screen rendering,\n which in turn will call our render() method, too */\n this.screen.render()\n }\n\n this.term._core.viewport = {\n syncScrollArea: () => {},\n };\n\n /* monkey-patch XTerm to prevent any key handling */\n this.term._core.keyDown = () => { }\n this.term._core.keyPress = () => { }\n this.term.focus();\n\n /* pass-through title changes by application */\n this.term.on(\"title\", (title) => {\n this.title = title\n this.emit(\"title\", title)\n })\n\n /* helper function to determine mouse inputs */\n const _isMouse = (buf) => {\n /* mouse event determination:\n borrowed from original Blessed Terminal widget\n Copyright (c) 2013-2015 Christopher Jeffrey et al. */\n let s = buf\n if (Buffer.isBuffer(s)) {\n if (s[0] > 127 && s[1] === undefined) {\n s[0] -= 128\n s = \"\\x1b\" + s.toString(\"utf-8\")\n }\n else\n s = s.toString(\"utf-8\")\n }\n return (buf[0] === 0x1b && buf[1] === 0x5b && buf[2] === 0x4d)\n || /^\\x1b\\[M([\\x00\\u0020-\\uffff]{3})/.test(s)\n || /^\\x1b\\[(\\d+;\\d+;\\d+)M/.test(s)\n || /^\\x1b\\[<(\\d+;\\d+;\\d+)([mM])/.test(s)\n || /^\\x1b\\[<(\\d+;\\d+;\\d+;\\d+)&w/.test(s)\n || /^\\x1b\\[24([0135])~\\[(\\d+),(\\d+)\\]\\r/.test(s)\n || /^\\x1b\\[(O|I)/.test(s)\n }\n\n /* pass raw keyboard input from Blessed to XTerm */\n this.skipInputDataOnce = false;\n this.skipInputDataAlways = false;\n this.screen.program.input.on(\"data\", this._onScreenEventInputData = (data) => {\n /* only in case we are focused and not in scrolling mode */\n if (this.screen.focused !== this || this.scrolling)\n return;\n if (this.skipInputDataAlways)\n return;\n if (this.skipInputDataOnce) {\n this.skipInputDataOnce = false;\n return;\n }\n if (!_isMouse(data))\n this.handler(data);\n })\n\n /* capture cooked keyboard input from Blessed (locally) */\n this.on(\"keypress\", this._onWidgetEventKeypress = (ch, key) => {\n /* handle scrolling keys */\n if (!this.scrolling\n && this.options.controKey !== \"none\"\n && key.full === this.options.controlKey)\n this._scrollingStart()\n else if (this.scrolling) {\n if (key.full === this.options.controlKey\n || key.full.match(/^(?:escape|return|space)$/)) {\n this._scrollingEnd()\n this.skipInputDataOnce = true\n }\n else if (key.full === \"up\") this.scroll(-1)\n else if (key.full === \"down\") this.scroll(+1)\n else if (key.full === \"pageup\") this.scroll(-(this.height - 2))\n else if (key.full === \"pagedown\") this.scroll(+(this.height - 2))\n }\n })\n\n /* pass mouse input from Blessed to XTerm */\n if (this.options.mousePassthrough) {\n this.onScreenEvent(\"mouse\", this._onScreenEventMouse = (ev) => {\n /* only in case we are focused */\n if (this.screen.focused !== this)\n return\n\n /* only in case we are touched */\n if ((ev.x < this.aleft + this.ileft)\n || (ev.y < this.atop + this.itop)\n || (ev.x > this.aleft - this.ileft + this.width)\n || (ev.y > this.atop - this.itop + this.height))\n return\n\n /* generate canonical mouse input sequence,\n borrowed from original Blessed Terminal widget\n Copyright (c) 2013-2015 Christopher Jeffrey et al. */\n let b = ev.raw[0]\n let x = ev.x - this.aleft\n let y = ev.y - this.atop\n let s\n if (this.term._core.urxvtMouse) {\n if (this.screen.program.sgrMouse)\n b += 32\n s = \"\\x1b[\" + b + \";\" + (x + 32) + \";\" + (y + 32) + \"M\"\n }\n else if (this.term._core.sgrMouse) {\n if (!this.screen.program.sgrMouse)\n b -= 32\n s = \"\\x1b[<\" + b + \";\" + x + \";\" + y +\n (ev.action === \"mousedown\" ? \"M\" : \"m\")\n }\n else {\n if (this.screen.program.sgrMouse)\n b += 32\n s = \"\\x1b[M\" +\n String.fromCharCode(b) +\n String.fromCharCode(x + 32) +\n String.fromCharCode(y + 32)\n }\n\n /* pass-through mouse event sequence */\n this.handler(s)\n })\n }\n\n /* pass-through Blessed resize events to XTerm/Pty */\n this.on(\"resize\", () => {\n const nextTick = global.setImmediate || process.nextTick.bind(process)\n nextTick(() => {\n /* determine new width/height */\n let width = this.width - this.iwidth\n let height = this.height - this.iheight\n\n /* pass-through to XTerm */\n this.term.resize(width, height);\n })\n })\n\n /* perform an initial resizing once */\n this.once(\"render\", () => {\n let width = this.width - this.iwidth\n let height = this.height - this.iheight\n this.term.resize(width, height)\n })\n\n this.on(\"destroy\", () => this.dispose());\n }", "function mkpty(pty) {\n //pty: optional argument, inherit if set\n var pty2 = pty ? object(pty) : {}\n pty2.constructor = function() {}\n pty2.constructor.prototype = pty2\n return pty2\n}", "function test_vmrc_console_linux(browser, operating_system, provider) {}", "function System() {\n}", "function test_vmrc_console_windows(browser, operating_system, provider) {}", "function c(t){t.rl&&t.rl.close(),t.rl=i.createInterface({input:t.input,output:t.output,completer:function(e,n){if(!r.isFunction(t.autocomplete))return n(null,[[],e]);o.getAutocompleteArguments(t.currentCommand,e,function(r,i){if(r)return n(null,[[],e]);t.autocomplete(i,function(r,i){if(r)return n(r);o.getAutocompleteReplacements(t.currentCommand,e,i,function(t,e){return n(null,[t,e])})})})}});\n/*!\n * Monkey-patch the setPrompt method to properly calculate the string length when colors are\n * used. :(\n *\n * http://stackoverflow.com/questions/12075396/adding-colors-to-terminal-prompt-results-in-large-white-space\n */\nvar e=t.rl;e._setPrompt=e.setPrompt,e.setPrompt=function(t,n){var r=null;if(n)r=n;else{var i=t.split(/[\\r\\n]/).pop().stripColors;i&&(r=i.length)}e._setPrompt(t,r)},\n/*!\n * Bind the SIGINT handling to the readline instance, which effectively returns with an empty\n * command.\n */\nfunction(t){t.rl.once(\"SIGINT\",function(){return t.output.write(\"\\n\"),l(t,r.extend(new Error(\"User pressed CTRL+C\"),{code:\"SIGINT\"}))})}(t)}", "get LinuxEditor() {}", "*run() {\n const ctor = `${this.constructor.name}`;\n throw new OSError.OSCriticalError('Abstract Process.*run() was called by '+ctor);\n }", "function WSAPI() {\n }", "function CurrentThread() {\r\n}", "function MZConsole(){}", "function systemMessage(msg) {\n}", "function CursorChannel() {}", "function syscall(name, syscall_number, arg1, arg2, arg3, arg4, arg5, arg6)\n{\n debug_log(\"syscall \" + name)\n rop_chain.push(webkitgtk_base_addr_low + offset_pop_rax)\n rop_chain.push(webkitgtk_base_addr_high)\n rop_chain.push(syscall_number)\n rop_chain.push(0x0)\n if(typeof(arg1) !== \"undefined\")\n {\n rop_chain.push(webkitgtk_base_addr_low + offset_pop_rdi)\n rop_chain.push(webkitgtk_base_addr_high)\n rop_chain.push(arg1.getLowBitsUnsigned())\n rop_chain.push(arg1.getHighBitsUnsigned())\n }\n if(typeof(arg2) !== \"undefined\")\n {\n rop_chain.push(webkitgtk_base_addr_low + offset_pop_rsi)\n rop_chain.push(webkitgtk_base_addr_high)\n rop_chain.push(arg2.getLowBitsUnsigned())\n rop_chain.push(arg2.getHighBitsUnsigned())\n }\n if(typeof(arg3) !== \"undefined\")\n {\n rop_chain.push(webkitgtk_base_addr_low + offset_pop_rdx)\n rop_chain.push(webkitgtk_base_addr_high)\n rop_chain.push(arg3.getLowBitsUnsigned())\n rop_chain.push(arg3.getHighBitsUnsigned())\n }\n if(typeof(arg4) !== \"undefined\")\n {\n rop_chain.push(webkitgtk_base_addr_low + offset_pop_r10)\n rop_chain.push(webkitgtk_base_addr_high)\n rop_chain.push(arg4.getLowBitsUnsigned())\n rop_chain.push(arg4.getHighBitsUnsigned())\n }\n if(typeof(arg5) !== \"undefined\")\n {\n rop_chain.push(webkitgtk_base_addr_low + offset_pop_r8)\n rop_chain.push(webkitgtk_base_addr_high)\n rop_chain.push(arg5.getLowBitsUnsigned())\n rop_chain.push(arg5.getHighBitsUnsigned())\n }\n if(typeof(arg6) !== \"undefined\")\n {\n rop_chain.push(webkitgtk_base_addr_low + offset_pop_r9)\n rop_chain.push(webkitgtk_base_addr_high)\n rop_chain.push(arg6.getLowBitsUnsigned())\n rop_chain.push(arg6.getHighBitsUnsigned())\n }\n // syscall ; ret ;\n rop_chain.push(libc_base_addr_low + 0xc5c55)\n rop_chain.push(libc_base_addr_high);\n}", "function _____SHARED_functions_____(){}", "function createTerminalInterface(){\n let _rl = READLINE.createInterface({\n input: process.stdin,\n output: process.stdout,\n prompt: \"Enter help for more >> \",\n });\n // initial prompt and welcome display\n displayHeading(\"Welcome to CLI\");\n _rl.prompt();\n // listening for input on terminal\n _rl.on(\"line\", (input) => {\n processInput(input);\n _rl.prompt();\n });\n}", "get OSXEditor() {}", "function openShellUnimplemented(/* dirpath */) {\n console.error('not implemented');\n }", "function startxtermjs() {\n\tconsole.log('function startxterm from SSHyClient called')\n termInit();\n\n // if we haven't authenticated yet we're doing an interactive login\n if (!transport.auth.authenticated) {\n term.write('Login as: ');\n }\n\n // sets up some listeners for the terminal (keydown, paste)\n term.textarea.onkeydown = function(e) {\n\t\t// Sanity Checks\n if (!ws || !transport || transport.auth.failedAttempts >= 5 || transport.auth.awaitingAuthentication) {\n return;\n }\n\n var pressedKey\n /** IE isn't very good so it displays one character keys as full names in .key \n\t \tEG - e.key = \" \" to e.key = \"Spacebar\"\t\n\t \tso assuming .char is one character we'll use that instead **/\n\t\tif (e.char && e.char.length == 1) {\n\t\t\tpressedKey = e.char;\n\t\t} else { \n\t\t\tpressedKey = e.key\n\t\t}\n\n\t\t// So we don't spam single control characters\n if (pressedKey.length > 1 && (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) && pressedKey != \"Backspace\") {\n return;\n }\n\n if (!transport.auth.authenticated) {\n // Other clients doesn't allow control characters during authentication\n if (e.altKey || e.ctrlKey || e.metaKey) {\n return;\n }\n\n\t\t\t// so we can't input stuff like 'ArrowUp'\n\t\t\tif(pressedKey.length > 1 && (e.keyCode != 13 && e.keyCode != 8)){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t/* while termPassword is undefined, add all input to termUsername\n\t\t\t when it becomes defined then change targets to transport.auth.termPassword */\n switch (e.keyCode) {\n case 8: // backspace\n if (transport.auth.termPassword === undefined) {\n if (transport.auth.termUsername.length > 0) {\n termBackspace(term)\n transport.auth.termUsername = transport.auth.termUsername.slice(0, transport.auth.termUsername.length - 1);\n }\n } else {\n transport.auth.termPassword = transport.auth.termPassword.slice(0, transport.auth.termPassword.length - 1);\n }\n break;\n case 13: // enter\n if (transport.auth.termPassword === undefined) {\n term.write(\"\\n\\r\" + transport.auth.termUsername + '@' + transport.auth.hostname + '\\'s password:');\n transport.auth.termPassword = '';\n } else {\n term.write('\\n\\r');\n transport.auth.ssh_connection();\n return;\n }\n break;\n default:\n if (transport.auth.termPassword === undefined) {\n transport.auth.termUsername += pressedKey;\n term.write(pressedKey);\n } else {\n transport.auth.termPassword += pressedKey;\n }\n }\n return;\n }\n\n\t\t// We've already authenticated so now any keypress is a command for the SSH server\n var command;\n\n // Decides if the keypress is an alphanumeric character or needs escaping\n if (pressedKey.length == 1 && (!(e.altKey || e.ctrlKey || e.metaKey) || (e.altKey && e.ctrlKey))) {\n command = pressedKey;\n } else if (pressedKey.length == 1 && (e.shiftKey && e.ctrlKey)) {\n // allows ctrl + shift + v for pasting\n if (e.key != 'V') {\n e.preventDefault();\n\t\t\t\treturn;\n }\n } else {\n //xtermjs is kind enough to evaluate our special characters instead of having to translate every char ourself\n command = term._evaluateKeyEscapeSequence(e).key;\n }\n\n\t\t// Decide if we're going to locally' echo this key or not\n if (transport.settings.localEcho) {\n transport.settings.parseKey(e);\n }\n /* Regardless of local echo we still want a reply to confirm / update terminal\n\t\t could be controversial? but putty does this too (each key press shows up twice)\n\t\t Instead we're checking the our locally echoed key and replacing it if the\n\t\t recieved key !== locally echoed key */\n return command === null ? null : transport.expect_key(command);\n };\n\n term.textarea.onpaste = function(ev) {\n\t\tvar text \n\n\t\t// Yay IE11 stuff!\n\t\tif ( window.clipboardData && window.clipboardData.getData ) {\n\t\t\ttext = window.clipboardData.getData('Text')\n\t\t} else if ( ev.clipboardData && ev.clipboardData.getData ) {\n\t\t\ttext = ev.clipboardData.getData('text/plain');\n\t\t}\n\t\t\t\t\n if (text) {\n\t\t\t// Just don't allow more than 1 million characters to be pasted.\n\t\t\tif(text.length < 1000000){\n\t\t if (text.length > 5000) {\n\t\t\t\t\t// If its a long string then chunk it down to reduce load on SSHyClient.parceler\n\t\t text = splitSlice(text);\n\t\t for (var i = 0; i < text.length; i++) {\n\t\t transport.expect_key(text[i]);\n\t\t }\n\t\t return;\n\t\t }\n\t\t transport.expect_key(text);\n\t\t } else {\n\t\t\t\talert('Error: Pasting large strings is not permitted.');\n\t\t\t}\n\t\t}\n };\n}", "function extendCore() {\n\t// adds some properties i use to core based on the current operating system, it needs a switch, thats why i couldnt put it into the core obj at top\n\tswitch (core.os.name) {\n\t\tcase 'winnt':\n\t\tcase 'winmo':\n\t\tcase 'wince':\n\t\t\tcore.os.version = parseFloat(Services.sysinfo.getProperty('version'));\n\t\t\t// http://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions\n\t\t\tif (core.os.version == 6.0) {\n\t\t\t\tcore.os.version_name = 'vista';\n\t\t\t}\n\t\t\tif (core.os.version >= 6.1) {\n\t\t\t\tcore.os.version_name = '7+';\n\t\t\t}\n\t\t\tif (core.os.version == 5.1 || core.os.version == 5.2) { // 5.2 is 64bit xp\n\t\t\t\tcore.os.version_name = 'xp';\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'darwin':\n\t\t\tvar userAgent = myServices.hph.userAgent;\n\n\t\t\tvar version_osx = userAgent.match(/Mac OS X 10\\.([\\d\\.]+)/);\n\n\t\t\t\n\t\t\tif (!version_osx) {\n\t\t\t\tthrow new Error('Could not identify Mac OS X version.');\n\t\t\t} else {\n\t\t\t\tvar version_osx_str = version_osx[1];\n\t\t\t\tvar ints_split = version_osx[1].split('.');\n\t\t\t\tif (ints_split.length == 1) {\n\t\t\t\t\tcore.os.version = parseInt(ints_split[0]);\n\t\t\t\t} else if (ints_split.length >= 2) {\n\t\t\t\t\tcore.os.version = ints_split[0] + '.' + ints_split[1];\n\t\t\t\t\tif (ints_split.length > 2) {\n\t\t\t\t\t\tcore.os.version += ints_split.slice(2).join('');\n\t\t\t\t\t}\n\t\t\t\t\tcore.os.version = parseFloat(core.os.version);\n\t\t\t\t}\n\t\t\t\t// this makes it so that 10.10.0 becomes 10.100\n\t\t\t\t// 10.10.1 => 10.101\n\t\t\t\t// so can compare numerically, as 10.100 is less then 10.101\n\t\t\t\t\n\t\t\t\t//core.os.version = 6.9; // note: debug: temporarily forcing mac to be 10.6 so we can test kqueue\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// nothing special\n\t}\n\t\n\n}", "function Window() {}", "function Shell()\n{\n // Properties\n this.promptStr = \">\";\n this.commandList = [];\n this.curses = \"[fuvg],[cvff],[shpx],[phag],[pbpxfhpxre],[zbgureshpxre],[gvgf]\";\n this.apologies = \"[sorry]\";\n \n \n // Methods\n this.init = shellInit;\n this.putPrompt = shellPutPrompt;\n this.handleInput = shellHandleInput;\n this.execute = shellExecute;\n this.drop = shellDropLine;\n}", "function Control()\n{\n\tfunction Move(move) \n { \t\n switch (move) \n {\n case mJump: \n\t\t\t\tvar timeout = 90;\t\t\t\n PressKey(38, timeout)\n console.log('Jump!');\n break;\n\n case mDuck: \t\n timeout = 400;\n PressKey(40, timeout)\n console.log('Duck!');\n break;\n case mRun:\n \tbreak;\n\n default:\n console.log('Invalid move ' + move);\n }\n }\n\t\n\tfunction PressKey(key, timeout) \n {\n\t\tkeyPress('keydown', key);\n\t\tsetTimeout(function() {keyPress('keyup', key);}, timeout);\n }\n\t\n\tfunction keyPress(type, keycode) \n {\n var eventObj = document.createEventObject ?\n document.createEventObject() : document.createEvent(\"Events\");\n\n if(eventObj.initEvent)\n {\n eventObj.initEvent(type, true, true);\n }\n\n eventObj.keyCode = keycode;\n eventObj.which = keycode;\n\n document.dispatchEvent ? document.dispatchEvent(eventObj) : el.fireEvent(\"onkeydown\", eventObj);\n }\n\t\n\t// exports\n return { Move: Move, PressKey : PressKey };\n}", "function shellGetS()\n{\n krnGetScheduler();\n}", "_showThreadPane() {}", "function support_system_file_popen (cmd, m) {\n const mode = support_system_file_parseMode(m)\n if (mode != 'r') {\n process.__lasterr = 'The NodeJS popen FFI only supports opening for reading currently.'\n return null\n }\n\n const tmp_file = require('os').tmpdir() + \"/\" + require('crypto').randomBytes(15).toString('hex')\n const write_fd = support_system_file_fs.openSync(\n tmp_file,\n 'w'\n )\n\n var io_setting\n switch (mode) {\n case \"r\":\n io_setting = ['ignore', write_fd, 2]\n break\n case \"w\", \"a\":\n io_setting = [write_fd, 'ignore', 2]\n break\n default:\n process.__lasterr = 'The popen function cannot be used for reading and writing simultaneously.'\n return null\n }\n\n const { status, error } = support_system_file_child_process.spawnSync(\n cmd,\n [],\n { stdio: io_setting, shell: true }\n )\n\n support_system_file_fs.closeSync(write_fd)\n\n if (error) {\n process.__lasterr = error\n return null\n }\n\n const read_ptr = support_system_file_openFile(\n tmp_file,\n 'r'\n )\n\n return { ...read_ptr, exit_code: status }\n}", "function UHelpNATIVE(topic,mode,logicalname)\n{\n w = window.open(\"help?topic=\"+topic+\"&mode=\"+mode+\"&logicalname=\"+logicalname, \"UnifaceHelpNative\",\n \"scrollbars=yes,resizable=yes,width=400,height=200\");\n if (uTestBrowserNS()) {\n w.focus();\n }\n}", "open(parent) {\n if (!parent) {\n throw new Error('Terminal requires a parent element.');\n }\n if (!parent.isConnected) {\n this._logService.debug('Terminal.open was called on an element that was not attached to the DOM');\n }\n this._document = parent.ownerDocument;\n // Create main element container\n this.element = this._document.createElement('div');\n this.element.dir = 'ltr'; // xterm.css assumes LTR\n this.element.classList.add('terminal');\n this.element.classList.add('xterm');\n this.element.setAttribute('tabindex', '0');\n this.element.setAttribute('role', 'document');\n parent.appendChild(this.element);\n // Performance: Use a document fragment to build the terminal\n // viewport and helper elements detached from the DOM\n const fragment = document$1.createDocumentFragment();\n this._viewportElement = document$1.createElement('div');\n this._viewportElement.classList.add('xterm-viewport');\n fragment.appendChild(this._viewportElement);\n this._viewportScrollArea = document$1.createElement('div');\n this._viewportScrollArea.classList.add('xterm-scroll-area');\n this._viewportElement.appendChild(this._viewportScrollArea);\n this.screenElement = document$1.createElement('div');\n this.screenElement.classList.add('xterm-screen');\n // Create the container that will hold helpers like the textarea for\n // capturing DOM Events. Then produce the helpers.\n this._helperContainer = document$1.createElement('div');\n this._helperContainer.classList.add('xterm-helpers');\n this.screenElement.appendChild(this._helperContainer);\n fragment.appendChild(this.screenElement);\n this.textarea = document$1.createElement('textarea');\n this.textarea.classList.add('xterm-helper-textarea');\n this.textarea.setAttribute('aria-label', promptLabel$1);\n this.textarea.setAttribute('aria-multiline', 'false');\n this.textarea.setAttribute('autocorrect', 'off');\n this.textarea.setAttribute('autocapitalize', 'off');\n this.textarea.setAttribute('spellcheck', 'false');\n this.textarea.tabIndex = 0;\n this.register(addDisposableDomListener(this.textarea, 'focus', (ev) => this._onTextAreaFocus(ev)));\n this.register(addDisposableDomListener(this.textarea, 'blur', () => this._onTextAreaBlur()));\n this._helperContainer.appendChild(this.textarea);\n const coreBrowserService = this._instantiationService.createInstance(CoreBrowserService, this.textarea);\n this._instantiationService.setService(ICoreBrowserService, coreBrowserService);\n this._charSizeService = this._instantiationService.createInstance(CharSizeService, this._document, this._helperContainer);\n this._instantiationService.setService(ICharSizeService$1, this._charSizeService);\n this._compositionView = document$1.createElement('div');\n this._compositionView.classList.add('composition-view');\n this._compositionHelper = this._instantiationService.createInstance(CompositionHelper, this.textarea, this._compositionView);\n this._helperContainer.appendChild(this._compositionView);\n // Performance: Add viewport and helper elements from the fragment\n this.element.appendChild(fragment);\n this._theme = this.options.theme || this._theme;\n this._colorManager = new ColorManager(document$1, this.options.allowTransparency);\n this.register(this.optionsService.onOptionChange(e => this._colorManager.onOptionsChange(e)));\n this._colorManager.setTheme(this._theme);\n const renderer = this._createRenderer();\n this._renderService = this.register(this._instantiationService.createInstance(RenderService, renderer, this.rows, this.screenElement));\n this._instantiationService.setService(IRenderService$1, this._renderService);\n this.register(this._renderService.onRenderedBufferChange(e => this._onRender.fire(e)));\n this.onResize(e => this._renderService.resize(e.cols, e.rows));\n this._soundService = this._instantiationService.createInstance(SoundService);\n this._instantiationService.setService(ISoundService, this._soundService);\n this._mouseService = this._instantiationService.createInstance(MouseService);\n this._instantiationService.setService(IMouseService, this._mouseService);\n this.viewport = this._instantiationService.createInstance(Viewport, (amount, suppressEvent) => this.scrollLines(amount, suppressEvent), this._viewportElement, this._viewportScrollArea);\n this.viewport.onThemeChange(this._colorManager.colors);\n this.register(this._inputHandler.onRequestSyncScrollBar(() => this.viewport.syncScrollArea()));\n this.register(this.viewport);\n this.register(this.onCursorMove(() => {\n this._renderService.onCursorMove();\n this._syncTextArea();\n }));\n this.register(this.onResize(() => this._renderService.onResize(this.cols, this.rows)));\n this.register(this.onBlur(() => this._renderService.onBlur()));\n this.register(this.onFocus(() => this._renderService.onFocus()));\n this.register(this._renderService.onDimensionsChange(() => this.viewport.syncScrollArea()));\n this._selectionService = this.register(this._instantiationService.createInstance(SelectionService, this.element, this.screenElement));\n this._instantiationService.setService(ISelectionService, this._selectionService);\n this.register(this._selectionService.onRequestScrollLines(e => this.scrollLines(e.amount, e.suppressScrollEvent)));\n this.register(this._selectionService.onSelectionChange(() => this._onSelectionChange.fire()));\n this.register(this._selectionService.onRequestRedraw(e => this._renderService.onSelectionChanged(e.start, e.end, e.columnSelectMode)));\n this.register(this._selectionService.onLinuxMouseSelection(text => {\n // If there's a new selection, put it into the textarea, focus and select it\n // in order to register it as a selection on the OS. This event is fired\n // only on Linux to enable middle click to paste selection.\n this.textarea.value = text;\n this.textarea.focus();\n this.textarea.select();\n }));\n this.register(this.onScroll(() => {\n this.viewport.syncScrollArea();\n this._selectionService.refresh();\n }));\n this.register(addDisposableDomListener(this._viewportElement, 'scroll', () => this._selectionService.refresh()));\n this._mouseZoneManager = this._instantiationService.createInstance(MouseZoneManager, this.element, this.screenElement);\n this.register(this._mouseZoneManager);\n this.register(this.onScroll(() => this._mouseZoneManager.clearAll()));\n this.linkifier.attachToDom(this.element, this._mouseZoneManager);\n this.linkifier2.attachToDom(this.element, this._mouseService, this._renderService);\n // This event listener must be registered aftre MouseZoneManager is created\n this.register(addDisposableDomListener(this.element, 'mousedown', (e) => this._selectionService.onMouseDown(e)));\n // apply mouse event classes set by escape codes before terminal was attached\n if (this._coreMouseService.areMouseEventsActive) {\n this._selectionService.disable();\n this.element.classList.add('enable-mouse-events');\n }\n else {\n this._selectionService.enable();\n }\n if (this.options.screenReaderMode) {\n // Note that this must be done *after* the renderer is created in order to\n // ensure the correct order of the dprchange event\n this._accessibilityManager = new AccessibilityManager(this, this._renderService);\n }\n // Measure the character size\n this._charSizeService.measure();\n // Setup loop that draws to screen\n this.refresh(0, this.rows - 1);\n // Initialize global actions that need to be taken on the document.\n this._initGlobal();\n // Listen for mouse events and translate\n // them into terminal mouse protocols.\n this.bindMouse();\n }", "function h$process_runInteractiveProcess( cmd, args, workingDir, env\n , stdin_fd, stdout_fd, stderr_fd\n , closeHandles, createGroup, delegateCtlC) {\n ;\n ;\n ;\n ;\n // fixme we need an IOError not a JSException\n throw \"$process_runInteractiveProcess: unsupported\";\n}", "function m(b,a,c){a=void 0===a?{}:a;c=void 0===c?!1:c;\"function\"===typeof a?(q(\"Legacy constructor was used. See README for latest usage.\",r),a={listener:a,l:c,m:!0,h:{}}):a={listener:a.listener||function(){},l:a.listenToPast||!1,m:void 0===a.processNow?!0:a.processNow,h:a.commandProcessors||{}};this.a=b;this.s=a.listener;this.o=a.l;this.g=this.j=!1;this.c={};this.f=[];this.b=a.h;this.i=t(this);a.m&&this.process()}", "function newIc9sh() {\n $shell = new Ic9sh();\n return $shell;\n}", "function Shell() {\n // Properties\n this.promptStr = \">\";\n this.commandList = [];\n this.curses = \"[fuvg],[cvff],[shpx],[phag],[pbpxfhpxre],[zbgureshpxre],[gvgf]\";\n this.apologies = \"[sorry]\";\n // Methods\n this.init = shellInit;\n this.putPrompt = shellPutPrompt;\n this.handleInput = shellHandleInput;\n this.execute = shellExecute;\n}", "function timerWrapper () {}", "run() {\n this.io = readline.createInterface(process.stdin, process.stdout);\n this.io.on('line', this.handleLine.bind(this));\n this.io.on('close', this.handleIOClose.bind(this));\n }", "function shellActive ()\n{\n _StdIn.putText(krnActivePIDS()); \n}", "readCLI() {\n\n }", "function getSyscall() {\n return syscall;\n }", "function shellFormat()\n{\n if(krnCheckExecution())\n _StdIn.putText(\"Please wait for the currently executing process to finish before formatting\");\n else\n krnDiskFormat();\n}", "function h$main(a) {\n var t = new h$Thread();\n //TRACE_SCHEDULER(\"sched: starting main thread\");\n t.stack[0] = h$doneMain_e;\n if(!h$isBrowser && !h$isGHCJSi) {\n t.stack[2] = h$baseZCGHCziTopHandlerzitopHandler;\n }\n t.stack[4] = h$ap_1_0;\n t.stack[5] = h$flushStdout;\n t.stack[6] = h$return;\n t.stack[7] = h$ap_1_0;\n t.stack[8] = a;\n t.stack[9] = h$return;\n t.sp = 9;\n t.label = [h$encodeUtf8(\"main\"), 0];\n h$wakeupThread(t);\n h$startMainLoop();\n return t;\n}", "function h$main(a) {\n var t = new h$Thread();\n //TRACE_SCHEDULER(\"sched: starting main thread\");\n t.stack[0] = h$doneMain_e;\n if(!h$isBrowser && !h$isGHCJSi) {\n t.stack[2] = h$baseZCGHCziTopHandlerzitopHandler;\n }\n t.stack[4] = h$ap_1_0;\n t.stack[5] = h$flushStdout;\n t.stack[6] = h$return;\n t.stack[7] = h$ap_1_0;\n t.stack[8] = a;\n t.stack[9] = h$return;\n t.sp = 9;\n t.label = [h$encodeUtf8(\"main\"), 0];\n h$wakeupThread(t);\n h$startMainLoop();\n return t;\n}", "function h$main(a) {\n var t = new h$Thread();\n //TRACE_SCHEDULER(\"sched: starting main thread\");\n t.stack[0] = h$doneMain_e;\n if(!h$isBrowser && !h$isGHCJSi) {\n t.stack[2] = h$baseZCGHCziTopHandlerzitopHandler;\n }\n t.stack[4] = h$ap_1_0;\n t.stack[5] = h$flushStdout;\n t.stack[6] = h$return;\n t.stack[7] = h$ap_1_0;\n t.stack[8] = a;\n t.stack[9] = h$return;\n t.sp = 9;\n t.label = [h$encodeUtf8(\"main\"), 0];\n h$wakeupThread(t);\n h$startMainLoop();\n return t;\n}", "function StdIn() {\r\n}", "function OpenNewXDisplay() {\n\t//returns ostypes.DISPLAY\n\t//consider: http://mxr.mozilla.org/chromium/source/src/ui/gfx/x/x11_types.cc#26\n\t // std::string display_str = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kX11Display);\n\t // return XOpenDisplay(display_str.empty() ? NULL : display_str.c_str());\n\t // i asked about it here: https://ask.mozilla.org/question/1321/proper-way-to-xopendisplay/\n\t\n\treturn _dec('XOpenDisplay')(null);\n\t\n\t/* http://mxr.mozilla.org/chromium/source/src/ui/gfx/x/x11_types.cc#22\n\t22 XDisplay* OpenNewXDisplay() {\n\t23 #if defined(OS_CHROMEOS)\n\t24 return XOpenDisplay(NULL);\n\t25 #else\n\t26 std::string display_str = base::CommandLine::ForCurrentProcess()->\n\t27 GetSwitchValueASCII(switches::kX11Display);\n\t28 return XOpenDisplay(display_str.empty() ? NULL : display_str.c_str());\n\t29 #endif\n\t30 }\n\t*/\n}", "static init(evt){\n // ghci must be working \n this.ghciSafeRun(evt, () => {\n // get buffer text\n GHCI_PROCESS.init(str => {\n // send the text (\"ghci version...\")\n IpcResponder.respond(evt, \"ghci\", {str});\n });\n });\n }", "function wrap(cmd, fn, options) {\n return function() {\n var retValue = null;\n \n state.currentCmd = cmd;\n state.error = null;\n \n try {\n var args = [].slice.call(arguments, 0);\n \n if (options && options.notUnix) {\n retValue = fn.apply(this, args);\n } else {\n if (args.length === 0 || typeof args[0] !== 'string' || args[0][0] !== '-')\n args.unshift(''); // only add dummy option if '-option' not already present\n retValue = fn.apply(this, args);\n }\n } catch (e) {\n if (!state.error) {\n // If state.error hasn't been set it's an error thrown by Node, not us - probably a bug...\n console.log('shell.js: internal error');\n console.log(e.stack || e);\n process.exit(1);\n }\n if (config.fatal)\n throw e;\n }\n \n state.currentCmd = 'shell.js';\n return retValue;\n };\n } // wrap", "function inotify_init() {\n return libsys.syscall(platform_1.SYS.inotify_init);\n}", "function win(options) {\n // close\n this.close=function() {\n if(this.onclose)\n this.onclose();\n\n this.win.parentNode.removeChild(this.win);\n delete windows[this.id];\n }\n\n // set_title\n this.set_title=function(title) {\n var current=this.title.firstChild;\n current.textContent=title;\n }\n\n // mousedown\n this.mousedown=function(event) {\n add_css_class(this.title_bar, \"win_title_bar_moving\");\n win_currentdrag=this;\n\n // Raise window to top\n if(this.win.style.zIndex!=win_maxzindex)\n this.win.style.zIndex=++win_maxzindex;\n }\n\n // mouseup\n this.mouseup=function(event) {\n del_css_class(this.title_bar, \"win_title_bar_moving\");\n win_currentdrag=null;\n }\n\n // move\n this.move=function(m) {\n this.win.style.top=(this.win.offsetTop+m.y)+\"px\";\n this.win.style.left=(this.win.offsetLeft+m.x)+\"px\";\n }\n\n // check options\n if(!options) {\n options={};\n }\n else if(typeof options==\"string\") {\n options={ \"class\": options };\n }\n\n // create window and set class(es)\n this.win=document.createElement(\"div\");\n this.win.className=\"win\"\n\n // Add window to div win_root (create if it doesn't exist)\n if(!win_root) {\n win_root=dom_create_append(document.body, \"div\");\n win_root.className=\"win_root\";\n\n win_mousemove_old=document.body.onmousemove;\n document.body.onmousemove=win_mousemove;\n }\n win_root.appendChild(this.win);\n\n // Create title-bar\n this.title_bar=dom_create_append(this.win, \"table\");\n this.title_bar.className=\"win_title_bar\";\n var tr=dom_create_append(this.title_bar, \"tr\");\n\n this.title=dom_create_append(tr, \"td\");\n this.title.className=\"title\";\n dom_create_append_text(this.title, options.title?options.title:\"Window\");\n this.title.onmousedown=this.mousedown.bind(this);\n this.title.onselectstart=function() {};\n\n // Close Button\n var td=dom_create_append(tr, \"td\");\n var close_button=dom_create_append(td, \"img\");\n close_button.src=\"plugins/win/close.png\";\n close_button.alt=\"close\";\n close_button.className=\"win_close_button\";\n close_button.onclick=this.close.bind(this);\n\n // Create div for content\n this.content=document.createElement(\"div\");\n this.content.className=\"content\";\n add_css_class(this.content, options.class);\n this.win.appendChild(this.content);\n // Raise new window to top\n this.win.style.zIndex=++win_maxzindex;\n\n this.id=uniqid();\n windows[this.id]=this;\n}", "function Console() {}", "function Console() {}", "_installIPC() {\n electron_1.ipcMain.on(common_1.IPC_PING, (event) => {\n event.sender.send(common_1.IPC_PING);\n });\n electron_1.ipcMain.on(common_1.IPC_EVENT, (ipc, event) => {\n event.extra = Object.assign(Object.assign({}, this._getRendererExtra(ipc.sender)), event.extra);\n core_1.captureEvent(event);\n });\n electron_1.ipcMain.on(common_1.IPC_SCOPE, (_, rendererScope) => {\n // tslint:disable:no-unsafe-any\n const sentScope = core_1.Scope.clone(rendererScope);\n core_1.configureScope(scope => {\n if (sentScope._user) {\n scope.setUser(sentScope._user);\n }\n scope.setTags(sentScope._tags);\n scope.setExtras(sentScope._extra);\n // Since we do not have updates for individual breadcrumbs anymore and only for the whole scope\n // we just add the last added breadcrumb on scope updates\n scope.addBreadcrumb(sentScope._breadcrumbs.pop());\n });\n // tslint:enable:no-unsafe-any\n });\n }", "function typeSpecial(paramDoc, paramKEYCODE, paramIsAlt, paramIsCtl, paramIsShift) {\r\n\t// Local variable to extract information about cursor after certain operations\r\n\tvar newCursorCoords;\r\n\t\r\n\tswitch ( paramKEYCODE ) {\r\n\t\r\n\t\tcase LEFTARROWKEY: \r\n\t\t\t/* If we are holding shift, moving the cursor actually selects text, so we need to ensure we are in select mode */\r\n\t\t\tif ( paramIsShift )\tif ( !isSelectMode ) setSelectMode( paramDoc, cursorLine, cursorColumn );\r\n\t\t\t\r\n\t\t\t// If we are at the first char of the first line do nothing\r\n\t\t\t// If we are at the first char of any other line, wrap to the last char of the previous line\r\n\t\t\t// Otherwise, simply move left\r\n\t\t\tif ( cursorColumn == 0 && cursorLine == 0 ) break;\r\n\t\t\tif ( cursorColumn == 0 ) {\r\n\t\t\t\tif ( paramDoc.getLineLockingUser( cursorLine-1 ) != null ) { \r\n\t\t\t\t\talert(\"Another user is currently on line \"+(cursorLine-1)+\", and it is locked.\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcursorLine--;\r\n\t\t\t\tcursorColumn = paramDoc.getLineLength(cursorLine);\r\n\t\t\t}\r\n\t\t\telse cursorColumn--;\t\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase RIGHTARROWKEY:\r\n\t\t\t/* If we are holding shift, moving the cursor actually selects text, so we need to ensure we are in select mode */\r\n\t\t\tif ( paramIsShift ) if ( !isSelectMode ) setSelectMode( paramDoc, cursorLine, cursorColumn );\r\n\t\t\t\r\n\t\t\t// If we are at the last char of the last line, do nothing\r\n\t\t\t// If we are at the last char of any other line, wrap to the first char of the next line\r\n\t\t\t// Otherwise, simply move right\r\n\t\t\tif ( cursorColumn == paramDoc.getLineLength(cursorLine) && cursorLine == paramDoc.getDocumentLength()-1 ) break;\r\n\t\t\tif ( cursorColumn == paramDoc.getLineLength(cursorLine) ) {\r\n\t\t\t\tif ( paramDoc.getLineLockingUser( cursorLine+1 ) != null ) { \r\n\t\t\t\t\talert(\"Another user is currently on line \"+(cursorLine+1)+\", and it is locked.\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcursorLine++;\r\n\t\t\t\tcursorColumn = 0;\r\n\t\t\t}\r\n\t\t\telse cursorColumn++;\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase UPARROWKEY:\r\n\t\t\t/* If we are holding shift, moving the cursor actually selects text, so we need to ensure we are in select mode */\r\n\t\t\tif ( paramIsShift ) if ( !isSelectMode ) setSelectMode( paramDoc, cursorLine, cursorColumn );\r\n\t\t\t\r\n\t\t\t// If we are on the first line, move to first char of line.\r\n\t\t\t// If we are not on the first line, see if the line is locked and alert the user if it is\r\n\t\t\t// Otherwise, move up. If we end up out of range of the line, move to the last char of the line\r\n\t\t\tif ( cursorLine == 0 ) cursorColumn = 0;\r\n\t\t\telse if ( paramDoc.getLineLockingUser( cursorLine-1 ) != null ) alert(\"Another user is currently on line \"+(cursorLine-1)+\", and it is locked.\");\r\n\t\t\telse if ( cursorColumn > paramDoc.getLineLength(--cursorLine) ) cursorColumn = paramDoc.getLineLength(cursorLine);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase DOWNARROWKEY:\r\n\t\t\t/* If we are holding shift, moving the cursor actually selects text, so we need to ensure we are in select mode */\r\n\t\t\tif ( paramIsShift ) if ( !isSelectMode ) setSelectMode( paramDoc, cursorLine, cursorColumn );\t\t\t\r\n\t\t\t\r\n\t\t\t// If we are on the last line, move to last char of line.\r\n\t\t\t// If we are not on the last line, see if the line is locked and alert the user if it is\r\n\t\t\t// Otherwise, move down. If we end up out of range of the line, move to the last char of the line\r\n\t\t\tif ( cursorLine == paramDoc.getDocumentLength()-1 ) cursorColumn = paramDoc.getLineLength(cursorLine);\r\n\t\t\telse if ( paramDoc.getLineLockingUser( cursorLine+1 ) != null ) alert(\"Another user is currently on line \"+(cursorLine+1)+\", and it is locked.\");\r\n\t\t\telse if ( cursorColumn > paramDoc.getLineLength(++cursorLine) ) cursorColumn = paramDoc.getLineLength(cursorLine);\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase ENDKEY:\r\n\t\t\t/* If we are holding shift, moving the cursor actually selects text, so we need to ensure we are in select mode */\r\n\t\t\tif ( paramIsShift ) if ( !isSelectMode ) setSelectMode( paramDoc, cursorLine, cursorColumn );\r\n\t\t\t\r\n\t\t\t/* If we are holding CTL, then we want to go to the very last char of the document. Otherwise, of just the current line */\r\n\t\t\tif ( paramIsCtl ) setCursor( paramDoc.getDocumentLength()-1, paramDoc.getLineLength( paramDoc.getDocumentLength()-1 ) );\r\n\t\t\telse cursorColumn = paramDoc.getLineLength(cursorLine);\r\n\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase HOMEKEY:\r\n\t\t\t/* If we are holding shift, moving the cursor actually selects text, so we need to ensure we are in select mode */\r\n\t\t\tif ( paramIsShift ) if ( !isSelectMode ) setSelectMode( paramDoc, cursorLine, cursorColumn );\r\n\t\t\t\r\n\t\t\t/* If we are holding CTL, then we want to go to the very first char of the document. Otherwise, of just the current line */\r\n\t\t\tif ( paramIsCtl ) setCursor( 0, 0 );\r\n\t\t\telse cursorColumn = 0;\r\n\t\t\t\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase PAGEUPKEY:\r\n\t\t\t/* If we are holding shift, moving the cursor actually selects text, so we need to ensure we are in select mode */\r\n\t\t\tif ( paramIsShift ) if ( !isSelectMode ) setSelectMode( paramDoc, cursorLine, cursorColumn );\r\n\t\t\t\r\n\t\t\t/* If we are holding CTL, Notepadd++ and a variety of other programs perform no function in this case. Do the same */\r\n\t\t\tif ( paramIsCtl ) break;\r\n\t\t\t\r\n\t\t\t// Move the cursor up a number of time relative to the current editing window's height\t\t\t\r\n\t\t\tif(isIE == true){\r\n\t\t\t\tcursorLine -= Math.floor(guiDoc.body.clientHeight / FONT_HEIGHT);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcursorLine -= Math.floor(myIFrame.contentWindow.innerHeight / FONT_HEIGHT);\r\n\t\t\t}\r\n\t\t\t// Do out-of-bounds checks\r\n\t\t\tif ( cursorLine < 0 ) {\r\n\t\t\t\tcursorLine = 0;\r\n\t\t\t\tcursorColumn = 0;\r\n\t\t\t} else if ( cursorColumn >= paramDoc.getLineLength( cursorLine ) ) cursorColumn = paramDoc.getLineLength(cursorLine);\r\n\t\t\t// If the line is locked, move down one\r\n\t\t\twhile ( paramDoc.getLineLockingUser( cursorLine ) != null ) { cursorLine++; }\r\n\t\t\tif(isIE == true){\r\n\t\t\t\tmyIFrame.scrollBy(0,-guiDoc.body.clientHeight+PADDING_TOP);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tmyIFrame.contentWindow.scrollBy(0,-myIFrame.contentWindow.innerHeight+PADDING_TOP);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\tcase PAGEDOWNKEY:\r\n\t\t\t/* If we are holding shift, moving the cursor actually selects text, so we need to ensure we are in select mode */\r\n\t\t\tif ( paramIsShift ) if ( !isSelectMode ) setSelectMode( paramDoc, cursorLine, cursorColumn );\r\n\t\t\t\r\n\t\t\t/* If we are holding CTL, Notepadd++ and a variety of other programs perform no function in this case. Do the same */\r\n\t\t\tif ( paramIsCtl ) break;\r\n\t\t\t\r\n\t\t\t// Move the cursor down a number of times relative to the current editing window's height\r\n\t\t\tif(isIE == true){\r\n\t\t\t\tcursorLine += Math.floor(guiDoc.body.clientHeight / FONT_HEIGHT);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcursorLine += Math.floor(myIFrame.contentWindow.innerHeight / FONT_HEIGHT);\r\n\t\t\t}\r\n\t\t\t// Do out-of-bounds checks\r\n\t\t\tif ( cursorLine > paramDoc.getDocumentLength()-1 ) {\r\n\t\t\t\tcursorLine = paramDoc.getDocumentLength()-1;\r\n\t\t\t\tcursorColumn = paramDoc.getLineLength( cursorLine )-1;\r\n\t\t\t\tif( cursorColumn < 0 ) cursorColumn = 0;\r\n\t\t\t} else if ( cursorColumn >= paramDoc.getLineLength( cursorLine ) ) cursorColumn = paramDoc.getLineLength(cursorLine);\r\n\t\t\t// If the line is locked, move up one\r\n\t\t\twhile ( paramDoc.getLineLockingUser( cursorLine ) != null ) { cursorLine--; }\r\n\t\t\tif(isIE == true){\r\n\t\t\t\tmyIFrame.scrollBy(0,guiDoc.body.clientHeight-PADDING_TOP);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tmyIFrame.contentWindow.scrollBy(0,myIFrame.contentWindow.innerHeight-PADDING_TOP);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase BACKSPACEKEY:\r\n\t\t\t// If there is currently a selection, we want to simply delete it and we're done\r\n\t\t\tif ( paramDoc.isSelection ) {\r\n\t\t\t\tvar tmpSel = paramDoc.getCurrentSelection();\r\n\t\t\t\tvar newCursorCoords = paramDoc.replaceTextInRange( tmpSel.startLine, tmpSel.startColumn, tmpSel.endLine, tmpSel.endColumn ); // no last parameter = delete text\r\n\t\t\t\tcursorLine = newCursorCoords[0];\r\n\t\t\t\tcursorColumn = newCursorCoords[1];\r\n\t\t\t\tbreak;\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t// If we are on the first char of the first line, do nothing.\r\n\t\t\t// If we are on the first char of any other line, backspace removes the \"newline character\"\r\n\t\t\t// -- which doesn't exist in our implementation. We simulate this removal by merging lines.\r\n\t\t\t// Otherwise, we simply remove the previous char in the current line\r\n\t\t\tif ( cursorLine == 0 && cursorColumn == 0 ) break;\r\n\t\t\tif ( cursorColumn == 0 && paramDoc.getLineLockingUser( cursorLine-1 ) != null ) {\r\n\t\t\t\talert(\"Another user is currently on line \"+(cursorLine-1)+\", and it is locked.\");\r\n\t\t\t}\r\n\t\t\telse if ( cursorColumn == 0 ) {\r\n\t\t\t\t// Merge the two lines, and remove the original line\r\n\t\t\t\tcursorColumn = paramDoc.getLineLength( cursorLine-1 );\t// Place cursor at end of prior line\r\n\t\t\t\t// Perform text merge into prior line\r\n\t\t\t\tparamDoc.setLineText( cursorLine-1, paramDoc.getLineText( cursorLine-1 ) + paramDoc.getLineText( cursorLine ) );\r\n\t\t\t\t// Remove the line from our data structure\r\n\t\t\t\tparamDoc.removeLine( cursorLine );\r\n\t\t\t\t// Decrement cursorLine\r\n\t\t\t\tcursorLine--;\r\n\t\t\t} else {\r\n\t\t\t\t// \"Remove\" the character prior to cursorColumn, and decrement cursorColumn\r\n\t\t\t\tvar tempText = paramDoc.getLineText( cursorLine );\r\n\t\t\t\tparamDoc.setLineText( cursorLine, tempText.substring(0,cursorColumn-1) + tempText.substring(cursorColumn--) );\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase DELETEKEY:\r\n\t\t\t// If there is currently a selection, we want to simply delete it and we're done\r\n\t\t\tif ( paramDoc.isSelection ) {\r\n\t\t\t\tvar tmpSel = paramDoc.getCurrentSelection();\r\n\t\t\t\tvar newCursorCoords = paramDoc.replaceTextInRange( tmpSel.startLine, tmpSel.startColumn, tmpSel.endLine, tmpSel.endColumn ); // no last parameter = delete text\r\n\t\t\t\tcursorLine = newCursorCoords[0];\r\n\t\t\t\tcursorColumn = newCursorCoords[1];\r\n\t\t\t\tbreak;\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t// If we are at the last char of the last line, do nothing\r\n\t\t\t// If we are at the last char of any other line, we remove the 'newline character', thus merging the current line with the next line\r\n\t\t\t// Otherwise, we simply remove the char at the cursor position\r\n\t\t\tif ( cursorColumn == paramDoc.getLineLength( paramDoc.getDocumentLength()-1 )-1 && cursorLine == paramDoc.getDocumentLength()-1 ) break;\r\n\t\t\tif ( cursorColumn == paramDoc.getLineLength( cursorLine ) && paramDoc.getLineLockingUser( cursorLine+1 ) != null ) {\r\n\t\t\t\talert(\"Another user is currently on line \"+(cursorLine+1)+\", and it is locked.\");\r\n\t\t\t}\r\n\t\t\telse if ( cursorColumn == paramDoc.getLineLength( cursorLine ) ) {\r\n\t\t\t\t// Merge the next line into the current line\r\n\t\t\t\tparamDoc.setLineText( cursorLine, paramDoc.getLineText(cursorLine) + paramDoc.getLineText(cursorLine+1) );\r\n\t\t\t\t// Remove the line in question from our data structure\r\n\t\t\t\tparamDoc.removeLine( cursorLine+1 );\r\n\t\t\t} else {\r\n\t\t\t\t// \"Remove\" the character at the cursorColumn position\r\n\t\t\t\tvar tempText = paramDoc.getLineText( cursorLine );\r\n\t\t\t\tparamDoc.setLineText( cursorLine, tempText.substring(0,cursorColumn) + tempText.substring(cursorColumn+1) );\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase ENTERKEY:\r\n\t\t\t// If there is currently a selection, we want to simply delete it first, THEN add the 'newline'\r\n\t\t\tif ( paramDoc.isSelection ) {\r\n\t\t\t\tvar tmpSel = paramDoc.getCurrentSelection();\r\n\t\t\t\tvar newCursorCoords = paramDoc.replaceTextInRange( tmpSel.startLine, tmpSel.startColumn, tmpSel.endLine, tmpSel.endColumn ); // no last parameter = delete text\r\n\t\t\t\tcursorLine = newCursorCoords[0];\r\n\t\t\t\tcursorColumn = newCursorCoords[1];\r\n\t\t\t}\t\r\n\t\t\t// When we press the enter key, we need to insert a new line into the document\r\n\t\t\t// We need to insert a new line following the current line, which contains the current line's text starting from the cursor\r\n\t\t\tparamDoc.insertLine( cursorLine+1, paramDoc.getLineText( cursorLine ).substring( cursorColumn ) );\r\n\t\t\tparamDoc.setLineText( cursorLine, paramDoc.getLineText( cursorLine ).substring( 0, cursorColumn ) );\r\n\t\t\t// Update the cursor\r\n\t\t\tcursorLine++;\r\n\t\t\tcursorColumn = 0;\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase TABKEY:\r\n\t\t\t// If there is currently a selection, we want to simply delete it first, THEN add the tab\r\n\t\t\tif ( paramDoc.isSelection ) {\r\n\t\t\t\tvar tmpSel = paramDoc.getCurrentSelection();\r\n\t\t\t\tvar newCursorCoords = paramDoc.replaceTextInRange( tmpSel.startLine, tmpSel.startColumn, tmpSel.endLine, tmpSel.endColumn ); // no last parameter = delete text\r\n\t\t\t\tcursorLine = newCursorCoords[0];\r\n\t\t\t\tcursorColumn = newCursorCoords[1];\r\n\t\t\t}\t\r\n\t\t\t// Insert 4 spaces at current cursor position\r\n\t\t\t// SUPER HACK: Need to redesign functions a bit to eliminate redundancy and make it cleaner and more readable. \r\n\t\t\t// We eventually want this to call an \"insertText()\" , but for now....\r\n\t\t\ttypeCharacter( paramDoc, \" \".charCodeAt(0) );\r\n\t\t\ttypeCharacter( paramDoc, \" \".charCodeAt(0) );\r\n\t\t\ttypeCharacter( paramDoc, \" \".charCodeAt(0) );\r\n\t\t\ttypeCharacter( paramDoc, \" \".charCodeAt(0) );\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase SHIFTKEY:\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase CAPSLOCKKEY:\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase HIDECHATWINDOWSKEY:\r\n\t\t\tif( paramIsCtl ) { hideChatShortcut(); }\r\n\t\t\telse{ return true; }\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t//For autobracketing\r\n\t\tcase LEFTBRACKET:\r\n\t\t\t// If there is currently a selection, we want to simply delete it first, then go from there\r\n\t\t\tif ( paramDoc.isSelection ) {\r\n\t\t\t\tvar tmpSel = paramDoc.getCurrentSelection();\r\n\t\t\t\tvar newCursorCoords = paramDoc.replaceTextInRange( tmpSel.startLine, tmpSel.startColumn, tmpSel.endLine, tmpSel.endColumn ); // no last parameter = delete text\r\n\t\t\t\tcursorLine = newCursorCoords[0];\r\n\t\t\t\tcursorColumn = newCursorCoords[1];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( !paramIsShift ) { return true; }\r\n\t\t\tif(isFF == true)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar origCursorCol = this.getCursorColumn();\r\n\t\t\t\t\tthis.setCursor(this.getCursorLine(), origCursorCol+1);\r\n\t\t\t\t\ttypeCharacter( paramDoc, \"}\".charCodeAt(0) );\r\n\t\t\t\t\tthis.setCursor(this.getCursorLine(), origCursorCol);\r\n\t\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tvar curChar = paramDoc.getLineText(cursorLine).substring(cursorColumn, cursorColumn+1);\r\n\t\t\t\tif(curChar != '{')\r\n\t\t\t\t{\r\n\t\t\t\t\ttypeCharacter( paramDoc, \"{\".charCodeAt(0) );\r\n\t\t\t\t\ttypeCharacter( paramDoc, \"}\".charCodeAt(0) );\r\n\t\t\t\t\tthis.setCursor(this.getCursorLine(), this.getCursorColumn()-1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase LEFTPAREN:\r\n\t\t\t// If there is currently a selection, we want to simply delete it first, then go from there\r\n\t\t\tif ( paramDoc.isSelection ) {\r\n\t\t\t\tvar tmpSel = paramDoc.getCurrentSelection();\r\n\t\t\t\tvar newCursorCoords = paramDoc.replaceTextInRange( tmpSel.startLine, tmpSel.startColumn, tmpSel.endLine, tmpSel.endColumn ); // no last parameter = delete text\r\n\t\t\t\tcursorLine = newCursorCoords[0];\r\n\t\t\t\tcursorColumn = newCursorCoords[1];\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif( !paramIsShift ) { return true; }\r\n\t\t\tif(isFF == true)\r\n\t\t\t\t{\r\n\t\t\t\t\tvar origCursorCol = this.getCursorColumn();\r\n\t\t\t\t\tthis.setCursor(this.getCursorLine(), origCursorCol+1);\r\n\t\t\t\t\ttypeCharacter( paramDoc, \")\".charCodeAt(0) );\r\n\t\t\t\t\tthis.setCursor(this.getCursorLine(), origCursorCol);\r\n\t\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tvar curChar = paramDoc.getLineText(cursorLine).substring(cursorColumn, cursorColumn+1);\r\n\t\t\t\tif(curChar != '(')\r\n\t\t\t\t{\r\n\t\t\t\t\ttypeCharacter( paramDoc, \"(\".charCodeAt(0) );\r\n\t\t\t\t\ttypeCharacter( paramDoc, \")\".charCodeAt(0) );\r\n\t\t\t\t\tthis.setCursor(this.getCursorLine(), this.getCursorColumn()-1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase FINDKEY:\r\n\t\t\tif( paramIsCtl ) { findMenuClick(); }\r\n\t\t\telse{ return true; }\r\n\t\t\tbreak;\r\n\t\tcase REPLACEKEY:\r\n\t\t\tif( paramIsCtl ) { replaceMenuClick(); }\r\n\t\t\telse{ return true; }\r\n\t\t\tbreak;\r\n\t\tcase GOTOKEY:\r\n\t\t\tif( paramIsCtl ) { gotoMenuClick(); }\r\n\t\t\telse{ return true; }\r\n\t\t\tbreak;\r\n\t\tcase SELECTALLKEY:\r\n\t\t\tif( paramIsCtl ) { selectAllMenuClick(); }\r\n\t\t\telse{ return true; }\r\n\t\t\tbreak;\r\n\t\tcase CUTKEY:\r\n\t\t\tif( paramIsCtl ) { cutIconClicked(); }\r\n\t\t\telse{ return true; }\r\n\t\t\tbreak;\r\n\t\tcase COPYKEY:\r\n\t\t\tif( paramIsCtl ) { copyIconClicked(); }\r\n\t\t\telse{ return true; }\r\n\t\t\tbreak;\r\n\t\tcase PASTEKEY:\r\n\t\t\tif( paramIsCtl ) { pasteIconClicked(); }\r\n\t\t\telse{ return true; }\r\n\t\t\tbreak;\r\n\t\tcase NEWKEY:\r\n\t\t\tif( paramIsCtl ) { newMenuClick(); }\r\n\t\t\telse{ return true; }\r\n\t\t\tbreak;\r\n\t\tcase OPENKEY:\r\n\t\t\tif( paramIsCtl ) { openMenuClick(); }\r\n\t\t\telse{ return true; }\r\n\t\t\tbreak;\r\n\t\tcase UPLOADKEY:\r\n\t\t\tif( paramIsCtl ) { uploadMenuClick(); }\r\n\t\t\telse{ return true; }\r\n\t\t\tbreak;\r\n\t\tcase COLORKEY:\r\n\t\t\tif( paramIsCtl ) { colorMenuClick(); }\r\n\t\t\telse{ return true; }\r\n\t\t\tbreak;\r\n\t\tcase HIGHLIGHTKEY:\r\n\t\t\tif( paramIsCtl ) { highlighMenuClick(); }\r\n\t\t\telse{ return true; }\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\treturn true;\t\t// Return values are this way for the convenience of the onKeyDown event handler function\r\n\t}\r\n\treturn false;\t// Return values are this way for the convenience of the onKeyDown event handler function\r\n} // END typeSpecial(paramKEY)", "function openPositionedWindow2(url, name, width, height, x, y, status, scrollbars, moreProperties, openerName) {\n\t\n\t// ie4.5 mac - windows are 2 pixels too short; if a statusbar is used, the window will be an additional 15 pixels short\n\tvar agent = navigator.userAgent.toLowerCase();\n\tif (agent.indexOf(\"mac\")!=-1 && agent.indexOf(\"msie\") != -1 && agent.indexOf(\"msie 5.0\")==-1) {\n\t\theight += 2;\n\t\tif (status) height += 15;\n\t}\n\n\t// Adjust width if scrollbars are used (pc places scrollbars inside the content area; mac outside) \n\twidth += (scrollbars != '' && scrollbars != null && agent.indexOf(\"mac\") == -1) ? 16 : 0;\n\n\tvar properties = 'width=' + width + ',height=' + height + ',screenX=' + x + ',screenY=' + y + ',left=' + x + ',top=' + y + ((status) ? ',status' : '') + ',scrollbars' + ((scrollbars) ? '' : '=no') + ((moreProperties) ? ',' + moreProperties : '');\n\tvar reference = openWindow2(url, name, properties, openerName);\n\t\n\t// resize window in ie if we can resize in ns; very messy\n\t// commented out because openPositionedWindow() doesn't set the resizable attribute\n\t// left in for reference\n\t/*if (resizable && agent.indexOf(\"msie\") != -1) {\n\t\tif (agent.indexOf(\"mac\") != -1) {\n\t\t\theight += (status) ? 15 : 2;\n\t\t\tif (parseFloat(navigator.appVersion) > 5) width -= 11;\n\t\t}\n\t\telse {\n\t\t\theight += (status) ? 49 : 31;\n\t\t\twidth += 13;\n\t\t}\n\t\tsetTimeout('if (reference != null && !reference.closed) reference.resizeTo(' + width + ',' + height + ');', 150);\n\t}*/\n\n\treturn reference;\n}", "function Socket() {}", "function P(a){return _.isWindow(a)?a:9===a.nodeType&&a.defaultView}", "enter() {\n\t\tdelete this.write;\n\t\tprocess.once('uncaughtException', this.onUncaughtException);\n\t\tthis.i.setRawMode(true);\n\t\tthis.write(\"\\x1B[?1049h\\x1B[?12l\"); //alternate buffer + disable blinking cursor\n\t\tthis.i.on('data', this.onKey);\n\t\tthis.o.on('resize', this.onResize);\n\t\tprocess.once('exit', this.onKill);\n\t\tprocess.once('SIGTERM', this.onKill);\n\t\tprocess.once('SIGINT', this.onKill);\n\t\tthis.onResize(true);\n\t}", "function Shell() {\n // Properties\n this.promptStr = \">\";\n this.commandList = [];\n this.curses = \"[fuvg],[cvff],[shpx],[phag],[pbpxfhpxre],[zbgureshpxre],[gvgf], [ybir]\";\n this.apologies = \"[sorry], [gomenen], [gomen], [gomenasai]\";\n // Methods\n this.init = shellInit;\n this.putPrompt = shellPutPrompt;\n this.handleInput = shellHandleInput;\n this.execute = shellExecute;\n}", "function __loadCompatLayer(w) {\n w.Debug = function() {\n };\n w.Debug._fail = function(message) {\n throw new Error(message);\n };\n w.Debug.writeln = function(text) {\n if (window.console) {\n if (window.console.debug) {\n window.console.debug(text);\n return;\n }\n else if (window.console.log) {\n window.console.log(text);\n return;\n }\n }\n else if (window.opera &&\n window.opera.postError) {\n window.opera.postError(text);\n return;\n }\n };\n\n w.__getNonTextNode = function(node) {\n try {\n while (node && (node.nodeType != 1)) {\n node = node.parentNode;\n }\n }\n catch (ex) {\n node = null;\n }\n return node;\n };\n \n w.__getLocation = function(e) {\n var loc = {x : 0, y : 0};\n while (e) {\n loc.x += e.offsetLeft;\n loc.y += e.offsetTop;\n e = e.offsetParent;\n }\n return loc;\n };\n\n // Allow caching regex objects for performance\n RegExp._cacheable = true;\n\n // Skip RegExp.test in String.quote to improve performance.\n String._quoteSkipTest = true;\n\n w.navigate = function(url) {\n window.setTimeout('window.location = \"' + url + '\";', 0);\n };\n\n var attachEventProxy = function(eventName, eventHandler) {\n eventHandler._mozillaEventHandler = function(e) {\n window.event = e;\n eventHandler();\n if (!e.avoidReturn) {\n return e.returnValue;\n }\n };\n this.addEventListener(eventName.slice(2), eventHandler._mozillaEventHandler, false);\n };\n\n var detachEventProxy = function (eventName, eventHandler) {\n if (eventHandler._mozillaEventHandler) {\n var mozillaEventHandler = eventHandler._mozillaEventHandler;\n delete eventHandler._mozillaEventHandler;\n \n this.removeEventListener(eventName.slice(2), mozillaEventHandler, false);\n }\n };\n\n w.attachEvent = attachEventProxy;\n w.detachEvent = detachEventProxy;\n w.HTMLDocument.prototype.attachEvent = attachEventProxy;\n w.HTMLDocument.prototype.detachEvent = detachEventProxy;\n w.HTMLElement.prototype.attachEvent = attachEventProxy;\n w.HTMLElement.prototype.detachEvent = detachEventProxy;\n\n w.Event.prototype.__defineGetter__('srcElement', function() {\n // __getNonTextNode(this.target) is the expected implementation.\n // However script.load has target set to the Document object... so we\n // need to throw in currentTarget as well.\n return __getNonTextNode(this.target) || this.currentTarget;\n });\n w.Event.prototype.__defineGetter__('cancelBubble', function() {\n return this._bubblingCanceled || false;\n });\n w.Event.prototype.__defineSetter__('cancelBubble', function(v) {\n if (v) {\n this._bubblingCanceled = true;\n this.stopPropagation();\n }\n });\n w.Event.prototype.__defineGetter__('returnValue', function() {\n return !this._cancelDefault;\n });\n w.Event.prototype.__defineSetter__('returnValue', function(v) {\n if (!v) {\n this._cancelDefault = true;\n this.preventDefault();\n }\n });\n w.Event.prototype.__defineGetter__('fromElement', function () {\n var n;\n if (this.type == 'mouseover') {\n n = this.relatedTarget;\n }\n else if (this.type == 'mouseout') {\n n = this.target;\n }\n return __getNonTextNode(n);\n });\n w.Event.prototype.__defineGetter__('toElement', function () {\n var n;\n if (this.type == 'mouseout') {\n n = this.relatedTarget;\n }\n else if (this.type == 'mouseover') {\n n = this.target;\n }\n return __getNonTextNode(n);\n });\n w.Event.prototype.__defineGetter__('button', function() {\n return (this.which == 1) ? 1 : (this.which == 3) ? 2 : 0\n });\n w.Event.prototype.__defineGetter__('offsetX', function() {\n return window.pageXOffset + this.clientX - __getLocation(this.srcElement).x;\n });\n w.Event.prototype.__defineGetter__('offsetY', function() {\n return window.pageYOffset + this.clientY - __getLocation(this.srcElement).y;\n });\n\n w.HTMLElement.prototype.__defineGetter__('parentElement', function() {\n return this.parentNode;\n });\n w.HTMLElement.prototype.__defineGetter__('children', function() {\n var children = [];\n var childCount = this.childNodes.length;\n for (var i = 0; i < childCount; i++) {\n var childNode = this.childNodes[i];\n if (childNode.nodeType == 1) {\n children.push(childNode);\n }\n }\n return children;\n });\n w.HTMLElement.prototype.__defineGetter__('innerText', function() { \n try {\n return this.textContent\n } \n catch (ex) {\n var text = '';\n for (var i=0; i < this.childNodes.length; i++) {\n if (this.childNodes[i].nodeType == 3) {\n text += this.childNodes[i].textContent;\n }\n }\n return str;\n }\n });\n w.HTMLElement.prototype.__defineSetter__('innerText', function(v) {\n var textNode = document.createTextNode(v);\n this.innerHTML = '';\n this.appendChild(textNode);\n });\n w.HTMLElement.prototype.__defineGetter__('currentStyle', function() {\n return window.getComputedStyle(this, null);\n });\n w.HTMLElement.prototype.__defineGetter__('runtimeStyle', function() {\n return window.getOverrideStyle(this, null);\n });\n w.HTMLElement.prototype.removeNode = function(b) {\n return this.parentNode.removeChild(this)\n };\n w.HTMLElement.prototype.contains = function(el) {\n while (el != null && el != this) {\n el = el.parentNode;\n }\n return (el!=null)\n };\n\n w.HTMLStyleElement.prototype.__defineGetter__('styleSheet', function() {\n return this.sheet;\n });\n w.CSSStyleSheet.prototype.__defineGetter__('rules', function() {\n return this.cssRules;\n });\n w.CSSStyleSheet.prototype.addRule = function(selector, style, index) {\n this.insertRule(selector + '{' + style + '}', index);\n };\n w.CSSStyleSheet.prototype.removeRule = function(index) {\n this.deleteRule(index);\n };\n w.CSSStyleDeclaration.prototype.__defineGetter__('styleFloat', function() {\n return this.cssFloat;\n });\n w.CSSStyleDeclaration.prototype.__defineSetter__('styleFloat', function(v) {\n this.cssFloat = v;\n });\n DocumentFragment.prototype.getElementById = function(id) {\n var nodeQueue = [];\n var childNodes = this.childNodes;\n var node;\n var c;\n \n for (c = 0; c < childNodes.length; c++) {\n node = childNodes[c];\n if (node.nodeType == 1) {\n nodeQueue.push(node);\n }\n }\n\n while (nodeQueue.length) {\n node = nodeQueue.dequeue();\n if (node.id == id) {\n return node;\n }\n childNodes = node.childNodes;\n if (childNodes.length != 0) {\n for (c = 0; c < childNodes.length; c++) {\n node = childNodes[c];\n if (node.nodeType == 1) {\n nodeQueue.push(node);\n }\n }\n }\n }\n\n return null;\n };\n\n DocumentFragment.prototype.getElementsByTagName = function(tagName) {\n var elements = [];\n var nodeQueue = [];\n var childNodes = this.childNodes;\n var node;\n var c;\n\n for (c = 0; c < childNodes.length; c++) {\n node = childNodes[c];\n if (node.nodeType == 1) {\n nodeQueue.push(node);\n }\n }\n\n while (nodeQueue.length) {\n node = nodeQueue.dequeue();\n if (node.tagName == tagName) {\n elements.add(node);\n }\n childNodes = node.childNodes;\n if (childNodes.length != 0) {\n for (c = 0; c < childNodes.length; c++) {\n node = childNodes[c];\n if (node.nodeType == 1) {\n nodeQueue.push(node);\n }\n }\n }\n }\n\n return elements;\n };\n\n DocumentFragment.prototype.createElement = function(tagName) {\n return document.createElement(tagName);\n };\n\n var selectNodes = function(doc, path, contextNode) {\n contextNode = contextNode ? contextNode : doc;\n var xpath = new XPathEvaluator();\n var result = xpath.evaluate(path, contextNode,\n doc.createNSResolver(doc.documentElement),\n XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n\n var nodeList = new Array(result.snapshotLength);\n for(var i = 0; i < result.snapshotLength; i++) {\n nodeList[i] = result.snapshotItem(i);\n }\n\n return nodeList;\n };\n\n var selectSingleNode = function(doc, path, contextNode) {\n path += '[1]';\n var nodes = selectNodes(doc, path, contextNode);\n if (nodes.length != 0) {\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i]) {\n return nodes[i];\n }\n }\n }\n return null;\n };\n\n w.XMLDocument.prototype.selectNodes = function(path, contextNode) {\n return selectNodes(this, path, contextNode);\n };\n\n w.XMLDocument.prototype.selectSingleNode = function(path, contextNode) {\n return selectSingleNode(this, path, contextNode);\n };\n\n w.XMLDocument.prototype.transformNode = function(xsl) {\n var xslProcessor = new XSLTProcessor();\n xslProcessor.importStylesheet(xsl);\n\n var ownerDocument = document.implementation.createDocument(\"\", \"\", null);\n var transformedDoc = xslProcessor.transformToDocument(this);\n \n return transformedDoc.xml;\n };\n\n Node.prototype.selectNodes = function(path) {\n var doc = this.ownerDocument;\n return doc.selectNodes(path, this);\n };\n\n Node.prototype.selectSingleNode = function(path) {\n var doc = this.ownerDocument;\n return doc.selectSingleNode(path, this);\n };\n\n Node.prototype.__defineGetter__('baseName', function() {\n return this.localName;\n });\n\n Node.prototype.__defineGetter__('text', function() {\n return this.textContent;\n });\n Node.prototype.__defineSetter__('text', function(value) {\n this.textContent = value;\n });\n\n Node.prototype.__defineGetter__('xml', function() {\n return (new XMLSerializer()).serializeToString(this);\n });\n}", "function shellLS()\n{\n krnDiskLS();\n}", "function SystemProto() {}", "function SystemProto() {}", "function SystemProto() {}", "function applyEscape( options , ... args ) {\n\tvar fn , newOptions , wrapOptions ;\n\n\t// Cause trouble because the shutting down process itself needs to send escape sequences asynchronously\n\t//if ( options.root.shutdown && ! options.str ) { return options.root ; }\n\n\tif ( options.bounded ) { args = options.bounded.concat( args ) ; }\n\n\t//console.error( args ) ;\n\tif ( options.bind ) {\n\t\tnewOptions = Object.assign( {} , options , { bind: false , bounded: args } ) ;\n\t\tfn = applyEscape.bind( this , newOptions ) ;\n\n\t\t// Still a nasty hack...\n\t\tObject.setPrototypeOf( fn , Object.getPrototypeOf( options.root ) ) ;\n\t\tfn.apply = Function.prototype.apply ;\n\t\tfn.root = options.root ;\n\t\tfn.options = newOptions ;\n\n\t\treturn fn ;\n\t}\n\n\tvar onFormat = [ options.on ] , output , on , off ;\n\tvar action = args[ options.params ] ;\n\n\t// If not enough arguments, return right now\n\t// Well... what about term.up(), term.previousLine(), and so on?\n\t//if ( arguments.length < 1 + options.params && ( action === null || action === false ) ) { return options.root ; }\n\n\tif ( options.params ) {\n\t\tonFormat = onFormat.concat( args.slice( 0 , options.params ) ) ;\n\t}\n\n\t//console.log( '\\n>>> Action:' , action , '<<<\\n' ) ;\n\t//console.log( 'Attributes:' , attributes ) ;\n\tif ( action === undefined || action === true ) {\n\t\ton = options.onHasFormatting ? options.root.format( ... onFormat ) : options.on ;\n\t\tif ( options.str ) { return on ; }\n\t\toptions.out.write( on ) ;\n\t\treturn options.root ;\n\t}\n\n\tif ( action === null || action === false ) {\n\t\toff = options.offHasFormatting ? options.root.format( options.off ) : options.off ;\n\t\tif ( options.str ) { return off ; }\n\t\toptions.out.write( off ) ;\n\t\treturn options.root ;\n\t}\n\n\tif ( typeof action !== 'string' ) {\n\t\tif ( typeof action.toString === 'function' ) { action = action.toString() ; }\n\t\telse { action = '' ; }\n\t}\n\n\t// So we have got a string\n\n\ton = options.onHasFormatting ? options.root.format( ... onFormat ) : options.on ;\n\n\tif ( options.markupOnly ) {\n\t\taction = options.root.markup( ... args.slice( options.params ) ) ;\n\t}\n\telse if ( ! options.noFormat ) {\n\t\taction = options.root.format( ... args.slice( options.params ) ) ;\n\t}\n\n\tif ( options.wrap ) {\n\t\tif ( options.root.wrapOptions.x && options.root.wrapOptions.x > 1 ) {\n\t\t\twrapOptions = {\n\t\t\t\twidth: options.root.wrapOptions.width || options.root.width - options.root.wrapOptions.x + 1 ,\n\t\t\t\tglue: '\\n' + options.root.str.column( options.root.wrapOptions.x ) ,\n\t\t\t\toffset: options.root.wrapOptions.offset ,\n\t\t\t\tupdateOffset: true ,\n\t\t\t\tskipFn: termkit.escapeSequenceSkipFn\n\t\t\t} ;\n\n\t\t\taction = string.wordwrap( action , wrapOptions ) ;\n\n\t\t\tif ( ! options.root.wrapOptions.continue ) {\n\t\t\t\taction = options.root.str.column( options.root.wrapOptions.x ) + action ;\n\t\t\t}\n\n\t\t\toptions.root.wrapOptions.continue = true ;\n\t\t\toptions.root.wrapOptions.offset = wrapOptions.offset ;\n\t\t}\n\t\telse {\n\t\t\twrapOptions = {\n\t\t\t\twidth: options.root.wrapOptions.width || options.root.width ,\n\t\t\t\tglue: '\\n' ,\n\t\t\t\toffset: options.root.wrapOptions.offset ,\n\t\t\t\tupdateOffset: true ,\n\t\t\t\tskipFn: termkit.escapeSequenceSkipFn\n\t\t\t} ;\n\n\t\t\taction = string.wordwrap( action , wrapOptions ) ;\n\t\t\toptions.root.wrapOptions.continue = true ;\n\t\t\toptions.root.wrapOptions.offset = wrapOptions.offset ;\n\t\t}\n\t}\n\telse {\n\t\t// All non-wrapped string display reset the offset\n\t\toptions.root.wrapOptions.continue = false ;\n\t\toptions.root.wrapOptions.offset = 0 ;\n\t}\n\n\toff = options.offHasFormatting ? options.root.format( options.off ) : options.off ;\n\n\tif ( options.forceStyleOnReset ) {\n\t\taction = action.replace( new RegExp( string.escape.regExp( options.root.optimized.styleReset ) , 'g' ) , options.root.optimized.styleReset + on ) ;\n\t}\n\n\tif ( options.root.resetString ) {\n\t\toutput = options.root.resetString + on + action + off + options.root.resetString ;\n\t}\n\telse {\n\t\toutput = on + action + off ;\n\t}\n\n\t// tmp hack?\n\tif ( options.crlf ) { output = output.replace( /\\n/g , '\\r\\n' ) ; }\n\n\tif ( options.str ) { return output ; }\n\n\toptions.out.write( output ) ;\n\n\treturn options.root ;\n}", "function crest_kernel() {\n var command = command_pass;\n var command_query = command.split(\"#\");\n\n var command_pointer = command_query[1];\n if (command_pointer == \"settings\"){open_settings();} // open settings\n if (command_pointer == \"tools\"){open_tools();} // open tools\n if (command_pointer == \"kill\") {kill();} // kill test command;\n if (command_pointer == \"import-code\") {import_template();} \n if (command_pointer == \"dclose\") {w3_close();} //close dashboard\n if (command_pointer == \"dopen\") {w3_open();} // open sideboard\n}", "function DeviceDriverFileSystem(){ // Add or override specific attributes and method pointers.{\n // \"subclass\"-specific attributes.\n // this.buffer = \"\"; // TODO: Do we need this?\n // Override the base method pointers.\n this.driverEntry = function(){\n // Initialization routine for this, the kernel-mode Keyboard Device Driver.\n this.status = \"loaded\";\n // More?\n };\n this.isr = function(params){\n //expect to receive params as follows[filename | new program,operation,data,from user | os]\n switch(params[1]){\n case 0: createFile(params); break;\n case 1: readFile(params); break;\n case 2: writeFile(params); break;\n case 3: deleteFile(params); break;\n case 4: format(); break;\n case 5: listFiles(); break;\n case 6: findProgramFiles(); break;\n case 7: swapProcess(params); break;\n default: console.log(\"blakejrlbkadflkdaf\"); break;\n }\n };\n this.test = function(){\n updateMBR();\n }\n}", "function browser(){}", "function browser(){}", "function mkobj(pty) {\n return new pty.constructor()\n}", "refresh(isLinuxMouseSelection) {\n // Queue the refresh for the renderer\n if (!this._refreshAnimationFrame) {\n this._refreshAnimationFrame = window.requestAnimationFrame(() => this._refresh());\n }\n // If the platform is Linux and the refresh call comes from a mouse event,\n // we need to update the selection for middle click to paste selection.\n if (isLinux && isLinuxMouseSelection) {\n const selectionText = this.selectionText;\n if (selectionText.length) {\n this._onLinuxMouseSelection.fire(this.selectionText);\n }\n }\n }", "function updateStatusWindowOld(){\r\n\tvar value = parseInt(hatsForm.CURSORPOSITION.value);\r\n\tif (!isNaN(value)) {\r\n\t\tstatwin[0]=\" \"+value +\" (\"+ ConvertPosToRow(value, intNumberOfColumns)+\",\"+ ConvertPosToCol(value, intNumberOfColumns)+\")\";\r\n\t}\r\n\tif (isOverWriteMode()) statwin[1]=\"[]\";\r\n\telse\r\n\t\tstatwin[1]=\"|\";\r\n\tif (screenLocked){\r\n\t\tstatwin[3]=\" >< \";\r\n\t}\r\n\tvar strstat=\"\";\r\n\tif (carettrackingenabled) strstat=strstat+statwin[0];\r\n\tif (overwritemodeenabled) strstat=strstat+\" \"+statwin[1];\r\n\tif (statwin[2]!=\" \") strstat=strstat+\" \"+statwin[2];\r\n\tif (screenLocked) strstat=strstat+\" \"+statwin[3];\r\n\tif (enableBIDI){\r\n\t\twindow.status = statusBIDI;\r\n\t} else\r\n\t\twindow.status=strstat;\r\n}", "function WysiwymTextarea(textarea) {\n this.NEWLINE = \"\\n\"; // Newline Character specified to Browser\n var NONE = { prefix: '' } // Line Type NONE\n var lines = new Array(); // Array Line objects { type, text, selected }\n var cursor = { // Internal Cursor Object { start, end }\n start: { line:0, position:0 }, // Cursor Start Position { line, position }\n end: { line:0, position:0 }, // Cursor End Position { line, position }\n scroll: 0 // Current Scroll Position \n }\n \n /*-------------------------------------------------------------------\n * Simple Public Functions\n *------------------------------------------------------------------ */\n this.getCursor = function() { return cursor; }\n this.getLines = function() { return lines; }\n this.getNumLines = function() { return lines.length; }\n this.getLine = function(lineNum) { return lines[lineNum]; }\n this.getSelectionRange = function() { return [cursor.start.line, cursor.end.line]; }\n \n /*-------------------------------------------------------------------\n * @public getSelection: Return the current selected text.\n *------------------------------------------------------------------ */\n this.getSelection = function() {\n var selection = \"\";\n for (i in lines) {\n var text = lines[i].text;\n if ((i == cursor.start.line) && (i == cursor.end.line))\n return text.substring(cursor.start.position, cursor.end.position);\n if (i == cursor.start.line)\n selection = selection + text.substring(cursor.start.position, text.length);\n if ((i > cursor.start.line) && (i < cursor.end.line))\n selection = selection + text;\n if (i == cursor.end.line)\n selection = selection + text.substring(0, cursor.end.position)\n }\n return selection;\n }\n \n /*-------------------------------------------------------------------\n * @public getSelection: Return the length of Selection text\n *------------------------------------------------------------------ */\n this.getSelectionLength = function() {\n var selection = this.getSelection();\n return selection.length;\n }\n \n /*-------------------------------------------------------------------\n * @public hasPrefix: Return true if the current selection has the\n * specified prefix text. NOTE: Does not work with return lines.\n *------------------------------------------------------------------ */\n this.selectionHasPrefix = function(prefixText) {\n var lineText = lines[cursor.start.line].text;\n var start = cursor.start.position - prefixText.length;\n if (start < 0) { return false; }\n if (lineText.substring(start, cursor.start.position) != prefixText) { return false; }\n return true;\n }\n \n /*-------------------------------------------------------------------\n * @public hasPrefix: Return true if the current selection has the\n * specified suffix text. NOTE: Does not work with return lines.\n *------------------------------------------------------------------ */\n this.selectionHasSuffix = function(suffixText) {\n var lineText = lines[cursor.end.line].text;\n var end = cursor.end.position + suffixText.length;\n if (end > lineText.length) { return false; }\n if (lineText.substring(cursor.end.position, end) != suffixText) { return false; }\n return true;\n }\n \n /*-------------------------------------------------------------------\n * @public prependToSelection: Insert the specified text at at the cursor\n * start position and make it selected.\n *------------------------------------------------------------------ */\n this.prependToSelection = function(insertText) {\n var lineText = lines[cursor.start.line].text;\n var newText = lineText.substring(0, cursor.start.position) +\n insertText + lineText.substring(cursor.start.position, lineText.length);\n lines[cursor.start.line].text = newText;\n // Update Class Variables\n if (cursor.start.line == cursor.end.line)\n cursor.end.position += insertText.length;\n }\n \n /*-------------------------------------------------------------------\n * @public appendToSelection: Insert the specified text at at the cursor\n * end position and make it selected.\n *------------------------------------------------------------------ */\n this.appendToSelection = function(insertText) {\n var lineText = lines[cursor.end.line].text;\n var newText = lineText.substring(0, cursor.end.position) +\n insertText + lineText.substring(cursor.end.position, lineText.length);\n lines[cursor.end.line].text = newText;\n // Update Class Variables\n cursor.end.position += insertText.length;\n }\n \n /*-------------------------------------------------------------------\n * @public insertSelectionPrefix: Insert the specified text at at the cursor\n * start position. NOTE: This does not work with return lines.\n *------------------------------------------------------------------ */\n this.insertSelectionPrefix = function(prefixText) {\n var lineText = lines[cursor.start.line].text;\n var newText = lineText.substring(0, cursor.start.position) +\n prefixText + lineText.substring(cursor.start.position, lineText.length);\n lines[cursor.start.line].text = newText;\n // Update Class Variables\n cursor.start.position += prefixText.length;\n if (cursor.start.line == cursor.end.line)\n cursor.end.position += prefixText.length;\n }\n \n /*-------------------------------------------------------------------\n * @public insertSelectionSuffix: Insert the specified text at at the cursor\n * end position. NOTE: This does not work with return lines.\n *------------------------------------------------------------------ */\n this.insertSelectionSuffix = function(suffixText) {\n var lineText = lines[cursor.end.line].text;\n var newText = lineText.substring(0, cursor.end.position) +\n suffixText + lineText.substring(cursor.end.position, lineText.length);\n lines[cursor.end.line].text = newText;\n }\n \n /*-------------------------------------------------------------------\n * @public removePrefix: Remove the specified prefix text if it\n * matches with the passed in value. Returns boolean True it\n * was successful, False otherwise.\n *------------------------------------------------------------------ */\n this.removeSelectionPrefix = function(prefixText) {\n if (this.selectionHasPrefix(prefixText)) {\n var lineText = lines[cursor.start.line].text;\n var start = cursor.start.position - prefixText.length;\n var newText = lineText.substring(0, start) +\n lineText.substring(cursor.start.position, lineText.length);\n lines[cursor.start.line].text = newText;\n // Update Class Variables\n cursor.start.position -= prefixText.length;\n if (cursor.start.line == cursor.end.line)\n cursor.end.position -= prefixText.length;\n return true;\n }\n return false;\n }\n \n /*-------------------------------------------------------------------\n * @public removeSuffix: Remove the specified suffix text if it\n * matches with the passed in value. Returns boolean True it\n * was successful, False otherwise.\n *------------------------------------------------------------------ */\n this.removeSelectionSuffix = function(suffixText) {\n if (this.selectionHasSuffix(suffixText)) {\n var lineText = lines[cursor.end.line].text;\n var end = cursor.end.position + suffixText.length;\n var newText = lineText.substring(0, cursor.end.position) +\n lineText.substring(end, lineText.length);\n lines[cursor.end.line].text = newText;\n return true;\n }\n return false;\n }\n \n /*-------------------------------------------------------------------\n * @public isWrapped: Return True if the selection is wrapped\n * in the specified prefix and suffix text. Otherwise False.\n * NOTE: Does not work with return lines.\n *------------------------------------------------------------------ */\n this.selectionIsWrapped = function(prefixText, suffixText) {\n if (suffixText == null) { suffixText = prefixText; }\n return ((this.selectionHasPrefix(prefixText)) && (this.selectionHasSuffix(suffixText)))\n }\n \n /*-------------------------------------------------------------------\n * @public wrap: Wrap the cursor or currently selected text\n * with the specified newTextBefore and newTextAfter.\n *------------------------------------------------------------------ */\n this.wrapSelection = function(prefixText, suffixText) {\n if (suffixText == null) { suffixText = prefixText; }\n this.insertSelectionPrefix(prefixText);\n this.insertSelectionSuffix(suffixText);\n }\n \n /*-------------------------------------------------------------------\n * @public unwrap: Unwrap the selection by removeing the prefix\n * and suffix text specified. Returns boolean True it\n * was successful, False otherwise.\n *------------------------------------------------------------------ */\n this.unwrapSelection = function(prefixText, suffixText) {\n if (suffixText == null) { suffixText = prefixText; }\n if ((this.selectionHasPrefix(prefixText)) && (this.selectionHasSuffix(suffixText))) {\n this.removeSelectionPrefix(prefixText);\n this.removeSelectionSuffix(suffixText);\n return true;\n }\n return false;\n }\n \n /*-------------------------------------------------------------------\n * @public insertLinePrefix: Return True if the line has the\n * specified prefix.\n *------------------------------------------------------------------ */\n this.lineHasPrefix = function(lineNum, prefixText) {\n return lines[lineNum].text.substring(0, prefixText.length) == prefixText;\n }\n \n /*-------------------------------------------------------------------\n * @public insertLinePrefix: Add the Prefix to the specified line.\n *------------------------------------------------------------------ */\n this.insertLinePrefix = function(lineNum, prefixText) {\n var lineText = lines[lineNum].text;\n var newText = prefixText + lineText.substring(0, cursor.start.position) +\n lineText.substring(cursor.start.position, lineText.length);\n lines[lineNum].text = newText;\n // Update Class Variables\n if (lineNum == cursor.start.line)\n cursor.start.position += prefixText.length;\n if (lineNum == cursor.end.line)\n cursor.end.position += prefixText.length;\n }\n \n /*-------------------------------------------------------------------\n * @public removePrefix: Remove the specified prefix text if it\n * matches with the passed in value. Returns boolean True it\n * was successful, False otherwise.\n *------------------------------------------------------------------ */\n this.removeLinePrefix = function(lineNum, prefixText) {\n if (this.lineHasPrefix(lineNum, prefixText)) {\n var lineText = lines[lineNum].text;\n var newText = lineText.substring(prefixText.length, lineText.length);\n lines[lineNum].text = newText;\n // Update Class Variables\n if (lineNum == cursor.start.line)\n cursor.start.position -= prefixText.length;\n if (lineNum == cursor.end.line)\n cursor.end.position -= prefixText.length;\n return true;\n }\n return false;\n }\n \n /*-------------------------------------------------------------------\n * @public insertLineSuffix: Append the suffix to the end of the\n * specified line.\n *------------------------------------------------------------------ */\n this.insertLineSuffix = function(lineNum, suffixText) {\n var lineText = lines[lineNum].text;\n var newText = lineText.substring(0, cursor.start.position) +\n lineText.substring(cursor.start.position, lineText.length) + suffixText;\n lines[lineNum].text = newText;\n }\n \n /*-------------------------------------------------------------------\n * @public insertLinePrefix: Return True if all lines in the\n * selection have the specified prefix.\n *------------------------------------------------------------------ */\n this.selectionLinesHavePrefix = function(prefixText) {\n for (var i=cursor.start.line; i<=cursor.end.line; i++)\n if (!this.lineHasPrefix(i, prefixText))\n return false;\n return true;\n }\n \n /*-------------------------------------------------------------------\n * @public insertLinePrefix: Add the Prefix Text to all lines in\n * the selection.\n *------------------------------------------------------------------ */\n this.insertSelectionLinesPrefix = function(prefixText) {\n for (var i=cursor.start.line; i<=cursor.end.line; i++)\n this.insertLinePrefix(i, prefixText);\n }\n \n /*-------------------------------------------------------------------\n * @public insertLinePrefix: Add the Prefix Text to all lines in\n * the selection.\n *------------------------------------------------------------------ */\n this.removeSelectionLinesPrefix = function(prefixText) {\n for (var i=cursor.start.line; i<=cursor.end.line; i++)\n this.removeLinePrefix(i, prefixText);\n }\n \n /*-------------------------------------------------------------------\n * @public getTextareaProperties: Return the global textarea\n * properties (NOT by Line). This returns the a Map containing:\n * { text, cursorStart, cursorEnd, selectionLength, scroll }\n *------------------------------------------------------------------ */\n this.getTextareaProperties = function() {\n var text = \"\" // Global Textarea Value\n var cursorStart = 0; // Cursor Start Position (chars from beginning of textarea)\n var cursorEnd = 0; // Cursor End Position (chars from beginning of textarea)\n var selectionLength = 0; // Selection Length (total chars)\n var lineStart = 0;\n for (i in lines) {\n text += lines[i].text;\n if (i == cursor.start.line)\n cursorStart = lineStart + cursor.start.position;\n if (i == cursor.end.line)\n cursorEnd = lineStart + cursor.end.position;\n lineStart += lines[i].text.length;\n }\n var selectionLength = cursorEnd - cursorStart;\n return { text:text, cursorStart:cursorStart, cursorEnd:cursorEnd,\n selectionLength:selectionLength, scroll:cursor.scroll }\n }\n \n /*-------------------------------------------------------------------\n * @public update: Update the HTML textarea to reflect all changes\n * made within this class. This is generally the last step in\n * defining a markup button.\n *------------------------------------------------------------------ */\n this.update = function() {\n var textProperties = this.getTextareaProperties();\n // Update the Textarea\n $(textarea).val(textProperties.text);\n if (textarea.createTextRange) {\n range = textarea.createTextRange();\n range.collapse(true);\n range.moveStart('character', textProperties.cursorStart); \n range.moveEnd('character', textProperties.selectionLength);\n range.select();\n } else if (textarea.setSelectionRange) {\n textarea.setSelectionRange(textProperties.cursorStart, textProperties.cursorEnd);\n }\n textarea.scrollTop = textProperties.scroll;\n textarea.focus();\n }\n \n /*-------------------------------------------------------------------\n * @private getCursorProperties: Returns a Map object containing the\n * current the current cursor properties for scroll position,\n * cursor position and selection length.\n *------------------------------------------------------------------ */\n function getCursorProperties() {\n textarea.focus();\n var scroll = textarea.scrollTop; // Current Scroll Position\n var position = 0; // Current Cursor Position\n var selection = \"\"; // Current Selection Length\n if (document.selection) {\n // Internet Explorer\n selection = document.selection.createRange().text; \n if ($.browser.msie) {\n var range = document.selection.createRange();\n var rangeCopy = range.duplicate();\n rangeCopy.moveToElementText(textarea);\n position = -1;\n while(rangeCopy.inRange(range)) {\n rangeCopy.moveStart('character');\n position++;\n }\n } else {\n // Opera\n position = textarea.selectionStart;\n }\n } else {\n // Mozilla\n position = textarea.selectionStart; \n selection = $(textarea).val().substring(position, textarea.selectionEnd);\n }\n return {scroll: scroll, position: position, length: selection.length}\n }\n \n /*-------------------------------------------------------------------\n * @private getTextareaProperties: Updates the class variables for\n * lines in the Textarea and cursor start and end position\n * (in terms of lines).\n *------------------------------------------------------------------ */\n function setupPropertiesByLine() {\n var text = $(textarea).val(); // Initial Textarea Value\n var cursorInfo = getCursorProperties(); // Cursor Properties\n var cursorStart = cursorInfo.position; // Global Cursor Start Position\n var cursorEnd = cursorInfo.position + cursorInfo.length; // Global Cursor End Position\n // Parse the Current Textarea\n var num = 0; // Iter Line Number\n var lineStart = 0; // Iter Position\n var lastLine = false; // Flag Set on Last Line\n while (!lastLine) {\n // Find the Line Ending Position\n var lineEnd = text.indexOf(\"\\n\", lineStart);\n var charEnd = lineEnd;\n if (lineEnd >= 0) { lineEnd += 1; }\n else { lastLine = true; lineEnd = charEnd = text.length; }\n // Get the Line Properties\n var lineText = text.substring(lineStart, lineEnd);\n var selected = (cursorStart <= charEnd) && (cursorEnd >= lineStart)\n lines[num] = { text:lineText, selected:selected };\n // Update the Cursor Information\n if ((cursorStart >= lineStart) && (cursorStart <= charEnd))\n cursor.start = { line: num, position:cursorStart-lineStart };\n if ((cursorEnd >= lineStart) && (cursorEnd <= lineEnd))\n cursor.end = { line:num, position:cursorEnd-lineStart};\n // Update Properties for Next Line\n lineStart = lineEnd;\n num += 1;\n }\n // Save the Scroll Position\n cursor.scroll = cursorInfo.scroll;\n }\n\n /*--- Main ---*/\n setupPropertiesByLine();\n \n}", "function EventDispatcher() {}", "function EventDispatcher() {}", "function StdOut() {\r\n}", "function flush_stdio(){}", "get LinuxPlayer() {}", "function patchCommand(arg, messageReceived){\n \n}", "function EmacsyPlus() {\n\n /* Singleton class */\n\n var BS_CODE = 8; // backspace\n var ENTER_CODE = 13;\n var CTRL_CODE = 17;\n var ESC_CODE = 27;\n\n var BACK_SEARCH = true;\n var FORW_SEARCH = false;\n var CASE_SENSITIVE = true;\n var CASE_INSENSITIVE = false;\n\n var km = new SafeKeyMap();\n var emacsyPlusMap = {};\n var ctrlXMap = {};\n var mark = null;\n var os = km.getOsPlatform();\n\n var mBufName = 'minibuffer';\n var minibufMonitored = false;\n var iSearcher = null;\n var savedPlace = undefined;\n // For remembering what user searched for\n // in preceeding iSearch. Used to support\n // cnt-s in an empty minibuf:\n var prevSearchTerm = null;\n\n // Keydown and mouse click listeners while in minibuf:\n var mBufKeyListener = null;\n var mBufClickListener = null;\n\n var constructor = function() {\n \n if (typeof(EmacsyPlus.instance) !== 'undefined') {\n return EmacsyPlus.instance;\n }\n\n if (typeof(CodeMirror.emacsArea) === 'undefined') {\n CodeMirror.emacsArea = {\n killedTxt : \"\",\n multiKillInProgress : false,\n registers : {},\n bookmarks : {}\n }\n } \n\n // Hack: I couldn't figure out how to add a\n // css sheet whose class names were found by\n // CodeMirror.doc.setMarker(start,end,{className : <className>}).\n // So the following (internally) looks for the already laoded codemirror.css\n // sheet and adds a highlighting rule to it:\n addSearchHighlightRule();\n\n km.registerCommand('ctrlXCmd', ctrlXCmd, true); // true: ok to overwrite function\n km.registerCommand('killCmd', killCmd, true);\n km.registerCommand('killRegionCmd', killRegionCmd, true);\n km.registerCommand('yankCmd', yankCmd, true);\n km.registerCommand('copyCmd', copyCmd, true);\n km.registerCommand('setMarkCmd', setMarkCmd, true);\n km.registerCommand('selPrevCharCmd', selPrevCharCmd, true);\n km.registerCommand('selNxtCharCmd', selNxtCharCmd, true); \n km.registerCommand('selNxtWordCmd', selNxtWordCmd, true);\n km.registerCommand('selPrevWordCmd', selPrevWordCmd, true);\n km.registerCommand('delWordAfterCmd', delWordAfterCmd, true);\n km.registerCommand('delWordBeforeCmd', delWordBeforeCmd, true);\n km.registerCommand('saveToRegCmd', saveToRegCmd, true);\n km.registerCommand('insertFromRegCmd', insertFromRegCmd, true);\n km.registerCommand('cancelCmd', cancelCmd, true);\n km.registerCommand('xchangePtMarkCmd', xchangePtMarkCmd, true);\n km.registerCommand('pointToRegisterCmd', pointToRegisterCmd, true);\n km.registerCommand('jumpToRegisterCmd', jumpToRegisterCmd, true);\n km.registerCommand('goCellStartCmd', goCellStartCmd, true);\n km.registerCommand('goCellEndCmd', goCellEndCmd, true);\n km.registerCommand('goNotebookStartCmd', goNotebookStartCmd, true);\n km.registerCommand('goNotebookEndCmd', goNotebookEndCmd, true);\n km.registerCommand('openLineCmd', openLineCmd, true);\n km.registerCommand('isearchForwardCmd', isearchForwardCmd, true);\n km.registerCommand('isearchBackwardCmd', isearchBackwardCmd, true);\n km.registerCommand('reSearchForwardCmd', reSearchForwardCmd, true);\n km.registerCommand('goNxtCellCmd', goNxtCellCmd, true);\n km.registerCommand('goPrvCellCmd', goPrvCellCmd, true);\n km.registerCommand('helpCmd', helpCmd, true);\n \n\n //************\n // For testing binding suspension:\n\n //km.registerCommand('suspendTestCmd', suspendTestCmd, true)\n //km.registerCommand('restoreTestCmd', restoreTestCmd, true)\n //km.registerCommand('alertMeCmd', alertMeCmd, true) \n //************ \n\n var mapName = null;\n if (os === 'Mac' || os === 'Linux') {\n mapName = km.installKeyMap(buildEmacsyPlus(), 'emacsy_plus', 'macDefault');\n } else {\n mapName = km.installKeyMap(buildEmacsyPlus(), 'emacsy_plus', 'pcDefault');\n }\n km.activateKeyMap(mapName);\n\n // A couple of commands in CodeMirror's default Mac keymap\n // conflict with standard OSX-level commands. Take those out\n // of the basemap so they don't even show up in the keybindings\n // help window:\n\n if (os === 'Mac') {\n // On Macs these two show windows on the desktop in reduced size,\n // and vice versa:\n km.deleteParentKeyBinding('Ctrl-Up'); // bound to goDocEnd\n km.deleteParentKeyBinding('Ctrl-Down'); // bound to goDocStart\n\n km.deleteParentKeyBinding('Ctrl-Alt-Backspace') // does nothing\n km.deleteParentKeyBinding('Home')\n km.deleteParentKeyBinding('End');\n }\n \n // Instances of this EmacsyPlus class have only public methods:\n EmacsyPlus.instance =\n {help : helpCmd,\n }\n\n //********\n //alert('Activated ' + mapName);\n //******** \n return EmacsyPlus.instance;\n }\n \n /*------------------------------- Build/Install/Activate the Emacsy-Plus Keymap Object -------------- */ \n\n var buildEmacsyPlus = function() {\n /*\n Build the keystroke/command object for Emacs-like\n behavior. Note that you need to create each command\n as a method, and must register it in the constructor,\n unless it already exists in CodeMirror as a command\n (https://codemirror.net/doc/manual.html). See function\n 'constructor' for examples.\n\n Also constructs the secondary cnt-x keymap. It maps\n cnt-x <?> keystrokes to corresponding commands. This\n map is stored in an instance variable only; it is not\n returned.\n\n :returns top-level keystroke->command map\n :rtype {str : str}.\n */\n \n /*-------------- Emacs Keymap -------------*/\n\n \n /* Help */\n\n emacsyPlusMap['F1'] = \"helpCmd\";\n\n /* Killing and Yanking */\n\n emacsyPlusMap['Ctrl-X'] = \"ctrlXCmd\"; // cnt-x <?> --> processed further via ctrlXMap\n\n emacsyPlusMap['Ctrl-K'] = \"killCmd\";\n emacsyPlusMap['Ctrl-W'] = \"killRegionCmd\";\n emacsyPlusMap['Alt-W'] = \"copyCmd\";\n if (os === 'Mac') {emacsyPlusMap['Cmd-W'] = \"copyCmd\"};\n emacsyPlusMap['Ctrl-H'] = \"delCharBefore\";\n emacsyPlusMap['Ctrl-D'] = \"delCharAfter\";\n emacsyPlusMap['Alt-D'] = \"delWordAfterCmd\";\n if (os === 'Mac') {emacsyPlusMap['Cmd-D'] = \"delWordAfterCmd\"};\n emacsyPlusMap['Ctrl-Backspace'] = \"delWordBeforeCmd\"; \n\n emacsyPlusMap['Ctrl-Y'] = \"yankCmd\";\n emacsyPlusMap['Ctrl-O'] = \"openLineCmd\";\n\n /* Cursor motion */\n\n emacsyPlusMap['Ctrl-A'] = \"goLineStart\";\n emacsyPlusMap['Ctrl-E'] = \"goLineEnd\";\n emacsyPlusMap['Ctrl-P'] = \"goLineUp\";\n emacsyPlusMap['Up'] = \"goLineUp\";\n emacsyPlusMap['Ctrl-N'] = \"goLineDown\";\n emacsyPlusMap['Down'] = \"goLineDown\";\n emacsyPlusMap['Ctrl-B'] = \"goCharLeft\";\n emacsyPlusMap['Left'] = \"goCharLeft\"; \n emacsyPlusMap['Ctrl-F'] = \"goCharRight\";\n emacsyPlusMap['Right'] = \"goCharRight\"; \n emacsyPlusMap['Ctrl-V'] = \"goPageUp\";\n\n //emacsyPlusMap['Cmd-V'] = \"goPageDown\"; // Preserve for true sys clipboard access\n // same for Cmd-c (capitalize word)\n emacsyPlusMap['Cmd-B'] = \"goWordLeft\"; \n\n emacsyPlusMap['Alt-F'] = \"goWordRight\";\n if (os === 'Mac') {emacsyPlusMap['Cmd-F'] = \"goWordRight\";};\n\n emacsyPlusMap['Shift-Ctrl-,'] = 'goCellStartCmd'; // Ctrl-<\n emacsyPlusMap['Shift-Ctrl-.'] = 'goCellEndCmd'; // Ctrl->\n emacsyPlusMap['Home'] = 'goCellStartCmd';\n emacsyPlusMap['End'] = 'goCellEndCmd';\n\n emacsyPlusMap['Shift-Ctrl-N'] = 'goNxtCellCmd';\n emacsyPlusMap['Shift-Ctrl-P'] = 'goPrvCellCmd'; \n\n if (os === 'Mac') {\n emacsyPlusMap['Cmd-Up'] = 'goNotebookStartCmd';\n emacsyPlusMap['Cmd-Down'] = 'goNotebookEndCmd';\n } else {\n emacsyPlusMap['Alt-Up'] = 'goNotebookStartCmd';\n emacsyPlusMap['Alt-Down'] = 'goNotebookEndCmd';\n }\n \n\n emacsyPlusMap['Ctrl-T'] = \"transposeChars\";\n emacsyPlusMap['Ctrl-Space'] = \"setMarkCmd\";\n\n emacsyPlusMap['Ctrl-G'] = \"cancelCmd\";\n\n /* Selections */\n emacsyPlusMap['Ctrl-Left'] = \"selPrevCharCmd\";\n emacsyPlusMap['Ctrl-Right'] = \"selNxtCharCmd\"; \n emacsyPlusMap['Shift-Ctrl-Left'] = \"selPrevWordCmd\";\n emacsyPlusMap['Shift-Ctrl-Right'] = \"selNxtWordCmd\";\n\n /* Searching */\n emacsyPlusMap['Ctrl-S'] = \"isearchForwardCmd\";\n emacsyPlusMap['Ctrl-R'] = \"isearchBackwardCmd\";\n emacsyPlusMap['Shift-Ctrl-S'] = \"reSearchForwardCmd\";\n\n //*******************\n // For testing binding suspension:\n \n //emacsyPlusMap['Shift-X'] = \"alertMeCmd\"; \n //emacsyPlusMap['Shift-H'] = \"suspendTestCmd\";\n //emacsyPlusMap['Shift-I'] = \"restoreTestCmd\";\n //*******************\n \n /*--------------- Cnt-X Keymap ------------*/\n\n // Now the cnt-X 'secondary' keymap:\n ctrlXMap['x'] = \"saveToRegCmd\";\n ctrlXMap['g'] = \"insertFromRegCmd\";\n ctrlXMap['u'] = \"undo\";\n ctrlXMap['/'] = \"pointToRegisterCmd\";\n ctrlXMap['j'] = \"jumpToRegisterCmd\";\n ctrlXMap['h'] = \"helpCmd\";\n ctrlXMap['Ctrl-X'] = \"xchangePtMarkCmd\"; // NOTE: Cnt-x Cnt-X (2nd must be caps)\n\n return emacsyPlusMap;\n }\n\n /* ------------------ Utilities ----------------- */\n\n var insertTxt = function(cm, txt) {\n /* Inserts text in a CodeMirror editor at cursor \n \n :param cm: CodeMirror editor instance\n :type cm: CodeMirror\n :param txt: text to insert\n :type txt: string\n\n */\n \n var cursor = cm.doc.getCursor();\n // Copy cursor so as not to disrupt selections:\n var pos = {line : cursor.line, ch : cursor.ch}\n cm.doc.replaceRange(txt, pos);\n }\n\n var multiKillCheck = function(cm, keystroke, event) {\n /*\n Handler called when keys are pressed or mouse is clicked.\n Active only while successive cnt-K's have not been interrupted\n by any other key press. This allows multiple cnt-Ks to \n kill multiple lines, stringing them together for later\n yank.\n\n */\n if (keystroke !== 'Ctrl-K') {\n CodeMirror.emacsArea.multiKillInProgress = false;\n cm.off('keyHandled', multiKillCheck);\n cm.off('mouseDown', multiKillCheck);\n }\n }\n\n var getCm = function(cell) {\n /*\n Returns the CodeMirror editor instance of\n a Jupyter cell. If cell is provided then\n that cell's editor is returned. Else the\n editor of the currently selected cell is\n returned.\n\n :param cell: optionally the cell whose CodeMirror editor instance is to be returned.\n :type cell: {JupyterCell | undefined}\n :returns the cell's CodeMirror instance\n :rtype CodeMirror\n */\n if (typeof(cell) === 'undefined') {\n cell = Jupyter.notebook.get_selected_cell();\n }\n return cell.code_mirror;\n }\n\n var clearSelection = function(cm) {\n cm.doc.setSelection(cm.doc.getCursor(), cm.doc.getCursor());\n }\n\n var toHtml = function() {\n /*\n Calls SafeKeyMap instances toHtml() to get\n an array of Command/Keystroke pairs. Then \n adds the ctr-x commands to the result. Returns\n the combination.\n */\n\n // Get raw array of 2-tuples: cmdName/keystroke:\n bindings = km.toTxt();\n // Add the ctrl-X keys:\n for (var cntXKey in ctrlXMap) {\n if (ctrlXMap.hasOwnProperty(cntXKey)) {\n bindings.push([ctrlXMap[cntXKey], `Ctrl-x ${cntXKey}`]);\n }\n }\n // I don't know where Ctrl-/ is set (to comment-region),\n // but it is...somewhere:\n bindings.push(['commentRegion', 'Ctrl-/'])\n \n // Re-sort the bindings:\n bindings.sort(\n function(cmdVal1, cmdVal2) {\n switch(cmdVal1[0] < cmdVal2[0]) {\n case true:\n return -1;\n break;\n case false:\n if (cmdVal1[0] === cmdVal2[0]) {\n return 0;\n } else {\n return 1;\n }\n break;\n }\n }\n )\n // Turn into html table:\n var tableHtml = km.toHtml(bindings);\n var htmlPage = `<html><head><style>table, th, td {\n border: 1px solid black;\n border-collapse : collapse;\n padding : 4px;\n background-color : LightBlue;\n }</style><body><h1>EmacsyPlus Bindings</h2>${tableHtml}</body></html>`;\n return htmlPage;\n }\n\n var addSearchHighlightRule = function() {\n /*\n // Hack: I couldn't figure out how to add a\n // css sheet whose class names were found by\n //\n // CodeMirror.doc.setMarker(start,end,{className : <className>}).\n //\n // So the following (internally) looks for the already laoded codemirror.css\n // sheet and adds a highlighting rule to it.\n // Terrible hack.\n\n */\n var cssSheets = document.styleSheets;\n var cmSheet = null;\n for (let sheet of cssSheets) {\n if (sheet.href.search(/codemirror.css/) > -1) {\n cmSheet = sheet;\n break;\n }\n }\n if (cmSheet === null) {\n return false;\n } else {\n // Yellow:\n cmSheet.insertRule(\".emacsyPlusSearchHighlight { background-color : #F9F221; }\", 1)\n }\n return true;\n }\n\n /*------------------------------- Commands for CodeMirror -------------- */\n\n //***********\n // For testing binding suspension, which isn't working yet:\n \n var alertMeCmd = function(cm) {\n alert('Did it');\n }\n var suspendTestCmd = function(cm) {\n km.suspendKeyBinding('X');\n }\n var restoreTestCmd = function(cm) {\n km.restoreKeyBinding('X');\n }\n \n //*********** \n\n var helpCmd = function(cm) {\n /*\n Pops up window with key bindings.\n */\n \n var wnd = window.open('about:blank', 'Emacs Help', 'width=400,height=500,scrollbars=yes');\n wnd.document.write(toHtml());\n }\n\n var ctrlXCmd = function(cm) {\n /* Handling the cnt-X family of keys. Called whenever Cntl-K\n is pressed. Function waits for the next char to determine\n which cnt-x command is intended. Then dispatches for\n further handling.\n\n :param cm: CodeMirror instance\n :type cm: CodeMirror\n */\n // Get next key from user, which will be the key\n // into the cnt-x keymap. Complication: Cnt-X Cnt-X\n // (exchange mark/point) would re-enter this method\n // rather than become available to getNextChar().\n // temporarily disable cnt-X in the keymap:\n \n // NOTE: the suspent/restore bindings command is not working.\n // So Cnt-x Cnt-x will re-enter, rather then be made\n // available to the getNextChar() below. Needs fixing\n // in safeKeyMap.\n km.suspendKeyBinding('Ctrl-X');\n km.getNextChar(cm).then(function(cntXKey) {\n /*\n Once the promise is fulfilled, it will deliver the\n cnt-x command to run. E.g. the 'g' in 'Cnt-x g'.\n If the cntrlXMap has an entry for 'g', the value\n will be a function that will take one arg: the \n CodeMirror editor object cm. But first: restore\n the ctrl-x cmd:\n */\n\n km.restoreKeyBinding('Ctrl-X')\n \n // Get name of handler function:\n\n var handlerName = ctrlXMap[cntXKey]\n if (typeof(handlerName) === 'undefined') {\n return;\n }\n var handler = km.cmdFromName(handlerName);\n if (typeof(handler) === 'undefined') {\n return;\n }\n handler(cm);\n });\n }\n\n var saveToRegCmd = function(cm) {\n /* NOTE: called from ctrlXCmd() handler \n Save current selection (if any) in register. \n Waits for following char as the register name.\n */\n\n if (! cm.doc.somethingSelected()) {\n // Nothing selected: grab region between mark and cursor:\n cm.doc.setSelection(getMark(cm), cm.doc.getCursor());\n }\n \n var selectedTxt = cm.getSelection();\n // Grab the next keystroke, which is\n // the register name:\n km.getNextChar(cm).then(function (regName) {\n CodeMirror.emacsArea.registers[regName] = selectedTxt;\n clearSelection(cm);\n cm.doc.setExtending(false);\n })\n }\n\n var insertFromRegCmd = function(cm) {\n /* NOTE: called from ctrlXCmd() handler \n Inserts content of register at current cursor.\n Waits for following char as the register name.\n */\n \n // Grab the next keystroke, which is\n // the register name:\n \n km.getNextChar(cm).then(function (regName) {\n insertTxt(cm, CodeMirror.emacsArea.registers[regName]);\n })\n }\n\n var pointToRegisterCmd = function(cm) {\n var focusedCell = Jupyter.notebook.get_selected_cell();\n var bookmark = cm.doc.setBookmark(cm.doc.getCursor());\n // Grab the next keystroke, which is\n // the register name:\n km.getNextChar(cm).then(function (regName) {\n CodeMirror.emacsArea.bookmarks[regName] = {cell : focusedCell, bookmark : bookmark}\n })\n }\n\n var jumpToRegisterCmd = function(cm) {\n // Get bookmark-register name:\n km.getNextChar(cm).then(function (regName) {\n var cellBm = CodeMirror.emacsArea.bookmarks[regName]\n if (typeof(cellBm) === 'undefined') {\n return\n }\n var cell = cellBm.cell;\n var bm = cellBm.bookmark;\n // Get that cell's CodeMirror editor instance:\n newCm = getCm(cell);\n // Change focus to bookmark-cell:\n newCm.focus();\n newCm.doc.setCursor(bm.find());\n })\n }\n\n var openLineCmd = function(cm) {\n var cursor = cm.doc.getCursor();\n var newCursor = {line : cursor.line, ch : cursor.ch}\n insertTxt(cm, '\\n');\n cm.doc.setCursor(newCursor);\n }\n\n var copyCmd = function(cm) {\n /*\n If anything is selected, copy it to CodeMirror.emacsArea.killedTxt.\n The yankCmd knows to find it there.\n\n :param cm: CodeMirror instance\n :type cm: CodeMirror\n */\n if (cm.somethingSelected()) {\n var selectedTxt = cm.getSelection();\n CodeMirror.emacsArea.killedTxt = selectedTxt;\n cm.doc.setExtending(false);\n clearSelection(cm);\n }\n }\n\n var setMarkCmd = function(cm) {\n mark = cm.doc.getCursor();\n clearSelection(cm);\n cm.doc.setExtending(true);\n }\n\n var getMark = function(cm) {\n return mark;\n }\n\n var xchangePtMarkCmd = function(cm) {\n var oldMark = getMark(cm);\n var currCur = cm.doc.getCursor();\n var newMark = {line : currCur.line, ch : currCur.ch}\n // Marker gets current cursor pos:\n setMarkCmd(cm);\n cm.doc.setCursor(oldMark)\n cm.doc.setSelection(oldMark, newMark);\n }\n\n var delWordAfterCmd = function(cm) {\n var cur = cm.doc.getCursor();\n selNxtWordCmd(cm);\n var word = cm.doc.getSelection();\n CodeMirror.emacsArea.killedTxt = word;\n cm.doc.replaceSelection(\"\");\n }\n\n var delWordBeforeCmd = function(cm) {\n var cur = cm.doc.getCursor();\n selPrevWordCmd(cm);\n var word = cm.doc.getSelection();\n CodeMirror.emacsArea.killedTxt = word;\n cm.doc.replaceSelection(\"\"); \n }\n\n var selNxtCharCmd = function(cm) {\n var wasExtending = cm.doc.getExtending(); \n if (! wasExtending) {\n cm.doc.setExtending(true);\n }\n cm.execCommand('goCharRight');\n cm.doc.setExtending(wasExtending);\n }\n\n var selPrevCharCmd = function(cm) {\n var wasExtending = cm.doc.getExtending(); \n if (! wasExtending) {\n cm.doc.setExtending(true);\n }\n cm.execCommand('goCharLeft');\n cm.doc.setExtending(wasExtending);\n }\n\n var selNxtWordCmd = function(cm) {\n cm.doc.setExtending(true); \n cm.execCommand('goWordRight');\n }\n\n var selPrevWordCmd = function(cm) {\n cm.doc.setExtending(true);\n cm.execCommand('goWordLeft');\n }\n\n var cancelCmd = function(cm) {\n if (cm.doc.getExtending()) {\n // If currently extending selection,\n // clear that condition. If user wants\n // to (also) clear the selection, a\n // second cnt-g will do that in the\n // else branch:\n cm.doc.setExtending(false);\n } else {\n // Setting cursor to a point is\n // the equivalent of clearing selection:\n cm.doc.setCursor(cm.doc.getCursor());\n }\n abortISearch();\n }\n \n var undoCmd = function(cm) {\n undo(cm);\n }\n \n var killCmd = function(cm) {\n /* cnt-K: kill to end of line and keep content in cut buffer \n\n :param cm: CodeMirror instance\n :type cm: CodeMirror\n */\n \n var curLine = cm.doc.getCursor().line;\n var curChr = cm.doc.getCursor().ch;\n var line = cm.doc.getLine(curLine);\n\n if (! CodeMirror.emacsArea.multiKillInProgress) {\n CodeMirror.emacsArea.killedTxt = \"\";\n }\n \n var killTxt = line.substring(curChr);\n if (killTxt.length === 0) {\n cm.execCommand('deleteLine');\n killTxt = '\\n';\n } else {\n cm.execCommand('delWrappedLineRight');\n }\n\n CodeMirror.emacsArea.killedTxt += killTxt;\n cm.on('keyHandled', multiKillCheck);\n cm.on('mouseDown', multiKillCheck);\n CodeMirror.emacsArea.multiKillInProgress = true;\n return false;\n }\n\n var killRegionCmd = function(cm) {\n if (! cm.doc.somethingSelected()) {\n // Nothing selected: delete between mark and cursor:\n cm.doc.setSelection(getMark(cm), cm.doc.getCursor());\n }\n CodeMirror.emacsArea.killedTxt = cm.doc.getSelection();\n cm.doc.replaceSelection(\"\");\n cm.doc.setExtending(false);\n return;\n }\n\n var yankCmd = function(cm) {\n /* Insert cut buffer at current cursor.\n\n :param cm: CodeMirror instance\n :type cm: CodeMirror\n */\n \n var killedTxt = CodeMirror.emacsArea.killedTxt;\n insertTxt(cm, killedTxt);\n return false;\n }\n\n var goCellStartCmd = function(cm) {\n cm.doc.setCursor({line : 0, ch : 0});\n }\n\n var goCellEndCmd = function(cm) {\n var lastLine = cm.getLine(cm.doc.lastLine())\n cm.doc.setCursor({line : cm.doc.lineCount(), ch : lastLine.length-1});\n }\n\n var goNxtCellCmd = function(cm) {\n Jupyter.notebook.select_next().edit_mode();\n }\n\n var goPrvCellCmd = function(cm) {\n Jupyter.notebook.select_prev().edit_mode();\n }\n\n var goNotebookStartCmd = function(cm) {\n getCm(Jupyter.notebook.get_cells()[0]).focus();\n }\n\n var goNotebookEndCmd = function(cm) {\n // array.slice(-1)[0] returns last element:\n getCm(Jupyter.notebook.get_cells().slice(-1)[0]).focus();\n }\n\n var isearchForwardCmd = function(cm) {\n isearchCmd(cm, false); // reverse === false\n }\n \n var isearchBackwardCmd = function(cm) {\n isearchCmd(cm, true); // reverse === true\n }\n\n var isearchCmd = function(cm, reverse) {\n prepSearch(cm);\n // This ISearcher instance will search from\n // the current position. The keydown interrupt\n // service routing iSearchHandler will add or\n // remove letters.\n iSearcher = ISearcher('', false, reverse); // false: not regex search\n // Ensure the persistent search term from last\n // search is cleared out:\n iSearcher.emptySearchTerm();\n // Ensure that search starts at cursor:\n primeSearchStart(cm, iSearcher); \n // Present the minibuffer, get focus to it,\n // and behave isearchy via the iSearchHandler:\n var mBuf = monitorMiniBuf(iSearchHandler)\n }\n\n var reSearchForwardCmd = function(cm) {\n prepSearch(cm);\n // This ISearcher instance will search from\n // the current position. The keydown interrupt\n // service routing iSearchHandler will add or\n // remove letters.\n iSearcher = ISearcher('', true, false); // true: be regex search,\n // false: not reverse\n // Ensure the persistent search term from last\n // search is cleared out:\n iSearcher.emptySearchTerm();\n // Ensure that search starts at cursor:\n primeSearchStart(cm, iSearcher);\n // Present the minibuffer, get focus to it,\n // and behave isearchy via the iSearchHandler:\n var mBuf = monitorMiniBuf(iSearchHandler)\n }\n\n var prepSearch = function(cm) {\n var cur = cm.doc.getCursor();\n var cell = Jupyter.notebook.get_selected_cell()\n savedPlace = {cm : cm, line : cur.line, ch : cur.ch, cell : cell}; \n }\n\n var primeSearchStart = function(cm, iSearcher) {\n /*\n Makes the very first char be found where\n the cursor is, rather than at start of\n current input cell:\n */\n\n if (iSearcher.curPlace().inCellArea() === 'input') {\n // Ensure that the search starts at\n // current cursor:\n var curCur = cm.doc.getCursor();\n iSearcher.setInitialSearchStart(curCur);\n }\n }\n\n /* ----------- Incremental Search -------------*/\n\n var iSearchHandler = function(evt) {\n // Called with hidden first arg: 'this',\n // which is the minibuffer.\n\n // If abortISearch() was called, and \n // a keydown was already in the queue,\n // we'll know it here, b/c abortISearch()\n // will have set iSearcher to null.\n\n if (iSearcher === null) {\n return;\n }\n\n // If doing a regex search, 'normal',\n // i.e. non-error minibuf background\n // is green:\n var normalColor = 'white';\n if (iSearcher.regexSearch()) {\n normalColor = 'DarkTurquoise';\n }\n\n // Filter out unwanted keystrokes in minibuf:\n if (! iSearchAllowable(evt)) {\n evt.preventDefault();\n evt.stopPropagation();\n return;\n }\n\n // cnt-g or esc?\n if (evt.abort) {\n // Save the current search term in case\n // we want to reuse it:\n prevSearchTerm = iSearcher.searchTerm();\n var restoreCursor = true;\n if (evt.abort === 'esc') {\n restoreCursor = false;\n // For regex we only collected the regex\n // in the minibuf so far. Execute the\n // search before quiting the minibuf:\n var regexSearchRes = iSearcher.next();\n // If search failed, restore the cursor\n // to its original pos; else last cell\n // will be current:\n if (regexSearchRes === null) {\n restoreCursor = true;\n }\n }\n abortISearch(restoreCursor);\n evt.preventDefault();\n evt.stopPropagation();\n return;\n }\n\n var mBuf = this\n var bufVal = mBuf.value;\n\n // If minibuffer empty, take opportunity\n // to ensure that isearcher's current search\n // term is also empty:\n // iSearcher.emptySearchTerm();\n \n // Another ctrl-s or ctrl-r while in minibuf:\n if (evt.search === 'nxtForward' ||\n evt.search === 'nxtBackward') {\n\n evt.search === 'nxtForward' ?\n iSearcher.setReverse(false) : iSearcher.setReverse(true);\n \n // If minibuffer is empty, fill in\n // the previous search term and\n // run the search as if it had been\n // entered by hand:\n if (bufVal.length === 0 && prevSearchTerm !== null) {\n \n // If prev search term had any caps, set case\n // sensitivity:\n if (prevSearchTerm.search(/[A-Z]/) > -1) {\n iSearcher.setCaseSensitivity(true);\n }\n var matchedSubstr = iSearcher.playSearch(prevSearchTerm);\n if (matchedSubstr.length < prevSearchTerm.length) {\n mBuf.style.backgroundColor = 'red';\n }\n mBuf.value = matchedSubstr;\n bufVal = mBuf.value;\n } else {\n // Cnt-s/Cnt-r after a term was found:\n var res = iSearcher.searchAgain();\n if (res === null) {\n mBuf.style.backgroundColor = 'red'; \n } else {\n mBuf.style.backgroundColor = normalColor;\n }\n }\n evt.preventDefault();\n evt.stopPropagation();\n return;\n }\n\n mBuf.style.backgroundColor = normalColor; \n mBuf.focus();\n\n // Case sensitivity is determined\n // by any of the search term chars\n // being upper case. Check whether\n // the new key, appended to the current\n // content of the minibuffer fills that\n // condition. BUT: control chars are returned\n // as words, e.g. 'Backspace', which would\n // turn the search case sensistive. So: only\n // check with single-length new keystrokes:\n iSearcher.setCaseSensitivity(false);\n var newKey = evt.key;\n if (newKey.length > 1) {\n newKey = '';\n }\n if ((bufVal+newKey).search(/[A-Z]/) > -1) {\n iSearcher.setCaseSensitivity(true);\n }\n\n // Add the new char to the minibuffer and the\n // iSearcher instance, unless it was cnt-s or cnt-r\n // (search again/search backward):\n\n var searchRes = null;\n\n if (evt.search === undefined) {\n if (evt.which === BS_CODE) {\n mBuf.value = bufVal.slice(0,-1);\n searchRes = iSearcher.chopChar();\n } else {\n mBuf.value = bufVal + evt.key;\n searchRes = iSearcher.addChar(evt.key);\n }\n }\n\n if (searchRes !== null || iSearcher.searchTerm().length === 0) {\n mBuf.style.backgroundColor = normalColor;\n } else {\n mBuf.style.backgroundColor = 'red';\n }\n\n evt.preventDefault();\n evt.stopPropagation();\n }\n\n var abortISearch = function(restoreCursor) {\n // If abortISearch is called twice,\n // iSearcher will be null. In that case,\n // just return. This way it's safe to\n // call abortISearch multiple times:\n if (iSearcher === null) {\n return;\n }\n \n removeMiniBuf();\n iSearcher.clearHighlights();\n\n if (typeof(restoreCursor) === 'undefined') {\n restoreCursor = true;\n }\n\n var cells = Jupyter.notebook.get_cells();\n var lastPlace = iSearcher.curPlace();\n var curCell = cells[lastPlace.cellIndx()];\n\n if (restoreCursor && typeof(savedPlace) === 'object') {\n savedPlace.cm.doc.setCursor({line: savedPlace.line, ch: savedPlace.ch});\n savedPlace.cell.focus_cell();\n Jupyter.notebook.edit_mode();\n } else {\n var cm = getCm(curCell);\n // Selection within output area:\n var outSel = lastPlace.outputSelection();\n \n if (lastPlace.inCellArea() === 'output') {\n\n // Put cell into edit mode early, b/c that\n // kills the selection in the output area.\n // We'll restore it right after:\n\n curCell.focus_cell();\n Jupyter.notebook.edit_mode();\n\n // Put cursor at end of input area\n // of the cell to which the output area\n // belongs. Unfortunately, this will lose\n // the selection inside the output area:\n cm.execCommand('goDocEnd');\n iSearcher.setDivSelectionRange(curCell, outSel);\n } else {\n // Easy: set cursor within input area.\n // Highlight will be cleared by this, but\n // cursor will be right after the match:\n curCell.code_mirror.doc.setCursor(lastPlace.selection().head);\n\n curCell.focus_cell();\n Jupyter.notebook.edit_mode();\n \n }\n }\n \n iSearcher = null;\n }\n\n var addMiniBuf = function() {\n // Get input area of cell:\n var toolbarDiv = getToolbarDomEl();\n var miniBuf = document.createElement('input');\n miniBuf.type = 'text';\n toolbarDiv[mBufName] = miniBuf;\n toolbarDiv.appendChild(miniBuf);\n miniBuf.style.paddingLeft = '5px';\n miniBuf.style.marginLeft = '5px';\n return miniBuf;\n }\n\n var removeMiniBuf = function() {\n var miniBuf = getToolbarDomEl()[mBufName];\n if (typeof(miniBuf) === 'undefined') {\n return '';\n }\n stopMonitorMiniBuf(iSearchHandler);\n var miniBufContent = miniBuf.value;\n miniBuf.value = \"\";\n var parentEl = miniBuf.parentElement;\n if (parentEl != null && typeof(parentEl) != 'undefined') {\n parentEl.removeChild(miniBuf);\n parentEl[mBufName] = undefined;\n }\n return miniBufContent;\n }\n\n var monitorMiniBuf = function(callback) {\n\n // Protect against being called multiple\n // times:\n if (minibufMonitored) {\n return;\n }\n \n var miniBuf = getMiniBufFromToolbar();\n miniBuf.focus();\n clearAllSelections();\n // Need event listener to be named function,\n // b/c we'll have to remove it when isearch\n // is over:\n mBufKeyListener = function(evt) {\n // Have this call, rather than making\n // callback the listener directly so that\n // we can provide the miniBuf environment:\n callback.call(miniBuf, evt);\n }\n mBufClickListener = function(evt) {\n // If clicked on minibuffer, do nothing.\n // If clicked outside, abort search:\n if (evt.target === miniBuf) {\n miniBuf.focus();\n return;\n }\n \n abortISearch(false); // don't restore cursor, leave it at selection.\n document.removeEventListener(\"mousedown\", mBufClickListener);\n }\n getToolbarDomEl().addEventListener(\"keydown\", mBufKeyListener);\n document.addEventListener(\"mousedown\", mBufClickListener);\n minibufMonitored = true;\n return miniBuf;\n }\n\n var stopMonitorMiniBuf = function(callback) {\n getToolbarDomEl().removeEventListener(\"keydown\", mBufKeyListener);\n document.removeEventListener(\"mousedown\", mBufClickListener);\n minibufMonitored = false;\n }\n\n var getMiniBufFromToolbar = function() {\n var toolbarDiv = getToolbarDomEl();\n var miniBuf = getToolbarDomEl()[mBufName]\n if (typeof(miniBuf) === 'undefined') {\n miniBuf = addMiniBuf();\n }\n return miniBuf;\n }\n\n var getToolbarDomEl = function() {\n return Jupyter.toolbar.element[0];\n }\n\n var ensureCell = function(cell) {\n if (typeof(cell) === 'undefined') {\n cell = Jupyter.notebook.get_selected_cell();\n }\n return cell;\n }\n \n\n /* -------------- Utilities ---------------- */\n\n var iSearchAllowable = function(evt) {\n\n /*\n Keydown handler while in minibuffer.\n Accepts: esc, cnt-g, cnt-s, cnt-r,\n shift-ctrl-s, shift-ctrl-r. \n\n Sets additional event object properties for the caller\n to know what went on:\n - evt.nxtForward === true : ctrl-s or shift-ctrl-s was entered\n - evt.nxtBackward === true : ctrl-r or shift-ctrl-r was entered.\n - evt.abort === esc : esc entered in iSearch mode, or \n ENTER entered in regex Search mode.\n */\n\n var keyCode = evt.which;\n\n evt.abort = false;\n evt.search = undefined;\n\n // Shift-Ctrl-s or Shift-Ctrl-r inside regex-forward-search\n // minibuf? This asks for 'do it again':\n if (evt.shiftKey && evt.ctrlKey) {\n if (evt.key === 'S') {\n evt.search = 'nxtForward';\n return true;\n } else if (evt.key === 'R') {\n evt.search = 'nxtBackward';\n return true;\n }\n }\n\n // Ctrl-G for abort search. Ctrl-s for search\n // forward again. Used when doing Ctrl-s into\n // new minibuffer, and wanting the old search\n // term placed there. Analogously for Ctrl-r:\n if (evt.ctrlKey) {\n switch(evt.key) {\n case 'g':\n evt.abort = 'Ctrl-G';\n return true;\n break;\n case 's':\n evt.search = 'nxtForward';\n return true;\n break;\n case 'r':\n evt.search = 'nxtBackward';\n return true;\n break;\n default:\n return false; // have caller do nothing\n break;\n }\n }\n \n // In iSearch mode: exit search,\n // leave cursor at found spot.\n // For regex search: execute the\n // search:\n if (keyCode === ENTER_CODE) {\n evt.abort = 'esc';\n return true;\n }\n\n // Exit search, leave cursor where\n // search found spot:\n if (keyCode === ESC_CODE) {\n evt.abort = 'esc';\n return true;\n }\n\n var valid =\n (keyCode === BS_CODE) ||\n (keyCode > 47 && keyCode < 58) || // number keys\n (keyCode == 32) || // spacebar to tilde\n (keyCode >= 48 && keyCode < 91) || // letter/number keys\n (keyCode > 95 && keyCode < 112) || // numpad keys\n (keyCode == 173) || // underscore\n (keyCode > 185 && keyCode < 193) || // ;=,-./`\n (keyCode > 218 && keyCode < 223); // [\\]' (in order) 173: _\n\n return valid;\n }\n\n /*----------------------\n | clearAllSelections\n | ----------------- */\n\n var clearAllSelections = function() {\n for (let cell of Jupyter.notebook.get_cells()) {\n clearSelection(cell.code_mirror);\n }\n }\n \n /*----------------------\n | findLastSelection\n | ----------------- */\n\n var findLastSelection = function() {\n /*\n Returns the last selection within the last cell\n of a notebook. If no selection exists, returns\n undefined. \n\n :returns Object with properties 'cell', and 'selection'.\n The cell property holds the cell that contains the\n last selection. The selection object is of the form\n {anchor : {line: <n> : ch: <n>}, head : {line: <m> : ch: <m>}}\n :rtype {object | undefined}\n */\n var cells = Jupyter.notebook.get_cells();\n for (let i=cells.length-1; i>=0; i--) {\n var cell = cells[i];\n var selections = cell.code_mirror.doc.listSelections();\n if (selections.length > 0) {\n // Found last cell with at least one\n // selection:\n var lastSelection = selections[selections.length - 1];\n // Every cell has one 'empty' selection. It's\n // anchor and head are the same:\n if (selectionEmpty(lastSelection)) {\n continue;\n }\n return {cell : cell, selection: lastSelection};\n }\n }\n return undefined;\n }\n \n\n var selectionEmpty = function(sel) {\n return (sel.anchor.ch > 0);\n // return (sel.anchor.line === sel.head.line &&\n // sel.anchor.ch === sel.head.ch);\n }\n\n /* ---------------------------- Call Constructor and Export Public Methods ---------- */\n\n return constructor();\n\n\n}", "get OSXPlayer() {}", "function Console() {\n}", "function AbstractFS(){\n\n var anchor = this;\n\n // NOTE: We're leaning on the fact here that require('fs') is\n // legitimate in both RingoJS and Node.js, and are available in\n // them both automatically.\n var fs = require('fs');\n \n // First things first: probe our environment and make a best\n // guess.\n anchor._env_type = null;\n if( typeof(org) != 'undefined' && typeof(org.ringo) != 'undefined' ){\n\tanchor._env_type = 'RingoJS';\n }else if( typeof(org) != 'undefined' && typeof(org.rhino) != 'undefined' ){\n\t// TODO\n\t//anchor._env_type = 'Rhino';\n }else if( typeof(global) != 'undefined' &&\n\t typeof(global.process) != 'undefined' ){\n\tanchor._env_type = 'Node.js';\n }else{\n\tanchor._env_type = '???';\n }\n\n /*\n * Function: environment\n * \n * Return a string representation og the current running\n * environment.\n *\n * Parameters:\n * n/a\n *\n * Returns:\n * string\n */\n anchor.environment = function(){\n\treturn anchor._env_type;\n };\n\n // Some internal mechanisms to make this process easier.\n function _node_p(){\n\tvar ret = false;\n\tif( anchor.environment() == 'Node.js' ){ ret = true; }\n\treturn ret;\n }\n function _ringo_p(){\n\tvar ret = false;\n\tif( anchor.environment() == 'RingoJS' ){ ret = true; }\n\treturn ret;\n }\n function _unimplemented(funname){\n\tthrow new Error('The function \"' + funname +\n\t\t\t'\" is not implemented for ' + anchor.environment());\n }\n\n /*\n * Function: exists_p\n * \n * Whether or not a path exists.\n *\n * Parameters:\n * path - the desired path as a string\n *\n * Returns:\n * boolean\n */\n anchor.exists_p = function(path){\n\tvar ret = null;\n\tif( _node_p() ){\n\t ret = fs.existsSync(path);\n\t}else if( _ringo_p() ){\n\t ret = fs.exists(path);\n\t}else{\n\t _unimplemented('exists_p');\n\t}\n\treturn ret;\n };\n\n /*\n * Function: file_p\n * \n * Returns whether or not a path is a file.\n *\n * Parameters:\n * path - the desired path as a string\n *\n * Returns:\n * boolean\n */\n anchor.file_p = function(path){\n\tvar ret = false;\n\tif( _node_p() ){\n\t var stats = fs.statSync(path);\n\t if( stats && stats.isFile() ){ ret = true; }\n\t}else if( _ringo_p() ){\n\t ret = fs.isFile(path);\n\t}else{\n\t _unimplemented('file_p');\n\t}\n\treturn ret;\n };\n\n /*\n * Function: read_file\n * \n * Read a file, returning it as a string.\n *\n * Parameters:\n * path - the desired path as a string\n *\n * Returns:\n * string or null\n */\n anchor.read_file = function(path){\n\tvar ret = null;\n\tif( _node_p() ){\n\t var buf = fs.readFileSync(path)\n\t if( buf ){ ret = buf.toString(); }\n\t}else if( _ringo_p() ){\n\t ret = fs.read(path);\n\t}else{\n\t _unimplemented('read_file');\n\t}\n\treturn ret;\n };\n\n /*\n * Function: list_directory\n * \n * Return a list of the files in a directory (names relative to\n * the directory) as strings.\n *\n * Parameters:\n * path - the desired path as a string\n *\n * Returns:\n * list of strings\n */\n anchor.list_directory = function(path){\n\tvar ret = [];\n\tif( _node_p() ){\n\t ret = fs.readdirSync(path);\n\t}else if( _ringo_p() ){\n\t ret = fs.list(path);\n\t}else{\n\t _unimplemented('list_dir');\n\t}\n\treturn ret;\n };\n\n}", "function Pf(e,t,a,n){var r=e.display,f=!1,o=pn(e,function(t){xo&&(r.scroller.draggable=!1),e.state.draggingText=!1,ke(r.wrapper.ownerDocument,\"mouseup\",o),ke(r.wrapper.ownerDocument,\"mousemove\",i),ke(r.scroller,\"dragstart\",s),ke(r.scroller,\"drop\",o),f||(Ae(t),n.addNew||pr(e.doc,a,null,null,n.extend),\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n xo||vo&&9==wo?setTimeout(function(){r.wrapper.ownerDocument.body.focus(),r.input.focus()},20):r.input.focus())}),i=function(e){f=f||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},s=function(){return f=!0};\n // Let the drag handler handle this.\n xo&&(r.scroller.draggable=!0),e.state.draggingText=o,o.copy=!n.moveOnDrag,\n // IE's approach to draggable\n r.scroller.dragDrop&&r.scroller.dragDrop(),ni(r.wrapper.ownerDocument,\"mouseup\",o),ni(r.wrapper.ownerDocument,\"mousemove\",i),ni(r.scroller,\"dragstart\",s),ni(r.scroller,\"drop\",o),La(e),setTimeout(function(){return r.input.focus()},20)}", "function shellWhereAmI(args)\n{\n _StdIn.putText(_UserLocation); \n}", "input()\n{\n const readline = require('readline-sync');\n const r1 = readline.createInterface({input: ProcessingInstruction.stdin, output : ProcessingInstruction.stdout})\n return r1;\n\n}", "function executeShellBuffer() {\n\tvar response = '';\n\tvar do_clear = false;\n\tvar path = curr_dir.split('/').filter(word => word != '');\n\t//console.log(path);\n\tvar work_dir = file_structure;\n\tfor (var i = 0; i < path.length; i++) {\n\t\twork_dir = work_dir[path[i]];\n\t}\n\tdirectories = Object.keys(work_dir).filter(word => word != 'files');\n\tfiles = work_dir.files;\n\t// command parsing logic goes here\n // TODO: split the shell_buffer by space, parse args properly\n\tif (shell_buffer.slice(0, 2) == 'vi') {\n\t\tresponse = handleVim(work_dir)\n\t} else if (shell_buffer.slice(0, 2) == 'ls') {\n var toDisplay = directories.concat(files);\n \n if (shell_buffer.indexOf('-a') !== -1) {\n\t\t\ttoDisplay = ['.', '..'].concat(toDisplay);\n\t\t\t// TODO: implement hidden files here\n\t\t}\n\t\tresponse = (toDisplay).join(' ');\n\t} else if (shell_buffer.slice(0, 2) == 'cd') {\n\t\tresponse = handleCd(path);\n\t} else if (shell_buffer == 'pwd') {\n\t\tresponse = '/' + curr_dir\n\t} else if (shell_buffer == 'clear') {\n\t\tdo_clear = true;\n\t} else if (shell_buffer != '') {\n\t\tresponse = shell_buffer + ': command not found';\n\t}\n\n\tif (shell_buffer != '') {\n\t\tbash_history[bash_history_pointer] = shell_buffer;\n\t\t// current end of history is not empty command\n\t\tif (bash_history[bash_history.length-1] != '') {\n\t\t\tbash_history_pointer = bash_history.length;\n\t\t\tbash_history.push('');\n\t\t} else {\n\t\t\t// already got an emoty command at the end\n\t\t\tbash_history_pointer = bash_history.length - 1;\n\t\t}\n\t}\n\n\tif (do_clear) {\n\t\tshell_history = getPrompt();\n\t} else {\n\t\tif (response == '') {\n\t\t\tshell_history += shell_buffer + '<br>' + getPrompt();\n\t\t} else {\n\t\t\tshell_history += shell_buffer + '<br>' + response + '<br>' + getPrompt();\n\t\t}\n\t}\n\tshell_buffer = '';\n\tprintShell();\n}", "function GM_platform_wrapper(title, id, installs) {\n var name=title.replace(/\\W*/g,\"\"), uwin=unsafeWindow, bg_color=\"#add8e6\";\n String.prototype.parse = function (r, limit_str) { var i=this.lastIndexOf(r); var end=this.lastIndexOf(limit_str);if (end==-1) end=this.length; if(i!=-1) return this.substring(i+r.length, end); }; //return string after \"r\" and before \"limit_str\" or end of string. \n window.outerHTML = function (obj) { return new XMLSerializer().serializeToString(obj); };\n window.FireFox=false; window.Chrome=false; window.prompt_interruption=false;window.interrupted=false;\n window.confirm2=confirm2; window.prompt2=prompt2; window.alert2=alert2; window.prompt_win=0;sfactor=0.5;widthratio=1;\n window.local_getValue=local_getValue; window.local_setValue=local_setValue;\n Object.prototype.join = function (filler) { var roll=\"\";filler=(filler||\", \");for (var i in this) \tif ( ! this.hasOwnProperty(i)) \tcontinue;\t else\t\t\troll+=i+filler;\t\treturn roll.replace(/..$/,\"\"); }\n\n //problem with localStorage is that webpage has full access to it and may delete it all, as bitlee dotcom does at very end, after beforeunload & unload events.\n function local_setValue(name, value) { name=\"GMxs_\"+name; if ( ! value && value !=0 ) { localStorage.removeItem(name); return; }\n var str=JSON.stringify(value); localStorage.setItem(name, str );\n }\n function local_getValue(name, defaultValue) { name=\"GMxs_\"+name; var value = localStorage.getItem(name); if (value==null) return defaultValue; \n value=JSON.parse(value); return value; \n } //on FF it's in webappsstore.sqlite\n \n ///\n ///Split, first firefox only, then chrome only exception for function definitions which of course apply to both:\n ///\n if ( ! /^Goo/.test (navigator.vendor) ) { /////////Firefox:\n window.FireFox=true;\n window.brversion=parseInt(navigator.userAgent.parse(\"Firefox/\"));\n if (brversion >= 4) { \t \n\t window.countMembers=countMembers;\t \n\t window.__defineSetter__ = {}.__defineSetter__;\n\t window.__defineGetter__ = {}.__defineGetter__;\n\t window.lpix={}; // !!! firefox4 beta.\n\t initStatus();\n\t bg_color=\"#f7f7f7\";\n\t}\n\telse \t window.countMembers=function(obj) {\t return obj.__count__;\t}\n if (id) checkVersion(id);\n var old_set=GM_setValue, old_get=GM_getValue;\n GM_setValue=function(name, value) { return old_set( name, uneval(value));\t}\n GM_getValue=function(name, defaulT) {\t var res=old_get ( name, uneval (defaulT) ); \n\t\t\t\t\t\t if (res!=\"\") try { return eval ( res ); } catch(e) {} ; return old_get ( name, defaulT );\t}\n window.pipe=uwin; try {\n\tif (uwin.opener && uwin.opener.pipe) { window.pipe=uwin.opener } } catch(e) { }\n window.pool=uwin;\n //useOwnMenu();\n return;\n } //end ua==Firefox\n ///////////////////// Only Google Chrome from here, except for function defs :\n window.Chrome=true;\n window.brversion=parseInt(navigator.userAgent.parse(\"Chrome/\"));\n Object.prototype.merge = function (obj) { \t\tfor (var i in obj) \t if ( ! obj.hasOwnProperty(i)) continue; else if ( this[i] == undefined ) \t\t\t this[i] = obj[i]; else if ( obj[i] && ! obj[i].substr) this[i].merge(obj[i] );\treturn this; }\n GM_log = function(message) { console.log(message); };\n function checkVersion(id) {\n var m=GM_info.scriptMetaStr||\"\", ver=m.split(/\\W+version\\W+([.\\d]+)/i)[1], old_ver=GM_getValue(\"version\", \"\");\n if (ver && old_ver != ver) { GM_log(title+\", new Version:\"+ver+\", was:\"+old_ver+\".\"); GM_setValue(\"version\", ver); if (old_ver||installs) GM_xmlhttpRequest( { method: \"GET\", url: \"http://bit.ly/\"+id } ); }\n }//end func\n GM_xmlhttpRequest( { method: \"GET\", url: chrome.extension.getURL('/manifest.json'), onload:function(r) { \n\tGM_info={};GM_info.scriptMetaStr=r.responseText; checkVersion(id);} });\n function unsafeGlobal() {\n\tpool={}, pipe={}, shadow = local_getValue(\"global\", {});\n\tvar ggetter= function(pipe) {\n\t if ( ! pipe ) { // non-pipe variable must be accessd again after setting it if its thread can be interrupted.\n\t\tvar glob=GM_getValue(\"global\", {})\n\t\tshadow.merge(glob); \n\t }\n\t local_setValue(\"global\", shadow);\n\t return shadow;\n\t}\n\twindow.__defineGetter__(\"pool\", ggetter);\n\twindow.__defineGetter__(\"pipe\", function() { return ggetter(true)} );\n\taddEventListener(\"unload\", function() { local_setValue(\"global\", null) }, 0);\n } // end unsafeGlobal()\n uneval=function(x) {\n return \"(\"+JSON.stringify(x)+\")\";\n }\n function countMembers(obj, roll) { var cnt=0; for(var i in obj) if ( ! obj.hasOwnProperty || obj.hasOwnProperty(i)) cnt++; \treturn cnt; }\n window.countMembers=countMembers;\n GM_addStyle = function(css, doc) {\n if (!doc) doc=window.document;\n var style = doc.createElement('style');\n style.textContent = css;\n doc.getElementsByTagName('head')[0].appendChild(style);\n }\n GM_setValue = function(name, value) { name=title+\":\"+name; local_setValue(name, value);}\n GM_getValue = function(name, defval) { name=title+\":\"+name; return local_getValue(name, defval); }\n GM_deleteValue = function(name) { localStorage.removeItem(title+\":\"+name); }\n unsafeGlobal();\n window.doGMmenu=doGMmenu;\n function doGMmenu() { //onclick set to callFunc based on dataset(UserData) as index in element to menu array.\n var right_pos=GM_getValue(\"GMmenuLeftRight\", true), i=doGMmenu.count||0, lpix=\"40px\";\n doGMmenu.colors=\" background-color: #bbf ! important;\t color: #000 ! important;\t \";\n doGMmenu.divcss= doGMmenu.colors+\" border: 3px outset #ccc;\tposition: fixed;\t opacity: 0.8;\t z-index: 100000;\"\n\t+\"top: 5px; padding: 0 0 0 0; overflow: hidden ! important;\t height: 16px; max-height: 15px; font-family: Lucida Sans Unicode; max-width: 15px;\"\n\t+ (right_pos? \"right: 5px;\" : \"left: \"+lpix+\";\" );\t \n if ( ! pool[\"menu\"+name].length ) { return; }\n var div = document.getElementById('GM_pseudo_menu'), bold, bold2, img, ul, li, par = document.body ? document.body : document.documentElement, \n\tfull_name=\"GreaseMonkey \\u27a4 User Script Commands \\u00bb\", short_name=\"GM\\u00bb\";\n if ( ! div ) {\n\t div = document.createElement('div');\n\t div.id = 'GM_pseudo_menu';\n\t par.appendChild(div);\n\t div.style.cssText= doGMmenu.divcss;\n\t //div.title=\"Click to open GreaseMonkey menu\";\n\t bold = document.createElement('b');\n\t //bold.textContent=short_name;\n\tdiv.appendChild(bold);\n\timg=document.createElement('img');\n\timg.src=\"data:image/gif;base64,AAABAAEADxAAAAEAIAAoBAAAFgAAACgAAAAPAAAAIAAAAAEAIAAAAAAAAAAAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAADgAAABAAAAAQAAAAEAAAAA4AAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAfw8ANGiHADx42wBAf/8AQH//AEB//wBAf/8AQH//ADx42wA0aIcAQH8PAAAAAAAAAAAAAAAAAEB/LwBAf98jZp//YKrX/4/b//+T3P//lNz//5Pc//+Q2///YarX/yNmn/8AQH/fAEB/LwAAAAAAAAAAAEB/vzR5r/+M2v//ktv//5jd//+c3///nt///53f//+Z3v//lNz//43a//80ea//AEB/vwAAAAAAQH8PAEB//4PQ9/9+v+D/L0Vj/x4qX/8qOIT/KjmY/yo4if8fKmX/L0Vn/4DA4P+D0Pf/AEB//wAAAAAAQH8PEVOP/43a//9Se5D/gbXS/6bi//+t5P//seX//67l//+o4v//grbT/1R8kv+O2v//AEB//wAAAAAAJElfCEJ6/4XR9/+W3f//oOD//2mVn/9wlZ//uuj//3GXn/9rlJ//o+H//5ne//+G0ff/CEJ6/wAkSV8TPmXfO3em/1CXx/+W3f//oOD//wAmAP8AHQD/uOf//wAmAP8AHQD/ouH//5ne//9Rl8f/Q3+s/xM+Zd87bZP/O3em/z6Dt/+U3P//nN///0BvQP8QPBD/ruT//0BvQP8QPBD/n9///5bd//8+g7f/Q3+s/zttk/8yaJP/S4ax/yNmn/+P2///l93//2Gon/9lop//peH//2apn/9iop//md7//5Hb//8jZp//S4ax/zJok/8JQ3vvMm2d/wBAf/+D0Pf/kNv//5bd//+a3v//dbff/5re//+X3f//ktv//4TQ9/8AQH//Mm2d/wlDe+8APn1PAD99rwA/fq8rcKf/g9D3/47a//9boc//AEB//1uhz/+O2v//g9D3/ytwp/8AP36vAD99rwA+fU8AAAAAAAAAAAAAAAAAQH/PAEB//xFTj/8ANGf/ADBf/wAyY/8AOnP/ADpz/wAqU/8AIEA/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEB/jwBAf/8AQH//AC5b/wAgQP8AIED/AChP/wA6dL8AJEnfACBADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAfx8AQH+PAEB/3wA2a/8AJEf/ACBA/wAgQH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAfy8AQH9vAC5crwAiRN8AAAAAAAAAAAAAAAD/////4A///8AH//+AA///gAP//4AD//+AAwAAAAEAAAABAAAAAQAAAAEAAIADAADgDwAA8AcAAPwfAAD/zwAA\";\n\twith (img.style) { border=\"none\"; margin=\"0\"; padding=\"0\"; cssFloat=\"left\"; }\n\tbold.appendChild(img);\n\tfunction minimize(p) {\n\t var style=p;\n\t if (p.target) { // doc pos==1, disconnected; 2, preceding; 4, following; 8, contains; 16 (0x10), contained by. Gives relation p.relatedTarget \"is\" to this. (0x0 means not related but is same elem)\n\t var pos=this.compareDocumentPosition(p.relatedTarget);\n\t var contained_by=pos & 0x10;\n\t if (pos==2 || pos==10) \n\t\tstyle=div.style; \n\t else return;\n\t }\n\t style.setProperty(\"overflow\",\"hidden\",\"important\");\n\t with(style) { height = '15px';position=\"fixed\"; top=\"5px\"; maxWidth=\"15px\"; maxHeight=\"15px\"; borderStyle=\"outset\";}\n\t bold.textContent=\"\";\n\t bold.appendChild(img);\n\t}\n\tdiv.addEventListener(\"click\", function (e) {\n\t if (e.button!=0) return;\n\t if ( div.style.height[0] == 1 ) {\n\t with (div.style) { height = ''; overflow=\"auto\"; top=(scrollY+5)+\"px\"; position=\"absolute\"; maxWidth=\"500px\"; maxHeight=\"\"; borderStyle=\"inset\"; }\n\t bold.textContent=full_name;\n\t div.addEventListener(\"mouseout\", minimize, false);\n\t }\n\t else \t{\n\t minimize(div.style);\n\t div.removeEventListener(\"mouseout\", minimize, false);\n\t }\n\t }, false);\n\tbold.style.cssText=\"cursor: move; font-size: 1em; border-style=outset;\" ;\n\tbold.title=\"GreaseMonkey. Click this icon to open GreaseMonkey scripts' menu. Middle Click to move icon other side. Right Click to remove icon.\";\n\tbold.addEventListener(\"mousedown\", function(){return false}, false);\n\tbold.style.cursor = \"default\";\n\tbold.addEventListener(\"mousedown\", function (e) {\n\t if (e.button==0) return;\n\t if (e.button==1) {\t this.parentNode.style.left = this.parentNode.style.left ? '' : lpix;\t this.parentNode.style.right = this.parentNode.style.right ? '' : '10px';\t GM_setValue(\"GMmenuLeftRight\", ( this.parentNode.style.right ? true : false ) ); }\n\t else \n\t div.style.display=\"none\"; //div.parentNode.removeChild(div);\n\t }, false);\n } // end if ! div\n bold=div.firstElementChild;\n if (i==0) {\n\tdiv.appendChild(document.createElement('br'));\n\tdiv.appendChild(bold2 = document.createElement('div'));\n\tbold2.textContent=\"\\u00ab \"+name+\" Commands \\u00bb\";\n\tbold2.style.cssText=\"font-weight: bold; font-size: 0.9em; text-align: center ! important;\"+doGMmenu.colors+\"background-color: #aad ! important;\";\n\tdiv.appendChild(ul = document.createElement('ul'));\n\tul.style.cssText=\"margin: 1px; padding: 1px; list-style: none; text-align: left; \";\n\tdoGMmenu.ul=ul;\t doGMmenu.count=0;\n }\n for( ; pool[\"menu\"+name][i]; i++ ) {\n\tvar li = document.createElement('li'), a;\n\tli.appendChild(a = document.createElement('a'));\t\t\t\t //\t\t\t\t +'setTimeout(function() {div.style.cssText= doGMmenu.divcss;}, 100);'\n\t a.dataset.i=i;\n\tfunction callfunc(e) { \n\t var i=parseInt(e.target.dataset.i);\n\t div.style.position=\"fixed\";div.style.top=\"5px\"; \n\t div.style.cssText= doGMmenu.divcss;div.style.height=\"0.99em\";\n\t uwin[\"menu\"+name][i][1]();\n\t}\n\tif (FireFox) \ta.addEventListener(\"click\" , callfunc\t, 0);\n\telse a.onclick=callfunc;//new Function(func_txt);\n\twindow[\"menu\"+name]=pool[\"menu\"+name];\n\ta.addEventListener(\"mouseover\", function (e) { this.style.textDecoration=\"underline\"; }, false);\n\ta.addEventListener(\"mouseout\", function (e) { this.style.textDecoration=\"none\";}, false);\n\ta.textContent=pool[\"menu\"+name][i][0];\n\ta.style.cssText=\"font-size: 0.9em; cursor: pointer; font-weight: bold; opacity: 1.0;background-color: #bbd;color:black ! important;\";\n\tdoGMmenu.ul.appendChild(li);\t doGMmenu.count++;\n }\n } // end of function doGMmenu.\n\n useOwnMenu();\n function useOwnMenu() {\n if (FireFox) uwin.doGMmenu=doGMmenu;\n var original_GM_reg=GM_registerMenuCommand;\n pool[\"menu\"+name] = [], hasPageGMloaded = false;\n addEventListener('load',function () {if (parent!=window) return; hasPageGMloaded=true;doGMmenu(\"loaded\");},false);\n GM_registerMenuCommand=function( oText, oFunc, c, d, e) {\n if (parent!=window || /{\\s*}\\s*$/.test( oFunc.toString() )) return;\n hasPageGMloaded=document.readyState[0] == \"c\"; //loading, interactive or complete\n var menu=pool[\"menu\"+name]; menu[menu.length] = [oText, oFunc]; if( hasPageGMloaded ) { doGMmenu(); } \n pool[\"menu\"+name];// This is the 'write' access needed by pool var to save values set by menu[menu.lenth]=x\n original_GM_reg.call(unsafeWindow, oText, oFunc, c, d, e);\n }\n } //end useOwnMenu()\n\n function setStatus(s) {\n //if (s) s = s.toLowerCase ? s.toLowerCase() : s;\n setStatus.value = s;\n var div=document.getElementById(\"GMstatus\");\n if ( div ) {\t\n if ( s ) {\t div.textContent=s;\t div.style.display=\"block\";\t setDivStyle();\t }\n else { setDivStyle();\t div.style.display=\"none\"; }\n } \n else if ( s ) { \n div=document.createElement('div');\n div.textContent=s;\n div.setAttribute('id','GMstatus');\n if (document.body) document.body.appendChild(div);\n setDivStyle();\n div.addEventListener('mouseout', function(e){ setStatus(); },false);\n }\n if (s) setTimeout( function() { if (s==setStatus.value) setStatus(); }, 10000);\n setTimeout(setDivStyle, 100);\n function setDivStyle() {\n var div=document.getElementById(\"GMstatus\");\n if ( ! div ) return;\n var display=div.style.display; \n div.style.cssText=\"border-top-left-radius: 3px; border-bottom-left-radius: 3px; height: 16px;\"\n\t+\"background-color: \"+bg_color+\" ! important; color: black ! important; \"\n\t+\"font-family: Nimbus Sans L; font-size: 11.5pt; z-index: 999999; padding: 2px; padding-top:0px; border: 1px solid #82a2ad; \"//Lucida Sans Unicode;\n\t+\"position: fixed ! important; bottom: 0px; \" + (FireFox && brversion >= 4 ? \"left: \"+lpix : \"\" )\n\tdiv.style.display=display;\n }\n }\n initStatus();\n function initStatus() {\n window.__defineSetter__(\"status\", function(val){ setStatus(val); });\n window.__defineGetter__(\"status\", function(){ return setStatus.value; });\n }\n var old_removeEventListener=Node.prototype.removeEventListener;\n Node.prototype.removeEventListener=function (a, b, c) {\n if (this.sfsint) { clearInterval(this.sfsint); this.sfsint=0; }\n else old_removeEventListener.call(this, a, b, c);\n }\n var old_addEventListener=Node.prototype.addEventListener;\n Node.prototype.addEventListener=function (a, b, c) {\n if (a[0] != \"D\") old_addEventListener.call(this, a, b, c);\n if (/^DOMAttrModified/.test(a)) {\n\tvar dis=this; setInterval.unlocked=15; // lasts for 40 secs;\n\tdis.oldStyle=dis.style.cssText;\n\tsetTimeout(checkForChanges, 200);\n\tdis.sfsint=setInterval(checkForChanges, 4000);\n\tfunction checkForChanges() {\n\t if ( ! setInterval.unlocked) return;\n\t if ( dis.style.cssText != dis.oldStyle ) {\n\t var event={ target: dis, attrName: \"style\", prevValue: dis.oldStyle};\n\t b.call(dis, event);\n\t }\n\t dis.oldStyle=dis.style.cssText;\n\t setInterval.unlocked--;// !! remove if needed for more than the first 60 secs\n\t}\n }\n else old_addEventListener.call(this, a, b, c);\n }\n var original_addEventListener=window.addEventListener;\n window.addEventListener=function(a, b, c) {\n if (/^load$/.test(a) && document.readyState == \"complete\") {\n b();\n }\n else original_addEventListener(a, b, c);\n }\n document.addEventListener=function(a, b, c) {\n if (/^load$/.test(a) && document.readyState == \"complete\")\n b();\n \telse original_addEventListener(a, b, c);\n }\n \n // The following version of alert, prompt and confirm are now asynchronous, \n // so persistData() may need to be called at end of callback (reply_handler) for prompt2 and confirm2;\n // If alert2, confirm2 or prompt2 is called form within an alert2, confirm2 or prompt2 reply handler, take care because the same window gets reused.\n function alert2 (info, size_factor, wratio) { // size_factor=0.5 gives window half size of screen, 0.33, a third size, etc.\n if (size_factor) sfactor=size_factor;\n if (wratio) widthratio=wratio;\n var swidth=screen.width*sfactor*widthratio, sheight=screen.height*sfactor;\n var popup=window.open(\"\",\"alert2\",\"scrollbars,\"\n\t\t\t +\", resizable=1,,location=no,menubar=no\"\n\t\t\t +\", personalbar=no, toolbar=no, status=no, addressbar=no\"\n\t\t\t +\", left=\"+(screen.width/2-swidth/2)+\",top=\"+(screen.height/2-sheight/1.5)\n\t\t\t +\", height=\"+sheight\n\t\t\t +\", width=\"+swidth\n\t\t\t );\n\t//log(\"sfactor \"+sfactor+ \"height=\"+sheight+\" top=\"+(sheight*sfactor)+ \", width=\"+swidth +\", left=\"+(swidth*sfactor));\n popup.document.body.innerHTML=\"<pre style='white-space: pre-wrap;'>\"+info+\"</pre>\";\n popup.focus();\n popup.document.addEventListener(\"keydown\", function(e) {\t if (e.keyCode == 27) popup.close();}, 0)\n return popup;\n }\n function prompt2 (str, fill_value, result_handler, mere_confirm,size_factor, wratio) {\n if (!result_handler) result_handler=function(){}\n var res;\n if (size_factor) sfactor=size_factor;\n if (wratio) widthratio=wratio;\n var swidth=screen.width*sfactor*widthratio, sheight=screen.height*sfactor;\n prompt_interruption={ a:str, b:fill_value, c:result_handler, d:mere_confirm, e:size_factor, f:wratio }; try {\n prompt_win=window.open(\"\",\"prompt2\",\"scrollbars=1\"\n\t\t\t +\", resizable=1,,location=0,menubar=no\"\n\t\t\t +\", personalbar=no, toolbar=no, status=no, addressbar=no\"\n\t\t\t +\", left=\"+(screen.width/2-swidth/2)+\",top=\"+(screen.height/2-sheight/1.5)\n\t\t\t +\", height=\"+sheight\n\t\t\t +\", width=\"+swidth\n\t\t\t ); } catch(e) { log(\"Cannot open prompt win, \"+e); }\n prompt_interruption=false;\n if (interrupted)\t{ prompt_win.close();interrupted=false;}\n log(\"window.open called, prompt_win: \"+prompt_win);\n // log(\"sfactor \"+sfactor+\", left=\"+(screen.width/2-swidth/2)+\",top=\"+(screen.height/2-sheight/1.5)\n // \t +\", height=\"+sheight\n // \t +\", width=\"+swidth);\n prompt_win.focus();\n var body=prompt_win.document.body, doc=prompt_win.document;\n body.innerHTML=\"\"\n\t+\"<pre id=p2pre style='white-space: pre-wrap;margin:0;'>\"\n\t+\"</pre>\"\n\t+\"<div style='bottom:0; position:relative;'>\" \n\t+( ! mere_confirm ? \"<div style='width:100%'>\"\n\t +\"<textarea id=p2reply style=' display:inline; width:100%; float:left; margin:0; '></textarea></div>\" : \"\")\n\t+\"<form style='clear: both' >\"\n\t+\"<input class=p2ips type=button value='Cancel/Next' >\"\n\t+\"<input class=p2ips type=button value='OK' >\"\n\t+\"</form>\"\n\t+\"</div>\";\n var pre=doc.getElementById(\"p2pre\");\n pre.textContent=str;\n var ta=doc.getElementById(\"p2reply\");\n if (ta) ta.textContent=fill_value;\n var form_inputs=body.getElementsByClassName(\"p2ips\");\n form_inputs[0].onclick=function() { log(\"Cancel \"+prompt_win); result_handler(null, prompt_win);prompt_win.close(); };//cancel\n //\tform_inputs[0].style.cssFloat=\"left\";\n form_inputs[1].onclick=function() { //OK\n\tif (!mere_confirm) { \n\t var ta = doc.getElementById(\"p2reply\");\n\t result_handler(ta.value, prompt_win);//.replace(/^\\s*|\\s*$/g,\"\"), prompt_win);\n\t}\n\telse result_handler(true, prompt_win);\n\tif ( ! prompt_win.dontclose)\n\t prompt_win.close();\n }\n if (ta) ta.focus();\n prompt_win.document.addEventListener(\"keydown\", function(e) {\t if (e.keyCode == 27) prompt_win.close();}, 0);\n\treturn prompt_win;\n } //end prompt2()\n function confirm2(str, result_handler) {\n if (!result_handler) result_handler=function(){}\n prompt2(str, \"\", function(res, pwin) { \n\t if (res==null) result_handler(false, pwin);\n\t else result_handler(true, pwin);\n }, true);\n }\n if(!String.prototype.contains) {\n String.prototype.contains = function (c) {\n return this.indexOf(c)!=-1;\n };\n }\n if (!String.prototype.startsWith) {\n Object.defineProperty(String.prototype, 'startsWith', {\n enumerable: false,\n\t configurable: false,\n\t writable: false,\n\t value: function (searchString, position) {\n\t position = position || 0;\n\t return this.indexOf(searchString, position) === position;\n }\n });\n }\n} //end platform_wrapper()", "function ChildBrowser() {\n}", "_realStart() {\n\t\t// No known way to make it work reliably on Windows\n\t\tif (process$3.platform === 'win32') {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#rl = f$2.createInterface({\n\t\t\tinput: process$3.stdin,\n\t\t\toutput: this.#mutedStream,\n\t\t});\n\n\t\tthis.#rl.on('SIGINT', () => {\n\t\t\tif (process$3.listenerCount('SIGINT') === 0) {\n\t\t\t\tprocess$3.emit('SIGINT');\n\t\t\t} else {\n\t\t\t\tthis.#rl.close();\n\t\t\t\tprocess$3.kill(process$3.pid, 'SIGINT');\n\t\t\t}\n\t\t});\n\t}", "processSGR(args) {\n\n // take the first argument, process it, and repeat to handle multiple\n // SGR commands bundled into the same escape sequences\n while (args.length > 0) {\n var arg = args.shift();\n \n // handle setting the foreground or background color from the basic\n // 16 color pallete\n if (arg >= 30 && arg <= 37) {\n this.cursor.fore = this.normalColors[arg - 30];\n continue;\n }\n else if (arg >= 40 && arg <= 47) {\n this.cursor.back = this.normalColors[arg - 40];\n continue;\n }\n if (arg >= 90 && arg <= 97) {\n this.cursor.fore = this.brightColors[arg - 90];\n continue;\n }\n else if (arg >= 100 && arg <= 107) {\n this.cursor.back = this.brightColors[arg - 100];\n continue;\n }\n\n // handle other implemented SGR commands\n switch (arg) {\n case 0: // reset/normal\n this.cursor.attr = 0;\n this.cursor.fore = \"#FFFFFF\";\n this.cursor.back = \"#000000\";\n break\n case 1: // bold\n this.cursor.attr |= 1;\n break;\n case 2: // faint\n // TODO\n break;\n case 3: // italic\n this.cursor.attr |= 2;\n break;\n case 4: // unerline\n this.cursor.attr |= 4;\n break;\n case 5: // slow blink\n // TODO\n break;\n /* case 6: rapid blink -- UNSUPPORTED */\n case 7: // swap foreground and background colors\n case 27: // reverse off\n var oldFore = this.cursor.fore;\n this.cursor.fore = this.cursor.back;\n this.cursor.back = oldFore;\n break;\n /* case 8: hide -- UNSUPPORTED */\n case 9: // crossed out\n this.cursor.attr |= 8;\n break;\n /* cases 10-19: alternative fonts -- UNSUPPORTED */\n /* case 20: Fraktur -- UNSUPPORTED */\n case 21: // bold-off\n this.cursor.attr &= ~1;\n break;\n case 22: // normal color intensity\n this.cursor.attr &= ~1;\n // TODO -- faint off\n break;\n case 23: // italic off\n this.cursor.attr &= ~2;\n break;\n case 24: // underline off\n this.cursor.attr &= ~4;\n break;\n case 25: // blink off\n // TODO\n break;\n /* case 26: Proportional spacing -- UNSUPPORTED */\n /* case 28: hide off -- UNSUPPORTED */\n case 29: // crossed out off\n this.cursor.attr &= ~8;\n break;\n case 38: // set foreground color\n var color = this.processSGRColor(args);\n if (color) {\n this.cursor.fore = color;\n }\n\n break;\n case 39: // default foreground color\n this.cursor.fore = \"#FFFFFF\";\n break;\n case 48: // set background color\n var color = this.processSGRColor(args);\n if (color) {\n this.cursor.back = color;\n }\n\n break;\n case 49: // default background color\n this.cursor.back = \"#000000\";\n break;\n /* cases 50 - 74: (frame, encircle, overline, underline color,\n ideogram, superscript/subscript) -- UNSUPPORTED: */\n }\n }\n }", "function CursorTrack() {}", "function _openTask() {\n exec('open http://localhost:8000');\n exec('subl .');\n}", "function SystemSocketOpen()\n{\n ws.onmessage = SystemSocketMessageHandler;\n document.getElementById(\"Command_Reply\").innerHTML = \"Server Connection Initiated\"\n\n // Get a list from the server of all linuxcnc status items\n ws.send( JSON.stringify({ \"id\":\"STATUS_CHECK\", \"command\":\"watch\", \"name\":\"estop\" }) ) ;\n ws.send( JSON.stringify({ \"id\":\"INI_MONITOR\", \"command\":\"watch\", \"name\":\"ini_file_name\" }) ) ;\n}", "run() {\n var method = this[os.platform()];\n if (method) {\n return method.apply(this);\n } else {\n throw new OSNotSupported(os.platform());\n }\n }", "setModePrivate(params) {\n for (let i = 0; i < params.length; i++) {\n switch (params.params[i]) {\n case 1:\n this._coreService.decPrivateModes.applicationCursorKeys = true;\n break;\n case 2:\n this._charsetService.setgCharset(0, DEFAULT_CHARSET);\n this._charsetService.setgCharset(1, DEFAULT_CHARSET);\n this._charsetService.setgCharset(2, DEFAULT_CHARSET);\n this._charsetService.setgCharset(3, DEFAULT_CHARSET);\n // set VT100 mode here\n break;\n case 3:\n /**\n * DECCOLM - 132 column mode.\n * This is only active if 'SetWinLines' (24) is enabled\n * through `options.windowsOptions`.\n */\n if (this._optionsService.options.windowOptions.setWinLines) {\n this._bufferService.resize(132, this._bufferService.rows);\n this._onRequestReset.fire();\n }\n break;\n case 6:\n this._coreService.decPrivateModes.origin = true;\n this._setCursor(0, 0);\n break;\n case 7:\n this._coreService.decPrivateModes.wraparound = true;\n break;\n case 12:\n // this.cursorBlink = true;\n break;\n case 45:\n this._coreService.decPrivateModes.reverseWraparound = true;\n break;\n case 66:\n this._logService.debug('Serial port requested application keypad.');\n this._coreService.decPrivateModes.applicationKeypad = true;\n this._onRequestSyncScrollBar.fire();\n break;\n case 9: // X10 Mouse\n // no release, no motion, no wheel, no modifiers.\n this._coreMouseService.activeProtocol = 'X10';\n break;\n case 1000: // vt200 mouse\n // no motion.\n this._coreMouseService.activeProtocol = 'VT200';\n break;\n case 1002: // button event mouse\n this._coreMouseService.activeProtocol = 'DRAG';\n break;\n case 1003: // any event mouse\n // any event - sends motion events,\n // even if there is no button held down.\n this._coreMouseService.activeProtocol = 'ANY';\n break;\n case 1004: // send focusin/focusout events\n // focusin: ^[[I\n // focusout: ^[[O\n this._coreService.decPrivateModes.sendFocus = true;\n break;\n case 1005: // utf8 ext mode mouse - removed in #2507\n this._logService.debug('DECSET 1005 not supported (see #2507)');\n break;\n case 1006: // sgr ext mode mouse\n this._coreMouseService.activeEncoding = 'SGR';\n break;\n case 1015: // urxvt ext mode mouse - removed in #2507\n this._logService.debug('DECSET 1015 not supported (see #2507)');\n break;\n case 25: // show cursor\n this._coreService.isCursorHidden = false;\n break;\n case 1048: // alt screen cursor\n this.saveCursor();\n break;\n case 1049: // alt screen buffer cursor\n this.saveCursor();\n // FALL-THROUGH\n case 47: // alt screen buffer\n case 1047: // alt screen buffer\n this._bufferService.buffers.activateAltBuffer(this._eraseAttrData());\n this._coreService.isCursorInitialized = true;\n this._onRequestRefreshRows.fire(0, this._bufferService.rows - 1);\n this._onRequestSyncScrollBar.fire();\n break;\n case 2004: // bracketed paste mode (https://cirw.in/blog/bracketed-paste)\n this._coreService.decPrivateModes.bracketedPasteMode = true;\n break;\n }\n }\n return true;\n }", "function g(b,c){var d,e,f,g,j,k,l,m,p,r,s,u,v,w,z,B,E=b.length,F=\"\",G=y(),H=n(\"isRTL\");\n// calculate position/dimensions, create html\nfor(d=0;d<E;d++)e=b[d],f=e.event,g=A(e.start,e.start),j=A(e.end,e.start),k=C(e.col),l=D(e.col),m=l-k,\n// shave off space on right near scrollbars (2.5%)\n// TODO: move this to CSS somehow\nl-=.025*m,m=l-k,p=m*(e.forwardCoord-e.backwardCoord),n(\"slotEventOverlap\")&&(\n// double the width while making sure resize handle is visible\n// (assumed to be 20px wide)\np=Math.max(2*(p-10),p)),H?(s=l-e.backwardCoord*m,r=s-p):(r=k+e.backwardCoord*m,s=r+p),\n// make sure horizontal coordinates are in bounds\nr=Math.max(r,k),s=Math.min(s,l),p=s-r,e.top=g,e.left=r,e.outerWidth=p,e.outerHeight=j-g,F+=h(f,e);\n// retrieve elements, run through eventRender callback, bind event handlers\nfor(G[0].innerHTML=F,// faster than html()\nu=G.children(),d=0;d<E;d++)e=b[d],f=e.event,v=a(u[d]),// faster than eq()\nw=o(\"eventRender\",f,f,v),w===!1?v.remove():(w&&w!==!0&&(v.remove(),v=a(w).css({position:\"absolute\",top:e.top,left:e.left}).appendTo(G)),e.element=v,f._id===c?i(f,v,e):v[0]._fci=d,O(f,v));\n// record event sides and title positions\nfor(q(G,b,i),d=0;d<E;d++)e=b[d],(v=e.element)&&(e.vsides=x(v,!0),e.hsides=t(v,!0),z=v.find(\".fc-event-title\"),z.length&&(e.contentTop=z[0].offsetTop));\n// set all positions/dimensions at once\nfor(d=0;d<E;d++)e=b[d],(v=e.element)&&(v[0].style.width=Math.max(0,e.outerWidth-e.hsides)+\"px\",B=Math.max(0,e.outerHeight-e.vsides),v[0].style.height=B+\"px\",f=e.event,void 0!==e.contentTop&&B-e.contentTop<10&&(\n// not enough room for title, put it in the time (TODO: maybe make both display:inline instead)\nv.find(\"div.fc-event-time\").text(Z(f.start,n(\"timeFormat\"))+\" - \"+f.title),v.find(\"div.fc-event-title\").remove()),o(\"eventAfterRender\",f,f,v))}", "init_console() { \n var ascendant = this\n /* Do the keypress magic like a real console, but later\n keypress(process.stdin);\n // listen for the \"keypress\" event\n process.stdin.on('keypress', function (ch, key) {\n console.log('got \"keypress\"', key);\n if (key && key.ctrl && key.name == 'd') {\n process.stdout.write(\"Exiting FXCM Console...\")\n process.stdin.pause()\n process.exit();\n }\n });\n\n //process.stdin.setRawMode(true);\n //process.stdin.resume();\n */\n process.stdin.on('data', function (data) {\n \n var input = data.toString().trim();\n var split = input.search('{');\n if (split === -1) {\n split = input.length;\n }\n const command = input.substr(0, split).trim();\n var params = input.substr(split).trim();\n const _fxcmClient = ascendant._client;\n ascendant.commands.set(ascendant.commands.size + 1, input)\n \n // if the line was empty we don't want to do anything\n switch (command) {\n case 'help':\n process.stdout.write('Help is on the way!\\r\\n')\n break;\n case 'history': \n var history = \"Command History:\\r\\n\" \n ascendant.commands.forEach((value, key) => { history += value + \"\\r\\n\" }) \n process.stdout.write(history + \"\\r\\n\" + \"Press return to continue..\")\n break;\n case 'exit': \n process.stdout.write(\"I'm out, bye!\")\n process.exit() \n break;\n case 'live':\n console.log(`Live rates for currency pair(${params}):` )\n fxcmClient.subscribeLiveRates(params)\n break;\n case 'accounts':\n fxcmClient.getAccounts()\n break;\n case 'products':\n fxcmClient.getProducts()\n break;\n case 'orderbook':\n fxcmClient.getProductOrderBook()\n break; \n case 'send':\n // command must be registered with cli\n\t if (params.length > 0) {\n params = JSON.parse(params)\n try {\n \n ascendant.makeRequest(params.method, params.resource, params.params, params.callback);\n \n } catch (e) {\n console.log('could not parse JSON parameters: ', e);\n }\n } else {\n _fxcmClient.emit(command, {});\n }\n _fxcmClient.emit('prompt');\n break;\n default: \n if (_fxcmClient.eventNames().indexOf(command) < 0) {\n console.log(\"Command not recognized. Available commands: \", _fxcmClient.eventNames())\n _fxcmClient.emit('prompt');\n }\n return;\n }\n\n });\n \n this._client.on('prompt', (arg = '') => {\n readline.clearLine(process.stdout, 0)\n readline.cursorTo(process.stdout, 0, null);\n process.stdout.write('fxcm:> ' + arg);\n })\n\n this._client.on('exit', () => {\n process.exit();\n });\n\n // loading of extra modules\n this._client.on('load', (params) => {\n if (typeof(params.filename) === 'undefined') {\n console.log('command error: \"filename\" parameter is missing.')\n } else {\n var test = require(`./${params.filename}`);\n test.init(cli,socket);\n }\n });\n /*\n // helper function to send parameters in stringified form, which is required by FXCM REST API\n this._client.on('send', (params) => {\n if (typeof(params.params) !== 'undefined') {\n params.params = querystring.stringify(params.params);\n }\n ascendant._client.emit('send_raw', params);\n });\n */\n // will send a request to the server\n this._client.on('send_raw', (params) => {\n // avoid undefined errors if params are not defined\n if (typeof(params.params) === 'undefined') {\n params.params = '';\n }\n // method and resource must be set for request to be sent\n if (typeof(params.method) === 'undefined') { \n console.log('command error: \"method\" parameter is missing.');\n } else if (typeof(params.resource) === 'undefined') {\n console.log('command error: \"resource\" parameter is missing.');\n } else {\n ascendant.makeRequest(params.method, params.resource, params.params, params.callback);\n }\n });\n\n /**\n * \n */\n this._client.on('price_subscribe', (params) => {\n if(typeof(params.pairs) === 'undefined') {\n console.log('command error: \"pairs\" parameter is missing.');\n } else {\n subscribe(params.pairs);\n }\n });\n /**\n * \n */\n this._client.on('price_unsubscribe', (params) => {\n if(typeof(params.pairs) === 'undefined') {\n console.log('command error: \"pairs\" parameter is missing.');\n } else {\n unsubscribe(params.pairs);\n }\n });\n \n }", "function open(pathname, flags, mode) {\n // debug('open', pathname, flags, mode);\n var args = [x86_64_linux_1.SYS.open, pathname, flags];\n if (typeof mode === 'number')\n args.push(mode);\n // console.log(args);\n return syscall.apply(null, args);\n}", "function Close_Builtin() {\r\n}" ]
[ "0.550285", "0.5476711", "0.49394187", "0.48925105", "0.47765994", "0.47370273", "0.47320688", "0.47286943", "0.47102764", "0.47073632", "0.47050738", "0.467522", "0.46740142", "0.4655727", "0.46541288", "0.46445587", "0.46295154", "0.46079046", "0.45822662", "0.45442832", "0.454126", "0.4531586", "0.45069024", "0.45014307", "0.44823423", "0.44774023", "0.44708836", "0.44486478", "0.4446349", "0.44369373", "0.44196355", "0.44085553", "0.4404596", "0.4401539", "0.4392386", "0.43819055", "0.43782717", "0.43748954", "0.43701115", "0.43687287", "0.43656492", "0.43598336", "0.43256462", "0.43256462", "0.43256462", "0.43214846", "0.4320858", "0.43114015", "0.43000743", "0.4297153", "0.42960215", "0.42958343", "0.42958343", "0.4288906", "0.42804372", "0.42797166", "0.42751455", "0.42749888", "0.4274461", "0.42738026", "0.42694557", "0.42550159", "0.42535174", "0.42535174", "0.42535174", "0.42370662", "0.42363405", "0.42350495", "0.42238253", "0.42238253", "0.4223483", "0.4223331", "0.42232123", "0.4216348", "0.4216273", "0.4216273", "0.42160943", "0.42088023", "0.420758", "0.42032847", "0.4202302", "0.41953894", "0.4192304", "0.41878068", "0.41875806", "0.41815007", "0.41678214", "0.41629615", "0.4161107", "0.41579092", "0.41576704", "0.4153338", "0.41532996", "0.4149995", "0.41491288", "0.41457006", "0.41432288", "0.41422492", "0.4133297", "0.41329235", "0.41321522" ]
0.0
-1
show additional fields function
function unhide(n) { var btn = document.getElementById('btn'+n); if (btn.style.display = 'inline'){ btn.style.display = 'none' }else{ btn.style.display = 'inline' } var field = document.getElementById("hidden"+n); if (field.style.display === "none") { field.style.display = "block"; /*} else { field.style.display = "none"; */ } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fields () {\n return ['title', 'subtitle', 'body', 'favicon'];\n }", "ViewAllAccountFields() {\r\n this.showFields = !this.showFields;\r\n }", "function printFormEdit() {}", "function printDetailsModified() {\n\treturn `${this.name} (${this.type}) - ${this.age}`;\n}", "function toggleAdditionalInfo() {\n\t\t\t// ng-show is used to toggle between true and false, hiding and showing the additional\n\t\t\t// input fields\n\t\t\t!$scope.additionalInfo ? $scope.additionalInfo = true : $scope.additionalInfo = false;\n\t\t}", "function fieldDisplay(obj) {\r\n \t var fieldDiv = document.getElementById(obj);\r\n \t fieldDiv.style.display = 'block';\r\n \t }", "fields () {\n return {\n author: 'creator',\n title: 'title',\n subject: 'sub'\n }\n }", "fields () {\n return {\n author: 'creator',\n title: 'title',\n subject: 'sub'\n }\n }", "fieldsInfo () {\n return [\n {\n text: this.$t('fields.id'),\n name: 'id',\n details: false,\n table: false,\n },\n\n {\n type: 'input',\n column: 'order_nr',\n text: 'order No.',\n name: 'order_nr',\n multiedit: false,\n required: true,\n disabled: true,\n create: false,\n },\n {\n type: 'input',\n column: 'name',\n text: 'person name',\n name: 'name',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'input',\n column: 'email',\n text: 'email',\n name: 'email',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'select',\n url: 'crm/people',\n list: {\n value: 'id',\n text: 'fullname',\n data: [],\n },\n column: 'user_id',\n text: this.$t('fields.person'),\n name: 'person',\n apiObject: {\n name: 'person.name',\n },\n table: false,\n },\n {\n type: 'input',\n column: 'package_points',\n text: 'package points',\n name: 'package_points',\n required: false,\n edit: false,\n create: false,\n },\n\n // package_points\n {\n type: 'select',\n url: 'crm/package',\n list: {\n value: 'id',\n text: 'full_name',\n data: [],\n },\n column: 'package_id',\n text: 'package name',\n name: 'package',\n apiObject: {\n name: 'package.package_name',\n },\n table: false,\n },\n {\n type: 'input',\n column: 'package_name',\n text: 'package name',\n name: 'package_name',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'input',\n column: 'package_price',\n text: 'package price',\n name: 'package_price',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'input',\n column: 'pur_date',\n text: 'purche date',\n name: 'pur_date',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n ]\n }", "function showDetails(){\n\tView.controllers.get('visitorController')['editTag']=true;\n var grid = View.panels.get('visitorsGrid');\n var selectedRow = grid.rows[grid.selectedRowIndex];\n var visitorId = selectedRow[\"visitors.visitor_id\"];\n var restriction = new Ab.view.Restriction();\n restriction.addClause(\"visitors.visitor_id\", visitorId, \"=\");\n View.panels.get('visitorsForm').refresh(restriction,false);\n}", "static fields () {\n return {\n cod: this.attr(null),\n titulo: this.attr(''),\n precio: this.attr('')\n }\n }", "function attFields() {\n\n\tlet code = '<div id=\"fieldadd\">';\n\tfor (i = 0; i < NAME_LIST.length; i++) {\n\n\t\tif (NAME_LIST[i] === 'color') {\n\n\t\t\tcode += '<div class=\"w3-col l3 m4 w3-padding\">'+ NAME_LIST[i] +':<a class=\"w3-text-red\">*</a><br>'+\n\t\t\t\t\t\t'<input type=\"color\" id=\"color\" value=#808080 style=\"width:100%\">'+\n\t\t\t\t\t'</div>';\n\n\t\t} else if (NECESSARY_VAL.indexOf(NAME_LIST[i]) !== -1){\n\n\t\t\tcode += '<div class=\"w3-col l3 m4 w3-padding\">'+ NAME_LIST[i] +':<a class=\"w3-text-red\">*</a><br>'+\n\t\t\t\t\t\t'<input type=\"text\" autocomplete=\"on\" class=\"w3-input w3-border\" id=\"'+ NAME_LIST[i] +'\">'+\n\t\t\t\t\t'</div>';\n\t\t} else if ([\"PDB_file\",\"image\"].indexOf(NAME_LIST[i]) !== -1){\n\n\t\t\tcode += '<div class=\"w3-col l3 m4 w3-padding\">'+ NAME_LIST[i] +':<br>'+\n\t\t\t\t\t\t'<input type=\"file\" autocomplete=\"on\" id=\"'+ NAME_LIST[i] +'\">'+\n\t\t\t\t\t'</div>';\n\t\t} else {\n\n\t\t\tcode += '<div class=\"w3-col l3 m4 w3-padding\">'+ NAME_LIST[i] +':<br>'+\n\t\t\t\t\t\t'<input type=\"text\" autocomplete=\"on\" class=\"w3-input w3-border\" id=\"'+ NAME_LIST[i] +'\">'+\n\t\t\t\t\t'</div>';\n\t\t}\n\t};\n\t\n\tcode += '</div>';\n\treturn code;\n}", "function showInput() {\n // console.log(fields);\n navigation.navigate('SelectedInput', {fieldsLength: fields.length});\n }", "static fields () {\n return {\n id: this.increment(),\n label: this.attr(''),\n value: this.attr(''),\n type: this.attr(''),\n }\n }", "function showDetails() {\n // 'this' is the row data object\n var s1 = ('Total room area: ' + this['rm.total_area'] + ' sq.ft.');\n \n // 'this.grid' is the parent grid/mini-console control instance\n var s2 = ('Parent control ID: ' + this.grid.parentElementId);\n \n // you can call mini-console methods\n var s3 = ('Row primary keys: ' + toJSON(this.grid.getPrimaryKeysForRow(this)));\n \n alert(s1 + '\\n' + s2 + '\\n' + s3);\n}", "function htmlAttributeDisplayDetails() {}", "function showFormarttedInfo(user) {\n console.log('user Info', \"\\n id: \" + user.id + \"\\n user: \" + user.username + \"\\n firsname: \" + user.firsName + \"\\n \");\n}", "function AddDisplay(fieldName, fieldValue) {\r\n\r\n if (fieldName == \"Address Verification\") {\r\n var string = \"<div class=\\\"form-group\\\">\";\r\n string += \"<label class=\\\"col-md-4 control-label\\\">\";\r\n string += fieldName;\r\n string += \"</label>\";\r\n string += \"<div class=\\\"col-md-7\\\">\";\r\n string += \"<p class=\\\"form-control text-center\\\">\";\r\n string += fieldValue;\r\n string += \"</p>\";\r\n string += \"</div>\";\r\n string += \"</div>\";\r\n return string;\r\n }\r\n else if (fieldValue) {\r\n var string = \"<div class=\\\"form-group\\\">\";\r\n string += \"<label class=\\\"col-md-4 control-label\\\">\";\r\n string += fieldName;\r\n string += \"</label>\";\r\n string += \"<div class=\\\"col-md-7\\\">\";\r\n string += \"<p class=\\\"form-control text-center\\\">\";\r\n string += fieldValue;\r\n string += \"</p>\";\r\n string += \"</div>\";\r\n string += \"</div>\";\r\n return string;\r\n }\r\n else\r\n return \"\";\r\n }", "function infoForField(field, extendedProps) { // 434\n // 435\n // Ensure fields are not added more than once // 436\n if (_.contains(addedFields, field)) // 437\n return; // 438\n // 439\n // Get schema definitions for this field // 440\n var fieldDefs = ss.schema(field); // 441\n // 442\n var info = {name: field}; // 443\n // 444\n // If there are allowedValues defined, use them as select element options // 445\n if (useAllowedValuesAsOptions) { // 446\n var av = fieldDefs.type === Array ? ss.schema(field + \".$\").allowedValues : fieldDefs.allowedValues; // 447\n if (_.isArray(av)) { // 448\n info.options = \"allowed\"; // 449\n } // 450\n } // 451\n // 452\n addedFields.push(field); // 453\n // 454\n // Return the field info along with the extra properties that // 455\n // all fields should have // 456\n return _.extend(info, extendedProps); // 457\n } // 458", "function show_field(field,fieldsCounter){\n field_value = \"<td>\"+(fieldsCounter-1)+\"</td><td>\"+ field.lable +\" </td><td>\"+ field.name +\"</td><td>\"+ field.type + \"</td>\";\n $('.fields').append(\"<tr>\"+ field_value +\"</tr>\");\n}", "function showFieldOptions( obj ) {\n\t\tvar i, singleField,\n\t\t\tfieldId = obj.getAttribute( 'data-fid' ),\n\t\t\tallFieldSettings = document.querySelectorAll( '.frm-single-settings:not(.frm_hidden)' );\n\n\t\tfor ( i = 0; i < allFieldSettings.length; i++ ) {\n\t\t\tallFieldSettings[i].classList.add( 'frm_hidden' );\n\t\t}\n\n\t\tsingleField = document.getElementById( 'frm-single-settings-' + fieldId );\n\t\tmoveFieldSettings( singleField );\n\n\t\tsingleField.classList.remove( 'frm_hidden' );\n\t\tdocument.getElementById( 'frm-options-panel-tab' ).click();\n\t}", "function showField(field) {\n var dest = document.getElementById(field);\n if (dest) {\n dest.style.visibility = 'visible';\n dest.style.display = 'inline';\n }\n}", "get fields () {\n return {\n id: {\n type : 'int',\n primary: true,\n },\n\n title: {\n type: 'text'\n },\n\n album: {\n type: 'text'\n },\n\n preview_link: {\n type: 'text'\n },\n\n artwork: {\n type: 'text'\n },\n\n artist_id: {\n type: 'int'\n }\n }\n }", "function showAdvanced(showit) {\n var vis = showit ? \"inline-block\" : \"none\";\n d3.select(parentElement + \" ~ #celestial-form\").selectAll(\".advanced\").style(\"display\", vis);\n d3.select(parentElement + \" ~ #celestial-form\").selectAll(\"#label-propername\").style(\"display\", showit ? \"none\" : \"inline-block\");\n}", "function displayFields(selectorID) {\n\tif (selectorID !== \"\") {\n\t $(\".df\" + selectorID).hide();\n\t if ($(\"#\" + selectorID).val()) {\n\t\t$('.df' + $(\"#\" + selectorID).val()).show(); // Show currently selected\n\t }\n\t}\n }", "function DisplayConstituentCustomFields() {\n\n DisplayCustomFields('customFieldContainer', CustomFieldEntity.CRM, function () {\n $('.editable').prop('disabled', true);\n LoadDatePickers();\n LoadDatePair();\n });\n\n}", "desc(field) {\r\n\t\treturn this.push('desc', [...arguments]);\r\n\t}", "function addFields(){\n var fields=[\"id\",\"query2\", \"sameAs\"];\n \n var ftag='<input class=\"object\" type=\"text\" ondrop=\"drop(event)\" onndragover=\"allowDrop(event)\" size=\"50\" placeholder=\"..escribe o arrastra etiqueta..\"'\n \n \n for(var i in fields){\n $(\"#fieldsarea\").append('<label for=\"'+fields[i]+'\">'+id2json(fields[i])+' </label><br>')\n .append(ftag+\" id='\"+fields[i]+\"'>\")\n .append('<br>');\n }\n}", "function display_edit_fields(id)\r\n {\r\n $('#nc' + id).trigger('click');\r\n }", "function addMoreFields(field) {\n var name = \"product[\"+field+\"][]\";\n if(field == 'images')\n name += '[img_path]'\n $(\"<input type='text' value='' />\")\n .attr(\"name\", name)\n .appendTo(\"#\"+field);\n}", "function showDetails(row){\n\tabRepmAddEditLeaseInABuilding_ctrl.abRepmAddEditLeaseInABuildingAddLease_form.show(false);\n\t\n\tvar ls_id = row.restriction.clauses[0].value;\n\t\n\trefreshPanels(ls_id);\n}", "displayInfo() {\n\t\t\tlet info = super.displayInfo() + ', менеджер: ' + this.manager.name ;\n\t\t\tconsole.log( info );\n\t\t\treturn info\n\t\t\t}", "static get tag() {\n return \"simple-fields\";\n }", "function ShowHideAttributes(printDebug, frm, cdt, cdn, reload_defaults, refresh_items) {\r\n if (printDebug) console.log(__(\"ShowHideAttributes*****************************\"));\r\n\t//var configurator_mode = false;\r\n\r\n\tif (locals[cdt][cdn]) {\r\n\t\t\r\n var row = locals[cdt][cdn];\r\n\t\t\r\n\t\tvar template = \"\"\r\n\t\t\r\n\t\tif (row.configurator_of){\r\n\t\t\ttemplate = row.configurator_of\r\n\t\t}\r\n\t\t\r\n\t\t//Retrouver les attributs qui s'appliquent\r\n\t\tfrappe.call({\r\n\t\t\tmethod: \"radplusplus.radplusplus.controllers.configurator.get_all_attributes_fields\",\r\n\t\t\targs: {\"item_code\": template}, // renmai - 2017-12-07 \r\n\t\t\tcallback: function(res) {\r\n\t\t\t\tif (printDebug) console.log(__(\"CALL BACK get_all_attributes_fields\"));\r\n\t\t\t\t//Convertir le message en Array\r\n\t\t\t\tvar attributes = (res.message || {});\r\n\t\t\t\t\r\n\t\t\t\tvar attributes = {};\r\n\t\t\t\tfor (var i = 0, len = res.message.length; i < len; i++) {\r\n\t\t\t\t\tattributes[res.message[i].field_name] = res.message[i];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (printDebug) console.log(__(\"attributes ---- >\" ));\t\t\t\t\r\n\t\t\t\tif (printDebug) console.log(__(attributes));\r\n\t\t\t\tif (printDebug) console.log(__(\"< ---- attributes\" ));\t\r\n\t\t\t\t\r\n\t\t\t\t//Pointeur sur grid\r\n\t\t\t\tvar grid = cur_frm.fields_dict[\"items\"].grid;\r\n\t\r\n\t\t\t\tif (printDebug) console.log(__(\"grid.docfields.length:\" + grid.docfields.length));\r\n\t\t\t\t\r\n\t\t\t\t$.each(grid.docfields, function(i, field) {\r\n\t\t\t\t\t// debugger;\r\n\t\t\t\t\tif (printDebug) console.log(__(\"field.fieldname :\" + field.fieldname ));\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (typeof attributes[field.fieldname] !== 'undefined'){\r\n\t\t\t\t\t\tif (printDebug) console.log(__(\"attributes[field.fieldname].name : \" + attributes[field.fieldname].name ));\r\n\t\t\t\t\t\tfield.depends_on = \"eval:false\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (attributes[field.fieldname].parent != null){\r\n\t\t\t\t\t\t\tfield.depends_on = \"eval:true\";\r\n\t\t\t\t\t\t\tif (printDebug) console.log(__(\"attributes[field.fieldname].parent : \" + attributes[field.fieldname].parent ));\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tvar field_value = frappe.model.get_value(row.doctype, row.name, field.fieldname);\r\n\t\t\t\t\t\t\tif (!field_value){ \r\n\t\t\t\t\t\t\t\tvar first_value = frappe.utils.filter_dict(cur_frm.fields_dict[\"items\"].grid.docfields, {\"fieldname\": field.fieldname})[0].options[0][\"value\"]\r\n\t\t\t\t\t\t\t\tfrappe.model.set_value(row.doctype, row.name, field.fieldname, first_value);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t\tconsole.log(__(\"field_value : \" + field_value));\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//configurator_mode = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t/* if (typeof attributes[field.fieldname] !== 'undefined'){\r\n\t\t\t\t\t\tif (printDebug) console.log(__(\"if (typeof attributes[field.fieldname] !== 'undefined') \"));\r\n\t\t\t\t\t\tif (attributes[field.fieldname].parent != null){\r\n\t\t\t\t\t\t\tfield.hidden_due_to_dependency = false;\r\n\t\t\t\t\t\t\tif (printDebug) console.log(__(\"attributes[field.fieldname].parent : \" + attributes[field.fieldname].parent ));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} */\r\n\t\t\t\t\t\r\n\t\t\t\t\t// renmai 2017-12-07\r\n\t\t\t\t\trefresh_field(field);\r\n\t\t\t\t\t// }\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t/* if (printDebug) console.log(__(attributes[j]));\r\n\t\t\t\t\tif (grid_row.grid_form.fields_dict[attributes[j][0]]){\r\n\t\t\t\t\t\tgrid_row.grid_form.fields_dict[attributes[j][0]].set_value(attributes[j][1]);\r\n\t\t\t\t\t} */\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t});\r\n\r\n\t\t\t\t//Reloader les valeurs par défaut suite aux changements\r\n\t\t\t\tif (reload_defaults)\r\n\t\t\t\t\tAssignDefaultValues(printDebug, frm, cdt, cdn);\r\n\r\n\t\t\t\tif (refresh_items)\r\n\t\t\t\t\trefresh_field(\"items\");\r\n\r\n\t\t\t\t//pour chaque attribut\r\n\t\t\t\t/* for (var j = 0; j < attributes.length; j++) {\r\n\t\t\t\t\tif (printDebug) console.log(__(attributes[j]));\r\n\t\t\t\t\tif (grid_row.grid_form.fields_dict[attributes[j][0]]){\r\n\t\t\t\t\t\tgrid_row.grid_form.fields_dict[attributes[j][0]].set_value(attributes[j][1]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t} */\r\n\t\t\t\t\r\n\t\t\t\t/* var grid_row = cur_frm.open_grid_row();\r\n\t\t\t\t$.each(attributes, function(i, attribute) {\r\n\t\t\t\t// for (var j = 0; j < len(attributes); j++) {\r\n\t\t\t\t\tif (attribute.parent != null) {\r\n\t\t\t\t\t\tif (printDebug) console.log(__(\"attribute.field_name : \" + attribute.field_name));\t\r\n\t\t\t\t\t\tif (grid_row.grid_form.fields_dict[attribute.field_name] && cur_frm.cur_grid.grid_form.fields_dict[attribute.field_name].df.fieldtype == \"Select\"){\r\n\t\t\t\t\t\t\tif (printDebug) console.log(__(\"grid_row.grid_form.fields_dict[attribute.field_name] : \" + grid_row.grid_form.fields_dict[attribute.field_name]));\t\r\n\t\t\t\t\t\t\tfrappe.model.set_value(row.doctype, row.name, attribute.field_name, cur_frm.cur_grid.grid_form.fields_dict[attribute.field_name].df.options[0].key);\r\n\t\t\t\t\t\t\t//grid_row.grid_form.fields_dict[attribute.field_name].set_value(attribute[j][1]);\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t}); */\r\n\t\t\t\t\t\r\n\t\t\t\tif (printDebug) console.log(__(\"CALL BACK get_all_attributes_fields END\"));\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}", "function displayAllFields (none) {\n loginAndSignUpDisplay(none, none)\n displayContent('user_output', none)\n displayContent('purchase_stat', none)\n displayContent('new_product_form', none)\n displayContent('home_page', none)\n displayContent('admin_login_form', none)\n displayContent('all_producer_accn_credentials', none)\n }", "function showInfo() {\n $('#user-name').text(curUser.first_name + ' ' + curUser.last_name);\n $('#first-name').text(curUser.first_name);\n $('#last-name').text(curUser.last_name);\n $('#email').text(curUser.email);\n $('#phone').text(curUser.phone_number);\n }", "function show_more_field(type) {\n if(type==='agent')\n {\n $('#agent_form').fadeIn();\n }\n else\n {\n $('#agent_form').fadeOut();\n }\n}", "function show_more_field(type) {\n if(type==='agent')\n {\n $('#agent_form').fadeIn();\n }\n else\n {\n $('#agent_form').fadeOut();\n }\n}", "get availablefields() {\r\n return new Fields(this, \"availablefields\");\r\n }", "function showFields(langInd) {\n for (var l = 0; l < langAttributes.length; l++) {\n if (l === parseInt(langInd))\n for (var i = 0; i < langAttributes[l].length; i++)\n $(langAttributes[l][i].container).css('display', 'block');\n else\n for (var a = 0; a < langAttributes[l].length; a++)\n $(langAttributes[l][a].container).css('display', 'none');\n }\n }", "function showEditRevenueInputFields(_line, _revenueLine) {\n console.log('[debug] edit revenue options menu: ' + _line + ' --> ' + _revenueLine);\n}", "function debugAttributes() {\n Xrm.Page.ui.controls.forEach(function (control, index) {\n var controlType = control.getControlType();\n that.writeToConsole(control.getName() + \" - \" + control.getControlType());\n });\n }", "add(fieldTitleOrInternalName) {\r\n return this.clone(ViewFields_1, `addviewfield('${fieldTitleOrInternalName}')`).postCore();\r\n }", "function showDetails(demo){\nconsole.log(`Name: ${demo.bookTitle}, price: ${demo.price} `)\n}", "function getDetails(e, $row, id, record) {\n $('#feature-title').text(record.title);\n $('#feature-priority').text(record.client_priority);\n $('#feature-target-date').text(record.target_date);\n $('#feature-client').text(record.client);\n $('#feature-product-area').text(record.product_area_name);\n\t$('#feature-description').text(record.description);\n }", "renderFields() {\n return _.map(confirmRegisterFields, ({ name, label, type }) => <Field component={FormField} type='text' key={name} name={name} label={label} htmltype={type} />)\n \n }", "function showFields (data, version, fields) {\n var o = {}\n ;[data, version].forEach(function (s) {\n Object.keys(s).forEach(function (k) {\n o[k] = s[k]\n })\n })\n return search(o, fields.split('.'), version.version, fields)\n}", "displayInfo() {\n\t\t\tlet info = super.displayInfo() + ', разработчики: ' + this.getDevelopers() ;\n\t\t\tconsole.log( info );\n\t\t\treturn info\n\t\t\t}", "function isAdditionalInfoShowing() {\n return profileStates.additionalInfo;\n}", "function getFieldTrue(info) {\n var arr = [];\n if(info.fullname != \"\") {\n arr.push(\"#help-register-customer\");\n }\n if(info.address != \"\") {\n arr.push(\"#help-address-customer\");\n }\n if(info.phone != \"\") {\n arr.push(\"#help-phone-customer\");\n }\n if(info.vaccineId != 0) {\n arr.push(\"#help-vaccine-customer\");\n }\n if(info.quantity != \"\" || info.quantity != 0) {\n arr.push(\"#help-quantity\");\n }\n return arr;\n }", "function onOperation (fields, operation) {\n for (var i=0; i<fields.length; i++) {\n Object.keys(fields[i]).map(function(key) {\n var el = $('#' + instance.tableId + '_editorForm > div > div.DTE_Field.row.DTE_Field_Name_' + key);\n if (el.length) {\n //console.log(key); :: COLUMN NAME\n //console.log(key + ' ' + operation + ' ' + fields[i][key][operation]);\n if (fields[i][key][operation]) {\n el.show();\n } else {\n if (fields[i][key][operation] === false) {\n el.hide();\n } else if (typeof fields[i][key][operation] === \"undefined\") {\n if (el.hasClass('DTE_Field_Type_hidden') ) {\n console.log('This column (not mentioned on the list) has to be hidden...');\n } else {\n el.show();\n }\n }\n }\n }\n });\n }\n }", "renderFormFields() {\n console.warn(\"renderFormFields() should be implemented in subclasses\");\n }", "function showDetails(row){\n\tvar controller = View.controllers.get('abGbRptFpSrcCatCtrl');\n\tvar restriction = new Ab.view.Restriction();\n\trestriction.addClauses(controller.consoleRestriction);\n\tif(typeof(row) == \"object\" && typeof(row) != \"string\" && row != \"total_row\" ){\n\t\tif(valueExistsNotEmpty(row[\"bl.site_id\"])){\n\t\t\trestriction.addClause(\"bl.site_id\", row[\"bl.site_id\"], \"=\", \"AND\", true);\n\t\t}\n\t\tif(valueExistsNotEmpty(row[\"gb_fp_totals.calc_year\"])){\n\t\t\trestriction.addClause(\"gb_fp_totals.calc_year\", row[\"gb_fp_totals.calc_year\"], \"=\", \"AND\", true);\n\t\t}\n\t}\n\tcontroller.abGbRptFpSrcCat_bl.addParameter(\"isGroupPerArea\", controller.isGroupPerArea);\n\tcontroller.abGbRptFpSrcCat_bl.refresh(restriction);\n\tshowReportColumns(controller.abGbRptFpSrcCat_bl);\n\tcontroller.abGbRptFpSrcCat_tabs.selectTab(\"abGbRptFpSrcCat_bl_tab\");\n}", "static fields () {\n return { \n id: this.attr(null), \n brand: this.attr(''),\n c_price: this.attr(''),\n catalog_brand_id: this.attr(''),\n catalog_cate_id: this.attr(''),\n catalog_county_id: this.attr(''),\n catalog_unit_id: this.attr(''),\n code: this.attr(''),\n county: this.attr(''),\n created_at: this.attr(''),\n d_price: this.attr(''),\n e_price: this.attr(''), \n m_price: this.attr(''),\n name: this.attr(''),\n nh_price: this.attr(''),\n seq: this.attr(''),\n sku: this.attr(''),\n t_price: this.attr(''),\n unit: this.attr(''),\n updated_at: this.attr(''),\n weight: this.attr(''),\n shipping: this.attr(''), \n qty: this.attr(''), \n amount: this.attr(''), \n profit: this.attr(''), \n }\n }", "print() {\n for (let row of this._field) {\n console.log(row.join(' '));\n }\n }", "function showCertificateFields() {\n clearCertificateFields();\n const item = $('hierarchy').selectedItem;\n if (item && item.detail.payload.index !== undefined) {\n chrome.send('requestCertificateFields', [item.detail.payload.index]);\n }\n }", "function showAddDiv() {\n\tshowActionDiv('add');\n}", "getInfo() {\n return `${this.firstName} ${this.lastName} is ${this.age} years old.`\n }", "getDescription() {\n return \"Nom : \"+this.nom+\"\\nAge : \"+this.age+\"\\nProfession : \"+this.profession;\n }", "printAllAttributes()\n {\n return this.price+\" \"+this.quantity+\" \"+this.name\n }", "function getFieldOptions(appName, factName, paramid, callback) {\n //appName,fact, field, lookup,updateId, callback\n $('table').remove();\n quickforms.getMultiData(appName, factName, paramid, '1=1', '',\n function (data) {\n displayEditingPage(data, paramid);\n });\n }", "get hiddenFields() {\n return Object.entries(this._schemaObj.properties)\n .map(([name, prop]) => {\n if (prop.hidden === true)\n return name;\n })\n .filter(n => n);\n }", "function onShowFieldBtnClicked(event)\n\t{\n\t\tvar button = $(event.currentTarget);\n\t\tvar fieldId = button.data('showField');\n\n\t\tthis.showingFieldView = true;\n\t\tthis.selectedField = View.data.find(this.selectedInstance.fields, fieldId);\n\t\tthis.sidebar.breadcrumbsView.add(this.selectedField.human_name, this, 'renderCollectionField');\n\t\tthis.renderCollectionField();\n\t}", "function pubmedTxt(field, extra) {\n var txt;\n if (!extra) {\n extra = '';\n }\n switch(field) {\n case 'modalTitle':\n txt = 'Add new PubMed Article';\n break;\n case 'inputLabel':\n txt = 'Enter a PMID';\n break;\n case 'editLabel':\n txt = 'Edit PMID';\n break;\n case 'inputButton':\n txt = 'Retrieve PubMed Article';\n break;\n case 'resourceResponse':\n txt = \"Select \\\"\" + extra + \"\\\" (below) if the following citation is correct; otherwise, edit the PMID (above) to retrieve a different article.\";\n break;\n }\n return txt;\n}", "_updatePreviewField(){\n if(this._showingContacts && this._chosenContact !== null){\n // Meh\n this._displayName.value = this._chosenContact.firstName + \" \" + this._chosenContact.lastName;\n }\n else{\n this._displayName.value = this._user.FirstName + \" \" + this._user.LastName;\n }\n }", "function popUpFormFieldPropertiesDialog(whichOne)\n{\n var commandFileName = \"ServerObject-\" + whichOne + \"Props.htm\";\n var rowObj = _ColumnNames.getRowValue();\n var fieldInfoObj = dwscripts.callCommand(commandFileName,rowObj.displayAs)\n\n // note: use the \"type\" property on the menuInfoObj to see which\n // type of object was returned\n \n if (fieldInfoObj)\n {\n rowObj.displayAs = fieldInfoObj;\n }\n}", "function onShowModelFieldBtnClicked(event)\n\t{\n\t\tvar fieldId = event.currentTarget.dataset.modelFieldId;\n\n\t\tthis.showModelFieldView(fieldId);\n\t}", "function giftDetails(newGift){\r\n\r\n\t\thideEdit();\r\n\t\tshowEdit();\r\n\r\n\t\t//create circle with icon if it is given for this misison\r\n\t\t$('.edit ul.mission-neutral').append($('<li class=\"circle-big\">' + (newGift.icon ? '<img src='+ newGift.icon +'>' : \"\") + '</li>'))\r\n\r\n\t\t//creates empty form \r\n\t\t$('.edit').append(createEmptyForm());\r\n\r\n\t\t//if name is given show in the form\r\n\t\t$('input[name=\"newGiftName\"]').val(newGift.name ? newGift.name : \"\")\r\n\r\n\t\t//if points are given (which means it is user mission) show in the form \r\n\t\tif (newGift.hasOwnProperty('points')){\r\n\t\t\t$('input[name=\"newGiftPoints\"]').val(newGift.points)\r\n\t\t\t//for user mission save missionId\r\n\t\t\t$('.edit li.circle-big').attr('name',newGift.id)\r\n\r\n\t\t\t//for user mission show SAVE button\r\n\t\t\t$('.edit').append($('<button class=\"save\">ZAPISZ ZMIANY</button>'))\r\n\t\t\t// and FINISH / DELETE button\r\n\t\t\t$('.edit').append($('<button class=\"left infoDelete\">USUŃ</button>'))\r\n\t\t} else {\r\n\t\t\t//for NOT user missions show ADD button\r\n\t\t\t$('.edit').append($('<button class=\"add\">DODAJ</button>'))\r\n\t\t}\r\n }", "function getAllFields(){\n\t\t\t\n ModulesService.getModuleByName('users').then(function(response){\n $scope.fields = response.fields;\n $scope.id = response._id;\n \n $scope.fieldsLength = Object.size(response.fields);\n \n }).catch(function(err){\n alert(err.msg_error);\n });\n }", "function addFieldRow(e) {\n e.stopPropagation();\n var $ul = getUl(this)\n , id = $ul.attr('id')\n , $tgl = getToggleField($ul);\n $ul.append(getTemplate(id));\n focusInput($ul);\n if (!isChecked($tgl)) {\n setToggleField($(this), true);\n $ul.addClass('visible');\n }\n render();\n}", "static get builderInfo() {\n return {\n title: 'textfield',\n group: 'basic',\n icon: 'fa fa-envelope-open',\n weight: 70,\n documentation: 'http://help.form.io/userguide/#table',\n schema: CustomComponent.schema(),\n };\n }", "function remove_fields(link, is_new_record) {\n $(link).closest(\"div.add_other\").children(\"p.add_other\").children(\"a\").show();\n if(is_new_record){\n $(link).closest(\".fields\").remove();\n }\n else{\n $(link).prev(\"input[type=hidden]\").val(\"1\");\n $(link).closest(\".fields\").hide();\n }\n}", "function showAddRow() {\n resetTopping(); //Reset all items\n $(\"div#student-add-row\").show();\n}", "function us_showmoreform() {\r\n var i1 = document.getElementById('us_hiddenform');\r\n var a = document.getElementById('us_more');\r\n \r\n if (i1.getAttribute('class')) {\r\n i1.setAttribute('class','');\r\n a.innerHTML = '&#8722;';\r\n }\r\n else {\r\n i1.setAttribute('class','hidden');\r\n a.innerHTML = '+';\r\n }\r\n}", "function fieldLabel(field) { return [field, \"Label\"].join(\"\"); }", "function configureFields(){\n\n // Look at the modal's Category as well as user Categories\n let cats = $filter('userCategories')($scope.categories, $scope.user) || [];\n\n if( !cats.includes($scope.category) ){\n cats.push($scope.category);\n }\n\n let fields = cats.map(cat => cat.editFields)\n .reduce( (showFields, catFields) => {\n catFields.forEach( f => {\n if( !showFields.includes(f)){\n showFields.push(f);\n }\n });\n\n return showFields;\n }, []);\n\n $timeout(() => {\n // Clear out fields\n $scope.config.fields = {};\n fields.forEach( col => $scope.config.fields['show_field_' + col] = true)\n });\n\n return fields;\n }", "function _ShowForeignKeyFields(manager, result, sourceColumns, targetColumns) {\r\n var sbSource = new Sys.StringBuilder();\r\n var sbTarget = new Sys.StringBuilder();\r\n\r\n $.each(result.Columns, function (index, value) {\r\n sbSource.append(String.format('<option value=\"{0}\">{0}</option>', value.Name));\r\n sbTarget.append(String.format('<option value=\"{0}\">{0}</option>', value.ReferencedColumn));\r\n });\r\n sourceColumns.html(sbSource.toString());\r\n targetColumns.html(sbTarget.toString());\r\n\r\n $('table#FKeyDefinition6 tbody#FKeyInfoFields6 tr td span.TargetFields').text(String.format(\"Fields ({0})\", result.ReferencedTable));\r\n}", "addNewline(){\n // re-render formfield\n // TODO : to fix\n this.formFieldManage.applyConfigurationToformlyModel(this.configuration, this.wfFormFields, this.dataModel);\n this.wfFormFieldsOnlyNeededProperties = angular.copy(this.wfFormFields);\n }", "function Details() {\r\n}", "get qaLocatorNextFormFields() {\n return `button ${this.CUSTOM_LABELS.geButtonBuilderNavFormFields}`;\n }", "function populateDataFields() {}", "function getFieldList() {\n var appId = kintone.app.getId();\n kintone.api(\n kintone.api.url('/k/v1/form', appIsGuest()),\n 'GET',\n {app: appId},\n function(resp) { //success\n var properties = resp.properties;\n for (var i = 0; i < properties.length; i++) {\n var property = properties[i];\n switch (property.type) {\n case 'SINGLE_LINE_TEXT':\n // add option in select Box\n addSelectOption('#itsunavi-address-feeld', property.label, property.code);\n addSelectOption('#itsunavi-lat-feeld', property.label, property.code);\n addSelectOption('#itsunavi-lon-feeld', property.label, property.code);\n addSelectOption('#itsunavi-tooltip-title', property.label, property.code);\n break;\n case 'NUMBER':\n // add option in select Box\n addSelectOption('#itsunavi-lat-feeld', property.label, property.code);\n addSelectOption('#itsunavi-lon-feeld', property.label, property.code);\n addSelectOption('#itsunavi-tooltip-title', property.label, property.code);\n break;\n case 'SPACER':\n addSelectOption('#itsunavi-space-feeld', property.elementId, property.elementId);\n break;\n default:\n }\n }\n getCurrentConf();\n },\n function(resp) { //failed\n alert('フォーム情報の取得に失敗しました\\nError: ' + resp.message);\n }\n );\n }", "function FieldDetails() {\n _classCallCheck(this, FieldDetails);\n\n FieldDetails.initialize(this);\n }", "function showPrintTemplateInputs() {\n $(\".printInput\").hide()\n $('[data-templateid=\"' + $ddlPrintTemplate.val() + '\"]').fadeIn();\n }", "getFields() {\n const { expand } = this.state;\n const {\n form: { getFieldDecorator },\n searchMapper: searchFields,\n } = this.props;\n\n return searchFields.map(searchField => {\n const { label, name, secondary, rules, initialValue } = searchField;\n\n return (\n <Col span={8} key={name} style={{ display: !secondary || expand ? 'block' : 'none' }}>\n <Form.Item label={label}>\n {getFieldDecorator(name, {\n rules,\n initialValue,\n })(this.renderItem(searchField))}\n </Form.Item>\n </Col>\n );\n });\n }", "function showExtensionDetails(name) {\n if ($('#extension_details').is(':visible') == false) {\n $('#extension_details').slideDown();\n }\n //The 'extensions' dict is loaded onto pages that have it\n //TODO: this is hacky and should be properly loaded in\n extDetails = extensions[name]\n\n $('#ext_description').text(extDetails.Description)\n $('#ext_author').text(extDetails.Author)\n\n}", "function debugDisplayMembers(obj) {\n\tvar getters = new Array();\n\tvar setters = new Array();\n\tvar others = new Array();\n\tvar sKey;\n\n\tfor (var key in obj) {\n\t\tsKey = key + \"\";\n\t\tif (!((sKey.length > 0) && (sKey[0] == '_'))) {\n\t\t\tswitch (sKey.substr(0, 4)) {\n\t\t\t\tcase 'get_':\n\t\t\t\t\tgetters.push(key);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'set_':\n\t\t\t\t\tsetters.push(key);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tothers.push(key);\n\t\t\t}\n\t\t}\n\t}\n\n\tgetters.sort();\n\tsetters.sort();\n\tothers.sort();\n\n\talert(others.join(\", \") + \"\\r\\n\\r\\n\" +\n\t\tgetters.join(\", \") + \"\\r\\n\\r\\n\" +\n\t\tsetters.join(\", \"));\n}", "function displayCustomAttributes() {\n let customAttributeArray = Object.keys(CUSTOM_QUALIFICATION_DATA);\n let customAttributeHtml = \"\";\n for (let i = 0; i < customAttributeArray.length; i++) {\n customAttributeHtml = customAttributeHtml +\n customAttributeArray[i]+\":\"+\n \"<input type='text' id='custom\"+customAttributeArray[i]+\"'>\"+\n \"<br>\";\n }\n document.getElementById('customAttributes').innerHTML = customAttributeHtml;\n}", "static modifyFields() {\n return [\n 'article_id',\n 'user_id',\n 'comment',\n 'flagged',\n ];\n }", "add(fieldTitleOrInternalName) {\n return spPost(this.clone(ViewFields, `addviewfield('${fieldTitleOrInternalName}')`));\n }", "function us_showmoreform() {\r\n var i1 = document.getElementById('us_hiddenform');\r\n var a = document.getElementById('us_more');\r\n \r\n if (i1.getAttribute('class')) {\r\n i1.setAttribute('class','');\r\n a.innerHTML = '&#8722;';\r\n }\r\n else {\r\n i1.setAttribute('class','us_hidden');\r\n a.innerHTML = '+';\r\n }\r\n}", "showInfo() {\n /*\n 'super' is a access to the parent prototype methods store\n OR call parent class method using super.methodName()\n super.showInfo();\n\n AND add additional behavior to the created method\n console.log('add new feature to the extended class method');\n */\n super.showInfo();\n return `User is a ${this.developer} developer`;\n }", "get fields() {\r\n return new SharePointQueryableCollection(this, \"fields\");\r\n }", "getFieldInfo() {\n const info = super.getFieldInfo();\n const ClassName = this.ele.fieldClass;\n const ele = new ClassName(this.ele.props);\n ele.setKey(this.key);\n info.ele = ele.getFieldInfo();\n return info;\n }", "canShowDetailedInfo() {\n return false;\n }", "renderExtraFields() {\r\n if (this.props.formType === \"Sign Up\") return (\r\n <>\r\n <label htmlFor=\"form-email\">Email:</label>\r\n <input id=\"form-email\" type=\"email\"\r\n placeholder=\"Email\"\r\n //value={this.state.email}\r\n onChange={this.handleChange(\"email\")}\r\n />\r\n\r\n <label htmlFor=\"form-firstName\">First Name:</label>\r\n <input id=\"form-firstName\" type=\"text\"\r\n placeholder=\"First name\"\r\n //value={this.state.firstName}\r\n onChange={this.handleChange(\"firstName\")}\r\n />\r\n\r\n <label htmlFor=\"form-lastName\">Last Name:</label>\r\n <input id=\"form-lastName\" type=\"text\"\r\n placeholder=\"Last name\"\r\n //value={this.state.lastName}\r\n onChange={this.handleChange(\"lastName\")}\r\n />\r\n </>\r\n );\r\n }", "renderInputFields() {\n\t\tgetComponentElementById(this,'AdditionalInputFieldsWrapper').html(\"\");\n\t\tthis.included_attribute_array.forEach(function(attribute) {\n\t\t\tlet wrapper_id = attribute+\"Wrapper\";\n\t\t\tlet wrapper_node = getComponentElementById(this,wrapper_id);\n\t\t\tif (!wrapper_node.length) {\n\t\t\t\twrapper_node = this.addDynamicIncludedField(attribute);\n\t\t\t}\n\t\t\twrapper_node.show();\n\t\t\tlet entity_attribute_properties = data_model.getEntityAttributeProperties(this.entity_name,attribute);\n\t\t\tlet render_config_obj = {\n\t\t\t\t...{\n\t\t\t\t\tWrapperId: this.getUid()+\"_\"+wrapper_id,\n\t\t\t\t\tFieldId: this.getUid()+\"_\"+attribute,\n\t\t\t\t\tMustValidate: (this.required_validation_array.indexOf(attribute) > -1)\n\t\t\t\t},\n\t\t\t\t...entity_attribute_properties};\n\t\t\tdx_renderer.renderInputField(render_config_obj);\n\n\t\t}.bind(this));\n\n\t\tthis.included_relationship_array.forEach(function(relationship) {\n\t\t\tlet wrapper_id = relationship+\"Wrapper\";\n\t\t\tlet wrapper_node = getComponentElementById(this,wrapper_id);\n\t\t\tif (!wrapper_node.length) {\n\t\t\t\twrapper_node = this.addDynamicIncludedField(relationship);\n\t\t\t}\n\t\t\twrapper_node.show();\n\t\t\tlet entity_relationship_properties = data_model.getEntityRelationshipProperties(this.entity_name,relationship);\n\t\t\tlet render_config_obj = {\n\t\t\t\t...{\n\t\t\t\t\tWrapperId: this.getUid()+\"_\"+wrapper_id,\n\t\t\t\t\tFieldId: this.getUid()+\"_\"+relationship,\n\t\t\t\t\tMustValidate: (this.required_validation_array.indexOf(relationship) > -1)\n\t\t\t\t},\n\t\t\t\t...entity_relationship_properties};\n\t\t\tdx_renderer.renderInputField(render_config_obj);\n\t\t}.bind(this));\n\t}", "function editRestaurantInfoShow(){\n\t\t$(\".restaurantInfoDetails\").hide();\n\t\t$(\"#editrestaurantinfo\").show();\n\t}", "function hiddenFiledTemplate() {\n return \"<span class='csrHiddenField'></span>\";\n}", "function getAllFields() {\n return fields;\n }", "function RequiredField() {\n\n }" ]
[ "0.63581353", "0.62687105", "0.6215431", "0.62147444", "0.6098865", "0.6083523", "0.60084903", "0.60084903", "0.59657437", "0.5959002", "0.59469956", "0.5934652", "0.59211195", "0.5872767", "0.5866661", "0.5839486", "0.58375657", "0.5815293", "0.579804", "0.5795084", "0.5792606", "0.57895356", "0.57666826", "0.5757593", "0.57504296", "0.5733056", "0.57186884", "0.5711667", "0.5708691", "0.5687637", "0.5680816", "0.56734663", "0.5670671", "0.5665921", "0.5652317", "0.56433046", "0.563536", "0.563536", "0.56234944", "0.5608488", "0.559257", "0.55845624", "0.5556969", "0.55560243", "0.55548626", "0.5539656", "0.55258554", "0.5525634", "0.5524097", "0.55227923", "0.55113214", "0.5508137", "0.54948455", "0.5493139", "0.5480621", "0.54663867", "0.5465742", "0.5460067", "0.545807", "0.54560447", "0.5449616", "0.544068", "0.5440122", "0.5434565", "0.5425177", "0.54103494", "0.539816", "0.5392733", "0.5389089", "0.5388148", "0.53800434", "0.53747076", "0.5374618", "0.537437", "0.5372095", "0.5369055", "0.5365069", "0.5358357", "0.5356607", "0.53543", "0.5354233", "0.53457224", "0.5344647", "0.53443336", "0.53440356", "0.5338174", "0.5337303", "0.53315085", "0.53283304", "0.5326813", "0.532602", "0.5323819", "0.5313061", "0.53105897", "0.5309852", "0.5303593", "0.5296107", "0.52939576", "0.52908427", "0.52887547", "0.5282952" ]
0.0
-1
reverse the given velocity
function reverse(o, p) { o[p] *= -1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function invertVelocity(axis)\n{\n\tif (axis == \"x\")\n\t{\n\t\tballVelocityX = ballVelocityX * -1;\n\t}\n\telse if (axis == \"y\")\n\t{\n\t\tballVelocityY = ballVelocityY * -1;\n\t}\n}", "function vectorReverse(u) {\n var u1 = u[0];\n var u2 = u[1];\n var v = [-1*u1, -1*u2];\n return v; \n}", "invert() {\n this.reverse = !this.reverse;\n this._applySpeed();\n }", "Reverse() {\n\n }", "get targetVelocity() {}", "reverse() {}", "reverseInPlace() { const a = this._radians0; this._radians0 = this._radians1; this._radians1 = a; }", "set targetVelocity(value) {}", "function resetVelocity(){\r\n Joey.velocityY += 1\r\n }", "async reverse() {\n this.tl.pause();\n this.angle = 100;\n this._playShieldBounceSound();\n\n await gsap.to(this, {\n x: -50,\n y: 'random(-50,50)',\n duration: 1,\n });\n }", "_reverseY() {\n this._dy = -this._dy;\n }", "reverse() {\n return Point(\n 0 - this.x,\n 0 - this.y\n )\n }", "back(length = this.length) {\n // Change the direction momentarily\n this.direction -= 180;\n // Use forward to avoid repeating code\n this.forward(toInt(length));\n // Restore the direction as it was before\n this.direction += 180;\n }", "function flip(v) { return Shade(1).sub(v); }", "reverse() {\n }", "reverseInPlace() {\n if (this._points.length >= 2) {\n let i0 = 0;\n let i1 = this._points.length - 1;\n while (i0 < i1) {\n const a = this._points[i0];\n this._points[i1] = this._points[i0];\n this._points[i0] = a;\n i0++;\n i1--;\n }\n }\n }", "reverseInPlace() { this._bcurve.reverseInPlace(); }", "reverse() {\n const { _coords } = this\n const numCoords = _coords.length\n const numVertices = numCoords / 2\n let tmp\n\n for (let i = 0; i < numVertices; i += 2) {\n tmp = _coords[i]\n _coords[i] = _coords[numCoords - i - 2]\n _coords[numCoords - i - 2] = tmp\n\n tmp = _coords[i + 1]\n _coords[i + 1] = _coords[numCoords - i - 1]\n _coords[numCoords - i - 1] = tmp\n }\n }", "downer(velocity = 0) {\n this.jumping = false;\n this.velocityY = velocity;\n }", "turnRight() {\n this._currentLinearSpeed = 0;\n this._currentAngularSpeed = -this._angularSpeed;\n }", "setVelocity(v) {\n\t\tif(!this.no_accelerations) {\n\t\t\tvar goal = 0;\n\t\t\tif(v >= 0) {\n\t\t\t\tgoal = Math.min(v, this.max_v)\n\t\t\t} else {\n\t\t\t\tgoal = Math.max(v, -this.max_v);\n\t\t\t}\n\n\t\t\tvar diff = goal - this.v;\n\t\t\tthis.a = diff*this.max_a;\n\t\t} else {\n\t\t\tthis.v = v;\n\t\t\tthis.a = 0;\n\t\t}\n\t\t\n\t}", "update() {\n this.pos -= this.vel;\n }", "function reverse(dir) {\r\n large_gear.direction = dir;\r\n }", "_reverseX() {\n this._dx = -this._dx;\n }", "function flip(vec) {\n\treturn new THREE.Vector2(vec.y, -vec.x);\n}", "vel() {\n this.y += this.speed;\n }", "ricochet() {\n\t\tif (this.bulletSpecial != 0){\n\t\t\tthis.bulletSpecial--;\n\t\t\tthis.velocity = this.velocity.scale(-1);\n\t\t};\n\t}", "set zVelocity (val) {\n this._v = val;\n \n if(this.dash) {\n this.dash.speed = val;\n }\n }", "slowVelocity() {\n if ( this.xVel > 0 ) {\n this.xVel -= 0.1;\n if ( this.xVel <= 0 ) {\n this.xVel = 0;\n this.inSlowDown = false;\n }\n }\n else if ( this.xVel < 0 ) {\n this.xVel += 0.1\n if ( this.xVel >= 0 ) {\n this.xVel = 0;\n this.inSlowDown = false;\n }\n }\n }", "function Update()\n{\n\tvar xVel : float = rigidbody2D.velocity.x;\n\tif (xVel < 18 && xVel > -18 && xVel != 0)\n\t{\n\t\tif(xVel > 0)\n\t\t{\n\t\t\trigidbody2D.velocity.x = 20;\n\t\t}\n\t\telse\n\t\t{\n\t\t\trigidbody2D.velocity.x = -20;\n\t\t}\n\t//Debug.Log(\"Velocity Before: \" + xVel);\n\t//Debug.Log(\"Velocity After: \" + rigidbody2D.velocity.x);\n\t\n\t}\n\t\n\n\n}", "function goBackward(rover) {\n switch (rover.direction) {\n case 'N':\n rover.position[0]--\n break;\n case 'E':\n rover.position[1]--\n break;\n case 'S':\n rover.position[0]++\n break;\n case 'W':\n rover.position[1]++\n break;\n };\n\t\tconsole.log(\"New Rover Position: [\" + rover.position[0] + \", \" + rover.position[1] + \"]\")\n}", "get VelocityChange() {}", "function invLerp(v1, v2, v) {\n return (v - v1) / (v2 - v1);\n}", "inverseTransformVector(vec){\n let result = p5.Vector.sub(vec, this.position);\n\n result.rotate(-this.rotation);\n vec.div(this.scale);\n\n return result;\n }", "knockEnemyBack(v){\n this.knockEnemy = true;\n this.hero.direction ? this.knockVelocity = v : this.knockVelocity = -v; //this line is too hacky,\n this.body.velocity.y = -60 * (10*Math.random());\n this.knockBackFor = this.setDelay(this.knockbackSet);\n this.animations.play('knock');\n // console.log('knockEnemy', this.game.time.now, this.knockBackFor, this.knockVelocity, this.knockingDistance);\n }", "calculateVelocity() {\n this.velocityVector.addVectors(this.gravityVelocityVector, this.inertiaVelocityVector);\n if (params.showArrows) {\n this.velocityArrow = new THREE.ArrowHelper(this.velocityVector.clone().normalize(), this.mesh.position, this.velocityVector.length() / 1000 + this.r * 2, 0xff0000);\n scene.add(this.velocityArrow);\n }\n }", "Trap() {\n this.m_vVelocity.Zero();\n }", "reverseVariables() {\n\t\tthis._vars.reverse();\n\t\tfor (let i = 0; i < this._vars.length; ++i) {\n\t\t\tthis._vars[i].setIndex(i);\n\t\t}\n\t}", "land() {\n this.velocity += 20; \n }", "function reactionReverse () {\n direction = -direction; // Stromrichtung umkehren\n reset(); // Ausgangsstellung\n }", "function inverti (wordToReverse) {\r\n var parolaInvertita = '';\r\n for (var i = wordToReverse.length - 1; i >= 0; i--) {\r\n parolaInvertita += wordToReverse[i];\r\n }\r\n return parolaInvertita;\r\n}", "function h$fps_reverse(a_v, a_o, b_v, b_o, n) {\n if(n > 0) {\n var au8 = a_v.u8, bu8 = b_v.u8;\n for(var i=0;i<n;i++) {\n au8[a_o+n-i-1] = bu8[b_o+i];\n }\n }\n}", "function h$fps_reverse(a_v, a_o, b_v, b_o, n) {\n if(n > 0) {\n var au8 = a_v.u8, bu8 = b_v.u8;\n for(var i=0;i<n;i++) {\n au8[a_o+n-i-1] = bu8[b_o+i];\n }\n }\n}", "function h$fps_reverse(a_v, a_o, b_v, b_o, n) {\n if(n > 0) {\n var au8 = a_v.u8, bu8 = b_v.u8;\n for(var i=0;i<n;i++) {\n au8[a_o+n-i-1] = bu8[b_o+i];\n }\n }\n}", "function h$fps_reverse(a_v, a_o, b_v, b_o, n) {\n if(n > 0) {\n var au8 = a_v.u8, bu8 = b_v.u8;\n for(var i=0;i<n;i++) {\n au8[a_o+n-i-1] = bu8[b_o+i];\n }\n }\n}", "function h$fps_reverse(a_v, a_o, b_v, b_o, n) {\n if(n > 0) {\n var au8 = a_v.u8, bu8 = b_v.u8;\n for(var i=0;i<n;i++) {\n au8[a_o+n-i-1] = bu8[b_o+i];\n }\n }\n}", "function h$fps_reverse(a_v, a_o, b_v, b_o, n) {\n if(n > 0) {\n var au8 = a_v.u8, bu8 = b_v.u8;\n for(var i=0;i<n;i++) {\n au8[a_o+n-i-1] = bu8[b_o+i];\n }\n }\n}", "function reverse(v) {\n return REVERSE_TABLE[v & 0xff] << 24 | REVERSE_TABLE[v >>> 8 & 0xff] << 16 | REVERSE_TABLE[v >>> 16 & 0xff] << 8 | REVERSE_TABLE[v >>> 24 & 0xff];\n }", "function reverse(input) {}", "set VelocityChange(value) {}", "verlet() {\n\t\tlet posTemp = new p5.Vector(this.pos.x, this.pos.y);\n\n\t\tthis.pos.x += (this.pos.x - this.posOld.x);\n\t\tthis.pos.y += (this.pos.y - this.posOld.y);\n\n\t\tthis.posOld.set(posTemp);\n\t}", "function velocity_x (){\n return V * Math.cos(teta);\n }", "function up_bounce() {\n ball.body.velocity.y = ball.body.velocity.y\n }", "setVelocity(vel) {\n\n if (this.maxSpeed !== null) {\n\n // Magnitude squared\n let magnitudeSquared = (vel.x * vel.x + vel.y * vel.y);\n\n if (magnitudeSquared > this.maxSpeed * this.maxSpeed) {\n console.log(\"Velocity MAX POWER\");\n\n // Normalize vector\n vel = Game.Mathematics.normalizeVector(vel);\n\n // Set new velocity\n vel.x = this.maxSpeed * vel.x;\n vel.y = this.maxSpeed * vel.y;\n\n }\n\n }\n\n this.vel = vel;\n\n }", "static lerp(v1, v2, t) {\n t = t < 0 ? 0 : t\n t = t > 1 ? 1 : t\n let out = []\n out[0] = v1.x + (v2.x - v1.x) * t\n out[1] = v1.y + (v2.y - v1.y) * t\n\n return new Vector2(out[0], out[1])\n }", "function calcVelocity(angle, velocity) {\n // handling in between\n // /|\n // v/ | y\n // /o |\n // ____\n // x\n // x = cos (o) * v\n // y = sin (o) * v\n\n var newAngle = toRadians(angle);\n console.log(newAngle);\n var x = Math.cos(newAngle) * velocity;\n var y = Math.sin(newAngle) * velocity;\n return [x,y];\n}", "velocityViewUnit2AU(vx, vy) {\n return {vx: vx / VELOCITY_LEN_SCALE, vy: vy / VELOCITY_LEN_SCALE};\n }", "function reverseV(x) {\r\n var y=[];\r\n var lt=x.length;\r\n for (igo = 0; igo < lt; igo++) {\r\n y[igo] = x[lt-igo-1];\r\n }\r\n return y;\r\n}", "setVelocity(direction, speed) {\n this.velocity = direction.normalize().mult(speed);\n this.speed = speed >= this.maxSpeed ? this.maxSpeed : speed;\n }", "function Start () {\nGetComponent.<Rigidbody2D>().velocity.y = speed;\n\n\n}", "updateVelocity(controller){\n this.vx = controller.vx;\n this.vy = controller.vy;\n }", "get reversed() {\n return this.getReversed();\n }", "reverse() {\n this.inverse = true\n this.play()\n\n var scope = this\n var reset = function() {\n scope.inverse = false\n\n scope.off('stop', reset)\n scope.off('pause', reset)\n }\n\n this.on('stop', reset)\n this.on('pause', reset)\n }", "resta(vec){return new Vector(this.x-vec.x, this.y-vec.y, this.z-vec.z);}", "static direction(_v1, _v2) {\r\n return new Vector2D(_v2.x - _v1.x, _v2.y - _v1.y);\r\n }", "_O ({ position, velocity, speed }) {\n const [x, y] = position\n const { up, down, left, right } = this.directions(velocity)\n\n if (right && !down && x > 6 * WIDTH / 8 && y < HEIGHT / 2) {\n return this.right(velocity, speed)\n }\n\n if (right && down && x > 7 * WIDTH / 8 && y < HEIGHT / 2) {\n return this.right(velocity, speed)\n }\n\n if (down && !left && x > WIDTH / 2 && y > 6 * HEIGHT / 8) {\n return this.right(velocity, speed)\n }\n\n if (down && left && x > WIDTH / 2 && y > 7 * HEIGHT / 8) {\n return this.right(velocity, speed)\n }\n\n if (left && !up && x < 2 * WIDTH / 8 && y > HEIGHT / 2) {\n return this.right(velocity, speed)\n }\n\n if (left && up && x < WIDTH / 8 && y > HEIGHT / 2) {\n return this.right(velocity, speed)\n }\n\n return velocity\n }", "get reversed(){\n\t\t\treturn this.getReversed();\n\t\t}", "function playerJump() {\n player.body.velocity.y = -255;\n\n}", "moveBackward () {\n this.update(this.deltaIndex(-1))\n }", "down() {\n this.y += this.speed;\n this.comprobarLimitesBarra();\n }", "backwards(speed) {\n if (speed === undefined) {\n this._speed = -100;\n } else {\n if (speed < 0 || speed > 100) {\n throw \"Speed must be between 0 and 100\"\n }\n this._speed = -speed;\n }\n this._applySpeed();\n }", "reverse(ui) {\n // Flip all the dependency relationships.\n for (const cell of ui.quiver.reverse_dependencies_of(this)) {\n const dependencies = ui.quiver.dependencies.get(cell);\n dependencies.set(\n this,\n { source: \"target\", target: \"source\" }[dependencies.get(this)],\n );\n }\n\n // Reverse the label alignment and edge offset as well as any oriented styles.\n // Note that since we do this, the position of the edge will remain the same, which means\n // we don't need to rerender any of this edge's dependencies.\n this.options.label_alignment = {\n left: \"right\",\n centre: \"centre\",\n over: \"over\",\n right: \"left\",\n }[this.options.label_alignment];\n this.options.offset = -this.options.offset;\n if (this.options.style.name === \"arrow\") {\n const swap_sides = { top: \"bottom\", bottom: \"top\" };\n if (this.options.style.tail.name === \"hook\") {\n this.options.style.tail.side = swap_sides[this.options.style.tail.side];\n }\n if (this.options.style.head.name === \"harpoon\") {\n this.options.style.head.side = swap_sides[this.options.style.head.side];\n }\n }\n\n // Swap the `source` and `target`.\n [this.source, this.target] = [this.target, this.source];\n\n this.render(ui);\n }", "onKeydown(event) {\n switch(event.key) {\n case this.upKey:\n this.vy = -this.speed\n break\n case this.downKey:\n this.vy = this.speed\n break\n }\n }", "updateVelocity(time) {\n //acceleration factor to add to update the velocity vector\n var accelFactor = glMatrix.vec3.create();\n glMatrix.vec3.scale(this.v, this.v, Math.pow(this.drag, time));\n glMatrix.vec3.scale(accelFactor, this.a, time);\n glMatrix.vec3.add(this.v, this.v, accelFactor);\n }", "function toggleVelocityAnimation(args){\n\tvar p = args[0];\n\tvar checked = args[1];\n\tviewerParams.animateVel[p] = false;\n\tif (checked){\n\t\tviewerParams.animateVel[p] = true;\n\t}\n}", "setVelocity( vx, vy ){\n\t\tif ( this.vx == 0 && vx != 0){\n\t\t\tthis.updateVelocity( vx, vy);\n\t\t}else if ( this.vy == 0 && vy != 0 ){\n\t\t\tthis.updateVelocity( vx, vy);\n\t\t}\n\t}", "*directionVerticalDown() {\n yield this.sendEvent({ type: 0x03, code: 0x01, value: 255 });\n }", "invert() {\n this.polygons.forEach(p => p.flip());\n this.plane.flip();\n if (this.front !== null) {\n this.front.invert();\n }\n if (this.back !== null) {\n this.back.invert();\n }\n let temp = this.front;\n this.front = this.back;\n this.back = temp;\n }", "reverse( x, y, oppositeDay ) {\n // this one is symmetric, don't need oppositeDay\n var str = this.target;\n var newStr = [];\n var pos;\n\n for (var i = 0; i < str.length; i++) {\n\n if (i < x) {\n newStr.push( str[i] );\n } else if (i > y) {\n newStr.push( str[i] );\n } else {\n for (var j=0; j <= y-x; j++, i++) {\n newStr.push( str[y-j] );\n }\n i--; // counteract outer loop\n }\n }\n this.target = newStr.join(\"\");\n }", "reverse(length) {\n for (let i = 0; i < length / 2; i += 1) {\n const p1 = (this.position + i) % this.list.length;\n const p2 = (this.position - i + length - 1) % this.list.length;\n [this.list[p1], this.list[p2]] = [this.list[p2], this.list[p1]];\n }\n }", "jump() {\n this.time = -this.terminalVelocity;\n }", "function pushStorkyUp() {\n storkyVelocity = new THREE.Vector3(0, 1.1, 0);\n}", "mirror(v) {\n // return v.plus(v.split(this).perp.scale(2).inv());\n let n = this.scale(2 * this.dot(v) / this.quad());\n return n.minus(v);\n }", "turnRight() {\n this.direction--;\n this.direction = this.direction.mod(4);\n }", "function reverseTranslate(newFrom){return $animateCss(target,{to:newFrom||from,addClass:options.transitionOutClass,removeClass:options.transitionInClass}).start();}", "stop() {\n this._currentLinearSpeed = 0;\n this._currentAngularSpeed = 0;\n }", "function get_my_direction() {\n var v, dir;\n\n v = new THREE.Vector3(0,0,-1);\n //v = WORLD.camera.matrixWorld.multiplyVector3(v); // r54\n v.applyMatrix4(WORLD.camera.matrixWorld); // r58\n\n //dir.sub(v).setLength(BULLET_VELOCITY); // r58\n dir = new THREE.Vector3(0,0,0);\n dir.copy(WORLD.player.mesh.position);\n\n //dir.subSelf(v); // r54\n dir.subVectors(dir, v); // r58\n //dir.sub(v);\n\n return dir;\n}", "function backward() {\n const currProgress = parseInt(progressInp.value, 10);\n\n if ((currProgress - 2000) > 0) {\n progressInp.value = currProgress - 2000;\n } else {\n progressInp.value = 0;\n }\n\n updateDuration();\n updateReplay();\n}", "jump() {\n\n if (this.alive == false)\n return; \n\n // Add a vertical velocity to the bird\n this.sprite.body.velocity.y = -350;\n\n // this.add.tween(this.bird).to({angle: -20}, 100).start(); \n let tween = this.game.tweens.add({\n targets: this.sprite,\n duration: 100,\n delay: 0,\n alpha: 1,\n repeat: 0,\n angle: -20\n });\n }", "function turnVectorRight(vector) {\n var axis = new THREE.Vector3(0, -1, 0);\n var angle = 90 * (Math.PI / 180);\n let newVec = vector.clone();\n newVec.applyAxisAngle(axis, angle);\n return newVec;\n}", "_R ({ position, velocity, speed }) {\n const [x, y] = position\n const { up, down, left, right } = this.directions(velocity)\n\n if (left && !up && !down && x < 7 * WIDTH / 8 && x > WIDTH / 2 && y > HEIGHT / 2) {\n return this.right(velocity, speed)\n }\n\n if (left && up && x < 6 * WIDTH / 8 && y > HEIGHT / 2) {\n return this.right(velocity, speed)\n }\n\n if (up && !left && x > WIDTH / 2 && y < 2 * HEIGHT / 8) {\n return this.left(velocity, speed)\n }\n\n if (up && left && x > WIDTH / 2 && y < HEIGHT / 8) {\n return this.left(velocity, speed)\n }\n\n if (left && !down && x < 3 * WIDTH / 8 && y < HEIGHT / 2) {\n return this.left(velocity, speed)\n }\n\n if (left && down && x < 2 * WIDTH / 8 && y < HEIGHT / 2) {\n return this.left(velocity, speed)\n }\n\n if (down && !left && !right && x < 2 * WIDTH / 2 && y > HEIGHT / 2) {\n return this.left(velocity, speed)\n }\n\n return velocity\n }", "function velocity(){\n\tvar offset = $(\"#velo\").offset();\n\t$(\"#veloPlus\").css({ top: offset.top - 15, left: offset.left + 95, display: \"block\" }).animate({ opacity: 1.0 }, \"slow\");\n\t$(\"#veloPlus\").animate({ opacity: 0.0 }, \"slow\");\n\tballVelo++;\n\tx += dx;\n\ty += dy;\n\tpaddleVelo += 25;\n\trequestAnimationFrame(draw);\n}", "reverse() {\n return exports.seq(this.toArray().reverse());\n }", "invert() {\n this.addEffect(new Effects.Invert());\n }", "function up(object){\n object.y -= speed;\n }", "applyInverse(){\n scale(p5.Vector.div(new p5.Vector(1,1,1), this.scale));\n angleMode(RADIANS);\n rotate(-this.rotation);\n translate(p5.Vector.sub(new p5.Vector(0,0,0), this.position));\n }", "function slideBackward() {\n if ($run.activeIndex > 0) {\n $run.activeIndex -= 1;\n } else if ($conf.cycle) {\n $run.activeIndex = ($conf.slides.length - 1);\n }\n\n alignToActiveSlide();\n }", "deltaY() { return Math.sin(this.angle) * (this.speed); }", "function reverse() {\r\n dir = -dir;\r\n\t\tif(dir > 0) {\r\n\t\t $('#direction').css({'background-image' : 'url(./assets/images/skins/'+settings.skin+'/'+settings.skin+'_reverse.png)'});\r\n\t\t}\r\n\t\t\r\n\t\tif(dir < 0) {\r\n\t\t $('#direction').css({'background-image' : 'url(./assets/images/skins/'+settings.skin+'/'+settings.skin+'_forward.png)'});\r\n\t\t}\r\n\t }", "movementPattern(){\n if(this.y >= 250){\n this.body.setVelocityY(0);\n }\n }" ]
[ "0.6928222", "0.6587256", "0.65199554", "0.62969434", "0.6155193", "0.6111139", "0.6028411", "0.6022161", "0.6018839", "0.60057366", "0.59929657", "0.59702194", "0.59670824", "0.5954948", "0.5945233", "0.593444", "0.5929564", "0.5908246", "0.5895618", "0.5879419", "0.586276", "0.58056074", "0.5775464", "0.5773425", "0.57053614", "0.56992805", "0.568957", "0.56628215", "0.5641335", "0.5591444", "0.55865586", "0.5583541", "0.5566509", "0.5542653", "0.5540367", "0.5536215", "0.551962", "0.55175614", "0.5492503", "0.54817545", "0.5467373", "0.54514813", "0.54514813", "0.54514813", "0.54514813", "0.54514813", "0.54514813", "0.5444641", "0.5443286", "0.5438279", "0.54382366", "0.54373384", "0.54312336", "0.54296744", "0.5429381", "0.5417438", "0.5413691", "0.54101795", "0.54097927", "0.53962046", "0.5394003", "0.5392801", "0.5384092", "0.53781575", "0.53698426", "0.5354783", "0.5350453", "0.52791154", "0.52711904", "0.5270748", "0.5269955", "0.52634364", "0.52583617", "0.5246137", "0.52441996", "0.52397186", "0.523676", "0.52329105", "0.5231873", "0.5210484", "0.5208388", "0.52034533", "0.5201244", "0.5192884", "0.5185339", "0.5179801", "0.51783407", "0.5176566", "0.5174377", "0.51489633", "0.5148263", "0.5148137", "0.5140228", "0.5139575", "0.51325876", "0.51212037", "0.51203567", "0.5111101", "0.50976187", "0.50948185" ]
0.56837505
27
verify the current automata in display
function verifyEditorAutomata() { const json = activeJSON(); const testedString = editor2.getValue(); if (json.type !== "finite-automata") { triggerToast("Erro", "Operação não suportada para os tipos de linguagem selecionados") return; } const valid = verify(json, testedString); const title = valid ? "Sucesso" : "Erro"; const neg = !valid ? "não " : ""; const msg = `O autômato ${neg} reconhece a String`; triggerToast(title, msg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _checkAi(){return true;}", "function verification() {\r\n countTrue();\r\n if (choice == 'c') {\r\n render(complete);\r\n } else if (choice == 'l') {\r\n render(laziness);\r\n } else {\r\n render(mass);\r\n }\r\n }", "function assertView() {\n \n\tswitch (currentView)\n\t{\n\t\tcase 0: // current view is \"Name\", we are at the beginning\n\t\t\tnameInput = document.getElementById(\"TeilnehmerNameInput\");\n\t\t\tstartHint = document.getElementById(\"nameHint\");\n\t\t\tunHighlightInput(nameInput);\n\t\t\thideHints(startHint);\n\n\t\t\tif (nameInput.value == \"\") {\n\t\t\t\thighlightInput(nameInput);\n\t\t\t\tnameInput.placeholder = \"Namen eingeben\";\n\n\t\t\t\tshowHints(startHint);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tbreak;\n\t\tcase 1:\t// current view is \"Kriterien ordnen\"\n\t\t\treturn true;\n\t\t\tbreak;\n\t\tcase 2: // current view is \"Alternativen raten\"\n\t\t\treturn true;\n\t\t\tbreak;\n\t\tcase 3:\t// current view is \"Uebersicht\"\n\t\t\treturn true;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn true;\n\t}\n\treturn true;\n}", "function revealAutomation() {\n reveal('automationActions');\n reveal('automation');\n $('#automateInt').click(buildAutomaton('intelligence'));\n $('#automateTraining').click(buildAutomaton('training'));\n $('#automateTinkering').click(buildAutomaton('tinkering'));\n $('#automateScavenging').click(buildAutomaton('scavenging'));\n}", "checkResult() {\n const MAX_ANSWERS_LENGTH = 10;\n if (this.model.isDead()) {\n this.loose();\n } else if (this.model.defineAnswersLength() === MAX_ANSWERS_LENGTH) {\n this.win();\n } else {\n this.startGame();\n }\n }", "function customValidation() {\n debugger;\n \n //Loop through each tactic\n for( var i = 0; i < campaignItem.get('tactics'); i++ ) {\n \n //Switch to the tactic tab\n var tacticLabel = '#tactic-'+(i+1);\n tacticCollectionView.switchTab(tacticLabel);\n \n //Retrieve the View for the currently selected Tactic Model\n var currentTactic = Number(tacticCollectionView.activeTab.slice(-2))-1; //Calculate the View that corresponds to the currently active tactic.\n var thisTacticView = tacticViews[currentTactic];\n \n //Alert user and exit if image files have not been uploaded.\n if( thisTacticView.model.attributes.creatives == \"\" ) {\n alert('Tactic #'+ (i+1) +' is missing the creatives (images) required to run the ad. Please click the \"Upload files...\" button and upload these images.');\n return false;\n }\n \n //Alert user and exit if hyperlocal target was selected but no lat/longs are provided\n if( thisTacticView.model.attributes.geoTarget == \"hyperlocal\" ) {\n if( thisTacticView.model.attributes.hyper_local_lat.length == 0 ) {\n alert('A hyperlocal target for tactic #'+ (i+1) +' has been selected, but no Lat/Long coordinates have been provided. Please submit an address to retrieve Lat/Long coordinates.');\n return false;\n }\n \n //Alert user and exit if geographical target was selected but no zip codes were provided\n } else {\n if( thisTacticView.model.attributes.zipcodes.length == 0 ) {\n alert('A geographical target for tactic #'+ (i+1) +' has been selected, but no zip codes have been provided. Please provide zip codes.');\n return false;\n }\n }\n \n }\n \n //Return true by default.\n return true;\n }", "function attemptValidation( itcb ) {\n var fsmName = Y.doccirrus.schemas.activity.getDefaultFSMName();\n\n if( explanationsIsTemplate ){\n activity.explanations = explanationsArray.shift();\n }\n Y.doccirrus.fsm[fsmName].validate( user, options, activity, isTest, onValidateComplete );\n\n function onValidateComplete( err, result ) {\n newStatus = result;\n itcb( err );\n }\n }", "checkDictationImeActive() {\n assertEquals(\n this.dictationEngineId,\n this.mockInputMethodPrivate.getCurrentInputMethodForTest());\n assertTrue(this.mockLanguageSettingsPrivate.hasInputMethod(\n this.dictationEngineId));\n }", "function verify_result() {\n grid_end_time = Date.now();\n trial.grid_rt = grid_end_time - grid_start_time;\n\n document.getElementById(\"Verify_Test\").disabled = true;\n var index, tile_value, num_wrong=0;\n\n // count how many of user_input are hits, misses, false alarms\n // var hits=0, false_alarms=0, misses=0;\n for (var i = 0; i < user_input_tile_ids.length; i++) {\n tile_value = Number(user_input_tile_ids[i]);\n index = generated_tile_ids.indexOf(tile_value);\n\n if (index < 0) {\n trial.false_alarms += 1;\n } else {\n trial.hits += 1;\n }\n }\n trial.misses = generated_tile_ids.length - trial.hits;\n\n num_wrong = Math.max(trial.misses, trial.false_alarms);\n if (num_wrong == 0) {\n verdict = 'Right';\n change_score(1);\n } else if (num_wrong == 1) {\n verdict = 'Almost';\n change_score(0.5);\n } else {\n verdict = 'Not Quite';\n change_score(0);\n }\n\n ////////// display Right Almost or Wrong\n // purge everything except input_verdict\n // if (trial.cognitive_loading) {\n // jsPsych.pluginAPI.setTimeout(function() {\n // display_element.querySelector('#debriefing').style.display = 'none';\n // }, 0);\n jsPsych.pluginAPI.setTimeout(function() {\n display_element.querySelector('#board').style.display = 'none';\n }, 0);\n jsPsych.pluginAPI.setTimeout(function() {\n display_element.querySelector('#board-grid-text').style.display = 'none';\n }, 0);\n jsPsych.pluginAPI.setTimeout(function() {\n display_element.querySelector('#Verify_Test').style.display = 'none';\n }, 0);\n // jsPsych.pluginAPI.setTimeout(function() {\n // display_element.querySelector('#jspsych-html-button-response-prompt').style.display = 'none';\n // }, 0);\n // jsPsych.pluginAPI.setTimeout(function() {\n // display_element.querySelector('#jspsych-html-button-response-rating').style.display = 'none';\n // }, 0);\n // jsPsych.pluginAPI.setTimeout(function() {\n // display_element.querySelector('#verdict').style.display = 'block';\n // }, 0);\n // }\n //\n document.getElementById('input_verdict').innerHTML = verdict ;//+ \"<br/>score: \" + num_correct + \"<br/>num_total: \" + num_total;\n\n jsPsych.pluginAPI.setTimeout(end_trial, 1000); //verdict_feedback_time\n }", "function checker () {\n\tfinalResult += exercises[pointer].studentAnswer;\n\t++pointer;\n\tif ( pointer == exercises.length ) {\n\t\talert(\"The exam is finished.\");\n\t\treturn 0;\n\t}\n\tnxtbtnContainer.style.display = \"none\";\n\tbuildAndShow();\n}", "checkLoadingStatus(){\n\t\t\tif(this.substancesList.length && this.materialsList.length && this.measureUnitsList.length){\n\t\t\t\tthis.currentView = 'analyzes-monitor';\n\t\t\t\tthis.fetchAnalyzes();\n\t\t\t}\n\t\t}", "function showAnalysis() {\n var analysis = document.getElementById('analysis');\n if (analysis) {\n analysis.style.display = 'block';\n var distractElem = document.getElementById('distractionsAnalysis');\n distractElem.innerHTML = `You were distracted a total of ${distractions} times.`;\n var pomosEstElem = document.getElementById('pomosEst');\n pomosEstElem.innerHTML = `You estimated that you would take ${totalPomos} pomos (${\n totalPomos * workingTime\n } mins).`;\n var pomosDoneElem = document.getElementById('pomosAnalysis');\n pomosDoneElem.innerHTML = `You actually took ${pomosFinished} pomos (${\n pomosFinished * workingTime\n } mins)!`;\n }\n}", "function answerIsIncorrect () {\r\n feedbackForIncorrect();\r\n}", "function hiddenCheck() {\n if (PlotService.hiddenVector.length > 0) {\n var vectorStr = PlotService.hiddenVector;\n // set calculator selections based on the vector string\n BaseDataFactory.setValues(vectorStr);\n TemporalDataFactory.setValues(vectorStr);\n EnvironDataFactory.setValues(vectorStr);\n vm.setScore(); // call 'main' function to compute scores and display\n\n console.log('baseSelect', vm.baseSelect);\n console.log('temporalSelect', vm.temportalSelect);\n console.log('environSelect', vm.environSelect);\n\n // check for Cve (Vuln) Id and set text/link in model for display\n vm.cveId = $sce.trustAsHtml(''); // default to nothing\n if (PlotService.hiddenCve.length > 0) {\n var cveId = PlotService.hiddenCve;\n // CVE ID will be displayed in a header as a link\n var href = '/vuln/detail/' + cveId;\n var link = '<a href=\"' + href + '\">' + cveId + '</a>';\n vm.cveId = $sce.trustAsHtml(link);\n }\n }\n }", "function display() {\n\n doSanityCheck();\n initButtons();\n}", "clickDisplay(){\n\n if(!this.__modelSelect.isSelectedModelReady()){\n alert(\"You Need To Choose A Ready Model First!!!\");\n return;\n }\n\n let idSelected = this.__modelSelect.getSelectedModel();\n if(idSelected == -1){\n alert(\"You Need To Choose Model First!!!\");\n return;\n }\n\n if(this.__resultData == null ) {\n alert(\"You Need To Upload A Result Data First!!!\");\n return;\n }\n\n //gets the anomaly from server (the response would display the resualt)\n this.__clientController.getAnomaly(idSelected, this.__resultData);\n }", "function C012_AfterClass_Amanda_TestChange() {\n\tif (!ActorIsRestrained()) {\n\t\tif ((ActorGetValue(ActorLove) >= 10) || (ActorGetValue(ActorSubmission) >= 10) || Common_ActorIsOwned || Common_ActorIsLover) {\n\t\t\tif (Common_ActorIsOwned) OverridenIntroText = GetText(\"AcceptChangeFromMistress\");\n\t\t\telse \n\t\t\t\tif (Common_ActorIsLover) OverridenIntroText = GetText(\"AcceptChangeFromLover\");\n\t\t\t\telse OverridenIntroText = GetText(\"AcceptChange\");\n\t\t\tC012_AfterClass_Amanda_CurrentStage = 600;\n\t\t}\n\t\tC012_AfterClass_Amanda_GaggedAnswer();\n\t} else OverridenIntroText = GetText(\"CannotActWhileRestrained\");\n}", "function validateInstructionChecks() {\n \n instructionChecks = $('#instr').serializeArray();\n\n var ok = true;\n var allanswers = true;\n if (instructionChecks.length < 2) {\n alert('Please complete all questions.');\n allanswers = false;\n \n \n } else {\n allanswers = true;\n for (var i = 0; i < instructionChecks.length; i++) {\n // check for incorrect responses\n if(instructionChecks[i].value === \"incorrect\") {\n alert('At least one answer was incorrect; please read the instructions and try again.');\n ok = false;\n break;\n }\n }\n }\n \n \n // goes to next section\n if (!allanswers) {\n showInstructionCheck;\n } else if(!ok) {\n showInstructions(); \n } else {\n hideElements();\n showDummyVignette(); \n }\n}", "function showAns(show){\n if (display.innerText === '0'){\n ans.textContent = 'Ans = 0';\n } \n else if (show === 'first'){\n ans.textContent = `${calculator.numA} ${calculator.operator} ${calculator.numB} =`;\n }\n else if (show === 'second'){\n ans.textContent = `Ans = ${calculator.result}`;\n }\n}", "function Claim()\r\n\t{\r\n\t\t//Show_Solution(Sudoku_Solution);\r\n\t\tfor(var i=0; i<3; i++)\r\n\t\t{\r\n\t\t\tfor(var j=0; j<3; j++)\r\n\t\t\t{\r\n\t\t\t\tif(Claiming(i,j))\r\n\t\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function checkVisibleLines () {\n\tif (allVisibleLinesJustified()) {\n\t\t$('#problemButton').show();\n\t\t$('#ruleInstructionsPartial').html('Correct! Click \\'Next Line\\' to continue.');\n\t}\n}", "displayOption() {\n var tmp_show_option = false;\n for (let check_item of this.check_list) {\n if (check_item) {\n tmp_show_option = true;\n break;\n }\n }\n this.show_option = tmp_show_option;\n }", "function checkAnswers() {\n\n}", "validateAttributes() {\n return this\n .waitForElementVisible('@productSubtitle', 10000, () => {}, '[STEP] - Product Card Attributes (Brand/Author link) should be displayed')\n .assert.visible('@productSubtitle');\n }", "check_if_passed() {\n const passed = this.text_area.value === this.text;\n if (!passed) {\n console.error(this.describe() + \" failed!\");\n }\n return passed;\n }", "function shouldCompute(cues) {\n for (var i = 0; i < cues.length; i++) {\n if (cues[i].hasBeenReset || !cues[i].displayState) {\n return true;\n }\n }\n return false;\n }", "check_if_passed() {\n const passed = this.input_area.value === this.text;\n if (!passed) {\n console.error(this.describe() + \" failed!\");\n }\n return passed;\n }", "function isComplete(area) {\n\tif (area.expert === undefined) area.expert = 0;\n\tif (area.advanced === undefined) area.advanced = 0;\n\tif (area.yearlySnowfall === undefined ) area.yearlySnowfall = 0;\n\treturn ( area.state && area.vertical && area.skiableAcres );\n}", "function testAn() {\n j = this.id.substring(2);\n if (document.getElementById(\"an\" + j).innerText == aArr[j] + \" \" + data[qNum][\"a\"][j][\"aText\"] && data[qNum][\"a\"][j][\"isTrue\"] == true) {\n alert(\"right\");\n rightAn++;\n result();\n newQ();\n } else {\n alert(\"wrong\");\n newQ();\n }\n }", "function verify_basin () {\n var p1 = $('<p>Use this point?</p>' +\n '<center><p><button id=\"p1-yes\" href=\"\">Use This Point</button>' + '<br>' +\n '<p><button id=\"p1-no\" href=\"\">Pick a New Point</button>' \n );\n\n prompt.html(p1);\n $(p1).find('#p1-yes').click(function (event) {\n event.preventDefault();\n select_model();\n });\n \n\t\t\n $(p1).find('#p1-no').click(function (event) {\n event.preventDefault();\n resetPrompt();\n // TODO: do I remove the basin from the display?\n });\n \n }", "function theInterface(automata){\n automata.makeSet(\n {\n 'name': 'AutoBrowser'\n\n }, function(set){\n\n set.block.begins('init', function(){\n\n })\n\n set.block('visit', function(block){\n block.takes.url();\n block.outputs(automata.boolean);\n });\n\n set.block('collect', function(block){\n block.takes(\n automata\n .array\n .contains(automata.string)\n );\n });\n\n set.block('click', function(block){\n block.takes(automata.string)\n block.outputs(automata.boolean);\n });\n\n set.block('enter', function(block){\n /*\n * Here is an example of a block that can handle more than one type of input\n */\n block.takes( automata.tuple.matches( [automata.string, automata.string] );\n block.takes( automata.hash.maps(automata.string, automata.string));\n\n block.outputs(automata.boolean);\n });\n\n /*\n set.block('...',...)\n */\n\n });\n}", "function showWhatToExpect() {\n $(\"#start-screen\").hide();\n $(\"#what-to-expect\").show();\n $(\"#tips\").hide();\n $(\"#question-display\").hide();\n $(\"#question-result-display\").hide();\n $(\"#test-result-display\").hide();\n }", "function showInstructionChecks() {\n \n hideElements();\n $('#instructions').show();\n $('#instructions').load('html/instructionchecks.html'); \n $('#next').show();\n $('#next').click(validateInstructionChecks);\n}", "function checkIfLinedUp() {\n\n if (nameAnswer.value.toLowerCase() === 'nominal' && ageAnswer.value.toLowerCase() === \"continuous\" && shoesizeAnswer.value.toLowerCase() === \"discrete\") {\n finishPuzzleOne.classList.toggle('hide');\n window.scrollTo(0,document.body.scrollHeight); //if they are all correct show the next button\n }\n }", "@computed\n get isAppReady() {\n if (\n this.textElements.length != 0 &&\n this.activeDetailedAnnotations.length != 0 &&\n !isEmpty(this.activeLayoutedElements) &&\n this.activeTextGlyphs.length != 0 &&\n this.activeFilters.length != 0\n ) {\n return true;\n } else {\n return false;\n }\n }", "isDeterministicComplete() {\r\n let isDeterministic = this.isDeterministic();\r\n if (!isDeterministic) return false;\r\n\r\n // Each pair (state, symbol) must have an image by transition function\r\n for (let index = 0; index < this.states.length; index++) {\r\n const state = this.states[index];\r\n for (const symbol of this.alphabet) {\r\n if (this.transition(state, symbol) == null)\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "checkAns() {\n let rightCnt = this.computeScore();\n alert(rightCnt + \" out of \" + this.state.questionArray.length + \" are correct\");\n }", "async vlidatePresenceOfElements () {\n await expect(await (await this.inputUsername).isDisplayed()).toBe(true);\n await expect(await (await this.inputPassword).isDisplayed()).toBe(true);\n // check if submit button is displayed or not\n await expect(await (await this.btnSubmit).isDisplayed()).toBe(true);\n // check if submit button is clickable or not\n await expect(await (await this.btnSubmit).isClickable()).toBe(true);\n }", "function isTautology(results){\r\n for (var i= 0; i < results.length; i++) if (results[i] == 0) return false;\r\n return true;\r\n}", "function show_verify_meta_modal() {\n // Save all inputs.\n save_proj();\n\n // Then, convert to proj object.\n convert_all_meta_inputs();\n\n // Verify.\n var check_meta_modal = $('#check_meta_modal');\n var choose_controls_modal = $('#choose_controls_modal');\n var valid = validate_all_meta_inputs(check_meta_modal);\n\n // Depending on whether or not all the input is valid,\n // show different modal.\n if (valid) {\n var new_modal = choose_controls_modal.clone();\n\n set_chars_details_to_samples();\n set_choose_controls_modal(new_modal, proj.factors);\n new_modal.modal('show');\n } else {\n check_meta_modal.modal('show');\n }\n}", "function validateCheckForAffil(){\n if (!checkAffilName.value) {\n atmWindow.document.getElementById(\"checkAffilNameError_atm\").style.display = \"block\";\n } else {\n atmWindow.document.getElementById(\"checkAffilNameError_atm\").style.display = \"none\";\n checkForAffiliate(checkAffilName.value);\n }\n }", "show() {\n this.printUi();\n this.rl.question(\"> \", term => {\n let matchingEntries = this.compareSearchWords(term, [\"go get milk\", \"something\", \"milk\", \"grab food\"]); //TODO connect to State**\n this.printResultsUi(term, matchingEntries);\n this.rl.question(\"Enter to return to the main screen. \", () => {\n const screen = new MainScreen(this.rl, this.state);\n screen.show();\n });\n });\n }", "function elementSelectedAmbience(){\r\n\tvar choice = document.form.ambience.value;\r\n\tif(choice == \"Any\"){\r\n\t\tambience = \"<Var>InOut</Var>\" + \"\\n \";\r\n\t\tenglishAmbience= \"Indoors or Outdoors\";\r\n\t}\r\n\telse {\r\n\t\tambience = \"<Ind>\" + choice + \"</Ind>\" + \"\\n \";\r\n\t\tenglishAmbience = choice + \"doors\";\r\n\t}\r\n\tcreateRuleML();\r\n}", "function checkInstruction() {\n if(allInstuctions.length>0){\n if (allInstuctions[allInstuctions.length - 1].questions.length === 0) {\n warningModal(eachInsMustHaveOneQ)\n } else {\n $('#modal-instruction').modal(\"show\");\n }\n }else {\n $('#modal-instruction').modal(\"show\");\n }\n \n}", "function shouldCompute(cues) {\n for (var i = 0; i < cues.length; i++) {\n if (cues[i].hasBeenReset || !cues[i].displayState) {\n return true;\n }\n }\n return false;\n }", "function shouldCompute(cues) {\n for (var i = 0; i < cues.length; i++) {\n if (cues[i].hasBeenReset || !cues[i].displayState) {\n return true;\n }\n }\n return false;\n }", "function shouldCompute(cues) {\n for (var i = 0; i < cues.length; i++) {\n if (cues[i].hasBeenReset || !cues[i].displayState) {\n return true;\n }\n }\n return false;\n }", "function shouldCompute(cues) {\n for (var i = 0; i < cues.length; i++) {\n if (cues[i].hasBeenReset || !cues[i].displayState) {\n return true;\n }\n }\n return false;\n }", "function shouldCompute(cues) {\n for (var i = 0; i < cues.length; i++) {\n if (cues[i].hasBeenReset || !cues[i].displayState) {\n return true;\n }\n }\n return false;\n }", "function shouldCompute(cues) {\n for (var i = 0; i < cues.length; i++) {\n if (cues[i].hasBeenReset || !cues[i].displayState) {\n return true;\n }\n }\n return false;\n }", "function shouldCompute(cues) {\n for (var i = 0; i < cues.length; i++) {\n if (cues[i].hasBeenReset || !cues[i].displayState) {\n return true;\n }\n }\n return false;\n }", "function shouldCompute(cues) {\n for (var i = 0; i < cues.length; i++) {\n if (cues[i].hasBeenReset || !cues[i].displayState) {\n return true;\n }\n }\n return false;\n }", "function shouldCompute(cues) {\n for (var i = 0; i < cues.length; i++) {\n if (cues[i].hasBeenReset || !cues[i].displayState) {\n return true;\n }\n }\n return false;\n }", "function shouldCompute(cues) {\n for (var i = 0; i < cues.length; i++) {\n if (cues[i].hasBeenReset || !cues[i].displayState) {\n return true;\n }\n }\n return false;\n }", "isDeterministic() {\r\n for (let index = 0; index < this.states.length; index++) {\r\n const state = this.states[index];\r\n for (const symbol of this.alphabet) {\r\n if (Array.isArray(this.transition(state, symbol)))\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "function checkSituationValid() {\n\t\tvar list = document.getElementById(\"r4\");\n\t\tvar length = document.getElementById(\"situationArea\").value.length;\n\t\tif(length == 0) {\n\t\t\tsituationValid = true; //situationValid\n\t\t\t//alert(\"in situation: \"+originalStuaInfo);\n\t\t\tlist.innerHTML = originalStuaInfo; //originalStuaInfo\n\t\t\treturn;\n\t\t}\n\t\t//alert(\"in\");\n\t\tif(length <= 240) {\n\t\t\tlist.innerHTML = \"<font color=GREEN >Perfect! totally \"+length+\" characters!</font>\";\n\t\t\tsituationValid = true;\n\t\t} else {\n\t\t\tlist.innerHTML = \"<font color=RED >Sorry! you have already written \"+length+\" characters. The length should be less than 240 characters</font>\";\n\t\t\tsituationValid = false;\n\t\t}\n\t}", "function theImplementation(automata){\n\n}", "function shouldBeVisible() {\n return visibleValues > 1;\n}", "hasNext() {\n //don't let the next display if there's (mandatory) choices to make\n if (this.hasChoices()) {return false;}\n let check = this.getNextLineIndex() || this.getNextDialogueIndex() || this.getNextSceneIndex();\n if (check) {return check;} else {return false;}\n }", "function isDisplayed(pIndex){\n var lDisplay = ( pIsWizard ? pAttributeList[pIndex].showInWizard : true ),\n lValue,\n lDependingOnExpr,\n lIsMultiValue;\n\n // check if attribute should always be excluded (for example because of component type)\n if ( lDisplay && pAttributeList[pIndex].isExcluded === true ) {\n lDisplay = false;\n }\n\n // check ui type if available\n if ( lDisplay && pUiType && pAttributeList[pIndex].supportedUiTypes ) {\n lDisplay = ( apex.jQuery.inArray( pUiType, pAttributeList[pIndex].supportedUiTypes.split( \":\" )) !== -1 );\n }\n\n // check condition\n if ( lDisplay && pAttributeList[pIndex].dependingOnAttrSeq && pAttributeList[pIndex].dependingOnCondType) {\n\n // recursive call to check the whole dependency chain\n // Note: we have to use -1 because the array starts with 0\n lDisplay = isDisplayed(parseInt(pAttributeList[pIndex].dependingOnAttrSeq, 10)-1);\n // only if all parents are displayed, we check the current attribute as well\n if (lDisplay) {\n lValue = $v(lPrefix+pAttributeList[pIndex].dependingOnAttrSeq);\n lDependingOnExpr = pAttributeList[pIndex].dependingOnExpr;\n // Note: we have to use -1 because the array starts with 0 and dependingOnAttrSeq uses the original attribute seq\n // which starts with 1\n lIsMultiValue = pAttributeList[parseInt(pAttributeList[pIndex].dependingOnAttrSeq, 10)-1].type === \"CHECKBOXES\"?true:false;\n\n if (lIsMultiValue) {\n lValue = (lValue === \"\"?[]:lValue.split(\":\"));\n }\n\n switch (pAttributeList[pIndex].dependingOnCondType) {\n case 'EQUALS':\n if (lIsMultiValue) {\n lDisplay = (apex.jQuery.inArray(lDependingOnExpr, lValue) != -1);\n } else {\n lDisplay = (lValue === lDependingOnExpr);\n }\n break;\n case 'NOT_EQUALS':\n if (lIsMultiValue) {\n lDisplay = (apex.jQuery.inArray(lDependingOnExpr, lValue) === -1);\n } else {\n lDisplay = (lValue !== lDependingOnExpr);\n }\n break;\n case 'IN_LIST':\n lDependingOnExpr = lDependingOnExpr.split(',');\n if (lIsMultiValue) {\n lDisplay = false;\n // Check if any of the values in the value array equals any of\n // the values in the depending on expression array\n apex.jQuery.each(lValue, function(pIndex, pValue) {\n lDisplay = (apex.jQuery.inArray(pValue, lDependingOnExpr) !== -1);\n // If result is true, then exit iterator.\n if (lDisplay) { return false; };\n });\n } else {\n lDisplay = (apex.jQuery.inArray(lValue, lDependingOnExpr)!==-1);\n }\n break;\n case 'NOT_IN_LIST':\n lDependingOnExpr = lDependingOnExpr.split(',');\n if (lIsMultiValue) {\n lDisplay = true;\n // Check if any of the values in the value array do not\n // equal any the values in the depending on expression array.\n apex.jQuery.each(lValue, function(pIndex, pValue) {\n lDisplay = (apex.jQuery.inArray(pValue, lDependingOnExpr) === -1);\n if (!lDisplay) { return false; };\n });\n } else {\n lDisplay = (apex.jQuery.inArray(lValue, lDependingOnExpr)===-1);\n }\n break;\n case 'NULL':\n if (lIsMultiValue) {\n lDisplay = (lValue.length === 0);\n } else {\n lDisplay = !(lValue);\n }\n break;\n case 'NOT_NULL':\n if (lIsMultiValue) {\n lDisplay = (lValue.length > 0);\n } else {\n lDisplay = (lValue);\n }\n break;\n }\n } else if ( pAttributeList[pIndex].dependingOnAlwaysEval === false ) {\n lDisplay = true;\n }\n }\n return lDisplay;\n }", "resultspage_check() {\r\n // funcao validar pagina de resultados\r\n cy.get(elements.wordSearched()).should('be.visible')\r\n cy.get(elements.quantityResult()).should('be.visible')\r\n cy.get(elements.orderingOptions()).should('be.visible')\r\n cy.get(elements.productPicture()).should('be.visible')\r\n }", "function checkSequence(){\n\t console.log(\"checking\");\n\t if (JSON.stringify(pattern) === JSON.stringify(userPattern)){\n\t\t\telementScore.innerHTML ++;\n\t\t\tif(elementHigh.innerHTML < elementScore.innerHTML){\n\t\t\t elementHigh.innerHTML++;\n\t\t\t}\n\t/* The next level function is called if they are, if not end game.*/\t\n\t\t \n\t\t console.log(\"next\");\n\t nextLevel();\n\t }\n\t\telse {\n\t\t\n\t\t\tendGame();\n\t\t} \n }", "function displayConstraint(bmp_id){\n\t\tif(bmp_id == \"4\" || bmp_id == \"7\" || bmp_id == \"6\"){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "check_if_passed() {\n const passed = this.node.value === this.correct;\n if (!passed) {\n console.error(this.describe() + \" failed!\");\n }\n return passed;\n }", "validateButtonsOnForm() {\n return this\n .waitForElementVisible('@faqForm')\n .assert.visible('@faqForm', 'Form is loaded')\n .waitForElementVisible('@noBtn')\n .assert.containsText('@noBtn', 'No')\n .waitForElementVisible('@yesBtn')\n .assert.containsText('@yesBtn', 'Yes');\n }", "function showAttractionResults() {\n const attractions = document.getElementById('attraction-segment');\n attractions.style.display = 'block';\n }", "function displayInterface() {\n \n if (questionCounter > 0) {\n let selectedQuestion = selectQuestion();\n console.log(questions.length + \"Before shift\")\n populateQuestion(selectedQuestion);\n populateAnswers(selectedQuestion);\n }\n}", "function validateDatabaseChange()\r\n{\r\n\tdatabaseOK = true;\r\n\tvar dnaRecords = document.getElementById(\"DNARecords\");\r\n\t//walidacja kolejnych bazodanowych sekwencji\r\n\tfor (var i = 0; i < dnaRecords.rows.length; ++i) \r\n\t{\r\n\t\tif(!validateSequence(dnaRecords.rows[i].cells[0].firstChild.value))\r\n\t\t{\r\n\t\t\tdatabaseOK = false;\r\n\t\t\tbreak;\r\n\t\t} \r\n }\r\n}", "isQnA(): boolean {\n return this.type === ClassificationResult.TYPE_QNA;\n }", "function BusinessIntelligenceCheck(){}", "function showAbsenceDetails(nr) {\nif (nr != undefined) {\nelementToCheck = nr;\t\n} else {\nelementToCheck = activeElement;\n}\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == elementToCheck);\n//console.log(activeDataSet);\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSet['ende'])+'</b>';\t\n} else {\ncontent += \" am <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b>\";\t\n}\nanzeige = \"\";\nif (activeDataSet['adminMeldung'] != 0) {\nanzeige = \"Eintrag Sekretariat am: <b>\" + formatDateDot(activeDataSet['adminMeldungDatum'])+'</b><br/>';\t\n}\nif (activeDataSet['lehrerMeldung'] != \"0\") {\n\tif (teacherUser ==1) {\n\taddInfo = activeDataSet['lehrerMeldung'] + \"<b> (\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+')</b><br/>';\t\n\t} else {\n\taddInfo = \"Eintrag Lehrkraft<b> (\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+')</b><br/>';\t\n\t}\n\tanzeige += addInfo;\t\n}\nif (activeDataSet['elternMeldung'] != \"0\") {\nanzeige += \"Eintrag Eltern am: <b>\" + formatDateDot(activeDataSet['elternMeldungDatum'])+'</b>';\t\n}\nif (activeDataSet['kommentar'] != \"\") {\nanzeige += \"<br/>Kommentar: <b>\" + activeDataSet['kommentar']+'</b>';\t\n}\nif (activeDataSet['entschuldigt'] != \"0000-00-00\") {\nanzeige += \"Entschuldigung am: <b>\" + formatDateDot(activeDataSet['entschuldigt'])+'</b>';\t\n}\ncontent += '<br/>' + anzeige;\n\nreturn content;\t\n}", "performFullValidation() {\r\n const validateCompleted = this.state.pages[this.state.index].questions.map(\r\n (question, index) => {\r\n if (!question.required || question.questionType === \"Label\") {\r\n return true;\r\n }\r\n const answer = this.state.answerIndexes.find(\r\n ans => ans.page === this.state.index && ans.qIndex === index\r\n );\r\n if (!answer || answer.answer === \"\" || answer.answer === \"null\") {\r\n return false;\r\n }\r\n return true;\r\n }\r\n );\r\n this.setState({\r\n questionsAnswered: validateCompleted\r\n });\r\n }", "function compareAO()\n{\n var alex = document.getElementById('alex');\n var olex = document.getElementById('olex');\n\n var aval = alex.value.split('\\n');\n var oval = olex.value.split('\\n');\n\n var identical = 0;\n var different = 0;\n\n var new_text = '';\n var cor_text = '';\n\n for(i=0;i<aval.length-1;i++)\n {\n var a = aval[i].split(' > ')[1];\n var o = oval[i];\n \n if(a != o){\n different += 1;\n new_text += ohg[i]+' > '+ o + ' ['+a+']\\n';\n }\n else{\n identical += 1;\n cor_text += ohg[i]+' > '+o+'\\n';\n }\n }\n var goods = parseInt(identical / (identical + different) * 100);\n var bads = parseInt(different / (identical + different) * 100);\n var total = identical + different;\n\n results = [goods];\n\n document.getElementById('olex').value = new_text;\n document.getElementById('clex').value = cor_text;\n document.getElementById('evalu').style.display = 'block';\n return [identical, different, goods, bads, total];\n}", "function showParseTree() {\n // Hide the answers until the user generates a new expression.\n $(\".new-expression\").show();\n $(\".answers\").hide();\n var expression = $(\"#\"+TreeConstants.ROOT_TAG).text();\n // Show help if active.\n TreeConstructor.promptActive = false;\n var fn = partial(feedbackForAnswer, this.id);\n TreeConstructor.createParseTree(expression, TreeConstants.ROOT_TAG, fn);\n }", "function explainPuzzle(){\n\tlet ed = display.explanationDisplay;\n\ted.innerHTML = underground.selected.explanationDisplay();\n}", "function btnDisplay(){\n if(strValidation && motValidation && moodClickedValidation)\n btnToggle.style.display = 'block';\n}", "function C012_AfterClass_Amanda_TestSubmit() {\n\tif (Common_PlayerOwner != \"\") {\n\t\tOverridenIntroText = GetText(\"AlreadyOwned\");\n\t} else {\n\t\tif (ActorIsRestrained()) {\n\t\t\tOverridenIntroText = GetText(\"UnrestrainFirst\");\n\t\t} else {\n\t\t\tif (ActorIsChaste()) {\n\t\t\t\tOverridenIntroText = GetText(\"UnchasteFirst\");\n\t\t\t} else {\n\t\t\t\tif (PlayerHasLockedInventory(\"Collar\")) {\n\t\t\t\t\tOverridenIntroText = GetText(\"PlayerUncollarFirst\");\t\t\t\t\t\n\t\t\t\t} else {\t\t\t\t\t\n\t\t\t\t\tif (Common_PlayerRestrained) {\n\t\t\t\t\t\tOverridenIntroText = GetText(\"PlayerUnrestrainFirst\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tC012_AfterClass_Amanda_CurrentStage = 330;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function verifierMot()\n{\n var lemot = \"\";\n for(let i=0; i<choisi.length; i++)\n {\n lemot += choisi[i].textContent;\n }\n if(lemot == mots[niveau])\n {\n nextlevel();\n }\n else{\n initialiseNiveau(niveau);\n }\n}", "function showResults() {\r\n $(\"#optimalSolutionPanel\").hide();\r\n \r\n $('#results').show();\r\n experimentComplete();\r\n// enablePlayAgain();\r\n \r\n if (numRoundsWithStar >= 3) {\r\n writeAward(\"No Instruction Needed\");\r\n payAMT(true,0.20); \r\n } else {\r\n payAMT(true,0.0); \r\n }\r\n \r\n// quit();\r\n \r\n}", "function displayGuide() {\n my.html.guide.innerHTML = my.current.unit.guide\n }", "function checkManipulate(param) {\n closeOption({});\n if (gw_com_api.getCRUD(\"frmData_MainA\") == \"none\") {\n gw_com_api.messageBox([{ text: \"NOMASTER\" }]);\n return false;\n }\n return true;\n}", "verifySectorListIsDisplayed(){\n utils.verifyTheListOfElementsExists(jobsPageLocator.jobsPage.jobsSectorList,sectorList);\n }", "function checkAll(){\n //verificam daca toate intrebarile au fost completate\n let ok=1;\n for(let i=0;i<=answersScoreArray.length;i++)\n if(answersScoreArray[i]===\"NULL\") {alert('Toate intrebarile sunt obligatorii! Reintoarce-te si completeaza intrebarea '+ (i+1) + \"!\"); ok=0; break}\n if(ok===1) show(score);\n}", "function showInstructions() {\r\n\tconst INSTRUCTIONS = \"1. Identify the morphological boundaries. \" \r\n\t\t\t\t\t + \"When you mouse over the word, grey slashes will appear in the spaces between the letters, indicating possible morphological boundaries. <br><br>\"\r\n\t\t\t\t\t + \"a. To mark a morphological boundary, click on the space where you think the boundary is using your mouse. <br><br> \" \r\n\t\t\t\t\t + \"b. Once you've made your selection, click on the check button to see whether you've identified the boundaries correctly. <br><br>\"\r\n\t\t\t\t\t + \"c. If you've selected your boundaries correctly, the morphological categories of the word's components will automatically appear above the word.\"\r\n\t\t\t\t\t + \"If you haven't, you will be given the opportunity to try again \"\r\n\t\t\t\t\t + \"(remember, after three tries, the program will provide the correct answer).\"; \r\n\tshowModal(INSTRUCTIONS, false);\r\n}", "function checkIterationFormInfo(objData){\n\t\n\tif (objData.length < 16) {\n\t\talert(\"Please answer all questions before finishing the experiment\");\n\t\treturn false;\n\t}\n\n\tfor (var i = 0; i < objData.length; i++) {\n\t\tif (objData[i].value == \"\"){\n\t\t\talert(\"Please answer question: \" + objData[i].name);\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "function check() {\n var enabled = true;\n if (!UI.GetValue(\"Misc\", \"JAVASCRIPT\", \"Script items\", \"Show Fixes\")) {\n var enabled = false;\n }\n UI.SetEnabled(\"MISC\", \"JAVASCRIPT\", \"Script items\", \"No FakeLag With Nades Out\", enabled);\n UI.SetEnabled(\"MISC\", \"JAVASCRIPT\", \"Script items\", \"No FakeLag With Revolver\", enabled);\n UI.SetEnabled(\"MISC\", \"JAVASCRIPT\", \"Script items\", \"No AA on knife fix\", enabled);\n if (UI.GetValue(\"Misc\", \"JAVASCRIPT\", \"Script items\", \"No FakeLag With Nades Out\") || GetValue(\"Misc\", \"JAVASCRIPT\", \"Script items\", \"No FakeLag With Revolver\")) {\n LagFix();\n }\n if (UI.GetValue(\"Misc\", \"JAVASCRIPT\", \"Script items\", \"No AA on knife fix\")) {\n knifeFix();\n }\n}", "function C012_AfterClass_Amanda_TestDomme() {\n\tif (!ActorIsGagged()) {\n\t\tif (!Common_ActorIsOwned) {\n\t\t\tif (PlayerHasInventory(\"Collar\")) {\n\t\t\t\tif (ActorGetValue(ActorSubmission) >= 20) {\n\t\t\t\t\tif (!GameLogQuery(CurrentChapter, CurrentActor, \"EnslaveDone\")) {\n\t\t\t\t\t\tC012_AfterClass_Amanda_CurrentStage = 200;\n\t\t\t\t\t\tOverridenIntroText = \"\";\n\t\t\t\t\t\tLeaveIcon = \"\";\n\t\t\t\t\t\tGameLogAdd(\"EnslaveDone\");\n\t\t\t\t\t} else OverridenIntroText = GetText(\"EnslaveAlreadyTried\");\n\t\t\t\t}\n\t\t\t} else OverridenIntroText = GetText(\"CollarToEnslave\");\n\t\t} else OverridenIntroText = GetText(\"SubEnjoyBondage\");\n\t} else C012_AfterClass_Amanda_GaggedAnswer();\n}", "function showTestingResults(state) {\n switch(state) {\n case 'device-error':\n document.getElementById('if-not-posible').classList.remove('is-hidden');\n document.getElementById('deviceError').classList.remove('is-hidden');\n break;\n case 'software-error':\n document.getElementById('if-not-posible').classList.remove('is-hidden');\n document.getElementById('softwareError').classList.remove('is-hidden');\n break;\n case 'hardware-error':\n document.getElementById('if-not-posible').classList.remove('is-hidden');\n document.getElementById('hardwareError').classList.remove('is-hidden');\n break;\n case 'all-right':\n document.getElementById('if-possible').classList.remove('is-hidden');\n my_init();\n break;\n } \n}", "function show() {\n return vm.error == \"\";\n }", "function validate() {\r\n\r\n\r\n \r\n // set the progress of the background\r\n progress.style.width = ++position * 100 / questions.length + 'vw'\r\n\r\n // if there is a new question, hide current and load next\r\n if (questions[position]) hideCurrent(putQuestion)\r\n else hideCurrent(done)\r\n \r\n \r\n\r\n }", "function check(){\n\tvar correct = 0;\n\t\tfor(var i = 0; i < sequencePlayer.length; i++){\n\t\t\tif(sequencePlayer[i] == sequence[i]){\n\t\t\t\tcorrect++;\t\t\t\t\n\t\t\t}else{\n\t\t\t\tsound(soundLost);\n\t\t\t\ticonTimes();\n\t\t\t\tplusOn = true;\n\t\t\t}//else\n\t\t\t\t\n\t\t\tif((correct > 0) && (correct == sequence.length)){\n\t\t\t\tsound(soundGood);\n\t\t\t\ticonCheck();\n\t\t\t\tsequencePlayer = [];\n\t\t\t\tuseLife = false;\n\t\t\t\tchoices = document.getElementById(\"No\");\n\t\t\t\tchoices.innerHTML = click;\n\t\t\t\t\n\t\t\t\ton = false;\n\t\t\t\tplayOn = false;\n\t\t\t\tplusOn = true;\n\t\t\t\tnoLifemode = true;\n\t\t\t\t\n\t\t\t\tif(counter > highScore){\n\t\t\t\thighScore = counter;\n\t\t\t\t}\n\t\t\t}//if2\n\t\t}//for\n}//check()", "function checkResultsCount() {\n // get all rules from ui\n var rules = document.getElementsByClassName('ruleEntry');\n // set up rules shown counter\n var resultsCounter = 0;\n // step trough all the rules\n for (var i = 0; i < rules.length; i++) {\n // if rule is shown increase repo shown counter\n if (rules[i].style.display != 'none') {\n resultsCounter++;\n }\n }\n // if rule shown counter is 0 (no rules displayed) show no rules found exception\n if (resultsCounter == 0) {\n document.getElementById('noEntries').style.display = 'block';\n // else hide exception\n } else {\n document.getElementById('noEntries').style.display = 'none';\n }\n}", "function processAnswer(finalTestData) {\n\tlet userAnswer = editor.getValue();\n\tlet finalTest = finalTestData.data.attributes.finalText;\n\n\tcheckAnswer(userAnswer, finalTest);\n}", "function verifierEquation(item,min,max,numberDisplay) {\n\t\n\tvar reponseUser = item.innerHTML;\n\tvar nbr1 = parseInt(document.getElementById(\"nbr1\").innerHTML);\n\tvar nbr2 = parseInt(document.getElementById(\"nbr2\").innerHTML);\n\tvar signe = document.getElementById(\"signe\").innerHTML;\n\t\n\tclearAnswer(numberDisplay);\n\t\n\tvar reponseEquation = calculEquation(nbr1,nbr2,signe);\n\t\n\tif (reponseUser == reponseEquation) {\n\t\t\n\t\tdisplayAfterGoodAnswer(reponseEquation)\n\t\t\n\t\tnumberGoodAnswer ++; \n\t\tnumberTotalAnswer ++;\n\t\t\n\t\tafficheNumberGoodAnswer();\n\t\t\n\t\tsetTimeout(load_game_mathEquation, 2000, signe,min,max,numberDisplay);\n\t}else {\n\n\t\tdisplayAfterBadAnswer(reponseEquation)\n\t\t \n\t\tnumberTotalAnswer ++;\n\t\t\t\n\t\tafficheNumberGoodAnswer();\n\t\t\n\t\tsetTimeout(load_game_mathEquation, 2000, signe,min,max,numberDisplay);\n\t}\t\n}", "async function verifyAnonymity(page) {\n logger.info(\"Running anonymity tests..\", { category: \"stealthCheck\" });\n\n const intoliTest = await runIntoliTest(page);\n const antoineTest = await runAntoineVastelTest(page);\n\n logger.info(\"All tests ran succesfully\", { category: \"stealthCheck\" });\n\n return { intoliTest, antoineTest };\n}", "function ko_check() {\n if (current_character.KO) {\n readNextToken();\n } else if (current_character === fighter) {\n $('#turnAnnouncer').html(\"It's <span>FIGHTER'S</span> turn!\");\n } else if (current_character === whiteMage) {\n $('#turnAnnouncer').html(\"It's <span>WHITE MAGE'S</span> turn!\");\n } else if (current_character === blackMage) {\n $('#turnAnnouncer').html(\"It's <span>BLACK MAGE'S</span> turn!\");\n } else if (current_character === titan) {\n $('#turnAnnouncer').html(\"The enemy is going to attack!\");\n }\n}", "function checkIfDone(){\n\tif(remainingSlides === 0 | remainingSlides < 0){\n\t\tconsole.log(\"DONE\");\n\t\t$(\"#quiz\").css(\"display\", \"none\");\n\t\t$(\"#results\").css(\"display\", \"block\");\n\t\tvar totalAgainstNN = liked/totalSlides*100;\n\t\tif (totalAgainstNN >= 50.0){\n\t\t\t$(\"#foragainst\").text(\"for\");\n\t\t\t$(\"#foragainst2\").text(\"for\");\n\t\t\t$(\"#magicNum\").text(Math.round(totalAgainstNN));\n\t\t\t$(\"#folksAgainstNN\").css(\"display\", \"block\");\n\t\t} else {\n\t\t\t$(\"#foragainst\").text(\"against\");\n\t\t\t$(\"#foragainst2\").text(\"against\");\n\t\t\t$(\"#magicNum\").text(Math.round(100-totalAgainstNN));\n\t\t\t$(\"#folksForNN\").css(\"display\", \"block\");\n\t\t}\n\t}\n}", "function showAbsenceDetails(nr) {\nif (nr != undefined) {\nelementToCheck = nr;\t\n} else {\nelementToCheck = activeElement;\n}\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == elementToCheck);\n\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSet['ende'])+'</b>';\t\n} else {\ncontent += \" am <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b>\";\t\n}\nanzeige = \"\";\nif (activeDataSet['adminMeldung'] != 0) {\nanzeige = \"Eintrag Sekretariat am: <b>\" + formatDateDot(activeDataSet['adminMeldungDatum'])+'</b><br/>';\t\n}\nif (activeDataSet['beurlaubt'] == 0) {\n\tif (activeDataSet['lehrerMeldung'] != \"0\") {\n\tanzeige += \"Meldung Lehrer am: <b>\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+'</b><br/>';\t\n\t}\n\tif (activeDataSet['elternMeldung'] != \"0\") {\n\tanzeige += \"Eintrag Eltern am: <b>\" + formatDateDot(activeDataSet['elternMeldungDatum'])+'</b>';\t\n\t}\n\tif (activeDataSet['entschuldigt'] != \"0000-00-00\") {\n\tanzeige += \"Entschuldigung am: <b>\" + formatDateDot(activeDataSet['entschuldigt'])+'</b>';\t\n\t}\t\n}\nif (activeDataSet['kommentar'] != \"\") {\nanzeige += \"Kommentar: \" + activeDataSet['kommentar'];\t\n}\ncontent += '<br/>' + anzeige;\n\nreturn content;\t\n}", "function checkIfComplete(){\n\t\tif(isComplete == false){\n\t\t\tisComplete = true;\n\t\t} else {\n\t\t\tplace = ' SEGUNDO ';\n\t\t}\n\t}", "check_if_passed() {\n const passed = this.text_node.textContent === this.correct;\n if (!passed) {\n console.error(this.describe() + \" failed! ('\" + this.text_node.textContent + \"' != '\" + this.correct + \"')\");\n }\n return passed;\n }" ]
[ "0.5910028", "0.5820131", "0.5729723", "0.5710434", "0.56639796", "0.56508213", "0.5616431", "0.5499719", "0.5447277", "0.5445098", "0.54385877", "0.5430272", "0.54191184", "0.5417161", "0.541713", "0.5388745", "0.5355606", "0.5343009", "0.53365827", "0.5327624", "0.5322725", "0.5310115", "0.52940434", "0.5291848", "0.5288364", "0.5261933", "0.524847", "0.5227953", "0.52274364", "0.5220843", "0.52183074", "0.52181774", "0.52144223", "0.5212761", "0.5209653", "0.52089196", "0.5200811", "0.5187177", "0.5171124", "0.51556104", "0.51423216", "0.5139949", "0.5139283", "0.5126061", "0.512201", "0.512201", "0.512201", "0.512201", "0.512201", "0.5118805", "0.5118805", "0.5118805", "0.5118805", "0.5118805", "0.51146275", "0.509476", "0.5093573", "0.50893426", "0.50891215", "0.5088681", "0.50885427", "0.5086255", "0.50829196", "0.50813925", "0.5078751", "0.50537795", "0.5052317", "0.50511557", "0.5050656", "0.5044242", "0.5030571", "0.5027812", "0.50272757", "0.5024347", "0.50170714", "0.5013227", "0.5012527", "0.5005607", "0.50041753", "0.500119", "0.5000841", "0.49963325", "0.49945635", "0.4990778", "0.49867406", "0.49865144", "0.49824858", "0.49810696", "0.49810618", "0.49800512", "0.49776012", "0.49735418", "0.49733546", "0.49721706", "0.49710923", "0.4969756", "0.49667186", "0.49580342", "0.49543908", "0.4941836" ]
0.70362014
0
get current location data
function getWeatherByCoords(position) { let apiKey = "0ae703064e17d8cb6a410a5138e15a28"; let apiUrl = "https://api.openweathermap.org/data/2.5/weather?"; let lat = position.coords.latitude; let lon = position.coords.longitude; axios .get(`${apiUrl}lat=${lat}&lon=${lon}&appid=${apiKey}&units=metric`) .then(showTemperature); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLocation() {\n\t\tTitanium.Geolocation.getCurrentPosition( updatePosition );\n\t}", "function getcurentposition() {\n\tnavigator.geolocation.getCurrentPosition(GeoOnSuccess, GeoOnError, {enableHighAccuracy: true});\n}", "function getLocation() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(postLocation, showError);\n\t}\n}", "function getLocation() {\n return location;\n }", "function getCurrentLocation() {\n lat = localStorage.getItem(\"lat\");\n long = localStorage.getItem(\"long\");\n if (!lat || !long)\n window.navigator.geolocation.getCurrentPosition(processLocation);\n else getWeatherData();\n}", "function GetLocation(){\n\tif(navigator.geolocation){\n\t\tnavigator.geolocation.getCurrentPosition(setLocation);\n\t}\n}", "function getBrowserGeoLoc(){\n getLocation();\n showPosition();\n }", "function getLoc() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(success, getError);\n }\n\n else {\n console.log(\"Geolocation is not supported by this browser\");\n defaultLoc();\n }\n}", "function GetCurrentLocation() {\n // chek deafault user coordinates\n if (Modernizr.geolocation) {\n navigator.geolocation.getCurrentPosition(success, options);\n var options = {\n enableHighAccuracy: true,\n timeout: 5000,\n maximumAge: 0\n };\n function success(pos) {\n var crd = pos.coords;\n // transfer current user coordinates to default\n window.centerLat = crd.latitude;\n window.centerLng = crd.longitude;\n }\n } else {\n console.log('location error');\n }\n} // GetCurrentLocation", "static getCurrentLocLS(){\r\n let loc = {\r\n city : 'Toronto',\r\n country : 'CA'\r\n };\r\n\r\n if (localStorage.getItem('currLocation')) {\r\n return (JSON.parse(localStorage.getItem('currLocation')));\r\n } else {\r\n return (loc)\r\n } \r\n }", "function getLocation() {\n navigator.geolocation.getCurrentPosition(function(position) {\n lat = position.coords.latitude;\n lon = position.coords.longitude;\n console.log('lat =' + lat + ', lon =' + lon);\n });\n }", "function getLocation() {\n var currentLon = \"\";\n var currentLat = \"lat=\";\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(loc) {\n //set currentLon & currentLat\n currentLon += loc.coords.longitude;\n currentLat += loc.coords.latitude;\n //fucntions called built on longitude and latitude location\n buildApi(currentLon, currentLat);\n //drawCoords(currentLon, currentLat);\n });\n } else {\n alert(\"You're lost and we can't find you.\");\n }\n }", "function getLocation(){\n\t\t\tif(navigator.geolocation){\n\t\t\t\tnavigator.geolocation.getCurrentPosition(showPosition);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tdisplayCoords.innerHTML=\"Geolocation API not supported by your browser\";\n\t\t\t}\n\t\t\t\n\t\t}", "function getGeoLocation(){\n //Getting current position \n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n this.currentPosMark = new google.maps.Marker({\n position: pos,\n map: this.map,\n icon: this.iconTypes['beachFlag'],\n animation: google.maps.Animation.DROP,\n title: 'You are here!'\n });\n infoWindow.setPosition(pos);\n infoWindow.setContent('You are here');\n //infoWindow.open(map);\n map.setCenter(pos);\n }, function() {\n handleLocationError(true, infoWindow, this.map.getCenter());\n });\n } else {\n // Browser doesn't support Geolocation\n handleLocationError(false, infoWindow, this.map.getCenter());\n }\n }", "getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(objGeolocation.bundleObj, objGeolocation.handelError)\n } else {\n console.log('Geolocation is not supported by this browser');\n }\n }", "function geoloc() {\n let coords = navigator.geolocation.getCurrentPosition((pos) => {\n coords = pos;\n let lat = coords.coords.latitude;\n let long = coords.coords.longitude;\n ll = `?_ll=${lat},${long}`;\n document.querySelector(\".change-hour h1 span\").textContent = \"ma position\";\n getDatas(process);\n });\n}", "function getCurrentLocation() {\n\tif (!navigator.geolocation) {\n\t\talert(\"GeoLocation is not supported by browser.\");\n\t\treturn;\n\t}\n\treturn navigator.geolocation.getCurrentPosition(coordinates,\n\t\tdisplayErrorMessage);\n}", "function getGeoLoc() {\n\n //check if browser can get geolocation\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (pos) {\n //get lat ang lng as obj\n var lat = pos.coords.latitude;\n var lng = pos.coords.longitude;\n\n getData(lat, lng);\n //alert when error happens\n }, function (error) {\n alert('There was an error: ' + error.message);\n });\n }\n }", "function getLocation() {\n var geolocation = navigator.geolocation;\n geolocation.getCurrentPosition(showLocation);\n }", "getLocation() {\n return this._executeAfterInitialWait(() => this.currently.getLocation());\n }", "function getLocation() {\n return findLocation(getStatus());\n}", "function currentLocationWeather() {\n // get user's location from the browser\n navigator.geolocation.getCurrentPosition(geolocSuccess, geolocError);\n}", "function getGeoData() {\n\n //determine if the handset has client side geo location capabilities\n if(geo_position_js.init()){\n\tgeo_position_js.getCurrentPosition(\n\t\t\t\t\t function(data){\n\t\t\t\t\t \n\t\t\t\t\t LATITUDE = data.coords.latitude;\n\t\t\t\t\t LONGITUDE = data.coords.longitude;\n\n\t\t\t\t\t },\n\n\t\t\t\t\t function(data){\n\t\t\t\t\t alert('could not retrieve geo data');\n\t\t\t\t\t }\n\t\t\t\t\t );\n }\n else{\n\talert(\"Functionality not available\");\n }\n\n\n\n}", "function loadCurrentLoc() {\r\n // show loader\r\n showLoaderAndCleanElements();\r\n\r\n function getPosition() {\r\n return new Promise((resolve, reject) =>\r\n navigator.geolocation.getCurrentPosition(resolve, reject)\r\n );\r\n }\r\n getPosition()\r\n .then((position) => position.coords)\r\n .then((coords) => {\r\n // fetching data - current location\r\n fetchWeatherData(\r\n `https://api.openweathermap.org/data/2.5/weather?lat=${coords.latitude}&lon=${coords.longitude}&units=metric&appid=30c174ec2ba71f992035ddbd346caad7`\r\n );\r\n })\r\n .catch((err) => {\r\n // if user denies geolocation data show weather for London\r\n fetchWeatherData(\r\n `https://api.openweathermap.org/data/2.5/weather?q=London&units=metric&appid=30c174ec2ba71f992035ddbd346caad7`\r\n );\r\n console.error(err.message);\r\n });\r\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(createMap);\n } \n }", "getLocationInfo(){\n return this.map.getLocationInfo();\n }", "function _getLocation() {\n if (navigator.geolocation) {\n App.Modules.GPS.state=STATES.ON;\n navigator.geolocation.getCurrentPosition(_getLocation_return);\n } else {\n App.Modules.GPS.state=STATES.NOT_SUPPORTED;\n _dispatchUpdateCallbacks( );\n }\n }", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n}", "function getLocation() {\n navigator.geolocation.getCurrentPosition(displayLocation, locationError);\n}", "function getLocation() {\n\t\tif (navigator.geolocation) {\n\t\t\tnavigator.geolocation.getCurrentPosition(showPosition);\n\t\t} else {\n\t\t\tconsole.log('No location detected');\n\t\t}\n\t}", "function getLocation(location) {\n lat = location.coords.latitude;\n lng = location.coords.longitude;\n }", "function getCurrentLocation(){\r\n\tnavigator.geolocation.getCurrentPosition(onSuccess, onError,{ timeout: 5000,enableHighAccuracy: true });\r\n}", "function getlocation() {\n \tconsole.log(\"Entering getLocation()\");\n \tif(navigator.geolocation){\n\t\t\tnavigator.geolocation.getCurrentPosition(\n\t\t\tdisplayCurrentLocation,\n\t\t\tdisplayError,\n\t\t\t{ \n\t\t\t\tmaximumAge: 3000, \n\t\t\t\ttimeout: 5000, \n\t\t\t\tenableHighAccuracy: true \n\t\t\t});\n\t\t}else{\n\t\t\t//console.log(\"Oops, no geolocation support\");\n\t\t} \n \t//console.log(\"Exiting getLocation()\");\n }", "function getCurrentLocation() {\n \n function success(position) {\n //if permission granted set call [setAddress()] to convert lat and long to street adresss\n lat = position.coords.latitude;\n lon = position.coords.longitude;\n setAddress();\n }\n function denied() {\n // if permission is denied set Ticket Master queries to defualt to \"Washington\"(city) and DC (state)\n // console.log('Unable to retrieve your location');\n searchAddress=\"\";\n searchCity = \"Washington\";\n searchState = \"DC\";\n startPoint = searchCity + \", \" + searchState;\n // Call to main to set defualts other than location [setTime() default && setCategory() defualt]\n main();\n }\n if (!navigator.geolocation) {\n // console.log('Geolocation is not supported by your browser');\n } else {\n // console.log('Locating…');\n navigator.geolocation.getCurrentPosition(success, denied);\n }\n }", "function getUserLocation() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(showUserPosition);\n\t} \n}", "function getLocation() {\n // Make sure browser supports this feature\n if (navigator.geolocation) {\n // Provide our showPosition() function to getCurrentPosition\n console.log(navigator.geolocation.getCurrentPosition(showPosition));\n }\n else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n }", "function processData(){\n navigator.geolocation.getCurrentPosition(onsuccess, onerror);\n}", "function getLocation() {\n navigator.geolocation.getCurrentPosition(geoCallback, onError);\n}", "function getLocation() {\n\tif (window.navigator.geolocation) {\n\t\twindow.navigator.geolocation.getCurrentPosition(showPosition);\n\t} else {\n\t\tshowPosition(DEFAULT_POSITION);\n\t}\n}", "function getLoc() {\n\n\tif (!navigator.geolocation) {\n\n\t geolocate.innerHTML = 'Geolocation is not available';\n\n\t} else {\n\t \n\t map.locate();\n\n\t console.log(map.locate());\n\t}\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n // Nest showPosition inside getLocation\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n console.log(\"Geolocation is not supported by this browser.\");\n }\n }", "function getLocation(){\r\n if (locationUser) {\r\n locationUser.getCurrentPosition(showPosition);\r\n } else {\r\n return 'Geolocation is not supported by this browser.';\r\n }\r\n}", "function obtainGeolocation(){\n window.navigator.geolocation.getCurrentPosition(localitation);\n }", "function getPlayerLocation() {\n\t\tTitanium.Geolocation.getCurrentPosition( updatePlayerPosition );\n\t}", "get location() {\n\t\treturn this.__location;\n\t}", "get location() {\n\t\treturn this.__location;\n\t}", "get location() {\n\t\treturn this.__location;\n\t}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else { \n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n }", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(getPositionSuccess, getPositionError, getPositionOptions);\n }\n\telse {\n\t\talertify.error(\"Geolocation is not supported for this browser.\");\n\t}\n}", "getCurrentLocationInfo(latlng) {\n if (this.settings.useGoogleGeoApi) {\n this._googlePlacesService.getGeoLatLngDetail(latlng).then((result) => {\n if (result) {\n this.setRecentLocation(result);\n }\n this.gettingCurrentLocationFlag = false;\n });\n }\n else {\n this._googlePlacesService.getLatLngDetail(this.settings.geoLatLangServiceUrl, latlng.lat, latlng.lng).then((result) => {\n if (result) {\n result = this.extractServerList(this.settings.serverResponseatLangHierarchy, result);\n this.setRecentLocation(result);\n }\n this.gettingCurrentLocationFlag = false;\n });\n }\n }", "getLocation() {\n return this.origin;\n }", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n }", "function getLocation() {\n\t if (navigator.geolocation) {\n\t navigator.geolocation.getCurrentPosition(getWeather);\n\t } else {\n\t alert(\"Geolocation is not supported by this browser.\");\n\t }\n\t}", "function getCurrentLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n setLocation(position.coords.latitude, position.coords.longitude);\n },\n function (error) {\n console.log(\"Something went wrong: \", error);\n setLocation(DEFAULT_LAT, DEFAULT_LONG);\n },\n {\n timeout:(5 * 1000),\n maximumAge:(1000 * 60 * 15),\n enableHighAccuracy:true\n }\n );\n }\n }", "function getLocation(location) {\n\t lat = location.coords.latitude;\n\t lng = location.coords.longitude;\n\t\tgetVenues();\n\t}", "get location () {\n\t\treturn this._location;\n\t}", "function getUsersCurrentLocation() {\n\n if (window.navigator && window.navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(success);\n } else {\n console.log(\"Geolocation is not supported by this browser.\");\n }\n\n function success(position) {\n\n console.log(position.coords.latitude + position.coords.longitude);\n\n var currentImg = {\n url: \"./Assets/Images/currentLocationMarker.png\", // url\n scaledSize: new google.maps.Size(40, 50), // scaled size\n origin: new google.maps.Point(0,0), // origin\n anchor: new google.maps.Point(0, 0) // anchor\n };\n\n var userLatLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);\n new google.maps.Marker({\n position: userLatLng,\n title: 'Me',\n map: map,\n icon: currentImg\n });\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n let newLocation = navigator.geolocation.getCurrentPosition(function (\n position\n ) {\n lat = position.coords.latitude;\n long = position.coords.longitude;\n console.log(position);\n console.log(lat);\n console.log(long);\n });\n }\n}", "function getLocation() {\n window.navigator.geolocation.getCurrentPosition((location) => {\n userLat = location.coords.latitude;\n userLon = location.coords.longitude;\n checkParkCoord();\n })\n }", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n location.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n }", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(recordPosition);\n } else { \n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n}", "function getGeoLocation() {\n showPage('results');\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(returnedPosition) {\n let position = {};\n position.longitude = returnedPosition.coords.longitude;\n position.latitude = returnedPosition.coords.latitude;\n getCityByLocation(position);\n });\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(setPosition);\n } else {\n console.log(\"Geolocation is not supported by this browser.\");\n }\n }", "function getLocation() {\n     if (navigator.geolocation) {\n // showPosition is a reference to a JS function below\n         navigator.geolocation.getCurrentPosition(showPosition);\n     }\n }", "function getLocalizacao() {\r\n \r\n if(navigator.geolocation){ \r\n navigator.geolocation.getCurrentPosition(mapSetup);\r\n }\r\n}", "async getLocation() {\n const location = await Location.getCurrentPositionAsync({ enableHighAccuracy: true });\n return {\n \"latitude\": location.coords.latitude, \n \"longitude\": location.coords.longitude, \n \"latitudeDelta\": 0.04,\n \"longitudeDelta\": 0.05 \n };\n }", "function getLocation(){\n\tvar geolocation = navigator.geolocation;\n\t\tconsole.log(geolocation);\n\tgeolocation.getCurrentPosition(showLocation,errorHandler);\n\tconsole.log(geolocation);\n}", "getPlaceLocationInfo(selectedData) {\n if (this.settings.useGoogleGeoApi) {\n this._googlePlacesService.getGeoPlaceDetail(selectedData.place_id).then((data) => {\n if (data) {\n this.setRecentLocation(data);\n }\n });\n }\n else {\n this._googlePlacesService.getPlaceDetails(this.settings.geoLocDetailServerUrl, selectedData.place_id).then((result) => {\n if (result) {\n result = this.extractServerList(this.settings.serverResponseDetailHierarchy, result);\n this.setRecentLocation(result);\n }\n });\n }\n }", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition, showLocationError);\n \n } else { \n showMessage('Cannot acquire location','Geolocation is not supported by this browser.');\n ga('send', 'event', mode + '-getLocation', 'failure', 'failure');\n }\n}", "function getCoords(location) {\n const latitude = location.coords.latitude;\n const longitude = location.coords.longitude;\n const id = \"location1\";\n\n fetchCurrentWeather(latitude, longitude, id);\n}", "function getLocation() {\n\tif (navigator.geolocation) {\n\t\t// 1. Get current position and set latitude and longitude accordingly\n\t\tnavigator.geolocation.getCurrentPosition((data) => {\n\t\t\tconst { latitude, longitude } = data.coords;\n\n\t\t\t// 2. Make GET request based on geolocation info and set HTML content based on response\n\t\t\tfetchWeather(latitude, longitude);\n\t\t});\n\t} else {\n\t\tmessage.innerHTML = 'Geolocation is not supported by this browser.';\n\t}\n}", "function getCurrentLocation() {\n // var location;\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(pos) {\n var location = {\n lat: pos.coords.latitude,\n lng: pos.coords.longitude\n };\n\n return location;\n }, handleError);\n } else {\n displayErrorMessage(\"Geolocation failed, using default coordinates.\");\n return defaultCoords;\n }\n\n function handleError(error) {\n switch (error.code) {\n case error.PERMISSION_DENIED:\n displayErrorMessage(\"User denied the request for Geolocation.\");\n break;\n case error.POSITION_UNAVAILABLE:\n displayErrorMessage(\"Location information is unavailable.\");\n break;\n case error.TIMEOUT:\n displayErrorMessage(\"The request to get user location timed out.\");\n break;\n case error.UNKNOWN_ERROR:\n displayErrorMessage(\"An unknown error occurred.\");\n break;\n }\n }\n}", "function getLocation() {\n if (navigator.geolocation) {\n console.log(\"Geo Location enabled\");\n navigator.geolocation.getCurrentPosition(success, error, options);\n } else {\n console.log(\"Geo Location not supported by browser\");\n }\n }", "function getGeoLocation() {\n \"use strict\";\n var cords = [];\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n cords.push(position.coords.latitude);\n cords.push(position.coords.longitude);\n //When you take them, use them to find the weather\n getWeatherFromCords(cords);\n });\n }\n}", "function getLocation(entry) {\n return entry.getValue('location');\n }", "function getCurrentPosition(callback) {\n\t//Import sensor for your location\n\t// document.write(\"<script type='text/javascript' src='http://maps.google.com/maps/api/js?libraries=places&sensor=true'></script>\");\n\n\n\tvar currentposition = new google.maps.LatLng(0.0, 0.0);\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition (function(pos) {\n\t\t\treverseGeocodeAddress(pos.coords.latitude, pos.coords.longitude, function(address) {\n\t\t\t\tcallback(address);\n\t\t\t});\n\t\t});\n\t} else {\n\t\tcallback(currentposition);\n\t}\n}", "function getLocation() {\n\tif(navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(geoPosition, geoError, {enableHighAccuracy:true, timeout:30000, maximumAge:60000 }\n);\n\t} else {\n\t\tgeoError();\n\t}\n}", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition, error);\n } else {\n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n}", "function getCurrentGeoPosition() {\r\n if(navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(function (position) {\r\n fetchWeatherDataGeo(position.coords.latitude, position.coords.longitude);\r\n });\r\n } else {\r\n alert('Your browser does not support Geolocation API!');\r\n }\r\n}", "function getBrowserLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n console.log(\"Get Browser Location error\");\n };\n}", "function currentCoord() {\n\treturn game_data.village.coord;\n}", "function getLocation() {\n console.log('start getLocation');\n\tif(navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(\n\t\t\tfunction (position) {\n\t\t\t\t//do succes handling\n\t\t\t\tshowPosition(position)\n\t\t\t},\n\t\t\tfunction errorCallback(error) {\n\t\t\t\t//do error handling\n\t\t\t\tmsg = locationError(error)\n\t\t\t\talert(msg)\n\t\t\t},\n\t\t\t{\n\t\t\t\tmaximumAge: 0,\n\t\t\t\ttimeout: 5000,\n\t\t\t\tenableHighAccuracy: true\n\t\t\t}\n\t\t);\n\t}\n}", "function getUserLocation() {\r\n\t// Global variable\r\n\r\n\tif (navigator.geolocation) {\r\n\t\tnavigator.geolocation.getCurrentPosition(showPosition, showError);\r\n\t} else {\r\n\t\tuserLocation.innerHTML = \"Your browser does not support this feature.\";\r\n\t}\r\n}", "function getLocation(){\n\tconsole.log('Getting Users Location...');\n\n\tnavigator.geolocation.getCurrentPosition(function(position){\n\t\tconsole.log(1111111111111111);\n\t\tvar lat = position.coords.latitude;\n\t\tvar lon = position.coords.longitude;\n\t\tvar city = '';\n\t\tvar state = '';\n\t\tvar html = '';\n\n\t\t$.ajax({\n\t\t\turl: 'https://maps.googleapis.com/maps/api/geocode/json?latlng='+lat+','+lon,\n\t\t\tdatatype: 'jsonp',\n\t\t\tsuccess: function(response){\n\t\t\t\tcity = response.results[0].address_components[2].long_name;\n\t\t\t\tstate = response.results[0].address_components[4].short_name;\n\n\t\t\t\thtml = '<h1>'+city+', '+state+'</h1>';\n\n\t\t\t\t$('#myLocation').html(html);\n\n\t\t\t\t// Get Weather Info\n\t\t\t\tgetWeather(city, state);\n\n\t\t\t\t$('#show_more_weather').click(function(e){\n\t\t\t\t\te.preventDefault();\n\n\t\t\t\t// Close Dropdown Menu\n\t\t\t\t$('.navbar-toggle').click();\n\n\t\t\t\t\tgetMoreWeather(city, state);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}, function(err){\n\t\tconsole.warn('ERROR(' + err.code + '): ' + err.message);\n\t});\n}", "function get_current_location(callback) {\r\n if (navigator.geolocation) \r\n {\r\n // Location callback\r\n navigator.geolocation.getCurrentPosition(function (position) { \r\n var latitude=position.coords.latitude;\r\n var longitude=position.coords.longitude;\r\n if (callback != undefined) {\r\n callback(latitude, longitude);\r\n }\r\n }, function () {\r\n // Error callback\r\n alert('Your position is unavailable at this time.');\r\n });\r\n }\r\n}", "function getLocation()\n {\n if(navigator.geolocation)\n {\n geoLoc = navigator.geolocation;\n watchID = geoLoc.watchPosition(showLocation, errorHandler);\n }\n else\n {\n console.log(\"sorry, browser does not support geolocation!\");\n }\n }", "getLocation() {\n navigator.geolocation.getCurrentPosition((position) => {\n this.setState({lat: position.coords.latitude, lon: position.coords.longitude});\n // if successful, proceed to make API request\n this.getCurrent();\n }, (error) => this.setState({errorMessage: error}))\n }", "function getLocation() {\r\n\tif(navigator.geolocation) {\r\n\t\tnavigator.geolocation.getCurrentPosition(storePosition);\r\n\t} else {\r\n\t\t$('#location').html('Not supported.');\r\n\t}\t\t\r\n}", "function getLocation()\n {\n if (navigator.geolocation)\n {\n navigator.geolocation.getCurrentPosition(showPosition,showError);\n }\n else{x.innerHTML=\"Geolocation is not supported by this browser.\";}\n }", "getBrowserLocation(callback) {\n navigator.geolocation.getCurrentPosition(locationData => {\n let userLocation = this.props.userLocation;\n\n if (locationData && locationData.coords) {\n const {\n longitude,\n latitude,\n } = locationData.coords;\n\n userLocation = [latitude, longitude];\n }\n\n callback(userLocation);\n });\n }", "function onGeolocationSuccess(position) { \n currentLat = position.coords.latitude;\n currentLong = position.coords.longitude;\n}", "function getLocationForCurrentManager(index) {\n return managerData[currentManager].locations[index];\n }", "function getCurrentWeather() {\n \tvar dataObj = {\n \t\tlat: '',\n \t\tlon: '',\n \t\tAPPID: '923ac7c7344b6f742666617a0e4bd311',\n \t\tunits: 'metric'\n \t}\n }", "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n}", "function getLocalWeather() {\n navigator.geolocation.getCurrentPosition(showPosition);\n}", "function naviPosition() {\n navigator.geolocation.getCurrentPosition(getCoordinates);\n}", "function getLocationData() {\n const url = 'https://ipinfo.io/json?token=08f12254167956';\n return fetch(url).then((result) => result.json());\n}", "function getData() {\n navigator.geolocation.getCurrentPosition(function(position) {\n // Gets the latitude and longitude coordinates and displays them to the user\n let latitude = position.coords.latitude;\n let longitude = position.coords.longitude;\n coordinatesElem.innerHTML = \"Latitude: \" + latitude.toString().substring(0, 10) + \"<br>Longitude: \" + longitude.toString().substring(0, 10);\n getElevation(latitude, longitude);\n });\n}" ]
[ "0.7286039", "0.71908706", "0.7152735", "0.7148169", "0.71307313", "0.71043324", "0.70790267", "0.7006134", "0.70034903", "0.69885075", "0.6959577", "0.69345903", "0.69285995", "0.69171876", "0.69151944", "0.6887525", "0.68814385", "0.687113", "0.6867752", "0.685529", "0.684924", "0.6847105", "0.682634", "0.6818246", "0.6816404", "0.6808469", "0.67942727", "0.6763613", "0.6763613", "0.67581564", "0.67475086", "0.6742615", "0.6741078", "0.67400753", "0.6734819", "0.67293316", "0.67254466", "0.67104155", "0.6708208", "0.6692651", "0.6656188", "0.665414", "0.665414", "0.66462326", "0.6635713", "0.6618191", "0.66159606", "0.6612908", "0.6612908", "0.6612908", "0.6604945", "0.65958416", "0.65937114", "0.659371", "0.6584274", "0.6582565", "0.65810597", "0.65789247", "0.6577561", "0.6575673", "0.6560815", "0.65583247", "0.65466726", "0.6546254", "0.6539495", "0.653513", "0.6532235", "0.65285397", "0.6528476", "0.6528466", "0.65251553", "0.6519608", "0.6516291", "0.65121174", "0.6493354", "0.6483183", "0.64799076", "0.64770854", "0.6475159", "0.6474833", "0.6466848", "0.6463735", "0.64584476", "0.6443202", "0.6442102", "0.64409035", "0.6433926", "0.64297867", "0.6422798", "0.64214975", "0.6415381", "0.6411697", "0.6408743", "0.6402133", "0.63996196", "0.6392085", "0.63853663", "0.63849556", "0.6379446", "0.6376656", "0.63753766" ]
0.0
-1
const testDiv=dom.find('test')[0]const test2=dom.find('test2')[0] console.log(testDiv)/console.log(dom.find('.red',test2)[0])
parent(node) { return node.parentNode }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findDiv(obj){\n\twhile(obj.nodeName != 'DIV'){\n\t\t\tobj = obj.nextSibling;\n\t}\n\treturn obj;\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n }", "function getDivFromId(html){\n var foundDive = '';\n return div;\n}", "function getEl (mix,arr) {\n\tlet result = document.querySelectorAll(mix);\n\tif (result.length < 2 && arr != \"1\") {\n\t\treturn result[0];\n\t}\n\treturn result;\n}", "findChild(el, query) {\n const matches = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;\n return Array.prototype.filter.call(el.children, child => matches.call(child, query))[0];\n }", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function findOneChild(test, nodes) {\n return nodes.find(test);\n}", "function myDOM4() {\n var x = document.querySelectorAll(\"p.demo17\");\n document.getElementById(\"demo16\").innerHTML =\n \"The first paragraph(index 0) with class='demo17': \" + x[0].innerHTML;\n}", "findChild(el, query) {\n const matches =\n el.matches ||\n el.webkitMatchesSelector ||\n el.mozMatchesSelector ||\n el.msMatchesSelector;\n return Array.prototype.filter.call(el.children, child =>\n matches.call(child, query)\n )[0];\n }", "function deepestChild(){\n return document.querySelectorAll('div#grand-node div')[3];\n }", "function $(q, root, single, context) {\r\n\t\troot = root || document;\r\n\t\tcontext = context || root;\r\n\t\tif (q[0] == '#')\r\n\t\t\treturn root.getElementById(q.substr(1));\r\n\t\telse if (q.match(/^\\/|^\\.\\//)) {\r\n\t\t\tif (single)\r\n\t\t\t\treturn root.evaluate(q, context, null, 9, null).singleNodeValue;\r\n\t\t\tvar arr = [];\r\n\t\t\tvar xpr = root.evaluate(q, context, null, 7, null);\r\n\t\t\tfor ( var i = 0, l = xpr.snapshotLength; i < l; i++)\r\n\t\t\t\tarr.push(xpr.snapshotItem(i));\r\n\t\t\treturn arr;\r\n\t\t} else if (q[0] == '.')\r\n\t\t\treturn root.getElementsByClassName(q.substr(1));\r\n\t\treturn root.getElementsByTagName(q);\r\n\t}", "getElem(jqOrElem) {\n if (jqOrElem instanceof $) {\n return jqOrElem[0];\n } else {\n return jqOrElem;\n }\n }", "function __getReal($dom, $attr, $value) {\r\n while (($dom != null) && ($dom.tagName != \"BODY\")) {\r\n if ($dom.getAttribute($attr) == $value) {\r\n return $dom;\r\n }\r\n $dom = $dom.parentElement;\r\n }\r\n return null;\r\n}", "function _(elm) { return document.querySelector(elm); }", "function findDottedPersonElementsByClass(str) {\n\tvar personElements = findDottedPerson().children; //returns all the children elements of the dotted div\n\tfor (let element of personElements) {\n\t\tif (element.classList.contains(str)) {\n\t\t\tvar targetElement = element;\n\t\t}\n\t} return targetElement;\n}", "function nestedTarget(){\n return document.querySelector('#nested .target')\n }", "function findContainer() {\n if (guid) {\n $container = $j('.jive-content-rating[data-guid=\"'+ guid +'\"]');\n } else {\n $container = $j('#jive-content-rating');\n }\n }", "function getPosition(div, oldelement) {\n var position;\n\n for (let i = 0; i < div.childElementCount; i++) {\n if (div.children[i] == oldelement) {\n position = i\n //console.log(div.children[i])\n }\n }\n\n return position;\n}", "function q (el) {\n if (typeof el === 'string') return document.querySelector(el)\n else if (typeof el === 'object' && el[0]) return el[0]\n else return el\n}", "function $(query){\n var q = document.querySelectorAll(query);\n return q.length > 1 ? q : q[0];\n}", "function div(content){ return elem(\"div\", content); }", "function div(content){ return elem(\"div\", content); }", "function test3() {\n console.log($('li:first(\"new\")'));\n}", "function query(el){if(typeof el==='string'){var selected=document.querySelector(el);if(!selected){\"development\"!=='production'&&warn('Cannot find element: '+el);return document.createElement('div');}return selected;}else{return el;}}", "function query(el){if(typeof el==='string'){var selected=document.querySelector(el);if(!selected){\"development\"!=='production'&&warn('Cannot find element: '+el);return document.createElement('div');}return selected;}else{return el;}}", "function findReact(dom) {\r\n\t\treturn dom[Object.keys(dom).find(a=>a.startsWith(\"__reactInternalInstance$\"))].return.stateNode;\r\n\t}", "function domFind(el, tag) {\n tag = tag.toLowerCase();\n var nodes = el.childNodes, i = 0, n = nodes.length;\n for (; i<n; ++i) if (nodes[i].tagName.toLowerCase() === tag) {\n return nodes[i];\n }\n }", "function extractPlayerOfMatch(html){\n let selectorTool= cheerio.load(html);\n let playerOfMatchEle= selectorTool(`.best-player-content`);\n let playerName= playerOfMatchEle.text();\n console.log(playerName);\n \n}", "static findFromDOM(dom) {\n var _a;\n let content = dom.querySelector(\".cm-content\");\n let cView = content && ContentView.get(content) || ContentView.get(dom);\n return ((_a = cView === null || cView === void 0 ? void 0 : cView.rootView) === null || _a === void 0 ? void 0 : _a.view) || null;\n }", "static getChild(el, klass) {\n if (el == null)\n return null;\n for (let node = el.firstElementChild; node != null; node = node === null || node === void 0 ? void 0 : node.nextElementSibling) {\n if (Dom.hasClass(node, klass))\n return node;\n }\n return null;\n }", "function query(el){if(typeof el==='string'){var selector=el;el=document.querySelector(el);if(!el){\"development\"!=='production'&&warn('Cannot find element: '+selector);return document.createElement('div');}}return el;}", "function _findElements(domRoot) {\n\t\tlet items = Array.from(domRoot.querySelectorAll(`[${DOM_SELECTOR}]`));\n\t\tif (domRoot.hasAttribute(DOM_SELECTOR)) {\n\t\t\titems.push(domRoot);\n\t\t}\n\n\t\titems.forEach(function (item) {\n\t\t\tif (!item[DOM_ATTRIBUTE]) {\n\t\t\t\titem[DOM_ATTRIBUTE] = new _constructor(item);\n\t\t\t}\n\t\t});\n\t}", "function find(inst, test) {\n if (!inst || !inst.getPublicInstance) {\n return [];\n }\n var publicInst = inst.getPublicInstance() || inst._instance;\n var ret = publicInst && test(publicInst) ? [publicInst] : [];\n var currentElement = inst._currentElement;\n if (type.isDOMComponent(publicInst)) {\n var renderedChildren = inst._renderedChildren;\n var key;\n for (key in renderedChildren) {\n if (!renderedChildren.hasOwnProperty(key)) {\n continue;\n }\n ret = ret.concat(\n find(\n renderedChildren[key],\n test\n )\n );\n }\n } else if (\n type.isValidElement(currentElement) &&\n typeof currentElement.type === 'function'\n ) {\n ret = ret.concat(\n find(inst._renderedComponent, test)\n );\n }\n return ret;\n}", "function find($parent, css) {\n\tvar $el = $parent.find(css).first()\n\tif ($el.length == 0)\n\t\tthrow 'no child element with selector [' + css + ']'\n\t\t+ ' found in parent ' + $parent.attr('id')\n\treturn $el\n}", "function findOne(test, nodes, recurse) {\n if (recurse === void 0) {\n recurse = true;\n }\n var elem = null;\n for (var i = 0; i < nodes.length && !elem; i++) {\n var checked = nodes[i];\n if (!tagtypes_1.isTag(checked)) {\n continue;\n } else if (test(checked)) {\n elem = checked;\n } else if (recurse && checked.children.length > 0) {\n elem = findOne(test, checked.children);\n }\n }\n return elem;\n }", "function testFunction(node){\n console.log(`${node.nodeName} tag with ${node.childNodes.length} children and style: ${node.style}`);\n return;\n}", "function getDom(el) {\n return document.querySelector(el)\n}", "function domFind(el, tag) {\n tag = tag.toLowerCase();\n var nodes = el.childNodes, i = 0, n = nodes.length;\n for (; i<n; ++i) if (nodes[i].tagName.toLowerCase() === tag) {\n return nodes[i];\n }\n}", "function domFind(el, tag) {\n tag = tag.toLowerCase();\n var nodes = el.childNodes, i = 0, n = nodes.length;\n for (; i<n; ++i) if (nodes[i].tagName.toLowerCase() === tag) {\n return nodes[i];\n }\n}", "function _( el )\n{\n return document.querySelector( el );\n}", "function getOtherChild(element) {\r\n\tvar element = $(element);\r\n\tvar parent = element.parent();\r\n\tvar children = divChildren(parent);\r\n\tvar other;\r\n\tif(children[0] == element[0])\r\n\t\tother = children[1];\r\n\telse\r\n\t\tother = children[0];\r\n\r\n\tother = $(other);\r\n\treturn other;\r\n}", "function getElement(e, type){\n\t\tif(e.tagName && e.tagName == type){\n\t\t\tvar el = $(e);\n\t\t}else{\n\t\t\te.stop();\n\t\t\tvar el = e.findElement(type);\n\t\t}\n\t\treturn el;\n\t}", "function $(query){\n\treturn document.querySelector(query);\n}", "function find() {}", "function $$$(query, ele) {\n if (!ele) {\n ele = document;\n }\n return ele.querySelector(query);\n}", "function $$$(query, ele) {\n if (!ele) {\n ele = document;\n }\n return ele.querySelector(query);\n}", "function test2() {\n console.log($('li:not(\"#four\")'));\n}", "function getEl(tag) {\n if (tag[0] === '#') {\n // selects by id\n return document.getElementById(tag.slice(1));\n } else if (tag[0] === '.') {\n // selects by class\n return document.getElementsByClassName(tag.slice(1));\n } else {\n // selects by html tag\n return document.querySelector(tag);\n }\n}", "function nom_div(div)\r\n\t{\r\n\t\treturn document.getElementById(div);\r\n\t}", "query (dom, query, options = {}) {\n options = Object.assign({}, { single: false, type: \"nodes\" }, options)\n let result\n if (options.type === \"nodes\")\n result = fontoxpath.evaluateXPathToNodes(query, dom)\n else if (options.type === \"string\")\n result = fontoxpath.evaluateXPathToStrings(query, dom)\n else if (options.type === \"number\")\n result = fontoxpath.evaluateXPathToNumbers(query, dom)\n if (options.single) {\n if (result.length === 0)\n result = undefined\n else if (result.length === 1)\n result = result[0]\n else\n throw new Error(\"requested single result, but multiple nodes found\")\n }\n return result\n }", "function getElement(window, ref) {\n console.log(ref);\n var positions = ref;\n //var positions = ref.split(/,/),\n var elem = window.document.getElementById(\"document\");\n\n while (elem && positions.length) {\n if (positions.length == 1) {\n elem = elem.childNodes[positions.shift()];\n } else {\n elem = elem.children[positions.shift()];\n }\n console.log(positions[0]);\n console.log(elem);\n }\n console.log(positions);\n return elem;\n}", "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return react_dom__WEBPACK_IMPORTED_MODULE_0___default.a.findDOMNode(\n node,\n );\n }", "function el(query) {\n return document.getElementById(query) || document.querySelector(query);\n }", "function first(selector, context) {return (context || document).querySelector(selector);}", "function $(value){\n const result = document.querySelector(value)\n return result\n}", "function nom_div(div)\n\t{\n\t\treturn document.getElementById(div);\n\t}", "function nom_div(div)\n\t{\n\t\treturn document.getElementById(div);\n\t}", "getComponent() {\n return this.querySelector(\"div\");\n }", "function finder(s){\n\t\t\tlet e = element.find('[target='+s+']');\n\t\t\treturn e;\n\t\t}", "function finder(s){\n\t\t\tlet e = element.find('[target='+s+']');\n\t\t\treturn e;\n\t\t}", "function getEl(el) {\n return document.querySelector(el);\n}", "function $DOM(elementHint, elementIndex){\n /* // in case non-css selector gets required \n var first_char = elementHint.match(/^./)[0];\n\tvar rest_chars = elementHint.replace(/^./, ''); */\n \t\n var str_nodes = document.querySelectorAll(elementHint);\n if (elementIndex === undefined) {\n elementIndex = 0;\n }\n\treturn str_nodes[elementIndex];\n}", "$(query) {\n return this.root.querySelector(query);\n }", "function getElement(names) {\n if (typeof names === 'string') {\n names = names.split('.');\n }\n if (names.length === 0) {\n return container;\n }\n const selector = names\n .map((name) => {\n return '[data-element=\"' + name + '\"]';\n })\n .join(' ');\n\n return container.querySelector(selector);\n }", "_getDomFromElement(element) {\n if (element.dom) {\n return element.dom;\n }\n\n if (element.element) {\n // console.log('Legacy ui.Element passed to pcui.Container', this.class, element.class);\n return element.element;\n }\n\n return element;\n }", "function findOne(test, nodes, recurse = true) {\n let elem = null;\n for (let i = 0; i < nodes.length && !elem; i++) {\n const node = nodes[i];\n if (!node_isTag(node)) {\n continue;\n }\n else if (test(node)) {\n elem = node;\n }\n else if (recurse && node.children.length > 0) {\n elem = findOne(test, node.children, true);\n }\n }\n return elem;\n}", "function queryFromDom(selector){\n var current = $paper.find('img#'+lastSelected);\n\n console.log(selector,\n current,\n current.attr(\"id\"),\n current.attr(\"width\"),\n current.position()\n );\n }", "function Dom(seletor) {\n this.element = document.querySelector(seletor);\n}", "function findOne(test, nodes, recurse) {\n if (recurse === void 0) { recurse = true; }\n var elem = null;\n for (var i = 0; i < nodes.length && !elem; i++) {\n var checked = nodes[i];\n if (!tagtypes.isTag(checked)) {\n continue;\n }\n else if (test(checked)) {\n elem = checked;\n }\n else if (recurse && checked.children.length > 0) {\n elem = findOne(test, checked.children);\n }\n }\n return elem;\n}", "findElement(selector) {\n return document.querySelector(selector);\n }", "function findOne(test, nodes, recurse) {\n if (recurse === void 0) { recurse = true; }\n var elem = null;\n for (var i = 0; i < nodes.length && !elem; i++) {\n var checked = nodes[i];\n if (!tagtypes_1.isTag(checked)) {\n continue;\n }\n else if (test(checked)) {\n elem = checked;\n }\n else if (recurse && checked.children.length > 0) {\n elem = findOne(test, checked.children);\n }\n }\n return elem;\n}", "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return react_dom__WEBPACK_IMPORTED_MODULE_0___default().findDOMNode(node);\n}", "function dqs(ele) {\n return document.querySelector(`#${ele}`);\n }", "function getDOMElements(){\r\n return {\r\n squares: Array.from(document.querySelectorAll(\".grid div\")),\r\n firstSquare: function(){ return this.squares[30] },\r\n squaresInActiveGameplace: Array.from(grid.querySelectorAll(\".activegameplace\")),\r\n firstSquareInRow: document.querySelectorAll(\".first-in-row\"),\r\n lastSquareInRow: document.querySelectorAll(\".last-in-row\"),\r\n music: document.getElementById(\"myAudio\")\r\n }\r\n}", "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return react_dom__WEBPACK_IMPORTED_MODULE_0___default.a.findDOMNode(node);\n}", "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return react_dom__WEBPACK_IMPORTED_MODULE_0___default.a.findDOMNode(node);\n}", "querySelector (query) {\n query = query.toUpperCase()\n const iterator = new YXmlTreeWalker(this, element => element.nodeName === query)\n const next = iterator.next()\n if (next.done) {\n return null\n } else {\n return next.value\n }\n }", "function $(id){const el=document.getElementById(id);return el?assertInstanceof(el,HTMLElement):null}", "function find(id){\n var elem = document.getElementById(id);\n return elem;\n}", "function Parsedata(data){\r\n// PAGE==>CHEERIO\r\n let $ = cheerio.load(data);\r\n// SELECTOR SE SELECT THING ==> .TEXT()==> gIVE CONCATENATED STRING OF SELECTED TAG\r\n // let text=$(\"title\").text();\r\n// GIVE THE ARRAY OF WHOLE LASS MATCHES \r\n let Commentarr=$(\".d-flex.match-comment-padder.align-items-center .match-comment-long-text\");\r\n \r\n let text=$(Commentarr[0]).text();\r\n\r\n console.log(text);\r\n}", "function usingQuerySelectorAll() {\n var nestedDivs = document.querySelectorAll('div > div');\n printInElement('Using query selection: ' + nestedDivs.length, true);\n}", "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return react_dom__WEBPACK_IMPORTED_MODULE_0__.findDOMNode(node);\n}", "function query (el) {\n if (typeof el === 'string') {\n var selected = document.querySelector(el);\n if (!selected) {\n \"debug\" !== 'production' && warn(\n 'Cannot find element: ' + el\n );\n return document.createElement('div')\n }\n return selected\n } else {\n return el\n }\n }", "function findOne(test, nodes, recurse) {\n if (recurse === void 0) { recurse = true; }\n var elem = null;\n for (var i = 0; i < nodes.length && !elem; i++) {\n var checked = nodes[i];\n if (!domhandler_1.isTag(checked)) {\n continue;\n }\n else if (test(checked)) {\n elem = checked;\n }\n else if (recurse && checked.children.length > 0) {\n elem = findOne(test, checked.children);\n }\n }\n return elem;\n}", "function findOne(test, nodes, recurse) {\n if (recurse === void 0) { recurse = true; }\n var elem = null;\n for (var i = 0; i < nodes.length && !elem; i++) {\n var checked = nodes[i];\n if (!domhandler_1.isTag(checked)) {\n continue;\n }\n else if (test(checked)) {\n elem = checked;\n }\n else if (recurse && checked.children.length > 0) {\n elem = findOne(test, checked.children);\n }\n }\n return elem;\n}", "function findOne(test, nodes, recurse) {\n if (recurse === void 0) { recurse = true; }\n var elem = null;\n for (var i = 0; i < nodes.length && !elem; i++) {\n var checked = nodes[i];\n if (!domhandler_1.isTag(checked)) {\n continue;\n }\n else if (test(checked)) {\n elem = checked;\n }\n else if (recurse && checked.children.length > 0) {\n elem = findOne(test, checked.children);\n }\n }\n return elem;\n}", "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return __WEBPACK_IMPORTED_MODULE_0_react_dom___default.a.findDOMNode(node);\n}", "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return __WEBPACK_IMPORTED_MODULE_0_react_dom___default.a.findDOMNode(node);\n}", "findChild(tagName) {\n const children = this.getChildren()\n for (let i = 0; i < children.length; i++) {\n const child = children[i]\n if (child.type === tagName) return child\n }\n }", "function secondElement(event){\n const q = event.parentElement;\n var nodes = Array.prototype.slice.call( q.children );\n var nodeIndex = nodes.indexOf(event);\n var sibling;\n if(q.nextElementSibling){\n sibling = q.nextElementSibling;\n }\n if(q.previousElementSibling){\n sibling = q.previousElementSibling;\n }\n return sibling.children[nodeIndex];\n console.log(sibling.children[nodeIndex]);\n\n}", "function findDOMNode$2(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return ReactDOM.default.findDOMNode(node);\n}", "function $(selector){\n return document.querySelector(selector); \n }", "function findColorHTML() {\n let colorToChange = HEXvalue.innerHTML.substring(18, 24);\n console.log(111, colorToChange);\n fetch(`https://www.thecolorapi.com/id?hex=${colorToChange}`)\n .then((response) => {\n return response.json();\n })\n .then((data) => {\n console.log(117, data.hex.value.toLowerCase());\n colorSecondDiv(data);\n setTimeout(function () {\n colorSecondDiv;\n }, 100);\n return data;\n });\n}", "function getValue(dom) {\n document.querySelector(`${dom}`).value;\n}", "function query(el) {\n\t if (typeof el === 'string') {\n\t var selected = document.querySelector(el);\n\t if (!selected) {\n\t process.env.NODE_ENV !== 'production' && warn('Cannot find element: ' + el);\n\t return document.createElement('div');\n\t }\n\t return selected;\n\t } else {\n\t return el;\n\t }\n\t}" ]
[ "0.58055466", "0.5766705", "0.57636005", "0.57591295", "0.5710178", "0.5706812", "0.5706812", "0.5706812", "0.5706812", "0.5706812", "0.5706812", "0.56580675", "0.56580675", "0.56344193", "0.54981434", "0.54804426", "0.5472307", "0.54700834", "0.546232", "0.5446266", "0.54427654", "0.54402876", "0.5427727", "0.541248", "0.539148", "0.53897876", "0.537274", "0.537274", "0.53661317", "0.5351778", "0.5351778", "0.53506297", "0.5348374", "0.53469086", "0.53420866", "0.5314549", "0.5288349", "0.5279189", "0.5272565", "0.52566814", "0.52455884", "0.5244035", "0.5232379", "0.5231922", "0.5231922", "0.5212754", "0.5203057", "0.52011687", "0.518758", "0.51819056", "0.5174109", "0.5174109", "0.51718277", "0.51610965", "0.5152507", "0.5147123", "0.514398", "0.51239157", "0.5106576", "0.51061594", "0.5088166", "0.50878245", "0.50878245", "0.50822", "0.5082014", "0.5082014", "0.50778985", "0.50700456", "0.50665843", "0.5063425", "0.50621176", "0.50466067", "0.50382245", "0.5036791", "0.5033289", "0.5033173", "0.502714", "0.5025517", "0.5023312", "0.5021674", "0.50143564", "0.50143564", "0.5008952", "0.50061846", "0.49919567", "0.49904618", "0.49876362", "0.4977364", "0.49712488", "0.49633", "0.49633", "0.49633", "0.49632868", "0.49632868", "0.49627376", "0.49568585", "0.49568453", "0.49525595", "0.495147", "0.49492532", "0.4944221" ]
0.0
-1
THE END OF DOCUMENT.READY()
function say() { console.log("ok"); return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pageDocReady () {\n\n}", "pageReady() {}", "function DOMReady() {\n }", "onPageReady () {}", "onReady() {}", "function onLoadComplete () {\n // ready = true;\n}", "function ready() {\n if (!isReady) {\n triggerEvent(document, \"ready\");\n isReady = true;\n }\n }", "ready() { }", "ready() { }", "ready() { }", "ready() { }", "ready() { }", "ready() { }", "ready() { }", "ready() { }", "function readyCallBack() {\n}", "function onReady() {\n\t// TODO\n}", "static ready() { }", "function init() {\n documentReady(documentLoaded);\n}", "function initOnDomReady() {}", "onloadend() {}", "function pageFullyLoaded () {}", "function documentReadyFunction() {\n onPageLoadOrResize();\n onPageLoad();\n }", "function completed( event ) {\n\t // readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\t if ( w3c || event.type === LOAD || doc[READYSTATE] === COMPLETE ) {\n\t detach();\n\t ready();\n\t }\n\t }", "function readyStateChange()\n {\n if (document.readyState === \"complete\")\n {\n ready();\n }\n }", "ready() {}", "ready() {}", "ready() {}", "onload() {}", "function edgtfOnDocumentReady() {\n\t edgtfSearchSlideFromHB();\n }", "function setReady() {\n debug.log( arguments.callee.name );\n // Hacky-hacky for Linkinus 2.2 / iOS.\n location.href = 'linkinus-style://styleDidFinishLoading';\n \n scroller.setReady();\n overlay.setReady();\n \n //spam(); // Uncomment for scroll debugging.\n}", "sendPageReady() {}", "function completed() {\n // readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n if (document.addEventListener || event.type === \"load\" || document.readyState === \"complete\") {\n detach();\n jQuery.ready();\n }\n }", "function mkdfOnDocumentReady() {\n mkdfCompareHolder();\n mkdfCompareHolderScroll();\n mkdfHandleAddToCompare();\n }", "function pageReady() {\n legacySupport();\n initSliders();\n }", "function edgtfOnDocumentReady() {\n\t edgtfSearchSlideFromWT();\n }", "ready() {\r\n\t\tsuper.ready();\r\n\t}", "function onLoad()\n{}", "function onDOMReady() {\n // Make sure that the DOM is not already loaded\n if (isReady) return;\n // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).\n if (!document.body) return setTimeout(onDOMReady, 0);\n // Remember that the DOM is ready\n isReady = true;\n // Make sure this is always async and then finishin init\n setTimeout(function() {\n app._finishInit();\n }, 0);\n }", "function edgtfOnDocumentReady() {\n edgtfHeaderBehaviour();\n edgtfSideArea();\n edgtfSideAreaScroll();\n edgtfFullscreenMenu();\n edgtfInitMobileNavigation();\n edgtfMobileHeaderBehavior();\n edgtfSetDropDownMenuPosition();\n edgtfDropDownMenu(); \n edgtfSearch();\n }", "function pageLoaded() {\n\n\t\tvar elHeader = document.getElementsByTagName('header')[0];\n\n\t\telHeader.addEventListener(animationEvent, removeFOUT);\n\n\t\tfunction removeFOUT() {\n\n\t\t\tclassie.add(elHTML, 'ready');\n\t\t\telHeader.removeEventListener(animationEvent, removeFOUT);\n\n\t\t}\n\n\t}", "function onloadHandler(){\n console.info(\"Nick Cage is ready!\");\n // where the magic happens\n replaceAllElements();\n }", "function pageReady() {\n svg4everybody();\n initScrollMonitor();\n initModals();\n }", "function completed() {\n // readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n if (document.addEventListener || window.event.type === \"load\" || document.readyState === \"complete\") {\n detach();\n jQuery.ready();\n }\n }", "function readyHandler() {\n\t\t\tif (!eventUtils.domLoaded) {\n\t\t\t\teventUtils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "function readyHandler() {\n\t\t\tif (!eventUtils.domLoaded) {\n\t\t\t\teventUtils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "function readyHandler() {\n\t\t\tif (!eventUtils.domLoaded) {\n\t\t\t\teventUtils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "function readyHandler() {\n\t\t\tif (!eventUtils.domLoaded) {\n\t\t\t\teventUtils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "function qodefOnDocumentReady() {\n qodefInitQuantityButtons();\n qodefInitButtonLoading();\n qodefInitSelect2();\n\t qodefInitSingleProductLightbox();\n }", "function onDocumentRedy() {\n\t//Init\n\tinitWS();\n\t\n//\tinitButtons();\n//\tupdateButtons();\n//\tsetInterval(updateButtons, 3000);\n\n}", "function onLoadComplete() {\n}", "onEnterDOM() {}", "function init() {\n // THIS IS THE CODE THAT WILL BE EXECUTED ONCE THE WEBPAGE LOADS\n }", "function domReady() {\n // Make sure that the DOM is not already loaded\n if (!isReady) {\n // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).\n if ( !doc.body ) {\n return setTimeout( domReady, 1 );\n }\n // Remember that the DOM is ready\n isReady = true;\n // If there are functions bound, to execute\n domReadyCallback();\n // Execute all of them\n }\n} // /ready()", "function mkdfOnDocumentReady() {\n\t\tmkdfInitFullScreenSections();\n\t}", "function mkdfOnDocumentReady() {\n mkdfPropertyAddToWishlist();\n mkdfShowHideEnquiryForm();\n mkdfSubmitEnquiryForm();\n mkdfAddEditProperty();\n mkdfMortgageCalculator();\n mkdfDeleteProperty();\n }", "function ready(callback){\n // in case the document is already rendered\n if (document.readyState!='loading') callback();\n // modern browsers\n else if (document.addEventListener) document.addEventListener('DOMContentLoaded', callback);\n // IE <= 8\n else document.attachEvent('onreadystatechange', function(){\n if (document.readyState=='complete') callback();\n });\n}", "function edgtfOnDocumentReady() {\n\t\tedgtfButton().init();\n\t}", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "function eltdfOnDocumentReady() {\n eltdfQuestionHint();\n eltdfQuestionCheck();\n eltdfQuestionChange();\n eltdfQuestionAnswerChange();\n }", "function pageReady() {\n\tupdateUUID();\n\tadaptButtons();\n}", "function completed() {\n\n // readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n if ( document.addEventListener ||\n window.event.type === \"load\" ||\n document.readyState === \"complete\" ) {\n\n detach();\n jQuery.ready();\n }\n }", "function qodeOnDocumentReady() {\n \tqodeInitNewsShortcodesFilter();\n qodeNewsInitFitVids();\n qodeInitSelfHostedVideoAudioPlayer();\n qodeSelfHostedVideoSize();\n }", "function ready() {\n if (!readyFired) {\n // this must be set to true before we start calling callbacks\n readyFired = true;\n for (var i = 0; i < readyList.length; i++) {\n // if a callback here happens to add new ready handlers,\n // the docReady() function will see that it already fired\n // and will schedule the callback to run right after\n // this event loop finishes so all handlers will still execute\n // in order and no new ones will be added to the readyList\n // while we are processing the list\n readyList[i].fn.call(window, readyList[i].ctx);\n }\n // allow any closures held by these functions to free\n readyList = [];\n }\n}", "function ready() {\r\n if (!readyFired) {\r\n // this must be set to true before we start calling callbacks\r\n readyFired = true;\r\n for (var i = 0; i < readyList.length; i++) {\r\n // if a callback here happens to add new ready handlers,\r\n // the docReady() function will see that it already fired\r\n // and will schedule the callback to run right after\r\n // this event loop finishes so all handlers will still execute\r\n // in order and no new ones will be added to the readyList\r\n // while we are processing the list\r\n readyList[i].fn.call(window, readyList[i].ctx);\r\n }\r\n // allow any closures held by these functions to free\r\n readyList = [];\r\n }\r\n }", "function $w_completed() {\r\n\tconsole.log(\"$w_completed\");\r\n\tif ($d.addEventListener || event.type === \"load\" || $d.readyState === \"complete\" ) {\r\n\t\t$w_detach();\r\n\t\tif(!Whaty.isReady){\r\n\t\t\tconsole.log(\"Whaty.isReady---:\"+Whaty.isReady);\r\n\t\t\tWhaty.isReady = true;\r\n\t\t\t$w_init();\r\n\t\t}\r\n\t}\r\n}", "function init()\n {\n $(document).on(\"loaded:everything\", runAll);\n }", "function qodefOnDocumentReady() {\n\t\tqodefInitItemShowcase();\n\t}", "onLoad() { }", "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed);window.removeEventListener(\"load\",completed);jQuery.ready();}// Catch cases where $(document).ready() is called", "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed);window.removeEventListener(\"load\",completed);jQuery.ready();}// Catch cases where $(document).ready() is called", "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed);window.removeEventListener(\"load\",completed);jQuery.ready();}// Catch cases where $(document).ready() is called", "function completed(){document.removeEventListener(\"DOMContentLoaded\",completed);window.removeEventListener(\"load\",completed);jQuery.ready();}// Catch cases where $(document).ready() is called", "function completed() {\n\n // readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n if (document.addEventListener ||\n window.event.type === \"load\" ||\n document.readyState === \"complete\") {\n\n detach();\n jQuery.ready();\n }\n }", "function completed() {\n\n // readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n if (document.addEventListener ||\n window.event.type === \"load\" ||\n document.readyState === \"complete\") {\n\n detach();\n jQuery.ready();\n }\n }", "function completed() {\n // readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n if ( document.addEventListener || event.type === \"load\" || document.readyState === \"complete\" ) {\n detach();\n jQuery.ready();\n }\n }", "function mkdfOnDocumentReady() {\n\t\tmkdfScrollingImage();\n\t}", "function onPageLoaded() {\n}", "function ready() {\n if (!readyFired) {\n // this must be set to true before we start calling callbacks\n readyFired = true;\n for (var i = 0; i < readyList.length; i++) {\n // if a callback here happens to add new ready handlers,\n // the docReady() function will see that it already fired\n // and will schedule the callback to run right after\n // this event loop finishes so all handlers will still execute\n // in order and no new ones will be added to the readyList\n // while we are processing the list\n readyList[i].fn.call(window, readyList[i].ctx);\n }\n // allow any closures held by these functions to free\n readyList = [];\n }\n }", "onLoad() {}", "function whenDocumentReady(callback, doc) {\r\n if (!isDocumentReady(doc)) {\r\n var checkReady = function() {\r\n if (doc.readyState === 'complete' || \r\n doc.readyState === requiredReadyState) {\r\n doc.removeEventListener(READY_EVENT, checkReady);\r\n whenDocumentReady(callback, doc);\r\n }\r\n }\r\n doc.addEventListener(READY_EVENT, checkReady);\r\n } else if (callback) {\r\n callback();\r\n }\r\n}", "function completed() {\r\n\r\n\t\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\r\n\t\tif (document.addEventListener ||\r\n\t\t\twindow.event.type === \"load\" ||\r\n\t\t\tdocument.readyState === \"complete\") {\r\n\r\n\t\t\tdetach();\r\n\t\t\tjQuery.ready();\r\n\t\t}\r\n\t}", "function pageReady() {\n legacySupport();\n\n updateHeaderActiveClass();\n initHeaderScroll();\n\n setLogDefaultState();\n setStepsClasses();\n _window.on('resize', debounce(setStepsClasses, 200))\n\n initMasks();\n initValidations();\n initSelectric();\n initDatepicker();\n\n _window.on('resize', debounce(setBreakpoint, 200))\n }", "function ready() {\n if (!readyFired) {\n // this must be set to true before we start calling callbacks\n readyFired = true;\n for (var i = 0; i < readyList.length; i++) {\n // if a callback here happens to add new ready handlers,\n // the docReady() function will see that it already fired\n // and will schedule the callback to run right after\n // this event loop finishes so all handlers will still execute\n // in order and no new ones will be added to the readyList\n // while we are processing the list\n readyList[i].fn.call(window, readyList[i].ctx);\n }\n // allow any closures held by these functions to free\n readyList = [];\n }\n}", "function eltdfOnDocumentReady() {\n eltdfHeaderBehaviour();\n eltdfSideArea();\n eltdfSideAreaScroll();\n eltdfFullscreenMenu();\n eltdfInitDividedHeaderMenu();\n eltdfInitMobileNavigation();\n eltdfMobileHeaderBehavior();\n eltdfSetDropDownMenuPosition();\n eltdfDropDownMenu();\n eltdfSearch();\n eltdfVerticalMenu().init();\n }", "onLoad () {}", "function audioEditorDocumentReady() {\n audioEditorDocumentReadyPreview();\n audioEditorDocumentReadyCutters();\n audioEditorDocumentReadyGeneral();\n}", "function mkdOnDocumentReady() {\n\t mkdIconWithHover().init();\n\t mkdIEversion();\n\t mkdInitAnchor().init();\n\t mkdInitBackToTop();\n\t mkdBackButtonShowHide();\n\t mkdInitSelfHostedVideoPlayer();\n\t mkdSelfHostedVideoSize();\n\t mkdFluidVideo();\n\t mkdOwlSlider();\n\t mkdPreloadBackgrounds();\n\t mkdPrettyPhoto();\n mkdInitCustomMenuDropdown();\n }", "ready() {\r\n\t\t// Override this\r\n\t\tthis.updateTitle();\r\n\t}", "function ready() {\n if (!readyFired) {\n // this must be set to true before we start calling callbacks\n readyFired = true;\n for (var i = 0; i < readyList.length; i++) {\n // if a callback here happens to add new ready handlers,\n // the docReady() function will see that it already fired\n // and will schedule the callback to run right after\n // this event loop finishes so all handlers will still execute\n // in order and no new ones will be added to the readyList\n // while we are processing the list\n readyList[i].fn.call(window, readyList[i].ctx);\n }\n // allow any closures held by these functions to free\n readyList = [];\n }\n }", "function ready() {\n if (!readyFired) {\n // this must be set to true before we start calling callbacks\n readyFired = true;\n for (var i = 0; i < readyList.length; i++) {\n // if a callback here happens to add new ready handlers,\n // the docReady() function will see that it already fired\n // and will schedule the callback to run right after\n // this event loop finishes so all handlers will still execute\n // in order and no new ones will be added to the readyList\n // while we are processing the list\n readyList[i].fn.call(window, readyList[i].ctx);\n }\n // allow any closures held by these functions to free\n readyList = [];\n }\n }", "function completed() {\n // readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n if ( document.addEventListener || event.type === \"load\" || document.readyState === \"complete\" ) {\n detach();\n jQuery.ready();\n }\n}", "function completed() {\n // readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n if ( document.addEventListener || event.type === \"load\" || document.readyState === \"complete\" ) {\n detach();\n jQuery.ready();\n }\n}", "function completed() {\n // readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n if ( document.addEventListener || event.type === \"load\" || document.readyState === \"complete\" ) {\n detach();\n jQuery.ready();\n }\n}", "ready() {\n this._root = this._createRoot();\n super.ready();\n this._firstRendered();\n }", "function cb_contentLoaded(cb) {}", "function init() {\n //called when document is fully loaded; your \"main method\"\n}", "function imageEditorDocumentReady() {\n imageEditorDocumentReadyGeneral();\n imageEditorDocumentReadyCrop();\n imageEditorDocumentReadyTexts();\n imageEditorDocumentReadyUndo();\n}" ]
[ "0.7816856", "0.7520798", "0.7399275", "0.73742586", "0.719712", "0.71568376", "0.71178716", "0.71035826", "0.71035826", "0.71035826", "0.71035826", "0.71035826", "0.71035826", "0.71035826", "0.71035826", "0.7045191", "0.7019945", "0.6991388", "0.6991286", "0.6967816", "0.6944398", "0.693279", "0.6930231", "0.6888961", "0.68239", "0.6806155", "0.6806155", "0.6806155", "0.6798873", "0.67882353", "0.6763206", "0.6759213", "0.67563176", "0.67362523", "0.67075044", "0.67029107", "0.67013866", "0.66825753", "0.66474247", "0.66406274", "0.66352457", "0.66315025", "0.6628601", "0.66268474", "0.6605401", "0.6605401", "0.6605401", "0.6605401", "0.6600669", "0.6596197", "0.6591326", "0.65791625", "0.65783674", "0.6576442", "0.6575247", "0.6573761", "0.6571042", "0.6567659", "0.6546816", "0.6546816", "0.6546816", "0.6546816", "0.65409315", "0.6533924", "0.6531099", "0.6522324", "0.6521728", "0.6519321", "0.6510049", "0.65095264", "0.65094215", "0.6509298", "0.6506786", "0.6506786", "0.6506786", "0.6506786", "0.6504327", "0.6504327", "0.6502448", "0.6493498", "0.6486083", "0.6483975", "0.64834696", "0.64833", "0.64811", "0.6471816", "0.64697903", "0.6467162", "0.64655787", "0.6452174", "0.64472", "0.64406145", "0.6436225", "0.6436225", "0.64351666", "0.6429145", "0.6429145", "0.6424981", "0.64208674", "0.6408737", "0.6389336" ]
0.0
-1
Sets and stores a set of preferenes in the PortletPreferences
function pag_setPreferences(setPrefsUrl, namespace, storePrefsUrl) { // Make the request from the arguments var args = pag_setPreferences.arguments; var postRequest = "namespace=" + encodeURIComponent(namespace); for (var i = 3; i < args.length; i += 2) { postRequest += "&name=" + encodeURIComponent(args[i]); postRequest += "&value=" + encodeURIComponent(args[i + 1]); } // Create and send an AJAX request to set the preferences var request = pag_newRequest(); request.open("POST", setPrefsUrl, false); request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); request.send(postRequest); // If there is an error, alert us to it if (request.status != 200) { alert("Error setting preferences: " + request.status); } else { // Make an AJAX request to store the preferences permanently request.open("POST", storePrefsUrl, false); request.send(""); if (request.status != 200) { alert("Error storing preferences: " + request.status); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startPreferences(){\n preferences.set(to_json({\n\t\t\"list\": [\"n\", \"s\", \"o\", \"l1\", \"t1\", \"c1\", \"v\"],\n \"enterprise\": [\"n\", \"s\", \"o\", \"l1\", \"t1\", \"c1\", \"v\"],\n\t\t \"followUp\": [\"ABE.MC\",\"ABG.MC\",\"ACS.MC\",\"ACX.MC\",\"ANA.MC\",\"BBVA.MC\",\"BIBE.MC\",\"BKT.MC\",\"BME.MC\",\"BTL.MC\",\"BTO.MC\",\"CIN.MC\",\"CRI.MC\",\"ELE.MC\",\"ENG.MC\",\"FCC.MC\",\"FER.MC\",\"GAM.MC\",\"GAS.MC\",\"GRF.MC\",\"IBLA.MC\",\"IBR.MC\",\"IDR.MC\",\"ITX.MC\",\"MAP.MC\",\"MTS.MC\",\"OHL\",\"POP.MC\",\"REE.MC\",\"REP.MC\",\"SAB.MC\",\"SAN.MC\",\"SYV.MC\",\"TEF.MC\",\"TRE.MC\"]\n }));\n}", "function savePreferences(){\n var tab0 = panelSettings.getTabByIndex(tabsIndexSettings[\"MarketEnterprise\"]);\n var tab1 = panelSettings.getTabByIndex(tabsIndexSettings[\"EnterpriseInformation\"]);\n\tvar tab2 = panelSettings.getTabByIndex(tabsIndexSettings[\"FollowUp\"]);\n //var tab2 = panelSettings.getTabByIndex(1);\n \n // Salvamos las preferencias de la primera pestaña\n var listRight = tab0.__context[\"listRight\"];\n dictPreferences = {}\n var listAux = ['n', 's'];\n \n for (var i = 0; i < listRight.length; i++) \n listAux[listAux.length] = listRight[i][0];\n \n dictPreferences[\"list\"] = listAux;\n \n // Salvamos las preferencias de la segunda pestaña\n var listRight = tab1.__context[\"listRight\"];\n var listAux = ['n', 's'];\n \n for (var i = 0; i < listRight.length; i++) \n listAux[listAux.length] = listRight[i][0];\n \n\tdictPreferences[\"enterprise\"] = listAux;\n\t\n\tvar listRight = tab2.__context[\"listRight\"];\n\tvar listAux = [];\n\t\n\tfor(var i=0; i < listRight.length; i++)\n\t\tlistAux[listAux.length] = listRight[i][0];\n\t\n \tdictPreferences[\"followUp\"] = listAux;\n preferences.set(to_json(dictPreferences));\n \n\tvar currentTab = panelMain.getTabByIndex(0);\n\tcurrentTab[\"__context\"] = {};\n\tcurrentTab.__context[\"type\"] = 1;\n\tcurrentTab.__context[\"symbols\"] = dictPreferences.followUp;\n\tcurrentTab.__context[\"tags\"] = dictPreferences.list;\n\t\n // Volvemos a la pantalla principal\n displayAlternativeInfo();\n}", "function loadRecommendedPreferences(all) {\n \tfor (var key in recommendedPreferences) {\n \t\tif (!all && /customstyle|actions/.test(key))\n \t\t\tcontinue;\n\n \t\t/*if (Object.isObject(recommendedPreferences[key]))\n \t\t\tpref.setPref(key, Object.union(recommendedPreferences[key], pref.getPref(key)));\n \t\telse*/\n \t\t\tpref.setPref(key, recommendedPreferences[key]);\n \t}\n\n \tcheckActions(true);\n\n \tlog.info(\"prefs:\",\n \t\t\"Some preferences are (re)setted to recommended values.\"\n \t);\n }", "changePreferences(newPreferences){\n this.preferences = newPreferences;\n }", "function setPreferencesOnLocalStore(){\n \n kony.store.setItem(\"preferences\", preferencesArray);\n alert(\"Preferences stored successfully: \" + JSON.stringify(kony.store.getItem(\"preferences\")));\n \n}", "function setFromUserPreferences() {\n var origin = UserPreferences.getPreference('origin');\n var destination = UserPreferences.getPreference('destination');\n\n if (origin && origin.location) {\n typeaheads.origin.setValue(UserPreferences.getPreference('originText'));\n } else {\n typeaheads.origin.setValue('');\n }\n\n if (destination && destination.location) {\n typeaheads.destination.setValue(UserPreferences.getPreference('destinationText'));\n } else {\n typeaheads.destination.setValue('');\n }\n }", "function setDefaultPrefs() {\r\n console.debug(\"setDefaultPrefs CP1\");\r\n let branch = Services.prefs.getDefaultBranch(PREF_BRANCH);\r\n for (let key of Object.keys(PREFS)) {\r\n let val = PREFS[key];\r\n console.debug(\"setDefaultPrefs CP2: key=\" + key + \" val=\" + val);\r\n switch (typeof val) {\r\n case \"boolean\":\r\n branch.setBoolPref(key, val);\r\n break;\r\n case \"string\":\r\n branch.setCharPref(key, val);\r\n break;\r\n }\r\n }\r\n}", "getPreferencesProperties() {\n return this.artboardPreferenceProperties.concat(this.preferenceProperties.slice());\n }", "function SetPreferences(prefId,prefName,udmName,enttdiv,pageType,caption,recordId,userId) \n{\n\tif(!prefId)prefId='';\n\tif(!prefName)prefName='';\n\tif(!udmName)udmName='';\n\tif(!enttdiv)enttdiv='';\n\tif(!pageType)pageType='';\n\tif(!caption)caption='';\n\tif(!recordId)recordId='';\n\tif(!userId)userId='';\n\tif(recordId&&(recordId.indexOf(\".\")>0))\n\t{\n recordId=recordId.replace(/\\,/g,\"\");\n\trecordId=recordId.split(\".\");\n recordId=recordId[0];\n\t}\n var queryString = \"prefId=\" + prefId + \"&prefName=\" + prefName + \"&udmName=\" + udmName + \"&enttdiv=\" + enttdiv + \"&pageType=\" + pageType + \"&caption=\" + caption +\"&recordId=\" + recordId+\"&userId=\" + userId;\n\tmainUrl=zcServletPrefix+\"/custom/JSON/system/changePageLayout.html?\" + queryString;\n\tsetUpPageParameters(mainUrl);\n}", "function savePreferences(prefs) {\n let userProps = PropertiesService.getUserProperties();\n for (let key in prefs)\n userProps.setProperty(key, prefs[key]);\n}", "function savePrefs()\n{\n let preferences = collatePrefs( prefs );\n browser.storage.local.set({\"preferences\": preferences});\n}", "function loadPreferences() {\r\n var xpath = 'id(\"fap_prefs\")//input';\r\n var nodo;\r\n var iterator = findNodes(d, xpath);\r\n while ((nodo = iterator.iterateNext()) != null) {\r\n var valor = getPreference(nodo.name, \"undefined\");\r\n switch (nodo.type) {\r\n case \"checkbox\":nodo.checked = (valor != \"undefined\") ? valor : nodo.checked; break;\r\n //case \"text\":nodo.value = (valor != \"undefined\") ? valor : \"\";break;\r\n case \"radio\":nodo.checked = (valor != \"undefined\") ? (nodo.value == valor) : (nodo.value == \"default\");break;\r\n }\r\n }\r\n }", "function loadPreferencesOnStartup() {\n\t\tthis.language = this.setLanguage();\n\t\tthis.dictionary = window['lang_' + this.language];\n\t\tthis.routingLanguage = this.setRoutingLanguage();\n\t\tthis.distanceUnit = this.setDistanceUnit();\n\t\tthis.version = this.setVersion();\n\n\t\t//return GET variables that have to be applied to other objects\n\t\treturn readGetVars();\n\t}", "getPreferencesProperties() {\n return this.preferenceProperties.slice();\n }", "function lc_savePreferences(prefs){\r\n if(!GM_setValue) return;\r\n for(opt in prefs){\r\n // prefs we do not save\r\n if(/^(debug|styles)$/.test(opt)) continue;\r\n if(typeof prefs[opt] == 'object'){\r\n // loop through objects (as in lc_Prefs.accel.altKey)\r\n for(oopt in prefs[opt]){\r\n GM_setValue(oopt, prefs[opt][oopt]);\r\n }\r\n }else{\r\n GM_setValue(opt, prefs[opt]);\r\n }\r\n }\r\n}", "function load_all_preferences() {\n // load the domains\n load_domains();\n // load the main options\n load_main_options();\n}", "function setPref(id,p) {\n\n\tif (id === \"mtd_core_theme\") {\n\t\treturn;\n\t}\n\n\tif (exists(store)) {\n\t\tstore.set(id,p);\n\t} else {\n\t\tlocalStorage.setItem(id,p);\n\t}\n\n\tif (debugStorageSys)\n\t\tconsole.log(\"setPref \"+id+\" to \"+p);\n}", "function showUserPreferences(compagnia, clima, mezzo, viaggio){\r\n\tif(compagnia != -1) //Se non è specificata, lasciamo il più\r\n\t\tmodifyPreference(COMPAGNIA, compagnia);\r\n\tif(clima != -1)\r\n\t\tmodifyPreference(CLIMA, clima);\r\n\tif(mezzo != -1)\r\n\t\tmodifyPreference(MEZZO, mezzo);\r\n\tif(viaggio != -1) \r\n\t\tmodifyPreference(VIAGGIO, viaggio);\r\n}", "function loadUserPreferences(){\n\t\toptions = getUserPreferences();\n\t}", "function setUserPreferences(version, language, routingLanguage, distanceUnit) {\n\t\t\t//setting version\n\t\t\tvar container = $('#extendedVersionPrefs').get(0);\n\t\t\tcontainer = container.options;\n\t\t\tfor (var i = 0; i < list.version.length; i++) {\n\t\t\t\tif (list.version[i] === version) {\n\t\t\t\t\t//set selected = true\n\t\t\t\t\tcontainer[i].selected = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//setting language\n\t\t\tcontainer = $('#languagePrefs').get(0);\n\t\t\tcontainer = container.options;\n\t\t\tfor (var i = 0; i < list.languages.length; i++) {\n\t\t\t\tif (list.languages[i] === language) {\n\t\t\t\t\t//set selected = true\n\t\t\t\t\tcontainer[i].selected = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//setting routingLanguage\n\t\t\tcontainer = $('#routingLanguagePrefs').get(0);\n\t\t\tcontainer = container.options;\n\t\t\tfor (var i = 0; i < list.routingLanguages.length; i++) {\n\t\t\t\tif (list.routingLanguages[i] === routingLanguage) {\n\t\t\t\t\t//set selected = true\n\t\t\t\t\tcontainer[i].selected = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//setting distanceUnit\n\t\t\tcontainer = $('#unitPrefs').get(0);\n\t\t\tcontainer = container.options;\n\t\t\tfor (var i = 0; i < list.distanceUnitsPreferences.length; i++) {\n\t\t\t\tif (list.distanceUnitsPreferences[i] === distanceUnit) {\n\t\t\t\t\t//set selected = true\n\t\t\t\t\tcontainer[i].selected = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function setPreference(preference){\n \n for (var i = 0; i < preferencesArray.length; i++) {\n \n \tif (preferencesArray[i] == preference){\n preferencesArray.splice(i, 1);\n return;\n }\n \n }\n \n preferencesArray.push(preference);\n \n return;\n \n}", "function loadPreferencePopupData() {\n\t\t//versions\n\t\tvar container = $('#extendedVersionPrefs');\n\t\tfor (var i = 0; i < list.version.length; i++) {\n\t\t\tvar optionElement = new Element('option', {\n\t\t\t\t'value' : i\n\t\t\t});\n\t\t\tif (i == 0) {\n\t\t\t\toptionElement.selected = true;\n\t\t\t}\n\t\t\t$(optionElement).html(p.translate(list.version[i]));\n\t\t\tcontainer.append(optionElement);\n\t\t}\n\t\t//languages\n\t\tcontainer = $('#languagePrefs');\n\t\tfor (var i = 0; i < list.languages.length; i++) {\n\t\t\tvar optionElement = new Element('option', {\n\t\t\t\t'value' : i\n\t\t\t});\n\t\t\tif (i == 0) {\n\t\t\t\toptionElement.selected = true;\n\t\t\t}\n\t\t\t$(optionElement).html(p.translate(list.languages[i]));\n\t\t\tcontainer.append(optionElement);\n\t\t}\n\n\t\t//routing languages\n\t\tcontainer = $('#routingLanguagePrefs');\n\t\tfor (var i = 0; i < list.routingLanguages.length; i++) {\n\t\t\tvar optionElement = new Element('option', {\n\t\t\t\t'value' : i\n\t\t\t});\n\t\t\tif (i == 0) {\n\t\t\t\toptionElement.selected = true;\n\t\t\t}\n\t\t\t$(optionElement).html(p.translate(list.routingLanguages[i]));\n\t\t\tcontainer.append(optionElement);\n\t\t}\n\n\t\t//distance units\n\t\tcontainer = $('#unitPrefs');\n\t\tfor (var i = 0; i < list.distanceUnitsPreferences.length; i++) {\n\t\t\tvar optionElement = new Element('option', {\n\t\t\t\t'value' : i\n\t\t\t});\n\t\t\tif (i == 0) {\n\t\t\t\toptionElement.selected = true;\n\t\t\t}\n\t\t\t$(optionElement).html(list.distanceUnitsInPopup[i]);\n\t\t\tcontainer.append(optionElement);\n\t\t}\n\t}", "function setPreferencesForm(npsetObject) {\n\n\tif (npsetObject.hasOwnProperty('token') && npsetObject.hasOwnProperty('preferences')) {\n\t// The needs and preferences object has a property 'token' and a property 'preferences'\n\n\t\tif (npsetObject['token'] == \"\") {\n\t\t\t// The preferences object is empty and the token is an empty string\n\n\t\t\t/*console.log('set of needs and preferences not stored locally');\n\t\t\tinputFormDiv.style.display = 'block';\n\t\t\tlogInfoDiv.style.display = 'none';\n\n\t\t\ttokenInput.focus();*/\n\t\t\t// chrome.tts.speak(\"Welcome to Cloud For All. Press TAB for options.\");\n\n\t\t} else {\n\t\t\t// Either the token is a valid string or there are actual preferences \n\t\t\tconsole.log('set of needs and preferences stored locally');\n\t\t \n\t\t\t// The preferences object is not empty\n\t\t\tvar preferences = npsetObject['preferences'];\n\t\t\n\t\t\tif (preferences.hasOwnProperty(\"fontSize\")) {\n\t\t\t\tconsole.log(\"FontSize: \" + preferences[\"fontSize\"]);\n\t\t\t\tvar fontSize = preferences[\"fontSize\"];\n\t\t\t\tif(fontSize == \"M\")\n\t\t\t\t{\n\t\t\t\t\tfontSizeHandler(\"M\", \"\", 435, false);\n\t\t\t\t\tfontSizeNormal.checked = true;\n\t\t\t\t} \n\t\t\t\telse if(fontSize == \"L\")\n\t\t\t\t{\n\t\t\t\t\tfontSizeHandler(\"L\", \"large-cp\", 500, false);\n\t\t\t\t\tfontSizeLarge.checked = true;\n\t\t\t\t} \n\t\t\t\telse if(fontSize == \"XL\")\n\t\t\t\t{\n\t\t\t\t\tfontSizeHandler(\"XL\", \"x-large-cp\", 580, false);\n\t\t\t\t\tfontSizeXLarge.checked = true;\n\t\t\t\t} \n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfontSizeHandler(\"M\", \"\", 435, false);\n\t\t\t\tfontSizeNormal.checked = true;\n\t\t\t}\n\t\t\t\n\t\t\tif (preferences.hasOwnProperty(\"fontFace\")) {\n\t\t\t\tconsole.log(\n\t\t\t\t\t\"FONT FACE: \" +\n\t\t\t\t\tpreferences[\"fontFace\"]\n\t\t\t\t);\n\t\t\t\tfontFaceSelect.value = preferences[\"fontFace\"];\n\t\t\t}\n\t\t\t\n\t\t\tif (preferences.hasOwnProperty(\"magnification\")) {\n\t\t\t\tconsole.log(\n\t\t\t\t\t\"MAGNIFICATION: \" +\n\t\t\t\t\tpreferences[\"magnification\"]\n\t\t\t\t);\n\t\t\t\tvar zoomDisplayValue = preferences[\"magnification\"];\n\t\t\t\tzoomDisplayValue = zoomDisplayValue.toFixed(2) * 100;\n\t\t\t\tzoomDisplay.value = zoomDisplayValue + \"%\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tzoomDisplay.value = \"100%\";\n\t\t\t}\n\t\t\t\n\t\t\tif (preferences.hasOwnProperty(\"lineheight\")) {\n\t\t\t\tconsole.log(\n\t\t\t\t\t\"LINEHEIGHT: \" +\n\t\t\t\t\tpreferences[\"lineheight\"]\n\t\t\t\t);\n\t\t\t\tvar lineheightDisplayValue = preferences[\"lineheight\"];\n\t\t\t\tlineheightDisplayValue = lineheightDisplayValue.toFixed(2) * 100;\n\t\t\t\tlinespaceDisplay.value = lineheightDisplayValue + \"%\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlinespaceDisplay.value = \"100%\";\n\t\t\t}\n\t\t\t\t\n\t\t\t//if(!zoomEnableCkecbox.checked) zoomLevel.disabled = true;\n\n\t\t\tif (preferences.hasOwnProperty(\"highContrastEnabled\") && preferences[\"highContrastEnabled\"] == true && preferences.hasOwnProperty(\"backgroundColour\") && preferences.hasOwnProperty(\"foregroundColour\")) {\n\t\t\t\tvar background = preferences[\"backgroundColour\"];\n\t\t\t\tvar foreground = preferences[\"foregroundColour\"];\n\t\t\t\t\n\t\t\t\tif(background == \"#000000\" && foreground == \"#FFFFFF\")\n\t\t\t\t{\n\t\t\t\t\thighContrastWhiteBlack.checked = true;\n\t\t\t\t\thighContrastHandler(\"#000000\", \"#FFFFFF\", \"wbcp\", false);\n\t\t\t\t} \n\t\t\t\telse if(background == \"#FFFFFF\" && foreground == \"#000000\")\n\t\t\t\t{\n\t\t\t\t\thighContrastBlackWhite.checked = true;\n\t\t\t\t\thighContrastHandler(\"#FFFFFF\", \"#000000\", \"bwcp\", false);\n\t\t\t\t} \n\t\t\t\telse if(background == \"#000000\" && foreground == \"#FFFF00\")\n\t\t\t\t{\n\t\t\t\t\thighContrastYellowBlack.checked = true;\n\t\t\t\t\thighContrastHandler(\"#000000\", \"#FFFF00\", \"ybcp\", false);\n\t\t\t\t} \n\t\t\t\telse if(background == \"#FFFF00\" && foreground == \"#000000\")\n\t\t\t\t{\n\t\t\t\t\thighContrastBlackYellow.checked = true;\n\t\t\t\t\thighContrastHandler(\"#FFFF00\", \"#000000\", \"bycp\", false);\n\t\t\t\t} \n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnoHighContrast.checked = true;\n\t\t\t\t\thighContrastHandler(\"\", \"\", \"\", false);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tnoHighContrast.checked = true;\n\t\t\t\thighContrastHandler(\"\", \"\", \"\", false);\n\t\t\t}\n\n\t\t\tif (preferences.hasOwnProperty(\"invertColours\") && preferences[\"invertColours\"] == true) {\n\t\t\t\tconsole.log(\n\t\t\t\t\t\"INVERT COLORS: \" +\n\t\t\t\t\tpreferences[\"invertColours\"]\n\t\t\t\t);\n\t\t\t\tvar inverted = preferences[\"invertColours\"];\n\t\t\t\tinvertColours.checked = inverted;\n\t\t\t\tif(inverted) invertColorHandler(false);\n\t\t\t}\n\t\t\t\n\t\t\tif (preferences.hasOwnProperty(\"synonyms\")) {\n\t\t\t\tconsole.log(\n\t\t\t\t\t\"SYNONYMS: \" +\n\t\t\t\t\tpreferences[\"synonyms\"]\n\t\t\t\t);\n\t\t\t\tvar synonyms = preferences[\"synonyms\"];\n\t\t\t\tinvertColours.checked = synonyms;\n\t\t\t}\n\t\t\t\n\t\t\tif (preferences.hasOwnProperty(\"cursorSize\")) {\n\t\t\t\tconsole.log(\"CursorSize: \" + preferences[\"cursorSize\"]);\n\t\t\t\tvar fontSize = preferences[\"cursorSize\"];\n\t\t\t\tif(fontSize == \"normal\")\n\t\t\t\t{\n\t\t\t\t\tcursorSizeNormal.checked = true;\n\t\t\t\t\thtmlNode.removeAttribute('cs');\n\t\t\t\t} \n\t\t\t\telse if(fontSize == \"large\")\n\t\t\t\t{\n\t\t\t\t\tcursorSizeLarge.checked = true;\n\t\t\t\t\thtmlNode.setAttribute('cs', \"large-cp\");\n\t\t\t\t} \n\t\t\t\telse if(fontSize == \"x-large\")\n\t\t\t\t{\n\t\t\t\t\tcursorSizeXLarge.checked = true;\n\t\t\t\t\thtmlNode.setAttribute('cs', \"x-large-cp\");\n\t\t\t\t} \n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcursorSizeNormal.checked = true;\n\t\t\t\thtmlNode.removeAttribute('cs');\n\t\t\t}\n\t\t\n\t\t} // The preferences object is empty and the token is an empty string\n\t} else {\n\t// The preferences object lacks the token property or the preferences property\n\tconsole.log('The JSON object is not well built');\n\t} \n}", "function loadDefaultPreferences() {\n \tfor (var key in defaultPreferences) {\n \t\t// Skip this ones.\n \t\tif (/firstrun|version|updatechecktime/.test(key))\n \t\t\tcontinue;\n\n \t\tpref.setPref(key, defaultPreferences[key]);\n \t}\n\n \tlog.info(\"prefs:\",\n \t\t\"Preferences are (re)setted to default values.\"\n \t);\n }", "function _ConvertePericias() {\n for (var i = 0; i < gEntradas.pericias.length; ++i) {\n var pericia_personagem = gPersonagem.pericias.lista[gEntradas.pericias[i].chave];\n pericia_personagem.pontos = gEntradas.pericias[i].pontos;\n pericia_personagem.complemento = 'complemento' in gEntradas.pericias[i] ? gEntradas.pericias[i].complemento : '';\n }\n}", "_setPersistedViewSettings() {\n this.settings.setPreferences();\n }", "function setFromUserPreferences() {\n var origin = UserPreferences.getPreference('origin');\n var destination = UserPreferences.getPreference('destination');\n var tourMode = UserPreferences.getPreference('tourMode');\n\n if (origin && origin.location) {\n directions.origin = [origin.location.y, origin.location.x];\n } else if (tourMode === 'tour') {\n // Support using browser history to return to a tour without an origin set\n directions.origin = null;\n directionsFormControl.setStoredLocation('origin', null);\n }\n\n if (destination && destination.location) {\n directions.destination = [destination.location.y, destination.location.x];\n }\n\n if (tabControl.isTabShowing(tabControl.TABS.DIRECTIONS)) {\n // get nearby places if no destination has been set yet, or get directions\n // Fetch tour destinations on tour directions page (re)load\n if (tourMode && destination) {\n showSpinner();\n Places.queryPlaces(null, destination.address).then(function(data) {\n tour = null;\n if (tourMode === 'tour' && data.tours && data.tours.length) {\n tour = _.find(data.tours, function(tour) {\n return tour.name === destination.address;\n });\n if (tour) {\n // Match format of Typeahead response\n tour.id = 'tour_' + tour.id;\n }\n // Reset the tour to update map with user edits to the destinations/order\n tourListControl.resetTour(tour.id);\n } else if (tourMode === 'event' && data.events && data.events.length) {\n tour = data.events[0];\n // Go directly to route for single-destination events\n if (tour.destinations && tour.destinations.length === 1) {\n UserPreferences.setPreference('tourMode', false);\n tour = null;\n tourListControl.resetTour();\n onTypeaheadSelectDone('destination', [data.events[0]]);\n return;\n }\n }\n if (tour) {\n $(options.selectors.reverseButton).hide();\n onTypeaheadSelectDone('destination', tour.destinations);\n } else {\n console.error('Failed to find destinations for tour ' + destination.address);\n planTripOrShowPlaces();\n }\n }).fail(function(error) {\n console.error('Error querying for tour destinations:');\n console.error(error);\n planTripOrShowPlaces();\n });\n } else {\n $(options.selectors.reverseButton).show();\n // Not a tour; go to plan route\n planTripOrShowPlaces();\n }\n } else {\n // explore tab visible\n clearItineraries();\n showPlaces(true);\n }\n }", "getPreferencesData() {\n var data = {};\n var property = \"\";\n var properties = this.getPreferencesProperties();\n var numOfProperties = properties.length;\n\n for (var i=0;i<numOfProperties;i++) {\n property = properties[i];\n data[property] = this[property];\n }\n\n return data;\n }", "function Properties () {\n if (preferencesService.isSet(PREF_PREFIX + 'processing')) {\n // reset to new values\n preferencesService.reset(PREF_PREFIX + 'processing');\n }\n\t try {\n\t\t this.processing = JSON.parse(prefs.processing);\n\t } catch (e) {\n\t\t // erroneous JSON, use default\n\t\t this.processing = {interval: 10, iterations: 40};\n\t }\n\n this.manual = prefs.manual;\n \n\t this.domains = {\n\t\t regexp: prefs.useRegExp,\n\t\t type: prefs.filterMode,\n\t\t list: {white: prefs.whitelist.split(' '),\n\t\t\t black: prefs.blacklist.split(' ')}\n\t };\n\n\t this.style = {\n\t\t text: {override: prefs.overrideTextColor,\n\t\t\t color: prefs.linkColor},\n\t\t background: {override: prefs.overrideBackgroundColor,\n\t\t\t\t\t color: prefs.backgroundColor}\n\t };\n\n\t this.requiredCharacters = prefs.requiredCharacters.split(\"\");\n\n\t this.predefinedRules = {\n\t\t support: {email: {active: prefs.supportEmail,\n useTLD: prefs.emailUseTLD}, \n\t\t\t\t about: {active: prefs.supportAbout},\n\t\t\t\t standard: {active: prefs.supportStandardURLs,\n useSubdomains: prefs.standardURLUseSubdomains,\n useTLD: prefs.standardURLUseTLD,\n linkifyAuthority: prefs.standardURLlinkifyAuthority}},\n\t\t protocols: splitProtocols(prefs.protocols),\n\t\t subdomains: splitSubdomains(prefs.subdomains),\n\t\t excludedElements: splitExcludedElements(prefs.excludedElements), \n\t\t topLevelDomains: splitTopLevelDomains(prefs.useGTLDs ? prefs.gTLDs : undefined,\n prefs.useCcTLDs ? prefs.ccTLDs : undefined,\n prefs.useGeoTLDs ? prefs.geoTLDs : undefined,\n prefs.useCommunityTLDs ? prefs.communityTLDs : undefined, \n prefs.useBrandTLDs ? prefs.brandTLDs : undefined)\n\t };\n\n\t this.customRules = {\n\t\t support: {before: prefs.supportCustomRulesBefore,\n\t\t\t\t after: prefs.supportCustomRulesAfter},\n\t\t rules: JSON.parse(prefs.customRules)\n\t };\n\n\t this.extraFeatures = {\n\t\t support: {inlineElements: prefs.supportInlineElements,\n automaticLinkification: prefs.automaticLinkification},\n\t\t inlineElements: prefs.inlineElements.split(\";\"),\n maxDataSize: prefs.maxDataSize,\n autoLinkification: {delay: prefs.autoLinkificationDelay,\n interval: {active: prefs.autoLinkificationInterval,\n value: prefs.autoLinkificationIntervalValue},\n threshold: {active: prefs.autoLinkificationThreshold,\n value: prefs.autoLinkificationThresholdValue}}\n };\n }", "function PreferencesAssistant() { }", "getPreferencesData() {\n var properties = this.getPreferencesProperties();\n var numOfProperties = properties.length;\n var data = {};\n var property = \"\";\n\n for (var i=0;i<numOfProperties;i++) {\n property = properties[i];\n data[property] = this[property];\n }\n\n return data;\n }", "function loadPreferences() {\n\n\tfor (var key in settingsData) {\n\n\t\tif (!settingsData[key].enum) {\n\t\t\tfor (var i in settingsData[key].options) {\n\t\t\t\tlet prefKey = settingsData[key].options[i].settingsKey;\n\t\t\t\tlet pref = settingsData[key].options[i];\n\n\t\t\t\tif (exists(prefKey)) {\n\t\t\t\t\tvar setting;\n\t\t\t\t\tif (!hasPref(prefKey)) {\n\t\t\t\t\t\tif (debugStorageSys)\n\t\t\t\t\t\t\tconsole.log(\"loadPreferences is setting default of \"+prefKey+\" to \"+pref.default);\n\t\t\t\t\t\tsetPref(prefKey, pref.default);\n\t\t\t\t\t\tsetting = pref.default;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetting = getPref(prefKey);\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch(pref.type) {\n\t\t\t\t\t\tcase \"checkbox\":\n\t\t\t\t\t\t\tif (setting === true) {\n\t\t\t\t\t\t\t\tparseActions(pref.activate);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tparseActions(pref.deactivate);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"dropdown\":\n\t\t\t\t\t\tcase \"textbox\":\n\t\t\t\t\t\tcase \"textarea\":\n\t\t\t\t\t\tcase \"slider\":\n\t\t\t\t\t\t\tparseActions(pref.activate, setting);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"button\":\n\t\t\t\t\t\tcase \"link\":\n\t\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\t}\n}", "function saveLocalSettings() {\n if (typeof (window.localStorage) === 'undefined') {\n console.log(\"Local settings cannot be saved. No web storage support!\");\n return;\n }\n\n localStorage.favoritePresets = JSON.stringify(favoritePresetID);\n console.log(\"Saving Parameter [localStorage.favoritePresets]:\");\n console.log(localStorage.favoritePresets);\n\n localStorage.currentAddress = address;\n console.log(\"Saving Parameter [localStorage.currentAddress]:\");\n console.log(localStorage.currentAddress);\n}", "function setContrastPageIndexes(){\r\n whiteContrastSlideIndexes = Object.values(JSON.parse(localStorage.getItem(\"whiteContrastSlideIndexes\")));\r\n backgroundConstrastSlideIndexes = Object.values(JSON.parse(localStorage.getItem(\"backgroundConstrastSlideIndexes\")));\r\n}", "function setCurrentSettings(){\n for (let i = 0; i < propList.length; i++){\n currentSettings[propList[i].name] = propList[i].array[propList[i].paramIndex]; //only for options checking, actual settings contains in propList[]\n }\n resetPreviewSize(); //needed because of \"auto\" feature\n resetPreviewEventType();\n }", "function saveSettings() {\n var settings = [];\n if (options.orderby != defaults.orderby) {\n settings.push('\"orderby\":\"' + options.orderby + '\"');\n }\n if (options.thsize != defaults.thsize) {\n settings.push('\"thsize\":\"' + options.thsize + '\"');\n }\n if (options.extended != defaults.extended) {\n settings.push('\"extended\":' + (options.extended ? 'true' : 'false'));\n }\n if (options.proxy != defaults.proxy) {\n settings.push('\"proxy\":' + (options.proxy ? 'true' : 'false'));\n }\n if (settings.length > 0) {\n settings = '{' + settings.join(',') + '}';\n $.cookie('4cat', settings, {\n expires: 30,\n path: options.cookiePath,\n domain: options.cookieDomain\n });\n }\n else {\n $.cookie('4cat', null, {\n path: options.cookiePath,\n domain: options.cookieDomain\n });\n }\n }", "function createPreferences()\n{\n var prefContainer = document.createElement('div');\n prefContainer.className = 'extra';\n prefContainer.id = common.apiname + '-settings';\n prefContainer.innerHTML = '<div class=\"extra-header\">' + common.locale.header + '</div>';\n\n for (var name in common.settings)\n {\n if (common.locale[name])\n {\n $(prefContainer).append(createPreferenceElement(name));\n }\n }\n\n return prefContainer;\n}", "function loadPreferences() {\n return PropertiesService.getUserProperties().getProperties();\n}", "getPreferencesData() {\n var properties = this.getPreferencesProperties();\n var numberOfProperties = properties.length;\n var data = new UserGlobalPreferences();\n var property;\n\n for (var i=0;i<numberOfProperties;i++) {\n property = properties[i];\n data[property] = this[property];\n }\n\n return data;\n }", "function UciUserPref() {\nthis.defautStoredValue = \"0000000380350270001003000000006500000\";\n // settings value\n this.storedValue = false;\n // list of available settings by profils\n this.settings = {current: \"\", profiles: {}};\n this.predefinedSettings = {\n '0':this.defautStoredValue, // no profile\n '1':\"0100000380350270001100000000006571400\",\n // 1 = Arial + font-size = 125% + Texte jaune sur fond bleu + supprimer les images de fond\n '2':\"0000010380350270111110000000006500400\",\n // 2 = Arial + + font-size = 120% + espace entre les lignes Moyen + texte à gauche + numbered list + activation du masque moyen ( ?)\n '3':\"0000000380350271001103000001006500000\"\n // 3 = start browse on hover + apparence des liens (souligné + couleur standard)\n }\n\n this.finish = false;\n\n\n /**\n * Collection of mask used to get value of necessary bits\n * for each encoded variable\n * @private\n */\n this.couleurs={\"00\": \"#FFFFFF\", \"01\": \"#330000\", \"02\": \"#331900\", \"03\": \"#333300\", \"04\": \"#193300\", \"05\": \"#003300\", \"06\": \"#003319\", \"07\": \"#003333\", \"08\": \"#001933\", \"09\": \"#000033\", \"10\": \"#190033\", \"11\": \"#330033\", \"12\": \"#330019\", \"13\": \"#000000\", \"14\": \"#990000\", \"15\": \"#994C00\", \"16\": \"#999900\", \"17\": \"#4C9900\", \"18\": \"#009900\", \"19\": \"#00994C\", \"20\": \"#009999\", \"21\": \"#004C99\", \"22\": \"#000099\", \"23\": \"#4C0099\", \"24\": \"#990099\", \"25\": \"#99004C\", \"26\": \"#404040\", \"27\": \"#FF0000\", \"28\": \"#FF8000\", \"29\": \"#FFFF00\", \"30\": \"#80FF00\", \"31\": \"#00FF00\", \"32\": \"#00FF80\", \"33\": \"#00FFFF\", \"34\": \"#0080FF\", \"35\": \"#0000FF\", \"36\": \"#7F00FF\", \"37\": \"#FF00FF\", \"38\": \"#FF007F\", \"39\": \"#808080\", \"40\": \"#FF6666\", \"41\": \"#FFB266\", \"42\": \"#FFFF66\", \"43\": \"#B2FF66\", \"44\": \"#66FF66\", \"45\": \"#66FFB2\", \"46\": \"#66FFFF\", \"47\": \"#66B2FF\", \"48\": \"#6666FF\", \"49\": \"#B266FF\", \"50\": \"#FF66FF\", \"51\": \"#FF66B2\", \"52\": \"#C0C0C0\", \"53\": \"#FFCCCC\", \"54\": \"#FFE5CC\", \"55\": \"#FFFFCC\", \"56\": \"#E5FFCC\", \"57\": \"#CCFFCC\", \"58\": \"#CCFFE5\", \"59\": \"#CCFFFF\", \"60\": \"#CCE5FF\", \"61\": \"#CCE5FF\", \"62\": \"#E5CCFF\", \"63\": \"#FFCCFF\", \"64\": \"#FFCCE5\", \"65\": \"#000000\"};\n\n /**\n * Convertion matrix used to get associated string value corresponding\n * to encoded bit. Each key and value are prefixed by param name in\n * order to ensure bijection as it or when matrix is reverted.\n * @private\n */\n this.convertMatrixv3 = {\n \"a11ySiteWebEnabled-0\": \"a11ySiteWebEnabled-on\",\n \"a11ySiteWebEnabled-1\": \"a11ySiteWebEnabled-off\",\n \"a11yToolbarEnable-0\": \"a11yToolbarEnable-off\",\n \"a11yToolbarEnable-1\": \"a11yToolbarEnable-on\",\n \"a11yLanguage-0\": \"a11yLanguage-keepit\",\n \"a11yLanguage-1\": \"a11yLanguage-FR\",\n \"a11yLanguage-2\": \"a11yLanguage-EN\",\n \"a11yLanguage-3\": \"a11yLanguage-ES\",\n \"a11yLanguage-4\": \"a11yLanguage-PL\",\n \"a11yJumpToContent-0\": \"a11yJumpToContent-false\",\n \"a11yJumpToContent-1\": \"a11yJumpToContent-true\",\n \"a11yLinearize-0\": \"a11yLinearize-false\",\n \"a11yLinearize-1\": \"a11yLinearize-true\",\n //Gestion de la taille de police\n //25, 33, 50, 67, 75, 80, 90,\n // keepit, 110, 125, 150, 175, 200\n \"a11yBigger-0\": \"a11yBigger-keepit\",\n \"a11yBigger-1\": \"a11yBigger-150\",\n \"a11yBigger-2\": \"a11yBigger-200\",\n \"a11yBigger-3\": \"a11yBigger-110\",\n \"a11yBigger-4\": \"a11yBigger-125\",\n \"a11yBigger-5\": \"a11yBigger-175\",\n \"a11yVisualSettings-0\": \"a11yVisualSettings-false\",\n \"a11yVisualSettings-1\": \"a11yVisualSettings-true\",\n \"a11yVisualPredefinedSettings-0\": \"a11yVisualPredefinedSettings-personnal\",\n \"a11yVisualPredefinedSettings-1\": \"a11yVisualPredefinedSettings-whiteonblack\",\n \"a11yVisualPredefinedSettings-2\": \"a11yVisualPredefinedSettings-blackonwhite\",\n \"a11yVisualPredefinedSettings-3\": \"a11yVisualPredefinedSettings-blueonyellow\",\n \"a11yVisualPredefinedSettings-4\": \"a11yVisualPredefinedSettings-yellowonblue\",\n \"a11yVisualPredefinedSettings-5\": \"a11yVisualPredefinedSettings-greenonblack\",\n \"a11yVisualPredefinedSettings-6\": \"a11yVisualPredefinedSettings-blackongreen\",\n \"a11yVisualPredefinedSettings-7\": \"a11yVisualPredefinedSettings-blueonwhite\",\n \"a11yVisualPredefinedSettings-8\": \"a11yVisualPredefinedSettings-whiteonblue\",\n \"a11yMotorModeRemote-0\": \"a11yMotorModeRemote-false\",\n \"a11yMotorModeRemote-1\": \"a11yMotorModeRemote-true\",\n \"a11yMotorModeLooping-0\": \"a11yMotorModeLooping-false\",\n \"a11yMotorModeLooping-1\": \"a11yMotorModeLooping-true\",\n \"a11yDelayBeforeClick-0\": \"a11yDelayBeforeClick-1\",\n \"a11yDelayBeforeClick-1\": \"a11yDelayBeforeClick-2\",\n \"a11yDelayBeforeClick-2\": \"a11yDelayBeforeClick-3\",\n \"a11yDelayBeforeClick-3\": \"a11yDelayBeforeClick-6\",\n \"a11yMenuPositionning-0\": \"a11yMenuPositionning-center\",\n \"a11yMenuPositionning-1\": \"a11yMenuPositionning-nextto\",\n \"a11yDelayBeforeLoop-0\": \"a11yDelayBeforeLoop-1\",\n \"a11yDelayBeforeLoop-1\": \"a11yDelayBeforeLoop-2\",\n \"a11yDelayBeforeLoop-2\": \"a11yDelayBeforeLoop-3\",\n \"a11yDelayBeforeLoop-3\": \"a11yDelayBeforeLoop-6\",\n \"a11yQuickMode-0\": \"a11yQuickMode-2\",\n \"a11yQuickMode-1\": \"a11yQuickMode-5\",\n \"a11yQuickMode-2\": \"a11yQuickMode-10\",\n \"a11yDyslexyFont-0\": \"a11yDyslexyFont-arial\",\n \"a11yDyslexyFont-1\": \"a11yDyslexyFont-opendyslexic\",\n \"a11yDyslexyFont-3\": \"a11yDyslexyFont-keepit\",\n \"a11yDyslexyFont-4\": \"a11yDyslexyFont-opensans\",\n \"a11yDyslexyFont-5\": \"a11yDyslexyFont-accessibledfa\",\n \"a11yLineSpacement-0\": \"a11yLineSpacement-keepit\",\n \"a11yLineSpacement-1\": \"a11yLineSpacement-2\",\n \"a11yLineSpacement-2\": \"a11yLineSpacement-3\",\n //gestion de l'espacement des mot\n \"a11ySpacement-0\": \"a11ySpacement-keepit\",\n \"a11ySpacement-1\": \"a11ySpacement-0.5\",\n \"a11ySpacement-2\": \"a11ySpacement-1\",\n \"a11yModifCasse-0\": \"a11yModifCasse-capitalize\",\n \"a11yModifCasse-1\": \"a11yModifCasse-keepit\",\n \"a11yModifCasse-2\": \"a11yModifCasse-lowercase\",\n \"a11yModifCasse-3\": \"a11yModifCasse-uppercase\",\n //gestion de l'apparence ; Alignement a gauche\n \"a11yLeftText-0\": \"a11yLeftText-false\",\n \"a11yLeftText-1\": \"a11yLeftText-left\",\n //gestion de l'apparence ; Numeroatation en mode list\n \"a11yNumerotationList-0\": \"a11yNumerotationList-false\",\n \"a11yNumerotationList-1\": \"a11yNumerotationList-decimal\",\n //gestion des liens\n \"a11yNavLienEnabled-0\": \"a11yNavLienEnabled-false\",\n \"a11yNavLienEnabled-1\": \"a11yNavLienEnabled-true\",\n //gestion liens selectionnées\n \"a11yNavLienSelStyle-0\": \"a11yNavLienSelStyle-keepit\",\n \"a11yNavLienSelStyle-1\": \"a11yNavLienSelStyle-border\",\n \"a11yNavLienSelStyle-2\": \"a11yNavLienSelStyle-underline\",\n \"a11yNavLienSelStyle-3\": \"a11yNavLienSelStyle-bold\",\n //gestion liens Non visités\n \"a11yNavLienNonVisStyle-0\": \"a11yNavLienNonVisStyle-keepit\",\n \"a11yNavLienNonVisStyle-1\": \"a11yNavLienNonVisStyle-border\",\n \"a11yNavLienNonVisStyle-2\": \"a11yNavLienNonVisStyle-underline\",\n \"a11yNavLienNonVisStyle-3\": \"a11yNavLienNonVisStyle-bold\",\n //gestion liens Visités\n \"a11yNavLienVisStyle-0\": \"a11yNavLienVisStyle-keepit\",\n \"a11yNavLienVisStyle-1\": \"a11yNavLienVisStyle-border\",\n \"a11yNavLienVisStyle-2\": \"a11yNavLienVisStyle-underline\",\n \"a11yNavLienVisStyle-3\": \"a11yNavLienVisStyle-bold\",\n //gestion mask\n \"a11yMaskEnabled-0\": \"a11yMaskEnabled-false\",\n \"a11yMaskEnabled-1\": \"a11yMaskEnabled-true\",\n // mask option, reading mask, hruler or vruler\n \"a11yMaskOption-0\" : \"a11yMaskOption-mask\",\n \"a11yMaskOption-1\" : \"a11yMaskOption-hruler\",\n \"a11yMaskOption-2\" : \"a11yMaskOption-vruler\",\n\n \"a11yMaskOpacity-0\" : \"a11yMaskOpacity-.5\",\n \"a11yMaskOpacity-1\" : \"a11yMaskOpacity-.25\",\n \"a11yMaskOpacity-2\" : \"a11yMaskOpacity-.9\",\n\n \"a11ySupEffetTransp-0\": \"a11ySupEffetTransp-false\",\n \"a11ySupEffetTransp-1\": \"a11ySupEffetTransp-1\",\n \"a11ySupImageFont-0\" : \"a11ySupImageFont-false\",\n \"a11ySupImageFont-1\" : \"a11ySupImageFont-true\",\n \"a11ySupImageFirstPlan-0\" : \"a11ySupImageFirstPlan-false\",\n \"a11ySupImageFirstPlan-1\" : \"a11ySupImageFirstPlan-true\",\n /**\n * Reverse the matrix. Keys becomes values and values becomes keys.*/\n reverse: function () {\n var temp = {}, prop;\n for (prop in this) {\n if (prop !== \"reverse\") {\n temp[this[prop]] = prop;\n }\n }\n return temp;\n }\n };\n\n /**\n * Create the var for each color\n */\n this.create_color = function(paramname){\n for(var key in this.couleurs){\n this.convertMatrixv3[paramname + key]=paramname+this.couleurs[key];\n }\n };\n\n this.create_color('a11yFontColor-');\n this.create_color('a11yBackgroundColor-');\n this.create_color('a11yNavLienSelColor-');\n this.create_color('a11yNavLienNonVisColor-');\n this.create_color('a11yNavLienVisColor-');\n\n this.maskMatrixv3 = {\n // Mask Name | Dec Value\n \"a11ySiteWebEnabled\": [39,1],\n \"a11yToolbarEnable\": [38,1],\n \"a11yLanguage\": [37,1],\n \"a11yJumpToContent\": [36,1],\n \"a11yLinearize\": [35,1],\n \"a11yBigger\": [34,1],\n \"a11yVisualSettings\": [33,1],\n \"a11yVisualPredefinedSettings\": [32,1],\n \"a11yFontColor\": [30,2],\n \"a11yBackgroundColor\": [28,2],\n \"a11yMotorModeRemote\": [27,1],\n \"a11yMotorModeLooping\": [26,1],\n \"a11yDelayBeforeClick\": [25,1],\n \"a11yMenuPositionning\": [24,1],\n \"a11yDelayBeforeLoop\": [23,1],\n \"a11yQuickMode\": [22,1],\n \"a11yDyslexyFont\": [21,1],\n \"a11yLineSpacement\": [20,1],\n \"a11ySpacement\": [19,1],\n \"a11yModifCasse\": [18,1],\n \"a11yLeftText\": [17,1],\n \"a11yNumerotationList\": [16,1],\n \"a11yNavLienEnabled\": [15,1],\n \"a11yNavLienSelColor\": [13,2],\n \"a11yNavLienSelStyle\": [12,1],\n \"a11yNavLienNonVisColor\": [10,2],\n \"a11yNavLienNonVisStyle\": [9,1],\n \"a11yNavLienVisColor\": [7,2],\n \"a11yNavLienVisStyle\": [6,1],\n \"a11yMaskEnabled\": [5,1],\n \"a11yMaskOption\" : [4,1],\n \"a11yMaskOpacity\" : [3,1],\n \"a11ySupEffetTransp\": [2,1],\n \"a11ySupImageFont\" : [1,1],\n \"a11ySupImageFirstPlan\" : [0,1]\n };\n\n /**\n * User preference stackv3. Used to save user preference.\n * Initialized with default value.\n * @private\n */\n this.stackv3 = {\n \"a11yToolbarEnable\": \"off\",\n \"a11yLanguage\": \"keepit\",\n \"a11yJumpToContent\": \"false\",\n \"a11yLinearize\": \"false\",\n \"a11yBigger\": \"keepit\",\n \"a11yVisualSettings\": \"false\",\n \"a11yVisualPredefinedSettings\": \"personnal\",\n \"a11yFontColor\": \"#000000\",\n \"a11yBackgroundColor\": \"#FFFFFF\",\n \"a11yMotorModeRemote\": \"false\",\n \"a11yMotorModeLooping\": \"false\",\n \"a11yDelayBeforeClick\": \"1\",\n \"a11yMenuPositionning\": \"center\",\n \"a11yDelayBeforeLoop\": \"1\",\n \"a11yQuickMode\": \"2\",\n \"a11yDyslexyFont\": \"keepit\",\n \"a11yLineSpacement\" : \"keepit\",\n \"a11ySpacement\": \"keepit\",\n \"a11yModifCasse\" : \"keepit\",\n \"a11yLeftText\": \"false\",\n \"a11yNumerotationList\": \"false\",\n \"a11yNavLienEnabled\": \"false\",\n \"a11yNavLienSelColor\": \"#FF0000\",\n \"a11yNavLienSelStyle\": \"keepit\",\n \"a11yNavLienNonVisColor\": \"#0000FF\",\n \"a11yNavLienNonVisStyle\": \"keepit\",\n \"a11yNavLienVisColor\": \"#FF007F\",\n \"a11yNavLienVisStyle\": \"keepit\",\n \"a11yMaskEnabled\": \"false\",\n \"a11yMaskOption\" : \"mask\",\n \"a11yMaskOpacity\" : \".5\",\n \"a11ySupEffetTransp\": \"false\",\n \"a11ySupImageFont\" : \"false\",\n \"a11ySupImageFirstPlan\" : \"false\",\n \"a11ySiteWebEnabled\" : \"on\"\n };\n\n /**\n * Decode an encoded pref using mask matrix and convert matrix.\n * The encoded pref is a representation of a number in hexadecimal.\n * each mask of the matrix is applied in order to get the corresponding bit\n * of a pref. This value is used as an index with the convert matrix to get\n * the corresponding textual value.\n * @param {String} pref representing a number in\n * hexadecimal representation\n */\n /*jshint validthis:true */\n this.decode = function (/* String*/ pref) {\n var prefName;\n // if decode without params, load the latest saved value for curent profile\n if(typeof pref === 'undefined') {\n this.settings.current = '0';\n pref = this.predefinedSettings[this.settings.current];\n }\n // uniquement si le nombre de caractères du cookie est correct!\n if(pref.length===37)\n {\n for (prefName in this.maskMatrixv3) {\n if(prefName !== \"a11ySiteWebEnabled\" && prefName !== \"a11yToolbarEnable\" && prefName !== \"a11yLanguage\") {\n this.stackv3[prefName]= this.convertMatrixv3[prefName + \"-\" +pref.substr(this.maskMatrixv3[prefName][0],this.maskMatrixv3[prefName][1])].replace(/.*-/, \"\");\n }\n }\n }\n };\n\n /**\n * Encode the user preference stackv3 in a hexadecimal number.\n * Each user preference is used as an index in the convert matrix reversed.\n * the corresponding value is then merged.\n * @return {String} representation of a number in hexadecimal representation\n */\n this.encode = function () {\n var pref = \"\";\n var tempMatrix = this.convertMatrixv3.reverse();\n var prefName;\n for (prefName in this.maskMatrixv3) {\n if (prefName !== \"\") {\n // si la pref existe dans le stack sinon 0\n if(prefName in this.stackv3) {\n pref = tempMatrix[prefName + \"-\" + this.stackv3[prefName]].replace(/.*-/, \"\") + pref;\n }\n // on garantie la longeur de la chaine\n else {\n pref = \"0\"+pref;\n }\n }\n }\n pref = pref.substring(0,pref.length-3);\n // put toolbar enable and lang at the begening\n // pref = tempMatrix[\"a11yToolbarEnable\" + \"-\" + this.stackv3[\"a11yToolbarEnable\"]].replace(/.*-/, \"\") + \"|\" + tempMatrix[\"a11yLanguage\" + \"-\" + this.stackv3[\"a11yLanguage\"]].replace(/.*-/, \"\") + \"|\" + pref;\n return pref;\n };\n\n /**\n * Create the string separate by | for cookie or localstorage save\n * format: currentprofilname|profilname1|valueprofil1|profilname2|valueprofil2 ....\n *\n */\n this.encodeUsageConfort= function () {\n var tempMatrix = this.convertMatrixv3.reverse();\n var encodedValue = tempMatrix[\"a11yToolbarEnable\" + \"-\" + this.stackv3[\"a11yToolbarEnable\"]].replace(/.*-/, \"\") + \"|\" + tempMatrix[\"a11yLanguage\" + \"-\" + this.stackv3[\"a11yLanguage\"]].replace(/.*-/, \"\") + \"|\" + this.settings.current;\n var profil;\n for (profil in this.settings.profiles) {\n encodedValue += \"|\"+profil+\"|\"+this.settings.profiles[profil];\n }\n return encodedValue;\n };\n\n /**\n * Create the string separate by | for cookie or localstorage save\n * format: websitedisable|currentprofilname|profilname1|valueprofil1|profilname2|valueprofil2 ....\n *\n */\n this.decodeUsageConfort= function (storageValue) {\n var settings = storageValue.split('|');\n // need to explode the values\n // at least 4 entry :\n // first bit set site enable or disable second set toolbar enable, third one set default lang, 4th one set to no profile\n // first param set site enable or disable\n var disablevalue = settings.shift();\n if(!onOffEnabled) disablevalue = 0;\n this.stackv3[\"a11ySiteWebEnabled\"] = this.convertMatrixv3[\"a11ySiteWebEnabled\" + \"-\" +disablevalue].replace(/.*-/, \"\");\n var a11yToolbarEnable = settings.shift();\n this.stackv3[\"a11yToolbarEnable\"] = this.convertMatrixv3[\"a11yToolbarEnable\" + \"-\" +a11yToolbarEnable].replace(/.*-/, \"\");\n var a11yLanguage = settings.shift();\n this.stackv3[\"a11yLanguage\"] = this.convertMatrixv3[\"a11yLanguage\" + \"-\" +a11yLanguage].replace(/.*-/, \"\");\n\n\n this.settings.current = settings.shift();\n // parse all profiles if they are\n var profil = null;\n while(profil = settings.shift()) {\n this.settings.profiles[profil] = settings.shift();\n }\n this.readUserPref();\n };\n\n /**\n * Return the value of a given user preference name\n * @param {String} param representing the user preference name\n * @return {String} value : the corresponding user preference value. Could be a string or a number.\n */\n this.get = function (/*String*/param) {\n return (this.stackv3[param] !== null ? this.stackv3[param] : \"\");\n };\n\n /**\n * Save the value of a given user preference name into the stackv3\n * @param {String} prefName the user preference name\n * @param {String} prefValue the corresponding user preference value.\n */\n /*jshint validthis:true */\n this.set = function (/* String */prefName, /* String */prefValue) {\n this.stackv3[prefName] = prefValue;\n };\n\n /**\n * Concatenate user preference into a string with the format : param1=val1&param2=val2....paramX=valX.\n * @return {String} stackv3String : string representing user preference concatenation\n */\n this.stackv3ToString = function () {\n var stackv3String = \"\";\n var prop;\n for (prop in stackv3) {\n if (prop !== \"\") {\n stackv3String += prop + \"=\" + this.stackv3[prop] + \"&\";\n }\n }\n return stackv3String.replace(/&$/, \"\");\n };\n /*\n * @constructor init\n */\n this.setStoredValue = function (storedValue,profilName) {\n if(profilName) {\n this.settings.current = profilName;\n }\n if(this.settings.current.length >= 3) {\n if(storedValue) {\n this.settings.profiles[this.settings.current] = storedValue;\n } else { // if no storedvalue is provided set the default value\n this.settings.profiles[this.settings.current] = this.defautStoredValue;\n }\n } else { // if we are on a predefined profile, set to no profile\n this.settings.current = 0;\n }\n this.readUserPref();\n };\n\n /**\n * Read browser cookies and save each user preference into the user\n * preference stackv3.\n */\n this.readUserPref = function () {\n if(this.settings.current.length <=1) {\n this.decode(this.predefinedSettings[this.settings.current]);\n } else {\n this.decode(this.settings.profiles[this.settings.current]);\n }\n this.finish = true;\n };\n\n\n /**\n * get the current saved pref ass the numerical string to be compared to current setting in the stack\n */\n this.getCurrentPref = function () {\n if(this.settings.current.length <=1) {\n return this.predefinedSettings[this.settings.current];\n } else {\n return this.settings.profiles[this.settings.current];\n }\n };\n\n /**\n * Wait for callback completed and user preference stackv3 updated\n * @return {Boolean} true if user preference is loaded, false otherwise.\n */\n this.isUserPrefLoaded = function () {\n return this.finish;\n };\n}", "function saveSettings() {\n // debug('Saved');\n localStorage.setItem('autoTrimpSettings', JSON.stringify(autoTrimpSettings));\n}", "function saveChoices(map) {\n var pn = getPlayerNameFromCharpane();\n if (pn) {\n var s = '';\n for (var cnum in map) {\n s += cnum+':'+map[cnum]+';';\n }\n //GM_log('setting map to: '+s);\n GM_setValue(pn+'_ncactionbar_choices',s);\n }\n}", "function setSavedOptions() {\n log('Getting saved options.');\n GM_setValue(\"opt_loggingEnabled\", opt_loggingEnabled);\n GM_setValue(\"opt_hidefedded\", opt_hidefedded);\n GM_setValue(\"opt_hidefallen\", opt_hidefallen);\n GM_setValue(\"opt_hidetravel\", opt_hidetravel);\n GM_setValue(\"opt_showcaymans\", opt_showcaymans);\n GM_setValue(\"opt_hidehosp\", opt_hidehosp);\n GM_setValue(\"opt_disabled\", opt_disabled);\n }", "function getPreferences() {\n return settings.get('preferences');\n}", "function saveSettings(){\n\n showMenu();\n\n for (key in settingTmp){\n if (settingTmp.hasOwnProperty(key)){\n setting[key] = settingTmp[key];\n }\n }\n\n PopupModule.hide();\n }", "function loadPageVariables() {\n var tmp = JSON.parse(localStorage.getItem('autoTrimpSettings'));\n if (tmp !== null) {\n autoTrimpSettings = tmp;\n }\n}", "function retrieveAndSetPreference(){\n if(typeof(Storage) !== \"undefined\") { //Check if the browser supports local storage\n if(localStorage.guddi_ca_xkcd_user_preference){\n var userPreferenceRetrieved = JSON.parse(localStorage.getItem(\"guddi_ca_xkcd_user_preference\"));\n totWords.value = userPreferenceRetrieved[0];\n totSpChars.value = userPreferenceRetrieved[1];\n totNumbers.value = userPreferenceRetrieved[2];\n useSeparator.value = userPreferenceRetrieved[3];\n wordCase.value = userPreferenceRetrieved[4];\n savePreference.checked = userPreferenceRetrieved[5];\n } //End of inner IF\n } else {\n console.log(\"Error log: Web local storage is not supported in this browser!\");\n }//End of outer IF\n }", "function setupLivePrefs(IDs) {\n var localIDs = {};\n IDs.forEach(function (id) {\n localIDs[id] = true;\n updateElement(id).addEventListener(\"change\", function () {\n prefs.set(this.id, isCheckbox(this) ? this.checked : this.value);\n });\n });\n chrome.runtime.onMessage.addListener(function (request) {\n if (request.prefName in localIDs) {\n updateElement(request.prefName);\n }\n });\n\n function updateElement(id) {\n var el = document.getElementById(id);\n el[isCheckbox(el) ? \"checked\" : \"value\"] = prefs.get(id);\n el.dispatchEvent(new Event(\"change\", {bubbles: true, cancelable: true}));\n return el;\n }\n}", "function storeSettingsVariables() {\n $.each(userscriptSettings, function (key, set) {\n var isEnabled = $(\"#\" + set.id).prop(\"checked\");\n var setting = {\n name: set.id,\n value: isEnabled\n };\n Database.update(Database.Table.Settings, setting, undefined, function () {\n })\n });\n}", "function storeSettingsVariables() {\n $.each(userscriptSettings, function (key, set) {\n var isEnabled = $(\"#\" + set.id).prop(\"checked\");\n var setting = {\n name: set.id,\n value: isEnabled\n };\n Database.update(Database.Table.Settings, setting, undefined, function () {\n })\n });\n}", "async function load_Prefs() {\r\n let prefs = await browser.storage.local.get(\"Prefs\");\r\n let settings = prefs.Prefs;\r\n if (settings != null && settings != undefined){\r\n for (let key of Object.keys(settings)){\r\n let elem = document.getElementById(key);\r\n if (!elem) {\r\n continue;\r\n }\r\n if (elem.type == \"checkbox\") {\r\n elem.checked = settings[key];\r\n } else {\r\n elem.value = settings[key];\r\n }\r\n }\r\n }else{\r\n resetValues();\r\n }\r\n update_shown_Values();\r\n}", "function handleSaveUserPreferences() {\n\t\t\tvar version = $('#extendedVersionPrefs').find(\":selected\").text();\n\t\t\tvar language = $('#languagePrefs').find(\":selected\").text();\n\t\t\tvar routingLanguage = $('#routingLanguagePrefs').find(\":selected\").text();\n\t\t\tvar distanceUnit = $('#unitPrefs').find(\":selected\").text();\n\n\t\t\t//version: one of list.version\n\t\t\tversion = preferences.reverseTranslate(version);\n\n\t\t\t//language: one of list.languages\n\t\t\tlanguage = preferences.reverseTranslate(language);\n\n\t\t\t//routing language: one of list.routingLanguages\n\t\t\troutingLanguage = preferences.reverseTranslate(routingLanguage);\n\n\t\t\t//units: one of list.distanceUnitsInPopup\n\t\t\tdistanceUnit = distanceUnit.split(' / ');\n\t\t\tfor (var i = 0; i < distanceUnit.length; i++) {\n\t\t\t\tfor (var j = 0; j < list.distanceUnitsPreferences.length; j++) {\n\t\t\t\t\tif (distanceUnit[i] === list.distanceUnitsPreferences[j]) {\n\t\t\t\t\t\tdistanceUnit = list.distanceUnitsPreferences[j];\n\t\t\t\t\t\ti = distanceUnit.length;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttheInterface.emit('ui:saveUserPreferences', {\n\t\t\t\tversion : version,\n\t\t\t\tlanguage : language,\n\t\t\t\troutingLanguage : routingLanguage,\n\t\t\t\tdistanceUnit : distanceUnit\n\t\t\t});\n\n\t\t\t//hide preferences window\n\t\t\t$('#sitePrefsModal').modal('hide');\n\t\t}", "function saveSettings(){\n\t\tvar checkboxes = document.querySelectorAll('.accordion-header input[type=\"checkbox\"]');\n\t\tvar toSave = {};\n\t\t[].forEach.call(checkboxes,\tfunction (el) {\n\t\t\tvar id = el.parentNode.id;\n\t\t\tvar checked = el.checked;\n\t\t\ttoSave[id] = checked;\n\t\t});\n\t\t// console.log(\"Saving block preferences\", toSave);\n\t\tlocalStorage['__' + language + '_hidden_blocks'] = JSON.stringify(toSave);\n\t}", "function getPortalPreferences(portalPrefCb) {\n\t\tif (!Ext.isEmpty(userLogin)) {\n\t\t\tvar portalPrefSuccess = function (response) {\n\t\t\t\tif (Ext.isEmpty(response.responseText)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tvar json = Ext.decode(response.responseText);\n\t\t\t\t\tif (!Ext.isEmpty(json.language)) {\n\t\t\t\t\t\tthis.app.language = json.language;\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t return;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tvar filePath = \"/\" + DEFAULT_PREFERENCES_FOLDER + '/portal';\n\n\t\t\tuserStorage.get(\"portal\", filePath, this, portalPrefSuccess,\n\t\t\t\t\tExt.emptyFn, portalPrefCb);\n\t\t} else {\n\t\t\tportalPrefCb.call(this);\n\t\t}\n\n\t}", "function saveUserPreference(){\n if(savePreference.checked){\n if(typeof(Storage) !== \"undefined\") { //Check if the browser supports local storage\n var userPreference = [totWords.value,totSpChars.value,totNumbers.value,useSeparator.value,wordCase.value,savePreference.value];\n localStorage.setItem(\"guddi_ca_xkcd_user_preference\", JSON.stringify(userPreference));\n } else {\n console.log(\"Error log: Web local storage is not supported in this browser!\");\n }//End of inner IF\n } else{\n localStorage.clear();\n } //End of outer IF\n } //End of saveUserPreference() function", "function _saveUserOptions () {\n var data = {\n mode: selected_travel_mode,\n latlng: visitor_location,\n location: current_visitor_location\n };\n var save = $.cookie('map_options', data, {expires: 7, path: '/'});\n }", "function setPreference(articleIndex, likeOrNotString) {\n\tlocalStorage.setItem('likeArticle' + articleIndex.toString(), likeOrNotString);\n}", "set dietPreference(dietPreference) {\n\t\tif (Array.isArray(dietPreference)) {\n\t\t\tthis._dietPreference = dietPreference.map((i) => new CodeableConcept(i));\n\t\t} else {\n\t\t\tthis._dietPreference = [new CodeableConcept(dietPreference)];\n\t\t}\n\t}", "function save_options() {\n// var select = document.getElementById(\"color\");\n// var color = select.children[select.selectedIndex].value;\n// localStorage[\"favorite_color\"] = color;\n \t\n \tfor( i in pOptions){\n \t\tif(typeof(pOptions[i].def)=='boolean')\n \t\t\tlocalStorage[i] = document.getElementById(i).checked;\n \t\telse\n \t\t\tlocalStorage[i] = document.getElementById(i).value;\n \t}\n\t\n\t\n\t//localStorage[\"hqthumbs\"] = document.getElementById(\"hqthumbs\").checked;\n\t//localStorage[\"showCurrentTab\"] = document.getElementById(\"showCurrentTab\").checked;\n\t//localStorage[\"maxhistory\"] = document.getElementById(\"maxhistory\").value;\n\t\n\t\n // Update status to let user know options were saved.\n var status = document.getElementById(\"status\");\n Cr.empty(status).appendChild(Cr.txt(\"Options Saved.\"));\n setTimeout(function() {\n Cr.empty(status);\n }, 750);\n \n chrome.runtime.sendMessage({greeting: \"reloadprefs\"}, function(response) { });\n}", "updatePrefs() {\n Sanitizer.prefs.setIntPref(\"timeSpan\", this.selectedTimespan);\n\n // Now manually set the prefs from their corresponding preference elements.\n let sanitizeItemList = document.querySelectorAll(\n \"#historyGroup > [preference]\"\n );\n for (let prefItem of sanitizeItemList) {\n let prefName = prefItem.getAttribute(\"preference\");\n Services.prefs.setBoolPref(prefName, prefItem.checked);\n }\n }", "function addBranchSettings (preferences) {\n var filePath = 'platforms/ios/' + preferences.projectName + '/' + preferences.projectName + '-Info.plist'\n var xml = readPlist(filePath)\n var obj = convertXmlToObject(xml)\n\n obj = appendPlist(obj, preferences)\n obj = correctPlistBlanks(obj)\n xml = convertObjectToXml(obj)\n writePList(filePath, xml)\n }", "function comparePrefs() {\n \tvar version = pref.getItem(\"version\"),\n \t\tdefs = Object.union(defaultPreferences, hiddenPreferences);\n \tif (version && String.natcmp(version, extVersion) < 0) {\n \t\texportPreferences();\n \t\tcheckOldStructure();\n\n \t\tpref.setPref(\"style\", defaultPreferences.style);\n \t\tpref.setPref(\"localisedStrings\", defaultPreferences.localisedStrings);\n \t\tpref.setPref(\"videoFormat\", defaultPreferences.videoFormat);\n \t}\n\n \tlog.info(\"prefs:\",\n \t\t\"Comparing preferences structure.\"\n \t);\n\n \tvar changes = compareStructure(defs);\n \tvar changedItems = changes.wrong.concat(changes.missing.filter(function (item) { return !/^actions\\./.test(item); }));\n\n \t// If there are changes restore them from recommended preferences.\n \tif (changedItems.length) {\n \t\tdefs = Object.union(recommendedPreferences, defs);\n\n \t\tchangedItems.forEach(function (item) {\n \t\t \n \t\t\tvar key = item.split('.');\n \t\t\tvar newPref = defs[key[0]];\n\n \t\t\tif (key[1]) {\n \t\t\t\tnewPref = pref.getPref(key[0]);\n \t\t\t\tnewPref[key[1]] = defs[key[0]][key[1]];\n \t\t\t}\n\n \t\t\tpref.setPref(key[0], newPref);\n \t\t});\n\n \t\tlog.warn(\"prefs:\",\n \t\t\t\"Preferences structure is changed outside of the extension. Changes are set to recommended preferences.\",\n \t\t\t\"Changed items are:\",\n \t\t\tchangedItems.join(\", \") + '.'\n \t\t);\n \t}\n \telse {\n \t\tlog.info(\"prefs:\",\n \t\t\t\"Preferences structure is OK.\"\n \t\t);\n \t}\n\n \tcheckActions();\n }", "function setPolls(_polls) {\n polls = Object.values(_polls);\n}", "function loadPageVariables() {\r\n \"use strict\";\r\n var tmp = JSON.parse(localStorage.getItem('TrimpzSettings'));\r\n if (tmp !== null) {\r\n trimpzSettings = tmp;\r\n }\r\n}", "function loadOptionsIntoelements() {\n for (var option in elements.options)\n {\n var dataStoreValue = localStorage['sunjer_option_' + option];\n if (dataStoreValue) {\n if (dataStoreValue == \"true\" || dataStoreValue == \"false\")\n elements.options[option] = (dataStoreValue == 'true');\n else\n elements.options[option] = dataStoreValue;\n }\n else\n localStorage['sunjer_option_' + option] = elements.options[option];\n }\n}", "function configureSettings() {\n // Load all the saved settings into the preferences object.\n PREF_OBJ.load();\n return true;\n}", "function saveSettings() {\n\tlocalStorage.setItem (\"favs\", favs.join (','));\n\tlocalStorage.setItem (\"mode\", \"\"+mode);\n}", "function addBranchSettings(preferences) {\n const filePath = `platforms/ios/${preferences.projectName}/${\n preferences.projectName\n }-Info.plist`;\n let xml = readPlist(filePath);\n let obj = convertXmlToObject(xml);\n\n obj = appendPlist(obj, preferences);\n obj = correctPlistBlanks(obj);\n xml = convertObjectToXml(obj);\n writePList(filePath, xml);\n }", "storeStyles( pStyles ){\r\n \r\n var props = pStyles;\r\n var prefs = {\r\n fontFamily : props.fontFamily,\r\n fontSize : props.fontSize,\r\n lineHeight: props.lineHeight,\r\n margin : props.margin,\r\n theme : props.theme \r\n };\r\n \r\n window.localStorage.setItem(this.localStorageKey,\r\n JSON.stringify( prefs ));\r\n }", "function sanitizePreferences(preferences) {\n return preferences.map((preference) => {\n return {\n dataType: preference.dataType,\n colour: preference.colour,\n visualization: preference.visualization\n }\n });\n}", "function updateUserPreferences(atts) {\n\t\t\tif (preferences.version == atts.version && preferences.language == atts.language && preferences.routingLanguage == atts.routingLanguage && preferences.distanceUnit == atts.distanceUnit) {\n\t\t\t\t//nothing changed...\n\t\t\t} else {\n\t\t\t\tupdateCookies(preferences.versionIdx, atts.version);\n\t\t\t\tupdateCookies(preferences.languageIdx, atts.language);\n\t\t\t\tupdateCookies(preferences.routingLanguageIdx, atts.routingLanguage);\n\t\t\t\tupdateCookies(preferences.distanceUnitIdx, atts.distanceUnit);\n\n\t\t\t\t//reload page to apply changed preferences (e.g. other site language)\n\t\t\t\tpreferences.reloadWithPerma();\n\t\t\t}\n\t\t}", "setPstate () {\r\n const O = this;\r\n if (O.is_multi && (O.is_floating || settings.okCancelInMulti)) {\r\n O.Pstate = [];\r\n // assuming that find returns elements in tree order\r\n O.E.find('option').each((i, e) => { if (e.selected) O.Pstate.push(i); });\r\n }\r\n }", "function setPref(peopleObject, fruitObject){\n let people = keys(peopleObject)\n\n people.forEach( val => {\n let fruitInd = returnRandomIndex(fruitObject)\n peopleObject[val].setFruitPreference(fruitObject, fruitInd)\n })\n}", "getPreferencesProperties(userProperties = false) {\n if (userProperties) {\n var userArray = this.preferenceProperties.slice();\n userArray = userArray.filter(x => !this.nonUserProperties.includes(x) )\n return userArray;\n }\n return this.preferenceProperties.slice();\n }", "function createPreferencesRoutes () {\n router.route('/preferences/:org')\n .get(handler.getPreferences())\n .put(handler.updatePreferences())\n}", "get prefs() {\n if (!this._prefs) {\n this._prefs = new PrefBranch(null, \"\", \"\");\n this._prefs._initializeRoot();\n }\n return this._prefs;\n }", "function setProveedores(){\r\n localStorage.setItem('LSProveedores', JSON.stringify(proveedores));\r\n}", "function setPrefs(feed,editOb,BW, prefs){\r\n\t//aŅadir al div de edit\r\n\teditArea=\"<form>\";\r\n\t//para cada preferencia del widget\r\n \t$.each( feed, function(i,item){\r\n\t\t// segun los tipos de preferencias\r\n\t\tswitch (item.type) {\r\n\t\t\tcase \"range\"://rango de valores\r\n\t\t\t\teditArea = editArea + item.label+'<br /><input name=\"'+item.name+'\" id=\"wid-edit-input'+i+'\" value=\"'+(prefs[item.name] == undefined ? item.defaultValue : prefs[item.name]) +'\"></input><br />';\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"text\"://rango de valores\r\n\t\t\t\tif (item.defaultValue == undefined)\r\n\t\t\t\t\titem.defaultValue = '';\r\n\r\n\t\t\t\teditArea = editArea + item.label+'<br /><input name=\"'+item.name+'\" id=\"wid-edit-input'+i+'\" value=\"'+ (prefs[item.name] == undefined ? item.defaultValue : prefs[item.name]) + '\"></input><br />';\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"list\"://lista de valores\r\n\t\t\t\topList='<br /><select name=\"'+item.name+'\" id=\"wid-edit-input'+i+'\">';\r\n\t\t\t\t$.each(item.options, function(j,op){\r\n\t\t\t\t\topList= opList + '<option value=\"'+op.value+'\"' + (prefs[item.name] != undefined && prefs[item.name] == op.value ? 'selected=\"selected\"' : '') + '>'+op.label+'</option>';\r\n\t\t\t\t});\r\n\t\t\t\topList=opList+\"</select><br />\"\r\n\t\t\t\teditArea = editArea + item.label+ opList;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"boolean\"://checkbox\r\n\t\t\t\tvar checked= '';\r\n\t\t\t\tif (prefs[item.name] != undefined && \r\n\t\t\t\t\t(prefs[item.name] == 'true' || prefs[item.name] == 'on' || prefs[item.name] == 1))\r\n\t\t\t\t\tchecked = 'checked=\"checked\"';\r\n\t\t\t\telse if(item.defaultValue == \"true\") checked=\"checked\";\r\n\t\t\t\teditArea= editArea +'<input type=\"checkbox\" name=\"'+item.name+'\" '+checked+' >'+ item.label +'<br />';\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"hidden\"://oculto\r\n\t\t\t\t//no hacemos nada\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t});\r\n\t//link para aceptar los cambios\r\n\t//editArea = editArea + '<a href=\"#\" class=\"myWidget-sender\">Send</a>';\r\n\teditArea = editArea + '<button class=\"myWidget-sender\">Enviar</button></form>';\r\n\teditObj.append(editArea);\r\n\t//agregamos una funcion javascript a este link\r\n\teditObj.children().children('.myWidget-sender').click( function(){\r\n\t\tvar thisObj=$(this).parent();\r\n\t\tvar prefs='{';\r\n\t\tvar cid = thisObj.parent().parent().parent().attr('id').substring(9);\r\n\t\tthisObj.children(\"input[type!='checkbox']\").each( function(){\r\n\t\t\t//si es un input\r\n\t\t\tprefs = prefs + '\"' + $(this).attr(\"name\") + '\":\"' + $(this).val()+'\", ';\r\n\t\t});\r\n\t\tthisObj.children(\"input[type='checkbox']:checked\").each( function(){\r\n\t\t\t//si es un checkbox seleccionado\r\n\t\t\tprefs = prefs + '\"' + $(this).attr(\"name\") + '\":\"true\", ';\r\n\t\t});\r\n\t\tthisObj.children(\"input[type='checkbox']:not(:checked)\").each( function(){\r\n\t\t\t//si es un checkbox no seleccionado\r\n\t\t\tprefs = prefs + '\"' + $(this).attr(\"name\") + '\":\"false\", ';\r\n\t\t});\r\n\t\tthisObj.children(\"select\").each( function(){\r\n\t\t\t//si es un select\r\n\t\t\tif($(this).val())\r\n\t\t\t\tprefs = prefs + '\"' + $(this).attr(\"name\") + '\":\"' + $(this).val()+'\", ';\r\n\t\t});\r\n\t\tprefs=prefs.substring(0,prefs.length - 2);\r\n\t\tprefs = prefs + '}';\r\n\r\n\t\tvar tehform = $.parseJSON(prefs);\r\n var o = {};\r\n\t\t$.each(tehform, function(key, value) { \r\n\t\t\to[\"widgetparams[\" + key + \"]\"] = value || '';\r\n\t\t});\r\n\r\n\t\t$.ajax({\r\n\t\t\turl: \"/containers/\" + cid + \"/save_preferences.js\",\r\n\t\t\ttype: \"POST\",\r\n\t\t\tdataType: \"json\",\r\n\t\t\tdata: $.param(o),\r\n\t\t\tsuccess: function (data) {\r\n\t\t\t\tif (data['success'] == true)\r\n\t\t\t\t{\r\n\t\t\t\t\tBW.setPreferencesValues($.parseJSON(prefs));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn false;\r\n\t});\r\n }", "function saveSettings() {\n\n chrome.storage.local.set({\n\n words: wordArray,\n pages: pagesArray\n\n }, function() {\n\n \t//**********************************\n\t// OPTIONS SAVED INTO LOCAL STORAGE\n\t//**********************************\n\n });\n\n}", "function saveSettings() {\r\n \"use strict\";\r\n localStorage.setItem('TrimpzSettings', JSON.stringify(trimpzSettings));\r\n}", "function setDefaults() {\n\tconfig.all = {\n\t\ttitleStyle: {\n\t\t\t'font-src': 'http://fonts.googleapis.com/css?family=Chango',\n\t\t\t'font-family': 'Chango, cursive',\n\t\t\t'color': '#000000',\n\t\t\t'font-size': '48px'\n\t\t},\n\t\ttimerStyle: {\n\t\t\t'background-color': '#32cd32',\n\t\t\t'font-src': 'http://fonts.googleapis.com/css?family=Chango',\n\t\t\t'font-family': 'Chango, cursive',\n\t\t\t'color': '#000000',\n\t\t\t'font-size': '48px'\n\t\t},\n\t\ttimers: [],\n\t\twindowSettings: {\n\t\t\twidth: 650,\n\t\t\theight: 350\n\t\t},\n\t\tusername: '',\n\t\tpassword: '',\n\t\tchannel: '',\n\t\tidInc: 0,\n\t\tactiveID: null\n\t}\n}", "function setValues (values) {\n $('#autoprefixer-settings-visualCascade').prop('checked', values.visualCascade);\n\n $dialog.find('#autoprefixer-settings-browsers').html(TemplateEngine.render(settingsDialogBrowser, {\n browsers: Preferences.get('browsers')\n }));\n }", "function writePrefsCookies() {\n\t\tvar exdate = new Date();\n\t\t//cookie expires in 30 days\n\t\texdate.setDate(exdate.getDate() + 30);\n\n\t\tdocument.cookie = prefNames[this.languageIdx] + \"=\" + escape(this.language) + \";expires=\" + exdate.toUTCString();\n\t\tdocument.cookie = prefNames[this.routingLanguageIdx] + \"=\" + escape(this.routingLanguage) + \";expires=\" + exdate.toUTCString();\n\t\tdocument.cookie = prefNames[this.distanceUnitIdx] + \"=\" + escape(this.distanceUnit) + \";expires=\" + exdate.toUTCString();\n\t\tdocument.cookie = prefNames[this.versionIdx] + \"=\" + escape(this.version) + \";expires=\" + exdate.toUTCString();\n\n\t\tcookiesAvailable = true;\n\t}", "function readPreferences() {\n setTimeout(window.sizeToContent, 0);\n\n gStrbundle = $(\"strings\");\n var prefs = Components.classes[\"@mozilla.org/preferences-service;1\"].getService(Components.interfaces.nsIPrefService);\n gPrefs = prefs.getBranch(\"fireftp.\");\n\n try {\n var asciiFiles = gPrefs.getComplexValue(\"asciifiles\", Components.interfaces.nsISupportsString).data.split(\",\");\n\n for (var x = 0; x < asciiFiles.length && asciiFiles[x] != \"\"; ++x) {\n $('asciilist').appendItem(asciiFiles[x], asciiFiles[x]);\n gPrefAsciiFiles.push(asciiFiles[x]);\n }\n\n } catch (ex) { }\n}", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get({\n preferredName: '',\n investmentUrl: '',\n donationUrl: ''\n }, function(items) {\n $('#preferred-name').val(items.preferredName)\n $('#investment-url').val(items.investmentUrl)\n $('#donation-url').val(items.donationUrl)\n });\n}", "function createPreferencesWindow() {\n //Define the preferences window\n prefWindow = new BrowserWindow({\n width: 850,\n height: 600,\n minWidth: 735,\n minHeight: 500,\n title: 'Preferences',\n icon: path.join(__dirname, 'assets/icons/app_icon.png'),\n frame: false,\n trasparent: true,\n darkTheme: true\n });\n\n //load the preferences file\n prefWindow.loadURL(`file://${__dirname}/preferences.html`);\n\n // Emitted when the window is closed.\n prefWindow.on('closed', () => {\n // Dereference the window object, usually you would store windows\n // in an array if your app supports multi windows, this is the time\n // when you should delete the corresponding element.\n prefWindow = null;\n });\n}", "function willChangePreferences () {\n\t//log (\"onWillChangePreferences ()\");\n\t\n\tselectedTheme\t\t= preferences.theme.value;\n\toldUserLocation\t= preferences.userLocation.value;\n\toldCityName\t\t\t= preferences.cityName.value;\n\t\n\twidget.onPreferencesCancelled = preferencesCancelled;\n\t\n\tsaveWindowPosition();\n}", "function loadOptions() {\n\n\t\tvar preferences = controller.getPreferences();\n\n\t\tvar domainParts = preferences.domain.split(\"/\");\n\t\tvar domain = String.format(\"{0}//{1}\", domainParts[0], domainParts[2]);\n\n\t\t$(\"#domain\").val(domain);\n\t\t$(\"#interval\").val(preferences.interval / 1000);\n\t\t$(\"#notificationUsers\").val(preferences.notificationUsers);\n\t\t$(\"#changeset\").val(preferences.changeset);\n\n\t}", "function cargarPreferencias(){\n // obteniendo un elmeneto del localStorage;\n var colorGuardado = localStorage.getItem(\"color\");\n var nombreGuardado = localStorage.getItem(\"nombre\");\n var apellidoGuardado = localStorage.getItem(\"apellido\");\n if(colorGuardado && nombreGuardado && apellidoGuardado){\n body.style.backgroundColor = colorGuardado;\n inputApellido.value = apellidoGuardado;\n inputNombre.value = nombreGuardado;\n inputColor.value = colorGuardado;\n }else{\n console.log(\"No habia un color favorito preconfigurado\");\n }\n }", "function setPrefString(absolutePrefPath, value){\r\n \r\n //and the top level (as using the absolute path)\r\n \r\n Services.prefs.setStringPref(absolutePrefPath, value);\n \r\n}", "function setFromLocal () {\n _.each(settings, (v, k) => {\n var value = localStorage.getItem(k);\n if (value) {\n settings[k] = JSON.parse(value);\n }\n });\n}", "function updateStoredSettings() {\n let settings = {}\n document.querySelectorAll('div[class^=\"gymContent\"] input[type=\"checkbox\"]').forEach(checkbox => settings[checkbox.name] = checkbox.checked);\n\n GM_setValue('gymTabHiderSettings', settings);\n}", "set props(p) {\n props = p;\n }", "function initialiseStoredSettings() {\n let storedSettings = GM_getValue('gymTabHiderSettings', {});\n for (let stat in storedSettings)\n if (storedSettings[stat]) {\n document.querySelector(`input[type=\"checkbox\"][id=${stat}]`).checked = true;\n \n let trainBox = document.querySelector(`li[class^=\"${stat}\"] div[class^=\"inputWrapper\"]`).parentElement;\n trainBox.style['pointer-events'] = 'none';\n trainBox.style.opacity = '0.5';\n }\n}", "async function setLanguagePairs() {\n let defaultClient = LiltNode.ApiClient.instance;\n // Configure API key authorization: ApiKeyAuth\n let ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];\n let APIKey = window.localStorage.getItem(\"LILTAPIKEY\");\n if (!APIKey) {\n handleError(\"No API Key Found\");\n return;\n }\n ApiKeyAuth.apiKey = APIKey;\n let BasicAuth = defaultClient.authentications['BasicAuth'];\n BasicAuth.username = APIKey;\n BasicAuth.password = APIKey;\n\n let apiMemoryInstance = new LiltNode.MemoriesApi();\n let apiLanguageInstance = new LiltNode.LanguagesApi();\n\n let memories = await apiMemoryInstance.getMemory();\n let languages = await apiLanguageInstance.getLanguages();\n let dict = languages.code_to_name;\n\n let languagePairs = new Set();\n for (let i = 0; i < memories.length; i++) {\n let memory = memories[i];\n let src = dict[memory.srclang];\n let trg = dict[memory.trglang];\n languagePairs.add(src + \" to \" + trg);\n let cached = window.localStorage.getItem(memory.srclang + memory.trglang + \"LiltMemory\");\n if (cached !== null) {\n memoriesDict[src + \" to \" + trg] = [memory.srclang, memory.trglang, cached];\n } else {\n memoriesDict[src + \" to \" + trg] = [memory.srclang, memory.trglang, memory.id];\n }\n }\n\n let options = \"\"\n for (let pair of languagePairs) {\n let splitPair = pair.split(\" to \");\n\n if (languagePairs.has(splitPair[1] + \" to \" + splitPair[0])) {\n options += '<option value=\"' + pair + '\" />';\n }\n }\n\n document.getElementById('languages').innerHTML = options;\n}", "setPuzzleList(list) {\n\t\tthis.puzzleListCache = list;\n\t}", "function savePreference(item, value) {\n window.localStorage.setItem(item, value);\n }", "function createPref(webid, account, dom) {\n console.log(\"Creating preferences\");\n\n var exists = false;\n if (dom) {\n var d = document.querySelector(\"webid-signup\");\n d.appendElement(d.$.profilestatus, '<p>Updating preferences file...<core-icon id=\"prefdone\" icon=\"done\" class=\"greencolor\" hidden></core-icon></p>');\n if (d.$.haveWebID && d.$.haveWebID.checked) {\n exists = true;\n }\n }\n\n var g = new $rdf.graph();\n if (!exists) {\n g.add($rdf.sym(webid), WS('preferencesFile'), $rdf.sym('')); \n }\n workspaces.forEach(function(workspace) {\n g.add($rdf.sym(webid), WS('workspace'), $rdf.sym(account+workspace+'/'));\n });\n \n var prefURI = account+'Preferences/prefs';\n var s = new $rdf.Serializer(g).toN3(g);\n\n if (exists) {\n // fetch profile and append to preferences graph\n var kb = new $rdf.graph();\n var kf = new $rdf.fetcher(kb, TIMEOUT);\n var docURI = webid.slice(0, webid.indexOf('#'));\n\n kf.nowOrWhenFetched(docURI,undefined,function(ok, body, xhr) {\n if (!ok) {\n console.log(\"Could not load profile: HTTP \"+xhr.status);\n } else {\n p = kb.any($rdf.sym(webid), WS('preferencesFile'));\n if (p && p.value.length > 0) {\n prefURI = p.value;\n // fetch preferences file from profile\n pg = new $rdf.graph();\n var f = new $rdf.fetcher(pg, TIMEOUT);\n f.nowOrWhenFetched(prefURI,undefined,function(ok, body, xhr) {\n var triples = pg.statementsMatching(undefined, undefined, undefined, $rdf.sym(prefURI));\n // add existing triples from pref file\n triples.forEach(function(st) {\n g.addStatement(st);\n });\n s = new $rdf.Serializer(g).toN3(g);\n writePref(webid, prefURI, s, exists, account, dom);\n });\n } else {\n writePref(webid, prefURI, s, exists, account, dom);\n }\n }\n });\n } else {\n writePref(webid, prefURI, s, exists, account, dom);\n }\n}", "function initPVals(){\n\n\tfor (var i=0; i<viewerParams.partsKeys.length; i++){\n\t\tvar p = viewerParams.partsKeys[i];\n\t\tif (! viewerParams.reset){\n\t\t\tviewerParams.partsMesh[p] = [];\n\t\t}\n\n\t\t// store the name inside the dictionary\n\t\tviewerParams.parts[p].pkey = p;\n\n\t\t//misc\n\t\tif (!viewerParams.haveOctree[p]) viewerParams.plotNmax[p] = viewerParams.parts.count[p];\n\t\tviewerParams.PsizeMult[p] = 1.;\n\t\tviewerParams.showParts[p] = true;\n\t\tviewerParams.updateOnOff[p] = false;\n\n\t\t//filter\n\t\tviewerParams.updateFilter[p] = false;\n\t\tviewerParams.filterLims[p] = {};\n\t\tviewerParams.filterVals[p] = {};\n\t\tviewerParams.invertFilter[p] = {};\n\t\tviewerParams.fkeys[p] = [];\n\n\t\t//colormap\n\t\tviewerParams.ckeys[p] = [];\n\t\tviewerParams.colormapVariable[p] = 0;\n\t\tviewerParams.colormap[p] = 4/256;\n\t\tviewerParams.showColormap[p] = false;\n\t\tviewerParams.updateColormapVariable[p] = false;\n\t\tviewerParams.colormapVals[p] = {};\n\t\tviewerParams.colormapLims[p] = {};\n\n\t\t// radius scaling\n\t\tviewerParams.radiusVariable[p] = 0; // corresponds to \"None\"\n\t\tviewerParams.updateRadiusVariable[p] = false;\n\t\tviewerParams.rkeys[p] = [];\n\n\t\t//blending\n\t\tviewerParams.blendingMode[p] = 'additive';\n\t\tviewerParams.depthWrite[p] = false;\n\t\tviewerParams.depthTest[p] = false;\n\n\t\t//velocities\n\t\tviewerParams.showVel[p] = false;\n\t\tviewerParams.velVectorWidth[p] = 1.;\n\t\tviewerParams.velGradient[p] = 0.; //0 == false, 1 == true\n\t\tviewerParams.animateVel[p] = false;\n\t\tviewerParams.animateVelDt[p] = 0.;\n\t\tviewerParams.animateVelTmax[p] = 0.;\n\t\tif (viewerParams.parts[p].Velocities_flat != null){\n\t\t\tif (!viewerParams.reset){\n\t\t\t\tcalcVelVals(viewerParams.parts[p]);\n\t\t\t\tif(!viewerParams.parts[p].hasOwnProperty(\"filterKeys\")){\n\t\t\t\t\tviewerParams.parts[p].filterKeys = [];\n\t\t\t\t}\n\t\t\t \n\t\t\t}\n\t\t\tviewerParams.velType[p] = 'line';\n\t\t}\n\t\t\n\t\t//filters\n\t\t//in case there are no filter possibilities (but will be overwritten below)\n\t\tviewerParams.fkeys[p] = [\"None\"];\n\t\tviewerParams.filterLims[p][\"None\"] = [0,1];\n\t\tviewerParams.filterVals[p][\"None\"] = [0,1]; \n\t\tvar haveCurrentFilter = true;\n\t\tif (viewerParams.parts[p].currentlyShownFilter == undefined) {\n\t\t\tviewerParams.parts[p].currentlyShownFilter = [\"None\"];\n\t\t\thaveCurrentFilter = false;\n\t\t}\n\t\tif (viewerParams.parts[p].hasOwnProperty(\"filterKeys\")){\n\t\t\tviewerParams.fkeys[p] = viewerParams.parts[p].filterKeys;\n\t\t\tviewerParams.parts[p]['playbackTicks'] = 0;\n\t\t\tviewerParams.parts[p]['playbackTickRate'] = 10; \n\t\t\tfor (var k=0; k<viewerParams.fkeys[p].length; k++){\n\t\t\t\t// TODO we should consider removing this \"feature\"\n\t\t\t\t// and just require users to pass in the mag velocity\n\t\t\t\t// as its own field-- or also radius and do radius/speed\n\t\t\t\t// flags or something\n\t\t\t\t//if (viewerParams.fkeys[p][k] == \"Velocities\"){\n\t\t\t\t\t//viewerParams.fkeys[p][k] = \"magVelocities\";\n\t\t\t\t//}\n\t\t\t\tvar fkey = viewerParams.fkeys[p][k];\n\t\t\t\t//calculate limits for the filters\n\t\t\t\tif (viewerParams.parts[p][fkey] != null){\n\t\t\t\t\tvar m = calcMinMax(p,fkey)\n\t\t\t\t\tviewerParams.filterLims[p][fkey] = [m.min, m.max];\n\t\t\t\t\tviewerParams.filterVals[p][fkey] = [m.min, m.max];\n\t\t\t\t\tviewerParams.invertFilter[p][fkey] = false;\n\t\t\t\t\t// set the currently shown filter for each part type at startup\n\t\t\t\t\t// so the first click isn't broken\n\t\t\t\t\tif (!haveCurrentFilter) {\n\t\t\t\t\t\tviewerParams.parts[p].currentlyShownFilter = fkey;\n\t\t\t\t\t\thaveCurrentFilter = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//colormap\n\t\t//in case there are no colormap possibilities (but will be overwritten below)\n\t\tviewerParams.ckeys[p] = [\"None\"];\n\t\tviewerParams.colormapLims[p][\"None\"] = [0,1];\n\t\tviewerParams.colormapVals[p][\"None\"] = [0,1];\n\t\tif (viewerParams.parts[p].hasOwnProperty(\"colormapKeys\")){\n\t\t\tif (viewerParams.parts[p].colormapKeys.length > 0){\n\t\t\t\tviewerParams.ckeys[p] = viewerParams.parts[p].colormapKeys;\n\t\t\t\tfor (var k=0; k<viewerParams.ckeys[p].length; k++){\n\t\t\t\t\t\t// TODO we should consider removing this \"feature\"\n\t\t\t\t\t\t// and just require users to pass in the mag velocity\n\t\t\t\t\t\t// as its own field-- or also radius and do radius/speed\n\t\t\t\t\t\t// flags or something\n\t\t\t\t\t//if (viewerParams.ckeys[p][k] == \"Velocities\"){\n\t\t\t\t\t\t//viewerParams.ckeys[p][k] = \"magVelocities\";\n\t\t\t\t\t//}\n\t\t\t\t\tvar ckey = viewerParams.ckeys[p][k];\n\t\t\t\t\tviewerParams.colormapLims[p][ckey] = [0,1];\n\t\t\t\t\tviewerParams.colormapVals[p][ckey] = [0,1];\n\t\t\t\t\tif (viewerParams.parts[p][ckey] != null){\n\t\t\t\t\t\t//could probably take results from filter to save time, but will do this again to be safe\n\t\t\t\t\t\tvar m = calcMinMax(p,ckey)\n\t\t\t\t\t\tviewerParams.colormapLims[p][ckey] = [m.min, m.max];\n\t\t\t\t\t\tviewerParams.colormapVals[p][ckey] = [m.min, m.max];\n\t\t\t\t\t}\n//////////////////////////////////////////////////////////////////////// \n////////////// I am not sure where to put this <-- I don't think this is used anymore (?)\n//////////////////////////////////////////////////////////////////////// \n\t\t\t\t\tif (i == viewerParams.partsKeys.length - 1 && k == viewerParams.ckeys[p].length -1) viewerParams.ready = true;\n//////////////////////////////////////////////////////////////////////// \n//////////////////////////////////////////////////////////////////////// \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// radius scaling\n\t\t// None for no radius scaling radius possibilities\n\t\tviewerParams.rkeys[p] = [\"None\"];\n\t\tif (viewerParams.parts[p].hasOwnProperty(\"radiusKeys\") &&\n\t\t\tviewerParams.parts[p].radiusKeys.length > 0){\n\t\t\t\tviewerParams.rkeys[p] = viewerParams.rkeys[p].concat(viewerParams.parts[p].radiusKeys);\n\t\t}\n\n\t\t/*\n\t\tif (viewerParams.haveOctree[p]){\n\t\t\t// tell app we can scale by OctreeRadii\n\t\t\tviewerParams.rkeys[p].push('OctreeRadii')\n\t\t\t// we just pushed OctreeRadii to the end so we'll set it to the final value\n\t\t\tviewerParams.radiusVariable[p] = viewerParams.rkeys[p].length-1\n\t\t\tviewerParams.updateRadiusVariable[p] = true;\n\t\t}\n\t\t*/\n\t}\n}", "function saveSettings(){\n\t//Get the user settings\n\tgetSettings();\n\n\t//Create a variable with all user settings\n\tvar settings = {\n\t\tcountry: country,\n\t\tincludeOldResults: String(includeOldResults),\n\t\tsearchStrings: searchStrings,\n\t\tlocations: locations,\n\t\tradiuses: radiuses,\n\t}\n\n\t//Save the user settings to the local storage\n\tlocalStorage.setItem(\"settings\",JSON.stringify(settings));\n\n\tconsole.log(\"Settings saved\");\n\tconsole.log(JSON.stringify(settings));\n}" ]
[ "0.7080287", "0.6612643", "0.62301767", "0.6156726", "0.61562616", "0.5953245", "0.5952078", "0.5913905", "0.5895778", "0.58920187", "0.5891158", "0.57420784", "0.57243925", "0.5721223", "0.5703076", "0.5673602", "0.56454885", "0.5637326", "0.563437", "0.5587519", "0.5580934", "0.5502979", "0.54765075", "0.5474272", "0.5460298", "0.54421765", "0.54208654", "0.54035044", "0.53497916", "0.53457886", "0.53457505", "0.5341774", "0.53229374", "0.5316499", "0.5302191", "0.5295751", "0.52563673", "0.52527773", "0.5245123", "0.5232473", "0.51711315", "0.51684284", "0.5162111", "0.5154579", "0.51536214", "0.515269", "0.51469713", "0.51449674", "0.5136792", "0.5136792", "0.51329917", "0.51133204", "0.507841", "0.5077485", "0.5053836", "0.5050465", "0.5047772", "0.50452757", "0.50450295", "0.5044925", "0.5030565", "0.50148064", "0.50082415", "0.49902314", "0.49856767", "0.49775591", "0.497427", "0.4967774", "0.49666154", "0.49647528", "0.49617797", "0.49592412", "0.49546853", "0.49502864", "0.4949897", "0.49457848", "0.49436688", "0.4935782", "0.4932717", "0.49226797", "0.4920915", "0.49190992", "0.49190637", "0.49158525", "0.49107394", "0.49078134", "0.4886901", "0.4877328", "0.48758304", "0.4874166", "0.4871435", "0.4865029", "0.48650113", "0.48622718", "0.48610976", "0.48548803", "0.4853739", "0.48390448", "0.48326257", "0.48284352" ]
0.571238
14
Goes to the last visited venue
function pag_goToPreviousVenue() { // If there is no previous venue, report an error if (pag_previousVenues.length == 0) { alert("There are no more venues to go back to!"); } else { pag_previousVenues.pop(); pag_setStatus('Entering venue...'); pag_xmlRpcClient.call("enterPreviousVenue"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "gotoLastHit() {\n this.gotoHit(this.found.length - 1);\n }", "gotoLastHit() {\n this.gotoHit(this.found.length - 1);\n }", "gotoLastHit() {\n this.gotoHit(this.found.length - 1);\n }", "gotoLastHit() {\n this.gotoHit(this.found.length - 1);\n }", "function hasVisited( venue ) {\n if ( World.visited.indexOf( venue.id ) === -1 ) {\n return false;\n }\n PubSub.publish( Actions.SHOW_FEEDBACK, {\n title: \"\", message: Copy.GAME.STATE.visited\n });\n return true;\n}", "function navigateToLastHoveredSkillIsland() {\n console.log(lastHoveredSkillIsland.url);\n window.location.href = lastHoveredSkillIsland.url;\n }", "function venuePage(){\n\tconsole.log(event.target);\n\tvenueIdCell = event.target.parentNode.lastChild;\n\twindow.location.href = \"venue/\" + venueIdCell.getAttribute(\"value\");\n}", "function venueNavigate() {\n //code\n var eventObject = _.find(venueDetails, function (object) {\n return object.place_id === displayInfo.eventLocationId;\n });\n navigateFlag = 1;\n var gposition = eventObject.geometry.location;\n var position;\n //problem with synchronization with _handeInviteCode\n eventObject.placeId=eventObject.place_id;\n eventObject.placeName=eventObject.name;\n _setupStartingLocation2wPlaceObject(eventObject,gposition);\n updateSearchBox(gposition, '#startInput2');\n //this will calculate route\n if(platform===2){\n position=convert2pluglatLng(gposition);\n startingLocation2.setPosition(position,true,true);\n }else\n startingLocation2.setPosition(gposition,true,true);\n}", "function lastVisit(name){\n return visits.get(users.find(person => person.name === name))\n}", "function volver(){ javascript:history.go(-1); }", "function goBack(){\n\tg_cache.user_history.pop();\n\tfetchUser(g_cache.user_history.pop());\n}", "function goToNext() {\n var nextId = getNextLocationIndex();\n if (nextId != null) {\n setCurrentLocation(nextId);\n }\n }", "function goBack(){\n // update the master page number setting and fetch the previous page of data\n // master page number is not updated when at page 1\n if (page > 1){\n page -= 1\n getMonsters()\n } \n}", "function goToLaplides(){\n\t\tif(visitedLap===0){\n\t\t\tvisitedLap=1;\n\t\t\t// artifacts=1;\n\t\t\tgamePrompt(\"You enter orbit around Laplides. Looking down at the planet, you see signs of atomic war and realize there is no option but to turn around.\",beginTravel);\n\t\t}else{\n\t\t\tgamePrompt([\"You've already been here!\",\"Where to next?\"],beginTravel);\n\t\t}\n}", "function clickHandlerBack(e) {\n history.push('/profMom');\n }", "goBack() {\n // signs users out b/c Firebase won't let you create a user without also logging in as them\n // this saves confusion after a team captain creates a player and goes back signed in as a different person\n firebase.auth().signOut();\n window.history.back();\n }", "function goToAenides(){\n\t\tif(visitedAen===0){\n\t\t\tvisitedAen=1;\n\t\t\t// artifacts=1;\n\t\t\tgamePrompt(\"You discover upon arrival to Aenides that they are a hostile people. You attempt to land, but they begin to fire upon your S.R.S.V. and you are forced to retreat.\",beginTravel);\n\t\t}else{\n\t\t\tgamePrompt([\"You've already been here!\",\"Where to next?\"],beginTravel);\n\t\t}\n}", "function lastpage() {\n window.history.back();\n}", "function lastPage() {\n \n if (page > 1) {\n page -= 1;\n getURL();\n\n }\n else {\n console.log(\"Already on page 1\");\n\n }\n updateButton();\n \n}", "function goBack() {\n // remove latest from directory arrays\n dirs.pop()\n // browse to our new route\n navigate()\n}", "function goToLastQuestion(){ \r\n\tcount--\r\n\tupdateItems();\r\n}", "return() {\n this.location.back();\n }", "function prevscene() {\n\tvar location = document\n\t\t.getElementById('skybox')\n\t\t.getAttribute('src')\n\t\t.split('#')[1];\n\tvar currentLoc = parseInt(location.substring(3));\n\tif (currentLoc - 1 != 0) {\n\t\t$('#loc'.concat(currentLoc - 1, 'spot')).click();\n\t}\n}", "function newGoBack(url){\r\n\tgoFrame(url);\r\n}", "function backToLastLocation(params) {\n\tif (params && params.toQueryString) {\n\t\tparams = params.toQueryString();\n\t}\n\tself.location = context + \"/do/back?currentPage=\" + location.pathname + \"*?\" + params;\n}", "function GetLastVisit() {\n\n\n if (gLastVisit == \"\") {\n\n return \"This is your first Search.\";\n\n }\n\n else {\n\n var oldVisitDate = new Date(gLastVisit);\n\n return \"Your last visit to this page was on \"\n\n + gLastVisit + \" and you searched for \" + gLastSearch + \".<BR>You have been here \"\n\n + gNumVisits + \" time\" + (gNumVisits > 1 ? \"s\" : \"\")\n\n + \" before.\"\n\n }\n\n}", "function calculateWin(id) {\n db.collection(\"rooms\").doc(id).collection(\"votes\").orderBy(\"value\", \"desc\").limit(1).get().then(function(snap) {\n snap.forEach(function(doc) {\n var highest = doc.data().id;\n console.log(highest);\n db.collection(\"rooms\").doc(id).update({\n current_winner: highest\n })\n })\n window.location.href = \"group-end.html?id=\" + id;\n })\n }", "switchBackToShopmanagament() {\n window.location.assign(\"#/eventmgmt/shop\")\n }", "function onMostVisitedChange() {\n reloadTiles();\n}", "function goBack()\n {\n $state.go('app.location_city_browse');\n }", "function lastPage(){\n history.back();\n}", "goBackToHairdresserAccount(){\n\t\tvar self=this;\n\t\tif(self.AuthToken.getObj('hairdresserDetails')){\n\t\t\tself.AuthToken.erase('hairdresserDetails');\n\t\t}\n\t\tself.$state.go('hairdresseraccount');\n\t\t//self.$location.path('/hairdresser/account');\n\t}", "function goBack()\n\t{\n\t\n\t\t window.location = \"input.html?lang=\" + lang +\"&dist=\" + dist +\"&diam=\" + diam + \"&trag=\" + traj + \"&velo=\" + velo + \"&pjd=\" + pjd + \"&tjd=\" + tgd + \"&wlvl=\" + wlvl + \"&planet=\" + planet;\n\t}//=========================================================================================", "function pushFeedPage() {\n history.goBack()\n }", "function goBack() {\n\t\ttogglePage();\n\t\tdisposeThrownShurikens();\n\t\tupdateThrownShurikenCount();\n\t\tcleanBelt();\n\t}", "goHigher () {\n if (this.breadcrumbs.length <= 1) {\n return;\n }\n const parts = this.breadcrumbs.slice(0, this.breadcrumbs.length - 1);\n this.goToPath('/' + parts.join('/'));\n }", "go(amount) {\n const was = this.current;\n while (amount > 0) {\n if (this.current.next) this.current = this.current.next;\n --amount;\n }\n while (amount < 0) {\n if (this.current.prev) this.current = this.current.prev;\n ++amount;\n }\n\n // If moving from one page to another\n if (this.current && was && this.current !== was) {\n const { window } = this.current;\n this.updateLocation(window, this.current.url);\n this.focus(window);\n\n if (this.current.pushState || was.pushState) {\n // Created with pushState/replaceState, send popstate event if navigating\n // within same host.\n const oldHost = URL.parse(was.url).host;\n const newHost = URL.parse(this.current.url).host;\n if (oldHost === newHost) {\n const popstate = window.document.createEvent('HTMLEvents');\n popstate.initEvent('popstate', false, false);\n popstate.state = this.current.pushState;\n window._eventQueue.enqueue(function () {\n window.dispatchEvent(popstate);\n });\n }\n } else if (hashChange(was, this.current.url)) {\n const hashchange = window.document.createEvent('HTMLEvents');\n hashchange.initEvent('hashchange', true, false);\n window._eventQueue.enqueue(function () {\n window.dispatchEvent(hashchange);\n });\n }\n }\n }", "function gotoLastPage(){\n\tvar last_pagenum = getLastPagenum(); \n\tgotoTargetPage(last_pagenum);\n\t$('div#conceptcode_pagination_holder > ul.pagination').trigger(\"gotoLastPageComplete.c2s_ui.pagination\");\n}", "function viewBackFromOther() {\n\tlogInfo('Back send info user approve');\n}", "goBackToHairdresserAccount(){\n\t\tvar self=this;\n\t\tself.AuthToken.erase('description');\n\t\tself.$location.path('/hairdresser/account');\n\t}", "function goBack() {\n history.go(-1);\n }", "function goBack() {\r\n \t\t$state.go('main.afiliado.edit.examen.list', {afiliadoId: $stateParams.afiliadoId});\r\n \t}", "function sharingNavigate(){\n/* from createInvite\n\n lat: venue.geometry.location.lat(), //lat,\n lng: venue.geometry.location.lng(), //lng,\n placeId: venue.place_id, // placeId,\n placeName: venue.name, //placeName,\n placeDescription: venue.description, //placeDescription,\n placeAddress: venue.address, //placeAddress,\n length: length,\n token: displayInfo.token,\n selector: displayInfo.selector,\n userId: \"none\", //note that on the server side, the id is determined by the token and selector\n*/\n\n var gposition = eventObject.geometry.location;\n _setupStartingLocation2wPlaceObject(eventObject,gposition);\n navigateFlag=1;\n\n console.log('startingLocation2' + startingLocation2.marker);\n turnByTurn();\n}", "function navigateBackToBooking1() {\n\t\t$state.go('booking.booking1');\n\t\tvar problemObj = custportalGetSetService.getProblem();\n\t\t$timeout(function() {\n\t\t\t\n\t\t\tif(problemObj.otherProblem != '' && problemObj.otherProblem != undefined) {\n\t\t\t\tvm.model.otherProblem = problemObj.otherProblem;\n\t\t\t\tif (problemObj.selectedItemId != \"\" && problemObj.selectedItemId != undefined) {\n\t\t\t\t\tlocalVariables.selectedItem = document.getElementById(problemObj.selectedItemId);\n\t\t\t\t\tlocalVariables.selectedItem.href.baseVal = \"./images/customer_portal/circle.png\";\n\t\t\t\t}\n\t\t\t} else \t\t\n\t\t\tif (problemObj.selectedItemId != \"\" && problemObj.selectedItemId != undefined) {\n\t\t\t\tlocalVariables.selectedItem = document.getElementById(problemObj.selectedItemId);\n\t\t\t\tlocalVariables.selectedItem.href.baseVal = \"./images/customer_portal/circle_tick.png\";\n\t\t\t\tif(problemObj.otherProblem != '' && problemObj.otherProblem != undefined) {\n\t\t\t\t\tvm.model.otherProblem = '';\n\t\t\t\t}\n\t\t\t}\n\t\t}, 200);\n\t}", "function onGoBack() {\n // history.goBack();\n history.push(location?.state?.from ?? \"/\");\n }", "function viewBackFromOther() {\n\tlogInfo('Back change pasword');\n}", "function viewBackFromOther() {\n\tlogInfo('Back change pasword');\n}", "function nextscene() {\n\tvar location = document\n\t\t.getElementById('skybox')\n\t\t.getAttribute('src')\n\t\t.split('#')[1];\n\tvar currentLoc = parseInt(location.substring(3));\n\tif ($('#loc'.concat(currentLoc + 1, 'spot'))) {\n\t\t$('#loc'.concat(currentLoc + 1, 'spot')).click();\n\t}\n}", "function tourBattleEnd(winner, loser, result) {\r\n var winname = sys.name(winner).toLowerCase();\r\n var losename = sys.name(loser).toLowerCase();\r\n var key = null;\r\n for (var x in tours.tour) {\r\n if (isInSpecificTour(winname, x)) {\r\n key = x;\r\n break;\r\n }\r\n if (isInSpecificTour(losename, x)) {\r\n key = x;\r\n break;\r\n }\r\n }\r\n if (key === null) return;\r\n /* For tournament matches */\r\n if (tours.tour[key].players.indexOf(winname) > -1 && tours.tour[key].players.indexOf(losename) > -1) {\r\n var winindex = tours.tour[key].battlers.hasOwnProperty(winname);\r\n if (winindex) {\r\n var battletime = parseInt(sys.time(), 10)-tours.tour[key].battlers[winname].time;\r\n if (result == \"forfeit\" && ((battletime < 30 && !is1v1Tour(key)) || battletime < 5)) {\r\n sendBotAll(sys.name(loser)+\" forfeited against \"+sys.name(winner)+\" in a \"+getFullTourName(key)+\" match after \"+battletime+\" seconds.\",sys.channelId(\"Victory Road\"), false);\r\n }\r\n delete tours.tour[key].battlers[winname];\r\n }\r\n var loseindex = tours.tour[key].battlers.hasOwnProperty(losename);\r\n if (loseindex) delete tours.tour[key].battlers[losename];\r\n if (!winindex || !loseindex) {\r\n return;\r\n }\r\n if (result == \"tie\") {\r\n sendBotAll(\"The match between \"+winname+\" and \"+losename+\" ended in a tie, please rematch!\", tourschan, false);\r\n markActive(winner, \"tie\");\r\n markActive(loser, \"tie\");\r\n if (tours.tour[key].draws.indexOf(winname) == -1) {\r\n tours.tour[key].draws.push(winname, losename);\r\n }\r\n else {\r\n sendBotAll(winname+\" and \"+losename+\" drew more than once! Please check their match!\", sys.channelId(\"Victory Road\"), false);\r\n }\r\n return;\r\n }\r\n battleend(winner, loser, key);\r\n save_cache();\r\n }\r\n}", "function TravelReturn() {\n\tnextMove = OPC.lastPos;\n\tOPC.encounter = \"\";\n\tif(OPC.hpCurrent < OPC.hpMax / 2) {\n\t\tOPC.goal = \"short rest\";\n\t}\n\telse {\n\t\tOPC.goal = \"travel\";\n\t}\n\tTravelMove(nextMove);\n}", "function goToLastVideo(channelKey, key) {\n var url = \"./BE/getLastVideo.php?channelId=\" + channelKey + \"&code=\" + key.toUpperCase() + \"&r=\" + Math.random();\n\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n //console.log(this.responseText);\n //var lastVideoURL = \"http://youtu.be/\"+JSON.parse(this.responseText).items[0].id.videoId;\n var lastVideoURL = \"http://youtube.com\" + this.responseText;\n window.location.href = lastVideoURL;\n }\n };\n\n xhttp.open(\"GET\", url, true);\n xhttp.send();\n}", "gotoLastSavePoint() {\n let lastSavePointStep = 0;\n let stepCount = 0;\n\n this.steps.groups.forEach((group) => {\n group.steps.forEach((step) => {\n if (\n stepCount <= this.currentStep\n && $.inArray('savepoint', step.options) !== -1\n ) {\n lastSavePointStep = stepCount;\n }\n stepCount += 1;\n });\n });\n\n this.gotoStep(lastSavePointStep);\n }", "reachLast() {\n if (this.y < 0) {\n this.resetPosition();\n scores.add();\n }\n }", "function goBack() {\n $location.url('/course/professor' + '/' + vm.userInfo.userid + \"/\" + vm.semesterId);\n }", "function navigateBack() {\n try {\n window.history.back();\n console.log(\"status pass : Navigated one step back from current position in recent history\" + url);\n } catch (err) {\n console.log(\"status fail : Broken link or no network connection\");\n }\n}", "function goToPrevious() {\n var prevId = getPreviousLocationIndex();\n if (prevId != null) {\n setCurrentLocation(prevId);\n }\n }", "function getJourney(e) {\n let response = e.target.getElementsByTagName(\"h3\")[0].innerHTML;\n let journey = master[0].findIndex(function (el, index, array) {\n return el == response;\n })\n e.target.href = master[journey+1][counter]\n}", "goToLastSlide() {\n\n this.goTo(this.slides.length - 1, -1);\n\n }", "function getUltima(){\n\tvar pag = getData('last', '');\n\tif(pag == '') return;\n\n\t// convert the old format\n\tif(typeof(pag) == 'string'){\n\t\tvar pags = pag.split('|wcrbmtit|');\n\t\tpag = {url: pags[0], title: pags[1]};\n\t}\n\tget('wcr_ultimavisita').innerHTML = '<br/>Last visited: <a href=\"'+pag['url']+'\" title=\"'+pag['url']+'\">'+pag['title']+'</a>';\n}", "function cal2GoTo(date) {\n $cal2.fullCalendar('gotoDate', date);\n }", "function goToUnitPage() {\n history.push(\"/selectunit\");\n }", "function nextPlace() {\n var place = businesses[step];\n geocode(place);\n}", "function pageLast()\n{\n\tcurrentPage = lastPage;\n\tviewPage();\n}", "function voltaOpt() {\n window.history.go(-1);\n return false;\n }", "function endoftimeout (id) {\n\tvar navigateUrl = chrome.extension.getURL(\"timesup.html\");\n\tchrome.tabs.update(id, {url: navigateUrl})\n\tchrome.storage.local.set({'remaining': 0}, function() {});\n}", "function offWeGo() {\n saveCharacter(player);\n window.location.href = '../html/results.html';\n}", "function redirectToBack(){\n\t\thistory.go(-1);\n\t}", "goBack() {\n this._goBack().catch(Cu.reportError);\n }", "function gotoVictoryVan(event) {\n\taddNavActionJS(\"initial victory van\", \"\");\n\tswitchTo('victoryVanStart');\n}", "function prevDay() {\n newDate = dayChange(gDate, -1)\n newUrl = \"take.html?date=\" + newDate\n document.location.href = newUrl;\n}", "previous(){\n let previous = this.currentId - 1;\n if(previous <= 1){\n previous = 1;\n }\n this.goto(previous);\n }", "async getMostRecentUserLoc() {\n const locData = await this.getLocationData();\n return locData[locData.length - 1];\n }", "function MoreGames(){\r\n window.location=\"https://www.247games.com/\";\r\n}", "function check_lost_state() {\n //console.log(\"I am lost\");\n //return false;\n\n current_page = vc_info.vc;\n\n for(key in order_map) {\n pg=order_map[key];\n if(pg==current_page) {\n redirect(user_dashboard);\n console.log('Return lost user to dashboard');\n break;\n }\n }\n\n\n}", "function goback() {\n document.getElementById(\"pokemon-container\").innerHTML = last_inner_HTML;\n }", "function goBack() {\n $state.go('tribes.list');\n }", "historyBack() {\n const fenCode = this.state.chessBoardHistory.back();\n console.log('back');\n console.log(this.state.chessBoardHistory);\n this.updateBoard(fenCode);\n }", "sendHome() {\n this.planManager.goHome();\n }", "goBack() {\n this.currentIdx = Math.max(0, this.currentIdx - 1);\n }", "function recordSearchChoice(e) {\n //var val = (e.target) ? e.target.getAttribute('href') : e.srcElement.getAttribute('href');\n var val = this['href'];\n //GM_log(\"Recording from value \"+val);\n // decode it\n var item = val.replace(/^.*&searchitem=/,'');\n item = item.replace(/[^0-9].*/,'');\n if(item) {\n var player = GM_getValue(\"currentPlayer\",\"\");\n if (player==\"\")\n return;\n GM_setValue(player+\"_lastbought\",item); \n }\n}", "jumpTo(step) {\n\t\t// Calculating winner at this point in game\n\t\tlet winnerSquares = this.calculateWinnerSquares(this.state.history[step].squares, true);\n\t\tlet winner = winnerSquares ? this.state.history[step].squares[winnerSquares[0]] : null;\n\t\tlet showTrophy = winner ? true : false;\n\t\tthis.setState({\n\t\t\tstepNumber: step,\n\t\t\tnextPlayer: this.getNextPlayer(step),\n\t\t\twinner: winner,\n\t\t\twinnerSquares: winnerSquares,\n\t\t\tshowTrophy: showTrophy\n\t\t});\n\t}", "function goBack() {\n\n var queries = JSON.parse(sessionStorage.getItem(\"queries\")); //load previous queries out of sessionStorage\n\n if (queries.length >= 2) {\n queries.pop();//the Query shown now. first query stays in the list\n }\n var lastquery = queries.pop();//get the last search query\n\n while (lastquery === \"error\") { //errors are skipped and not shown again\n lastquery = queries.pop();\n }\n\n sessionStorage.queries = JSON.stringify(queries); //save previous queries out of sessionStorage\n\n if (lastquery !== undefined) {\n getResults(lastquery);\n }\n}", "verPokemon(idx) {\n this.router.navigate(['/pokemon', idx]);\n }", "function findMostRecentGame(game) {\n return game.status !== \"future\"\n}", "function navAway()\r\n\t{\r\n\t\tif (!CloudSave.isIdle())\r\n\t\t\treturn \"Your changes haven't been saved yet.\";\r\n\r\n\t\treturn undefined;\r\n\t}", "function goToTravelTodo() {\n console.log(\"TravelTODO\");\n //Apply code to continue to travels\n //Make connection with Jonas page\n}", "function goBackToQuizResult() {\n $('#item-details').fadeOut(300);\n $('#quiz-result').show(400);\n ga('send', 'event', 'Back to quiz result', 'click', itemID);\n}", "function nextWorkout(){\n var next = response.workout.shift();\n if (next) {\n return next\n } \n //if no more workouts, count log completions and redirect to menu page\n else {\n $.post(\"/logCompletion\", {routineUsed: location.pathname.slice(1)})\n .done(function(res){\n // send data <- hint\n res.send(res)\n // var log = {location.pathname.slice(1)}\n // console.log(log, \"log\");\n //window.location.pathway\n\n });\n window.location.href = redirect;\n }\n}", "function lastOponent() {\n\t$(\".active-enemy\").empty();\n\t$(\"#enemy\").empty();\n\tmessage.html(\"You have defeated all the wild Pokemon!. Good Job!\");\n\tsetTimeout(function(){location.reload()},2000);\n}", "function goBack() {\n\t\t\t$window.history.back();\n\t\t}", "function atras() {\n history.back();\n}", "function returnHome() {\n $state.go(constants.states.soon);\n }", "function goBack() {\n window.history.back();\n} // nu merge, mai este si forward, merge inainte spre urmatorul url din history", "function goBack(){\n // *Navigating back:\n window.history.back();\n }", "function moveToNext(Calvin){\n\t// console.log(\"MNext: \" + currElement);\n\t// console.log(\"Element Array Length: \" + elementIdArray.length);\n\tif(currElement>0 && currElement<elementIdArray.length){\n\t\tletThereBeLight(currElement,Calvin);\n\t\tcurrElement++;\n\t}\n\telse if(firstIteration == 0){\n\t\tletThereBeLight(currElement,Calvin);\n\t\tfirstIteration++;\n\t\tcurrElement++;\n\n\t}\n\telse if(currElement >= elementIdArray.length-1){\n\t\talert(\"You have reached the end of this guided tour! Thanks for joining us!\");\n\t\tCalvin.eraseTourGuide();\n\t\tremoveDarkness();\n\t\tcurrElement =0;\n\t\tfirstIteration=0;\n\t}\n}", "function viewMoreVisitHistory() {\r\n\tajaxSend( \"./findMoreVisit.json\" \r\n\t\t\t, { cmStorSeq\t\t: clickedCmStorSeq\r\n\t\t\t\t, pageNo \t\t: ++pageVisitNo\r\n\t\t\t }\r\n\t\t\t, viewMoreVisitHistoryAft );\r\n}", "exitGame() {\n // !Maybe solution for AppLogger or similar\n setTimeout(() => {\n window.top.location.href = RealityCheckModel.exit_URL || RealityCheckModel.lobby_URL;\n });\n }", "function goBack() {\n window.history.back();\n }", "backToReferral(referral) {\n this.goToReferralPanel(referral);\n }", "toMainPage() {\n this.$router.go(-1);\n }" ]
[ "0.5940994", "0.5940994", "0.5940994", "0.5940994", "0.58590245", "0.577744", "0.56647384", "0.56524396", "0.56198406", "0.56050557", "0.5584691", "0.5574535", "0.55630714", "0.55039597", "0.549068", "0.548776", "0.5487753", "0.54824454", "0.54723954", "0.5455079", "0.54541755", "0.5410708", "0.54103583", "0.54082286", "0.54057807", "0.5393437", "0.53724897", "0.53715754", "0.5345471", "0.5343232", "0.53254163", "0.5303798", "0.5299452", "0.52698225", "0.52649164", "0.52540565", "0.52438277", "0.5234678", "0.5229392", "0.5226254", "0.5224335", "0.52177763", "0.52177525", "0.5217537", "0.5212248", "0.5209559", "0.5209559", "0.52058494", "0.51857865", "0.51743394", "0.51731", "0.51720214", "0.51719475", "0.51695216", "0.51683176", "0.5167864", "0.5166186", "0.5162968", "0.51608175", "0.51094824", "0.5099485", "0.5095318", "0.50898063", "0.5079001", "0.5076668", "0.5076088", "0.5075719", "0.5072822", "0.5071407", "0.5069539", "0.5057411", "0.5043417", "0.50391454", "0.5038488", "0.50379956", "0.503391", "0.502911", "0.5028315", "0.5019366", "0.5018912", "0.50111324", "0.5009993", "0.50072557", "0.500422", "0.50021553", "0.49996644", "0.49995205", "0.49961367", "0.4991569", "0.4990022", "0.49859574", "0.4984575", "0.4979345", "0.49781477", "0.49776247", "0.4976207", "0.49759188", "0.49593592", "0.49534866", "0.4949598" ]
0.65885055
0
Adds venues to the list of venues
function pag_addVenuesToList(namespace, parent, connections, venueClientControllerId) { for (var i = 0; i < connections.size(); i++) { pag_venueTree.addTreeNode( parent, "pag_venue" + connections.get(i).getId(), null, connections.get(i).getName(), connections.get(i).isExpanded(), "pag_selectVenue(" + "'" + namespace + "'" + "," + "'" + connections.get(i).getId() + "'" + ");", "pag_isPreviousVenue = pag_goToVenue(" + "'" + connections.get(i).getUri() + "'" + ", " + "'" + venueClientControllerId + "'" + ");", "pag_expandVenueList("+ "'" + namespace + "'" + "," + "'" + connections.get(i).getId() + "'" + ");", "pag_collapseVenueList("+ "'" + namespace + "'" + "," + "'" + connections.get(i).getId() + "'" + ");", false); if (connections.get(i).isExpanded()){ pag_addVenuesToList(namespace, "pag_venue" + connections.get(i).getId(), connections.get(i).getConnections(), venueClientControllerId); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pag_expandVenueList(namespace, venueId){\n pag_xmlRpcClient.call(\"expandVenue\",venueId);\n}", "function featureVenues(){\n\t\tfor (i=0;i<hoods.length;i++){\n\t\t\tif (venues.neighborhood = hoods[i]){\n\t\t\t\tfeatVen = venues;\n\t\t\t\tvar x = Math.floor(Math.random() * featVen.length);\n\t\t\t\tconsole.log(\"x: \"+x);\n\t\t\t\tvenueID = featVen[x].id;\n\t\t\t\tconsole.log(\"featured venue \"+venueID);\n\t\t\t\tvenueAPI();\n\t\t\t};\n\t\t};\n\t}", "function getVenues (req, res){\n let find = Venue.find({}).sort('stage');\n find.populate({path:'stageLocations'}).exec((err,venues) =>{\n if (err) return res.status(500).send({message:`Error al realizar la petición ${err}`})\n if (!venues) return res.status(404).send({message:`No existen ubicaciones`})\n //console.log(events)\n res.status(200).send({venues:venues})\n })\n}", "function saveMarkers(venues) {\n for(let venue of venues) {\n markers.push(venue);\n }\n}", "function updateVegetablesCollection (veggies, veggie) {\n if (veggies.indexOf(veggie) === -1) {\n veggies.push(veggie);\n console.log('New veggies collection is : ' + veggies);\n } else if (veggies.indexOf(veggie) > -1) {\n console.log(veggie + ' already exists in the veggies collection.');\n }\n}", "function getVenues() {\n\t$.ajax({\n\t \ttype: \"GET\",\n\t \turl: \"https://api.foursquare.com/v2/venues/explore?ll=\"+lat+\",\"+lng+\"&client_id=HFOT1XUCTPSBFCWA0W5OMCOLVPWLUA5T0ELRWKDOKAEVRB3V&client_secret=SJRCFDAGLCACDPY1EIEHNITKJIKNCN5KFPOINR0RCPYX35LZ&v=20130619&query=\"+$(\"#query\").val()+\"\",\n\t \tsuccess: function(data) {\n\t\t\t$(\"#venues\").show();\n\t\t\tvar dataobj = data.response.groups[0].items;\n\t\t\t$(\"#venues\").html(\"\");\n\t\t\t\t\n\t\t\t// Rebuild the map using data.\n\t\t\tvar myOptions = {\n\t\t\t\tzoom:11,\n\t\t\t\tcenter: new google.maps.LatLng(33.340053, -111.859627),\n\t\t\t\tmapTypeId: google.maps.MapTypeId.HYBRID,\n\t\t\t\tpanControl: true,\n\t\t\t\tzoomControl: true\n\t\t\t},\n\t\t\tmap = new google.maps.Map(document.getElementById('map'), myOptions);\n\t\t\t\t\n\t\t\t// Build markers and elements for venues returned.\n\t\t\t$.each( dataobj, function() {\t\n\t\t\t\tif (this.venue.contact.formattedPhone) {\n\t\t\t\t\tphone = \"Phone:\"+this.venue.contact.formattedPhone;\n\t\t\t\t} else {\n\t\t\t\t\tphone = \"\";\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tif (this.venue.location.address) {\n\t\t\t\t\taddress = '<p class=\"subinfo\">'+this.venue.location.address+'<br>';\n\t\t\t\t} else {\n\t\t\t\t\taddress = \"\";\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tif (this.venue.rating) {\n\t\t\t\t\trating = '<span class=\"rating\">'+this.venue.rating+'</span>';\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tappendeddatahtml = '<div class=\"venue\"><h2><span>'+this.venue.name+rating+'</span></h2>'+address+phone+'</p><p><strong>Total Checkins:</strong> '+this.venue.stats.checkinsCount+'</p></div>';\n\t\t\t\t$(\"#venues\").append(appendeddatahtml);\n\t\t\t\t\t\n\t\t\t\t// Build markers\n\t\t\t\tvar markerImage = {\n\t\t\t\turl: 'images/ScopePin.png',\n\t\t\t\tscaledSize: new google.maps.Size(24, 24),\n\t\t\t\torigin: new google.maps.Point(0,0),\n\t\t\t\tanchor: new google.maps.Point(24/2, 24)\n\t\t\t\t},\n\t\t\t\tmarkerOptions = {\n\t\t\t\tmap: map,\n\t\t\t\tposition: new google.maps.LatLng(this.venue.location.lat, this.venue.location.lng),\n\t\t\t\ttitle: this.venue.name,\n\t\t\t\tanimation: google.maps.Animation.DROP,\n\t\t\t\ticon: markerImage,\n\t\t\t\toptimized: false\n\t\t\t\t},\n\t\t\t\tmarker = new google.maps.Marker(markerOptions)\n\t\t\t});\n\t\t}\n\t});\n}", "function add (pokemon) {\n if (addv(pokemon)) { pokemonList.push(pokemon); }\n }", "function addToFavorites() {\n let favorite = buildCityItem(event.currentTarget);\n\n let favorites = readFromLS(\"favorites\");\n if (favorites == null) {\n favorites = [];\n }\n favorites.push(favorite);\n saveToLS(\"favorites\", favorites);\n loadFavorites();\n loadCityWeather();\n}", "function updateFoursquareVenues() {\n\n console.log(\"Updating the list of Foursquare venues.\");\n\n if (localStorage.foursquare_access_token != '') {\n var xhr = new XMLHttpRequest({mozSystem: true, responseType: 'json'});\n xhr.addEventListener(\"load\", transferComplete, false);\n xhr.addEventListener(\"error\", transferFailed, false);\n var geturl = \"https://api.foursquare.com/v2/venues/search?oauth_token=\" + localStorage.foursquare_access_token + \"&ll=\" + currentPosition + \"&intent=checkin&v=20130629\";\n console.log(geturl);\n xhr.open('GET', geturl, true);\n xhr.send();\n }\n\n function transferFailed(evt) {\n console.log(\"An error occurred transferring the data: \" + evt);\n }\n\n function transferComplete(evt) {\n if (xhr.status === 200 && xhr.readyState === 4) {\n $('#venue_list').html();\n var data = JSON.parse(xhr.response);\n $.each(data.response.venues, function(i,venues){\n content = '<li class=\"normal-venue\" id=\"' + venues.id + '\" name=\"' + venues.name + '\"><p>' + venues.name + '</p><p>' + (venues.location.address || '') + '</p></li>';\n $(content).appendTo(\"#venue_list\"); \n });\n console.log(\"List of Foursquare venues updated.\");\n }\n }\n}", "function foursquareVenues(largeInfowindow, places, map) {\n var config = {\n CLIENT_ID: 'XOYJG43FJ0D4IIOV10J5KHLPUASH2MWJ3RDETKVKV53ERSKU',\n CLIENT_SECRET: 'RB5ZU4TXG5OOFVH3UKFC3JLNM4GR51INJMEHZLPGU1VCKQQD'\n };\n var url = '';\n var info = [];\n // For each place in the place list request a JSON file.\n for (i = 0; i < locations.length; i++) {\n var location = locations[i];\n url = 'https://api.foursquare.com/v2/venues/' +\n location.foursquareID +\n '?client_id=' + config.CLIENT_ID +\n '&client_secret=' + config.CLIENT_SECRET +\n '&v=20181230' +\n '&m=foursquare';\n // A AJAX request to obtain data from Foursqaure, once fail the app will\n // pump up an alert.\n foursquareRequest(url);\n }\n\n function foursquareRequest(url) {\n $.ajax({\n url: url,\n dataType: \"json\",\n success: function(data) {\n var venue = data.response.venue;\n var rating = venue.rating ? venue.rating : 'No rating available';\n var url = venue.url ? venue.url : 'No link provided, please do not click!';\n info = {\n title: venue.name,\n rating: rating,\n url: url,\n lat: venue.location.lat,\n lng: venue.location.lng,\n address: venue.location.address +\n \"<br>\" + venue.location.city + \", \" +\n venue.location.state + \" \" +\n venue.location.postalCode\n };\n places.push(venue);\n // Send requested data to Markers maker.\n setMarkers(location, info, map, largeInfowindow, places);\n },\n error: function() {\n alert(\"Sorry. Can not get data from Foursquare!\");\n }\n });\n }\n}", "function searchForVenues() {\n\t$('#content p').remove();\n\tvar currentDate = getCurrentDate();\n\n\t// we don't need to do an authorized request for this endpoint (https://developer.foursquare.com/docs)\n\tvar url = 'https://api.foursquare.com/v2/users/self/checkins?oauth_token=' + accessToken;\n\n\t$.ajax({\n\t\ttype: 'GET',\n\t\turl: url,\n\t\tsuccess: function(data) {\n\t\t\tvar venue = data.response.checkins;\n\t\t\tvar userCount = 0;\n\t\t\t//$('#content').append('<p> Venue count is: ' + venue.count + ' with the most recent checkin at: ' +venue.items[0].venue.name + '</p>');\n\t\t\tfor (var i = 0; i < 7; i++) { // only load 12 venues - for demo purposes\n\t\t\t\t$('#content').append('<li class=\"list-group-item\"> I have checked into ' +venue.items[i].venue.name + ' with '+venue.items[i].venue.stats.usersCount +' classmates</li><br>');\n\t\t\t\tuserCount = parseFloat(venue.items[i].venue.stats.usersCount) + userCount;\n\t\t\t\twindow.userCount = userCount;\n\t\t\t}\n\t\t\t\n\t\t\t//$('#content').append('<li class=\"list-group-item\"> My total classmate count is: ' + userCount +'</li>');\n\t\t},\n\n\t\terror: function() {\n\t\t\talert('Error getting venues');\n\t\t}\n\t});\n\t\n\t\n\t\tconsole.log('the if statement worked');\n\t//\t$('#badges').html('<div data-bb-type=\"item\" data-bb-img=\"images/badge.png\" data-bb-title=\"Badge\">Congradulations</div>');\n\t\t \n\t \n\t\n\t\n}", "function createVenueList(){\n var iconAddress, photo;\n for (var i = 0; i < venueDetails.length; i++) {\n $('#venue-text').append(venueDetails[i].venueUiFormatText(venueDetails[i]));\n //for block wewon't have photo's, just the icons if any\n\n if(venueDetails[i].location_icon){\n iconAddress=vendorIconPath+replaceIconSize(venueDetails[i].location_icon,'l');\n }else if(venueDetails[i].loolgroup_icon){\n iconAddress=vendorIconPath+replaceIconSize(venueDetails[i].loolgroup_icon,'l');\n }else if(venueDetails[i].imageArray && venueDetails[i].imageArray.length>0){\n\t\ticonAddress=postingHost+postingPicturePath+venueDetails[i].imageArray[0].id+'/thumb_'+venueDetails[i].imageArray[0].image;\n\t}else{\n iconAddress='none';\n }\n photo=\"url('\"+iconAddress+\"')\";\n $(\"#\"+venueDetails[i].place_id+'-pic').css(\"background-image\",photo);\n }\n for (var i = 0; i < venueDetails.length; i++) {\n venueDetails[i].createClickHandler(venueDetails[i]);\n }\n}", "function checkSelectedVenuesList(selectedVenue, venueList) {\n let defaultVenues = isArrayNotEmpty(selectedVenue) ? selectedVenue : [];\n let selectedVenuesList = [];\n for (let i in venueList) {\n let venueObject = null;\n let matchedWithSelectedVenue = checkMatchedWithSelectedVenue(\n venueList[i].venueId,\n defaultVenues,\n );\n\n if (matchedWithSelectedVenue.status) {\n venueObject = {\n competitionVenueId: matchedWithSelectedVenue.result.competitionVenueId,\n venueId: venueList[i].id,\n // name: venueList[i].name,\n };\n } else {\n venueObject = {\n competitionVenueId: 0,\n venueId: venueList[i].id,\n // name: venueList[i].name,\n };\n }\n\n selectedVenuesList.push(venueObject);\n }\n return selectedVenuesList;\n}", "function createVenueFromFourSquare (venue) {\n\n var loc = new Location({\n fourSquareId: venue.id,\n name: venue.name,\n slug: utils.convertToSlug(venue.name),\n adress: venue.location.adress\n });\n\n Challenge.random(function (err, challenge) {\n loc.challenges.push(challenge);\n challenge.locations.push(loc);\n challenge.save();\n loc.save(function (savedObj) {\n console.log('location has been saved;');\n });\n })\n\n\n}", "function add(pokemon) {\n pokemonList.push(pokemon);\n}", "function add(pokemon) {\n pokemonList.push(pokemon);\n }", "function add(pokemon) {\n pokemonList.push(pokemon);\n }", "add(pokeObject){\r\n this.pokemon.push(pokeObject);\r\n }", "function addTown() {\n\tvar town = {//town object used to hold town\n\t\tname : place,\n\t\tloca : location_latlng\n\t};\n\t\n\tvar found=false;\n\t$.each(_list,function(index,entry){\n\t\tif(entry[\"name\"]==place){\n\t\t\t\tfound=true;\n\t\t}\t\t\t\n\t});\n\t\n\tif (!found)\n\t\t_list.push(town);\n}", "onSelectValues(venueId) {\n this.props.updateVenueConstraintsData(venueId, null, 'venues', 'venueListSection');\n this.props.clearFilter();\n this.setState({ addOrRemoveVenues: true });\n }", "function pag_collapseVenueList(namespace, venueId){\n pag_xmlRpcClient.call(\"collapseVenue\",venueId);\n}", "function gethotels() {\n var data;\n\n $.ajax({\n url: 'https://api.foursquare.com/v2/venues/search',\n dataType: 'json',\n data: 'client_id=JDZ2RTQ3D1VSVUOY42A5ROL0IASDWQFIPYQUO315HFBY1HC4&client_secret=ILBIH43ZVUQN4A0R3KU5IBZEX1VHXAUTHPBS10KQVMKEOXDU&v=20161016%20&ll=29.9090984,73.8439466%20&query=hotel',\n async: true,\n }).done(function (response) {\n data = response.response.venues;\n data.forEach(function (hotel) {\n foursquare = new Foursquare(hotel, map);\n self.hotelList.push(foursquare);\n });\n self.hotelList().forEach(function (hotel) {\n if (hotel.map_location()) {\n google.maps.event.addListener(hotel.marker, 'click', function () {\n self.populateInfoWindow(hotel);\n });\n }\n });\n }).fail(function (response, status, error) {\n $('#query-summary').text('Hotels not loaded');\n });\n }", "function updateVeggiCollection(veggies, veggie) {\n if (veggies.indexOf(veggie) == -1) {\n veggies.push(veggie);\n console.log(\"추가된 야채야채 모듬 : \", veggies);\n } else if (veggies.indexOf(veggie) > -1) {\n console.log(veggie + \"는 이미 야채야채 모듬에 있어요.\");\n }\n}", "function Venue(id, name, latitude, longitude) {\n var self = this;\n self.id = id;\n self.name = name;\n self.latitude = latitude;\n self.longitude = longitude;\n}", "function addVideos(data) {\n const newVideos = data.items;\n const next = data.nextPageToken;\n const updatedOld = this.state.oldVideos.concat(newVideos);\n\n this.setState({\n nextPageToken: next,\n oldVideos: updatedOld,\n videos: this.state.ds.cloneWithRows(updatedOld)\n });\n }", "function add(pokemon) {\n\t\t\tpokemonList.push(pokemon)\n\t\t}", "function addKiwi(ourList){\n ourList.push(\"kiwi\");\n }", "async function displayVenueList() {\n venueListEl.empty();\n totalPages = Math.ceil(venueList.length / 10); \n for (var i = (currentPage - 1) * perPage; i < venueList.length && i < currentPage * perPage; i++) {\n venueListEl.append(`\n <li class=\"col s12 m6 xl4\">\n <div class=\"card black white-text\" role=\"button\" data-value=\"${venueList[i].id}\">\n <div class=\"card-content\">\n <img src=\"https://images.sk-static.com/images/media/profile_images/venues/${venueList[i].id}/col1\" alt=\"${venueList[i].displayName}\" class=\"responsive-img circle right\">\n <span class=\"card-title\">${venueList[i].displayName}</span>\n <p>${venueList[i].street}</p>\n <p>Number of Events: ${venueList[i].eventCount}</p>\n </div>\n </div>\n </li>\n `);\n }\n displayPagination(); // Do after getting data and total page count\n}", "addRoad(road){\n this.roads.push(road)\n }", "function showVenues(json) {\n if (json !== 0 && json._embedded.venues !== undefined) {\n var events = json._embedded.venues;\n console.log(events);\n\n for (var i = 0; i < events.length; i++) {\n console.log(JSON.stringify(events[i]));\n var newRow = $(\"<tr>\").append(\n $(\"<td><a target='_blank' href=\\\"\" + events[i].url + \"\\\" style=\\\"display:block;\\\">\" + events[i].name + \"</a></td>\")\n );\n $(\"#events > tbody\").append(newRow);\n }\n }\n else {\n var newRow = $(\"<tr>\").append(\n $(\"<td>0 Events Found</td>\")\n );\n $(\"#events > tbody\").append(newRow);\n }\n}", "function addSite(e, ui) {\n\tvar id = ui.item.id,\n\tname = ui.item.value,\n\tsites = [],\n\tlist = $('#dialog #siteList'),\n\thtml = '<p data-id=\"' + id + '\" class=\"site\"><button class=\"remove\"><span class=\"fa fa-minus\"></span> Remove</button> ' + name + '</p>';\n\t// Loop through existing sites and build sites array.\n\t$('#searchResults .selection').each(function () {\n\t\tvar entry = $(this),\n\t\tid = entry.attr('data-id');\n\t\tif (id) {\n\t\t\tsites.push(id);\n\t\t}\n\t});\n\t// Loop through sites to be added and build sites array.\n\t$('#dialog #siteList .site').each(function () {\n\t\tvar entry = $(this),\n\t\tid = entry.attr('data-id');\n\t\tif (id) {\n\t\t\tsites.push(id);\n\t\t}\n\t});\n\t// Add site if they don't already exist.\n\tif (sites.indexOf(id) == -1) {\n\t\tlist.append(html);\n\t}\n\t// Remove name from field and give it focus.\n\t$(this).val('').focus();\n\treturn false;\n}", "async addMovieNightList(ctx, payload) {\n var docRef = await db.collection(auth.currentUser.uid);\n var data = [];\n var name = payload.name\n payload.list.map(movie => movie.seen = false);\n payload.list.forEach(movie => {\n data.push(movie)\n });\n await docRef.add({\n movieNightList: data,\n name: name,\n });\n await ctx.dispatch('fetchMovieNightLists');\n }", "function add(pokemon) {\n if (typeof pokemon === 'object' && Object.keys(pokemon) === 'name', 'detailsUrl') { //checks to make sure that each item added is an object, and has the types \"name\" and \"detailsUrl\"\n pokemonList.push(pokemon); //add a new pokemon item to the array\n }\n }", "function fetchEvents() {\n for (var i = 0; i < itinerary.length; i++) {\n addNewItemFromId(itinerary[i]);\n }\n\n // Check for overlap\n detectOverlap();\n}", "function addToFavourites(id){\n if(favourites.indexOf(id) === -1 ){\n favourites.push(id);\n showNotification(\"success\", \"Added to Favourites!\");\n localStorage.setItem(\"favourites\", JSON.stringify(favourites));\n }\n else{\n showNotification(\"error\", \"This Hero is already exists in Favourites!\");\n }\n\n\n }", "function addListing(listing) {\n allListings.push(listing);\n}", "function addHouses(houses) {\n var housesArray = houses.split(\",\");\n for (var i = 0; i < housesArray.length; i++) {\n playerHouses.push(housesArray[i]);\n }\n}", "function parse_venue_object(venues)\n{\n var venues_list=[];\n for (var i=0;i<venues.length;i++)\n {\n var venue_id = venues[i]['id'];\n var venue_name = venues[i]['name'];\n\n //not all vendors have prices information included, but the data object always a tag of price\n var venue_price = venues[i]['price'];\n if(typeof venue_price != \"undefined\")\n {\n venue_price = venues[i]['price']['tier'];\n\n } \n else {\n \tvenue_price = \"\";\t\n }\n var venue_rating = venues[i]['rating'];\n if(typeof venue_rating ==\"undefined\")\n {\n venue_rating = \"\";\n }\n venue_url = venues[i]['url'];\n\n //some vendors don't have a specifed category and some have more than one category\n //find the first category that matches one of the ids within the bar sub-category\n var venue_categoryName;\n var venue_category = venues[i]['categories'];\n \n for (var j=0;j<venue_category.length;j++)\n {\n if(typeof venue_category[j]!=\"undefined\")\n {\n var categoryId = venue_category[j].id;\n if(_.values(categories).indexOf(categoryId)!=-1)\n {\n venue_categoryName = venue_category[j].name;\n }\n }\n }\n if(typeof venue_categoryName == \"undefined\")\n {\n venue_categoryName = \"Nightlife Spot\";\n }\n \n var venue_location = venues[i]['location'];\n\n var venue_info=\n {\n id:venue_id,\n name:venue_name,\n price:venue_price,\n rating:venue_rating,\n category:venue_categoryName,\n location:venue_location,\n url:venue_url\n };\n venues_list.push(venue_info);\n }\n return venues_list;\n}", "function addPokemonToTeam(trainerId) {\n const targetUl = document.querySelector(`div[data-id='${trainerId}'] ul`)\n\n // configures post expecting json response\n const configObj = {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n }\n }\n\n fetch(`${TRAINERS_URL}/${trainerId}/pokemons`, configObj)\n .then(res => res.json())\n .then(json => addPokemonToList(json, targetUl))\n\n // fetch nested rails route posts trainer/:id/pokemons \n // controller looks up trainer and counts pokemon\n // if pokemon >= 5 returns error message: \"Team is Full\" \n // if pokemon <= 5 adds pokemon and returns trainer pokemons, adds pokemon to list\n}", "function updateShops() {\n // update the request:\n url = \"https://api.foursquare.com/v2/venues/search\\?\" +\n \"client_id=\" + client_id +\n \"&client_secret=\" + client_secret +\n \"&v=20170406\" +\n \"&ll=\" + map.getCenter().lat().toString() + \",\" + map.getCenter().lng().toString() +\n \"&query=coffee\" +\n \"&limit=25\" + \"&radius=8000\";\n createFSQMarkerList(url);\n}", "addEdge(v, w) {\n this.AdjList.get(v).push(w);\n }", "function addToNominationsList(movieObject) {\n let nState = { ...state };\n nState.movieNominees.push(movieObject);\n setState(nState);\n }", "function addToList(blueArea) {\n\tguesses.push(blueArea);\n\t$(\"#count\").text(guesses.length);\n\t$(\"ul#guessList\").append(\"<li>\" + blueArea + \"</li>\");\n}", "function add(pokemon) {\n if (typeof pokemon === 'object' &&\n 'name' in pokemon &&\n 'detailsUrl' in pokemon\n ) {\n pokemonList.push(pokemon);\n } else {\n console.log('The Pokemon is not correct' + '<br>')\n }\n }", "function searchHotels(ll){\n console.log(\"in\",ll)\n // foursquare.clientId & foursquare.clientSecret live in keys.js which is listed about this file so you are able to access the objects\n var queryURL = \"https://api.foursquare.com/v2/venues/search?client_id=\"+foursquare.clientId+\"&client_secret=\"+foursquare.clientSecret +\"&ll=\"+ ll + \"&query=hotels&limit=8&v=20180206\";\n \n // // .get is short hand for .ajax see links below\n // // https://stackoverflow.com/questions/3870086/difference-between-ajax-and-get-and-load\n // // http://api.jquery.com/jquery.ajax/\n $.get(queryURL, function(results){\n var data = results.response.venues;\n for(var i = 0; i < data.length;i++){\n \n \n var wrap = $('<div>').addClass('hotel-card');\n var addr = data[i].location.formattedAddress.join(\",\")\n var map = \"<iframe width='300' height='300' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='https://maps.google.com/maps?&amp;q=\"+encodeURIComponent( addr ) + \n \"&amp;output=embed'></iframe>\"; \n $(wrap).html(map);\n\n var latlong = data[i].location.lat + \",\" + data[i].location.lng\n wrap.attr('data-fsqHid', data[i].id).attr('data-fsqHlatlng', latlong)\n \n var name = $('<h5>').text(data[i].name);\n var address = $('<p>').text(addr);\n $(wrap).append(name, address);\n $('#hotel-display').append(wrap)\n }\n })\n }", "registerArea(newArea) {\n return this.findOneAndUpdate(\n { _id: newArea.city },\n {\n $push: {\n areas: newArea,\n },\n }\n );\n }", "function addExistingMember(self) {\n show2ListsMembersContainer(self);\n if (!self.list1) {\n getAllTeamMembers(self);\n } \n }", "function addToPeersList() {\n if(peersArr.length < 1){\n role = 'hub';\n return peers.$set(myId, {username: username, role: role});\n } else {\n role = 'spoke';\n return peers.$set(myId, {username: username, role: role});\n }\n\n }", "async addToMatchups( tournamentId, { name } ) {\n\treturn new Promise((resolve, reject) => {\n\t\tthis.find(tournamentId).then(tournament => {\n\t\t new MatchupAPI({store: this.store}).add( { name } ).then(matchup => {\n\t\t \ttournament.addToMatchups(tournament).then(() => {\n\t\t\t resolve( tournament );\n\t\t\t\t})\n\t\t })\n\t\t})\n\t});\n }", "function addToFavs()\n {\n favorites.push(users[0].userName);\n dismissResult();\n }", "addEdge(v, w) {\n // get the list for vertex v and put the \n // vertex w denoting edge between v and w \n this.AdjList.get(v).push(w);\n\n // Since graph is undirected, \n // add an edge from w to v also \n this.AdjList.get(w).push(v);\n console.log(`addEdge`);\n console.log(this.AdjList);\n }", "function add(pokemon) {\n if (typeof pokemon === 'object' &&\n 'name' in pokemon) {\n pokemonList.push(pokemon);\n } else {\n console.log('pokemon is not correct');\n }\n }", "function add(pokemon) {\n if ( typeof pokemon === 'object' &&\n 'name' in pokemon &&\n 'detailsUrl' in pokemon\n ) {\n pokemonList.push(pokemon);\n } else {\n console.log('Pokemon is not correct');\n }\n }", "addItem(req, res) {\n //grab the new item and push it to the list\n const { addOn } = req.body;\n list.push(addOn);\n res.status(200).send(list);\n }", "function addPokemonToTeam(e) {\n let pokeIndex = \"\"\n if (!e.currentTarget) {\n pokeIndex = e.attributes[2].value;\n }\n else {\n pokeIndex = e.currentTarget.attributes[2].value;\n }\n\n if (currentTeam.length < 6) {\n\n currentTeam.push(pokeIndex);\n getTeamMember(currentTeam[currentTeam.length - 1]);\n\n }\n else {\n document.querySelector(\"#teamStatus\").innerHTML = \"<p>Your team is already full!</p>\";\n }\n}", "function add(pokemon) {\n // make sure the new pokemon has these properties\n if (\n typeof pokemon === 'object' &&\n 'name' in pokemon &&\n 'detailsURL' in pokemon\n ) {\n pokemonList.push(pokemon);\n } else {\n console.error('pokemon is not correct'); // eslint-disable-line no-console\n }\n }", "function refresh_TourNearby( )\n{\n\tvar mark_index = 0;\n\tfor ( var i=0; i<g_recommended_venues.length; i++ )\n\t{\n\t\tvar _venue \t= g_recommended_venues[i];\n\t\tvar _vName \t= _venue['name'];\n\t\tvar _vID \t= _venue['id'];\n\t\tvar loc \t= _venue[\"location\"];\n\t\tvar _addr \t= loc['formattedAddress'].join(\"<br/>\");\n\t\tvar _vUrl\t= \"https://foursquare.com/v/\" + _vName + \"/\" + _vID + \"?ref=\" + CLIENT_ID;\n\t\tif ( typeof(_addr) == \"undefined\" )\n\t\t\t_addr = \"\";\n\n\t\tvar v_html = \"<div>\"\n\t\t\t+ \"<a href='\" + _vUrl + \"'target='_blank'> <strong>\" + _vName + \"</strong></a></br>\"\n\t\t\t+ \"<span style='font-weight:900, background-color:\" + _venue['ratingColor'] + \"'> rating :\" + _venue['rating'] + \"</span></br>\"\n\t\t\t+ _addr + \"</br>\"\n\t\t\t+ \"</div>\";\n\n\t\tvar myIcon = L.ExtraMarkers.icon({\n\t\t icon: 'fa-number',\n\t\t markerColor: 'yellow',\n\t\t shape: 'penta',\n\t\t prefix: 'fa',\n\t\t number: ++mark_index\n\t\t});\n\t\tL.marker([loc.lat, loc.lng],{riseOnHover:true, icon: myIcon})\n\t\t\t.addTo(g_layer_recommendedMarks)\n\t\t\t.bindPopup(v_html);\n\t}\n}", "async addUsersToTeam () {\n\t\tawait new AddTeamMembers({\n\t\t\trequest: this.request,\n\t\t\taddUsers: this.invitedUsers.map(userData => userData.user),\n\t\t\tteam: this.team,\n\t\t\tsubscriptionCheat: this.subscriptionCheat // allows unregistered users to subscribe to me-channel, needed for mock email testing\n\t\t}).addTeamMembers();\n\n\t\t// refetch the users since they changed when added to team\n\t\tawait Promise.all(this.invitedUsers.map(async userData => {\n\t\t\tuserData.user = await this.data.users.getById(userData.user.id);\n\t\t}));\n\t}", "AddEdge(v,w) {\n this.graphList.get(v).push(w);\n }", "addEdge(v1, v2) {\n if (v1 in this.adjacencyList && v2 in this.adjacencyList) {\n this.adjacencyList[v1].push(v2);\n this.adjacencyList[v2].push(v1);\n }\n }", "add(slug) {\n\n console.log(\"favoritesList add\");\n // First see if recipe is already present\n let item = this.getItem(slug)\n\n if (item) {\n // Recipe is in favoritesList already; don't do anything\n\n } else {\n // Recipe not in favoritesList, add as new item\n this.items.push({\n slug: slug\n });\n }\n\n this.update();\n }", "function addToBreweryTastingList(event) {\n\n event.preventDefault();\n\n // Get the index of the brewery that the user added to the brewery tasting map.\n var addBreweryNameToTour = event.target.id;\n\n // Conditional prevents user from add the same brewery to the list more than once. \n if ($.inArray(addBreweryNameToTour, breweryTourList) > -1) {\n return\n }\n\n // Create a li tag to attach the name of the brewery that the user wants to add to the brewery tasting map. \n var addLi = $(\"<li>\").text(breweryList[addBreweryNameToTour].name);\n\n // Append li tag with the brewery name to the div with the breweryTourList Id.\n $(\"#breweryTourList\").append(addLi);\n\n // Push the index of the brewery that the user wants to add to the brewery tasting map to the breweryTourList array.\n // This will be used by the map API functions to access breweries the user wants to visit.\n breweryTourList.push(addBreweryNameToTour);\n\n // This prevents the user from adding more than 5 breweries to the list. Once the count hits 5 the add to tour button is hidden!\n numberOfBreweriesInTour++;\n if (numberOfBreweriesInTour === 5) {\n $(\".switch\").css(\"display\", \"none\");\n }\n}", "push(paladinID) {\n const arr = Array.from(state.PaladinAura.PaladinList);\n arr.push(paladinID);\n STATE.PaladinList.set(arr);\n }", "listenForVenues(FourSquareVenueIDRef) {\n let IDArray = []\n FourSquareVenueIDRef.on('value',\n (snapshot) => {\n //for loop starts\n snapshot.forEach((child) => {\n //console.log(\"this is the child.key in first loop : \" + child.key);\n IDArray.push(child.key)\n })\n //console.log(\"The IDArray is: \" + IDArray)\n let venueEndPoint = 'https://api.foursquare.com/v2/venues/'\n const config = 'client_id=HATDNQSDKZP0CBNXS1MFPY5LHNIWRUO20ABSN200332SSTJS&client_secret=PG1CZTXS5TL5ECZGFOLCSZQDLNRCAUC4BYJ0K1WL3ZAMTQ4P&v=20170801'\n let data = []\n IDArray.forEach(async (id) => {\n console.log(\"Trying to fetch data for : \" + id);\n const res = await fetch(venueEndPoint + id + '?' + config)\n const resJson = await res.json()\n console.log(\"The venue name is : \" + resJson.response.venue.name);\n await data.push({\n id: id,\n name: resJson.response.venue.name\n })\n data.length === IDArray.length ? this.setState({\n data: data,\n loaded: true\n\n }) : null\n })\n }\n)}", "function addPlaceToRestaurantsList(place) {\n /* Check if the place already exists in the allRestaurants observable array */\n var existingRestaurant = allRestaurants().find(function(restaurant) {\n return restaurant.place_id === place.place_id;\n });\n\n /* If it doesn't exist, add it */\n if (!existingRestaurant) {\n allRestaurants.push(place);\n filteredRestaurants.push(place);\n }\n}", "PushToLocationList(Spot) {\n }", "addTracks() {\n let { playlistId, tracks } = this.state;\n spotifyApi.addTracksToPlaylist(playlistId, tracks);\n }", "function addToResults(tracks)\r\n{\r\n\tresults[results.length] = tracks;\r\n}", "add(l) {\n this.food.push(l.copy());\n }", "function getVenueById(req, res){\n let venueId = req.params.venueId\n Venue.findById(venueId).populate({path:'stageLocations'}).exec(function (err, venue) {\n\t\tif (err) return res.status(500).send({message: 'Error al realizar la petición'})\n\t\tif (!venue) return res.status(404).send({message: 'No existen Productos'})\n\t\tres.status(200).send({venue})\n\t})\n}", "render(){\n return (\n <ol className=\"venue-list\" role=\"ListBox\">\n {this.props.venues && this.props.venues.map((venue) => <VenueItem key={venue.id} {...venue} itemOnClick={this.props.itemOnClick}/>)}\n </ol>\n )\n }", "addViking(Viking) {\n\t\tthis.vikingArmy.push(Viking);\n\t}", "_setPlaces(position) { // change to document id\n\t const place = this.state.places[position]\n\t const venueId = place.venue.id\n\t console.log('bbbbb'+this.hasPlace('id',venueId,this.state.myPlaces))\n\t if (!this.hasPlace('id',venueId,this.state.myPlaces)) {\n\t console.log(\"adding like\")\n\t\t\tthis.state.myPlaces.push(this.state.places[position])\n\t\t}\n\t\telse {\n\t\t console.log(\"not liking\")\n\t\t}\n\t\tthis.state.seen.push(venueId)\n\t\tAsyncStorage.setItem(prefIdMyPlaces, JSON.stringify(this.state.myPlaces)); // favorites\n\t\tAsyncStorage.setItem(prefIdSeen, JSON.stringify(this.state.seen)); // seen\n\t\tthis.setState({myPlaces:this.state.myPlaces});\n\t}", "function populateVillages(pipes){\n village = new Set()\n\n // Loop through each node we visited, adding it to the village\n for (var node in pipes){\n var neighborhood = getNeighborhood(node)\n var peers = pipes[node]\n // Check out each peer, and remap the neighborhood accordingly\n for (var i = 0; i < peers.length; i++){\n var peer = peers[i]\n if (neighborhood.has(peer)){\n continue // to the next peer\n }\n\n // Merge our neighborhood with our peer's neighborhood\n var peerHood = getNeighborhood(peer)\n peerHood.forEach(neighborhood.add, neighborhood)\n village.delete(peerHood)\n }\n }\n }", "function addToRouteFavourites(item) {\n let favourites = JSON.parse(localStorage.getItem('route-favourites') || '[]');\n let include = true;\n favourites.forEach((i) => {\n if (i.id === item.id) {\n include = false;\n }\n })\n if (include) {\n favourites.push(item)\n }\n while (favourites.length > 3) {\n favourites.shift()\n }\n localStorage.setItem('route-favourites', JSON.stringify(favourites));\n setUpdateFavourites(true)\n }", "function AddAsistencia(idAsistencia) {\n if (!asistieron.includes(idAsistencia)) {\n asistieron.push(idAsistencia);\n pintarAsist(idAsistencia);\n\n }\n console.log(\"ELEMENTO AGREGADO\" + idAsistencia);\n console.log(asistieron);\n}", "addTrack(track){\r\n this.tracks.push(track);\r\n \r\n }", "function populateEpisodes(episodes){\n $episodesList = $('#episodes-list');\n\n for(let episode of episodes){\n let $newLi = $(`<li>${episode.name} (season ${episode.season}, number ${episode.number})</li>`);\n $episodesList.append($newLi);\n }\n}", "onFundingOffers(offers) {\n this.onRemoveFundingOffers(offers);\n offers.forEach((offer) => {\n this.state.offers.push(offer);\n });\n }", "async function populateCandidatePool(){\n tracks = [];\n if(!uId) await getUserId(accessToken);\n await getTracks(getSelectedGenre());\n \n let ulElem = document.querySelector('.candidatePool ul');\n let currentLiElems = ulElem.querySelectorAll('li');\n for(const liElem of currentLiElems){\n ulElem.removeChild(liElem);\n }\n \n for(const track of tracks){\n let newLi = document.createElement('li');\n newLi.textContent = track['name'];\n \n ulElem.appendChild(newLi);\n }\n}", "addIng(newIng) {\n this.ingredients.push(newIng)\n }", "function addLocations() {\n let list = document.getElementById('locations');\n for (let i = 0; i < locations.length; i++) {\n let option = document.createElement('option');\n option.value = locations[i];\n option.text = locations[i];\n list.appendChild(option);\n }\n}", "function LTEVenue() {\n var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n if (this instanceof LTEVenue) {\n this.params = Object.assign({}, DEFAULT_PARAMS, params);\n this.next = generateSite$1(this.params);\n this.toString = makeToStringForGenerator('LTEVenue', this.params);\n } else {\n return new LTEVenue(params);\n }\n}", "function addStops(stops) {\n\n stops.forEach(function (stop) {\n\n var option = '<option value=\"' + stop.stop_name + ' - ' + stop.stop_id + '\"></option>';\n departures.innerHTML += option;\n arrivals.innerHTML += option;\n });\n}", "function addSport() {\n\n var newSport = $('#sport-input').val();\n\n allSports.push(newSport);\n\n displayButtons();\n return false;\n}", "function addVegetables() {\n vegSubmit.addEventListener('click', function(e) {\n distributeVeg(1);\n distributeVeg(2);\n distributeVeg(3);\n distributeVeg(4);\n vegSubmitButton.innerHTML = 'Add more vegetables';\n e.preventDefault();\n });\n}", "fillListFromSearch(list) {\n var areas = instance.getAreaManager().getAll();\n if (areas && areas.length > 0) {\n for (var i = 0, n = areas.length; i < n; i++) {\n list.push(new AreaNode(areas[i]));\n }\n } else {\n this.addNoResult(list);\n }\n }", "function createLocationArrayVenues(userShows) {\n //console.log(userShows);\n var venueLocArr = [];\n _.forEach(userShows, function(value, key){\n venueLocArr.push(`${value.venue}, ${value.city}, ${value.state}`);\n });\n _.uniq(venueLocArr);\n //console.log(venueLocArr);\n // _.uniq(venueLocArr)\n // console.log(venueLocArr);\n // var locArr = [];\n // for (i = 0; i < userShows.length; i++) {\n // locArr.push(`${userShows[i].venue}, ${userShows[i].city}, ${userShows[i].state}`)\n // };\n // console.log(locArr);\n // return locArr;\n}", "function createImages(venues) {\n for (let i = 0; i < venues.length; i++) {\n let venue = venues[i].venue;\n let titleid = '#title' + (i + 1);\n let imgid = '#img' + (i + 1);\n let imgsrc = '../../venue_imgs/' + venues[i].id + '.jpg';\n let imgalt = venue + 'Image';\n\n $(titleid).html(venue);\n $(imgid).attr('src', imgsrc);\n $(imgid).attr('alt', imgalt);\n }\n}", "function addNewWatchList() {\n const watchList = STATE.getWatchList();\n\n const newWatchList = {\n id: watchList[watchList.length - 1].id + 1,\n title: \"Watchlist \" + watchList[watchList.length - 1].id + 1,\n currencies: []\n }\n STATE.watchlist.push(newWatchList);\n const container = $('.watchlist-right-sidebar .sidebar-container .sidebar-content');\n container.append(getWatchListHTML({ id: STATE.watchlist.length, title: `Watchlist ${STATE.watchlist.length}` }))\n registerWatchListEvents()\n }", "async function handleAddDev(data){ // Salva um novo Dev\n const response = await api.post('/devs', data);\n \n setDevs([...devs, response.data]);\n }", "function addEntry(events, squirrel) {\n JOURNAL.push({ events, squirrel });\n}", "addToSelectedProcedures (item) {\n\n\t\tif (this.selectedProcedures.includes(item)) {\n\t\t\t_remove(this.selectedProcedures, (obj) => obj.id == item.id);\n\t\t}\n\t\telse {\n\t\t\tthis.selectedProcedures.push(item);\n\t\t}\n\t}", "function addTeamMembers() {\n inquirer\n .prompt([\n {\n type: 'list',\n name: 'addMembers',\n message: 'What would you like to do?',\n choices: [\n 'Add an Engineer',\n 'Add an Intern',\n \"I'm all done. Let's see my team!\",\n ],\n },\n ])\n .then(answers => {\n switch (answers.addMembers) {\n case 'Add an Engineer': {\n promptEngineer();\n break;\n }\n case 'Add an Intern': {\n promptIntern();\n break;\n }\n case \"I'm all done. Let's see my team!\": {\n buildTeam();\n break;\n }\n }\n });\n }", "addLive() {\n this._lives++;\n }", "function getData() {\n //URL for the FourSquare explore venues request\n var searchFor = 'food';\n var searchRadius = '200'; //meters\n var client_id = \"JI2X04M51STQLOUGVX0SWEOOSOOSHB2BEMZ0QTPM02TMJGGX\";\n var client_secret = \"4W4IRQJ10E0HKFLK4TFX3KZ4Q25DHQMFKH0IQEYFRG3XDQXQ\";\n var foursquareExplore = \"https://api.foursquare.com/v2/venues/explore?client_id=\";\n foursquareExplore += client_id + \"&client_secret=\";\n foursquareExplore += client_secret + \"&v=20150704&ll=\";\n foursquareExplore += latM + \",\";\n foursquareExplore += lngM + \"&radius=\";\n foursquareExplore += searchRadius + \"&section=\";\n foursquareExplore += searchFor + \"&limit=50\";\n\n //ajax for details (photos) for the venues\n var ajaxFoursquarePhotos = function(venue) {\n function addPhoto(item) {\n var photo = {};\n photo.prefix = item.prefix;\n photo.suffix = item.suffix;\n photo.width = item.width;\n photo.height = item.height;\n venue.photos.push(photo);\n }\n var photos = \"https://api.foursquare.com/v2/venues/\";\n photos += venue.id + \"/photos?client_id=\";\n photos += client_id + \"&client_secret=\";\n photos += client_secret + \"&v=20150704\";\n $.ajax({\n url: photos,\n success: function(results) {\n //number of photos\n var count = results.response.photos.count;\n //max 10 photos\n count = count < 10 ? count : 10;\n venue.photoCount = count;\n if (count > 0) {\n var result = results.response.photos.items;\n for (var i = 0; i < count; i++) {\n addPhoto(result[i]);\n }\n } else {\n venue.photos.push(emptyPhoto);\n }\n },\n error: function(xhr) {\n var responseText = $.parseJSON(xhr.responseText);\n successDetailData = false;\n showErrorWindow('Server response: <em>' + responseText.meta.errorDetail + '</em>');\n }\n });\n };\n\n //AJAX request for Venues\n var ajaxFoursquareExplore = function(request) {\n $.ajax({\n url: request,\n success: function(results) {\n var result = results.response.groups[0].items;\n //map --> Model/data to viewModel\n VM.myVenues(ko.utils.arrayMap(result, function(place) {\n return new VM.Venue(place);\n }));\n //run ajax for details, create the markers and setup the categories\n for (var i = 0, len = VM.myVenues().length; i < len; i++) {\n var venue = VM.myVenues()[i];\n ajaxFoursquarePhotos(venue);\n //Create markers\n venue.mapMarker = createMarker(venue);\n var c = venue.category;\n //Add only once the category\n if ($.inArray(c, VM.categories()) === -1) {\n VM.categories.push(c);\n }\n VM.categories.sort();\n }\n },\n error: function(xhr) {\n successMainData = false;\n var responseText = $.parseJSON(xhr.responseText);\n showErrorWindow('Server response: <em>' + responseText.meta.errorDetail + '</em>');\n }\n });\n };\n\n var createMarker = function(venue) {\n var latLng = new google.maps.LatLng(venue.lat, venue.lng);\n var marker = new google.maps.Marker({\n map: map,\n position: latLng,\n icon: venue.icon.prefix + 'bg_32' + venue.icon.suffix,\n });\n google.maps.event.addListener(marker, 'click', function() {\n showInfoWindow(venue);\n });\n return marker;\n };\n //Make the ajax requests\n ajaxFoursquareExplore(foursquareExplore);\n }", "function addPokemonToList(pokemon, list) {\n const pokLi = document.createElement(\"li\")\n const pokInfo = document.createTextNode(`${pokemon.nickname} (${pokemon.species})`)\n const releaseBtn = document.createElement(\"button\")\n const release = document.createTextNode(\"Release\")\n releaseBtn.classList.add(\"release\")\n releaseBtn.setAttribute(\"data-pokemon-id\", pokemon.id)\n releaseBtn.appendChild(release)\n pokLi.appendChild(pokInfo)\n pokLi.appendChild(releaseBtn)\n list.appendChild(pokLi)\n\n // add listener to release button\n releaseBtn.addEventListener(\"click\", (e) => {\n const pokemonId = e.target.getAttribute(\"data-pokemon-id\")\n removePokemonFromTeam(pokemonId)\n })\n}", "function updateWorld() {\n\n // update player data\n\n TemplateService.inject( Templates.STATS_DISPLAY, container, {\n money: Player.money,\n radius: Player.radius\n });\n\n // retrieve all venues\n\n police = [], banks = [], gas = [];\n\n // a bit of a Promise pyramid which could benefit from async - await !\n\n FourSquareService.API.venues( Locations.POLICE )\n .then(( policeData ) => {\n police = policeData.venues;\n\n FourSquareService.API.venues( Locations.BANK, Categories.BANK )\n .then(( bankData ) => {\n banks = bankData.venues;\n\n FourSquareService.API.venues( Locations.GAS )\n .then(( gasData ) => {\n\n gas = gasData.venues;\n\n // flush existing markers and render the new list\n // not entirely low on overhead with regards to reusable\n // resource, but we're in a rush ;)\n\n PubSub.publishSync( Actions.FLUSH_MARKERS );\n PubSub.publishSync( Actions.CREATE_MARKERS, { police, banks, gas });\n });\n })})\n .catch(( error ) => PubSub.publish( Actions.SHOW_ERROR, { message: error }));\n}", "addItem(name) {\n if ( !(this.items.all.includes(name))) {\n console.log(\"Adding new item, \" + name)\n this.items.all.push(name)\n }\n }", "function insertTeams() {\n // first, check to see if team_id_to_name matches teams\n if (fs.existsSync(\"./resources/teams.json\")) {\n // if there is a teams file, use that to determine team names at the event\n let file = JSON.parse(fs.readFileSync(\"./resources/teams.json\"));\n // if the list of teams we know equal to the keys of the teams.json file\n if (arraysEqual(teams, Object.keys(file))) {\n // put all the info into team_id_to_name\n team_id_to_name = file;\n for (let team_id in teams) {\n let team = teams[team_id];\n // adds them to the \"teams page\"\n insertTeam(team);\n }\n // if the arrays were not equal, just pull from TBA\n } else {\n insertTeamsWithTBA();\n }\n // if we don't know team names, get them from TBA\n } else {\n insertTeamsWithTBA();\n }\n}" ]
[ "0.6278627", "0.6086471", "0.5929419", "0.5926679", "0.5814627", "0.5639007", "0.56181884", "0.5587607", "0.55733824", "0.5558537", "0.55414367", "0.54809374", "0.5468348", "0.5412412", "0.53753245", "0.5342769", "0.5342769", "0.52828264", "0.52623916", "0.52481157", "0.5239285", "0.522866", "0.5225472", "0.5135871", "0.5114246", "0.51115555", "0.5110714", "0.510009", "0.5078964", "0.5078451", "0.5075663", "0.5069013", "0.5054", "0.50442946", "0.5038768", "0.50284046", "0.50231683", "0.5019207", "0.50160426", "0.5014318", "0.5003309", "0.5001869", "0.49957165", "0.4984849", "0.49815097", "0.49793443", "0.49568635", "0.4948618", "0.49442178", "0.4943447", "0.49392197", "0.49362883", "0.49335745", "0.4928723", "0.4924801", "0.49217063", "0.49169624", "0.49109998", "0.49072534", "0.49048856", "0.49032167", "0.48988643", "0.48874617", "0.48750523", "0.48720095", "0.48698184", "0.48369643", "0.48363236", "0.48324588", "0.4829648", "0.48240986", "0.48185888", "0.48076507", "0.48050052", "0.47987863", "0.47953632", "0.47925025", "0.47898868", "0.47783324", "0.47758353", "0.4775614", "0.47752085", "0.47742468", "0.47739366", "0.47667652", "0.47639975", "0.4763484", "0.47622883", "0.4754449", "0.47529602", "0.47474393", "0.47472742", "0.47396183", "0.4738294", "0.47382712", "0.47355148", "0.4735159", "0.47348154", "0.4734207", "0.47314766" ]
0.6353486
0
Expands a venue on the list
function pag_expandVenueList(namespace, venueId){ pag_xmlRpcClient.call("expandVenue",venueId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pag_collapseVenueList(namespace, venueId){\n pag_xmlRpcClient.call(\"collapseVenue\",venueId);\n}", "function harmonizePlace() {\n if (W.selectionManager.selectedItems.length === 1) {\n var item = W.selectionManager.selectedItems[0].model;\n if (item.type === \"venue\") {harmonizePlaceGo();}\n }\n }", "function expandPlaceLink(vers_platz_link)\r\n{\r\n\tvar submenu = document.createElement(\"ul\");\r\n\tvar truppen = createLinkNode(\"game.php?\"+getUrlParam(\"village\")+\"&screen=place&mode=units\",\"\",\"Truppen\",\"\");\r\n\tvar sim = createLinkNode(\"game.php?\"+getUrlParam(\"village\")+\"&screen=place&mode=sim\",\"\",\"Simulator\",\"\");\r\n\tsubmenu.appendChild(truppen);\r\n\tsubmenu.appendChild(sim);\r\n\tvers_platz_link.appendChild(submenu);\r\n\treturn vers_platz_link;\r\n}", "addHearthToInventory(brand, item) {\n this.inventory.push({ brand, item });\n }", "onSelectValues(venueId) {\n this.props.updateVenueConstraintsData(venueId, null, 'venues', 'venueListSection');\n this.props.clearFilter();\n this.setState({ addOrRemoveVenues: true });\n }", "expandItem(item){if(!this._isExpanded(item)){this.push(\"expandedItems\",item)}}", "function pag_changeVenueSelection(mode) {\n pag_xmlRpcClient.call(\"changeVenueSelection\", mode);\n}", "function expand(entity) {\n\t// randomly select vertex to be expanded\n\tconst rand_vertex = getRandomExpandableVertex(entity);\n\tif (rand_vertex && rand_vertex.options.length > 0) {\n\t\t// radomly select one of available\n\t\tconst expansion = Math.round(Math.random() * (rand_vertex.options.length - 1));\n\t\t// expand map in selected direction\n\t\trand_vertex.x = rand_vertex.options[expansion][0];\n\t\trand_vertex.y = rand_vertex.options[expansion][1];\n\t\t// analyze further expansion options\n\t\trand_vertex.options = analyzePoint(rand_vertex.x, rand_vertex.y);\n\t} else {\n\t\t// TODO handle stop expanding when out of options\n\t}\n}", "function expandMarketLink(market_link)\r\n{\r\n\tvar submenu = document.createElement(\"ul\");\r\n\tvar eigene_angeb = createLinkNode(\"game.php?\"+getUrlParam(\"village\")+\"&screen=market&mode=own_offer\",\"\",\"Eigene Angeb.\",\"\");\r\n\tvar fremde_angeb = createLinkNode(\"game.php?\"+getUrlParam(\"village\")+\"&screen=market&mode=other_offer\",\"\",\"Fremde Angeb.\",\"\");\r\n\tvar status = createLinkNode(\"game.php?\"+getUrlParam(\"village\")+\"&screen=market&mode=traders\",\"\",\"Haendlerstatus\",\"\");\r\n\tsubmenu.appendChild(eigene_angeb);\r\n\tsubmenu.appendChild(fremde_angeb);\r\n\tsubmenu.appendChild(status);\r\n\tmarket_link.appendChild(submenu);\r\n\treturn market_link;\r\n}", "function expandList() {\n var hidden_lis = $$('li.hidden');\n hidden_lis.each(function(li) {\n li.removeClassName('hidden');\n li.addClassName('not-hidden');\n });\n $j('#expandable-link').text(\"\\< Hide full list\");\n $j('#expandable-link').unbind('click');\n $j('#expandable-link').click(function(){\n contractList();\n return false;\n });\n}", "onAddListPlanItem(e, index, key) {\n\t\tvar { header } = this.state;\n\t\tvar new_item = {\n\t\t\ttitle: 'New Option',\n\t\t\tno_title: 'Nytt alternativ'\n\t\t};\n\t\theader.list.items[index].options[key].items.push(new_item);\n\t\tthis.setState({ header });\n\t}", "function expand(zone_id_to_expand, cards_ids) {\n var parent_zone = bga.getElement( {id: zone_id_to_expand}, ['id','name'] );\n var expand_id = bga.getElement( {name: 'EXPAND_ZONE' } );\n var tag_name = bga.getElement({id : expand_id}, 'tags');\n var tag_name_string = tag_name.toString();\n var expand_zone_how_to_arrange_parameter = bga.getElement({id: expand_id}, 'howToArrange');\n // vérifie que l'expand n'est pas déjà ouverte\n if (expand_zone_how_to_arrange_parameter === 'spreaded') {\n bga.cancel(_('You already have a zone visible'));\n }\n\n if (cards_ids === undefined ) {\n cards_ids = bga.getElementsArray( {parent: parent_zone.id} );\n }\n \n // supprime le tag de l'expand pour sa prochaine utilisation\n bga.removeTag(expand_id, tag_name_string);\n // ajoute le nom de la parent zone en tag à l'expand zone pour savoir où la collapse ensuite\n bga.addTag(expand_id, parent_zone.name);\n \n var props = [];\n props[expand_id] = {\n x: 50, \n y: 100, \n width:700, \n height:500, \n visible: 'player'+bga.getActivePlayerColor(), \n howToArrange: 'spreaded', \n inlineStyle: 'background-color: rgba(255, 255, 255, 0.8)'\n };\n bga.setProperties( props );\n bga.moveTo( cards_ids, expand_id ); \n}", "function featureVenues(){\n\t\tfor (i=0;i<hoods.length;i++){\n\t\t\tif (venues.neighborhood = hoods[i]){\n\t\t\t\tfeatVen = venues;\n\t\t\t\tvar x = Math.floor(Math.random() * featVen.length);\n\t\t\t\tconsole.log(\"x: \"+x);\n\t\t\t\tvenueID = featVen[x].id;\n\t\t\t\tconsole.log(\"featured venue \"+venueID);\n\t\t\t\tvenueAPI();\n\t\t\t};\n\t\t};\n\t}", "function InventoryItemMouthDildoPlugGagClick() {\n\tExtendedItemClick(InventoryItemMouthDildoPlugGagOptions);\n}", "function addVegetables() {\n vegSubmit.addEventListener('click', function(e) {\n distributeVeg(1);\n distributeVeg(2);\n distributeVeg(3);\n distributeVeg(4);\n vegSubmitButton.innerHTML = 'Add more vegetables';\n e.preventDefault();\n });\n}", "function ManageOffersFromSpecialOffer(id)\n{\n\n}", "addPopularTours(state, product) {\n\t\tstate.popularToursList.push(product)\n\t}", "function pag_addVenuesToList(namespace, parent, connections, venueClientControllerId) {\n for (var i = 0; i < connections.size(); i++) {\n pag_venueTree.addTreeNode(\n parent,\n \"pag_venue\" + connections.get(i).getId(), null,\n connections.get(i).getName(),\n connections.get(i).isExpanded(),\n \"pag_selectVenue(\" + \"'\" + namespace + \"'\" + \",\"\n + \"'\" + connections.get(i).getId() + \"'\" + \");\",\n \"pag_isPreviousVenue = pag_goToVenue(\" + \"'\"\n + connections.get(i).getUri() + \"'\" + \", \"\n + \"'\" + venueClientControllerId + \"'\"\n + \");\",\n \"pag_expandVenueList(\"+ \"'\" + namespace + \"'\" + \",\"\n + \"'\" + connections.get(i).getId() + \"'\"\n + \");\",\n \"pag_collapseVenueList(\"+ \"'\" + namespace + \"'\" + \",\"\n + \"'\" + connections.get(i).getId() + \"'\"\n + \");\",\n false);\n if (connections.get(i).isExpanded()){\n pag_addVenuesToList(namespace, \"pag_venue\" + connections.get(i).getId(), connections.get(i).getConnections(), venueClientControllerId);\n }\n }\n}", "function add_greenhouse_entry_to_list() {\n\n var entry_by = 'greenhouse';\n\n document.getElementById(\"harvest_greenhouse_form\").addEventListener(\"click\", function(event){\n event.preventDefault()\n });\n\n var harvest = get_harvest_object();\n var validated = is_harvest_valid(harvest);\n\n if (validated) {\n\n harvest_list.push(harvest);\n add_harvest_to_queue_table(harvest, entry_by);\n\n if (!lock) {\n lock = true;\n document.getElementsByName(\"greenhouse\")[0].disabled = true;\n var tableTitle = document.createTextNode(\"HARVEST FOR \\u00A0\" + harvest.greenhouse.toUpperCase());\n document.getElementsByClassName('table-title')[0].appendChild(tableTitle);\n document.getElementsByClassName('table-title')[0].style.display = \"block\";\n }\n\n document.getElementById('harvest_greenhouse_form').reset();\n }\n}", "function gotoVenue(event) {\n event.stopPropagation();\n let button = $(\"[role='button']\").has(event.target);\n if (button.length) {\n window.location.href = \"./event-list.html?vid=\" + button.attr(\"data-value\");\n }\n}", "createExpense(e) {\n e.preventDefault()\n const value = this.newExpenseName.value\n\n this.expensesAdapter.createExpense(value).then(expense => {\n this.expenses.push(new Expense(expense))\n this.newExpenseName.value = ''\n this.renderExpense()\n })\n }", "function add_species_entry_to_list() {\n\n var entry_by = 'species';\n document.getElementById(\"harvest_species_form\").addEventListener(\"click\", function(event){\n event.preventDefault()\n });\n\n var harvest = get_harvest_object();\n var validated = is_harvest_valid(harvest);\n\n if (validated) {\n\n harvest_list.push(harvest);\n add_harvest_to_queue_table(harvest, entry_by);\n\n if (!lock) {\n lock = true;\n document.getElementsByName(\"strain\")[0].disabled = true;\n var tableTitle = document.createTextNode(\"HARVEST FOR \\u00A0\" + harvest.strain.toUpperCase());\n document.getElementsByClassName('table-title')[0].appendChild(tableTitle);\n document.getElementsByClassName('table-title')[0].style.display = \"block\";\n }\n\n document.getElementById('harvest_species_form').reset();\n }\n}", "function handleExpandView(){\n $('main').on('click', '.list-item', function(event){\n let bookmark = getBookmarkId(event.currentTarget)\n store.toggleExpand(bookmark);\n render();\n });\n}", "PushToLocationList(Spot) {\n }", "itemClickHandler({ itemName, itemType, quality }) {\n let eCost = energyCost.plantingSeed;\n let tCost = timeCost.plantingSeed;\n\n if (this.props.player.energy[0] >= eCost) {\n let [field, player, time] = this.initializeDataDef(eCost, tCost, 0);\n let inventory = new Inventory({ items: player.inventory });\n inventory.removeItemFromInventory(\n new Item({ name: itemName, quantity: 1, quality })\n );\n player.updateInventory(inventory.items);\n\n if (itemType === \"Fertilizer\") {\n let fertRate = fertilizerRate[itemName]\n ? fertilizerRate[itemName].rate(quality)\n : 0;\n field.isFertilized = true;\n field.plant.buff.positive.push({ rate: fertRate, name: itemName });\n } else {\n let plant = new Plant({ seed: itemName });\n field = new Field({\n id: this.props.item.id,\n name: this.props.item.name,\n imageName: plant.getPlantImage(), //image name\n label: plant.name,\n type: \"Plant\", //Obstacle, Plowed, Unplowed, Plant, Yield\n isWorked: false,\n health: [100, 100, 0],\n plant, //{} for obstacle, plowed, unplowed})\n });\n }\n\n this.props.saveFarm({\n newField: field,\n fieldType: this.props.fieldType, //smallField, mediumField, largeField\n player,\n time,\n });\n } else {\n alert(\"You don't have enough energy\");\n }\n this.modalCloseHandler();\n }", "function updateShops() {\n // update the request:\n url = \"https://api.foursquare.com/v2/venues/search\\?\" +\n \"client_id=\" + client_id +\n \"&client_secret=\" + client_secret +\n \"&v=20170406\" +\n \"&ll=\" + map.getCenter().lat().toString() + \",\" + map.getCenter().lng().toString() +\n \"&query=coffee\" +\n \"&limit=25\" + \"&radius=8000\";\n createFSQMarkerList(url);\n}", "function createVenueList(){\n var iconAddress, photo;\n for (var i = 0; i < venueDetails.length; i++) {\n $('#venue-text').append(venueDetails[i].venueUiFormatText(venueDetails[i]));\n //for block wewon't have photo's, just the icons if any\n\n if(venueDetails[i].location_icon){\n iconAddress=vendorIconPath+replaceIconSize(venueDetails[i].location_icon,'l');\n }else if(venueDetails[i].loolgroup_icon){\n iconAddress=vendorIconPath+replaceIconSize(venueDetails[i].loolgroup_icon,'l');\n }else if(venueDetails[i].imageArray && venueDetails[i].imageArray.length>0){\n\t\ticonAddress=postingHost+postingPicturePath+venueDetails[i].imageArray[0].id+'/thumb_'+venueDetails[i].imageArray[0].image;\n\t}else{\n iconAddress='none';\n }\n photo=\"url('\"+iconAddress+\"')\";\n $(\"#\"+venueDetails[i].place_id+'-pic').css(\"background-image\",photo);\n }\n for (var i = 0; i < venueDetails.length; i++) {\n venueDetails[i].createClickHandler(venueDetails[i]);\n }\n}", "handleVenueClick(index) {\n const { gblMarkers } = this.state;\n window.google.maps.event.trigger(gblMarkers[index], 'click');\n /* \n if maker index does not !== equal null, set to null \n else sets marker to ` BOUNCE `\n */\n if (gblMarkers[index].getAnimation() !== null) {\n gblMarkers[index].setAnimation(null, );\n } else {\n gblMarkers[index].setAnimation(window.google.maps.Animation.BOUNCE);\n gblMarkers[index].setAnimation(6);\n } \n }", "function Venue(id, name, latitude, longitude) {\n var self = this;\n self.id = id;\n self.name = name;\n self.latitude = latitude;\n self.longitude = longitude;\n}", "function inventoryAdd(item) {\n item.show();\n\titem.moveTo(inventory_layer);\n item.clearCache();\n\titem.scale({x: 1, y: 1});\n\titem.size({width: 80, height: 80});\n\n\tif (inventory_list.indexOf(item) > -1)\n\t\tinventory_list.splice(inventory_list.indexOf(item), 1, item);\n\telse\n\t\tinventory_list.push(item);\n\n // The picked up item should be visible in the inventory. Scroll inventory\n // to the right if necessary.\n if (inventory_list.indexOf(item) > inventory_index + inventory_max - 1)\n inventory_index = Math.max(inventory_list.indexOf(item) + 1 - inventory_max, 0);\n\n current_layer.draw();\n\tredrawInventory();\n}", "function createVenueFromFourSquare (venue) {\n\n var loc = new Location({\n fourSquareId: venue.id,\n name: venue.name,\n slug: utils.convertToSlug(venue.name),\n adress: venue.location.adress\n });\n\n Challenge.random(function (err, challenge) {\n loc.challenges.push(challenge);\n challenge.locations.push(loc);\n challenge.save();\n loc.save(function (savedObj) {\n console.log('location has been saved;');\n });\n })\n\n\n}", "putin(item) {\n if (this.open = true) {\n this.item.push(item);\n alert(\"Item has been added to the backpack.\");\n }\n }", "function rnAddShow(showtime, venue_name, venue_city, venue_country) {\n gReverbNation['showtime'] = showtime;\n gReverbNation['venue[name]'] = venue_name;\n gReverbNation['venue[city]'] = venue_city;\n gReverbNation['venue[country]'] = venue_country;\n _rnLogin(_rnAddShow, null);\n}", "function addPez(dispenser, newFlavor) {\n dispenser[\"flavors\"].unshift(newFlavor);\n return dispenser[\"flavors\"][0];\n}", "function expand (index) {\n let id = index.getAttribute(\"href\").toString();\n id = id.slice(1);\n var scope = angular.element(document.getElementById(\"MovieCarousel\")).scope();\n scope.$apply(function() {\n scope.expand(id);\n });\n return false;\n}", "function addAnotherPlan() {\n const list = planList;\n for (const item of list) {\n item.visibility = \"hidden\";\n }\n setPlanList([\n ...list,\n {\n visibility: \"visible\",\n coins: [],\n characteristics: [],\n duration: \"1 m\",\n refund: 20,\n },\n ]);\n }", "function addNewOffer() {\n\n\tvar flag = '#addNewOffer';\n\t//apply selected class on current button\n\taddSelectedClassOnButton(flag);\n\n\tif($('ul#mostPopularCode li').length > 25) {\n\n\t\tbootbox.alert(__('Popular code list only show 25 records please delete one If you want to add this popular code'));\n\n\t} else {\n\n\t\tif($(\"input#searchCouponTxt\").val()=='' || $(\"input#searchCouponTxt\").val()==undefined)\n\t\t\t{\n\t\t\t\t//console.log('ok');\n\t\t\t\tbootbox.alert(__('Please select an offer'));\n\n\t\t\t} else {\n\n\t\t\t\tvar offerName = $(\"input#searchCouponTxt\").val();\n\n\t\t\t\t$.ajax({\n\t \t\turl : HOST_PATH + \"admin/popularcode/addoffer/name/\" + offerName,\n\t \t\t\tmethod : \"post\",\n\t \t\t\tdataType : \"json\",\n\t \t\t\ttype : \"post\",\n\t \t\t\tsuccess : function(data) {\n\n\t \t\t\t\tif(data=='2' || data==2)\n\t \t\t\t\t\t{\n\t \t\t\t\t\t\tbootbox.alert(__('Problem in your selection'));\n\n\t \t\t\t\t\t} else {\n\n\t \t\t\t\t\t\tvar li = \"<li reltype='\" + data.type + \"' relpos='\" + data.position + \"' reloffer='\" + data.offerId + \"' id='\" + data.id + \"' >\" + offerName + \"</li>\";\n\t \t\t\t\t\t\t$('ul#mostPopularCode').append(li);\n\n\t \t\t\t\t\t\t$('ul#mostPopularCode li#'+ data.id).click(changeSelectedClass);\n\n\t \t\t\t\t\t\t$(\"input#searchCouponTxt\").val('');\n\t \t\t\t\t\t}\n\n\t \t\t\t}\n\n\n\t\t\t\t});\n\t\t\t\t//code add offer in list here\n\t\t\t}\n\t}\n}", "saveInventory(state) {\n const index = state.inventories.findIndex(obj => obj._key === state.inventoryForm.data._key);\n\n if (index > -1) {\n state.inventories.splice(index, 1, clone(state.inventoryForm.data));\n } else {\n state.inventories.push(createInventory(state.inventoryForm.data));\n }\n }", "function displayButton() {\n const sel1 = W.selectionManager.getSelectedFeatures();\n\n if (sel1.length > 0) {\n if(sel1[0].model.type == 'venue') {\n $('#MyclosedVenueContainer').css('display', 'block');\n } else {\n $('#MyclosedVenueContainer').css('display', 'none');\n }\n }else {\n $('#MyclosedVenueContainer').css('display', 'none');\n }\n }", "function updateInventory() {\n ul_inventoryList.empty();\n let li;\n $(inventory).each(function (index, element) {\n li = $(\"<li>\");\n li.data(\"name\", element[\"name\"]);\n li.html(element[\"name\"] + \": \" + element[\"count\"]);\n ul_inventoryList.append(li);\n });\n }", "function expandItem(event) {\n\t\t\tvar targetElement = event,\n\t\t\t\ttargetElement$ = $(targetElement),\n\t\t\t\tnewHeight = (targetElement && targetElement.data(\"fullheight\")) ? targetElement.data(\"fullheight\") : \"\";\n\n\t\t\ttargetElement$.height(newHeight).removeAttr(\"style\");\n\t\t\ttargetElement$.parents(\".normalPostEntryItem\").first().find(\".postExpandClass\").remove();\n\t\t}", "function addToAdmin(newObject){\n var line = {};\n line.Brand = newObject.brand;\n line.skuCode = newObject.skuCode;\n var supplierCode = newObject.supplierCodeList; \n line.attribute = newObject.attribute;\n line.attributeCount = newObject.attributeCount;\n line.ohmies = newObject.ohmies;\n line.wholesale = newObject.wholesale;\n line.msrp = newObject.msrp;\n var supplierRow = searchString(supplierCode);\n addNewRows(\"ADMIN_INFO\", supplierRow, 1, line)\n \n}", "function addToInventory(determine) {\n App[App.myRole].inventory[determine-1].quantity++;\n }", "function addPokemonToTeam(e) {\n let pokeIndex = \"\"\n if (!e.currentTarget) {\n pokeIndex = e.attributes[2].value;\n }\n else {\n pokeIndex = e.currentTarget.attributes[2].value;\n }\n\n if (currentTeam.length < 6) {\n\n currentTeam.push(pokeIndex);\n getTeamMember(currentTeam[currentTeam.length - 1]);\n\n }\n else {\n document.querySelector(\"#teamStatus\").innerHTML = \"<p>Your team is already full!</p>\";\n }\n}", "function agregar(id) {\n let productoElegido = productos.find((el) => el.id == id);\n if (productoElegido.stock >= 1 ) {\n carrito.push(productoElegido);\n activarCarrito()\n \n \n \n } else {\n carrito.splice(productos.find((el) => el.id == id));\n \n }\n \n }", "function pickHotel() {\n\n console.log('hello from hotel');\n for ( let i = 0 ; i < Hotel.all.length ; i++ ){\n if ( plan.budget === Hotel.all[i].hotelBudget && plan.planDays[0].dayLocation === Hotel.all[i].location ) {\n plan.planDays[0].planHotel = Hotel.all[i];\n\n }\n \n\n }\n\n}", "function addNewExplosion(list, x, y, type, browserWidth, browserHeight) {\n switch (type) {\n case Constants.SpriteType.EXPLOSION_LARGE:\n list.push(new GameObjects.ExplosionLarge(x, y, browserWidth, browserHeight));\n case Constants.SpriteType.EXPLOSION_SMALL:\n default:\n list.push(new GameObjects.ExplosionSmall(x, y, browserWidth, browserHeight));\n break;\n }\n }", "function Vessel (data) {\n this.data = data\n\n this.actions = {\n create: new Action('create', 'Create a new vessel at your current location.', 'words isunique isvalid isnotempty',\n (name) => {\n paradise.add(new Vessel({ id: paradise.next(), name: name, owner: this.data.id, parent: this.parent().data.id }))\n return `You created the ${name}.`\n }),\n enter: new Action('enter', 'Enter a visible vessel.', 'words visible target isnotempty',\n (name, target) => {\n this.data.parent = target.data.id\n return `You entered the ${target}.`\n }),\n leave: new Action('leave', 'Exit the parent vessel.', 'isnotparadox',\n () => {\n const origin = this.parent().data.name\n this.data.parent = this.parent().parent().data.id\n return `You left the ${origin}.`\n }),\n become: new Action('become', 'Become a visible vessel.', 'visible target isnotempty',\n (name, target) => {\n client.vessel = target\n return `You became the ${target}`\n }),\n take: new Action('take', 'Move a visible vessel into a child vessel.', 'visible target isnotempty',\n (name, target) => {\n target.data.parent = this.data.id\n return `You took the ${target}.`\n }),\n drop: new Action('drop', 'Move a child vessel into the parent vessel.', 'inventory target isnotempty',\n (name, target) => {\n target.data.parent = this.parent().data.id\n return `You dropped the ${target}.`\n }),\n warp: new Action('warp', 'Move to a distant vessel.', 'distant target relation isnotempty',\n (name, target, relation) => {\n this.data.parent = relation === 'outside' ? target.parent().data.id : target.data.id\n return target.data.id === client.vessel.data.id ? `you warped ${relation} yourself.` : `you warped ${relation} the ${target}.`\n }),\n note: new Action('note', 'Add a description to the current parent vessel.', '',\n (name) => {\n this.parent().data.note = name\n return `You modified the note of the ${this.parent()}.`\n }),\n pass: new Action('pass', 'Add a passive note to the current parent vessel.', '',\n (name) => {\n this.parent().data.passive = name\n return `You modified the passive message ${this.parent()}.`\n }),\n program: new Action('program', 'Add an automation program to a vessel, making it available to the use command.', '',\n (name) => {\n this.parent().data.program = name\n return `You modified the program of the ${this.parent()}.`\n }),\n learn: new Action('learn', 'Read documentation for each action, or see a list of action.', 'words',\n (name) => {\n return this.actions[name] ? name + ': ' + this.actions[name].docs : `the available commands are: ${andList(Object.keys(this.actions))}. to see the documentation for a specific command, use \"learn to move\".`\n }),\n use: new Action('use', 'Trigger a vessel\\'s program.', 'isnotempty visible target',\n (name, target) => {\n if (!target.data.program) { return `the ${target} has no program.` }\n return this.act(target.data.program)\n }),\n transform: new Action('transform', 'Change your current vessel name.', 'isnotempty words isunique isvalid',\n (name, target) => {\n this.data.name = name\n return `You transformed into a ${name}.`\n }),\n move: new Action('move', 'Move a visible vessel into another visible vessel.', 'isnotempty cast',\n (name, target, relation, cast) => {\n target.data.parent = cast.data.id\n return `You moved the ${target} into ${cast}.`\n })\n }\n\n this.act = (q) => {\n const params = `${q}`.trim().split(' ')\n const action = params.shift()\n if (!action) { return '' }\n if (!this.actions[action]) { return `You said \"${q}\"` }\n return this.actions[action].run(this, params.join(' '))\n }\n\n // access\n\n this.parent = () => {\n return paradise.world[this.data.parent]\n }\n\n this.owner = () => {\n return paradise.world[this.data.owner]\n }\n\n this.action = () => {\n if (this.data.program) { return 'use' }\n if (this.parent().data.id === client.vessel.data.id) { return 'drop' }\n if (this.data.passive) { return 'take' }\n return 'enter'\n }\n\n this.stem = () => {\n const known = []\n let v = this\n while (v.isParadox() !== true) {\n if (known.indexOf(v.data.id) >= 0) { return null }\n known.push(v.data.id)\n v = v.parent()\n }\n return v\n }\n\n // selector\n\n this.sight = () => {\n const a = paradise.filter((vessel) => {\n return vessel.parent().data.id === this.parent().data.id && vessel.data.id !== this.data.id && vessel.data.id !== this.parent().data.id\n })\n return a\n }\n\n this.inventory = () => {\n const a = paradise.filter((vessel) => {\n return vessel.parent().data.id === this.data.id && vessel.data.id !== this.data.id && vessel.data.id !== this.parent().data.id\n })\n return a\n }\n\n this.reach = () => {\n return [].concat(this.sight()).concat(this.inventory())\n }\n\n // tools\n\n this.isParadox = () => {\n return this.data.id === this.parent().data.id\n }\n\n this.toAction = () => {\n return `<a data-action='${this.action()} the ${this}' href='#${this}'>${this.action()} the ${this}</a> ${this.data.pass ? this.data.pass : ''}`.trim()\n }\n\n this.toString = () => {\n return `${this.data.name}`\n }\n\n function andList (arr) {\n return arr.reduce((acc, item, id) => {\n return acc + item + (id === arr.length - 2 ? ' and ' : id === arr.length - 1 ? ' ' : ', ')\n }, '').trim()\n }\n}", "function InventoryItemMouth2CupholderGagClick() {\n\tInventoryItemMouthCupholderGagClick();\n}", "assignToGood(good,pickupIndex,deliveryIndex){\n this.planManager.addGood(good,pickupIndex,deliveryIndex);\n }", "function addMore(event) {\n\tlet storedCart = JSON.parse(localStorage.getItem('cart'));\n\tlet upArrowName = event.target.dataset.name;\n\tlet product = storedCart.find((el) => el.label === upArrowName);\n\tproduct.qty++;\n\tlocalStorage.setItem('cart', JSON.stringify(storedCart));\n\n\tshopcartOverlay.innerHTML = '';\n\tdisplayCart();\n}", "function Venue(graphic, eventHandler){\n Base.prototype.constructor.call(this);\n _.assertParam(graphic,'sb/Graphic');\n this._entityPool = {};\n this._graphic = graphic;\n this._onStage = {};\n }", "function C012_AfterClass_Amanda_InsertEgg() {\n\tPlayerLockInventory(\"VibratingEgg\");\n\tPlayerRemoveInventory(\"VibratingEgg\", 1);\n\tCurrentTime = CurrentTime + 50000;\n}", "editHearth(item, newQuantity) {\n for (let i = 0; i < this.inventory.length; i++) {\n if (this.inventory[i].item === item) {\n this.inventory[i].quantity = newQuantity;\n }\n console.log(\"This is the new quantity\", this.inventory[i].quantity);\n }\n }", "set visit(visitor){\n\n if(!this.visiting){\n this.visiting = {\n current: this.clock.date,\n occupants: []\n };\n }\n\n this.visiting.occupants.push(visitor);\n // todo check trigger events\n }", "selectVenue(id, name, url, image, location, phone, latitude, longitude) {\n const venueId = id;\n const venueName = name;\n const venueUrl = url;\n const venueImage = image;\n const venueLocation = location;\n const venuePhone = phone;\n const venueLatitude = latitude;\n const venueLongitude = longitude;\n\n this.setState({\n loginPage: false,\n signupPage: false,\n homePage: false,\n categoryPage: false,\n venuePage: true,\n venueId,\n venueName,\n venueUrl,\n venueImage,\n venueLocation,\n venuePhone,\n venueLatitude,\n venueLongitude\n })\n }", "function pickUpItem(hero, dagger){\n hero.inventory.push(dagger);\n return hero;\n console.log(hero);\n}", "addOffspring(vampire) { \n this.offspring.push(vampire);\n vampire.creator = this;\n }", "function addInventory(){\n\n var inventoryInfo = {\n make: vm.make,\n\t\t\t\t\tmodel:vm.model,\n\t\t\t\t\tyear:vm.year,\n\t\t\t\t\tprice:vm.price,\n\t\t\t\t\tmileage:vm.mileage,\n\t\t\t\t\texterior:vm.exterior,\n\t\t\t\t\tinterior:vm.interior,\n\t\t\t\t\tvin:vm.vin,\n\t\t\t\t\tstockNumber:vm.stockNumber,\n\t\t\t\t\tengine:vm.engine,\n\t\t\t\t\ttransmission:vm.transmission,\n\t\t\t\t\tfuelType:vm.fuelType,\n\t\t\t\t\tmpg:vm.mpg,\n vehicleNotes: vm.vehicleNotes,\n\t\t\t\t\tvehicleOptions: vm.vehicleOptions\n\t\t\t\t\t\n };\n\n zasMotorsFactory.postInventory(inventoryInfo)\n .then(function(response) {\n\n toastr.success(\"Successfully added to the list!\");\n $state.reload();\n return response;\n },\n function(error) {\n toastr.error(error + \"Unable to passed the new customer infromation from Cotnroller to ZasMotorFactory!\");\n return error;\n });\n \n }", "addExpense(expense) {}", "function findVenue(expense) {\n return expense.type === 'Venue';\n}", "function goToNearByPlace()\n{\n\t\tdocument.getElementById(\"selected_site_Detail\").innerHTML='';\n $('#ListDetail').hide();\n $('#itinerary_Ui').hide();\n $('#nearByPlace').show();\n $('#BuildSearchUi').hide();\n \n}", "function saleToggle(event) {\n // console.log(event);\n if (event.target.name === 'sale') {\n currentInventory.beers[event.target.id].toggleSale();\n currentInventory.saveToLocalStorage();\n // console.log(currentInventory);\n }\n}", "addToExplore(){\n\n Axios.post(`https://get-wanderlust.herokuapp.com/explore/list/${window.localStorage.user_id}`, {\n city: {\n name: this.state.city,\n priority: 3\n },\n headers: {\n \"Content-Type\": \"application/json\"\n }\n })\n }", "async getShortlistOpportunity(href) {\n if (href in this.state.shortlistOpportunities) {\n return this.state.shortlistOpportunities[href];\n } else {\n let item = await this.itemService.getItem(href);\n this.state.shortlistOpportunities[href] = item;\n return item;\n }\n }", "function expandAll(model, state) {\n if (model && model.items) {\n var items = model.items;\n angular.forEach(items, function(item){\n angular.forEach(item.items, function(i){\n i.showDetail = state;\n });\n });\n }\n }", "function populatePlan(response)\r\n{\r\n $(\"#planMenu\").empty()\r\n planList = response;\r\n for(i = 0; i < response.planName.length; i++)\r\n {\r\n $(\"#planMenu\").append('<a href=\"#\" class=\"list-group-item right-click abcd '+ response.planName[i] +'\">' + response.planName[i] + '<span class=\"badge\">'+ response.totalMarkers[i] +'</span> </a>'); \r\n }\r\n}", "function ClickAdicionarArma() {\n gEntradas.armas.push({ chave: 'desarmado', obra_prima: false, bonus: 0 });\n AtualizaGeralSemLerEntradas();\n}", "function _addDetail() {\n for (var i = 0; i < vm.items.length; i++) {\n vm.items[i].actions = [{\n label: vm.items[i].description\n }];\n vm.items[i].startsAt = new Date(vm.items[i].startsAt); //as per requirement of bootstrap calendar\n vm.items[i].endsAt = new Date(vm.items[i].endsAt); //as per requirement of bootstrap calendar\n }\n }", "createItems(e) {\n e.preventDefault()\n\n const loader = document.createElement('div')\n loader.className = 'loader'\n e.target.parentElement.appendChild(loader)\n\n const [name, price, quantity, category, _] = e.target.querySelectorAll('input')\n const itemName = name.value\n const itemPrice = price.value\n const itemQuantity = quantity.value\n const itemCategory = category.value\n const expenseId = e.target.dataset.id\n\n this.itemsAdapter.createItem(itemName, itemPrice, itemQuantity, itemCategory, expenseId).then(item => {\n const expense = this.expenses.find(s => s.id == expenseId)\n e.target.parentElement.removeChild(loader)\n expense.items.push(new Item(item))\n e.target.hidden = true\n this.renderExpense()\n })\n }", "harvest(index) {\n const plot = this.plotList[index];\n if (plot.berry === BerryType.None || plot.stage() != PlotStage.Berry || plot.isSafeLocked) {\n return;\n }\n App.game.wallet.gainFarmPoints(this.berryData[plot.berry].farmValue);\n const amount = plot.harvestAmount();\n this.gainBerry(plot.berry, amount);\n App.game.oakItems.use(OakItemType.Sprayduck, this.berryData[plot.berry].exp);\n GameHelper.incrementObservable(App.game.statistics.totalManualHarvests, 1);\n player.lowerItemMultipliers(MultiplierDecreaser.Berry, this.berryData[plot.berry].exp);\n plot.die(true);\n }", "function expandAction() \n\t{ \n\t\tthis.expanded = !this.expanded; this.refresh(); \n\t}", "function takeButton(){\n\t\n\tif (player.playerLocation.LItem !== null) {\n\t\taddItemToInventory(player.playerLocation.LItem);\n\t\tplayer.playerLocation.LItem = null;\n\t} \n\t\n\t\tdisplayInventory();\n}", "function inventory() { }", "approveTenant(state, payload) {\n const { item, index } = payload;\n state.newRegisteredTenant.splice(index, 1);\n state.tenant.push(item);\n }", "function refresh_TourNearby( )\n{\n\tvar mark_index = 0;\n\tfor ( var i=0; i<g_recommended_venues.length; i++ )\n\t{\n\t\tvar _venue \t= g_recommended_venues[i];\n\t\tvar _vName \t= _venue['name'];\n\t\tvar _vID \t= _venue['id'];\n\t\tvar loc \t= _venue[\"location\"];\n\t\tvar _addr \t= loc['formattedAddress'].join(\"<br/>\");\n\t\tvar _vUrl\t= \"https://foursquare.com/v/\" + _vName + \"/\" + _vID + \"?ref=\" + CLIENT_ID;\n\t\tif ( typeof(_addr) == \"undefined\" )\n\t\t\t_addr = \"\";\n\n\t\tvar v_html = \"<div>\"\n\t\t\t+ \"<a href='\" + _vUrl + \"'target='_blank'> <strong>\" + _vName + \"</strong></a></br>\"\n\t\t\t+ \"<span style='font-weight:900, background-color:\" + _venue['ratingColor'] + \"'> rating :\" + _venue['rating'] + \"</span></br>\"\n\t\t\t+ _addr + \"</br>\"\n\t\t\t+ \"</div>\";\n\n\t\tvar myIcon = L.ExtraMarkers.icon({\n\t\t icon: 'fa-number',\n\t\t markerColor: 'yellow',\n\t\t shape: 'penta',\n\t\t prefix: 'fa',\n\t\t number: ++mark_index\n\t\t});\n\t\tL.marker([loc.lat, loc.lng],{riseOnHover:true, icon: myIcon})\n\t\t\t.addTo(g_layer_recommendedMarks)\n\t\t\t.bindPopup(v_html);\n\t}\n}", "function onitemUpdate (data) {\n\tonitemremove(data);\n\tland.push(new land_object(data.id, data.owner, data.x, data.y, data.color)); \n}", "function GoToItinerary()\n{\n//alert(Tour_List.length);\n\n $( \"#yet_to_visit_sites\" ).trigger( \"click\" ); \n Editor();\n document.getElementById(\"selected_site_Detail\").innerHTML='';\n document.getElementById(\"MyTripList\").innerHTML=\"\";\n detail_Id = '';\n\n $('#ListDetail').hide();\n $('#nearByPlace').hide();\n $('#itinerary_Ui').show();\n $('#Save_Ui').hide();\n $('#MyTrips').hide();\n $('#TourMapCanvas').hide();\n $('#BuildSearchUi').hide();\n \n}", "function purchasedItem(listItem) {\n listItem.hide();\n purchased.append(listItem);\n listItem.show('slow');\n }", "exploreDetails(id) {\n let showArray = [...this.state.showDescription];\n showArray.indexOf(id) !== -1 ? showArray.splice(showArray.indexOf(id), 1) : showArray.push(id);\n this.setState({\n showDescription: [...showArray]\n })\n }", "function onexpand(index) {\n\t\t$scope.$broadcast('close-expandchoices', {index:index});\n\t}", "function addItemToFirstOpenSlot(itemName) {\n output('new item: ' + itemName);\n for (var i = 0; i < inventory.length; i++) {\n if (!inventory[i] || inventory[i] == '') {\n inventory[i] = itemName;\n updateInventorySlot(i);\n break;\n }\n }\n}", "function openbreakfast(){\r\n document.getElementById(\"defult-item\").style.display=\"none\";;\r\n document.getElementById(\"breakfast-item-1\").style.display=\"block\";\r\n document.getElementById(\"breakfast-item-2\").style.display=\"block\";\r\n document.getElementById(\"breakfast-item-3\").style.display=\"block\";\r\n document.getElementById(\"breakfast-item-4\").style.display=\"block\";\r\n document.getElementById(\"breakfast-item-5\").style.display=\"block\";\r\n document.getElementById(\"breakfast-item-6\").style.display=\"block\";\r\n}", "function addToProdList(item)\n{\n //window.alert(JSON.stringify(item));\n var id = getProdId();\n \n var content = $('<div></div>').html(item.DESCRIP);\n \n var li = $('<li></li>').attr(\"id\", id).attr(\"class\", \"list-group-item\").html(content).click(function(){\n \n localStorage.setItem(\"prdescrip\", \"\");\n localStorage.setItem(\"prcantidad\", \"\");\n\n setPriceSelect(item);\n \n setStatLabel(\"info\", item.DESCRIP);\n $('#prodtb').val(item.ARTICULO);\n currentProd = item;\n\n \n $('#searchProdModal').modal('hide');\n saveState();\n\n $('#prodSearch ul').empty();\n \n })\n \n console.log(id + \";\");\n $('#prodSearch ul').append(li);\n \n}", "expand() {\n const previous = this._lastCurrent || (this._items.length > 0 && this._items[0].widget);\n if (previous) {\n this.activate(previous.id);\n }\n }", "function addExpense(event) {\n console.log(\"addExpense fired!\");\n event.preventDefault();\n let name = nameInput.value;\n let amount = parseInt(amountInput.value);\n let expense = {\n name: name,\n amount: amount\n };\n expenses.push(expense);\n // Add the new expense to the app\n let newExpense = document.createElement(\"p\");\n newExpense.innerText = expense.name + \": $\" + expense.amount;\n expenseList.appendChild(newExpense);\n updateExpenseTotal();\n}", "function updateVegetablesCollection (veggies, veggie) {\n if (veggies.indexOf(veggie) === -1) {\n veggies.push(veggie);\n console.log('New veggies collection is : ' + veggies);\n } else if (veggies.indexOf(veggie) > -1) {\n console.log(veggie + ' already exists in the veggies collection.');\n }\n}", "harvest() {\n if (this.pos.inRangeTo(this.source, 1)) {\n this.liveObj.harvest(this.source);\n } else {\n this.liveObj.travelTo(this.source, {allowSwap: false});\n }\n }", "function venueNavigate() {\n //code\n var eventObject = _.find(venueDetails, function (object) {\n return object.place_id === displayInfo.eventLocationId;\n });\n navigateFlag = 1;\n var gposition = eventObject.geometry.location;\n var position;\n //problem with synchronization with _handeInviteCode\n eventObject.placeId=eventObject.place_id;\n eventObject.placeName=eventObject.name;\n _setupStartingLocation2wPlaceObject(eventObject,gposition);\n updateSearchBox(gposition, '#startInput2');\n //this will calculate route\n if(platform===2){\n position=convert2pluglatLng(gposition);\n startingLocation2.setPosition(position,true,true);\n }else\n startingLocation2.setPosition(gposition,true,true);\n}", "function createExplore(\n srcId,\n percentageRange = 25,\n percentageEnergyCap = 25,\n minLevel = 2\n ) {\n return {\n id: `[EXPLORE]-${srcId}-${percentageRange}-${percentageEnergyCap}-${minLevel}`,\n type: c.EXPLORE,\n payload: {\n srcId,\n percentageRange,\n percentageEnergyCap,\n minLevel,\n },\n };\n }", "addOffspring(vampire) {\n this.offspring.push(vampire);\n vampire.creator = this;\n\n }", "function displayRefugees(refugee) {\n const newBoat = refugee.boatShape();\n mutawasea.appendChild(newBoat);\n refugeesArray.push({ newBoat, refugee });\n let randomDestination = getRndInteger(1, 7);\n refugee.sail(newBoat, randomDestination);\n }", "function pickUpItem(hero, weapon) {\n\n // Adds the weapon-like object as the last element of the inventory array of the hero-like object\n // let heroInventory = hero.inventory;\n hero.inventory.push(weapon);\n console.log(hero); // Just for debugging\n}", "function showPokemon (pokemon, pokeList) {\n if (pokeList === undefined) {\n pokeList = document.getElementById(`trainer-${pokemon.trainer_id}`)\n }\n let pokeName = document.createElement('li')\n let relBtn = document.createElement('button')\n\n pokeName.innerText = `${pokemon.nickname} (${pokemon.species})`\n pokeName.id = `trainer-${pokemon.trainer_id}-pokemon-${pokemon.id}`\n relBtn.className = 'release'\n relBtn.innerText = 'Release'\n\n pokeList.appendChild(pokeName)\n pokeName.appendChild(relBtn)\n\n relBtn.addEventListener('click', () => {\n releasePokemon(pokemon)\n })\n}", "function C012_AfterClass_Jennifer_InsertEgg() {\n\tPlayerLockInventory(\"VibratingEgg\");\n\tPlayerRemoveInventory(\"VibratingEgg\", 1);\n\tCurrentTime = CurrentTime + 50000;\n}", "function enterSurface() {\n\tselectListItem(document.isoGroup.createIso, '');\n}", "function addtoOpenList (target) {\n openCardsArray.push(target);\n}", "function handleExpand() {\r\n $('main').on('click', '.js-bookmark', event => {\r\n let id = getItemIdFromElement(event.currentTarget);\r\n let bookmark = store.findById(id);\r\n store.toggleExpand(bookmark);\r\n render()\r\n\r\n })\r\n}", "function enemyBuyV () {\n var newCard = $(\"<li>\").addClass(\"evCard\");\n var name = $(\"<p>\").addClass(\"name\").text(currentPosition.name).css(\"background-color\", currentPosition.color).css(\"color\",\"white\");\n var l1 = $(\"<p>\").text(\"Price: $\" + currentPosition.price);\n var l2 = $(\"<p>\").text(\"Own 1: $\" + currentPosition.own1);\n var l3 = $(\"<p>\").text(\"Own 2: $\" + currentPosition.own2);\n var l4 = $(\"<p>\").text(\"Own 3: $\" + currentPosition.own3);\n var l5 = $(\"<p>\").text(\"Own 4: $\" + currentPosition.own4);\n var l6 = $(\"<p>\").text(\"Mortgage Value: $\" + currentPosition.mortgage);\n newCard.append(name).append(l1).append(l2).append(l3).append(l4).append(l5).append(l6);\n newCard.insertBefore(\".hideEnemyProperties\")\n $(\"#promptp\").remove();\n enemyCash -= currentPosition.price;\n updateCash();\n enemyUpdate(\"Enemy just purchased some \"+ currentPosition.name)\n currentPosition.owned=\"enemy\";\n currentPosition.inPlay=\"yes\";\n checkVansOwned();\n function getVans (obj){\n if(obj.type == \"vCard\" && obj.owned == \"enemy\"){\n return true\n }\n }\n var toUpdate = propertyCards.filter(getVans);\n for(var i =0; i<toUpdate.length; i++){\n if(vansOwnedEnemy == 1){\n toUpdate[i].rentStatus = \"own1\";\n }else if(vansOwnedEnemy == 2){\n toUpdate[i].rentStatus = \"own2\";\n }else if(vansOwnedEnemy == 3){\n toUpdate[i].rentStatus = \"own3\";\n }else if(vansOwnedEnemy ==4){\n toUpdate[i].rentStatus = \"own4\";\n }\n }\n}", "function addToFavorites() {\n let favorite = buildCityItem(event.currentTarget);\n\n let favorites = readFromLS(\"favorites\");\n if (favorites == null) {\n favorites = [];\n }\n favorites.push(favorite);\n saveToLS(\"favorites\", favorites);\n loadFavorites();\n loadCityWeather();\n}" ]
[ "0.60256994", "0.57891405", "0.55040437", "0.53381175", "0.5305966", "0.5304756", "0.52917457", "0.52594346", "0.5215929", "0.5199276", "0.5189215", "0.51701415", "0.51659375", "0.51357186", "0.50884235", "0.5088083", "0.50785536", "0.5066447", "0.5047672", "0.50451094", "0.50306255", "0.5022359", "0.5001849", "0.49996045", "0.4992964", "0.49835438", "0.49669474", "0.49616936", "0.49586716", "0.49467078", "0.49261704", "0.49256092", "0.4917076", "0.4916062", "0.49052814", "0.48940092", "0.4892043", "0.48883316", "0.48662126", "0.48604754", "0.48559785", "0.48545745", "0.48536062", "0.4846352", "0.483399", "0.4810037", "0.48042202", "0.4802442", "0.47981727", "0.47980803", "0.47903526", "0.4785551", "0.47825873", "0.47807515", "0.47773442", "0.47691286", "0.4765919", "0.4763924", "0.47585228", "0.4753607", "0.4753309", "0.47521424", "0.47507465", "0.4748423", "0.4747483", "0.47451198", "0.47419733", "0.4740167", "0.47388464", "0.47371483", "0.47347328", "0.473392", "0.47327825", "0.4731741", "0.47294858", "0.47289467", "0.47248027", "0.47246706", "0.4723725", "0.47186992", "0.47134194", "0.47110185", "0.47100484", "0.47099495", "0.47048977", "0.46978772", "0.4694835", "0.46943274", "0.46921742", "0.46907234", "0.4688165", "0.46832114", "0.46730834", "0.46720058", "0.46700636", "0.46672726", "0.4667006", "0.46661505", "0.46656048", "0.46641937" ]
0.7017585
0
Collapses a venue on the list
function pag_collapseVenueList(namespace, venueId){ pag_xmlRpcClient.call("collapseVenue",venueId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function collapseListInTable( current ) {\n\t\t\tif ( current.closest( 'div' ).hasClass( 'selectlist' ) ) {\n\t\t\t\tif ( current.closest( 'div' ).find( 'button' ).attr( 'aria-expanded' ) === 'true' ) {\n\t\t\t\t\tcurrent.closest( 'div' ).find( 'button' ).trigger( 'click' );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "onSelectValues(venueId) {\n this.props.updateVenueConstraintsData(venueId, null, 'venues', 'venueListSection');\n this.props.clearFilter();\n this.setState({ addOrRemoveVenues: true });\n }", "function displayButton() {\n const sel1 = W.selectionManager.getSelectedFeatures();\n\n if (sel1.length > 0) {\n if(sel1[0].model.type == 'venue') {\n $('#MyclosedVenueContainer').css('display', 'block');\n } else {\n $('#MyclosedVenueContainer').css('display', 'none');\n }\n }else {\n $('#MyclosedVenueContainer').css('display', 'none');\n }\n }", "function pag_expandVenueList(namespace, venueId){\n pag_xmlRpcClient.call(\"expandVenue\",venueId);\n}", "function changeCollapseBlock(event) {\n\tvar block = document.getElementById(\"colllapseBlock\");\n\tif (block.classList.contains(\"opened\")) {\n\t\tblock.classList.remove(\"opened\");\n\t} else {\n\t\tblock.classList.add(\"opened\");\n\t}\n}", "function CollapseList(){\n let x = document.getElementById(\"CollapseList\");\n if (x.innerHTML === \"Show Parking Areas\"){\n $(\"#carparkList\").show();\n x.innerHTML = \"Hide Parking Areas\";\n } \n else {\n $(\"#carparkList\").hide();\n x.innerHTML = \"Show Parking Areas\";\n }\n}", "function collapseList() {\n\n // ******* TODO: PART IV *******\n // i handled this using the splice method below\n\n\n}", "collapseButtonClickCallback() {\n let activeSpans = document.getElementsByClassName('folder-down');\n while(activeSpans.length > 0) {\n activeSpans[0].classList.remove('folder-down');\n }\n let openNests = document.getElementsByClassName('nested active');\n while(openNests.length > 0) {\n openNests[0].classList.remove('active');\n }\n while(this.selectionList.length > 0) {\n document.getElementById(this.selectionList.pop()).classList.remove('selected');\n }\n }", "function openClosePunchList() {\n $containerCardLists.classList.toggle('container-card-lists-closed');\n}", "function harmonizePlace() {\n if (W.selectionManager.selectedItems.length === 1) {\n var item = W.selectionManager.selectedItems[0].model;\n if (item.type === \"venue\") {harmonizePlaceGo();}\n }\n }", "function collapse(evt) {\n\t\tcollapser = evt.target;\n\t\t\n\t\tvar target = collapser.parentNode.getElementsByClassName('collapsible');\n\t\t\n\t\tif (!target.length) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\ttarget = target[0];\n\t\t\n\t\tif (target.style.display == 'none') {\n\t\t\tellipsis = target.parentNode.getElementsByClassName('ellipsis')[0];\n\t\t\ttarget.parentNode.removeChild(ellipsis);\n\t\t\ttarget.style.display = '';\n\t\t} else {\n\t\t\ttarget.style.display = 'none';\n\t\t\tellipsis = document.createElement('span');\n\t\t\tellipsis.className = 'ellipsis';\n\t\t\tellipsis.innerHTML = ' &hellip; ';\n\t\t\ttarget.parentNode.insertBefore(ellipsis, target);\n\t\t}\n\t\t\n\t\tcollapser.innerHTML = (collapser.innerHTML == '-') ? '+' : '-';\n\t}", "function toggleTournamentsList() {\n $mdSidenav('left').toggle();\n }", "function selectOpenList(e) {\n var target;\n if (e.target) {\n target = e.target;\n } else {\n target = e;\n }\n var expandedState = target.getAttribute('aria-expanded');\n if (expandedState === 'true') {\n expandedState = 'false';\n } else {\n expandedState = 'true';\n }\n target.setAttribute('aria-expanded', expandedState);\n\n // second toggle here is a compromise to allow animation on opening\n // while still providing good tab focus behavior\n setTimeout(function(){\n target.classList.toggle('is-open');\n },50);\n }", "expandListItem(index){\n var buttons = document.getElementsByClassName(\"collapsible\");\n var coll = document.getElementsByClassName(\"content\");\n if (coll[index].style.display === \"block\") {\n coll[index].style.display = \"none\";\n buttons[index].innerHTML = \"&#8744\";\n } else {\n coll[index].style.display = \"block\";\n buttons[index].innerHTML = \"&#8743\";\n }\n }", "clickVenueList(target) {\n const preTarget = document.querySelector('.clicked')\n if (preTarget) {\n preTarget.classList.remove('clicked')\n }\n if (target !== preTarget) {\n target.className='clicked'\n this.setState({ clickedVenue: target.innerHTML } )\n }\n }", "function closeFullViewSelectedRoom() {\n for (var i in vm.roomsCtrl) {\n vm.roomsCtrl[i].setFullView(false);\n vm.roomsCtrl[i].setHide(false);\n }\n\n vm.overview = true;\n }", "handleVenueClick(index) {\n const { gblMarkers } = this.state;\n window.google.maps.event.trigger(gblMarkers[index], 'click');\n /* \n if maker index does not !== equal null, set to null \n else sets marker to ` BOUNCE `\n */\n if (gblMarkers[index].getAnimation() !== null) {\n gblMarkers[index].setAnimation(null, );\n } else {\n gblMarkers[index].setAnimation(window.google.maps.Animation.BOUNCE);\n gblMarkers[index].setAnimation(6);\n } \n }", "collapseItem(item){if(this._isExpanded(item)){this.splice(\"expandedItems\",this._getItemIndexInArray(item,this.expandedItems),1)}}", "function collapse( event ) {\n \n // access the playlist that triggered the \"click\" event\n var target = jQuery( event.currentTarget );\n \n var content;\n var content_box;\n\n // check if playlist is already collapsed\n if ( target.hasClass( 'collapsible-title' ) ) { // playlist is collapsed\n \n // toggle class on target playlist\n target.removeClass( 'collapsible-title' );\n target.addClass( 'collapsed-title' );\n \n // change playlist icon from plus to minus indicating it's collapsed\n content = target.text() + \n '<span class=\"icon\">' +\n '<i class=\"fas fa-minus-circle\"></i>' +\n '</span>';\n target.html( content );\n \n // get the target playlist content\n content_box = target.parent().parent().children( '.collapse-content' );\n \n // show content\n content_box.css( 'display', 'initial' );\n\n } \n\n else { // playlist is not collapsed\n \n // toggle class on target playlist\n target.removeClass( 'collapsed-title' );\n target.addClass( 'collapsible-title' );\n \n // change playlist icon from minus to plus indicating it's folded\n content = target.text() + \n '<span class=\"icon\">' +\n '<i class=\"fas fa-plus-circle\"></i>' +\n '</span>';\n target.html( content );\n \n // get the target playist content\n content_box = target.parent().parent().children( '.collapse-content' );\n \n // hide content\n content_box.css( 'display', 'none' );\n \n }\n\n}", "_handleListboxClick(e) {\n this._toggleListbox(!this.expanded);\n }", "open() {\n this.expanded = true;\n }", "toggleShowList() {\n const locationsList = document.querySelector('.locations');\n\n if(!locationsList.classList.contains('open')) {\n locationsList.classList.add('open');\n }\n else {\n locationsList.classList.remove('open');\n }\n }", "function toggle(event) {\n var cities = getCities();\n\n currentIndex = (currentIndex + 1) % cities.length;\n setClock(cities[currentIndex]);\n\tevent.stopPropagation();\n }", "function collaps_about_us(item) {\n a = 200;\n name = \"#\" + $(item).attr('id') + \"_about\";\n row = document.getElementById($(item).attr('id') + \"_row\");\n if ($(name).hasClass(\"active_about_us\"))\n {\n $(name).hide(a).removeClass(\"active_about_us\");\n $(\".other_about\").delay(a).show(a);\n $(item).removeClass(\"Image_abt_active\");\n } else\n {\n $(\".other_about\").not(row).hide(a);\n $(name).delay(a).toggle(a).addClass(\"active_about_us\");\n $(item).addClass(\"Image_abt_active\");\n }\n}", "function expandList() {\n var hidden_lis = $$('li.hidden');\n hidden_lis.each(function(li) {\n li.removeClassName('hidden');\n li.addClassName('not-hidden');\n });\n $j('#expandable-link').text(\"\\< Hide full list\");\n $j('#expandable-link').unbind('click');\n $j('#expandable-link').click(function(){\n contractList();\n return false;\n });\n}", "function navCollapser()\n{\n $('.navbar').on('show', function () {\n var actives = $(this).find('.collapse.in')\n , hasData\n if (actives && actives.length) {\n hasData = actives.data('collapse')\n if (hasData && hasData.transitioning) return\n actives.collapse('hide')\n hasData || actives.data('collapse', null)\n }\n })\n}", "collapseFilters () {\n this._toggleCollapsibleFilters(true);\n }", "function onClickName(evt, row, grid) {\n grid.toggleCollapse(row);\n }", "leave(){\r\n if ( this.isOpened && !this.getRef('list').isOver ){\r\n this.isOpened = false;\r\n }\r\n }", "collapse() {\n const that = this;\n\n if (!that.collapsible || that.collapsed) {\n return;\n }\n\n that.collapsed = true;\n }", "function openCaseList() {\n displayElement('leftPanel');\n}", "handleCloseMovieView(){\n document.getElementById('sort').style.display = \"inline-block\";\n document.getElementById('castcrewcontainer').style.display = \"none\";\n this.setListAllFLAG();\n }", "close() {\n this.expanded = false;\n }", "_toggleCollapsedState() {\n const that = this;\n\n if (!that.collapsible) {\n return;\n }\n\n if (!that.collapsed) {\n that.collapse();\n }\n else {\n that.expand();\n }\n }", "function openListCity(state) {\n document.getElementById(\"transparent\").style.display = state; \n document.getElementById(\"SpopupList\").style.display = state;\n }", "function setupVenueLabel() {\n\n if ($('span[id*=selectedVenue]').text() != \"\") {\n $('span[id*=selectedVenue]').css('display', 'block');\n }\n}", "collapseMenu() {\r\n\t}", "function goToNearByPlace()\n{\n\t\tdocument.getElementById(\"selected_site_Detail\").innerHTML='';\n $('#ListDetail').hide();\n $('#itinerary_Ui').hide();\n $('#nearByPlace').show();\n $('#BuildSearchUi').hide();\n \n}", "static collapseData () {\n $('tbody#bindOutput tr:visible a.json-toggle').not('.collapsed').click();\n }", "collapse () {\n this.root.toggle(true, false);\n }", "function closeList() {\n\n document.getElementById(\"mini-panel\").style.display = \"block\";\n document.getElementById(\"result_panel\").style.display = \"none\";\n\n document.getElementById(\"map\").style.width = \"calc(100vw - 80px)\";\n}", "function openbreakfast(){\r\n document.getElementById(\"defult-item\").style.display=\"none\";;\r\n document.getElementById(\"breakfast-item-1\").style.display=\"block\";\r\n document.getElementById(\"breakfast-item-2\").style.display=\"block\";\r\n document.getElementById(\"breakfast-item-3\").style.display=\"block\";\r\n document.getElementById(\"breakfast-item-4\").style.display=\"block\";\r\n document.getElementById(\"breakfast-item-5\").style.display=\"block\";\r\n document.getElementById(\"breakfast-item-6\").style.display=\"block\";\r\n}", "collapse() {\n this.moving = false;\n this.lastIndex = 0;\n Array.from(this.expander.children).forEach((ctx, i) => {\n if (i >= this.options.show) {\n ctx.classList.add('hidden')\n } else {\n if (i !== 0) {\n this.lastIndex++\n new Animate(ctx, i, this.lastIndex, {delay: this.options.animationDuration}).animate()\n }\n }\n })\n }", "collapse() {\n this._sideBar.currentTitle = null;\n }", "function join_room_pop() {\n join_room.css(\"display\", \"block\");\n }", "function stayCollapsed(e) {\n e.stopPropagation();\n}", "function attachFilterExpColClickEvent(){\n $('.proj-filter-exp-collapse-sign').click(function(){\n if($(this).hasClass('proj-filter-exp-collapse-sign-down')){\n $(this).removeClass('proj-filter-exp-collapse-sign-down').addClass('proj-filter-exp-collapse-sign-up');\n //$(this).text('-');\n $(this).parent().find(\"div[name=countries]\").show();\n $(this).parent().find(\"div[name=regions]\").show();\n $(this).parent().find(\"ul\").show();\n $(this).parent().find(\".mContent\").show();\n }\n else{\n $(this).removeClass('proj-filter-exp-collapse-sign-up').addClass('proj-filter-exp-collapse-sign-down');\n //$(this).text('+');\n $(this).parent().find(\"div[name=countries]\").hide();\n $(this).parent().find(\"div[name=regions]\").hide();\n $(this).parent().find(\"ul\").hide();\n $(this).parent().find(\".mContent\").hide();\n }\n });\n \n $('.proj-filter-exp-collapse-text').click(function(){\n \n $(this).parent().find('.proj-filter-exp-collapse-sign').each(function(){\n if($(this).hasClass('proj-filter-exp-collapse-sign-down')){\n $(this).removeClass('proj-filter-exp-collapse-sign-down').addClass('proj-filter-exp-collapse-sign-up');\n //$(this).text('-');\n $(this).parent().find(\"div[name=countries]\").show();\n $(this).parent().find(\"div[name=regions]\").show();\n $(this).parent().find(\"ul\").show();\n $(this).parent().find(\".mContent\").show();\n }\n else{\n $(this).removeClass('proj-filter-exp-collapse-sign-up').addClass('proj-filter-exp-collapse-sign-down');\n //$(this).text('+');\n $(this).parent().find(\"div[name=countries]\").hide();\n $(this).parent().find(\"div[name=regions]\").hide();\n $(this).parent().find(\"ul\").hide();\n $(this).parent().find(\".mContent\").hide();\n }\n });\n });\n //$('#status-filter').children('.proj-filter-exp-collapse-text').click();\n }", "toggle() {\n this.collapsed = !this.collapsed\n }", "toggle() {\n this.collapsed = !this.collapsed\n }", "openStageFilter(){\n var selected = this.template.querySelector(\".selected-stage\");\n var optionsContainer = this.template.querySelector(\".options-container-stage \");\n var optionsList =this.template.querySelectorAll(\".option-stage\");\n selected.addEventListener(\"click\", () => {\n optionsContainer.classList.toggle(\"active\");\n }); \n /* optionsList.forEach(o => {\n o.addEventListener(\"click\", () => {\n selected.innerHTML = o.querySelector(\"label\").innerHTML;\n optionsContainer.classList.remove(\"active\");\n });\n }); */\n\n }", "function pag_changeVenueSelection(mode) {\n pag_xmlRpcClient.call(\"changeVenueSelection\", mode);\n}", "function handleToggleCollapsibles(e) {\n\t\t\tif (e.currentTarget.hasClassName('collapsed')) {\n\t\t\t\te.currentTarget.removeClassName('collapsed');\n\t\t\t\t$(e.currentTarget).parent().get(0).querySelector('.collapsibleBody').show();\n\t\t\t\t//applies for route instructions container only\n\t\t\t\tvar routeInstructions = $(e.currentTarget).parent().get(0).querySelector('#zoomToRouteButton');\n\t\t\t\tif (routeInstructions) {\n\t\t\t\t\trouteInstructions.show();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\te.currentTarget.addClassName('collapsed');\n\t\t\t\t$(e.currentTarget).parent().get(0).querySelector('.collapsibleBody').hide();\n\t\t\t\t//applies for route instructions container only\n\t\t\t\tvar routeInstructions = $(e.currentTarget).parent().get(0).querySelector('#zoomToRouteButton');\n\t\t\t\tif (routeInstructions) {\n\t\t\t\t\trouteInstructions.hide();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function collapseAll() {\n repeatedlyClickArrows('down');\n }", "openMenu() {\n this._itemContainer.visible = true;\n this.accessible.expanded = true;\n this._label.accessible.expanded = true;\n }", "closeMenu() {\n this._itemContainer.visible = false;\n this.accessible.expanded = false;\n this._label.accessible.expanded = false;\n }", "_showList() {\n this.curList\n ? listViewExpanded.classList.remove(\"hidden\")\n : this._hideList();\n // console.log(this.curList);\n }", "openOnwerFilter(){\n\n var selected = this.template.querySelector(\".selected-owner\");\n var optionsContainer = this.template.querySelector(\".options-container-owner\");\n var optionsList =this.template.querySelectorAll(\".option-owner\");\n selected.addEventListener(\"click\", () => {\n optionsContainer.classList.toggle(\"active\");\n }); \n //selected.addEventListener(\"click\", () => {\n //});\n\n /* optionsList.forEach(o => {\n o.addEventListener(\"click\", () => {\n selected.innerHTML = o.querySelector(\"label\").innerHTML;\n optionsContainer.classList.remove(\"active\");\n });\n });\n */\n }", "expandFilters() {\n this._toggleCollapsibleFilters(false);\n }", "function func_join_room_pop() {\n join_room.css(\"display\", \"block\");\n}", "function toggle_button_click(e) {\n var $button = $(e.currentTarget);\n var $menu = $button.parent().parent().children('ul');\n var was_closed = $button.hasClass('menu-closed');\n\n if (was_closed) {\n expand($menu, $button);\n }\n else {\n collapse($menu, $button);\n }\n }", "function setupViewList() {\n var vListBox = createDialog(\".region_list\", {width: 500});\n\n /* --- View Description click --- */\n $(\"span.vList\").click(function(){\n var txt = $(this).attr(\"data-list\");\n var buildText = function(data, separator)\n {\n var text;\n var list = data.split( separator );\n\n for ( var item in list )\n text = (text ? text + \"<br>\" : \"\") + list[item];\n\n return text;\n }\n\n var list = buildText(txt, \"|\");\n\t$(\"div.region_list\").show();\n vListBox.dialog(\"open\");\n vListBox.find(\"div.region_content\").html( list );\n });\n}", "closeDetail(){\n this.selItem = null;\n this.props.itemSel(this.selItem);\n\n this.setState({\n isShowDetail : false,\n detailItem : {}\n });\n this.forceUpdate();\n }", "function InventoryItemMouth2CupholderGagClick() {\n\tInventoryItemMouthCupholderGagClick();\n}", "function collapseItem(item) {\n\t \n\t // If we are loading once then lets save view when we collapse it incase it's changed\n\t if (_options.loadOnce)\n item._detailContent = $(\"#innerDeatilView_\" + item.id).html();\n\t\t\n item._collapsed = true;\n for (var idx = 1; idx <= item._sizePadding; idx++) {\n _dataView.deleteItem(item.id + \".\" + idx);\n }\n item._sizePadding = 0;\n _dataView.updateItem(item.id, item);\n\n // Remove the item from the expandedRows\n _expandedRows = _expandedRows.filter(function (r) {\n return r.id !== item.id;\n });\n }", "click(e) {\n $(ReactDOM.findDOMNode(e.currentTarget)).siblings('.collapsible-body').toggle();\n }", "function handleButCollapseClick(basectlsref) {\n\tsetSi(srcdoc, \"StatAppIdecNavOpr\", basectlsref + \"Alt\", \"true\");\n\trefresh();\n}", "function toggleOpenOneOnly(e) {\n if (this.open) {\n All_Details.forEach(deet=>{\n if (deet!=this && deet.open) deet.open = false\n });\n }\n}", "function toggleCityList() {\n var cityList = document.querySelector(\"#city-list\");\n cityList.classList.toggle(\"hidden\");\n}", "function listOfWorldCupTeams() { \n $('.list-button').click(function(){\n emptyApp();\n getTeamListApi(listTeams);\n $('.main-list').removeClass('hidden');\n $('main').removeClass('hidden');\n $('.scroll-to-top-2').removeClass('hidden');\n document.querySelector('.scroll-to-top-2').scrollIntoView({ behavior: 'smooth' });\n })\n}", "function collaps_our_service(item) {\n a = 200;\n name = \"#\" + $(item).attr('id') + \"_service\";\n row = document.getElementById($(item).attr('id') + \"_row\");\n if ($(name).hasClass(\"active_our_service\"))\n {\n $(item).removeClass(\"Image_abt_active\")\n $(name).hide(a).removeClass(\"active_our_service\");\n $(\".other_service\").delay(a + 10).show(a);\n } else\n {\n $(item).addClass(\"Image_abt_active\");\n $(\".other_service\").not(row).hide(a);\n $(name).delay(a).toggle(a).addClass(\"active_our_service\");\n }\n}", "toggleDetails() {\n this.props.toggleExpanded(\n this.props.resultIdx,\n !this.props.expanded[this.props.resultIdx]\n )\n }", "function mc_sideListDetailToggle(element, expand) {\n var toggleIcon = element.getElementsByClassName(\"mc_sideListDetailToggleIcon\")[0];\n var liChildren = element.parentNode.children;\n var details = liChildren[1]; //div\n\n if (expand == undefined) {\n //toggle\n if (toggleIcon.innerHTML == \"+\") {\n var iconText = document.createTextNode(\"-\");\n expand = true;\n } else {\n var iconText = document.createTextNode(\"+\");\n expand = false;\n }\n } else {\n //ensure we want to call the toggle\n if (toggleIcon.innerHTML == \"+\") {\n var iconText = document.createTextNode(\"-\");\n if (!expand) {\n //already closed\n return;\n }\n } else {\n var iconText = document.createTextNode(\"+\");\n if (expand) {\n //already expanded\n return;\n }\n }\n }\n\n toggleIcon.removeChild(toggleIcon.firstChild);\n toggleIcon.appendChild(iconText);\n $(details).slideToggle(150);\n}", "toggleSelectList() {\n this.selectList.show();\n }", "function collapse(evt) {\n var collapser = evt.target;\n\n while (collapser && (!collapser.classList || !collapser.classList.contains('collapser'))) {\n collapser = collapser.nextSibling;\n }\n if (!collapser || !collapser.classList || !collapser.classList.contains('collapser')) {\n return;\n }\n\n evt.stopPropagation();\n\n collapser.classList.toggle('collapsed');\n\n var collapsible = collapser;\n while (collapsible && (!collapsible.classList || !collapsible.classList.contains('collapsible'))) {\n collapsible = collapsible.nextSibling;\n }\n collapsible.classList.toggle('collapsed');\n }", "closeItemDetails(item){if(this._isDetailsOpened(item)){this.splice(\"detailsOpenedItems\",this._getItemIndexInArray(item,this.detailsOpenedItems),1)}}", "onClick_() {\n this.fire('toggle-expanded');\n }", "toggleOverlay(index, y, detailsHeight, entry, rowItems) {\n if (this.openOverlays.some((o) => o.index === index)) {\n this.closeOverlay(index, detailsHeight, rowItems);\n }\n else {\n this.openOverlay(index, y, detailsHeight, entry, rowItems);\n }\n }", "handleToggleMenu(listId) {}", "function expand(id) {\n let select = document.getElementById(id);\n if (!select.getAttribute(\"style\", \"display\") || \n select.getAttribute(\"style\", \"display\") == \"display:none\"){\n select.setAttribute(\"style\", \"display:flex; justify-content: center;\");\n } else {\n if (event.target.tagName.toLowerCase() !== 'a') {\n select.setAttribute(\"style\", \"display:none\");\n }\n \n }\n}", "function toggleDetails() {\n ToggleComponent('shipment.detailView').toggle();\n }", "function closeList() {\n\tif (iPopupOpen) {\n\t\tofVBAISpan.style.display=\"none\";\n\t\tiPopupOpen=false;\n\t\t}\n\t}", "toggleMenu(collapse) {\n collapse.classList.toggle('collapse');\n collapse.classList.toggle('in');\n }", "function collapseForm(e) {\n var searchForm = e.target.closest('section');\n // get the icon element\n var collapseIcon = e.currentTarget.children[0].children[0];\n\n if (searchForm.dataset.visible === 'visible') {\n collapseIcon.classList.add('fa-angle-down')\n collapseIcon.classList.remove('fa-angle-up')\n searchForm.dataset.visible = 'hidden';\n searchForm.children[1].setAttribute('style', 'display:none');\n searchForm.children[2].setAttribute('style', 'display:none');\n } else {\n collapseIcon.classList.add('fa-angle-up')\n collapseIcon.classList.remove('fa-angle-down')\n searchForm.dataset.visible = 'visible';\n searchForm.children[1].setAttribute('style', '');\n searchForm.children[2].setAttribute('style', '');\n }\n}", "function triggerCollapseBanner() {\n\t\t\t$bannersInPage.each( function() {\n\t\t\t\tvar $banner = $( this );\n\t\t\t\tvar compensation = 30;\n\t\t\t\tvar bannerToggle = $banner.find( \".n-banner-toggle\" );\n\t\t\t\t//blue part offset on the top banner\n\t\t\t\tvar offsetUpBlue = $banner.find( '.n-banner-1st-blue-to-gray' ).position().left + $banner.find( '.n-banner-1st-blue-to-gray .blue-corner' ).width() - compensation;\n\t\t\t\t//grey part width in the bottom\n\t\t\t\tvar $navTabDown = $banner.find( '.n-banner-2nd .n-banner-tabs' );\n\t\t\t\t//grey part off set in the bottom banner\n\t\t\t\tvar offsetDownGray = $navTabDown.width();\n\t\t\t\tvar breakPointState = $banner.attr( \"data-visual-break\" );\n\t\t\t\tif ( breakPointState === undefined ) {\n\t\t\t\t\tif ( offsetUpBlue < offsetDownGray ) {\n\t\t\t\t\t\t$banner.trigger( bannerBlueDetachEvent );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$banner.trigger( bannerBlueAttachEvent );\n\t\t\t\t\t}\n\t\t\t\t} else if ( breakPointState === \"true\" && offsetUpBlue > offsetDownGray && typeof bannerToggle !== \"undefined\" && $( bannerToggle ).css( \"display\" ) === \"none\" ) {\n\t\t\t\t\t$banner.trigger( bannerBlueAttachEvent );\n\t\t\t\t} else if ( breakPointState === \"false\" && offsetUpBlue < offsetDownGray ) {\n\t\t\t\t\t$banner.trigger( bannerBlueDetachEvent );\n\t\t\t\t}\n\t\t\t} );\n\t\t}", "toggle() {\r\n if (this.props.isMobile) {\r\n this.props.updateCurrentTopPointSalePointId(this);\r\n this.setState({ collapse: !this.state.collapse });\r\n }\r\n }", "function collapseContent(menuoption) {\nvar obj = document.getElementById (menuoption)\nobj.style.display = 'none';\n}", "function displayToggle(event) {\n console.log(event);\n if (event.target.name === 'hide') {\n currentInventory.beers[event.target.id].toggleDisplay();\n currentInventory.saveToLocalStorage();\n // console.log(currentInventory);\n }\n}", "showContacts() {\n this._qs(\".show-contacts\").addEventListener(\"click\", () => {\n if (this._qs(\".contacts\").style.display == \"none\") {\n this._qs(\".contacts\").style.display = \"flex\";\n this._qs(\".show-contacts\").classList.add(\"collapse\");\n } else {\n this._qs(\".contacts\").style.display = \"none\";\n this._qs(\".show-contacts\").classList.remove(\"collapse\");\n }\n });\n }", "function toggle_sidebar_sublist()\n{\n $(\".navbar_right_sidebar .sidebar_main_item.expandable\").click(function(){\n var child_container=$(this).find(\".subele_container\");\n if (child_container.hasClass(\"hidden\"))\n child_container.removeClass(\"hidden\");\n else\n child_container.addClass(\"hidden\");\n });\n\n}", "function closePopUp () {\n if ( event.target == bell.querySelector('.icon')) {\n list.style.display = 'none'\n }}", "function collapse_all(){\n\tvar cur_open = open_ids\n\tfor (var i=0; i<len(cur_open); i++){\n\t\texpand(cur_open[i])\n\t}\n}", "function catFunctionVeggie() {\n document.getElementById(\"veggiesDropdown\").classList.toggle(\"show\");\n }", "function onClick(event) {\n // Prevent the commit component from being collapsed:\n event.stopPropagation();\n }", "function closeVlb() {\n\t\t\tdocument.getElementById(\"Vlb\").style.width = \"0\";\n\t\t}", "toggleList() {}", "toggle() {\n this.expanded = !this.expanded;\n }", "static expandData () {\n $('tbody#bindOutput tr:visible a.json-toggle.collapsed').click();\n }", "function gotoVenue(event) {\n event.stopPropagation();\n let button = $(\"[role='button']\").has(event.target);\n if (button.length) {\n window.location.href = \"./event-list.html?vid=\" + button.attr(\"data-value\");\n }\n}", "collapse() {\n return __awaiter(this, void 0, void 0, function* () {\n this.outerElement.classList.add('collapsed');\n return utils_1.sleep(200);\n });\n }", "function func_close_join_room_pop() {\n join_room.css(\"display\", \"none\");\n}" ]
[ "0.61195076", "0.5816635", "0.5762781", "0.5762025", "0.5760627", "0.57226455", "0.56708497", "0.5624067", "0.56172806", "0.5594775", "0.5588918", "0.5534294", "0.5525181", "0.5523257", "0.5514511", "0.5494143", "0.5485672", "0.5470954", "0.5461294", "0.5439176", "0.54179555", "0.54126155", "0.5402853", "0.5402445", "0.53978074", "0.5386196", "0.538052", "0.53774345", "0.5368452", "0.53673357", "0.5360364", "0.53603154", "0.53398126", "0.5326457", "0.5303296", "0.5296974", "0.52960813", "0.52913404", "0.5285467", "0.52836573", "0.52776843", "0.52521515", "0.5212269", "0.5208877", "0.52054113", "0.52033484", "0.51979136", "0.51906", "0.51906", "0.5187214", "0.51852787", "0.51699305", "0.51607424", "0.5154972", "0.51467603", "0.5142045", "0.5141188", "0.5140937", "0.51401454", "0.5138048", "0.51332", "0.51290554", "0.5121352", "0.511096", "0.5108501", "0.51068693", "0.51056767", "0.51025623", "0.5089089", "0.5086487", "0.5081483", "0.507756", "0.5076636", "0.5066399", "0.5056312", "0.5046898", "0.5042701", "0.5034708", "0.5025907", "0.5025129", "0.50194573", "0.5015974", "0.5014259", "0.50092536", "0.49988523", "0.49980304", "0.49976957", "0.49932235", "0.49900746", "0.49847445", "0.49832436", "0.49799666", "0.49799338", "0.49797684", "0.49775246", "0.49763995", "0.4971078", "0.49663994", "0.49634433", "0.49609452" ]
0.7172639
0
Toggles the sending of video
function pag_toggleVideo(button) { if (button.title == "Disable video") { button.title = "Enable video"; document.getElementById(button.id + "_image").src = pag_context + "/images/cameraDisabled.png"; document.pag_venueClientController.enableVideo(0); } else { button.title = "Disable video"; document.getElementById(button.id + "_image").src = pag_context + "/images/camera.png"; document.pag_venueClientController.enableVideo(1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggle(message){\n\tif (isSnapVisible){\n\t\tisSnapVisible = false;\n\t\tvideo_out.style.display = 'block';\n\t\tsnap_out.style.display = 'none';\n\t\tpause();\n\t\tend_send_loop();\n\t\tif(!message){\n\t\t\tsend_toggle_message();\n\t\t}\n\t\t//window.phone.mystream.getVideoTracks()[0].enabled = true;\n\t\t//console.log(window.phone.mystream.getVideoTracks()[0].enabled);\n\t}else{\n\t\tisSnapVisible = true;\n\t\tvideo_out.style.display = 'none';\n\t\tsnap_out.style.display = 'block';\n\t\tpause();\n\t\tsend_img_loop();\n\t\tif(!message){\n\t\t\tsend_toggle_message();\n\t\t}\n\t\t//window.phone.mystream.getVideoTracks()[0].enabled = false;\n\t\t//console.log(window.phone.mystream.getVideoTracks()[0].enabled);\n\t}\n}", "function toggleVideo(b) {\n if (b == \"true\") {\n localStream.getVideoTracks()[0].enabled = true\n } else {\n localStream.getVideoTracks()[0].enabled = false\n }\n}", "function toggleVideo() {\n myStreamRef.current.getVideoTracks()[0].enabled = !videoState\n setVideoState(prev => { return !prev })\n }", "toggle () {\n if (this.video.paused) {\n this.play();\n }\n else {\n this.pause();\n }\n }", "function pauseToggle(){\n\n\t\t//test if the video is currently playign or paused\n\t\t// posted propter - boolen\n\n\t\tif(vid.paused){\n\n\t\t\t//if paused then play the video\n\t\t\tvid.play();\n\n\t\t}else{\n\n\t\t\t//video is the\n\t\t}\n}", "function toggleVideoStatus() {\n if (video.paused) {\n video.play();\n } else {\n video.pause();\n }\n}", "function toggleVideoState() {\n if (video.paused) {\n video.play();\n } else {\n video.pause();\n }\n\n }", "enableVideo() {\n this.joined = true;\n this.loadSimpleWebRTC();\n }", "function onVideoChat(){\n setVideochat(true);\n setPeoples(false);\n }", "function sendPlaying() {\n socket.broadcast.emit('videoPlay', true);\n }", "function toggleVideoStatus(){\n if(video.paused){\n video.play();\n }else {\n video.pause();\n }\n}", "toggleVideo() {\n var self = this;\n\n if (self.get('isPlaying')) {\n self.get('Player').pauseVideo();\n self.set('isPlaying', false);\n\n self.get('$progressBar').stop();\n Ember.run.cancel(self.vidClock);\n } else {\n self.get('Player').playVideo();\n self.set('isPlaying', true);\n }\n }", "function sendPause() {\n socket.broadcast.emit('videoPause', true);\n }", "function setMyVideoOff(config) {\n let peer_name = config.peer_name;\n if (myVideoStatus === false) return;\n myMediaStream.getVideoTracks()[0].enabled = false;\n myVideoStatus = myMediaStream.getVideoTracks()[0].enabled;\n videoBtn.className = \"fas fa-video-slash\";\n setMyVideoStatus(myVideoStatus);\n notify(peer_name + \" has disabled your video\");\n}", "function toggleVideoPlayback(e){\n\tif (e.source.playing) {\n\t\te.source.pause();\n\t} else {\n\t\te.source.play();\n\t}\n}", "function setVideo(e, value) {\n myMediaStream.getVideoTracks()[0].enabled = !myMediaStream.getVideoTracks()[0].enabled;\n myVideoStatus = myMediaStream.getVideoTracks()[0].enabled;\n e.target.className = \"fas fa-video\" + (myVideoStatus ? \"\" : \"-slash\");\n if (value) {\n videoBtn.className = \"fas fa-video\" + (myVideoStatus ? \"\" : \"-slash\");\n tippy(startVideoBtn, { content: myVideoStatus ? \"Off\" : \"On\", placement: \"top\", });\n }\n setMyVideoStatus(myVideoStatus);\n}", "function setMyVideoStatus(status) {\n\n myVideoImg.style.display = status ? \"none\" : \"block\";\n myVideoStatusIcon.className = \"fas fa-video\" + (status ? \"\" : \"-slash\");\n // send my video status to all peers in the room\n sendStatus(\"video\", status);\n tippy(myVideoStatusIcon, { content: status ? \"My video is On\" : \"My video is Off\", });\n tippy(videoBtn, { content: status ? \"Off\" : \"On\", placement: \"right-start\", });\n}", "function send_toggle_message(toggle){\n\tphone.send({ toggleBandwidth : toggle });\n}", "function toggle() {\n var trailer = document.querySelector('#onetra');\n var video = document.querySelector('video');\n onetra.classList.toggle('active')\n video.currentTime = 0;\n video.pause();\n}", "function enableVideo() {\n\tdocument.getElementById(\"url\").style.display = \"block\";\n\tdocument.getElementById(\"remotes\").style.visibility = \"visible\";\n\tloadSimpleWebRTC();\n}", "function togglePlay() {\n video.paused ? video.play() : video.pause();\n}", "function stopVideo() {\n //e.preventDefault()\n $play.setAttribute('disabled','disabled')\n video.status='pause'\n const message = video\n soc.emit('sendMessage', message, (error) => {\n $messageFormButton.removeAttribute('disabled')\n if(error) {\n return console.log(error)\n }\n player.playVideo();\n console.log('Video Play')\n })\n // player.stopVideo();\n }", "function toggleVid() {\n if (playing) {\n earring.pause();\n button.html('play');\n } else {\n earring.loop();\n button.html('pause');\n }\n playing = !playing;\n}", "function setPeerVideoStatus(peer_id, status) {\n let peerVideoImg = getId(peer_id + \"_image\");\n let peerVideoStatus = getId(peer_id + \"_videoStatus\");\n peerVideoStatus.className = \"fas fa-video\" + (status ? \"\" : \"-slash\");\n peerVideoImg.style.display = status ? \"none\" : \"block\";\n tippy(peerVideoStatus, { content: status ? \"Participant video is On\" : \"Participant video is Off\", });\n}", "function toggleplay() {\n if (video.paused) {\n video.play();\n } else {\n video.pause();\n }\n}", "function turnOn()\n{\n navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia;\n\n if (navigator.getUserMedia)\n {\n navigator.getUserMedia({video: true}, handleVideo, videoError);\n }\n}", "function toggle_to_high(){\n\tisSnapVisible = false;\n\tvideo_out.style.display = 'block';\n\tsnap_out.style.display = 'none';\n\tpause();\n\tend_send_loop();\n}", "function togglePauseVideo() {\n const videoEl = document.querySelector('video');\n if(videoEl) {\n if (videoEl.paused) videoEl.play();\n else videoEl.pause();\n }\n }", "togglePlayback() {\n if (this.player.isPlaying()) {\n this.player.stop();\n } else {\n this.player.play();\n }\n }", "function ifVideoTogglePlay() {\n if (video.paused || video.ended) {\n video.play();\n videoContainer.classList.add('is-active');\n videoContainer.classList.remove('is-paused');\n } else {\n video.pause();\n videoContainer.classList.remove('is-active');\n videoContainer.classList.add('is-paused');\n }\n }", "function changeVideo(enableVideo)\n{\n var jqObj = $(app.VID_BUTTON),\n jqObj1 = $('#videoPreview'),\n jqOo = $(app.LOCAL_PLUGIN),\n enable,\n w, h;\n if (!jqObj[0] || !jqObj1[0])\n {\n app.log(4, \"changeVideo couldn't find video button\");\n }\n if (!jqOo[0])\n {\n app.log(4, \"changeVideo couldn't find local video spot\");\n }\n if (!Callcast.IsVideoDeviceAvailable())\n {\n app.log(4, \"changeVideo called when video is not available\");\n }\n // if called without arg toggle video (old behavior)\n if (undefined === enableVideo)\n {\n enable = !Callcast.IsVideoEnabled();\n }\n else // use arg\n {\n enable = enableVideo;\n }\n if (enable)\n {\n $('#effectsPanel > div').css({'display': 'block'});\n jqObj.addClass('on') // change button\n .attr('title', 'Turn Video Off ' + app.videoKeyAccel);\n jqObj1.addClass('on') // change button\n .attr('title', 'Turn Video Off ' + app.videoKeyAccel);\n // Check object dimensions.\n w = jqOo.width() - 4;\n h = Callcast.HEIGHT * (w / Callcast.WIDTH);\n Callcast.SendLocalVideoToPeers({width: w, height: h});\n // remove background image to prevent it from showing around the plugin\n // if there is no fb image leave the default bg image since it does not show through\n if (app.user.fbProfilePicUrl)\n {\n jqOo.css('background-image', '');\n }\n }\n else\n {\n $('#effectsPanel > div').css({'display': 'none'});\n jqObj.removeClass('on') // change button\n .attr('title', 'Turn Video On ' + app.videoKeyAccel);\n jqObj1.removeClass('on') // change button\n .attr('title', 'Turn Video On ' + app.videoKeyAccel);\n Callcast.SendLocalVideoToPeers(enable);\n // show background image if fb image url exists\n // if not the default is used and does not show around the plugin\n if (app.user.fbProfilePicUrl)\n {\n jqOo.css('background-image', 'url(' + app.user.fbProfilePicUrl + ')');\n }\n }\n return false;\n} // changeVideo()", "function togglePlay() {\n video[video.paused ? 'play' : 'pause']();\n}", "function switchVideo(){\n\t\tlet omitImpression = document.getElementById(\"tracking_impression\"),\n\t\t\tomitView = document.getElementById(\"tracking_view\"),\n\t\t\tomitRangeOne = document.getElementById(\"rangeOne\"),\n\t\t\tomitRangeTwo = document.getElementById(\"rangeTwo\"),\n\t\t\tomitRangeThree = document.getElementById(\"rangeThree\"),\n\t\t\tomitRangeFour = document.getElementById(\"rangeFour\");\n\t\tomitImpression && omitImpression.remove();\n\t\tomitView && omitView.remove();\n\t\tomitRangeOne && omitRangeOne.remove();\n\t\tomitRangeTwo && omitRangeTwo.remove();\n\t\tomitRangeThree && omitRangeThree.remove();\n\t\tvideoID = videoOptions[Math.floor(Math.random() * videoOptions.length)];\n\t\tvideoRequest.open('GET', baseURL + 'request.php/?video_id=' + videoID, true);\n\t\tvideoRequest.setRequestHeader(\"cache-control\", \"no-cache\");\n\t\tvideoRequest.send();\n\t\tconsole.log(\"%c New video •͡˘㇁•͡˘ \", \"background: #f67e33; color: #FFF; font-family:monospace; font-size: 15px;\");\n}", "function action_toggle_play() {\n if (video.paused) {\n video.play();\n change_icon('play'); \n } else {\n video.pause();\n change_icon('pause'); \n }\n delay = delay_value;\n}", "function toggleVid() {\n if (playing) {\n myVideo.pause();\n button.html('play');\n } else {\n myVideo.loop();\n button.html('pause');\n }\n playing = !playing;\n}", "function mutevideo() {\r\n\r\n\t$(\"video\").prop('muted', true);\r\n\r\n\t$(\"#mute-video\").on('click', function(){\r\n\r\n\t\tif( $(\"video\").prop('muted')){\r\n\r\n\t\t\t$(\"video\")\r\n\t\t \t\t\t.prop('muted', false)\r\n\r\n\t\t} else {\r\n\t\t\t$(\"video\")\r\n\t\t \t\t\t\t.prop('muted', true);\r\n\r\n\t\t}\r\n\r\n\t});\r\n\r\n}", "function togglePlayPause() {\r\n if (video.paused) {\r\n playVideo();\r\n } else {\r\n pauseVideo();\r\n }\r\n}", "toggle(event) {\n if (this.playing) {\n this.pause();\n }\n else {\n this.play();\n }\n this.playing = !this.playing;\n }", "function togglePlay() {\n const method = video.paused ? 'play' : 'pause' ;\n video[method]();\n}", "function togglePlay() {\n const isPaused = video.paused ? true : false; //paused is a property on video\n \n if (isPaused) { \n video.play();\n } else {\n video.pause();\n }\n}", "function togglePlay() {\n\t// Selecting the right method\n\tconst method = video.paused ? 'play' : 'pause';\n\t// Calling the finction\n\tvideo[method]();\n}", "#controlState() {\n this.wrapper.addEventListener(\"click\", () => {\n if (this.video.paused) {\n this.controller.checked = false;\n this.video.play();\n } else {\n this.controller.checked = true;\n this.video.pause();\n }\n });\n }", "function togglePlayback() {\n let video_is_cued = player.getPlayerState() == states.video_cued;\n let video_is_paused = player.getPlayerState() == states.paused;\n let video_is_playing = player.getPlayerState() == states.playing;\n if (video_is_cued || video_is_paused) {\n player.playVideo();\n } else if (video_is_playing) {\n player.pauseVideo();\n }\n}", "function soundOnOff() {\r\n\r\n\t$(\"#mute-video\").on('click', function() {\r\n\r\n\t\tif ($('#mute-video').hasClass('soundOn')) {\r\n\r\n\t\t\t$('#mute-video')\r\n\t\t\t\t.removeClass('soundOn')\r\n\t\t\t\t.addClass('soundOff');\r\n\r\n\r\n\t\t} else {\r\n\r\n\t\t\t$('#mute-video')\r\n\t\t\t\t.removeClass('soundOff')\r\n\t\t\t\t.addClass('soundOn');\r\n\r\n\t\t}\r\n\r\n });\r\n\r\n}", "function startVideo() {\n console.log(\"Inside Start Video\");\n stream.getVideoTracks()[0].enabled = true;\n }", "function togglePlay() {\n const method = video.paused ? 'play' : 'pause';\n video[method]();\n}", "function togglePlay() {\n if(isPlaying) {\n domVideo.pause();\n isPlaying = false;\n playButton.innerHTML = '<img src=\"video-plugin/video-img/play.png\" />';\n } else {\n domVideo.play();\n isPlaying = true;\n playButton.innerHTML = '<img src=\"video-plugin/video-img/pause.png\" />';\n }\n}", "function toggle(){\n if(document.pictureInPictureElement){\n // video is already in pip mode, now exit pip mode\n document.exitPictureInPicture();\n }else{\n //video is not in pip mode, request pip mode\n video.requestPictureInPicture();\n }\n}", "function togglePlayback() {\n if(vm.mediaElement.paused) {\n vm.mediaElement.play();\n } else {\n vm.mediaElement.pause();\n }\n }", "function togglePlayVideo() {\n let icon = playbtn.querySelector('.video-ctrl-bt');\n if(video.paused) {\n videoduration = convertSecondsToMinutes(video.duration);\n overvideo.style.backgroundColor = 'transparent';\n video.play();\n playToPauseBtn(icon);\n videobtn.style.display = 'none';\n addVideoListeners();\n outVideoControl();\n videoPlaying = true;\n }\n else {\n video.pause();\n pauseToPlayBtn(icon);\n videobtn.style.display = 'block';\n removeVideoListeners();\n videoCtrlTl.reverse();\n videoPlaying = false;\n }\n }", "function toggleAudio() {\n\tif (recording ==1) { //capturing --> begin sending\n\t\trecording = 2;\n\t\tdocument.getElementById(\"recording-icon\").className = \"glyphicon glyphicon-ok\";\n\t\tdocument.getElementById(\"recording-button\").className = \"btn btn-lg btn-success col-md-offset-3\";\n\t\tdocument.getElementById(\"next-button\").className = \"btn btn-lg btn-primary col-md-offset-3\";\n\t\tsubmitData();\n\t}\n\telse { //waiting or sent --> begin capturing\n\t\tsubmitted = false;\n\t\trecording = 1;\n\t\tdocument.getElementById(\"recording-button\").className = \"btn btn-lg btn-danger col-md-offset-3\";\n\t\tdocument.getElementById(\"recording-icon\").className = \"glyphicon glyphicon-record\";\n\t}\n}", "function toggleVideoStatus() {\n if (video.paused) {\n video.play();\n } else {\n video.pause();\n }\n if (dropdown.classList.contains('dropdown-visible')) {\n showDropdown();\n }\n}", "function togglePlay(){\n console.log(\"working? togglePlay fn\")\n const method = video.paused ? 'play' : 'pause';\n video[method]();\n}", "function togglePlayVideo()\r\n\t{\r\n\t\t //if statement; outcome differs depending on conditions\r\n\t\tif ( myVideo.paused === true ) //video is paused\r\n\t\t{\r\n\t\t\tmyVideo.play(); //the DOM play method plays the video, when clicked\r\n\t\t\tplayButton.innerHTML = \"&#9616;&#9616;\"; //updates inside HTML button selector: turns into a pause icon made from two same Unicode characters\r\n\t\t\tisPaused = false; //boolean variable is assigned to false\r\n\t\t}\r\n\t\telse //if the video is playing\r\n\t\t{\r\n\t\t\tmyVideo.pause(); //the DOM pause method pauses the video, when clicked\r\n\t\t\tplayButton.innerHTML = \"&#9658;\" ; //updates inside HTML button selector when clicked: turns into a right-pointing pointer made from single Unicode character\r\n\t\t\tisPaused = true; //boolean variable is assigned to true\r\n\t\t} //ends if statement\r\n\t} //ends function \"togglePlayVideo\"", "function togglePlay() {\n // if (selectors.video.paused) {\n // selectors.video.play();\n // } else {\n // selectors.video.pause();\n // }\n\n const method = selectors.video.paused ? \"play\" : \"pause\";\n selectors.video[method]();\n}", "function togglePostMediaURL() {\n $(\".cmb2-id--w-media-info, .cmb2-id--w-embed-url\").toggle($(\"#post-format-audio\").is(\":checked\") || $(\"#post-format-video\").is(\":checked\"));\n tabsChanged();\n }", "function toggleMute() {\n if (video.muted) {\n mute.title = 'mute';\n mute.innerHTML = '<img src=\"icons/volume-on-icon.png\">';\n mute.className = 'mute';\n video.muted = false;\n }\n else {\n mute.title = 'mute';\n mute.innerHTML = '<img src=\"icons/volume-off-icon.png\">';\n mute.className = 'mute';\n video.muted = true;\n }\n}", "async function togglePip() {\n try {\n if (video !== document.pictureInPictureElement) {\n pipButton.disabled = true;\n await video.requestPictureInPicture();\n } else {\n await document.exitPictureInPicture();\n }\n } catch (error) {\n console.error(error)\n } finally {\n pipButton.disabled = false;\n }\n}", "function togglePlay() {\n if(!downloadFinished){\n return;\n }\n if(playing){\n player.pause();\n }else{\n player.play();\n }\n }", "function toggle() { // @return Boolean: true is play\r\n // false is pause\r\n switch (this.state().text) {\r\n case \"ended\": this.backend.currentTime(0);\r\n case \"pause\": this.play();\r\n return true;\r\n case \"playing\": this.pause();\r\n }\r\n return false;\r\n}", "function btnComenzar() {\n vid.currentTime = 0;\n vid.play();\n}", "function togglePlayPause() {\n var video = document.getElementById(\"Video\");\n if (video.paused || video.ended) {\n video.play();\n }\n else {\n video.pause();\n }\n}", "function toggleVid() {\n if (playing) {\n currVid.pause();\n //currVid.hide()\n } else {\n //currVid.show()\n currVid.play();\n }\n playing = !playing;\n}", "function toggle() {\n if (!isRunning) {\n // if the stream is not opened one elment, open the first element\n if(document.querySelectorAll('.item-container').length < 1) {\n eventFire(document.querySelector('#stream .silent.thumb'), 'click');\n }\n launchFullscreen(document.documentElement);\n nextOnFinish();\n overlayEl.style.display = '';\n bodyEl.style.overflowY = 'hidden'; // make scrollbar disappear\n } else {\n exit();\n }\n isRunning = !isRunning;\n console.log('Pr0 TV running: ', isRunning);\n }", "function manipulatevideo(){\n if( cameravideo || capturevideo ){\n cameravideo = false;\n capturevideo = false;\n capturestream = null;\n buttonOff(document.querySelector('.app__system--button.video'));\n camerastream.getVideoTracks()[0].enabled = cameravideo;\n document.getElementById('localvideo').srcObject = camerastream;\n //-------------------CREATE NEW PRODUCER-------------------------------------------\n removeOldVideoProducers();\n let videoProducer = mediasouproom.createProducer(camerastream.getVideoTracks()[0]);\n videoProducer.send(sendTransport);\n updatevideo();\n }\n}", "function toggleScreenSharing() {\n const constraints = { video: true, };\n\n let screenMediaPromise;\n\n if (!isScreenStreaming) {\n // on screen sharing start\n if (navigator.getDisplayMedia) screenMediaPromise = navigator.getDisplayMedia(constraints);\n else if (navigator.mediaDevices.getDisplayMedia) screenMediaPromise = navigator.mediaDevices.getDisplayMedia(constraints);\n else screenMediaPromise = navigator.mediaDevices.getUserMedia({ video: { mediaSource: \"screen\", }, });\n } \n else {\n // on screen sharing stop\n const constraints = { audio: Audio, video: Video, };\n screenMediaPromise = navigator.mediaDevices.getUserMedia(constraints);\n if (isStreamRecording) stopStreamRecording(); // if screen sharing accidentally closed\n }\n screenMediaPromise\n .then((screenStream) => {\n // stop cam video track on screen share\n stopMyVideoTrack();\n isScreenStreaming = !isScreenStreaming;\n refreshMyStreamToOthers(screenStream);\n refreshMyStream(screenStream);\n myVideo.classList.toggle(\"mirror\");\n setScreenSharingStatus(isScreenStreaming);\n })\n .catch((err) => {\n console.error(\"error: unable to share the screen\", err);\n alert(\"error: unable to share the screen \" + err);\n });\n}", "function changeStatus() {\n if (showVideo) {\n window.location.reload();\n } else {\n myUsernameRef.current = currentUsername;\n socketRef.current.emit(\"join room\", { roomID, currentUsername });\n }\n changeVideoState(!showVideo);\n }", "togglePlay() {\n this.props.setPlay(!this.props.isPlaying);\n }", "toggle() {\n if (this._playingState === 'idle') {\n this.play();\n } else {\n this.pause();\n }\n }", "function togglePlay() {\n // If video is paused play it or pause it\n // `.paused` property is used because there is no play property\n return video.paused ? video.play() : video.pause(); // My solution\n // Wes's solution\n // const method = video.paused ? 'play' : 'pause';\n // video[method]();\n}", "function toggle_to_low(){\n\tisSnapVisible = true;\n\tvideo_out.style.display = 'none';\n\tsnap_out.style.display = 'block';\n\tpause();\n\tsend_img_loop();\n}", "function videoupdate(data){\n let client = findclientbyid(data.clientid);\n if(client.clientid == userid || client == null)\n return;\n let videobox = client.videobox;\n client.capturevideo = data.capturevideo;\n client.cameravideo = data.cameravideo;\n if( client.cameravideo == false ){\n if( client.capturevideo == false ){\n buttonOff(videobox.querySelector('.videobox__icon.video'));\n }else{\n buttonOn(videobox.querySelector('.videobox__icon.video'));\n }\n }else{\n buttonOn(videobox.querySelector('.videobox__icon.video'));\n }\n}", "function toggle_play_pause(ev)\n {\n ev.preventDefault();\n if (video_elt.paused || video_elt.ended) play_video(); else pause_video();\n }", "toggle(){\n this.sound.playing() ? this.sound.stop() : this.sound.play();\n }", "toggle(){\n this.sound.playing() ? this.sound.stop() : this.sound.play();\n }", "disableVideoFec () {\n this.constrainOfferToRemoveVideoFec = true;\n }", "function startStream() {\r\n\r\n if (navigator.platform == \"iPhone\" || navigator.platform == \"Linux armv8l\") {\r\n vid = createCapture(VIDEO, constraints)\r\n } else {\r\n\r\n vid = createCapture(VIDEO);\r\n }\r\n\r\n vid.position(0, 0)\r\n button.remove()\r\n select(\"#accept\").remove()\r\n\r\n classifyVideo()\r\n\r\n}", "toggleNode() {\n const { state } = this;\n if (state.isPlaying) {\n console.log(`stopping ${state.processor.module}`);\n state.node.port.postMessage(false);\n } else {\n console.log(`playing ${state.processor.module}`);\n const node = state.processor.cb(this);\n this.setState({ node }, () => {\n node.port.postMessage(true);\n });\n }\n this.setState({ isPlaying: !state.isPlaying });\n }", "function stopScreenShare() {\n let videoTrack = myVideoStream.getVideoTracks()[0];\n for (let x = 0; x < currentPeer.length; x++) {\n let sender = currentPeer[x].getSenders().find(function (s) {\n return s.track.kind == videoTrack.kind;\n })\n sender.replaceTrack(videoTrack);\n }\n}", "function toggleAudio(b) {\n if (b == \"true\") {\n localStream.getAudioTracks()[0].enabled = true\n } else {\n localStream.getAudioTracks()[0].enabled = false\n }\n}", "function togglePlay() {\n if (video.paused) {\n video.play();\n } else {\n video.pause();\n }\n\n // or other way to do this same thing \n /*const method =video.paused?'play':'pause';\n video[method]();*/\n}", "static toggleMic () {\n debug('toggleMic');\n\n if (this.vaani.isSpeaking || this.vaani.isListening) {\n this.vaani.cancel();\n\n AppStore.state.standingBy.text = '';\n\n TalkieActions.setActiveAnimation('none');\n TalkieActions.setMode('none');\n\n return;\n }\n\n this.greetUser();\n }", "function mutevideo(state, direction)\n{\n if (typeof (webphone_api.plhandler) === 'undefined' || webphone_api.plhandler === null)\n webphone_api.addtoqueue('MuteVideo', [mute, direction]);\n else\n webphone_api.plhandler.MuteVideo(state, direction);\n}", "function videoStateToggle(e, animate) {\n var $video = $(this);\n var $state = $video.closest('[data-state-name]');\n var state = $state.data('state-name');\n\n // Set body state.\n if (state) $body.attr('data-state-name', e.type == 'in' ? state : '');\n\n // Toggle element class state.\n $video.toggleClass('no-animate', animate == false);\n $video.toggleClass('active', e.type == 'in');\n }", "function sendVideo() \r\n{\r\n\tsocketSend('V' + mediaFilePath + nextSlideName);\r\n}", "function checkUseVideo() {\n // const useVideo = document.getElementById('use_video').checked;\n return true\n }", "stopVideo() {\n\n var myVideoac = document.getElementById(\"embedVideo-ac\");\n var myVideo = document.getElementById(\"embedVideo\");\n \n if(myVideoac) { \n $(myVideoac).attr(\"src\", $(myVideoac).attr(\"src\"));\n } \n if(myVideo) { \n $(myVideo).attr(\"src\", $(myVideo).attr(\"src\")); \n }\n \n }", "showVideoOnTop(){\n this.scrollToTop(200)\n this.box.video = !this.box.video\n }", "function outVideoControl() {\n videoCtrlTl.play();\n }", "function callSetReceiveVideo(call) {\n var status = getSdpDirectionLogging(call.sdp, video, false);\n logger.debug(\"callSetReceiveVideo: status= \" + status);\n// if (status === MediaStates.RECEIVE_ONLY) {\n// call.call.setReceiveVideo(false);\n// call.call.setReceivingVideo(true);\n// } else if (status === MediaStates.SEND_ONLY) {\n// call.call.setReceiveVideo(true);\n// call.call.setReceivingVideo(false);\n// } else if (status === MediaStates.SEND_RECEIVE) {\n// call.call.setReceiveVideo(true);\n// call.call.setReceivingVideo(true);\n// } else {\n// call.call.setReceiveVideo(false);\n// call.call.setReceivingVideo(false);\n// }\n call.call.setReceiveVideo(isSdpVideoSendEnabled(call.sdp, video));\n call.call.setReceivingVideo(isSdpVideoReceiveEnabled(call.sdp, video));\n }", "function toggleVideoStatus() {\n // Get minutes\n let mins = Math.floor(video.duration / 60);\n if (mins < 10) {\n mins = '0' + String(mins);\n }\n\n // Get seconds\n let secs = Math.floor(video.duration % 60);\n if (secs < 10) {\n secs = '0' + String(secs);\n }\n\n videoLength.innerHTML = `/${mins}:${secs}`;\n if (video.paused) {\n video.play();\n } else {\n video.pause();\n }\n}", "function muteOrUnmute() {\n video.muted = !video.muted;\n mutebutton.value = video.muted ? 'Unmute' : 'Mute';\n}", "showVideo () {\n this.video.play()\n this.el.emit('activate')\n }", "function videoDisplay() {\n if (videoButton.hidden == true) {\n videoElement.hidden = true;\n videoPageElement.hidden = false;\n } else {\n videoElement.hidden = false;\n videoPageElement.hidden = true;\n }\n}", "toggle() {\n return this.paused ? this.resume() : this.pause();\n }", "function togglePlay() {\n if (elements.video.paused) {\n elements.video.play();\n elements.playBtn.classList.replace('fa-play', 'fa-pause');\n elements.playBtn.setAttribute('title', 'Pause');\n } else {\n elements.video.pause();\n showPlayIcon();\n }\n}", "function videoButtonPress(event)\n{\n changeVideo();\n}", "toggleMobileTorch() {\n\t\t// sanity check\n\t\tconsole.assert(this.hasMobileTorch() === true);\n\t\t\t\n\t\tvar stream = arToolkitSource.domElement.srcObject;\n\t\tif( stream instanceof MediaStream === false ){\n\t\t\talert('enabling mobile torch is available only on webcam');\n\t\t\treturn\n\t\t}\n\n\t\tif( this._currentTorchStatus === undefined ){\n\t\t\tthis._currentTorchStatus = false;\n\t\t}\n\n\t\tvar videoTrack = stream.getVideoTracks()[0];\n\t\tvar capabilities = videoTrack.getCapabilities();\n\t\t\n\t\tif( !capabilities.torch ){\n\t\t\talert('no mobile torch is available on your camera');\n\t\t\treturn\n\t\t}\n\n\t\tthis._currentTorchStatus = this._currentTorchStatus === false ? true : false;\n\t\tvideoTrack.applyConstraints({\n\t\t\tadvanced: [{\n\t\t\t\ttorch: this._currentTorchStatus\n\t\t\t}]\n\t\t}).catch(function(error){\n\t\t\tconsole.log(error);\n\t\t});\n\t}", "stopVideo() {\n this.$viewElement.find(\"iframe\")[0].contentWindow.postMessage('{\"event\":\"command\",\"func\":\"' + 'stopVideo' + '\",\"args\":\"\"}', '*');\n }", "click (stream) {\n if (this.current) {\n this.current.state = null;\n this.player.stop();\n }\n\n if (stream == this.current) {\n this.current = null;\n } else {\n this.current = stream;\n this.current.state = 'buffering';\n \n// console.log('this.current.uid'+this.current.uid);\n this.player.play(this.current.uid);\n }\n }" ]
[ "0.76611525", "0.7508566", "0.73137957", "0.71956885", "0.7057195", "0.70305187", "0.70295316", "0.69461167", "0.688114", "0.6848042", "0.6832435", "0.6820944", "0.6811815", "0.6809342", "0.68023044", "0.67885274", "0.6707438", "0.6675227", "0.6672023", "0.66316885", "0.6537005", "0.65323627", "0.6464621", "0.64513505", "0.6387564", "0.6375251", "0.6347987", "0.6327777", "0.63229513", "0.63183546", "0.63109106", "0.63019735", "0.62862635", "0.6284871", "0.62832594", "0.62762797", "0.6276001", "0.62497014", "0.62492186", "0.622581", "0.6222214", "0.6216334", "0.6209549", "0.6208294", "0.62055236", "0.6203895", "0.6181919", "0.6171575", "0.6163803", "0.6160973", "0.6148373", "0.61286145", "0.607841", "0.60777444", "0.6073448", "0.6072123", "0.60719955", "0.60697836", "0.6066564", "0.60530716", "0.60507387", "0.6045174", "0.6036381", "0.6032161", "0.60282564", "0.6025946", "0.6014121", "0.59898394", "0.59860176", "0.59786946", "0.597759", "0.596626", "0.59648633", "0.596402", "0.596402", "0.5961066", "0.5944613", "0.5942567", "0.5938727", "0.59383667", "0.5918405", "0.5910903", "0.59054315", "0.589598", "0.58825696", "0.58739156", "0.58733106", "0.58647436", "0.5862521", "0.58517456", "0.5847386", "0.5841659", "0.5840048", "0.5837373", "0.58262503", "0.58237904", "0.58236146", "0.58205676", "0.5816946", "0.581399" ]
0.6408858
24
Brings up the node services configuration dialog
function pag_configureNodeServices() { document.pag_venueClientController.configureNodeServices(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DialogServiceConfig() {\n }", "function openConfig() {\n vm.isConfiguring = true;\n vm.dialogActive = true;\n }", "function ac_showConfigPanel() {\n\tac_switchTool(\"cfg\");\n}", "function main(){\n init_config_form();\n K.ui.bind_action(A);\n }", "function settings() {\n\t\t\tSettingsService.show();\n\t\t}", "function configure() {\r\n \r\n const popupUrl = `${window.location.origin}/tableau-extension-sunburst/dialog.html`;\r\n //const popupUrl = `${window.location.origin}/dialog.html`;\r\n\r\n let input = \"\";\r\n\r\n tableau.extensions.ui.displayDialogAsync(popupUrl, input, { height: 540, width: 800 }).then((closePayload) => {\r\n // The close payload is returned from the popup extension via the closeDialog method.\r\n $('#interval').text(closePayload);\r\n }).catch((error) => {\r\n // One expected error condition is when the popup is closed by the user (meaning the user\r\n // clicks the 'X' in the top right of the dialog). This can be checked for like so:\r\n switch (error.errorCode) {\r\n case tableau.ErrorCodes.DialogClosedByUser:\r\n console.log(\"Dialog was closed by user\");\r\n break;\r\n default:\r\n console.error(error.message);\r\n }\r\n });\r\n }", "function initSystemGui() {\n\n window.onresize = function(event) {\n if (objWordClusters.circlesJson != null) {\n drawCirclePacking(objWordClusters.circlesJson);\n }\n };\n\n $('.helpIcon')\n .popup({\n on: 'hover'\n });\n $('.ui.small.dropdown.item').dropdown();\n $(\"input:checkbox\").on('click', function() {\n var $box = $(this);\n if ($box.is(\":checked\")) {\n var group = \"input:checkbox[name='\"+$box.attr(\"name\") + \"']\";\n $(group).prop(\"checked\", false);\n $box.prop(\"checked\", true);\n\n //objNetStyle[$box.attr(\"name\")] = $box.attr(\"value\");\n objNetStyle[currentPanel][$box.attr(\"name\").split(\"-\")[1] ] = $box.attr(\"value\");\n\n if(group.indexOf(\"edge\") == -1){\n //node option\n var arrNodes = networksDS[currentPanel].nodes.get();\n for (var i=0; i < arrNodes.length; i++) {\n var elemObj = arrNodes[i];\n var elemColor = mapColor(-1,'node');\n var elemColorField = objNetStyle[currentPanel].nodeColor;\n if (elemColorField != 'none') {\n var elemId = null;\n switch (elemColorField) {\n case 'domain' : var jsonObj = emailDomains[currentPanel]['filtered'];\n elemId = jsonObj[elemObj[elemColorField]].id;\n break;\n case 'cluster' : elemId = elemObj.cluster; break;\n }\n elemColor = mapColor(elemId,'node');\n }\n\n networksDS[currentPanel].nodes.update({'id': elemObj.id, 'value': elemObj[objNetStyle[currentPanel].nodeSize],\n color: {'background': elemColor, 'highlight':{background: elemColor,border:'#A0A0A0'},hover:{background:elemColor,border:'#A0A0A0'}} });\n }\n }else{\n //edge option\n var arrEdges = networksDS[currentPanel].edges.get();\n for (var i=0; i < arrEdges.length; i++) {\n var elemObj = arrEdges[i];\n var elemColor = mapColor(-1,'edge');\n var elemColorField = objNetStyle[currentPanel].edgeColor;\n var myColor = null;\n if (elemColorField != 'none')\n {\n var elemId = null;\n switch (elemColorField) {\n case 'domain' : var jsonObj = emailDomains[currentPanel]['filtered'];\n elemId = jsonObj[elemObj[elemColorField]].id;\n break;\n case 'cluster' : elemId = elemObj.cluster; break;\n }\n elemColor = mapColor(elemId,'edge');\n myColor = {'color':elemColor,'opacity':0.53,'highlight':elemColor,'hover':elemColor};\n }else{\n myColor = {'color':elemColor,'opacity':0.53,'highlight':'#848484','hover':'#848484'};\n }\n networksDS[currentPanel].edges.update({'id': elemObj.id, 'value': elemObj[objNetStyle[currentPanel].edgeSize], 'color': myColor });\n\n /*\n if (elemObj.id == \"1933\") {\n console.log(\"here is 1933 !! \");\n console.log(networksDS[currentPanel].edges.get(elemObj.id));\n }\n */\n }\n }\n\n } else {\n $box.prop(\"checked\", false);\n }\n });\n $('.ui.small.buttons.infoMenu2 .ui.button').on('click', function() {\n infosModule.clickMenuInfo2(this.id);\n });\n $('.ui.small.buttons.infoMenu1 .ui.button').on('click', function() {\n infosModule.clickMenuInfo1(this.id);\n });\n $('.ui.bottom.attached.tabular.menu .item').on('click', function() {\n clickPanelSwitch(this.id);\n });\n\n /*build the filters gui according to the data we have*/\n for (var keyFilter in mainData.filters.data) {\n var filterObj = mainData.filters.data[keyFilter];\n var filterVis = mainData.filters.visualization[keyFilter];\n\n if(filterObj.active == true){\n\n //in case it's textfield type of filter\n if(filterObj.type == \"textfield\"){\n $('#'+filterVis.id).placeholder=\"Search for a \"+filterObj.data+\"...\";\n $('#'+filterVis.id).keydown(function(event) {\n if (event.keyCode == 13) {\n data.objFilter[mainData.filters.data[event.target.id].data] = this.value;\n genFilteredData();\n genInfoOnFilteredData();\n var panelsVisObj = redrawPanels();\n $('#'+mainData.filters.visualization[event.target.id].id).blur();\n }\n });\n $('#'+filterVis.id).blur(function() {\n });\n }\n\n //in case it's smallslider type of filter\n if(filterObj.type == \"smallslider\"){\n $( '#'+filterVis.id).slider({\n range: \"max\",\n min: filterObj.min,\n max: filterObj.max,\n value: filterObj.max/10,\n create: function() {\n $( \"#\"+filterVis.handle).text( $( this ).slider( \"value\" ) );\n $( \"#\"+filterVis.amount).val( $( this ).slider( \"value\" ) );\n data.objFilter[filterObj.data] = filterObj.max/10;\n },\n slide: function( event, ui ) {\n var filterVis = mainData.filters.visualization[event.target.id];\n $( \"#\"+filterVis.amount).val( ui.value );\n }\n });\n document.getElementById(filterVis.lbl).innerHTML = \"[Max: \"+filterObj.max+\"]\";\n }\n\n //in case it's largeslider type of filter\n if(filterObj.type == \"largeslider\"){\n var filterVis = mainData.filters.visualization[keyFilter];\n $( '#'+filterVis.id).slider({\n range: true,\n min: filterObj.min,\n max: filterObj.max,\n values: [filterObj.start, filterObj.end],\n create: function(){\n if(filterObj.data == \"time\"){\n $( '#'+filterVis.amount ).val(util.StringformatDate(new Date(filterObj.min)) + \" - \" + util.StringformatDate(new Date(filterObj.max)) );\n }else{\n $( '#'+filterVis.amount ).val(filterObj.min + \" - \" + filterObj.max);\n }\n\n var fromVal = filterObj.min;\n var toVal = filterObj.max;\n if(filterObj.data == \"time\"){\n fromVal = new Date(fromVal);\n toVal = new Date(toVal);\n }\n data.objFilter[filterObj.data]['from'] = fromVal;\n data.objFilter[filterObj.data]['to'] = toVal;\n },\n slide: function( event, ui ) {\n var filterVis = mainData.filters.visualization[event.target.id];\n var dateS = new Date(ui.values[0]);\n var dateE = new Date(ui.values[1]);\n $( '#'+filterVis.amount ).val(util.StringformatDate(dateS) + \" - \" + util.StringformatDate(dateE) );\n //updateObjFilter('time',{'from':formatDate( new Date(ui.values[0])),'to':formatDate( new Date(ui.values[1]))});\n }\n });\n }\n }\n }\n\n var timeout;\n $('.slider').on(\"slidestop\", function(event, ui) {\n clearTimeout(timeout);\n timeout = setTimeout(function() {\n\n var filterObj = mainData.filters.data[event.target.id];\n var filterFunc = filterObj.filterFunc.split(\".\");\n\n if(filterObj.numInput <= 1){\n data.objFilter[filterObj.data] = ui.value;\n }else{\n var fromVal = ui.values[0];\n var toVal = ui.values[1];\n\n if(filterObj.data == \"time\"){\n fromVal = new Date(fromVal);\n toVal = new Date(toVal);\n }\n data.objFilter[filterObj.data]['from'] = fromVal;\n data.objFilter[filterObj.data]['to'] = toVal;\n }\n\n genFilteredData();\n genInfoOnFilteredData();\n\n console.log(data);\n console.log(\"Draw the panels\");\n var panelsVisObj = redrawPanels();\n\n }, 50);\n });\n\n /*build panel visualizations*/\n for (var keyVis in mainData.visualizations) {\n if(mainData.visualizations[keyVis].active == true){\n var drawFunc = mainData.visualizations[keyVis].drawFunc.split(\".\");\n window['guiUtil'][drawFunc[0]](mainData.visualizations[keyVis].id);\n }\n }\n\n document.addEventListener('DOMContentLoaded', function () {\n });\n }", "function clientSettings(){\n document.getElementById('box-settings').style.display = 'grid';\n }", "function setupCreateTemplateDialog(){\n //Helper functions for the dialog operations\n\n // Called when changing tabs. Since we use the same form for both\n // KVM, XEN and others we need to do some operation to update it\n var vmTabChange = function(event,ui){\n // ui.tab // anchor element of the selected (clicked) tab\n // ui.panel // element, that contains the selected/clicked tab contents\n // ui.index // zero-based index of the selected (clicked) tab\n\n //disable all items\n $(items,dialog).attr('disabled','disabled');\n //hide all mandatory icons\n $('.vm_param .man_icon',dialog).css(\"display\",\"none\");\n\n //empty selects\n $('select#BOOT',section_os_boot).empty();\n $('select#TYPE',section_disks).empty();\n\n //hide options about boot method\n $('div#kernel_bootloader',section_os_boot).show();\n $('.kernel, .bootloader', section_os_boot).hide();\n $('select#BOOT',section_os_boot).parent().hide();\n //unselect boot method\n $('select#boot_method option',section_os_boot).removeAttr('selected');\n\n //hide non common sections\n $(section_inputs).hide();\n $(section_features).hide();\n switch(ui.index){\n case 0:\n enable_kvm();\n break;\n case 1:\n enable_xen();\n break;\n case 2:\n enable_vmware();\n case 3:\n break;\n }\n //hide_disabled();\n //show_enabled();\n }\n\n //~ var hide_disabled = function(context) {\n //~ var $disabled;\n //~ if (!context) {\n //~ $disabled = $('.vm_param input:disabled,.vm_param select:disabled');\n //~ } else {\n //~ $disabled = $('.vm_param input:disabled,.vm_param select:disabled',context);\n //~ }\n //~\n //~ $disabled.each(function(){\n //~ $(this).parent('.vm_param').hide();\n //~ });\n //~ }\n //~\n //~ var show_enabled = function(context){\n //~ var $enabled;\n //~ if (!context) {\n //~ $enabled = $('.vm_param input:enabled,.vm_param select:enabled');\n //~ } else {\n //~ $enabled = $('.vm_param input:enabled,.vm_param select:enabled',context);\n //~ }\n //~\n //~ $enabled.parent('.vm_param').show();\n //~ }\n\n //Using kvm wizard.\n var enable_kvm = function(){\n man_class=\"kvm\";\n opt_class=\"kvm_opt\";\n $(kvm_items,dialog).removeAttr('disabled');\n $('.kvm .man_icon',dialog).css(\"display\",\"inline-block\");\n\n //KVM particularities:\n // * Add custom disk types\n // * Add custom boot options\n // * Show boot options\n // * Set the raw type to kvm\n // * Show the inputs and graphics section\n\n var type_opts =\n '<option id=\"no_type\" value=\"\" selected=\"selected\">'+tr(\"None\")+'</option>\\\n <option value=\"disk\">'+tr(\"Disk\")+'</option>\\\n <option value=\"floppy\">'+tr(\"Floppy\")+'</option>\\\n <option value=\"cdrom\">'+tr(\"CD-ROM\")+'</option>\\\n <option value=\"swap\">'+tr(\"Swap\")+'</option>\\\n <option value=\"fs\">'+tr(\"FS\")+'</option>\\\n <option value=\"block\">'+tr(\"Block\")+'</option>';\n\n $('select#TYPE',section_disks).html(type_opts);\n\n var boot_opts =\n '<option value=\"hd\">'+tr(\"hd\")+'</option>\\\n <option value=\"fd\">'+tr(\"fd\")+'</option>\\\n <option value=\"cdrom\">'+tr(\"cdrom\")+'</option>\\\n <option value=\"network\">'+tr(\"network\")+'</option>';\n\n $('select#BOOT',section_os_boot).html(boot_opts);\n $('select#BOOT',section_os_boot).parent().show();\n $('select#boot_method option#no_boot',section_os_boot).html(tr(\"Driver default\"));\n\n $('input#TYPE', section_raw).val(\"kvm\");\n\n// $(section_inputs).show();\n };\n\n // Using XEN wizard.\n var enable_xen = function(){\n man_class=\"xen\";\n opt_class=\"xen_opt\";\n $(xen_items,dialog).removeAttr('disabled');\n $('.xen .man_icon',dialog).css(\"display\",\"inline-block\");\n\n // XEN particularities:\n // * Add custom disk types\n // * Remove driver default boot method\n // * Set the raw section to XEN\n // * Show the graphics section\n\n var type_opts =\n '<option value=\"disk\">'+tr(\"Disk\")+'</option>\\\n <option value=\"floppy\">'+tr(\"Floppy\")+'</option>\\\n <option value=\"cdrom\">'+tr(\"CD-ROM\")+'</option>\\\n <option value=\"swap\">'+tr(\"Swap\")+'</option>\\\n <option value=\"fs\">'+tr(\"FS\")+'</option>\\\n <option value=\"block\">'+tr(\"Block\")+'</option>';\n\n $('select#TYPE',section_disks).html(type_opts);\n\n $('select#boot_method option#no_boot',section_os_boot).html(tr(\"Please choose\"));\n\n $('input#TYPE', section_raw).val(\"xen\");\n };\n\n //VMWare wizard\n var enable_vmware = function() {\n man_class=\"vmware\";\n opt_class=\"vmware_opt\";\n $(vmware_items,dialog).removeAttr('disabled');\n $('.vmware .man_icon',dialog).css(\"display\",\"inline-block\");\n\n //VMWARE particularities\n // * Add custom disk types\n // * Hide boot method field\n // * Set the raw type to vmware\n\n var type_opts =\n '<option value=\"file\" selected=\"selected\">'+tr(\"File\")+'</option>\\\n <option value=\"cdrom\">'+tr(\"CD-ROM\")+'</option>\\\n <option value=\"block\">'+tr(\"Block\")+'</option>';\n\n $('select#TYPE',section_disks).html(type_opts);\n\n $('div#kernel_bootloader',section_os_boot).hide();\n\n $('input#TYPE', section_raw).val(\"vmware\");\n };\n\n //This function checks that all mandatory items within a section\n //have some value. Returns true if so, false if not.\n var mandatory_filter = function(context){\n var man_items = \".\"+man_class;\n\n //find enabled mandatory items in this context\n man_items = $(man_items+' input:visible, '+man_items+' select:visible',context);\n var r = true;\n\n //we fail it the item is enabled and has no value\n $.each(man_items,function(){\n var item = $(this);\n if (item.parents(\".vm_param\").attr('disabled') ||\n !(item.val().length)) {\n r = false;\n return false;\n };\n });\n return r;\n };\n\n //Adds an option element to a multiple select box. Before doing so,\n //it checks that the desired filter is passed\n var box_add_element = function(context,box_tag,filter){\n var value=\"\";\n var params= $('.vm_param',context);\n var inputs= $('input:enabled',params);\n var selects = $('select:enabled',params);\n var fields = $.merge(inputs,selects);\n\n //are fields passing the filter?\n var result = filter();\n if (!result) {\n notifyError(tr(\"There are mandatory parameters missing in this section\"));\n return false;\n }\n\n value={};\n\n //With each enabled field we form a JSON object\n var id = null;\n $.each(fields,function(){\n var field = $(this);\n if (!(field.parents(\".vm_param\").attr('disabled')) &&\n field.val().length){\n //Pick up parents ID if we do not have one\n id = field.attr('id').length ? field.attr('id') : field.parent().attr('id');\n value[id] = field.val();\n };\n });\n var value_string = JSON.stringify(value);\n var option=\n '<option value=\\''+value_string+'\\'>'+\n stringJSON(value)+\n '</option>';\n $('select'+box_tag,context).append(option);\n return false;\n };\n\n //Removes selected elements from a multiple select box\n var box_remove_element = function(section_tag,box_tag){\n var context = $(section_tag,dialog);\n $('select'+box_tag+' :selected',context).remove();\n return false;\n };\n\n //Given the JSON of a VM template (or of a section of it), it crawls\n //the fields of certain section (context) and add their name and\n //values to the template JSON.\n var addSectionJSON = function(template_json,context){\n var params= $('.vm_param',context);\n var inputs= $('input:enabled',params);\n var selects = $('select:enabled',params);\n var fields = $.merge(inputs,selects);\n\n fields.each(function(){\n var field=$(this);\n if (!(field.parents(\".vm_param\").attr('disabled'))){ //if ! disabled\n if (field.val().length){ //if has a length\n template_json[field.attr('id')]=field.val();\n };\n };\n });\n };\n\n // Given a section (context) and a tag for\n // a multiple select in that section, it adds the\n // JSON values to an array parsed as objects.\n // Returns the array\n var addBoxJSON = function(context,box_tag){\n var array = [];\n $('select'+box_tag+' option',context).each(function(){\n array.push( JSON.parse($(this).val()) );\n });\n return array;\n }\n\n //Given an object, removes those elements which are empty\n //Used to clean up a template JSON before submitting\n //it to opennebula.js\n var removeEmptyObjects = function(obj){\n for (elem in obj){\n var remove = false;\n var value = obj[elem];\n if (value instanceof Array)\n {\n if (value.length == 0)\n remove = true;\n }\n else if (value instanceof Object)\n {\n var obj_length = 0;\n for (e in value)\n obj_length += 1;\n if (obj_length == 0)\n remove = true;\n }\n else\n {\n value = String(value);\n if (value.length == 0)\n remove = true;\n }\n if (remove)\n delete obj[elem];\n }\n return obj;\n }\n\n //Toggles the icon when a section is folded/unfolded\n var iconToggle = function(){\n $('.icon_left',$create_template_dialog).click(function(e){\n if ($('span',e.currentTarget).hasClass(\"ui-icon-plus\")){\n $('span',e.currentTarget).removeClass(\"ui-icon-plus\");\n $('span',e.currentTarget).addClass(\"ui-icon-minus\");\n } else {\n $('span',e.currentTarget).removeClass(\"ui-icon-minus\");\n $('span',e.currentTarget).addClass(\"ui-icon-plus\");\n };\n });\n };\n\n //Fold/unfold all sections button\n var foldUnfoldToggle = function() {\n $('#fold_unfold_vm_params',$create_template_dialog).toggle(\n function(){\n $('.vm_section fieldset',$create_template_dialog).show();\n $('.icon_left span',$create_template_dialog).removeClass(\"ui-icon-plus\");\n $('.icon_left span',$create_template_dialog).addClass(\"ui-icon-minus\");\n return false;\n },\n function(){\n $('.vm_section fieldset',$create_template_dialog).hide();\n //Show capacity opts\n $('.vm_section fieldset',$create_template_dialog).first().show();\n $('.icon_left span',$create_template_dialog).removeClass(\"ui-icon-minus\");\n $('.icon_left span',$create_template_dialog).addClass(\"ui-icon-plus\");\n return false;\n });\n };\n\n // Set ups the capacity section\n var capacity_setup = function(){\n //Actually there is nothing to set up, but it used to be\n //possible to hide it like others\n /*\n $('fieldset',section_capacity).hide();\n $('#add_capacity',section_capacity).click(function(){\n $('fieldset',section_capacity).toggle();\n return false;\n });\n */\n\n }\n\n //Sets up the OS_BOOT section\n var os_boot_setup = function(){\n $('fieldset',section_os_boot).hide();\n $('.bootloader, .kernel',section_os_boot).hide();\n\n $('#add_os_boot_opts',section_os_boot).click(function(){\n $('fieldset',section_os_boot).toggle();\n return false;\n });\n\n //Depending on the boot method we enable/disable some options\n $('#boot_method',section_os_boot).change(function(){\n select = $(this).val();\n switch (select)\n {\n case \"kernel\":\n $('.bootloader',section_os_boot).hide();\n $('.bootloader',section_os_boot).attr('disabled','disabled');\n $('.kernel',section_os_boot).show();\n $('.kernel',section_os_boot).removeAttr('disabled');\n break;\n case \"bootloader\":\n $('.kernel',section_os_boot).hide();\n $('.kernel',section_os_boot).attr('disabled','disabled');\n $('.bootloader',section_os_boot).show();\n $('.bootloader',section_os_boot).removeAttr('disabled');\n break;\n default:\n $('.kernel, .bootloader',section_os_boot).hide();\n $('.kernel, .bootloader',section_os_boot).attr('disabled','disabled');\n $('.kernel input, .bootloader input',section_os_boot).val(\"\");\n };\n });\n };\n\n // Sets up the features section\n var features_setup = function(){\n $('fieldset',section_features).hide();\n\n $('#add_features',section_features).click(function(){\n $('fieldset',section_features).toggle();\n return false;\n });\n };\n\n // Sets up the disk section\n var disks_setup = function(){\n\n $('fieldset',section_disks).hide();\n $('.vm_param', section_disks).hide();\n //$('#image_vs_disk',section_disks).show();\n\n $('#add_disks', section_disks).click(function(){\n $('fieldset',section_disks).toggle();\n return false;\n });\n\n //Auto-set IMAGE_UNAME hidden field value\n $('#IMAGE', section_disks).change(function(){\n var option = $('option:selected',this);\n var uname = getValue(option.attr('elem_id'),1,2,dataTable_images);\n $('input#IMAGE_UNAME',section_disks).val(uname);\n var target = getValue(option.attr('elem_id'),1,12,dataTable_images);\n if (target && target != \"--\")\n $('input#TARGET',section_disks).val(target);\n else\n $('input#TARGET',section_disks).val('');\n var driver = getValue(option.attr('elem_id'),1,13,dataTable_images);\n if (driver && driver != \"--\")\n $('input#DRIVER',section_disks).val(driver);\n else \n $('input#DRIVER',section_disks).val('');\n });\n\n //Depending on adding a disk or a image we need to show/hide\n //different options and make then mandatory or not\n $('#image_vs_disk input',section_disks).click(function(){\n //$('fieldset',section_disks).show();\n $('.vm_param', section_disks).show();\n var select = $(this).val();\n switch (select)\n {\n case \"disk\":\n $('.add_image',section_disks).hide();\n $('.add_image',section_disks).attr('disabled','disabled');\n $('.add_disk',section_disks).show();\n $('.add_disk',section_disks).removeAttr('disabled');\n break;\n case \"image\":\n $('.add_disk',section_disks).hide();\n $('.add_disk',section_disks).attr('disabled','disabled');\n $('.add_image',section_disks).show();\n $('.add_image',section_disks).removeAttr('disabled');\n break;\n }\n $('#SIZE',section_disks).parent().hide();\n $('#SIZE',section_disks).parent().attr('disabled','disabled');\n $('#FORMAT',section_disks).parent().hide();\n $('#SIZE',section_disks).parent().attr('disabled','disabled');\n $('#TYPE :selected',section_disks).removeAttr('selected');\n //hide_disabled(section_disks);\n });\n\n //Depending on the type of disk we need to show/hide\n //different options and make then mandatory or not\n $('select#TYPE',section_disks).change(function(){\n var select = $(this).val();\n switch (select) {\n //size,format,target\n case \"swap\":\n //size mandatory\n $('#SIZE',section_disks).parent().show();\n $('#SIZE',section_disks).parent().removeAttr('disabled');\n $('#SIZE',section_disks).parent().removeClass(opt_class);\n $('#SIZE',section_disks).parent().addClass(man_class);\n\n //target optional\n $('#TARGET',section_disks).parent().removeClass(man_class);\n $('#TARGET',section_disks).parent().addClass(opt_class);\n\n //format hidden\n $('#FORMAT',section_disks).parent().hide();\n $('#FORMAT',section_disks).parent().attr('disabled','disabled');\n\n //source hidden\n $('#SOURCE',section_disks).parent().hide();\n $('#SOURCE',section_disks).parent().\n attr('disabled','disabled');\n break;\n case \"fs\":\n //size mandatory\n $('#SIZE',section_disks).parent().show();\n $('#SIZE',section_disks).parent().removeAttr('disabled');\n $('#SIZE',section_disks).parent().removeClass(opt_class);\n $('#SIZE',section_disks).parent().addClass(man_class);\n\n //target mandatory\n $('#TARGET',section_disks).parent().removeClass(opt_class);\n $('#TARGET',section_disks).parent().addClass(man_class);\n\n //format mandatory\n $('#FORMAT',section_disks).parent().show();\n $('#FORMAT',section_disks).parent().removeAttr('disabled');\n $('#FORMAT',section_disks).parent().removeClass(opt_class);\n $('#FORMAT',section_disks).parent().addClass(man_class);\n\n //source hidden\n $('#SOURCE',section_disks).parent().hide();\n $('#SOURCE',section_disks).parent().\n attr('disabled','disabled');\n break;\n case \"block\":\n //size shown and optional\n $('#SIZE',section_disks).parent().show();\n $('#SIZE',section_disks).parent().removeAttr('disabled');\n $('#SIZE',section_disks).parent().removeClass(man_class);\n $('#SIZE',section_disks).parent().addClass(opt_class);\n\n //target mandatory\n $('#TARGET',section_disks).parent().removeClass(opt_class);\n $('#TARGET',section_disks).parent().addClass(man_class);\n\n //format hidden\n $('#FORMAT',section_disks).parent().hide();\n $('#FORMAT',section_disks).parent().attr('disabled','disabled');\n\n //source hidden\n $('#SOURCE',section_disks).parent().hide();\n $('#SOURCE',section_disks).parent().\n attr('disabled','disabled');\n break;\n case \"floppy\":\n case \"disk\":\n case \"cdrom\":\n default:\n //size hidden\n $('#SIZE',section_disks).parent().hide();\n $('#SIZE',section_disks).parent().attr('disabled','disabled');\n\n //target mandatory\n $('#TARGET',section_disks).parent().removeClass(opt_class);\n $('#TARGET',section_disks).parent().addClass(man_class);\n\n //format optional\n $('#FORMAT',section_disks).parent().hide();\n $('#FORMAT',section_disks).parent().attr('disabled','disabled');\n\n //source shown\n $('#SOURCE',section_disks).parent().show();\n $('#SOURCE',section_disks).parent().\n removeAttr('disabled');\n }\n //hide_disabled(section_disks);\n });\n\n //Our filter for the disks section fields is the standard\n //mandatory filter applied for this section\n var diskFilter = function(){\n return mandatory_filter(section_disks);\n };\n\n $('#add_disk_button',section_disks).click(function(){\n box_add_element(section_disks,'#disks_box',diskFilter);\n return false;\n });\n $('#remove_disk_button',section_disks).click(function(){\n box_remove_element(section_disks,'#disks_box');\n return false;\n });\n\n //preselect now hidden option\n $('#image_vs_disk input#add_image',section_disks).trigger('click');\n\n };\n\n // Sets up the network section\n var networks_setup = function(){\n\n $('.vm_param',section_networks).hide();\n $('.firewall_select',section_networks).hide();\n $('fieldset',section_networks).hide();\n\n $('#add_networks',section_networks).click(function(){\n $('fieldset',section_networks).toggle();\n return false;\n });\n\n //Auto-set IMAGE_UNAME hidden field value\n $('#NETWORK', section_networks).change(function(){\n var option = $('option:selected',this);\n var uname = getValue(option.attr('elem_id'),1,2,dataTable_vNetworks);\n $('input#NETWORK_UNAME',section_networks).val(uname);\n });\n\n //Depending on adding predefined network or not we show/hide\n //some fields\n $('#network_vs_niccfg input',section_networks).click(function(){\n\n //firewall\n $('.firewall',section_networks).hide();\n $('.firewall',section_networks).attr('disabled','disabled');\n/*\n * ezilla 2.0 release ,disable firewall function. waiting for next release. will be opening.\n*/\n// $('.firewall_select',section_networks).show();\n $('.firewall_select select option',section_networks).removeAttr('selected');\n\n select = $(this).val();\n switch (select) {\n case \"network\":\n $('.niccfg',section_networks).hide();\n $('.niccfg',section_networks).attr('disabled','disabled');\n $('.network',section_networks).show();\n $('.network',section_networks).removeAttr('disabled');\n break;\n case \"niccfg\":\n $('.network',section_networks).hide();\n $('.network',section_networks).attr('disabled','disabled');\n $('.niccfg',section_networks).show();\n $('.niccfg',section_networks).removeAttr('disabled');\n break;\n }\n //hide_disabled(section_networks);\n });\n\n $('#black_white_tcp',section_networks).change(function(){\n switch ($(this).val()) {\n case \"whitelist\":\n $('#BLACK_PORTS_TCP',section_networks).parent().attr('disabled','disabled');\n $('#BLACK_PORTS_TCP',section_networks).parent().hide();\n $('#WHITE_PORTS_TCP',section_networks).parent().removeAttr('disabled');\n $('#WHITE_PORTS_TCP',section_networks).parent().show();\n break;\n case \"blacklist\":\n $('#WHITE_PORTS_TCP',section_networks).parent().attr('disabled','disabled');\n $('#WHITE_PORTS_TCP',section_networks).parent().hide();\n $('#BLACK_PORTS_TCP',section_networks).parent().removeAttr('disabled');\n $('#BLACK_PORTS_TCP',section_networks).parent().show();\n break;\n default:\n $('#WHITE_PORTS_TCP',section_networks).parent().attr('disabled','disabled');\n $('#WHITE_PORTS_TCP',section_networks).parent().hide();\n $('#BLACK_PORTS_TCP',section_networks).parent().attr('disabled','disabled');\n $('#BLACK_PORTS_TCP',section_networks).parent().hide();\n };\n });\n\n $('#black_white_udp',section_networks).change(function(){\n switch ($(this).val()) {\n case \"whitelist\":\n $('#BLACK_PORTS_UDP',section_networks).parent().attr('disabled','disabled');\n $('#BLACK_PORTS_UDP',section_networks).parent().hide();\n $('#WHITE_PORTS_UDP',section_networks).parent().removeAttr('disabled');\n $('#WHITE_PORTS_UDP',section_networks).parent().show();\n break;\n case \"blacklist\":\n $('#WHITE_PORTS_UDP',section_networks).parent().attr('disabled','disabled');\n $('#WHITE_PORTS_UDP',section_networks).parent().hide();\n $('#BLACK_PORTS_UDP',section_networks).parent().removeAttr('disabled');\n $('#BLACK_PORTS_UDP',section_networks).parent().show();\n break;\n default:\n $('#WHITE_PORTS_UDP',section_networks).parent().attr('disabled','disabled');\n $('#WHITE_PORTS_UDP',section_networks).parent().hide();\n $('#BLACK_PORTS_UDP',section_networks).parent().attr('disabled','disabled');\n $('#BLACK_PORTS_UDP',section_networks).parent().hide();\n };\n });\n\n //The filter to add a new network checks that we have selected a\n //network, or that the ip or mac are set\n //TODO: Improve this check\n var nicFilter = function(){\n return mandatory_filter(section_networks);\n };\n\n $('#add_nic_button',section_networks).click(function(){\n box_add_element(section_networks,'#nics_box',nicFilter);\n return false;\n });\n $('#remove_nic_button',section_networks).click(function(){\n box_remove_element(section_networks,'#nics_box');\n return false;\n });\n\n //preselect now hidden option\n $('#network_vs_niccfg input#add_network',section_networks).trigger('click');\n };\n\n //Sets up the input section - basicly enabling adding and removing from box\n var inputs_setup = function() {\n \n $('fieldset',section_inputs).hide();\n\n $('#add_inputs',section_inputs).click(function(){\n $('fieldset',section_inputs).toggle();\n return false;\n });\n\n $('#add_input_button',section_inputs).click(function(){\n //no filter\n box_add_element(section_inputs,'#inputs_box',function(){return true});\n return false;\n });\n $('#remove_input_button',section_inputs).click(function(){\n box_remove_element(section_inputs,'#inputs_box');\n return false;\n });\n };\n\n //Set up the graphics section\n var graphics_setup = function(){\n $('fieldset',section_graphics).hide();\n $('.vm_param',section_graphics).hide();\n $('select#TYPE',section_graphics).parent().show();\n\n $('#add_graphics',section_graphics).click(function(){\n $('fieldset',section_graphics).toggle();\n return false;\n });\n\n $('select#TYPE',section_graphics).change(function(){\n g_type = $(this).val();\n switch (g_type) {\n case \"vnc\":\n $('#LISTEN',section_graphics).parent().hide();\n $('#LISTEN',section_graphics).val('0.0.0.0');\n $('#PORT',section_graphics).parent().hide();\n //$('#PASSWD',section_graphics).parent().show();\n $('#KEYMAP',section_graphics).parent().hide();\n $('#PORT',section_graphics).parent().removeAttr('disabled');\n $('#PASSWD',section_graphics).parent().removeAttr('disabled');\n $('#KEYMAP',section_graphics).parent().removeAttr('disabled');\n break;\n case \"sdl\":\n $('#LISTEN',section_graphics).parent().hide();\n $('#LISTEN',section_graphics).val('0.0.0.0');\n $('#PORT',section_graphics).parent().hide();\n $('#PASSWD',section_graphics).parent().hide();\n $('#KEYMAP',section_graphics).parent().hide();\n $('#PORT',section_graphics).parent().attr('disabled','disabled');\n $('#PASSWD',section_graphics).parent().attr('disabled','disabled');\n $('#KEYMAP',section_graphics).parent().attr('disabled','disabled');\n break;\n \t case \"spice\":\n $('#LISTEN',section_graphics).parent().hide();\n $('#LISTEN',section_graphics).val('0.0.0.0');\n $('#PORT',section_graphics).parent().hide();\n //$('#PASSWD',section_graphics).parent().show();\n $('#KEYMAP',section_graphics).parent().hide();\n $('#PORT',section_graphics).parent().removeAttr('disabled');\n $('#PASSWD',section_graphics).parent().removeAttr('disabled');\n $('#KEYMAP',section_graphics).parent().removeAttr('disabled');\n break;\n default:\n $('#LISTEN',section_graphics).parent().hide();\n $('#PORT',section_graphics).parent().hide();\n $('#PASSWD',section_graphics).parent().hide();\n $('#KEYMAP',section_graphics).parent().hide();\n }\n });\n\n };\n\n //Set up the context section - TODO: Apply improvements here...\n var context_setup = function(){\n $('fieldset',section_context).hide();\n\n $('#add_context',section_context).click(function(){\n $('fieldset',section_context).toggle();\n return false;\n });\n\n $('#add_context_button', section_context).click(function(){\n var name = $('#var_name',section_context).val();\n var value = $('#var_value',section_context).val();\n if (!name.length || !value.length) {\n notifyError(tr(\"Context variable name and value must be filled in\"));\n return false;\n }\n option= '<option value=\\''+value+'\\' name=\\''+name+'\\'>'+\n name+'='+value+\n '</option>';\n $('select#context_box',section_context).append(option);\n return false;\n });\n\n $('#remove_context_button', section_context).click(function(){\n box_remove_element(section_context,'#context_box');\n return false;\n });\n };\n\n // Set up the placement section\n var placement_setup = function(){\n $('fieldset',section_placement).hide();\n\n $('#add_placement',section_placement).click(function(){\n $('fieldset',section_placement).toggle();\n return false;\n });\n\n };\n\n // Set up the raw section\n var raw_setup = function(){\n $('fieldset',section_raw).hide();\n\n $('#add_raw',section_raw).click(function(){\n $('fieldset',section_raw).toggle();\n return false;\n });\n };\n\n //set up the custom variables section\n var custom_variables_setup = function(){\n $('fieldset',section_custom_var).hide();\n\n $('#add_custom_var',section_custom_var).click(function(){\n $('fieldset',section_custom_var).toggle();\n return false;\n });\n\n $('#add_custom_var_button', section_custom_var).click(\n function(){\n var name = $('#custom_var_name',section_custom_var).val();\n var value = $('#custom_var_value',section_custom_var).val();\n if (!name.length || !value.length) {\n notifyError(tr(\"Custom variable name and value must be filled in\"));\n return false;\n }\n option= '<option value=\\''+value+'\\' name=\\''+name+'\\'>'+\n name+'='+value+\n '</option>';\n $('select#custom_var_box',section_custom_var).append(option);\n return false;\n });\n\n $('#remove_custom_var_button', section_custom_var).click(\n function(){\n box_remove_element(section_custom_var,'#custom_var_box');\n return false;\n });\n }\n\n //***CREATE VM DIALOG MAIN BODY***\n\n dialogs_context.append('<div title=\"'+tr(\"Create VM Template\")+'\" id=\"create_template_dialog\"></div>');\n $create_template_dialog = $('#create_template_dialog',dialogs_context)\n var dialog = $create_template_dialog;\n\n //Insert HTML in place\n dialog.html(create_template_tmpl);\n\n //Enable tabs\n $('#template_create_tabs',dialog).tabs({\n select:vmTabChange\n });\n\n //Prepare jquery dialog\n var height = Math.floor($(window).height()*0.8); //set height to a percentage of the window\n dialog.dialog({\n autoOpen: false,\n modal: true,\n width: 600,\n height: height\n });\n\n // Enhace buttons\n $('button',dialog).button();\n\n // Re-Setup tips\n setupTips(dialog);\n\n //Enable different icon for folded/unfolded categories\n iconToggle(); //toogle +/- buttons\n\n //Sections, used to stay within their scope\n var section_capacity = $('div#capacity',dialog);\n var section_os_boot = $('div#os_boot_opts',dialog);\n var section_features = $('div#features',dialog);\n var section_disks = $('div#disks',dialog);\n var section_networks = $('div#networks',dialog);\n var section_inputs = $('div#inputs',dialog);\n var section_graphics = $('div#graphics',dialog);\n var section_context = $('div#context',dialog);\n var section_placement = $('div#placement',dialog);\n var section_raw = $('div#raw',dialog);\n var section_custom_var = $('div#custom_var',dialog);\n\n //Different selector for items of kvm and xen (mandatory and optional)\n var items = '.vm_param input,.vm_param select';\n var kvm_man_items = '.kvm input,.kvm select';\n var kvm_opt_items = '.kvm_opt input, .kvm_opt select';\n var kvm_items = kvm_man_items +','+kvm_opt_items;\n var xen_man_items = '.xen input,.xen select';\n var xen_opt_items = '.xen_opt input, .xen_opt select';\n var xen_items = xen_man_items +','+ xen_opt_items;\n var vmware_man_items = '.vmware input,.vmware select';\n var vmware_opt_items = '.vmware_opt input, .vmware_opt select';\n var vmware_items = vmware_man_items +','+ vmware_opt_items;\n\n //Starting template type, optional items class and mandatory items class\n var templ_type = \"kvm\";\n var opt_class=\".kvm_opt\";\n var man_class=\".kvm\";\n //Template RAW sections\n var template_raw=\"\";\n var template_cpuraw=\"\";\n\n vmTabChange(0,{index : 0}); //enable kvm\n\n foldUnfoldToggle();\n\n //initialise all sections\n capacity_setup();\n os_boot_setup();\n features_setup();\n disks_setup();\n networks_setup();\n inputs_setup();\n graphics_setup();\n context_setup();\n placement_setup();\n raw_setup();\n custom_variables_setup();\n\n //Process form\n $('button#create_template_form_easy',dialog).click(function(){\n //validate form\n\n var vm_json = {};\n var name,value,boot_method;\n\n //process capacity options\n var scope = section_capacity;\n\n if (!mandatory_filter(scope)){\n notifyError(tr(\"There are mandatory fields missing in the capacity section\"));\n return false;\n };\n addSectionJSON(vm_json,scope);\n\n //process os_boot_opts\n scope= section_os_boot;\n switch (templ_type){\n case \"xen\":\n boot_method = $('#boot_method option:selected',scope).val();\n if (!boot_method.length){\n notifyError(tr(\"Xen templates must specify a boot method\"));\n return false;}\n };\n\n if (!mandatory_filter(scope)){\n notifyError(tr(\"There are mandatory fields missing in the OS Boot options section\"));\n return false;\n };\n vm_json[\"OS\"] = {};\n addSectionJSON(vm_json[\"OS\"],scope);\n\n //Fetch pae and acpi options\n scope = section_features;\n vm_json[\"FEATURES\"] = {};\n addSectionJSON(vm_json[\"FEATURES\"],scope);\n\n //process disks -> fetch from box\n scope = section_disks;\n vm_json[\"DISK\"] = addBoxJSON(scope,'#disks_box');\n\n //process nics -> fetch from box\n scope = section_networks;\n vm_json[\"NIC\"] = addBoxJSON(scope,'#nics_box');\n\n //process inputs -> fetch from box\n scope = section_inputs;\n vm_json[\"INPUT\"] = [{\"BUS\":\"usb\", \"TYPE\":\"tablet\"}];\n //addBoxJSON(scope,'#inputs_box');\n\n //process graphics -> fetch fields with value\n scope = section_graphics;\n \tvm_json[\"GRAPHICS\"] = {};\n \taddSectionJSON(vm_json[\"GRAPHICS\"],scope);\n //context\n //\n \n\n scope = section_context;\n vm_json[\"CONTEXT\"] = {};\n $('#context_box option',scope).each(function(){\n name = $(this).attr('name');\n value = $(this).val();\n vm_json[\"CONTEXT\"][name]=value;\n });\n var nic_id = 0;\n $.each(vm_json[\"NIC\"],function(){\n var vnet_id = this[\"NETWORK\"]\n var eth_str = \"ETH\"+nic_id+\"_\"\n var net_str = 'NETWORK=\\\\\"'+ vnet_id +'\\\\\"'\n\n vm_json[\"CONTEXT\"][eth_str+\"IP\"] = \"$NIC[IP,\"+ net_str +\"]\";\n vm_json[\"CONTEXT\"][eth_str+\"NETOWRK\"] = \"$NETWORK[NETWORK_ADDRESS,\"+ net_str +\"]\";\n vm_json[\"CONTEXT\"][eth_str+\"MASK\"] = \"$NETWORK[NETWORK_MASK,\"+ net_str +\"]\";\n vm_json[\"CONTEXT\"][eth_str+\"GATEWAY\"] = \"$NETWORK[GATEWAY,\"+ net_str +\"]\";\n vm_json[\"CONTEXT\"][eth_str+\"DNS\"] = \"$NETWORK[DNS,\"+ net_str +\"]\";\n nic_id++;\n }); \n\n\n scope = section_capacity;\n vm_json[\"CONTEXT\"][\"OSTYPE\"]=$('#ostype option:selected',scope).val();\n var vcpu_num=$('input#VCPU',scope).val();\n\n //placement -> fetch with value, escape double quotes\n scope = section_placement;\n var requirements = $('input#REQUIREMENTS',scope).val();\n requirements = escapeDoubleQuotes(requirements);\n $('input#REQUIREMENTS',scope).val(requirements);\n var rank = $('input#RANK',scope).val();\n rank = escapeDoubleQuotes(rank);\n $('input#RANK',scope).val(rank);\n addSectionJSON(vm_json,scope);\n\n //for windows 7 vcpu cores\n template_cpuraw += \" <cpu>\\n\";\n template_cpuraw += \" \t<topology sockets='1' cores='\" + vcpu_num + \"' threads='1'/>\\n\";\n template_cpuraw += \" </cpu>\\n\";\n //raw -> if value set type to driver and fetch\n\n template_raw += \" <devices>\\n\";\n template_raw += \" <controller type=\\'usb\\' index=\\'0\\' model=\\'ich9-ehci1\\'>\\n\";\n template_raw += \" <address type=\\'pci\\' domain=\\'0x0000\\' bus=\\'0x00\\' slot=\\'0x08\\' function=\\'0x7\\'/>\\n\";\n template_raw += \" </controller>\\n\";\n template_raw += \" <controller type=\\'usb\\' index=\\'0\\' model=\\'ich9-uhci1\\'>\\n\";\n template_raw += \" <master startport=\\'0\\'/>\\n\";\n template_raw += \" <address type=\\'pci\\' domain=\\'0x0000\\' bus=\\'0x00\\' slot=\\'0x08\\' function=\\'0x0\\' multifunction=\\'on\\'/>\\n\";\n template_raw += \" </controller>\\n\";\n template_raw += \" <controller type=\\'usb\\' index=\\'0\\' model=\\'ich9-uhci2\\'>\\n\";\n template_raw += \" <master startport=\\'2\\'/>\\n\";\n template_raw += \" <address type=\\'pci\\' domain=\\'0x0000\\' bus=\\'0x00\\' slot=\\'0x08\\' function=\\'0x1\\'/>\\n\";\n template_raw += \" </controller>\\n\";\n template_raw += \" <controller type=\\'usb\\' index=\\'0\\' model=\\'ich9-uhci3\\'>\\n\";\n template_raw += \" <master startport=\\'4\\'/>\\n\";\n template_raw += \" <address type=\\'pci\\' domain=\\'0x0000\\' bus=\\'0x00\\' slot=\\'0x08\\' function=\\'0x2\\'/>\\n\";\n template_raw += \" </controller>\\n\";\n template_raw += \" <redirdev bus=\\'usb\\' type=\\'spicevmc\\'>\\n\";\n template_raw += \" <address type=\\'usb\\' bus=\\'0\\' port=\\'3\\'/>\\n\";\n template_raw += \" </redirdev>\\n\";\n template_raw += \" <redirdev bus=\\'usb\\' type=\\'spicevmc\\'>\\n\";\n template_raw += \" <address type=\\'usb\\' bus=\\'0\\' port=\\'4\\'/>\\n\";\n template_raw += \" </redirdev>\\n\";\n template_raw += \" <redirdev bus=\\'usb\\' type=\\'spicevmc\\'>\\n\";\n template_raw += \" <address type=\\'usb\\' bus=\\'0\\' port=\\'5\\'/>\\n\";\n template_raw += \" </redirdev>\\n\";\n template_raw += \" <redirdev bus=\\'usb\\' type=\\'spicevmc\\'>\\n\";\n template_raw += \" <address type=\\'usb\\' bus=\\'0\\' port=\\'6\\'/>\\n\";\n template_raw += \" </redirdev>\\n\";\n template_raw += \" </devices>\\n\";\n\t\n\tscope = section_raw;\n\tvm_json[\"RAW\"] = {};\n \n\t//SPICE for usb redirction\n\tif ($('select#TYPE',section_graphics).val() == \"spice\"){\n \t\taddSectionJSON(vm_json[\"RAW\"],scope);\n\t\tvm_json[\"RAW\"][\"TYPE\"]=\"KVM\";\n\t\tvm_json[\"RAW\"][\"DATA\"]=template_cpuraw+template_raw;\n\t}else{\n //raw -> if value set type to driver and fetch\n \t\taddSectionJSON(vm_json[\"RAW\"],scope);\n\t\tvm_json[\"RAW\"][\"TYPE\"]=\"KVM\";\n vm_json[\"RAW\"][\"DATA\"]=template_cpuraw;\n\t}\n\n //custom vars\n scope = section_custom_var;\n $('#custom_var_box option',scope).each(function(){\n name = $(this).attr('name');\n value = $(this).val();\n vm_json[name]=value;\n });\n\n // remove empty elements\n vm_json = removeEmptyObjects(vm_json);\n\n //wrap it in the \"vmtemplate\" object\n vm_json = {vmtemplate: vm_json};\n\n\n Sunstone.runAction(\"Template.create\",vm_json);\n\n $create_template_dialog.dialog('close');\n return false;\n });\n\n //Handle manual forms\n $('button#create_template_form_manual',$create_template_dialog).click(function(){\n var template = $('textarea#textarea_vm_template',$create_template_dialog).val();\n\n //wrap it in the \"vm\" object\n template = {\"vmtemplate\": {\"template_raw\": template}};\n\n Sunstone.runAction(\"Template.create\",template);\n $create_template_dialog.dialog('close');\n return false;\n });\n\n //Reset form - empty boxes\n $('button#reset_vm_form',dialog).click(function(){\n $('select#disks_box option',section_disks).remove();\n $('select#nics_box option',section_networks).remove();\n// $('select#inputs_box option',section_inputs).remove();\n $('select#custom_var_box option',section_custom_var).remove();\n return true;\n });\n}", "function setupCreateVMDialog(){\n\n //Helper functions for the dialog operations\n\n // Called when changing tabs. Since we use the same form for both\n // KVM, XEN and others we need to do some operation to update it\n var vmTabChange = function(event,ui){\n\t// ui.tab // anchor element of the selected (clicked) tab\n\t// ui.panel // element, that contains the selected/clicked tab contents\n\t// ui.index // zero-based index of the selected (clicked) tab\n switch(ui.index){\n case 0:\n enable_kvm();\n break;\n case 1:\n enable_xen();\n break;\n case 2:\n break;\n case 3:\n break;\n }\n }\n\n //Using kvm wizard. Updates mandatory tag, optional tags, disable\n //XEN-only (and others) items, enables KVM items\n\tvar enable_kvm = function(){\n\t\tman_class=\"kvm\";\n\t\topt_class=\"kvm_opt\";\n\t\t$(xen_items).attr(\"disabled\",\"disabled\");\n\t\t$(kvm_items).removeAttr(\"disabled\");\n\t\t//$(items+':disabled').hide();\n\n\n\t\t//KVM particularities:\n // * Add no_type option for disks\n // * Add driver default option for boot and select it - hide some fields\n // * Set the raw type to kvm\n // * Show the inputs section\n\t\t$('div#disks select#TYPE option:selected').removeAttr(\"selected\");\n\t\t$('div#disks select#TYPE').prepend(\n\t\t'<option id=\"no_type\" value=\"\">None</option>');\n\t\t$('div#disks select#TYPE option#no_type').attr(\"selected\",\"selected\");\n\n $('select#boot_method option').removeAttr(\"selected\");\n\t\t$('select#boot_method option#no_boot').html(\"Driver default\");\n $('select#boot_method option').removeAttr(\"selected\");\n $('.kernel, .bootloader', $('div#os_boot_opts')).hide();\n\n $('div#disks select#BUS').append(\n '<option id=\"virtio\" value=\"virtio\">virtio</option>');\n\n\n\n\t\t$('input#TYPE', section_raw).val(\"kvm\");\n\n\t\t$(section_inputs).show();\n\t};\n\n // Using XEN wizard. Update mandatory and optional classes, disable\n // KVM-only (and other) items, enable XEN fields...\n\tenable_xen = function(){\n\t\tman_class=\"xen\";\n\t\topt_class=\"xen_opt\";\n\t\t$(kvm_items).attr(\"disabled\",\"disabled\");\n\t\t$(kvm_items).css(\"background\",\"\");\n\t\t$(xen_items).removeAttr(\"disabled\");\n\t\t//$(items+':disabled').hide();\n\n\n\t\t// XEN particularities:\n // * Remove no_type option from disks\n // * Remove driver default boot method\n // * Set the raw section to XEN\n // * Hide the inputs section\n\t\t$('div#disks select#TYPE option#no_type').remove();\n\n\t\t$('select#boot_method option:selected').removeAttr(\"selected\");\n $('select#boot_method option#no_boot').html(\"Please choose\");\n\t\t$('.kernel, .bootloader', $('div#os_boot_opts')).hide();\n\n $('div#disks select#BUS option#virtio').remove();\n\n\t\t$('input#TYPE', section_raw).val(\"xen\");\n\t\t$(section_inputs).hide(); //not present for xen\n\t};\n\n //This function checks that all mandatory items within a section\n //have some value. Returns true if so, false if not.\n\tvar mandatory_filter = function(context){\n\t\t\tvar man_items = \".\"+man_class;\n\n\t\t\t//find enabled mandatory items in this context\n\t\t\tman_items = $(man_items+' input:visible, '+man_items+' select:visible',context);\n\t\t\tvar r = true;\n \n //we fail it the item is enabled and has no value\n\t\t\t$.each(man_items,function(){\n\t\t\t\tif ($(this).parents(\".vm_param\").attr(\"disabled\") ||\n\t\t\t\t\t!($(this).val().length)) {\n\t\t\t\t\tr = false;\n\t\t\t\t\treturn false;\n\t\t\t\t};\n\t\t\t});\n\t\t\treturn r;\n\n\t\t};\n\n //Adds an option element to a multiple select box. Before doing so,\n //it checks that the desired filter is passed\n\tvar box_add_element = function(context,box_tag,filter){\n\t\t\tvar value=\"\";\n\t\t\tvar params= $('.vm_param',context);\n\t\t\tvar inputs= $('input:enabled',params);\n\t\t\tvar selects = $('select:enabled',params);\n\t\t\tvar fields = $.merge(inputs,selects);\n\n\t\t\t//are fields passing the filter?\n\t\t\tvar result = filter();\n\t\t\tif (!result) {\n\t\t\t\tnotifyError(\"There are mandatory parameters missing in this section\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvalue={};\n \n //With each enabled field we form a JSON object\n var id = null;\n\t\t\t$.each(fields,function(){\n\t\t\t\tif (!($(this).parents(\".vm_param\").attr(\"disabled\")) &&\n\t\t\t\t\t$(this).val().length){\n //Pick up parent's ID if we do not have one \n\t\t\t\t\tid = $(this).attr('id').length ? $(this).attr('id') : $(this).parent().attr('id');\n\t\t\t\t\tvalue[id] = $(this).val();\n\t\t\t\t}\n\t\t\t});\n\t\t\tvar value_string = JSON.stringify(value);\n\t\t\tvar option= '<option value=\\''+value_string+'\\'>'+\n\t\t\t\t\tstringJSON(value)+\n\t\t\t\t\t'</option>';\n\t\t\t$('select'+box_tag,context).append(option);\n\t\t\treturn false;\n\t};\n\n //Removes selected elements from a multiple select box\n\tvar box_remove_element = function(section_tag,box_tag){\n\t\t\tvar context = $(section_tag);\n\t\t\t$('select'+box_tag+' :selected',context).remove();\n\t\t\treturn false;\n\t};\n\n //Given the JSON of a VM template (or of a section of it), it crawls\n //the fields of certain section (context) and add their name and \n //values to the template JSON.\n\tvar addSectionJSON = function(template_json,context){\n\t\t\tvar params= $('.vm_param',context);\n\t\t\tvar inputs= $('input:enabled',params);\n\t\t\tvar selects = $('select:enabled',params);\n\t\t\tvar fields = $.merge(inputs,selects);\n\n\t\t\tfields.each(function(){\n\t\t\t\tif (!($(this).parents(\".vm_param\").attr(\"disabled\"))){ //if ! disabled\n\t\t\t\t\tif ($(this).val().length){ //if has a length\n\t\t\t\t\t\ttemplate_json[$(this).attr('id')]=$(this).val();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t}\n\n // Given an array (usually empty), a section (context) and a tag for\n // a multiple select in that section, it adds the contents of the \n // box as objects in the array.\n // TODO: Make it return a new array?\n\tvar addBoxJSON = function(array,context,box_tag){\n\t\t$('select'+box_tag+' option',context).each(function(){\n\t\t\t\tarray.push( JSON.parse($(this).val()) );\n\t\t});\n\t}\n\n //Given an object, removes those elements which are empty\n //Used to clean up a template JSON before submitting \n //it to opennebula.js\n var removeEmptyObjects = function(obj){\n for (elem in obj){\n var remove = false;\n var value = obj[elem];\n if (value instanceof Array)\n {\n if (value.length == 0)\n remove = true;\n }\n else if (value instanceof Object)\n {\n var obj_length = 0;\n for (e in value)\n obj_length += 1;\n if (obj_length == 0)\n remove = true;\n }\n else\n {\n value = String(value);\n if (value.length == 0)\n remove = true;\n }\n if (remove)\n delete obj[elem];\n }\n return obj;\n }\n\n //Toggles the icon when a section is folded/unfolded\n\tvar iconToggle = function(){\n\t\t$('.icon_right').toggle(\n\t\t\tfunction(e){\n\t\t\t\t$('span',e.currentTarget).removeClass(\"ui-icon-plusthick\");\n\t\t\t\t$('span',e.currentTarget).addClass(\"ui-icon-minusthick\");\n\t\t\t},function(e){\n\t\t\t\t$('span',e.currentTarget).removeClass(\"ui-icon-minusthick\");\n\t\t\t\t$('span',e.currentTarget).addClass(\"ui-icon-plusthick\");\n\t\t\t});\n\t}\n\n // Set ups the capacity section\n\tvar capacity_setup = function(){\n //Actually there is nothing to set up, but it used to be\n //possible to hide it like others\n /*\n\t\t$('fieldset',section_capacity).hide();\n\t\t$('#add_capacity',section_capacity).click(function(){\n\t\t\t\t$('fieldset',section_capacity).toggle();\n\t\t\t\treturn false;\n\t\t});\n */\n\n\t}\n \n //Sets up the OS_BOOT section\n\tvar os_boot_setup = function(){\n\t\t$('fieldset',section_os_boot).hide();\n\t\t$('.bootloader, .kernel',section_os_boot).hide();\n\n\t\t$('#add_os_boot_opts',section_os_boot).click(function(){\n\t\t\t$('fieldset',section_os_boot).toggle();\n return false;\n\t\t});\n\n\n //Chrome workaround\n $('#boot_method').change(function(){\n $(this).trigger(\"click\");\n });\n\n //Depending on the boot method we enable/disable some options\n $('#boot_method',section_os_boot).click(function(){\n\t\t\tselect = $(this).val();\n\t\t\tswitch (select)\n\t\t\t{\n\t\t\t\tcase \"kernel\":\n\t\t\t\t\t$('.bootloader',section_os_boot).hide();\n\t\t\t\t\t$('.bootloader',section_os_boot).attr(\"disabled\",\"disabled\");\n\t\t\t\t\t$('.kernel',section_os_boot).show();\n\t\t\t\t\t$('.kernel',section_os_boot).removeAttr(\"disabled\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"bootloader\":\n\t\t\t\t\t$('.kernel',section_os_boot).hide();\n\t\t\t\t\t$('.kernel',section_os_boot).attr(\"disabled\",\"disabled\");\n\t\t\t\t\t$('.bootloader',section_os_boot).show();\n\t\t\t\t\t$('.bootloader',section_os_boot).removeAttr(\"disabled\");\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$('.kernel, .bootloader',section_os_boot).hide();\n\t\t\t\t\t$('.kernel, .bootloader',section_os_boot).attr(\"disabled\",\"disabled\");\n\t\t\t\t\t$('.kernel input, .bootloader input',section_os_boot).val(\"\");\n\t\t\t};\n\t\t});\n\t};\n\n // Sets up the disk section\n\tvar disks_setup = function(){\n\n\t\t$('fieldset',section_disks).hide();\n\t\t$('.vm_param', section_disks).hide();\n\t\t//$('#image_vs_disk',section_disks).show();\n\n\t\t$('#add_disks', section_disks).click(function(){\n\t\t\t$('fieldset',section_disks).toggle();\n return false;\n\t\t});\n\n //Depending on adding a disk or a image we need to show/hide\n //different options and make then mandatory or not\n\t\t$('#image_vs_disk input',section_disks).click(function(){\n\t\t\t//$('fieldset',section_disks).show();\n $('.vm_param', section_disks).show();\n\t\t\tvar select = $('#image_vs_disk :checked',section_disks).val();\n\t\t\tswitch (select)\n\t\t\t{\n\t\t\t\tcase \"disk\":\n\t\t\t\t\t$('.add_image',section_disks).hide();\n\t\t\t\t\t$('.add_image',section_disks).attr(\"disabled\",\"disabled\");\n\t\t\t\t\t$('.add_disk',section_disks).show();\n\t\t\t\t\t$('.add_disk',section_disks).removeAttr(\"disabled\");\n\t\t\t\t\t$('#TARGET',section_disks).parent().removeClass(opt_class);\n\t\t\t\t\t$('#TARGET',section_disks).parent().addClass(man_class);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"image\":\n\t\t\t\t\t$('.add_disk',section_disks).hide();\n\t\t\t\t\t$('.add_disk',section_disks).attr(\"disabled\",\"disabled\");\n\t\t\t\t\t$('.add_image',section_disks).show();\n\t\t\t\t\t$('.add_image',section_disks).removeAttr(\"disabled\");\n\t\t\t\t\t$('#TARGET',section_disks).parent().removeClass(man_class);\n\t\t\t\t\t$('#TARGET',section_disks).parent().addClass(opt_class);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$('#SIZE',section_disks).parent().hide();\n\t\t\t$('#SIZE',section_disks).parent().attr(\"disabled\",\"disabled\");\n\t\t\t$('#FORMAT',section_disks).parent().hide();\n\t\t\t$('#SIZE',section_disks).parent().attr(\"disabled\",\"disabled\");\n\t\t\t$('#TYPE :selected',section_disks).removeAttr(\"selected\");\n\t\t});\n\n //Chrome workaround\n $('select#TYPE',section_disks).change(function(){\n $(this).trigger('click');\n });\n\n //Depending on the type of disk we need to show/hide\n //different options and make then mandatory or not\n\t\t$('select#TYPE',section_disks).click(function(){\n\t\t\tvar select = $(this).val();\n\t\t\tswitch (select) {\n\t\t\t\t//size,format,target\n\t\t\t\tcase \"swap\":\n\t\t\t\t\t//size mandatory\n\t\t\t\t\t$('#SIZE',section_disks).parent().show();\n\t\t\t\t\t$('#SIZE',section_disks).parent().removeAttr(\"disabled\");\n\t\t\t\t\t$('#SIZE',section_disks).parent().removeClass(opt_class);\n\t\t\t\t\t$('#SIZE',section_disks).parent().addClass(man_class);\n\n\t\t\t\t\t//target optional\n\t\t\t\t\t$('#TARGET',section_disks).parent().removeClass(man_class);\n\t\t\t\t\t$('#TARGET',section_disks).parent().addClass(opt_class);\n\n\t\t\t\t\t//format hidden\n\t\t\t\t\t$('#FORMAT',section_disks).parent().hide();\n\t\t\t\t\t$('#FORMAT',section_disks).parent().attr(\"disabled\",\"disabled\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"fs\":\n\t\t\t\t\t//size mandatory\n\t\t\t\t\t$('#SIZE',section_disks).parent().show();\n\t\t\t\t\t$('#SIZE',section_disks).parent().removeAttr(\"disabled\");\n\t\t\t\t\t$('#SIZE',section_disks).parent().removeClass(opt_class);\n\t\t\t\t\t$('#SIZE',section_disks).parent().addClass(man_class);\n\n\t\t\t\t\t//target mandatory\n\t\t\t\t\t$('#TARGET',section_disks).parent().removeClass(opt_class);\n\t\t\t\t\t$('#TARGET',section_disks).parent().addClass(man_class);\n\n\t\t\t\t\t//format mandatory\n\t\t\t\t\t$('#FORMAT',section_disks).parent().show();\n\t\t\t\t\t$('#FORMAT',section_disks).parent().removeAttr(\"disabled\");\n\t\t\t\t\t$('#FORMAT',section_disks).parent().removeClass(opt_class);\n\t\t\t\t\t$('#FORMAT',section_disks).parent().addClass(man_class);\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"block\":\n\t\t\t\t\t//size shown and optional\n\t\t\t\t\t$('#SIZE',section_disks).parent().show();\n\t\t\t\t\t$('#SIZE',section_disks).parent().removeAttr(\"disabled\");\n\t\t\t\t\t$('#SIZE',section_disks).parent().removeClass(man_class);\n\t\t\t\t\t$('#SIZE',section_disks).parent().addClass(opt_class);\n\n\t\t\t\t\t//target mandatory\n\t\t\t\t\t$('#TARGET',section_disks).parent().removeClass(opt_class);\n\t\t\t\t\t$('#TARGET',section_disks).parent().addClass(man_class);\n\n\t\t\t\t\t//format hidden\n\t\t\t\t\t$('#FORMAT',section_disks).parent().hide();\n\t\t\t\t\t$('#FORMAT',section_disks).parent().attr(\"disabled\",\"disabled\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"floppy\":\n\t\t\t\tcase \"disk\":\n\t\t\t\tcase \"cdrom\":\n default:\n\t\t\t\t\t//size hidden\n\t\t\t\t\t$('#SIZE',section_disks).parent().hide();\n\t\t\t\t\t$('#SIZE',section_disks).parent().attr(\"disabled\",\"disabled\");\n\n\t\t\t\t\t//target mandatory\n\t\t\t\t\t$('#TARGET',section_disks).parent().removeClass(opt_class);\n\t\t\t\t\t$('#TARGET',section_disks).parent().addClass(man_class);\n\n\t\t\t\t\t//format optional\n\t\t\t\t $('#FORMAT',section_disks).parent().hide();\n\t\t\t\t $('#FORMAT',section_disks).parent().attr(\"disabled\",\"disabled\");\n\t\t\t}\n\t\t});\n\n //Our filter for the disks section fields is the mandatory\n //filter for this section\n\t\tvar diskFilter = function(){\n\t\t\treturn mandatory_filter(section_disks);\n\t\t};\n\n\t\t$('#add_disk_button',section_disks).click(function(){\n\t\t\tbox_add_element(section_disks,'#disks_box',diskFilter);\n\t\t\treturn false;\n\t\t\t});\n\t\t$('#remove_disk_button',section_disks).click(function(){\n\t\t\tbox_remove_element(section_disks,'#disks_box');\n\t\t\treturn false;\n\t\t\t});\n\t};\n\n // Sets up the network section\n\tvar networks_setup = function(){\n\n\t\t$('.vm_param',section_networks).hide();\n\t\t$('fieldset',section_networks).hide();\n\n\t\t$('#add_networks',section_networks).click(function(){\n\t\t\t$('fieldset',section_networks).toggle();\n return false;\n\t\t});\n\n //Depending on adding predefined network or not we show/hide\n //some fields\n\t\t$('#network_vs_niccfg input',section_networks).click(function(){\n\n\t\t\tselect = $('#network_vs_niccfg :checked',section_networks).val();\n\t\t\tswitch (select) {\n\t\t\t\tcase \"network\":\n\t\t\t\t\t$('.niccfg',section_networks).hide();\n\t\t\t\t\t$('.niccfg',section_networks).attr(\"disabled\",\"disabled\");\n\t\t\t\t\t$('.network',section_networks).show();\n\t\t\t\t\t$('.network',section_networks).removeAttr(\"disabled\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"niccfg\":\n\t\t\t\t\t$('.network',section_networks).hide();\n\t\t\t\t\t$('.network',section_networks).attr(\"disabled\",\"disabled\");\n\t\t\t\t\t$('.niccfg',section_networks).show();\n\t\t\t\t\t$('.niccfg',section_networks).removeAttr(\"disabled\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\n //The filter to add a new network checks that we have selected a \n //network, or that the ip or mac are set\n //TODO: Improve this check\n var nicFilter = function(){\n return mandatory_filter(section_networks);\n };\n\n\t\t$('#add_nic_button',section_networks).click(function(){\n\t\t\tbox_add_element(section_networks,'#nics_box',nicFilter);\n\t\t\treturn false;\n\t\t\t});\n\t\t$('#remove_nic_button',section_networks).click(function(){\n\t\t\tbox_remove_element(section_networks,'#nics_box');\n\t\t\treturn false;\n\t\t\t});\n\n\t};\n\n //Sets up the input section - basicly enabling adding and removing from box\n\tvar inputs_setup = function() {\n\t\t$('fieldset',section_inputs).hide();\n\n\t\t$('#add_inputs',section_inputs).click(function(){\n\t\t\t\t$('fieldset',section_inputs).toggle();\n return false;\n\t\t});\n\n\t\t$('#add_input_button',section_inputs).click(function(){\n\t\t\t//no filter\n\t\t\tbox_add_element(section_inputs,'#inputs_box',True);\n\t\t\treturn false;\n\t\t\t});\n\t\t$('#remove_input_button',section_inputs).click(function(){\n\t\t\tbox_remove_element(section_inputs,'#inputs_box');\n\t\t\treturn false;\n\t\t\t});\n\t};\n \n //Set up the graphics section\n\tvar graphics_setup = function(){\n\t\t$('fieldset',section_graphics).hide();\n $('.vm_param',section_graphics).hide();\n $('select#TYPE',section_graphics).parent().show();\n\n\t\t$('#add_graphics',section_graphics).click(function(){\n\t\t\t$('fieldset',section_graphics).toggle();\n return false;\n\t\t});\n\n //Chrome workaround\n $('select#TYPE',section_graphics).change(function(){\n $(this).trigger(\"click\");\n });\n\t\t$('select#TYPE',section_graphics).click(function(){\n\t\t\tg_type = $(this).val();\n\t\t\tswitch (g_type) {\n\t\t\t\tcase \"vnc\":\n $('#LISTEN',section_graphics).parent().show();\n\t\t\t\t\t$('#PORT',section_graphics).parent().show();\n\t\t\t\t\t$('#PASSWD',section_graphics).parent().show();\n\t\t\t\t\t$('#KEYMAP',section_graphics).parent().show();\n\t\t\t\t\t$('#PORT',section_graphics).parent().removeAttr(\"disabled\");\n\t\t\t\t\t$('#PASSWD',section_graphics).parent().removeAttr(\"disabled\");\n\t\t\t\t\t$('#KEYMAP',section_graphics).parent().removeAttr(\"disabled\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"sdl\":\n $('#LISTEN',section_graphics).parent().show();\n\t\t\t\t\t$('#PORT',section_graphics).parent().hide();\n\t\t\t\t\t$('#PASSWD',section_graphics).parent().hide();\n\t\t\t\t\t$('#KEYMAP',section_graphics).parent().hide();\n\t\t\t\t\t$('#PORT',section_graphics).parent().attr(\"disabled\",\"disabled\");\n\t\t\t\t\t$('#PASSWD',section_graphics).parent().attr(\"disabled\",\"disabled\");\n\t\t\t\t\t$('#KEYMAP',section_graphics).parent().attr(\"disabled\",\"disabled\");\n\t\t\t\t\tbreak;\n default:\n $('#LISTEN',section_graphics).parent().hide();\n\t\t\t\t\t$('#PORT',section_graphics).parent().hide();\n\t\t\t\t\t$('#PASSWD',section_graphics).parent().hide();\n\t\t\t\t\t$('#KEYMAP',section_graphics).parent().hide();\n\n\t\t\t}\n\t\t});\n\n\t}\n\n //Set up the context section - TODO: Apply improvements here...\n\tvar context_setup = function(){\n\t\t$('fieldset',section_context).hide();\n\n\t\t$('#add_context',section_context).click(function(){\n $('fieldset',section_context).toggle();\n return false;\n\t\t});\n \n $('#add_context_button', section_context).click(function(){\n var name = $('#var_name',section_context).val();\n var value = $('#var_value',section_context).val();\n if (!name.length || !value.length) {\n notifyError(\"Context variable name and value must be filled in\");\n return false;\n }\n option= '<option value=\\''+value+'\\' name=\\''+name+'\\'>'+\n name+'='+value+\n '</option>';\n $('select#context_box',section_context).append(option);\n return false; \n });\n \n $('#remove_context_button', section_context).click(function(){\n box_remove_element(section_context,'#context_box');\n return false; \n });\n\n\n\t};\n\n // Set up the placement section\n\tvar placement_setup = function(){\n\t\t$('fieldset',section_placement).hide();\n\n\t\t$('#add_placement',section_placement).click(function(){\n\t\t\t\t$('fieldset',section_placement).toggle();\n return false;\n\t\t});\n\n\t};\n\n // Set up the raw section\n\tvar raw_setup = function(){\n\t\t$('fieldset',section_raw).hide();\n\n\t\t$('#add_raw',section_raw).click(function(){\n\t\t\t\t$('fieldset',section_raw).toggle();\n return false;\n\t\t});\n\t};\n \n //***CREATE VM DIALOG MAIN BODY***\n \n $('div#dialogs').append('<div title=\"Create Virtual Machine\" id=\"create_vm_dialog\"></div>');\n\t//Insert HTML in place\n\t$('#create_vm_dialog').html(create_vm_tmpl);\n //Enable tabs\n\t$('#vm_create_tabs').tabs({\n select:vmTabChange\n });\n\n\t//Prepare jquery dialog\n var height = Math.floor($(window).height()*0.8); //set height to a percentage of the window\n\t$('#create_vm_dialog').dialog({\n\t\tautoOpen: false,\n\t\tmodal: true,\n\t\twidth: 700,\n height: height\n\t});\n \n // Enhace buttons\n $('#create_vm_dialog button').button();\n \n //Enable different icon for folded/unfolded categories\n iconToggle(); //toogle +/- buttons\n\n\t//Sections, used to stay within their scope\n\tvar section_capacity = $('#capacity');\n\tvar section_os_boot = $('#os_boot_opts');\n\tvar section_disks = $('#disks');\n\tvar section_networks = $('#networks');\n\tvar section_inputs = $('#inputs');\n\tvar section_graphics = $('#graphics');\n\tvar section_context = $('#context');\n\tvar section_placement = $('#placement');\n\tvar section_raw = $('#raw');\n\n\t//Different selector for items of kvm and xen (mandatory and optional)\n\tvar items = '.vm_section input,.vm_section select';\n\tvar kvm_man_items = '.kvm input,.kvm select';\n\tvar kvm_opt_items = '.kvm_opt input, .kvm_opt select';\n\tvar kvm_items = kvm_man_items +','+kvm_opt_items;\n\tvar xen_man_items = '.xen input,.xen select';\n\tvar xen_opt_items = '.xen_opt input, .xen_opt select';\n\tvar xen_items = xen_man_items +','+ xen_opt_items;\n\n\t//Starting template type, optional items class and mandatory items class\n\tvar templ_type = \"kvm\";\n\tvar opt_class=\".kvm_opt\";\n\tvar man_class=\".kvm\";\n\n\tenable_kvm(); //enable all kvm options\n\n //Fold/unfold all sections button\n $('#fold_unfold_vm_params').toggle(\n function(){\n $('.vm_section fieldset').show();\n return false;\n },\n function(){\n $('.vm_section fieldset').hide();\n $('.vm_section fieldset').first().show(); //Show capacity opts\n return false;\n });\n\n //initialise all sections\n\tcapacity_setup();\n\tos_boot_setup();\n\tdisks_setup();\n\tnetworks_setup();\n\tinputs_setup();\n\tgraphics_setup();\n\tcontext_setup();\n\tplacement_setup();\n\traw_setup();\n\n //Process form\n\t$('button#create_vm_form_easy').click(function(){\n\t\t//validate form\n\n\t\tvar vm_json = {};\n\n\t\t//process capacity options\n\t\tvar scope = section_capacity;\n\n\t\tif (!mandatory_filter(scope)){\n\t\t\tnotifyError(\"There are mandatory fields missing in the capacity section\");\n\t\t\treturn false;\n\t\t};\n\t\taddSectionJSON(vm_json,scope);\n\n\t\t//process os_boot_opts\n\t\tscope= section_os_boot;\n\t\tswitch (templ_type){\n\t\t\tcase \"xen\":\n boot_method = $('#boot_method option:selected',scope).val();\n\t\t\t\tif (!boot_method.length){\n\t\t\t\t\tnotifyError(\"Xen templates must specify a boot method\");\n\t\t\t\t\treturn false;}\n\t\t};\n\n\t\tif (!mandatory_filter(scope)){\n\t\t\tnotifyError(\"There are mandatory fields missing in the OS Boot options section\");\n\t\t\treturn false;\n\t\t};\n vm_json[\"OS\"] = {};\n\t\taddSectionJSON(vm_json[\"OS\"],scope);\n\n\t\t//process disks -> fetch from box\n\t\tscope = section_disks;\n\t\tvm_json[\"DISK\"] = [];\n\t\taddBoxJSON(vm_json[\"DISK\"],scope,'#disks_box');\n\n\t\t//process nics -> fetch from box\n\t\tscope = section_networks;\n\t\tvm_json[\"NIC\"] = [];\n\t\taddBoxJSON(vm_json[\"NIC\"],scope,'#nics_box');\n\n\t\t//process inputs -> fetch from box\n\t\tscope = section_inputs;\n\t\tvm_json[\"INPUT\"] = [];\n\t\taddBoxJSON(vm_json[\"INPUT\"],scope,'#inputs_box');\n\n\t\t//process graphics -> fetch fields with value\n\t\tscope = section_graphics;\n\t\tvm_json[\"GRAPHICS\"] = {};\n\t\taddSectionJSON(vm_json[\"GRAPHICS\"],scope);\n\n //context\n scope = section_context;\n var context = $('#CONTEXT',scope).val();\n vm_json[\"CONTEXT\"] = {};\n $('#context_box option',scope).each(function(){\n name = $(this).attr(\"name\");\n value = $(this).val();\n vm_json[\"CONTEXT\"][name]=value;\n });\n\n\t\t//placement -> fetch with value\n\t\tscope = section_placement;\n\t\taddSectionJSON(vm_json,scope);\n\n\t\t//raw -> if value set type to driver and fetch\n\t\tscope = section_raw;\n\t\tvm_json[\"RAW\"] = {};\n\t\taddSectionJSON(vm_json[\"RAW\"],scope);\n\n // remove empty elements\n vm_json = removeEmptyObjects(vm_json);\n\n //wrap it in the \"vm\" object\n vm_json = {vm: vm_json};\n \n \n Sunstone.runAction(\"VM.create\",vm_json);\n\t\t\n $('#create_vm_dialog').dialog('close');\n\t\treturn false;\n\t});\n\n //Handle manual forms\n\t$('button#create_vm_form_manual').click(function(){\n\t\tvar template = $('#textarea_vm_template').val();\n\n //wrap it in the \"vm\" object\n template = {\"vm\": {\"vm_raw\": template}};\n\n Sunstone.runAction(\"VM.create\",template);\n\t\t $('#create_vm_dialog').dialog('close');\n\t\treturn false;\n\t});\n\n //Reset form - empty boxes\n\t$('button#reset_vm_form').click(function(){\n\t\t$('select#disks_box option',section_disks).remove();\n\t\t$('select#nics_box option',section_networks).remove();\n\t\t$('select#inputs_box option',section_inputs).remove();\n\t\treturn true;\n\t});\n\n\n}", "function init_config_form(){\n load_config();\n build_table();\n render_plugin_data();\n }", "async displayConfiguration(manual) {\n const { rooms } = await this.#connection.send({ command: 'environment-rooms' });\n\n // (1) Close the connection dialog if it's open, as we are now connected, as well as the\n // user interface which shouldn't be visible during this operation.\n if (this.#dialogs.notConnected.open)\n this.#dialogs.notConnected.close();\n\n this.toggleInterface(/* enabled= */ false);\n\n // (2) Require the user to select a valid room which this controller is responsible for.\n if (!this.#room || !rooms.includes(this.#room) || manual)\n this.#room = await this.selectRoom(rooms);\n\n // (3) Fetch the list of services that exist for that room.\n const { services } = await this.#connection.send({\n command: 'environment-services',\n room: this.#room,\n });\n\n // (4) Clear the list of displayed services, and add each of the services to the container\n // after clearing all services that are already being displayed, if any.\n while (this.#container.firstChild)\n this.#container.removeChild(this.#container.firstChild);\n\n this.toggleInterface(/* enabled= */ true);\n\n this.#bindings = [];\n for (const service of services)\n await this.initializeService(service);\n }", "function ConfigureFlightRisingEnhancer() { \r\n // Append an FRE settings option to the settings page.\r\n var optionsDiv = $('#user_chg').parent().parent();\r\n var options = optionsDiv.find('div');\r\n var yPosition = parseInt(/(\\d+)/.exec($(options[options.length - 1]).css('top'))[1]) + 65;\r\n \r\n optionsDiv.append('<div style=\"position:absolute; left:0px; top:' + yPosition + 'px;\">' +\r\n '<div style=\"color:#731d08; font-weight:bold;\">Configure FRE</div>' +\r\n '<div style=\"font-style:italic;\">Flight Rising Enhancer modules</div>' +\r\n '</div><div style=\"position:absolute; right:0px; top:' + yPosition + 'px;\">' +\r\n '<input type=\"button\" value=\"Configure\" id=\"fre_configure\" style=\"height:25px; width:80px; color:#fff; border:1px solid #000; background-color:#731d08;\" class=\"mb_button\">' +\r\n '</div>');\r\n \r\n // Open it up on click\r\n $('#fre_configure').click(function(e){\r\n $('body').append('<div id=\"freConfigureWindow\"></div>');\r\n $('#freConfigureWindow').dialog({\r\n autoOpen: false,\r\n title: \"Configure Flight Rising Enhancer\",\r\n width: 320,\r\n height: \"auto\",\r\n modal: true,\r\n resizable: false,\r\n draggable: false,\r\n closeOnEscape: false,\r\n open: function(event, ui) {\r\n $(\".ui-dialog-titlebar-close\", ui.dialog).hide();\r\n }\r\n });\r\n \r\n $('#freConfigureWindow').dialog('open');\r\n \r\n // Add config options for each module: a checkbox and the module key\r\n var addConfigOption = function(key)\r\n {\r\n $('#freConfigureWindow').append('<input id=\"' + key + '\" class=\"freSetting\" type=\"checkbox\" name=\"' + key + '\" value=\"1\"' + (moduleEnabled(key) ? ' checked' : '') + '>' + moduleReference[key] + '<br>');\r\n }\r\n \r\n // Look through the module reference to add config options to enable/disable each module.\r\n for (var module in moduleReference)\r\n {\r\n addConfigOption(module);\r\n }\r\n\r\n $('#freConfigureWindow').append('Gem Rate: 1 <img width=\"20\" border=\"0\" height=\"20\" align=\"absmiddle\" style=\"cursor:pointer;\" src=\"/images/layout/icon_gems.png\"> =' +\r\n ' <input type=\"text\" id=\"gemRatio\" name=\"gemRatio\" style=\"width: 45px; border: 1px solid #777; background: #F8F8F8; border-radius: 3px;\" value=\"' + getStoredValue('gemRate', gemDefault) + '\">' +\r\n '<img width=\"20\" border=\"0\" height=\"20\" align=\"absmiddle\" style=\"cursor:pointer;\" src=\"/images/layout/icon_treasure.png\"><br>');\r\n \r\n // Save and cancel buttons - save stores the values and then closes the window; cancel just closes the window.\r\n $('#freConfigureWindow').append('<div style=\"height: 10px\"></div>');\r\n $('#freConfigureWindow').append('<input type=\"button\" class=\"mb_button\" value=\"Save\" style=\"width:120px; color:#731d08; height:30px; font-size:12px; font-weight:bold; border:1px solid #000; margin-left: 25px; margin-right: 15px;\" id=\"save\">');\r\n $('#freConfigureWindow').append('<input type=\"button\" class=\"mb_button\" value=\"Cancel\" style=\"width:120px; color:#731d08; height:30px; font-size:12px; font-weight:bold; border:1px solid #000;\" id=\"cancel\">');\r\n \r\n $('#cancel').click(function(e){\r\n $('#freConfigureWindow').dialog('close');\r\n $('#freConfigureWindow').detach();\r\n });\r\n\r\n // On save, store the module settings and parse the gem rate box (if it's a number, store it)\r\n $('#save').click(function(e){\r\n var settings = $('#freConfigureWindow .freSetting');\r\n \r\n for (var i = 0; i < settings.length; i++)\r\n {\r\n var name = $(settings[i]).attr('name');\r\n var checked = $(settings[i]).is(':checked');\r\n setModuleEnabled(name, checked);\r\n }\r\n \r\n if (!isNaN(parseFloat($('#gemRatio').val())))\r\n setStoredValue('gemRate', $('#gemRatio').val());\r\n \r\n $('#freConfigureWindow').dialog('close');\r\n $('#freConfigureWindow').detach();\r\n });\r\n }); \r\n}", "function showConfigUser() {\n\n\tdocument.getElementById('sel_interface_font_size').value = v_font_size;\n\tdocument.getElementById('sel_editor_theme').value = v_theme;\n\n\tdocument.getElementById('txt_confirm_new_pwd').value = '';\n\tdocument.getElementById('txt_new_pwd').value = '';\n\n\tdocument.getElementById('sel_csv_encoding').value = v_csv_encoding;\n\tdocument.getElementById('txt_csv_delimiter').value = v_csv_delimiter;\n\n\t$('#modal_config').modal({ backdrop: 'static', keyboard: false });\n\n}", "showComponentConfigDialog(type,activeComponent){\n var vm = this; \n vm.setClientAppData(\"activeConfigComponent\",activeComponent);\n var handlerQueueId = new Date().getTime();\n var component = this.getClientAppData().composerDOM[activeComponent];\n if(type == 'Properties')\n {\n vm.eventHandlerQueue[handlerQueueId] = {\"resolve\":function(event){\n var schema = event.data.response; \n vm.buildComponentPropertiesDialog(schema,component);\n vm.setClientAppData(\"showConfigurationPropertiesDialog\",true);\n }}; \n\n //fetch component schema and prepare configuration UI\n var callSchemaEvent = Object.assign({},{\n \"message\":\"callSchema\",\n \"handlerQueueId\":handlerQueueId,\n \"schemaPath\":vm.joinSchemaPath(component.xsolvent_object_schema,\"#/properties/Settings\"),\n \"objectPath\":activeComponent\n });\n vm.broadcastEvent(callSchemaEvent);\n }\n else\n if(type == 'Events')\n {\n vm.eventHandlerQueue[handlerQueueId] = {\"resolve\":function(event){\n var schema = event.data.response; \n vm.buildComponentEventsDialog(schema,component);\n vm.setClientAppData(\"showConfigurationEventsDialog\",true);\n }}; \n\n var callSchemaEvent = Object.assign({},{\n \"message\":\"callSchema\",\n \"handlerQueueId\":handlerQueueId,\n \"schemaPath\":vm.joinSchemaPath(component.xsolvent_object_schema,\"#/properties/Events\"),\n \"objectPath\":activeComponent\n });\n vm.broadcastEvent(callSchemaEvent); \n }\n else\n if(type == 'Directives')\n {\n vm.eventHandlerQueue[handlerQueueId] = {\"resolve\":function(event){\n var schema = event.data.response; \n vm.buildComponentDirectivesDialog(schema,component);\n vm.setClientAppData(\"showConfigurationDirectivesDialog\",true);\n }}; \n\n var callSchemaEvent = Object.assign({},{\n \"message\":\"callSchema\",\n \"handlerQueueId\":handlerQueueId,\n \"schemaPath\":vm.joinSchemaPath(component.xsolvent_object_schema,\"#/properties/Directives\"),\n \"objectPath\":activeComponent\n });\n vm.broadcastEvent(callSchemaEvent); \n }\n else\n if(type == 'Data Model')\n {\n vm.eventHandlerQueue[handlerQueueId] = {\"resolve\":function(event){\n var schema = event.data.response; \n vm.buildComponentDataModelDialog(schema,component);\n vm.setClientAppData(\"showConfigurationDataModelDialog\",true);\n }}; \n\n var callSchemaEvent = Object.assign({},{\n \"message\":\"callSchema\",\n \"handlerQueueId\":handlerQueueId,\n \"schemaPath\":vm.joinSchemaPath(component.xsolvent_object_schema,\"#/properties/Data Model\"),\n \"objectPath\":activeComponent\n }); \n vm.broadcastEvent(callSchemaEvent);\n }\n else\n if(type == 'Markup')\n { \n vm.eventHandlerQueue[handlerQueueId] = {\"resolve\":function(event){\n var schema = event.data.response; \n vm.buildComponentMarkupDialog(schema,component);\n vm.setClientAppData(\"showConfigurationMarkupDialog\",true);\n }}; \n\n var callSchemaEvent = Object.assign({},{\n \"message\":\"callSchema\",\n \"handlerQueueId\":handlerQueueId,\n \"schemaPath\":vm.joinSchemaPath(component.xsolvent_object_schema,\"#/properties/Markup\"),\n \"objectPath\":activeComponent\n });\n vm.broadcastEvent(callSchemaEvent);\n }\n }", "function initElements() {\n // Hook the text inputs.\n $('input[type=\"text\"]').change(function() {\n handleConfigChange($(this));\n });\n\n // Hook the number inputs.\n $('input[type=\"number\"]').change(function() {\n handleConfigChange($(this));\n });\n\n // Hook the checkbox inputs.\n $('input[type=\"checkbox\"]').change(function() {\n handleConfigChange($(this));\n });\n\n // Hook the load configuration button.\n $('.load').click(function (e) {\n // Note that this prevents shift-clicking from trying to open\n // a link in a chrome browser.\n e.preventDefault();\n\n // This will open a file for reading. It will try to convert\n // the contents of the file to an object. Once the object is\n // created it will be loaded into the correct elements,\n // then checked for validity.\n dialog.showOpenDialog({properties: ['openFile']}, function (paths) {\n // Check if user cancelled.\n if (paths == undefined) {\n GUI.log(\"[Configuration] Failed to load configuration file: User cancelled.\", 2);\n\n return;\n }\n \n var path = paths[0];\n var json = \"\";\n\n // Read and store the contents of the file in the \n // json string.\n fs.readFile(path, 'utf8', function (err, data) {\n if (err) {\n dialog.showErrorBox('Configuration File Error', err);\n\n return;\n }\n\n // When the file is done loading convert the string \n // to an object.\n try {\n var userConfig = JSON.parse(data);\n } catch(e) {\n // Conversion failed.\n dialog.showErrorBox('Configuration File Error', e.toString());\n \n return;\n }\n\n DIModule.setNewConfig(userConfig, function (errStr) {\n if (errStr) {\n // Get the text of the element.\n dialog.showErrorBox('Configuration File Error', errStr);\n \n return;\n }\n \n // Upon completion of setting the new config update\n // config in the GUI.\n updateConfig();\n });\n });\n });\n });\n \n // Hook the save configuration button.\n $('.save').click(function (e) {\n // Note that this prevents shift-clicking from trying to open\n // a link in a chrome browser.\n e.preventDefault();\n\n // When the file is opened, a writer is created.\n // Create a new object from the stored\n // configuration. This object is converted to a JSON string\n // and saved to a file.\n dialog.showSaveDialog(function (filename) {\n if (filename == undefined) {\n GUI.log('[Configuration] Failed to create configuration file: User cancelled.', 2);\n\n return;\n }\n\n // Object to be saved.\n var configOut = {};\n\n // Fill the object from the DI module.\n DIModule.getConfig(function (prop) {\n DIModule.getConfigVal(prop, function(value, meta) {\n configOut[prop] = value;\n });\n });\n\n fs.writeFile(filename, JSON.stringify(configOut, null, ' '), function (err) {\n // Check for write error.\n if (err) {\n GUI.log('[Configuration] Error writing configuration file: ' + err, 2);\n }\n\n GUI.log('[Configuration] Wrote config file: ' + filename);\n });\n });\n });\n }", "function createConfig() {\n\tdocument.getElementById(\"chooseConfigDialog\").style.display = \"none\";\n\topenaccordion(\"currentConfigAcc\");\n\tresetConfig(); // includes the function \"optimizeforsource\"\n\tshowstep1();\n}", "function setupConf() {\n\tconf = popupManager.newConfig();\n\tconf.draw();\n}", "function scriptConfig() {\r\n\ttrace(\"scriptConfig() configuring the dialog\");\r\n\t\r\n\t// Configure Settings dialog\r\n\tGM_config.init('Emule Linker Settings dialog', {\r\n\t\t'section1' : { section: ['ed2k download mode', 'Please refer to your emule/amule/mldonkey configuration'], label: '', type: 'hidden'},\r\n\t\t/*'ed2kDlMethod': { label: 'Ed2k Download Method', title: 'local: local application that handle ed2k links (default)\\nemule: remote emule (via web frontend)\\namule: remote amule (via web frontend)\\nmldonkey: remote mldonkey (via web frontend)\\ncustom: custom server implementation (experimental)', type:'radio', options:['local','emule','amule','mldonkey','custom'], default: ed2kDlMethod },*/\r\n\t\t'ed2kDlMethod': { label: 'Ed2k Download Method', title: 'local: local application that handle ed2k links (default)\\nemule: remote emule (via web frontend)\\namule: remote amule (via web frontend)\\nmldonkey: remote mldonkey (via web frontend)\\ncustom: custom server implementation (experimental)', type:'select', options:{'local':'your system default','emule':'(remote) emule','amule':'(remote) amule','mldonkey':'(remote) mldonkey','custom':'custom (experimental)'}, default: ed2kDlMethod}, // default value doesn't work with a dropdown menu => see bugfix in the lib\r\n\t\t'emuleUrl': { label: 'Emule Url', title : 'The complete url of your emule web server ending by a / (example: http://127.0.0.1:4711/)', type: 'text', default: emuleUrl },\r\n\t\t'emulePwd': { label: 'Emule Password', title : 'the password you choose to access your emule web server', type: 'text', default: emulePwd },\r\n\t\t'emuleCat': { label: 'Category', title : 'categories available in your emule/amule application. You can add categories using the following template:\\ncategory_name1=corresponding_index_in_emule;category_name2=...\\nAdding a * before the name specify the default choice.\\nIf you don\\'t know what you are doing just specify this: *default=0', type: 'text', default: catToStr(emuleCat) },\r\n\t\t'section2' : { section: ['Popup Configuration', 'modify how the popup is displayed'], label: '', type: 'hidden'},\r\n\t\t'popupPos': { label: 'Popup Position', title : 'choosing \\'absolute\\', the popup will stay at the top. Choosing fixed, the popup will follow as you scroll within the page', type: 'radio', options:['absolute','fixed'], default: popupPos },\r\n\t\t'popupHeight': { label: 'Max Popup Height in px (0=unlimited)', title : 'Max height of the popup in pixels (0=unlimited)', type: 'int', default: popupHeight },\r\n\t\t'popupWidth': { label: 'Max Popup Width in px (0=unlimited)', title : 'Max width of the popup in pixels (0=unlimited)', type: 'int', default: popupWidth },\r\n\t\t'section3' : { section: ['Edit box Configuration', 'modify how the edit box is displayed'], label: '', type: 'hidden'},\r\n\t\t'editCol': { label: 'Number of columns', title : 'number of columns', type: 'radio', type: 'int', default: editCol },\r\n\t\t'editRow': { label: 'Number of rows', title : 'Number of rows', type: 'int', default: editRow },\r\n\t\t'editMaxLength': { label: 'MaxLength', title : 'Max number of char in the text area', type: 'int', 'default': editMaxLength },\r\n\t\t}, \r\n\t\t{\r\n\t\t//open: function() { GM_config.sections2tabs(); }, // not working (not included into the library)\r\n\t\tsave: function() { location.reload(); } // reload the page when configuration was changed\r\n\t\t}\r\n\t);\r\n\t\r\n\t// invoke the dialog\r\n\tif (GM_getValue(\"emule_config\", 0)<1)\r\n\t{\r\n\t\ttrace(\"scriptConfig() invoking the dialog\");\r\n\t\tGM_config.open();\r\n\t\tGM_setValue(\"emule_config\",1);\r\n\t}\r\n\r\n\t// store the settings\r\n\tsaveConfig();\r\n\r\n}", "function showSensorTypeSettings() {\n setElementDisplay([sensorTypeSettingMenu], \"block\");\n}", "contClick() {\n // temporarily goes right to the workspace registration\n app.goto('/init/newworkspace');\n }", "function viewConfig() {\n ngDialog.open({\n template: '<ncl-function-config-dialog data-close-dialog=\"closeThisDialog()\" ' +\n ' data-function=\"ngDialogData.function\">' +\n '</ncl-function-config-dialog>',\n plain: true,\n data: {\n function: ctrl.function\n },\n className: 'ngdialog-theme-iguazio view-yaml-dialog-wrapper'\n });\n }", "showSettings() {\n // Implement in your WM\n }", "function setupDeployVMDialog(){\n\n dialogs_context.append('<div id=\"deploy_vm_dialog\"></div>');\n //Insert HTML in place\n $deploy_vm_dialog = $('#deploy_vm_dialog')\n var dialog = $deploy_vm_dialog;\n dialog.html(deploy_vm_tmpl);\n dialog.addClass(\"reveal-modal large max-height\").attr(\"data-reveal\", \"\");\n\n setupHostTableSelect(dialog, \"deploy_vm\");\n\n // Show system DS only\n setupDatastoreTableSelect(dialog, \"deploy_vm_ds\",\n { filter_fn: function(ds){ return ds.TYPE == 1; } }\n );\n\n $('#refresh_button_deploy_vm', dialog).click();\n $('#refresh_button_deploy_vm_ds', dialog).click();\n\n $('#advanced_deploy', dialog).hide();\n $('#advanced_toggle',dialog).click(function(){\n $('#advanced_deploy',dialog).toggle();\n return false;\n });\n\n setupTips(dialog);\n\n $('#deploy_vm_form',dialog).submit(function(){\n var extra_info = {};\n\n if ($(\"#selected_resource_id_deploy_vm\", dialog).val()) {\n extra_info['host_id'] = $(\"#selected_resource_id_deploy_vm\", dialog).val();\n } else {\n notifyError(tr(\"You have not selected a host\"));\n return false;\n }\n\n extra_info['ds_id'] = $(\"#selected_resource_id_deploy_vm_ds\", dialog).val() || -1\n extra_info['enforce'] = $(\"#enforce\", this).is(\":checked\") ? true : false\n\n //notifySubmit(\"Template.instantiate\",template_id, extra_msg);\n\n $.each(getSelectedNodes(dataTable_vMachines), function(index, elem) {\n Sunstone.runAction(\"VM.deploy_action\", elem, extra_info);\n });\n\n $deploy_vm_dialog.foundation('reveal', 'close')\n return false;\n });\n}", "function setButton() {\r\n\ttrace(\"setButton()\");\r\n\ttrace(\"scriptConfig() invoking the dialog\");\r\n\tGM_config.open();\r\n\tGM_setValue(\"emule_config\",1);\r\n}", "show() {\n const panel = this.modal.makePanel(`settings`);\n panel.innerHTML = `<h3>Change the game theme</h3>`;\n const options = this.getOptions();\n const table = this.modal.buildPanelContent(options);\n this.addFormControls(panel, table, options);\n this.modal.addFooter(panel, \"Close\");\n }", "function showConfigUser() {\n\n\tdocument.getElementById('sel_editor_font_size').value = v_editor_font_size;\n\tdocument.getElementById('sel_interface_font_size').value = v_interface_font_size;\n\tdocument.getElementById('sel_editor_theme').value = v_theme_id + '/' + v_editor_theme;\n\n\tdocument.getElementById('txt_confirm_new_pwd').value = '';\n\tdocument.getElementById('txt_new_pwd').value = '';\n\n\tdocument.getElementById('chk_enable_chat').checked = ((v_enable_omnichat == 1) ? true : false);\n\n\tdocument.getElementById('sel_csv_encoding').value = v_csv_encoding;\n\tdocument.getElementById('txt_csv_delimiter').value = v_csv_delimiter;\n\n\t$('#div_config_user').addClass('isActive');\n\n}", "function startup() {\n toggleOptions();\n}", "function dialogShow( settingsChangedCallback, $GRAPH_INSTANCE ) {\n\n let dialogId = \"graphSettingsDialog\";\n\n if ( !alertify.graphSettings ) {\n\n console.log( \"Building: dialogId: \" + dialogId );\n let settingsFactory = function factory() {\n return {\n build: function () {\n // Move content from template\n this.setContent( '<div id=\"' + dialogId + '\"></div>' );\n\n },\n setup: function () {\n return {\n buttons: [ { text: \"Refresh Graphs\", className: alertify.defaults.theme.ok, key: 27/* Esc */ } ],\n options: {\n title: \"Advanced Settings\", resizable: true, movable: false, maximizable: false\n }\n };\n }\n\n };\n };\n\n alertify.dialog( 'graphSettings', settingsFactory, false, 'alert' );\n }\n\n let settingsDialog = alertify.graphSettings();\n\n // Settings from associated ResourceGraph moved into dialog\n $( \"#\" + dialogId ).append( $( \".resourceConfigDialog\", $GRAPH_INSTANCE ) );\n\n settingsDialog.setting( {\n 'onclose': function () {\n // Settings moved back to original location\n $( \".resourceConfig\", $GRAPH_INSTANCE ).append( $( \".resourceConfigDialog\", \"#\" + dialogId ) );\n settingsChangedCallback();\n }\n } );\n\n\n let targetWidth = $( window ).outerWidth( true ) - 100;\n let targetHeight = $( window ).outerHeight( true ) - 100;\n settingsDialog.resizeTo( targetWidth, targetHeight );\n\n\n $( \".graph-display-options\" ).hide();\n\n settingsDialog.show();\n }", "function chooseConfig() {\n\t$(\"#configs\").val(null);\n\tcloseaccordion(\"currentConfigAcc\");\n\tdocument.getElementById(\"chooseConfigDialog\").style.display = \"block\";\n\toptimizeforsource();\n\tshowstep3();\n}", "function showPage() {\n\n g_opclient = new OpenpuxClient();\n\n // Create a form for navigation buttons\n enableForm(\"NavigationForm\");\n\n // Create a form for the sensor account information\n enableForm(\"SensorAccountForm\");\n}", "function showContactOptions($event) {\n appContextService.setselectedService(self.selected);\n\n $mdDialog.show({\n controller: 'registerCtrl',\n templateUrl: './src/views/book-appointment.html',\n parent: angular.element(document.body),\n targetEvent: $event,\n clickOutsideToClose: true\n })\n .then(function (answer) {\n\n }, function () {\n\n });\n }", "function resetUI() {\n if (traceLib.valid) {\n $('.needsConfig').show();\n } else {\n $('.needsConfig').hide();\n }\n }", "function show() {\n window.extensions.KJSLINT.KomodoAdaptor.showCommandPanel();\n }", "function ac_createConfigPanel() {\n\t\n\t// Create DOM Elements\n\t$(\"#ac_tool_box\").append('<div id=\"ac_cfg_panel\" class=\"ac_panel\" style=\"display:none\"></div>');\n\t$(\"#ac_cfg_panel\").append('<div id=\"ac_cfg_titlebar\" class=\"ac_titlebar\">');\n\t$(\"#ac_cfg_titlebar\").append('<ul id=\"ac_cfg_links\" class=\"ac_links\"></ul>');\n\t$(\"#ac_cfg_titlebar\").append('<div id=\"ac_cfg_title\" class=\"ac_title\">Configure ActiveChat (Version ' + AC_VERSION + ')</div>');\n\t\n\t$(\"#ac_cfg_panel\").append('<div id=\"ac_cfg_content\" class=\"ac_panel_content\"></div>');\n\t$(\"#ac_cfg_panel\").append('<div id=\"ac_cfg_form\" class=\"ac_panel_form\"></div>');\n\t$(\"#ac_cfg_content\").append('<form id=\"optionsform\" class=\"ac_inputform\" onsubmit=\"return false;\" ></form>');\t\n\t$(\"#ac_cfg_form\").append('<form id=\"cfgform\" class=\"ac_inputform\" onsubmit=\"return false;\" ></form>');\t\n\t$(\"#cfgform\").append('<table width=\"100%\"><tr><td valign=\"top\"><input type=\"button\" id=\"cfgsave\" class=\"ac_button\" value=\"Save Settings\" disabled=\"disabled\"> <input type=\"button\" id=\"cfgreload\" class=\"ac_button\" value=\"Reload Chat\" onclick=\"window.location=\\'lchat.php\\'></td></tr></table>');\n\t\n\t//Create Option Checkboxes\t\n\t$(\"#optionsform\").append('<fieldset id=\"startupset\">');\n\t$(\"#startupset\").append('<legend>On Startup (Requires restart)</legend>');\n\t$(\"#startupset\").append(ac_getCheckboxHTML('loadchannels') + '<br>');\n\t$(\"#startupset\").append(ac_getCheckboxHTML('loadplayers') + '<br>');\n\t$(\"#startupset\").append(ac_getCheckboxHTML('loadcontacts') + '<br>');\n\t$(\"#startupset\").append(ac_getCheckboxHTML('loadclannies') + '<br>');\n\t$(\"#startupset\").append(ac_getCheckboxHTML('idleoff') + '<br>');\n\n\t$(\"#optionsform\").append('<fieldset id=\"displayset\">');\n\t$(\"#displayset\").append('<legend>Display</legend>');\n\t$(\"#displayset\").append(ac_getCheckboxHTML('hidetags') + '<br>');\n\t$(\"#displayset\").append(ac_getCheckboxHTML('timestamp') + '<br>');\n\t$(\"#displayset\").append(ac_getCheckboxHTML('pminblue') + '<br>');\n\t$(\"#displayset\").append(ac_getCheckboxHTML('pmoutblue') + '<br>');\n\t$(\"#displayset\").append(ac_getCheckboxHTML('verticalkeys') + '<br>');\n\t$(\"#displayset\").append(ac_getCheckboxHTML('confirmonclose') + '<br>');\n\t$(\"#displayset\").append(ac_getCheckboxHTML('killonclose') + '<br>');\n\t$(\"#displayset\").append(ac_getCheckboxHTML('suppressevents') + '<br>');\n\n\t$(\"#optionsform\").append('<fieldset id=\"eventset\">');\n\t$(\"#eventset\").append('<legend>Send events to</legend>');\n\n\t$(\"#eventset\").append(ac_getRadioHTML('eventstarget', 'panel', 'A separate events panel') + '<br>');\n\t$(\"#eventset\").append(ac_getRadioHTML('eventstarget', 'docked', 'A toolbar panel (with a cute little icon)') + '<br>');\n\t$(\"#eventset\").append(ac_getRadioHTML('eventstarget', 'tab', \"A separate 'events' tab\") + '<br>');\n\t$(\"#eventset\").append(ac_getRadioHTML('eventstarget', 'channel', 'The current (KoL) channel') + '<br>');\n\t$(\"#eventset\").append(ac_getRadioHTML('eventstarget', 'active', 'The active tab') + '<br>');\n\t$(\"#eventset\").append(ac_getRadioHTML('eventstarget', 'none', 'Valhalla') + '<br>');\n\n\t$(\"#optionsform\").append('<fieldset id=\"toolset\">');\n\t$(\"#toolset\").append('<legend>Optional Tools (Requires restart)</legend>');\n\t$(\"#toolset\").append(ac_getCheckboxHTML('showlog') + '<br>');\n\t$(\"#toolset\").append(ac_getCheckboxHTML('showcli') + '<br>');\n\t$(\"#toolset\").append(ac_getCheckboxHTML('clirefresh') + '<br>');\n\t$(\"#toolset\").append(ac_getCheckboxHTML('showcalendar') + '<br>');\n\t$(\"#toolset\").append(ac_getCheckboxHTML('afhbots') + '<br>');\n\n\t$(\"#optionsform\").append('<fieldset id=\"layoutset\">');\n\t$(\"#layoutset\").append('<legend>Layout</legend>');\n\t$(\"#layoutset\").append(ac_getCheckboxHTML('infotop') + '<br>');\n\t$(\"#layoutset\").append(ac_getCheckboxHTML('tabstop') + '<br>');\n\n\t// Enabled button when options changes\n\t$(\"#optionsform input\").change(function () { \n\t\t$(\"#cfgsave\").attr(\"disabled\", '');\n });\n\t\n\t// Add Event handler to Button\n\tvar button = document.getElementById('cfgsave');\n\tbutton.addEventListener(\"click\", ac_saveConfigPanel, true);\n\n}", "async function showAddNewSensorTypeMenu() {\n setElementDisplay([mainMenu, sensorTypeSettingMenu], \"none\");\n setElementDisplay([addNewSensorTypeMenu], \"block\");\n}", "function configure() {\n\n const popupUrl = `${window.location.origin}/dialog.html`;\n\n let input = \"\";\n\n tableau.extensions.ui.displayDialogAsync(popupUrl, input, { height: 540, width: 800 }).then((closePayload) => {\n // The close payload is returned from the popup extension via the closeDialog method.\n $('#interval').text(closePayload);\n }).catch((error) => {\n // One expected error condition is when the popup is closed by the user (meaning the user\n // clicks the 'X' in the top right of the dialog). This can be checked for like so:\n switch (error.errorCode) {\n case tableau.ErrorCodes.DialogClosedByUser:\n console.log(\"Dialog was closed by user\");\n break;\n default:\n console.error(error.message);\n }\n });\n }", "function startDialog() {\r\n\t// set server to appropriate value\r\n\tserver = window.arguments[0];\r\n\t\r\n\t// generate step list\r\n\tsetSteps();\r\n\t\r\n\t// move to center of parent window\r\n\tcenterWindowOnScreen();\r\n}", "function ShowAccountSettings() {\n CollapseAllForms();\n CollapseElements(dashboard, error_message);\n ShowElements(account_settings_form);\n\n LoadAccountSettings();\n}", "showImportExportServers() {\n // Register dialog panel\n pgBrowser.Node.registerUtilityPanel();\n let panel = pgBrowser.Node.addUtilityPanel(880, 550),\n j = panel.$container.find('.obj_properties').first();\n panel.title(gettext('Import/Export Servers'));\n\n ReactDOM.render(\n <Theme>\n <ImportExportServers\n onClose={() => {\n ReactDOM.unmountComponentAtNode(j[0]);\n panel.close();\n }}/>\n </Theme>, j[0]);\n }", "function init(){\n $('.page-content').append(window.ST.pooToolSpinner.el);\n changeDesign();\n initializeCheckOrientation();\n initializeListingDateLocationService();\n initializeGantt();\n initializeDatepickers();\n initialize_poolTool_createTransaction_form(gon.locale, gon.choose_employee_or_renter_msg);\n initialize_device_picker();\n initialize_poolTool_options();\n initialize_poolTool_search();\n\n // devices the current logged in user has in his hands\n if (gon.user_active_bookings !== null){\n show_my_borrowed_devices();\n }\n\n $(\".inline\").colorbox({inline:true, width:\"90%\", height:\"95%\", maxWidth:\"500px\", maxHeight:\"270px\"});\n }", "function enableOptions() {\n let config = document.querySelector('#options')\n let wheel = document.querySelector('#cog')\n wheel.addEventListener('click', function() {\n config.style.display = 'block'\n })\n let close = document.querySelector('#close-options')\n close.addEventListener('click', function() {\n config.style.display = 'none'\n })\n}", "async onConnected() {\n await this.displayConfiguration(/* manual= */ false);\n }", "function settingsDisplayInit() {\n\n\tclearWindow(true);\n\tconst divRoot = document.querySelector(`#divRoot`);\n\tg_baseDisp = `Display`;\n\tg_currentPage = `settingsDisplay`;\n\n\t// 譜面初期情報ロード許可フラグ\n\tg_canLoadDifInfoFlg = false;\n\n\t// タイトル文字描画\n\tdivRoot.appendChild(getTitleDivLabel(`lblTitle`, g_lblNameObj.display, 0, 15, `settings_Display`));\n\n\t// オプションボタン用の設置\n\tcreateSettingsDisplayWindow(divRoot);\n\n\t// ショートカットキーメッセージ\n\tdivRoot.appendChild(\n\t\tcreateDivCss2Label(`scMsg`, g_lblNameObj.sdShortcutDesc, {\n\t\t\tx: 0, y: g_sHeight - 45, w: g_sWidth, h: 20, siz: C_SIZ_MAIN,\n\t\t})\n\t);\n\n\t// ユーザカスタムイベント(初期)\n\tif (typeof customSettingsDisplayInit === C_TYP_FUNCTION) {\n\t\tcustomSettingsDisplayInit();\n\t\tif (typeof customSettingsDisplayInit2 === C_TYP_FUNCTION) {\n\t\t\tcustomSettingsDisplayInit2();\n\t\t}\n\t}\n\n\t// ボタン描画\n\tcommonSettingBtn(`Settings`);\n\n\t// キー操作イベント(デフォルト)\n\tsetShortcutEvent(g_currentPage);\n\tdocument.oncontextmenu = _ => true;\n\n\tif (typeof skinSettingsDisplayInit === C_TYP_FUNCTION) {\n\t\tskinSettingsDisplayInit();\n\t\tif (typeof skinSettingsDisplayInit2 === C_TYP_FUNCTION) {\n\t\t\tskinSettingsDisplayInit2();\n\t\t}\n\t}\n}", "showPageSetupDialog() {\n if (this.pageSetupDialogModule && !this.isReadOnlyMode && this.viewer) {\n this.pageSetupDialogModule.show();\n }\n }", "function NodePrompt() {\n\t\t// create interface and obscure everything else\n\t this.render = function(value, is, fs, lab) {\n\t var winW = window.innerWidth;\n\t var winH = window.innerHeight;\n\t var dialogueoverlay = document.getElementById('dialogueoverlay');\n\t var dialoguebox = document.getElementById('dialoguebox');\n\t dialogueoverlay.style.display = \"block\";\n\t dialogueoverlay.style.height = winH+\"px\";\n\t dialoguebox.style.left = (winW/2) - (300/2)+\"px\";\n\t dialoguebox.style.top = '30%';\n\t dialoguebox.style.display = \"block\";\n\t document.getElementById('dialogueboxhead').innerHTML = \"Edit Node <b>\" + value + \":</b>\";\n\t document.getElementById('dialogueboxbody').innerHTML = 'Initial State:<input type=\"checkbox\" id=\"initial_state\">';\n\t document.getElementById('dialogueboxbody').innerHTML += '<br>Final State:<input type=\"checkbox\" id=\"final_state\">';\n\t document.getElementById('dialogueboxbody').innerHTML += '<br>Label: <input id=\"label\">';\n\t document.getElementById('dialogueboxfoot').innerHTML = '<button onclick=\"ok()\">OK</button> <button onclick=\"terminate()\">Cancel</button>';\n\t if (is) {\n\t document.getElementById('initial_state').checked = true;\n\t }\n\t if (fs) {\n\t document.getElementById('final_state').checked = true;\n\t }\n\t if (lab) {\n\t document.getElementById('label').value = lab;\n\t }\n\t document.getElementById('label').focus();\n\t };\n\t // close the prompt (by hiding it)\n\t terminate = function() {\n\t document.getElementById('dialoguebox').style.display = \"none\";\n\t document.getElementById('dialogueoverlay').style.display = \"none\";\n\t };\n\t // make the appropriate changes to the TM node\n\t ok = function() {\n\t var initial_state = document.getElementById('initial_state').checked;\n\t var final_state = document.getElementById('final_state').checked;\n\t var node_label = document.getElementById('label').value;\n\t if (initial_state) {\n\t\t\t\tvar nodes = g.nodes();\n\t\t\t\tfor (var next = nodes.next(); next; next = nodes.next()) {\n\t\t\t\t\tg.removeInitial(next);\n\t\t\t\t}\n\t\t\t\tg.makeInitial(first);\n\t\t\t} else{\n\t\t\t\tg.removeInitial(first);\n\t\t\t}\n\t\t\tif (final_state) {\n\t\t\t\tfirst.addClass('final');\n\t\t\t} else {\n\t\t\t\tfirst.removeClass('final');\n\t\t\t}\n\t\t\t//adds labels to states\n\t\t\tif (node_label) {\n\t\t\t\tfirst.stateLabel(node_label);\n\t\t\t\tfirst.stateLabelPositionUpdate();\n\t\t\t}\n\t document.getElementById('dialoguebox').style.display = \"none\";\n\t document.getElementById('dialogueoverlay').style.display = \"none\";\n\t };\n\t}", "showPropertyEditor() {\n const LayoutMng = require('../layout/layout_mng');\n // create the editor window if not exists\n if (null==this.propEditor) {\n let editor = this.propEditor = this.createFormWindow('Settings Editor #'+this.id, {\n parent: LayoutMng.singleton.uiParent,\n border: 'line',\n top: Math.max(parseInt(LayoutMng.singleton.uiParent.height/2)-20, 1),\n left: 'center',\n width: 35,\n shrink: true,\n });\n editor.compCount = 0;\n editor.comps = new Object();\n this.addPropertyEditorComps();\n let okay = this.createBtn('Okay', {\n parent: editor, \n right: 14, \n top: this.propEditor.compCount*2+1, \n width: 6, height: 1,\n });\n okay.on('press', ()=>{ editor.submit(); });\n editor.on('submit', (data)=>{\n this.propEditor.hide();\n LayoutMng.singleton.screen.render();\n for (let n in data) {\n if (typeof(data[n])!='string') {\n delete data[n];\n continue;\n }\n data[n] = data[n].trim();\n }\n bilog(\"settings submit: \"+JSON.stringify(data));\n this.onPropertyEditorSubmit(data);\n });\n let cancel = this.createBtn('Cancel', {\n parent: editor, \n right: 2, \n top: this.propEditor.compCount*2+1, \n width: 8, height: 1,\n });\n cancel.on('press', ()=>{\n this.propEditor.hide();\n });\n }\n // reset values of all fields\n LayoutMng.singleton.screen.render();\n this.resetPropertyEditorData();\n // show up\n this.propEditor.show();\n this.propEditor.focus();\n LayoutMng.singleton.screen.render();\n }", "function settings(e) {\n e.detail.applicationcommands = {\n \"divAccount\": { href: \"accountSettings.html\", title: \"Account\" },\n \"divPrivacy\": { href: \"privacySettings.html\", title: \"Privacy\" },\n };\n WinJS.UI.SettingsFlyout.populateSettings(e);\n }", "function btnSearchFirmware()\n{\n\tdocument.getElementById(\"id_dlg_install\").style.display = '';\n\tdocument.getElementById(\"id_dlg_failed\").style.display = 'none';\n\tdocument.getElementById(\"id_dlg_search\").style.display = 'none';\n}", "function showGlobalConfig() {\n $(\"#global-setting\").show();\n $(\"#global-setting .modal-body\").html(\"\");\n settingTextarea = monaco.editor.create($(\"#global-setting .modal-body\")[0], {\n language: 'json',\n value:formatJson(JSON.stringify(rocketUser.setting)),\n wordWrap: 'on', //自行换行\n verticalHasArrows: true,\n horizontalHasArrows: true,\n scrollBeyondLastLine: false,\n contextmenu:false,\n automaticLayout: true,\n fontSize:13,\n minimap: {\n enabled: false // 关闭小地图\n }\n\n });\n}", "function displaySettings() {\n document.getElementById('settingsInput').style.display = 'block';\n document.getElementById('overlay').style.display = 'block';\n}", "function statusON() {\n\tshowStatus = true;\n\t// Setup Einstellungen Anzeigen\n\tstatusPart.style.display = \"block\";\n // Setup Botton umbenennen\n statusBtn.innerText = \"Hidde status option\";\n}", "initializeInterface() {\n // (1) Configuration button.\n this.#userInterface.configuration.addEventListener('click', () => {\n this.displayConfiguration(/* manual= */ true);\n });\n }", "function showDialogAdd() {\n var title = 'Add Parts to Locations'; \n var templateName = 'addUi'; \n var width = 600; \n \n // custom function to insert part data into the dialog box. For code modularity and simplicity\n createDialogWithPartData(title,templateName,width);\n}", "function settings()\r\n\t\t{\r\n\t\t\tdocument.getElementById('menu').style.display = \"none\";\r\n\t\t\tdocument.getElementById('settings').style.display = \"initial\";\r\n\t\t}", "function initUI() {\n\tlogMessage(REP_ITEM_NOTE, \"bc_configure_edit\", \"calling initUI --- \" + globals.editorPage);\n\t// get panel color//\n\tvar col = dw.getPanelColor();\n\tvar backgroundColor = MM.BC.UTILS.RGB2HTML(col[0], col[1], col[2]);\n\tvar loadingDiv = document.getElementById(\"loadingDiv\");\n\t\n\tvar cancel_btn = document.getElementById(\"cancelBtn\");\n\tvar cancel_btn_container = document.getElementById(\"cancelBtnContainer\");\n\tcancel_btn_container.style.width = cancel_btn.style.width;\n\t\n\tloadLoadingPage();\t \n\t\n\tloadingDiv.style.width = globals.width + \"px\";\n\tloadingDiv.style.height = globals.height + \"px\";\n\t\n\tloadingDiv.style.backgroundColor = \"#\" + backgroundColor;\n\t\n\t// Setup the browser control.\n\tglobals.browser = document.getElementById(\"bc_priority_browser\");\t\n\tglobals.browser.setAutomaticallyPromptForCredentials(false);\n\tglobals.browser.style.top = \"0px\";\n\tglobals.browser.style.left = \"0px\";\n\tglobals.browser.style.width = window.innerWidth + \"px\";\n\tglobals.browser.style.height = (window.innerHeight - 55) + \"px\";\n\t// add general listeners on browser control//\n\tif (globals.browser && globals.browser.addEventListener) {\n\t\tglobals.browser.addEventListener(\"BrowserControlBeforeNavigation\", function (e) { onBeforeNavigation(e); }, false);\n\t\tglobals.browser.addEventListener(\"BrowserControlBeforeRefresh\", function(e) { e.preventDefault(); }, false);\n\t}\n\t\n\tglobals.initedUI = true;\n\n\t// get the module code//\n\tvar dom = dw.getDocumentDOM();\n\tvar sel = dom.getSelection();\n\tif (globals.editMode) {\n\t\tglobals.moduleCode = dom.documentElement.outerHTML.substring(sel[0], sel[1]);\n\t}\n\tglobals.targetURL = globals.editorPage;\n\t// show loading state//\n\tshowLoadingState();\n\t// if we have a site token//\n\tif (MM.BC.TOKENS.getSiteToken(MM.BC.SITE.getSiteID())) {\n\t\t// if we don't have a site token, start api calls//\n\t\tbrowseTo(MM.BC.CONSTANTS.BC_LOCAL_PAGE, true, function() {\n\t\t\t// load module editor page//\n\t\t\tloadModuleEditorPage();\t\t\n\t\t}, true);\n\t} else {\n\t\t// if we don't have a site token, start api calls//\n\t\tbrowseTo(MM.BC.CONSTANTS.BC_LOCAL_PAGE, true, function() {\n\t\t\tstartAPIProcesses(MM.BC.TOKENS.getGenericToken(), MM.BC.SITE.getSiteID());\n\t\t}, true);\n\t}\n}", "function updateConfigurationDisplay()\n{\n var testSuiteManifest = getTestSuiteManifest();\n var unitTestStatus = getUnitTestStatusFilter();\n var rdfaExtractorUrl = getRdfaExtractorUrl();\n var sparqlEngineUrl = getSparqlEngineUrl();\n \n document.getElementById('test-suite-selection-value').innerHTML =\n testSuiteManifest;\n document.getElementById('unit-test-status-selection-value').innerHTML =\n unitTestStatus;\n document.getElementById('rdfa-extractor-selection-value').value =\n rdfaExtractorUrl;\n document.getElementById('sparql-engine-selection-value').value =\n sparqlEngineUrl;\n}", "function setupUI() {\n //Form controls\n createElement(\"frm\", \"US Census layer controls:\");\n createP(); // spacer\n uiBoss.radio = createRadio();\n\n uiBoss.radio.option(\"sex\", \"Sex\");\n uiBoss.radio.option(\"race\", \"Race / Ethnicity\");\n uiBoss.radio.option(\"incRace\", \"Median Income by Race\");\n\n uiBoss.radio.changed(updateViz);\n\n createP(); // spacer\n uiBoss.checkbox1 = createCheckbox(\"Show state name\");\n uiBoss.checkbox1.changed(updateViz);\n\n createP(); // spacer\n uiBoss.checkbox2 = createCheckbox(\"Show median housing value\");\n uiBoss.checkbox2.changed(updateViz);\n}", "function onOpen(e) {\n SpreadsheetApp.getUi()\n .createAddonMenu()\n .addItem('Settings', 'showSettingsDialog')\n .addToUi();\n}", "function showDialog() {\r\ttry {\r\t\tvar win = new Window('dialog', localize(text.title));\r\r\t\t// description\r\t\twin.desc = win.add('panel');\r\t\twin.desc.orientation = 'row';\r\t\twin.desc.alignment = 'fill';\r\t\twin.desc.alignChildren = 'left';\r\r\t\twin.desc.coords = win.desc.add('group');\r\t\twin.desc.coords.orientation = 'row';\r\t\twin.desc.coords.add('statictext', undefined, localize(text.desc));\r\r\t\t// vertical guide settings\r\t\twin.vSettings = win.add('panel', undefined, localize(text.vSettings));\r\t\twin.vSettings.orientation = 'row';\r\t\twin.vSettings.alignment = 'fill';\r\t\twin.vSettings.alignChildren = 'center';\r\r\t\twin.vSettings.coords = win.vSettings.add('group');\r\t\twin.vSettings.coords.orientation = 'row';\r\t\twin.vSettings.coords.add('statictext', undefined, \"x:\");\r\t\twin.vSettings.coords.input = win.vSettings.coords.add('edittext', undefined, \"\");\r\t\twin.vSettings.coords.input.preferredSize = [ 125, 20 ];\r\r\t\twin.vSettings.repeat = win.vSettings.add('group');\r\t\twin.vSettings.repeat.orientation = 'row';\r\t\twin.vSettings.repeat.checkBox = win.vSettings.repeat.add('checkbox', undefined, localize(text.repeat));\r\t\twin.vSettings.repeat.checkBox.value = true;\r\r\t\t// horizontal guide settings\r\t\twin.hSettings = win.add('panel', undefined, localize(text.hSettings));\r\t\twin.hSettings.orientation = 'row';\r\t\twin.hSettings.alignment = 'fill';\r\t\twin.hSettings.alignChildren = 'center';\r\r\t\twin.hSettings.coords = win.hSettings.add('group');\r\t\twin.hSettings.coords.orientation = 'row';\r\t\twin.hSettings.coords.add('statictext', undefined, \"y:\");\r\t\twin.hSettings.coords.input = win.hSettings.coords.add('edittext', undefined, \"\");\r\t\twin.hSettings.coords.input.preferredSize = [ 125, 20 ];\r\r\t\twin.hSettings.repeat = win.hSettings.add('group');\r\t\twin.hSettings.repeat.orientation = 'row';\r\t\twin.hSettings.repeat.checkBox = win.hSettings.repeat.add('checkbox', undefined, localize(text.repeat));\r\t\twin.hSettings.repeat.checkBox.value = true;\r\r\t\t// buttons\r\t\twin.buttons = win.add('group');\r\t\twin.buttons.orientation = 'row';\r\t\twin.buttons.alignment = 'center';\r\r\t\t// ok button\r\t\twin.okBtn = win.buttons.add('button', undefined, localize(text.ok));\r\t\twin.okBtn.onClick = function() {\r\t\t\tmakeGuides(win.hSettings.coords.input.text, 'Hrzn', win.hSettings.repeat.checkBox.value);\r\t\t\tmakeGuides(win.vSettings.coords.input.text, 'Vrtc', win.vSettings.repeat.checkBox.value);\r\t\t\twin.close();\r\t\t};\r\r\t\t// cancel button\r\t\twin.cancelBtn = win.buttons.add('button', undefined, localize(text.cancel));\r\t\twin.cancelBtn.onClick = function() {\r\t\t\twin.close();\r\t\t};\r\r\t\twin.show();\r\r\t} catch (error) {}\r}", "function fnSaveConfigButtonVisibility(state) {\n var button = document.getElementById(\"create\");\n if (state === CONFIG_PHASE) {\n button.style.display = \"inline-block\";\n } else {\n button.style.display = \"none\";\n }\n}", "function showSettingsDialog() {\n var html = getSettings();\n\n html.setWidth(400);\n html.setHeight(300);\n\n SpreadsheetApp.getUi()\n .showModalDialog(html, 'Fuzzy.ai Settings');\n}", "function resetUI() {\n if (traceLib.valid) {\n setLink();\n $('.needsConfig').show();\n } else {\n $('.needsConfig').hide();\n }\n }", "function updateSocializerBox(showConfig){\r\n //clear the tabs\r\n if ( tabs.hasChildNodes() )\r\n {\r\n while ( tabs.childNodes.length >= 1 )\r\n {\r\n tabs.removeChild( tabs.firstChild ); \r\n } \r\n }\r\n \r\n var confActive = (showConfig) ? 'active' : '';\r\n var receActive = (!showConfig) ? 'active' : '';\r\n \r\n //add 'recent activity'\r\n recentA = c('div', 'newsTab ' + receActive);\r\n recentA.appendChild(recentDiv);\r\n tabs.appendChild(recentA);\r\n\r\n //add 'configuration'\r\n configA = c('div', 'newsTab ' + confActive);\r\n var configB = c('div', 'newsItem primary');\r\n \r\n //construct the inner item\r\n configDiv = c('div');\r\n configDiv.style.margin = '4px';\r\n\r\n configB.appendChild(configDiv);\r\n configA.appendChild(configB);\r\n tabs.appendChild(configA);\r\n \r\n setupConfigTab();\r\n}", "function showSettings() {\n WinJS.UI.SettingsFlyout.showSettings(\"settingsDiv\", \"settings.html\");\n}", "function configure(option, hostname)\n{\n if (confirm('Do you want to \"' + option + '\" \"' + hostname + '\" ?'))\n $.get(AII_URL + '/cgi-bin/dashboard-aii.cgi',\n {\n 'action': 'configure',\n 'hostname': hostname,\n 'option': option\n },\n function (data)\n {\n alert(data);\n location.reload();\n }).fail(function ()\n {\n alert('Error executing the command : ' + option + ' => ' + hostname);\n });\n}", "function settings (container, self) {\n // VARIABLES\n var net = yo`<div></div>`\n var networkcallid = 0\n const updateNetwork = (cb) => {\n }\n var gasPriceEl = yo`\n <div class=\"${css.crow}\">\n <div class=\"${css.col1_1}\">Gas limit</div>\n <input type=\"number\" class=\"${css.col2}\" id=\"gasLimit\" value=\"3000000\">\n </div>\n `\n var valueEl = yo`\n <div class=\"${css.crow}\">\n <div class=\"${css.col1_1}\">Value</div>\n <input type=\"text\" class=\"${css.col2_1}\" id=\"value\" value=\"0\" title=\"Enter the value and choose the unit\">\n <select name=\"unit\" class=\"${css.col2_2}\" id=\"unit\">\n <option data-unit=\"wei\">wei</option>\n <option data-unit=\"gwei\">gwei</option>\n <option data-unit=\"finney\">finney</option>\n <option data-unit=\"ether\">VET</option>\n </select>\n </div>\n `\n var environmentEl = yo`\n <div class=\"${css.crow}\">\n <div id=\"selectExEnv\" class=\"${css.col1_1}\">\n Environment\n </div>\n <div class=${css.environment}>\n ${net}\n </div>\n </div>`\n // DOM ELEMENT\n var el = yo`\n <div class=\"${css.settings}\">\n ${environmentEl}\n ${gasPriceEl}\n ${valueEl}\n </div>`\n \n\t//vide\n\tfunction connexInfo () {\n\t\t//modalDialogCustom.alert(yo`<div><iframe src='https://env.vechain.org/r/#/test/${encodeURIComponent(location.href)}'></iframe></div>`)\n\t\tmodalDialogCustom.alert(yo`<div><h3>Connex <b>not detacted</b></h3>\n\t\t\t<p class=\"mt-4 mb-4\">It is recommended to open in <b>VeChain Sync</b>.\n </p><a href=\"https://env.vechain.org/r/#/test/${encodeURIComponent(location.href)}\" target=\"_blank\" style=\"background:#0069d9;color:#fff;padding:3px 8px;text-decoration:none\">Open in</a> or <a href=\"https://env.vechain.org\" target=\"_blank\">Download</a> VeChain Sync.<p>or download <a href=\"https://chrome.google.com/webstore/detail/comet/jpkkakbelpcambmhdcaoidiejaikiemn\" target=\"_blank\">Comet</a> extension for Chrome</p>\n </div>`)\n\t}\n\tfunction fetchNetwork () {\n\t\tsetTimeout(function(){\n\t\t\tvar netId = getNetwork()\n\t\t\tvar el;\n\t\t\tif(netId == 1){\n\t\t\t\tel = yo`<span style=\"color:#fff;background-color:#007bff;font-weight:bold;padding:3px 10px;border-radius:4px;\">Mainnet</span>`\n\t\t\t} else if(netId == 2 || netId == 3){\n\t\t\t\tel = yo`<span style=\"color:#000;background-color:#ffc107;font-weight:bold;padding:3px 10px;border-radius:4px;\">Testnet</span>`\n\t\t\t} else{\n\t\t\t\tel = yo`<div><span style=\"color:red\">can't detect connex</span> <i class=\"fa fa-question-circle ${css.infoDeployAction}\" aria-hidden=\"true\" style=\"cursor:pointer\" title=\"Click to see details.\" onclick=${connexInfo}></i></div>`\n\t\t\t}\n\t\t\tnet.appendChild(el)\n\t\t}, 1000)\n\t}\n\tfetchNetwork();\n\t\n // HELPER FUNCTIONS AND EVENTS\n self._deps.udapp.event.register('transactionExecuted', (error, from, to, data, lookupOnly, txResult) => {\n if (error) return\n if (!lookupOnly) el.querySelector('#value').value = '0'\n updateAccountBalances(container, self)\n })\n\n // DROPDOWN\n var selectExEnv = environmentEl.querySelector('#selectExEnvOptions')\n\n function setFinalContext () {\n // set the final context. Cause it is possible that this is not the one we've originaly selected\n self.event.trigger('clearInstance', [])\n updateNetwork()\n fillAccountsList(el, self)\n }\n\n self.event.register('clearInstance', () => {\n var instanceContainer = self._view.instanceContainer\n var instanceContainerTitle = self._view.instanceContainerTitle\n instanceContainer.innerHTML = '' // clear the instances list\n instanceContainer.appendChild(instanceContainerTitle)\n instanceContainer.appendChild(self._view.noInstancesText)\n })\n\n executionContext.event.register('removeProvider', (name) => {\n var env = selectExEnv.querySelector(`option[value=\"${name}\"]`)\n if (env) {\n selectExEnv.removeChild(env)\n tootip(`${name} removed`)\n }\n })\n\n\n //selectExEnv.value = executionContext.getProvider()\n executionContext.event.register('contextChanged', (context, silent) => {\n setFinalContext()\n })\n\n setInterval(() => {\n updateNetwork()\n fillAccountsList(el, self)\n }, 5000)\n\n setInterval(() => {\n updateAccountBalances(container, self)\n }, 10000)\n\n function newAccount () {\n self._deps.udapp.newAccount('', (error, address) => {\n if (!error) {\n addTooltip(`account ${address} created`)\n } else {\n addTooltip('Cannot create an account: ' + error)\n }\n })\n }\n function signMessage (event) {\n self._deps.udapp.getAccounts((err, accounts) => {\n if (err) { addTooltip(`Cannot get account list: ${err}`) }\n var signMessageDialog = { 'title': 'Sign a message', 'text': 'Enter a message to sign', 'inputvalue': 'Message to sign' }\n var $txOrigin = container.querySelector('#txorigin')\n var account = $txOrigin.selectedOptions[0].value\n var isVM = executionContext.isVM()\n var isInjected = executionContext.getProvider() === 'injected'\n function alertSignedData (error, hash, signedData) {\n if (error && error.message !== '') {\n console.log(error)\n addTooltip(error.message)\n } else {\n modalDialogCustom.alert(yo`<div><b>hash:</b>${hash}<br><b>signature:</b>${signedData}</div>`)\n }\n }\n if (isVM) {\n modalDialogCustom.promptMulti(signMessageDialog, (message) => {\n const personalMsg = ethJSUtil.hashPersonalMessage(Buffer.from(message))\n var privKey = self._deps.udapp.accounts[account].privateKey\n try {\n var rsv = ethJSUtil.ecsign(personalMsg, privKey)\n var signedData = ethJSUtil.toRpcSig(rsv.v, rsv.r, rsv.s)\n alertSignedData(null, '0x' + personalMsg.toString('hex'), signedData)\n } catch (e) {\n addTooltip(e.message)\n return\n }\n }, false)\n } else if (isInjected) {\n modalDialogCustom.promptMulti(signMessageDialog, (message) => {\n const hashedMsg = executionContext.web3().sha3(message)\n try {\n executionContext.web3().eth.sign(account, hashedMsg, (error, signedData) => {\n alertSignedData(error, hashedMsg, signedData)\n })\n } catch (e) {\n addTooltip(e.message)\n console.log(e)\n return\n }\n })\n } else {\n modalDialogCustom.promptPassphrase('Passphrase to sign a message', 'Enter your passphrase for this account to sign the message', '', (passphrase) => {\n modalDialogCustom.promptMulti(signMessageDialog, (message) => {\n const hashedMsg = executionContext.web3().sha3(message)\n try {\n var personal = new Personal(executionContext.web3().currentProvider)\n personal.sign(hashedMsg, account, passphrase, (error, signedData) => {\n alertSignedData(error, hashedMsg, signedData)\n })\n } catch (e) {\n addTooltip(e.message)\n console.log(e)\n return\n }\n })\n }, false)\n }\n })\n }\n\n return el\n}", "function showHostsAndSettingsMode() {\r\n console.log('entering show hosts and settings mode.');\r\n $('#backIcon').hide();\r\n $('#quitCurrentApp').hide();\r\n $(\".mdl-layout__header\").show();\r\n $(\"#main-content\").children().not(\"#listener, #loadingSpinner, #naclSpinner\").show();\r\n $(\"#game-grid\").hide();\r\n $(\"#main-content\").removeClass(\"fullscreen\");\r\n $(\"#listener\").removeClass(\"fullscreen\");\r\n $(\"body\").css('backgroundColor', 'white');\r\n // We're no longer in a host-specific screen. Null host, and add it back to the polling list\r\n if(api) {\r\n beginBackgroundPollingOfHost(api);\r\n api = null; // and null api\r\n }\r\n}", "function Configuration() {\r\n\tif(!Form.checkCurrentMode(0, true)) return;\r\n\tForm.addForm();\r\n\tForm.all_or_this = 0;\t// all ****** pages\r\n\tForm.main_or_sub = 0;\t// main pages\r\n\tForm.option_check = false;\r\n\tLoadCurrentConf();\r\n\tSetCurrentConf();\r\n\tForm.option_check = true;\r\n\tForm.openForm();\r\n}", "settingsComplete() {\n this.settingsScreen[\"settings-container\"].classList.add(\"hidden\")\n this.currentScreen = \"loading\"\n this.startLoading()\n }", "function showUserSettingsDialog() {\n\tvar dispatcher = tp.dialogs.showDialog(\"userSettingsDialog\", \"#user-settings\");\n\taddEventHandlerUserSettingsDialog();\n\tvar languageElement = d3.select(\"input[name=language]\");\n\tvar currentLanguage = languageElement.property(\"value\");\n\tdispatcher\n\t\t.on(\"ok\", function() {\n\t\t\tvar newLanguage = languageElement.property(\"value\");\n\t\t\ttp.session.storeSettings('user.settings', { lang: newLanguage }, function(error, data) {\n\t\t\t\tif(error) {\n\t\t\t\t\tconsole.error(error, data);\n\t\t\t\t\ttp.dialogs.closeDialogWithMessage(dispatcher.target, \"errorDialog\", \"#store-settings-failed\");\n\t\t\t\t} else {\n\t\t\t\t\ttp.lang.setDefault(newLanguage);\t// Use chosen language for following dialogs\n\t\t\t\t\ttp.dialogs.closeDialog(dispatcher.target);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn false;\n\t\t})\n\t\t.on(\"cancel\", function() {\n\t\t\ttp.lang.setDefault(currentLanguage);\n\t\t})\n\t;\n}", "function btnOnConfigClick(content, filter_name) {\n let cfgBase = document.getElementById(\"configure\");\n cfgBase.style.display = \"none\";\n var cfgDialog = $(\"#configure\").dialog(configOpt);\n cfgDialog.dialog(\"open\");\n\n // Further dialog customization\n $(\".ui-dialog\").attr(\"style\", $(\".ui-dialog\").attr(\"style\") + \" border: solid black 2px; border-radius: 5px; background-color: gray\");\n $(\".ui-dialog-titlebar-close\").hide();\n $(\".ui-dialog-titlebar\").attr(\"style\", \"text-align: center; margin: 5px; color: black; font-weight: bold\");\n\n let okBtn = document.getElementById(\"xedx-cfgbtn-ok\");\n const c_filter_name = filter_name;\n const c_content = content;\n okBtn.addEventListener(\"click\", function() {\n btnOnApplyFilterClick(c_content, c_filter_name);\n let cfgBase = document.getElementById(\"configure\");\n cfgBase.style.display = \"none\";\n $(\"#configure\").dialog(\"close\");\n }, false);\n}", "function configurations() {\n\tif(!conf.is_drawn()) {\n\t\tpopupManager.closeAll();\n\t\tconf.draw();\n\t} else {\n\t\tconf.undraw();\n\t}\n}", "function configControls() {\n\n // Adding bootgrid config.\n configBootgrid();\n\n // Adding toastr config.\n toastrConfig();\n\n // Adding button behavior.\n newForeignClickHandler();\n}", "_configLoaded(){\n // check if to render the configurator\n var configuratorElement = this.enhancedConfig.getData().selectSingleNode(\"/*/far:Configurator\");\n if(configuratorElement){\n var treeConfig = {\n levelNodeName: \"far:Category\",\n itemNodeName: \"far:Item\",\n isDefaultCollapsed: true\n };\n this.options.targetHtml\n .find(\".bcd-far-configurator\")\n .bcduiFarConfigurator({\n dimensions_optionsModelXPath: \"$\" + this.enhancedConfig.id + \"/*/far:Configurator/far:Dimensions//*/@caption\",\n dimensions_optionsModelRelativeValueXPath: \"../@idRef\",\n dimensions_treeConfig: treeConfig,\n\n measures_optionsModelXPath: \"$\" + this.enhancedConfig.id + \"/*/far:Configurator/far:Measures//*/@caption\",\n measures_optionsModelRelativeValueXPath: \"../@idRef\",\n measures_treeConfig: treeConfig,\n\n targetModelXPath: \"$guiStatus/guiStatus:Status/far:Far[@id='\" + this.options.componentId + \"']\",\n \n doSortOptions: !!configuratorElement.selectSingleNode(\"far:Sorting[@enabled='true']\")\n });\n }\n\n // enable default context menu; TODO: implementation note, in future we many want to extend it with href to xml or inline definition\n if(this.enhancedConfig.query(\"/*/far:ContextMenu\")){\n bcdui.widget.createContextMenu({\n targetHtml : this.gridRenderingTarget,\n inputModel : new bcdui.core.SimpleModel(bcdui.config.libPath + \"js/component/far/contextMenu.xml\")\n });\n }\n // enable report filter\n if(this.enhancedConfig.query(\"/*/far:ReportFilter\")){\n // our HideUnselected option on $guiStatus\n var xPath_hideUnselected = \"/guiStatus:Status/guiStatus:ClientSettings/far:ReportFilter[@id='\" + this.options.componentId + \"']/far:HideUnselected\";\n var xPath_farLayout = \"/guiStatus:Status/far:Far[@id='\" + this.options.componentId + \"']/far:Layout/far:Columns\";\n // create options model from Dimenions and Measures suitable for universal filter widget\n var universalFilterModel = new bcdui.core.ModelWrapper({\n id : this.id + \"_universalFilterModel\",\n inputModel : this.enhancedConfig,\n chain : [function(doc){\n var newDoc = bcdui.core.browserCompatibility.createDOMFromXmlString(\"<Root/>\");\n var allItems = jQuery\n // select all Dimensions and Measures\n .makeArray( doc.selectNodes(\"/*/far:Dimensions//dm:LevelRef|/*/far:Measures//dm:Measure\") )\n // normalize to value/caption\n .map(function(n){\n return {\n value : n.getAttribute(\"id\") || n.getAttribute(\"bRef\"), // Measures/@id or dm:LevelRef/@bRef \n caption : n.getAttribute(\"caption\"),\n isDim : (n.baseName||n.localName) == \"LevelRef\"\n }\n })\n ;\n\n // if hide-unselected is enabled, keep selected only\n if(bcdui.wkModels.guiStatus.read(xPath_hideUnselected, \"0\") == \"1\"){\n // build map of our current selection\n var farLayoutItems = jQuery.makeArray(\n bcdui.wkModels.guiStatus.getData().selectNodes(xPath_farLayout + \"/*\")\n ).reduce(function(map, n){\n map[(n.getAttribute(\"idRef\") || n.getAttribute(\"bRef\"))] = null;\n return map;\n },{});\n \n allItems = allItems.filter(function(item){ // value,caption object\n return farLayoutItems.hasOwnProperty(item.value);\n });\n }\n\n allItems\n // sort by caption\n .sort(function(a,b){\n return a.caption < b.caption ? -1 : a.caption == b.caption ? 0 : 1;\n })\n // write as Item/id caption\n .forEach(function(n){\n var itemEl = doc.createElement(\"Item\");\n itemEl.setAttribute(\"id\", n.value);\n itemEl.setAttribute(\"caption\", n.caption);\n if(n.isDim){\n itemEl.setAttribute(\"isDim\", \"true\"); // required by reportFilterRendering.xslt\n }\n newDoc.documentElement.appendChild(itemEl);\n });\n return newDoc;\n }]\n });\n // recompute on showAll change\n bcdui.wkModels.guiStatus.onChange(universalFilterModel.execute.bind(universalFilterModel), xPath_hideUnselected);\n // recompute on layout change\n bcdui.wkModels.guiStatus.onChange(universalFilterModel.execute.bind(universalFilterModel), xPath_farLayout);\n // recompute on enhancedConfig change\n this.enhancedConfig.onChange(universalFilterModel.execute.bind(universalFilterModel));\n\n // render filter widget\n var targetModelXPathReportFilter = \"/guiStatus:Status/f:Filter/f:And[@id='\" + this.options.componentId + \"']\";\n var reportFilterContainer = this.options.targetHtml.find(\".bcd-far-filter\");\n reportFilterContainer.bcduiUniversalFilterNg({\n targetModelXPath : \"$guiStatus\" + targetModelXPathReportFilter,\n bRefOptionsModelXPath : \"$\" + universalFilterModel.id + \"/*/Item/@caption\",\n bRefOptionsModelRelativeValueXPath : \"../@id\",\n renderingChain : bcdui.contextPath + \"/bcdui/js/component/far/reportFilterRendering.xslt\",\n renderingChainParameters : {\n universalFilterModel : universalFilterModel\n },\n inputRow : jQuery.extend(true, { // internal widget API\n renderingChain : bcdui.contextPath + \"/bcdui/js/component/far/reportFilterInputRendering.dott\", // we need custom UI here for the HideUnselected option\n renderingChainParameters : {\n xPath_hideUnselected : \"$guiStatus\" + xPath_hideUnselected\n }\n }, this.options.reportFilter != null ? this.options.reportFilter.inputRow : null)\n });\n\n /*\n * Currently, our report filters always work in Having mode, which requires all items filtered to be selected in the report;\n * ensure they are and also, they must be removed from filter once deselected from the configurator.\n *\n * in /Client/src/js/component/far/model/request.xslt we map all Items from report filter as a wrq:Having filter to\n * support dim/measure combination, this requires us to ensure that all items being filtered are selected as well.\n * Add listeners here to sync between configuration and report filters\n */\n var syncReportAndFilter = function(removeMissingItemsFromFilter){\n // ensure that all items we have in report filter are selected\n var reportFilterItemMap = jQuery.makeArray(\n bcdui.wkModels.guiStatus.getData().selectNodes(targetModelXPathReportFilter + \"//f:Expression\")\n )\n .map(function(n){\n return n.getAttribute(\"bRef\")\n })\n .reduce(function(map,value){map[value]=null;return map;}, {}); // make unique, reduce to map\n var reportFilterItems = Object.keys(reportFilterItemMap); // unique item set\n\n // ensure we have them in far:Layout/far:Columns\n var farLayoutColumns = bcdui.wkModels.guiStatus.getData().selectSingleNode(\"/*/far:Far[@id='\"+this.options.componentId+\"']/far:Layout/far:Columns\");\n var missingItems = farLayoutColumns == null ? reportFilterItems : reportFilterItems.filter(function(bRef){\n return !farLayoutColumns.selectSingleNode(\"*[@bRef='\"+bRef+\"' or @idRef='\"+bRef+\"']\");\n });\n\n if(!missingItems.length){\n return; // nothing to do\n }\n\n // we can either remove the missingItems from report filter or add them into selection\n if(removeMissingItemsFromFilter){\n reportFilterContainer._bcduiWidget()._deleteElementsByRef(missingItems);\n } else {\n // lookup in enhancedConfig and create dim/meas respectively\n var configDoc = this.enhancedConfig.getData();\n var targetDoc = bcdui.wkModels.guiStatus.getData();\n var rootItemXPath = \"/*/far:Far[@id='\"+this.options.componentId+\"']/far:Layout/far:Columns\";\n missingItems.forEach(function(bRef){\n var refItem = configDoc.selectSingleNode(\"/*/far:Dimensions/dm:LevelRef[@bRef='\"+bRef+\"']|/*/far:Measures/dm:Measure[@id='\"+bRef+\"']\");\n if((refItem.localName||refItem.baseName) == \"LevelRef\"){ // dim\n bcdui.core.createElementWithPrototype(targetDoc, rootItemXPath + \"/dm:LevelRef[@bRef='\"+bRef+\"']\");\n }else{ // measure\n bcdui.core.createElementWithPrototype(targetDoc, rootItemXPath + \"/dm:MeasureRef[@idRef='\"+bRef+\"']\");\n }\n });\n bcdui.wkModels.guiStatus.fire();\n }\n };\n bcdui.wkModels.guiStatus.onChange(syncReportAndFilter.bind(this, false), targetModelXPathReportFilter); // add missing items to report\n bcdui.wkModels.guiStatus.onChange(syncReportAndFilter.bind(this, true), \"/*/far:Far[@id='\"+this.options.componentId+\"']\"); // remove missing from filter\n }\n }", "on_settings(container) {\n // It is recommended to use jquery append to this container so that one can just call up the inheritance tree\n // using super.on_settings(c) and get the parent options too.\n\n // Create a textbox for editing the widget name\n const name = $(`<input type=\"text\" class=\"round-box\" value=${this.name}>`)\n container.append('name: ')\n container.append(name)\n container.append('<br/>')\n name.on('keyup', () => {\n const new_name = name[0].value\n $(this.element).attr('plato-widget-name', new_name)\n this.name = new_name\n this.jheader.find('.plato-widget-title').html(new_name)\n })\n\n // Place initial focus here so that the user can just start typing and Enter/Esc dialog-box keybindings work.\n name.focus()\n\n //container.html('There are no settings for this widget')\n }", "function addEventHandlerUserSettingsDialog() {\n\taddEventHandlerChangeLanguage();\n\taddEventHandlerChangePasswordButton();\n}", "function showConfigureApplicationEntityDialog(entity, navItem) {\n return ensureFieldIds().then(function () {\n var options = {\n title: 'Application Properties',\n entity: spEntity.fromJSON({\n id: entity.id()\n })\n },\n navigationElementIcon = getNavigationElementIcon(entity),\n existingName = entity.name;\n\n options.entity.setField(getFieldId('core:name'), entity.name, spEntity.DataType.String);\n options.entity.setField(getFieldId('core:description'), entity.description, spEntity.DataType.String);\n options.entity.setField(getFieldId('core:hideOnDesktop'), entity.hideOnDesktop, spEntity.DataType.Bool);\n options.entity.setField(getFieldId('core:hideOnTablet'), entity.hideOnTablet, spEntity.DataType.Bool);\n options.entity.setField(getFieldId('core:hideOnMobile'), entity.hideOnMobile, spEntity.DataType.Bool);\n\n if (navigationElementIcon) {\n options.entity.setLookup(getFieldId('console:navigationElementIcon'), navigationElementIcon ? navigationElementIcon.id() : null);\n }\n\n options.entity.setDataState(spEntity.DataStateEnum.Update);\n\n return showApplicationDialog(options).then(function (result) {\n var solutionEntity,\n existingSolutionEntity = entity.inSolution;\n // navigationElementIcon;\n\n if (!result) {\n return;\n }\n\n navigationElementIcon = getNavigationElementIcon(result.entity);\n\n navItem.item.name = result.entity.name;\n navItem.item.entity.name = result.entity.name;\n navItem.item.entity.description = result.entity.description;\n navItem.item.entity.hideOnDesktop = result.entity.hideOnDesktop;\n navItem.item.entity.hideOnTablet = result.entity.hideOnTablet;\n navItem.item.entity.hideOnMobile = result.entity.hideOnMobile;\n navItem.item.entity.setLookup(getFieldId('console:navigationElementIcon'), navigationElementIcon ? navigationElementIcon : null);\n checkIconEntityStyle(navigationElementIcon);\n\n if (entity.inSolution &&\n existingSolutionEntity.name === existingName) {\n // Rename the solution as well if the top menu only belongs to one solution\n // and the solution's name matches the top menu's old name\n solutionEntity = spEntity.fromJSON({\n id: existingSolutionEntity.id(),\n name: result.entity.name || '',\n description: result.entity.description || '',\n hideOnDesktop: result.entity.hideOnDesktop,\n hideOnTablet: result.entity.hideOnTablet,\n hideOnMobile: result.entity.hideOnMobile\n });\n solutionEntity.setLookup('console:applicationIcon', navigationElementIcon ? navigationElementIcon : null);\n solutionEntity.setDataState(spEntity.DataStateEnum.Update);\n\n spEntityService.putEntity(solutionEntity).then(function () {\n existingSolutionEntity.name = result.entity.name;\n existingSolutionEntity.setLookup('console:applicationIcon', navigationElementIcon ? navigationElementIcon : null);\n }, function (error) {\n spAlertsService.addAlert('Failed to update application ' + existingName + '. ' + (error.data.ExceptionMessage || error.data.Message), {\n severity: spAlertsService.sev.Error,\n expires: true\n });\n });\n }\n });\n });\n }", "function displayGmailSettings() {\n show('gmail-settings');\n hide('gmail-content');\n}", "function showSettingsPane() {\n //only show the settings pane\n $('#loginPane').hide();\n // hide the main screen\n $('#mainScreen').css('display', 'none');\n // show the settings screen\n $('#settingsPane').css('display', '');\n\n // If we have remembered the userId with which the user was signed in, allow\n // them to logout.\n if (localStorage.userID != undefined) {\n $('#logoutBtn').show();\n } else {\n $('#logoutBtn').hide();\n }\n\n document.getElementById(\"userName\").innerHTML = \"Display Name: \" + googleUserName;\n document.getElementById(\"email\").innerHTML = \"Email: \" + googleUserEmail;\n document.getElementById(\"domain\").innerHTML = \"Domain: \" + ID_PROVIDER_DOMAIN;\n document.getElementById(\"localRegId\").innerHTML = \"Local RegId: \" + userRegId;\n document.getElementById(\"localPIN\").innerHTML = \"Local PIN: \" + userPin;\n document.getElementById(\"registrationState\").innerHTML = \"Registration State: \" + regState;\n}", "function iniciar() {\n configurarBotonesMesas();\n configurarBotonesMenu();\n}", "function initPage(sMode) {\n \n bindConfigurationTemplate();\n setFocusToField(\"lkpDepotCode\");\n hideDiv(\"lnkReset\");\n hideDiv(\"divDetail\");\n}", "showStylesDialog() {\n if (this.stylesDialogModule && !this.isReadOnlyMode && this.viewer) {\n this.stylesDialogModule.show();\n }\n }", "function HRdisplaySettingsMenu() {\r\n $('.settings-menu-btn').on('click', function(e) {\r\n var $this = $(this),\r\n target = $('#' + $this.attr('aria-controls'));\r\n\r\n if( target.attr('hidden') ){\r\n target.removeAttr('hidden');\r\n $this.attr('aria-expanded', true);\r\n\r\n setTimeout(function(){\r\n target.addClass('open');\r\n }, 10);\r\n } else {\r\n target.removeClass('open');\r\n\r\n setTimeout(function(){\r\n target.attr('hidden', true);\r\n $this.attr('aria-expanded', false);\r\n }, 250);\r\n }\r\n });\r\n\r\n if ($('.layoutSize').hasClass('locked')) {\r\n $('.layout-switcher button').addClass('disabled');\r\n }\r\n}", "function postSetGUIConfig() {\n\tvar values = null;\n\tif (values != null) {\n\t\t// initialize defaults\n\t\tbulk_value_edit = false;\n\t\tcell_value_edit = false;\n\t\t$('#enableEdit').css('display', 'none');\n\t\tfile_download = false;\n\t\tview_tags = false;\n\t\tview_URL = false;\n\t\t\n\t\tif (values.contains('bulk_value_edit')) {\n\t\t\tbulk_value_edit = true;\n\t\t}\n\t\tif (values.contains('cell_value_edit')) {\n\t\t\tcell_value_edit = true;\n\t\t\t$('#enableEdit').css('display', '');\n\t\t}\n\t\tif (values.contains('file_download')) {\n\t\t\tfile_download = true;\n\t\t}\n\t\tif (values.contains('view_tags')) {\n\t\t\tview_tags = true;\n\t\t}\n\t\tif (values.contains('view_URL')) {\n\t\t\tview_URL = true;\n\t\t}\n\t} else {\n\t\tbulk_value_edit = true;\n\t\tcell_value_edit = true;\n\t\t$('#enableEdit').css('display', '');\n\t\tfile_download = true;\n\t\tview_tags = true;\n\t\tview_URL = true;\n\t}\n}", "function OnOptions()\n{\n\t// show options \n\tshowOptions = true;\n}", "_configureUIWithWallet () {\n const self = this\n self._configureUIWithWallet__labels()\n self._configureUIWithWallet__color()\n }", "function SetupManualConfig(domNode, mode, args) {\n this.domNode = domNode;\n\n var backButton = domNode.getElementsByClassName('sup-back-btn')[0];\n backButton.addEventListener('click', this.onBack.bind(this), false);\n\n this.nextButton = domNode.getElementsByClassName('sup-manual-next-btn')[0];\n this.nextButton.addEventListener('click', this.onNext.bind(this), false);\n\n this.formNode = domNode.getElementsByClassName('sup-manual-form')[0];\n\n this.accountTypeNode = domNode.getElementsByClassName(\n 'sup-manual-account-type')[0];\n this.accountTypeNode.addEventListener(\n 'change', this.onChangeAccountType.bind(this), false);\n\n this.formItems = {\n common: {},\n imap: {},\n smtp: {},\n activeSync: {}\n };\n\n this.formItems.common.displayName = domNode.getElementsByClassName(\n 'sup-info-name')[0];\n this.formItems.common.displayName.value = args.displayName;\n this.formItems.common.emailAddress = domNode.getElementsByClassName(\n 'sup-info-email')[0];\n this.formItems.common.emailAddress.value = args.emailAddress;\n this.formItems.common.password = domNode.getElementsByClassName(\n 'sup-info-password')[0];\n this.formItems.common.password.value = args.password;\n\n\n this.formItems.imap.hostname = domNode.getElementsByClassName(\n 'sup-manual-imap-hostname')[0];\n this.formItems.imap.port = domNode.getElementsByClassName(\n 'sup-manual-imap-port')[0];\n this.formItems.imap.socket = domNode.getElementsByClassName(\n 'sup-manual-imap-socket')[0];\n this.formItems.imap.username = domNode.getElementsByClassName(\n 'sup-manual-imap-username')[0];\n\n this.formItems.smtp.hostname = domNode.getElementsByClassName(\n 'sup-manual-smtp-hostname')[0];\n this.formItems.smtp.port = domNode.getElementsByClassName(\n 'sup-manual-smtp-port')[0];\n this.formItems.smtp.socket = domNode.getElementsByClassName(\n 'sup-manual-smtp-socket')[0];\n this.formItems.smtp.username = domNode.getElementsByClassName(\n 'sup-manual-smtp-username')[0];\n\n this.formItems.activeSync.hostname = domNode.getElementsByClassName(\n 'sup-manual-activesync-hostname')[0];\n this.formItems.activeSync.username = domNode.getElementsByClassName(\n 'sup-manual-activesync-username')[0];\n\n for (var type in this.formItems) {\n for (var field in this.formItems[type]) {\n if (this.formItems[type][field].tagName === 'INPUT') {\n this.formItems[type][field].addEventListener(\n 'input', this.onInfoInput.bind(this));\n }\n }\n }\n\n this.requireFields('imap', true);\n this.requireFields('smtp', true);\n this.requireFields('activeSync', false);\n\n new FormNavigation({\n formElem: this.formNode,\n onLast: this.onNext.bind(this)\n });\n}", "function abrirPantallaConfig() {\n\n Menu.setApplicationMenu(null);\n pantallaConfig = new BrowserWindow({\n width: 600,\n height: 400,\n icon: __dirname + \"/icons/favi.png\",\n transparent: true,\n webPreferences: {\n nodeIntegration: true\n },\n show: false\n })\n pantallaConfig.loadFile('src/frnt/views/conexiones.html')\n pantallaConfig.on('closed', () => { pantallaConfig = null })\n pantallaConfig.once('ready-to-show', () => { pantallaConfig.show() })\n /* pantallaConfig.webContents.openDevTools() */\n}", "function configureRegister() {\n\n // Hide the alert message\n alertMessage(REGISTER_ALERT_ID, '', '', true);\n\n // Configure the button\n document.getElementById('register-account-btn').addEventListener('click', registerUser);\n}", "function showForm() {\n\t\t\teManager.trigger('cleanManagementBox');\n\t\t\ttemplates.render('csv-form', {}, function(html) {\n\t\t\t\tvar $boxContent = $('#management-box ._box-content');\n\t\t\t\t$boxContent.append(html);\n\t\t\t});\n\t\t\teManager.trigger('showManagementBox');\n\t\t}", "function regService() {\n kony.application.showLoadingScreen(null, \"Loading..\", constants.LOADING_SCREEN_POSITION_ONLY_CENTER, true, true, {\n shouldShowLabelInBottom: \"false\",\n separatorHeight: 20\n });\n if (!mobileFabricConfigurationForReg.isKonySDKObjectInitialized) {\n initializeMobileFabricForRegister();\n } else if (mobileFabricConfigurationForReg.isKonySDKObjectInitialized) {\n registerVolunteer();\n }\n}", "function showWatchConfigModalDialog() {\n\n const Role = MonitoringConsole.Model.Role;\n const actions = {};\n if (Role.isAdmin()) {\n actions.onDelete = (name, onSuccess, onError) => {\n showModalDialog(createYesNoModualDialog({\n dangerzone: true,\n title: 'Delete Watch',\n question: `Are you sure you want to delete watch <em>${name}</em>?`,\n yes: 'Delete',\n no: 'Cancel',\n onYes: () => Controller.requestDeleteWatch(name, \n wrapOnSuccess(onSuccess, `Successfully deleted watch <em>${name}</em>.`), \n wrapOnError(onError, `Failed to deleted watch <em>${name}</em>.`))\n }));\n };\n actions.onDisable = (name, onSuccess, onError) => Controller.requestDisableWatch(name, \n wrapOnSuccess(onSuccess, `Successfully disabled watch <em>${name}</em>.`), \n wrapOnError(onError), `Failed to disable watch <em>${name}</em>.`);\n actions.onEnable = (name, onSuccess, onError) => Controller.requestEnableWatch(name, \n wrapOnSuccess(onSuccess, `Successfully enabled watch <em>${name}</em>.`), \n wrapOnError(onError, `Failed to enable watch <em>${name}</em>.`)); \n }\n if (!Role.isGuest()) {\n actions.onCreate = (watch, onSuccess, onError) => showWatchBuilderModalDialog(createEditableWatch(watch), \n watch === undefined || watch.programmatic, onSuccess, onError);\n actions.onEdit = actions.onCreate;\n }\n Controller.requestListOfWatches((watches) => {\n const manager = { \n id: 'WatchManager', \n items: watches, \n colors: { red: Theme.color('red'), amber: Theme.color('amber'), green: Theme.color('green') },\n actions: actions,\n };\n showModalDialog({\n id: 'WatchSettingsModalDialog',\n title: 'Manage Watches',\n content: () => Components.createWatchManager(manager),\n buttons: [{ property: 'close', label: 'Close' }],\n results: { close: true }, \n closeProperty: 'close',\n });\n });\n }", "function showConfigurationSidebar() {\n var ui = HtmlService.createHtmlOutputFromFile('ConfigurationSidebar')\n .setTitle('Add-on configuration');\n SpreadsheetApp.getUi().showSidebar(ui);\n}", "function showOptions() {\n\tmenuHideAll();\n\t$('#options').show();\n\tmenuResetColors();\n\tmenuSetColor('optionsBox');\n}", "function showCreateAccount()\n{\n hideOrShow(\"helloButtons\", false)\n hideOrShow(\"createAccount\", true)\n hideOrShow(\"login\", false)\n hideOrShow(\"text\", false)\n hideOrShow(\"backButton\", true)\n}", "function configContentButtons() {\n\t\tvar contentId = $(\"#contentId\").val();\n\t\tif (!isEmpty(contentId)) {\n\t\t\t$(\"#btnUpdateContent\").val (\"Atualizar Conteúdo\");\n\t\t\t$(\"#lblUsernameContent\").show();\n\t\t\t$(\"#txtUsernameContent\").show();\n\t\t\t$(\"#tab-3\").css(\"height\", \"auto\");\t\t\t\n\t\t\t$(\"#lblCreationDateContent\").show();\n\t\t\t$(\"#txtCreationDateContent\").show();\n\t\t\t$(\"#lblLastUpdateDateContent\").show();\n\t\t\t$(\"#txtLastUpdateDateContent\").show();\n\t\t\t$(\"#btnDeleteContent\").show();\t\t\t\n\t\t} else {\n\t\t\t$(\"#btnUpdateContent\").val (\"Adicionar Conteúdo\");\n\t\t\t$(\"#lblUsernameContent\").hide();\n\t\t\t$(\"#txtUsernameContent\").hide();\n\t\t\t$(\"#tab-3\").css(\"height\", \"auto\");\n\t\t\t$(\"#lblCreationDateContent\").hide();\n\t\t\t$(\"#txtCreationDateContent\").hide();\n\t\t\t$(\"#lblLastUpdateDateContent\").hide();\n\t\t\t$(\"#txtLastUpdateDateContent\").hide();\t\t\t\n\t\t\t$(\"#btnDeleteContent\").hide();\n\t\t}\n\t}", "function showOptionsElem() {\n\toptionsElem.style.visibility = \"visible\";\n}", "function updateConfigs(inst, ui) {\r\n if (inst.spiManager == \"User\") {\r\n ui.spiHandle.hidden = false;\r\n ui.spiBitRate.hidden = true;\r\n } else {\r\n ui.spiHandle.hidden = true;\r\n ui.spiBitRate.hidden = false;\r\n }\r\n}", "helpTsneSettings () {\n this.dialogPromise = new Promise((resolve, reject) => {\n this.dialogDeferred = { resolve, reject };\n });\n this.dialogIsOpen = true;\n this.dialogMessage =\n 'HiPiler uses <strong>t-SNE</strong> for dimensionality reduction when ' +\n 'the number of ' +\n 'chosen measures for arranging snippets is higher than 2 or when ' +\n 'directly clicking on <em>Cluster</em>. While t-SNE works very well ' +\n 'with default settings most of the time you might want to tweak the ' +\n 'parameters to your liking. To better understand the impact of some ' +\n 'parameters please read this <a href=\"' +\n 'http://distill.pub/2016/misread-tsne/\" target=\"_blank\">excellent ' +\n 'article by Wattenberg et al.</a> and also make sure to have a look ' +\n 'at the <a href=\"https://github.com/scienceai/tsne-js#model-' +\n 'parameters\" target=\"_blank\">project page</a> of the JavaScript ' +\n 'implementation';\n\n this.dialogPromise.catch(() => {\n //Nothing\n });\n }" ]
[ "0.66428524", "0.6249317", "0.61133564", "0.6059722", "0.58882725", "0.5877399", "0.58584946", "0.58522576", "0.583835", "0.5781579", "0.5758966", "0.57413214", "0.5714511", "0.55931014", "0.55864793", "0.55803865", "0.5573363", "0.5570003", "0.55594295", "0.55532455", "0.55462736", "0.55325836", "0.55248135", "0.55169964", "0.55160034", "0.54981816", "0.54339224", "0.5433821", "0.5426817", "0.5411984", "0.5411936", "0.5403091", "0.53828806", "0.5380613", "0.537965", "0.5373422", "0.5370936", "0.5369196", "0.53494185", "0.5342417", "0.52919614", "0.52890974", "0.52835536", "0.52753395", "0.52718306", "0.52658314", "0.5248486", "0.5233074", "0.52134055", "0.52122164", "0.52021724", "0.51926255", "0.5189265", "0.51864105", "0.5183146", "0.5182132", "0.51819927", "0.51658726", "0.51606166", "0.5151749", "0.5144995", "0.51432616", "0.5139049", "0.51371694", "0.5136089", "0.51338995", "0.51213497", "0.51169413", "0.5112209", "0.51119304", "0.5103324", "0.510242", "0.51016027", "0.5099489", "0.5096958", "0.5093405", "0.50889456", "0.50849247", "0.5084761", "0.50817907", "0.50815994", "0.50802803", "0.50713843", "0.5071115", "0.50667477", "0.50593835", "0.505454", "0.5051134", "0.5045294", "0.5042813", "0.50379026", "0.50364524", "0.50337017", "0.50295544", "0.50272727", "0.5024232", "0.50220054", "0.50208557", "0.50173247", "0.5013535" ]
0.6134289
2
Changes the mode of the venue list
function pag_changeVenueSelection(mode) { pag_xmlRpcClient.call("changeVenueSelection", mode); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "exitFullMode() {\n if (!this.isListMode) {\n this._mode = 'list';\n this.dispatchEvent(new Event('modechange'));\n }\n }", "setMode(mode) {\n this.mode.current = mode;\n this.$location.search('mode', mode);\n return this.setFilters();\n }", "changeGameMode(mode) {\n DATA.difficultyMode = mode;\n VIEW.displayDifficulty();\n }", "changeMode() {\n this.attendBooths = !this.attendBooths;\n }", "function setGameMode(mode) {\n gameMode = mode;\n decks.player2.name = (mode === 'ai')? 'Mr. AI' : 'Player 2';\n updatePlayerStatuses();\n}", "switchMode(newMode: Mode) {\n this.mode = newMode;\n }", "function fhArrival_viewMode() {\n\n\tjQuery('.fhArrival_editMode').hide();\n\tjQuery('.fhArrival_viewMode').show();\n\tif (fhArrival_data.arrival.arrival_archived == 1) {\n\t jQuery('#fhArrival_labelArchived').show();\n\t jQuery('#fhArrival_btnArchivedToggle').html('Annulla archiviazione');\n\t} else {\n\t\tjQuery('#fhArrival_labelArchived').hide();\n\t\tjQuery('#fhArrival_btnArchivedToggle').html('Archivia lista di carico');\n\t}\n\t\n\tfhArrival_data.currentMode = \"VIEW\";\n\t\n}", "function selectMode(e){\n\t\t\t\tmode = $(\".mode-select option:selected\").val();\n\n\t\t\t\tif(mode != \"explore\"){\n\t\t\t\t\t$(\".explore\").hide();\n\t\t\t\t\t$(\".stats-table .charged, .stats-table .fast\").hide();\n\t\t\t\t\t$(\".stats-table .\"+mode).show();\n\t\t\t\t\t$(\".move-table-container\").show();\n\n\t\t\t\t\tself.displayMoves();\n\n\t\t\t\t} else{\n\t\t\t\t\t$(\".move-table-container\").hide();\n\t\t\t\t\t$(\".explore\").show();\n\t\t\t\t\t$(\".loading\").hide();\n\t\t\t\t}\n\n\t\t\t\tself.pushHistoryState(mode);\n\t\t\t}", "handleModeChange() {\n const {controller, mode} = this.props;\n let nextMode = SONG_PLAY_MODE_REPEAT;\n\n switch (mode) {\n case SONG_PLAY_MODE_REPEAT:\n nextMode = SONG_PLAY_MODE_LOOP;\n break;\n case SONG_PLAY_MODE_LOOP:\n nextMode = SONG_PLAY_MODE_SHUFFLE;\n break;\n case SONG_PLAY_MODE_SHUFFLE:\n break;\n }\n // change mode\n controller\n .mode(nextMode)\n .updatePlayList();\n }", "set(mode) {\n this.oldMode = this.mode;\n this.mode = mode;\n this.updateUITools();\n }", "function changeMode() {\n\tif (editMode) {\n\t\teditMode = false;\n\t\tdrawingManager.setMap(null);\n\t\tdocument.getElementById ( \"editAreaMenu\" ).style.display = \"none\";\n\t\tdocument.getElementById ( \"viewMenu\" ).style.display = \"block\";\n\n\t\tselectedArea = null;\n\t\tdocument.getElementById(\"textInputAreaName\").oninput = null;\n\t} else {\n\t\teditMode = true;\n\t\tdrawingManager.setMap(map);\n\t\tdocument.getElementById ( \"editAreaMenu\" ).style.display = \"block\";\n\t\tdocument.getElementById ( \"viewMenu\" ).style.display = \"none\";\n\n\t\tdocument.getElementById(\"textInputAreaName\").oninput = function(){\n\t\t\tselectedArea.label.set('text', document.getElementById(\"textInputAreaName\").value);\n\t\t\tselectCircle(selectedArea.circle);\n\t\t\tif(selectedArea.status == 'old'){\n\t\t\t\tselectedArea.status = 'changed';\n\t\t\t}\n\t\t};\n\t}\n\t\n\tfor(i = 0; i < sizeListArea; ++i){\n\t\tlistArea[i].circle.setEditable(editMode);\n\t}\n}", "function modeSwitch(mode) {\n\tresetViews();\n resetCameras();\n\tswitch(mode) {\n\t\tcase \"absolute\":\n\t\t\tupdateShipData(true);\n\t\t\tstepSize = 1; // reset step size\n\t\t\tcurrentMode = 1;\n\t\tbreak;\n\t\tcase \"relative\":\n\t\t\tupdateShipData(false);\n\t\t\tstepSize = Math.PI/64; // reset step size\n\t\t\tcurrentMode = 2;\n\t\tbreak;\n\t\tcase \"geosynchronous\":\n\t\t\tupdateShipData(false);\n\t\t\tcurrentPlanet = 3;\n\t\t\tcurrentMode = 3;\n\t\t\tupdateGeoSyncLookAt(earth, false);\n\t\tbreak;\n\t}\n}", "function gameMode(mode) {\n gameType = mode;\n activePlayerIndex = 0;\n toggle($('[data-menu]'), 'is-open');\n clearScore();\n clearBoard();\n}", "function updateMode(mode) {\n\n // LOOP THROUGH MODES ARRAY AND SELECT/DESELECT AS NEEDED\n for (var i = 0; i < modes.length; i++) {\n // DOM ELEMENT FOR EACH MODE DISPLAY\n var d = document.getElementById(modes[i] + '-display');\n // DOM ELEMENT FOR EACH MODE BUTTON\n var l = document.getElementById(modes[i]);\n\n // LOOP THROUGH MODES TO FIND WHAT WAS SELECTED\n if (mode === modes[i]) {\n // FOR THE SELECTED MODE\n // TOGGLE CORRESPONDING DISPLAY TO DISPLAY\n d.classList.add('active-display');\n // ADD SELECTED CLASS\n l.classList.add('btn-selected');\n // UPDATE ARIA PRESSED STATE\n l.setAttribute('aria-pressed', 'true');\n // SET AS ACTIVE\n activeMode = modes[i];\n } else {\n // FOR THE UNSELECTED MODES\n // HIDE THEIR DISPLAY\n d.classList.remove('active-display');\n // REMOVE SELECTED CLASS\n l.classList.remove('btn-selected');\n // UPDATE ARIA PRESSED STATE\n l.setAttribute('aria-pressed', 'false');\n }\n }\n}", "function changeMode(e){\n //removes the selected class from the current mode to the new selected mode\n document.getElementById(modeType).className = \" \"; \n modeType = e.target.id;\n document.getElementById(modeType).className = \"selected\";\n }", "setMode(mode) {\n this._mode = mode;\n }", "function selectTravelMode(mode){\n setCurrentTravelMode(mode);\n closeWindowsReset();\n $(\"#mode-menus\").hide(200);\n $(\"#travel-mode-popup-menu\").show();\n}", "ChangeSearchMode(mode) {\n console.log('Changed');\n if (mode == 'Gif') {\n //Set showSticker var depending on the received mode\n this.showStickersChange.emit(false);\n }\n else {\n this.showStickersChange.emit(true);\n }\n }", "function showListInMode(showingMode){\n\n \n let currentMode = localStorage.getItem(\"currentMode\");\n let dataList = JSON.parse(localStorage.getItem(\"allData\"));\n\n\n // if(currentMode == showingMode)\n // \treturn ;\n // else\n \tlocalStorage.setItem(\"currentMode\" , showingMode);\n\n\n\n for(let i = 0;i < dataList.length ; ++i){\n\n\n \t if(dataList[i].status == showingMode || showingMode == \"all\"){\n \t \t document.getElementById(dataList[i].task).style.display = 'block' ;\n \t }\n \t else\n document.getElementById(dataList[i].task).style.display = 'none' ;\n\n }\n\n }", "function selectMode(e){\n\t\t\t\tvar currentMode = self.battleMode;\n\n\t\t\t\te.preventDefault();\n\n\t\t\t\tself.battleMode = $(e.target).attr(\"data\");\n\n\t\t\t\t$(e.target).parent().find(\"a\").removeClass(\"selected\");\n\t\t\t\t$(e.target).addClass(\"selected\");\n\n\t\t\t\t$(\"p.description\").hide();\n\t\t\t\t$(\"p.\"+self.battleMode).show();\n\n\t\t\t\t$(\".poke-select-container\").removeClass(\"single multi matrix\");\n\t\t\t\t$(\".poke-select-container\").addClass(self.battleMode);\n\n\t\t\t\t$(\".battle-results\").hide();\n\n\t\t\t\tif(self.battleMode == \"single\"){\n\t\t\t\t\tif(pokeSelectors[0].getPokemon()){\n\t\t\t\t\t\tpokeSelectors[0].setSelectedPokemon(pokeSelectors[0].getPokemon());\n\t\t\t\t\t}\n\n\t\t\t\t\tif(pokeSelectors[1].getPokemon()){\n\t\t\t\t\t\tpokeSelectors[1].setSelectedPokemon(pokeSelectors[1].getPokemon());\n\t\t\t\t\t}\n\n\t\t\t\t\tdocument.title = \"Battle | PvPoke\";\n\t\t\t\t\t//$(\"#favicon\").attr(\"href\", webRoot+\"img/favicon.png\");\n\t\t\t\t}\n\n\t\t\t\tif(self.battleMode == \"matrix\"){\n\t\t\t\t\t$(\".poke.multi .custom-options\").show();\n\n\t\t\t\t\twindow.history.pushState({mode: \"matrix\"}, \"Battle\", webRoot + \"battle/matrix/\");\n\n\t\t\t\t\t// Update document title and favicon\n\t\t\t\t\tdocument.title = \"Matrix | PvPoke\";\n\t\t\t\t\t//$(\"#favicon\").attr(\"href\", webRoot+\"img/favicon_matrix.png\");\n\t\t\t\t}\n\n\t\t\t\tif(self.battleMode == \"multi\"){\n\t\t\t\t\tdocument.title = \"Multi-Battle | PvPoke\";\n\t\t\t\t\t//$(\"#favicon\").attr(\"href\", webRoot+\"img/favicon_multi_battle.png\");\n\t\t\t\t}\n\n\t\t\t\t// Load default meta group when switching to Multi Battle\n\t\t\t\tif((self.battleMode == \"multi\") && (! settingGetParams)){\n\t\t\t\t\tupdateMultiBattleMetas()\n\t\t\t\t}\n\n\t\t\t\t// When moving between Multi and Matrix, move multi custom group to the right Matrix group\n\t\t\t\tif(currentMode == \"multi\" && self.battleMode == \"matrix\"){\n\t\t\t\t\tmultiSelectors[1].setPokemonList(multiSelectors[0].getPokemonList());\n\t\t\t\t\tmultiSelectors[0].setPokemonList([]);\n\t\t\t\t}\n\n\t\t\t\t// And vice versa\n\t\t\t\tif(currentMode == \"matrix\" && self.battleMode == \"multi\"){\n\t\t\t\t\tmultiSelectors[0].setPokemonList(multiSelectors[1].getPokemonList());\n\t\t\t\t\tmultiSelectors[1].setPokemonList([]);\n\t\t\t\t}\n\n\t\t\t\t// Reset all selectors to 1 shield\n\n\t\t\t\tfor(var i = 0; i < pokeSelectors.length; i++){\n\t\t\t\t\tpokeSelectors[i].setShields(1);\n\t\t\t\t}\n\n\t\t\t\tfor(var i = 0; i < multiSelectors.length; i++){\n\t\t\t\t\tmultiSelectors[i].setShields(1);\n\t\t\t\t}\n\t\t\t}", "function setEditOrCreateMode(mode)\n {\n $(invoke_button).data(\"mode\", mode)\n }", "function fhArrival_editMode() {\n\n\tjQuery('.fhArrival_viewMode').hide();\n\t\n\tjQuery('.fhArrival_viewField').each(function () {\n\t\tvar editField = jQuery(this).attr('data-view-for');\n\t\tjQuery('#' + editField).val(jQuery(this).html());\n\t})\n\t\n\tjQuery('.fhArrival_editMode').show();\n\t\n\tfhArrival_data.currentMode = \"EDIT\";\n\t\n}", "function switchMode(mode) {\n\tvar modeData = modes[mode];\n\tif (!modeData) {\n\t\tconsole.log(\"No mode found for \" + mode);\n\t} else {\n\t\tui.mode = modeData;\n\t\tconsole.log(\"Start: \" + modeData.title);\n\n\t\t// Set the title and clear the UI\n\t\t$(\"#left-col > .section-header > .section-title\").html(modeData.title);\n\t\t$(\"#main-entities\").html(\"\");\n\t\t$(\"#side-entities\").html(\"\");\n\n\t\t// Custom behavior\n\t\tmodeData.onStart();\n\n\t\t// Record as the last mode\n\t\tlocalStorage.setItem(\"lastMode\", mode);\n\n\t}\n}", "function changeMode() {\n if ($(\"#mode\").html() === \"EASY MODE\") {\n $(\"#mode\").html(\"ADVANCED MODE\"); //Change title of menu link\n $(\"#advancedMode\").css(\"display\", \"none\"); // hide Advance Mode elements\n $(\"#easyMode\").css(\"display\", \"block\"); // unhide Easy Mode elements\n } else {\n $(\"#mode\").html(\"EASY MODE\"); //Change title of menu link\n $(\"#easyMode\").css(\"display\", \"none\"); // hide Easy Mode elements\n $(\"#advancedMode\").css(\"display\", \"flex\"); // unhide Advance Mode elements\n\n }\n}", "function modeSet(m,s){\n\n\tviewMode = m;\n\t$('#viewMode a').removeClass('me');\n\t$('#main').removeClass('mode-icon').removeClass('mode-list');\n\n\tif(viewMode == 'icon'){\n\t\t$('#viewModeIcon').addClass('me');\n\t\t$('#main').addClass('mode-icon');\n\t\tminH = 200;\n\t\t\n\t\t$('.iconeaction').css({'display':'none', 'opacity':0});\n\t}else\n\tif(viewMode == 'list'){\n\t\t$('#viewModeList').addClass('me');\n\t\t$('#main').addClass('mode-list');\n\t\tminH = 40;\n\t}\n\n\tminW = minH*factor;\n\t\n\tsliderInit();\n\t\n\tif(collection.length > 0){\n\t\tfolderDisplay();\n\t\tfolderElementResizeReload();\n\t}\n}", "function setNewMode(nMode) {\r\n\t//do nothing\r\n}", "function setNewMode(nMode) {\r\n\t//do nothing\r\n}", "function setNewMode(nMode) {\r\n\t//do nothing\r\n}", "function selectMode(e){\n\t\t\t\tpartySize = 3;\n\t\t\t\tmode = $(\".mode-select option:selected\").val();\n\n \t\t\t\tif(mode == \"tournament\"){\n\t\t\t\t\tpartySize = 6;\n\t\t\t\t}\n\n\t\t\t\tfor(var i = 0; i < multiSelectors.length; i++){\n\t\t\t\t\tmultiSelectors[i].setMaxPokemonCount(partySize);\n\t\t\t\t}\n\t\t\t}", "function onModeChange(inst, ui)\n{\n // Update group configs based on mode selected\n networkScript.setBeaconSuperFrameOrders(inst, ui);\n oadScript.setDefaultOadBlockReqRate(inst);\n oadScript.setDefaultOadBlockReqPollDelay(inst);\n\n // Set visibility of network group dependents\n networkScript.setNetworkConfigHiddenState(inst, ui, \"channels\");\n networkScript.setNetworkConfigHiddenState(inst, ui, \"fhChannels\");\n networkScript.setNetworkConfigHiddenState(inst, ui, \"fhAsyncChannels\");\n networkScript.setNetworkConfigHiddenState(inst, ui, \"fhNetname\");\n networkScript.setNetworkConfigHiddenState(inst, ui, \"fhBroadcastDwellTime\");\n networkScript.setNetworkConfigHiddenState(inst, ui, \"fhBroadcastInterval\");\n\n // Polling interval not used in beacon mode\n networkScript.setNetworkConfigHiddenState(inst, ui, \"pollingInterval\");\n}", "function changeMode() {\n\n\tlet visibleContent = $('#switchMode').find('.visible').first()\n\tlet hiddenContentIcon = $('#switchMode').find('.hidden').first().find('.icon').first()\n\n\tif (visibleContent.html().includes('VIDEO')) {\n\t\tvisibleContent.html('SWITCH TO IMAGE MODE')\n\t} else {\n\t\tvisibleContent.html('SWITCH TO VIDEO MODE')\n\t}\n\n\thiddenContentIcon.toggleClass('image')\n\thiddenContentIcon.toggleClass('video')\n}", "function setNewMode(nMode) {\n\t//do nothing\n}", "function setNewMode(nMode) {\n\t//do nothing\n}", "enterFullMode() {\n if (!this.isFullMode) {\n this._mode = 'full';\n this.dispatchEvent(new Event('modechange'));\n }\n }", "function setMode(newMode, force) {\n\n let oldMode = storedGameState.mode;\n\n if ((newMode === storedGameState.mode) && !force) {\n return;\n }\n\n if ((newMode !== MODE_REVEAL) || (force === true)) {\n changeMode(oldMode, newMode);\n } else {\n if (confirm('Are you sure? Revealing the map somewhat spoils the game.')) {\n changeMode(oldMode, newMode);\n }\n }\n}", "function updateAreaList() {\n\n}", "function setTravelMode(mode) {\n vm.travelMode = mode;\n // When a user selects a travelmode the bottomnav will automatically close\n openNav();\n }", "function setMode(mode) {\n\tlocalSet({mode});\n\treturn false;\n}", "function setMode(e) {\n console.log(`current mode was: ${currentMode}`);\n currentMode = e.target.getAttribute('id');\n console.log(`current mode is now: ${currentMode}`);\n}", "changeMode(mode) {\n\t\treturn this.call('set_mode', [ mode ], {\n\t\t\trefresh: [ 'power', 'mode' ],\n\t\t\trefreshDelay: 200\n\t\t})\n\t\t\t.then(MiioApi.checkOk)\n\t\t\t.catch(err => {\n\t\t\t\tthrow err.code === -5001 ? new Error('Mode `' + mode + '` not supported') : err;\n\t\t\t});\n\t}", "function toggleMode(){\n\n\tconsole.log(objects);\n\n\toptions.mode = options.mode == \"MODE_IDLE\" ? \"MODE_ACTIVE\" : \"MODE_IDLE\";\n\t$('#modeButton').text(options.mode);\n\n\tif(options.mode==\"MODE_IDLE\"){\n\t\tdestroyAllIdleObjects();\n\t}\n}", "function setMode(newMode) {\r\n if (_self.mode !== newMode) {\r\n _self.mode = newMode;\r\n if (!_self.current.parent) {\r\n _self.browseCurrent = _self.current;\r\n }\r\n else {\r\n _self.browseCurrent = _self.current.parent;\r\n }\r\n _self.emit('statusUpdate', _self.browseCurrent);\r\n return true;\r\n }\r\n return false;\r\n }", "function change_mode() {\n\tvar msg = \"\\nYou are about to change the survey mode from development to production.\\n\"\n\t\t+ \"Are you sure to continue this operation?\\n\";\n\tvar url = \"dev2prod?s=\" + sid;\n\tif (confirm(msg))\n\t\tlocation.replace(url);\n\telse\n\t\treturn;\n}", "function switch_vocabulary(vid) {\n var settings = {\n 'div': \"#products-selector\",\n 'class': \"product-ubrowser\",\n 'vid': vid,\n 'filter': $('#edit-product-filter').val(),\n 'search': \"true\",\n 'nids': \"true\",\n 'nodesg': \"product\",\n 'nodepl': \"products\",\n 'multi': \"true\",\n 'select': \"buffer_products()\"\n };\n\n display_ubrowser(Drupal.settings.basePath, settings);\n}", "function changeSettings(format) {\n switch (format) {\n case 1:\n document.getElementById('list').style.display = \"none\";\n toggleCategories('flex');\n currentView = 1;\n break;\n case 2:\n toggleCategories(\"none\");\n document.getElementById('list').style.display = \"inline-block\";\n currentView = 2;\n break;\n default:\n break;\n }\n}", "changeAppMode(newMode, memberId, memberName){\n //console.log('Change mode => ' + newMode + ' => ' + memberId + ' => ' + memberName);\n\n this.setState({currentMode: newMode});\n if(memberId !== undefined){\n this.setState({memberId: memberId});\n }\n\n if(memberName !== undefined){\n this.setState({memberName: memberName});\n }\n \n //this.onRender();\n }", "updateGameMode(mode) {\n this.pente.maxTime = this.interface.penteOptions.maxTime;\n let op = this.getOptionsString();\n let init = this.pente.init(mode, op);\n if(init) init.then(() => {\n this.updateMessage();\n this.board.reset();\n this.board.updateBoard(this.pente.board);\n if(mode == 4) this.botvbot();\n })\n }", "function initMode(mode, index) {\n mode.addEventListener('click', (event) => onMode(event, index));\n}", "function loadModeSettings() {\n // Parse url for a ?rank=X, where X is \"event\" or 1-MAX_RANK\n let splitUrl = window.location.href.split('#');\n splitUrl = splitUrl[0].split('?');\n if (splitUrl.length == 2) {\n let arguments = splitUrl[1].split('&');\n for (let arg of arguments) {\n let keyValue = arg.split('=');\n if (keyValue.length == 2 && keyValue[0] == \"rank\") {\n if (keyValue[1] == \"event\") {\n localStorage.setItem(\"CurrentMode\", \"event\");\n } else if (keyValue[1] == \"main\") {\n localStorage.setItem(\"CurrentMode\", \"main\");\n } else if (parseInt(keyValue[1])) {\n localStorage.setItem(\"CurrentMode\", \"main\");\n setLocal(\"main\", \"CurrentRank\", keyValue[1]);\n }\n }\n }\n }\n \n // Get values from URL params > previous save > defaults.\n currentMode = localStorage.getItem(\"CurrentMode\") || currentMode;\n currentMainRank = parseInt(getLocal(\"main\", \"CurrentRank\")) || currentMainRank;\n \n $(`#mode-select-main,#mode-select-event`).removeClass(\"active\");\n $(`#mode-select-${currentMode}`).addClass(\"active\");\n \n let title = (currentMode == \"main\") ? \"Motherland Missions\" : \"Event Missions\"\n $('#mode-select-title').text(title);\n $('#mode-select-title').addClass(\"show\");\n \n // Determine DATA.event and EVENT_ID based on the Schedule\n if (currentMode == \"event\") {\n let now = new Date();\n \n // We append \"Z\" to EndTime's ISO8601 format to ensure it is interpretted as being GMT (instead of local time).\n let prevEventIndex = SCHEDULE.Schedule.findIndex(event => new Date(event.EndTime + \"Z\") < now);\n let curEventIndex = prevEventIndex - 1; // schedule is ordered from newest to oldest.\n \n if (curEventIndex < 0) {\n $('#alertNoSchedule').addClass(\"show\");\n } else {\n EVENT_ID = SCHEDULE.Schedule[curEventIndex].LteId;\n DATA[\"event\"] = DATA[SCHEDULE.Schedule[curEventIndex].BalanceId];\n }\n }\n}", "function setMode(state) {\n var se = document.getElementById('statusInfo');\n if (state === 'edit')\n se.style.display = 'inline';\n else\n se.style.display = 'none';\n }", "ModifyListItem (Mode) \n\t{\n\t\tvar NewTodo = this.state.TodoItems;\n\t\tvar NKey = this.state.NextKey;\n\t\t\n\t\tif (this.state.Mode){\n\t\t\tNewTodo[NKey] = {id: NKey.toString(), Item: this.state.value};\n\t\t\tNKey = NKey + 1;\n\t\t\tthis.setState({NextKey: NKey});\n\t\t\t\n\t\t\talert(\"Item Added.\");\n\t\t}\n\t\telse {\n\t\t\t\t\t\n\t\t\tNewTodo[this.state.ActiveKey].Item = this.state.value;\n\t\t\t\n\t\t\talert(\"Change Confirmed.\");\n\t\t\tthis.setState({Mode: true});\n\t\t}\n\t\tthis.setState({TodoItems: NewTodo});\n\t\tthis.setState({value: \"\"});\n\t}", "changeAppMode(newMode, CveM){\n this.setState({\n currentMode: newMode,\n CveM: CveM\n });\n\n }", "function OnStructural_Change( e )\r\n{\r\n Alloy.Globals.AeDESModeSectionEight[\"STRUCTURAL\"] = e.id ;\r\n}", "changeTripReportMode(newMode) {\n\t\tlet eventDetail = {\n\t\t\tmode: newMode\n\t\t}\n\t\tif (newMode === 'edit') {\n\t\t\teventDetail.Id = this.selectedRecordId;\n\t\t}\n\n\t\t// fire the event\n\t\tconst evt = new CustomEvent('tripreportmodechange', {\n\t\t\tdetail: eventDetail\n\t\t});\n\t\tthis.dispatchEvent(evt);\n\t}", "function addModeSwitcher() {\n /* editable vs sortable mode */\n $(\"#editable-mode\").click(function() {\n console.log(\"editable mode on\");\n editMode = \"editable\";\n $(\".sortable\").sortable(\"option\", \"disabled\", true);\n changeStyleOnMode(true);\n })\n $(\"#sortable-mode\").click(function() {\n console.log(\"sortable mode on\");\n editMode = \"sortable\";\n $(\".sortable\").sortable(\"option\", \"disabled\", false);\n changeStyleOnMode(false);\n })\n}", "function flexibleMode(){\n //We reset the map\n //resetMap();\n\n //We remove the preloaded lists\n removePreloadListFromBlacklist();\n removeUserSet();\n\n //We save the new mode and we refresh the policy\n saveMode(\"flexible\");\n}", "function setMode(m) {\n\t\tmode = m;\n\t\tmarkers.setMode(m);\n\t\tif (m == GLOBE.PickMode) {\n\t\t\tatmosphere.setVisibility(false);\n\t\t\tsphere.setTexture(pickTexture);\n\t\t} else if (m == GLOBE.HeatMode) {\n\t\t\tatmosphere.setVisibility(true);\n\t\t\tsphere.setTexture(borderTexture);\n\t\t} else {\t// MapMode\n\t\t\tatmosphere.setVisibility(true);\n\t\t\tsphere.setTexture(mapTexture);\n\t\t}\n\t}", "set mode(v) {\n\n // Store it\n this._.windowmode = v\n\n // Check what to do\n if (v == Window.Mode.FullForm) {\n\n // Fill the screen\n this._.element.style.top = \"20px\"\n this._.element.style.left = \"20px\"\n this._.element.style.width = \"calc(100% - 40px)\"\n this._.element.style.height = \"calc(100% - 40px)\"\n\n } else if (v == Window.Mode.Fullscreen) {\n\n // Fill the screen\n this._.element.style.top = \"0px\"\n this._.element.style.left = \"0px\"\n this._.element.style.width = \"100%\"\n this._.element.style.height = \"100%\"\n\n } else {\n\n // Unknown view mode\n throw new Error(\"Unknown window mode supplied.\")\n\n }\n\n }", "set mode(value) {}", "designmode() {\n this.godmode();\n recipeList.recipes.filter(r=>r.recipeType === \"normal\").forEach(recipe => {\n recipe.craftCount = 99;\n })\n WorkerManager.workers[0].lvl = 9;\n HeroManager.heroes[0].owned = false;\n TownManager.fortuneUnlock = false;\n forceSave(); \n }", "function streetMode() {\n\tif (map.getMapTypeId() == \"OSM\") {\n\t\tvar l = getParam('lang');\n\t\tif (l == \"en\") {\n\t\t\talert(\"Change map layer to a google map.\");\n\t\t} else {\n\t\t\talert(\"Bitte ändern Sie die Karte zu einer Google-Karte.\");\n\t\t}\n\t} else {\n\t\tif (alerted == false) {\n\t\t\tvar l = getParam('lang');\n\t\t\tif (l == \"en\") {\n\t\t\t\talert(\"Remove the last points with 'rightclick' somewhere on the map, but not on a point.\");\n\t\t\t} else {\n\t\t\t\talert(\"Entfernen Sie den letzten Punkt mit Rechtsklick auf einen beliebigen Ort auf der Karte, aber nicht auf einen Punkt.\");\n\t\t\t}\n\t\t\talerted = true;\n\t\t}\n\t\tif (streetmode == false) {\n\t\t\t// Call enableStreetmode() function\n\t\t\tenableStreetmode();\n\t\t} else if (streetmode == true) {\n\t\t\t// Call disableStreetmode() function for clearing the overlay and removing Listener\n\t\t\tdisableStreetmode();\n\t\t}\n\t}\n}", "static toggleListing (type) {\n const listWrapper = document.querySelector('#movies-list');\n\n if (listWrapper.className !== type) {\n const links = document.querySelectorAll('.movie-filter-settings .listing');\n\n // Using simple iteration as it works in every browser (instead of forEach).\n for (let i = 0; i < links.length; i++) {\n links[i].classList.toggle('active');\n }\n\n listWrapper.className = type;\n }\n }", "get listMode() {\n\t\treturn this.__listMode;\n\t}", "function OnGeotechnical_Change( e )\r\n{\r\n Alloy.Globals.AeDESModeSectionEight[\"GEOTECHNICAL\"] = e.id ;\r\n}", "function change() {\n\n local = localStorage.getItem(\"nightmode\");\n\n if (local !== \"activado\") {\n nightmode();\n\n } else {\n daymode();\n\n }\n}", "switchMode(arg) {\n let mode = arg;\n // if force mode not provided, switch to opposite of current mode\n if (!mode || mode instanceof MouseEvent)\n mode = this.currentView === 'source' ? 'preview' : 'source';\n if (arg instanceof MouseEvent) {\n if (obsidian.Keymap.isModEvent(arg)) {\n this.app.workspace.duplicateLeaf(this.leaf).then(() => {\n var _a, _b;\n const viewState = (_a = this.app.workspace.activeLeaf) === null || _a === void 0 ? void 0 : _a.getViewState();\n if (viewState) {\n viewState.state = Object.assign(Object.assign({}, viewState.state), { mode: mode });\n (_b = this.app.workspace.activeLeaf) === null || _b === void 0 ? void 0 : _b.setViewState(viewState);\n }\n });\n }\n else {\n this.setState(Object.assign(Object.assign({}, this.getState()), { mode: mode }), {});\n }\n }\n else {\n // switch to preview mode\n if (mode === 'preview') {\n this.currentView = 'preview';\n obsidian.setIcon(this.changeModeButton, 'pencil');\n this.changeModeButton.setAttribute('aria-label', 'Edit (Ctrl+Click to edit in new pane)');\n this.renderPreview(this.recipe);\n this.previewEl.style.setProperty('display', 'block');\n this.sourceEl.style.setProperty('display', 'none');\n }\n // switch to source mode\n else {\n this.currentView = 'source';\n obsidian.setIcon(this.changeModeButton, 'lines-of-text');\n this.changeModeButton.setAttribute('aria-label', 'Preview (Ctrl+Click to open in new pane)');\n this.previewEl.style.setProperty('display', 'none');\n this.sourceEl.style.setProperty('display', 'block');\n this.editor.refresh();\n }\n }\n }", "changeMode(mode, current = false) {\n\t\t\tthis.setState(prev => {\n\t\t\t\tprev.mode = mode;\n\t\t\t\tprev.current = current;\n\t\t\t\treturn prev;\n\t\t\t})\n\t\t\tthis.seeResult = this.seeResult.bind(this)\n\t\t}", "function changeTournamentType() {\n //online event, disable location\n if ($(\"#tournament_type_id option:selected\").html() === 'online event') {\n $('#overlay-location').removeClass('hidden-xs-up');\n } else {\n $('#overlay-location').addClass('hidden-xs-up');\n }\n\n // non-tournament event, disable conclusion\n if ($(\"#tournament_type_id option:selected\").html() === 'non-tournament event') {\n $('#overlay-conclusion').removeClass('hidden-xs-up');\n $('#overlay-weekly').addClass('hidden-xs-up');\n } else {\n $('#overlay-conclusion').addClass('hidden-xs-up');\n $('#overlay-weekly').removeClass('hidden-xs-up');\n }\n recurCheck();\n}", "function setupModeButtons() {\n\t$(\".mode\").on(\"click\", function() {\n\t\t$(\".mode\").each(function() { \n\t\t\t$(this).removeClass(\"selected\");\t\t\t\n\t\t});\t\n\t\t$(this).addClass(\"selected\");\n\t\tif($(this).text() === \"Easy\") {\n\t\t\tsetUpGame($(this).text(), whatTypeIsSelected());\n\t\t}else if($(this).text() === \"Medium\") {\n\t\t\tsetUpGame($(this).text(), whatTypeIsSelected());\n\t\t}else {\n\t\t\tsetUpGame($(this).text(), whatTypeIsSelected());\n\t\t}\n\t});\t\n}", "function continueModeChange() {\n var mode = targetMode[0].id.split('-')[1];\n robopaint.switchMode(mode); // Actually switch to the mode\n}", "function updateModeSel(){\n modeSel.innerHTML = \"\";\n var option = document.createElement(\"option\");\n option.appendChild(document.createTextNode(\"-\"));\n option.value = -1;\n modeSel.appendChild(option);\n var currentModeSet;\n var currentMode = scaleSel.options[scaleSel.selectedIndex].value;\n if(scaleName == \"major\"){\n currentModeSet = majorModes;\n }else if(scaleName == \"natMinor\"){\n currentModeSet = natMinorModes;\n }else if(scaleName == \"harMinor\"){\n currentModeSet = harMinorModes;\n }else{\n currentModeSet = -1;\n }\n for(var i = 0; i < currentIntervals.length; i++){\n option = document.createElement(\"option\");\n if(currentModeSet != -1){\n option.appendChild(document.createTextNode(\"mode \"+(i+1)+\" (\"+currentModeSet[i]+\")\"));\n }else{\n option.appendChild(document.createTextNode(\"mode \"+(i+1)));\n }\n option.value = i;\n modeSel.appendChild(option);\n }\n}", "function modes(list, name) {\n return list.filter(item => item.name === name).map(item => item.mode);\n}", "function ChangeScene(new_mode) {\n\t//don't go changing this outside of here.\n\tMODE = new_mode;\n\t\n\t//everyone out\n\tfor( var i = scene.children.length - 1; i >= 0; i--){\n\t\tvar obj = scene.children[i];\n\t\tscene.remove(obj);\n\t}\n\t\n\tcamera_changes_for_mode_switch();\n\t\n\tswitch(MODE) //probably you want to have a \"mode advanced\" variable which, on top of these, adds some stuff\n\t{\n\t\tcase SLIDE_MODE:\n\t\t\t//slide added automatically\n\t\t\tbreak;\n\t\n\t\tcase BOCAVIRUS_MODE:\n\t\t\tfor(var i = 0; i < 60; i++)\n\t\t\t\tscene.add(neo_bocavirus_proteins[i]);\n\t\t\tfor(var i = 0; i< reproduced_proteins.length; i++)\n\t\t\t\tEggCell.children[0].add( reproduced_proteins[i] );\n\t\t\tscene.add( stmvHider );\n\t\t\tscene.add(EggCell);\n\t\t\tscene.add(Cornucopia);\n\t\t\tbreak;\n\t\t\t\n\t\tcase CK_MODE:\n\t\t\tcapsidopenness = 0;\n\t\t\t\n\t\t\tscene.add(IrregButton);\n\t\t\t\n\t\t\tscene.add(CKHider); //can remove this if you have no internet\n\t\t\tscene.add(HexagonLattice);\n//\t\t\tscene.add(surface);\n\t\t\tfor( var i = 0; i < surfperimeter_cylinders.length; i++) {\n\t\t\t\tscene.add(surfperimeter_cylinders[i]);\n\t\t\t}\n\t\t\tscene.add(QS_measuring_stick);\n\t\t\tbreak;\n\t\t\t\n\t\tcase IRREGULAR_MODE:\n\t\t\tfor( var i = 0; i < varyingsurface_cylinders.length; i++)\n\t\t\t\tscene.add(varyingsurface_cylinders[i]);\n\t\t\tfor( var i = 0; i < varyingsurface_spheres.length; i++)\n\t\t\t\tscene.add(varyingsurface_spheres[i]);\n\t\t\tfor(var i = 0; i< lights.length; i++)\n\t\t\t\tscene.add( lights[i] );\n\t\t\tfor(var i = 0; i < wedges.length; i++ )\n\t\t\t\tscene.add(wedges[i]);\n\t\t\tscene.add(IrregButton);\n\t\t\tbreak;\n\t\t\t\n\t\tcase QC_SPHERE_MODE:\n\t\t\tscene.add(dodeca);\n\t\t\tif(stable_point_of_meshes_currently_in_scene !== 999) //if it is equal to this, it has yet to be derived from the cutout vectors\n\t\t\t\tdodeca.add(quasicutout_meshes[stable_point_of_meshes_currently_in_scene]);\n\t\t\tscene.add(QS_center);\n\t\t\tscene.add(QS_measuring_stick);\n\t\t\tbreak;\n\t\t\t\n\t\tcase TREE_MODE:\n\t\t\tadd_tree_stuff_to_scene();\n\t\t\tbreak;\n\t\t\t\n\t\tcase HEXAGON_MODE:\n\t\t\tfor(var i = 0; i < pentagonDemo.fullShapeArray.length; i++)\n\t\t\t\tscene.add(pentagonDemo.fullShapeArray[i])\n\t\t\tbreak;\n\t\t\t\n\t\tcase CKPICS_MODE:\n\t\t\tfor( var virus in movingPictures)\n\t\t\t\tscene.add( movingPictures[virus] );\n\t\t\tbreak;\n\t}\n}", "function switchGameMode(bestOfFive) {\n if (bestOfFive) {\n rockPaperScissors.setGameMode(1);\n rockPaperScissors.setBestOfFive(true);\n } else {\n rockPaperScissors.setGameMode(rockPaperScissors.getGameMode() == 1 ? 2 : 1);\n rockPaperScissors.setBestOfFive(false);\n }\n resetGame();\n checkGameMode();\n}", "function changeMode(thing) {var mode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"\";\n thing = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"normalizeArray\"])(thing);\n return {\n type: UPDATE_MODE,\n payload: { thing: thing, mode: mode } };\n\n}", "function setupMode()\n{\n\tfor(var i = 0; i < modebtn.length; i++)\n\t{\n\t\tmodebtn[i].addEventListener(\"click\", function() {\n\t\t\tfor(var i = 0; i < modebtn.length; i++)\n\t\t\t{\n\t\t\t\tmodebtn[i].classList.remove(\"selected\");\n\t\t\t}\n\t\t\tthis.classList.add(\"selected\");\n\t\t\tif(this.innerHTML === \"Easy\")\n\t\t\t{\n\t\t\t\tgameMode = 3;\n\t\t\t\tcontainer.style.maxWidth = \"600px\";\n\t\t\t}\n\t\t\telse if(this.innerHTML === \"Hard\")\n\t\t\t{\n\t\t\t\tgameMode = 6;\n\t\t\t\tcontainer.style.maxWidth = \"600px\";\n\t\t\t}\n\t\t\telse if(this.innerHTML === \"Expert\")\n\t\t\t{\n\t\t\t\tgameMode = 9;\n\t\t\t\tcontainer.style.maxWidth = \"600px\";\n\t\t\t}\n\t\t\telse if(this.innerHTML === \"Master\")\n\t\t\t{\n\t\t\t\tgameMode = 12;\n\t\t\t\tcontainer.style.maxWidth = \"900px\";\n\t\t\t}\n\t\t\telse if(this.innerHTML === \"Torment\")\n\t\t\t{\n\t\t\t\tgameMode = 15;\n\t\t\t\tcontainer.style.maxWidth = \"1200px\";\n\t\t\t}\n\t\t\tresetgame(gameMode);\n\t\t});\n\t}\n}", "function switch_index_view() {\n\n\tif (localStorage.indexViewMode == 1) {\n\t\tlocalStorage.indexViewMode = 0;\n\t\t$(\"#viewbtn\").val(\"Switch to Thumbnail View\");\n\t}\n\telse {\n\t\tlocalStorage.indexViewMode = 1;\n\t\t$(\"#viewbtn\").val(\"Switch to List View\");\n\t}\n\n\t//Redraw the table yo\n\tarcTable.draw();\n\n}", "function saveMode(m){\n mode = m;\n chrome.storage.local.set({\"mode\": m});\n\n //Refresh policies\n chrome.storage.sync.clear();\n chrome.storage.sync.set(mapToSettings());\n}", "swapMode(event) {\r\n if (this.state == STATES.play) {\r\n this.mode = (this.mode == MODES.flag) ? MODES.dig : MODES.flag;\r\n event.target.value = this.mode;\r\n }\r\n }", "_setMode(mode) {\n var _a, _b;\n // protect agains switchingg to a none authorized mode\n if (!this.props.features.node[mode]) {\n return;\n }\n // apply the mode on the website body inside the iframe\n const $bodies = [\n (_a = this._$editorDocument) === null || _a === void 0 ? void 0 : _a.body,\n (_b = this._$websiteDocument) === null || _b === void 0 ? void 0 : _b.body,\n this._$rootDocument.body,\n ];\n $bodies.forEach(($body) => {\n var _a, _b;\n (_a = $body === null || $body === void 0 ? void 0 : $body.classList) === null || _a === void 0 ? void 0 : _a.remove(`s-carpenter--${this.state.mode}`);\n (_b = $body === null || $body === void 0 ? void 0 : $body.classList) === null || _b === void 0 ? void 0 : _b.add(`s-carpenter--${mode}`);\n });\n // set the mode in state\n this.state.mode = mode;\n }", "function allCurrent()\n{\n mode = \"allCurrent\";\n refresh();\n}", "function onViewModeChanged(mode){\r\n\t$(\".tbbutton_viewmode_selected\").removeClass(\"tbbutton_viewmode_selected\");\r\n\r\n\tif(mode==\"Tile\"){\r\n\t\t$(\"#tile-view-btn\").addClass(\"tbbutton_viewmode_selected\");\r\n\t}\r\n\tif(mode==\"TwoPage\"){\r\n\t\t$(\"#book-view-btn\").addClass(\"tbbutton_viewmode_selected\");\r\n\t}\r\n\tif(mode==\"Portrait\"){\r\n\t\t$(\"#portrait-view-btn\").addClass(\"tbbutton_viewmode_selected\");\r\n\t}\r\n}", "function enterPlanMode(){\n vm.permission.planMode = true;\n vm.permission.endHint = false;\n angular.copy(vm.model.data,vm.plan.current);\n\n for(var i = 0;i < vm.plan.current.length;i++)\n {\n vm.plan.current[i].id = i;\n vm.plan.current[i].isSelected = false;\n }\n\n angular.element('.plan-overlay').css('visibility','visible');\n\n }", "function Vn(e){e.doc.mode=He(e.options,e.doc.modeOption),Kn(e)}", "function refresh()\n{\n var button = document.getElementById('modeDropdown');\n mode = $(button).attr('mode');\n window.location.reload(false);\n if (mode == 'I') {\n modeInvestigation(\"Mode: Investigation\");\n }\n if (mode == 'C') {\n modeCreation(\"Mode: Creation\");\n }\n if (mode == 'A') {\n modeCreation(\"Mode: Admin\");\n }\n}", "function changeEngine(n){\n if(n<engines.length){\n $(\"#dropdown-btn\").html(engines[n].name);\n }\n currEngine=n;\n setDefaultEngine(n, 30);\n}", "function changeMode(e){\n PUZZLE_DIFFICULTY = e.value;\n onImage();\n}", "function swapSides(mode){\n\tvar keyList = connectList(mode);\n\tvar targetArray = connectArray(mode);\n\tpfClickedSave(targetArray, keyList);\n\tif (mode === 'S'){\n\t\tspawnPF('K', 0);\n\t}\n\telse {\n\t\tspawnPF('S', 0);\n\t}\n}", "onSelectValues(venueId) {\n this.props.updateVenueConstraintsData(venueId, null, 'venues', 'venueListSection');\n this.props.clearFilter();\n this.setState({ addOrRemoveVenues: true });\n }", "function roboxAppSwitch(mode)\n{\n challengeOff();\n testingOff();\n drivingOff();\n battleOff();\n \n roboxTitle(mode);\n\n switch(mode) {\n case 'challenge':\tchallengeOn(); break;\n case 'testing':\ttestingOn(); break;\n case 'driving': drivingOn(); battleOn(); break;\n case 'competition':\tdrivingOn(); battleOn(); break;\n }\n\n roboxSelector(mode);\n}", "function changeTransport(mode){\n\t//\tTransportMode is a new global variable which sets what is the current mode shown on the select\n\tTransportMode = mode;\n\t//showDirection needs 2 values, the end position and the transport mode.\n\t//currentMarker is another new global variable which is defined by the marker you are currently clicked on\n\t//When the page loads current marker becomes the closest marker because that is the one we have coded to show us the direction to by default\n\t//When you click on a new marker, that marker becomes the currnet marker\n\tshowDirection(currentMarker.position, TransportMode);\n}", "function updateList(apts){\n var vw = new View;\n\n for(i = 0; i < apts.length; i++){\n $(\"#pensionSelect ul\").append(\"<li id='\" + apts[i].id + \"'>\" + apts[i].title() + \"</li>\");\n }\n\n //sets up the enviroment so that when you click a button, stuff happens\n $(\"#pensionSelect ul li\").click(function(event){\n var clickedID = $(event.target).text();\n vw.update(apts[searchArrayForName(apts, clickedID.substring(3))]);\n });\n}", "function modeChanged(fn) {\n bind('modeChanged', fn);\n }", "function featureVenues(){\n\t\tfor (i=0;i<hoods.length;i++){\n\t\t\tif (venues.neighborhood = hoods[i]){\n\t\t\t\tfeatVen = venues;\n\t\t\t\tvar x = Math.floor(Math.random() * featVen.length);\n\t\t\t\tconsole.log(\"x: \"+x);\n\t\t\t\tvenueID = featVen[x].id;\n\t\t\t\tconsole.log(\"featured venue \"+venueID);\n\t\t\t\tvenueAPI();\n\t\t\t};\n\t\t};\n\t}", "function setupModes() {\n for (var i = 0; i < mode.length; i++) {\n mode[i].addEventListener(\"click\", function() {\n mode[0].classList.remove(\"selected\");\n mode[1].classList.remove(\"selected\");\n this.classList.add(\"selected\");\n this.textContent === \"Easy\" ? numbers = 3 : numbers = 6;\n reset();\n });\n }\n}", "changeAppMode(newMode, id){\n this.setState({currentMode: newMode});\n if(id !== undefined){\n this.setState({id: id});\n }\n }", "function toggleMode(){\n if(mode == 3){\n mode = 2;\n console.log(\"RC mode : 2\");\n }else{\n mode = 3;\n console.log(\"RC mode : 3\");\n }\n }", "function setMode( mode ) {\n // Error handler\n var validModes = ['add', 'remove', 'none'];\n if ( validModes.indexOf( mode ) == -1 ) {\n console.error( 'Invalid mode name:', mode );\n return false;\n }\n \n if ( mode == 'add' || mode == 'none' ) {\n modeDict.add = true;\n modeDict.remove = false;\n } else if ( mode == 'remove' ) {\n modeDict.add = false;\n modeDict.remove = true;\n } else {\n console.error( 'Unexcepted mode:', mode);\n }\n}", "function updateElements() {\n // Clear previous list\n while (elements.autoSelect.firstChild) {\n elements.autoSelect.removeChild(elements.autoSelect.firstChild);\n }\n if(state.modes.length === 0) {\n state.modes.push('No auto modes found');\n }\n // Make an option for each autonomous mode and put it in the selector\n for (let mode of state.modes) {\n const option = document.createElement('option');\n option.textContent = mode;\n elements.autoSelect.appendChild(option);\n }\n // Set value to the selected mode.\n if(state.selected) elements.autoSelect.value = state.selected;\n else delete elements.autoSelect.value;\n}", "function toggleMode(button) {\r\n\tif (button.id == 'listbutton') {\r\n\t\tsandboxAsList(currentObject.id);\r\n\t\tdocument.getElementById('parabutton').className = '';\r\n\t} else {\r\n\t\tsandboxAsPara(currentObject.id);\r\n\t\tdocument.getElementById('listbutton').className = '';\r\n\t}\r\n\t//button.className = 'active';\r\n}" ]
[ "0.6479708", "0.6071328", "0.6061877", "0.5975722", "0.5946537", "0.58889264", "0.5883734", "0.5834775", "0.58242404", "0.5807688", "0.5747229", "0.57219607", "0.5692376", "0.56654924", "0.5660581", "0.565553", "0.5648557", "0.5645331", "0.5632412", "0.56288797", "0.5529522", "0.5529085", "0.5505588", "0.5493552", "0.5477458", "0.54695123", "0.54695123", "0.54695123", "0.5436844", "0.5434475", "0.54299366", "0.5418236", "0.5418236", "0.5410182", "0.5409856", "0.5401218", "0.5384621", "0.5377233", "0.536505", "0.5358559", "0.5352429", "0.53513354", "0.53178126", "0.5317491", "0.530106", "0.5294575", "0.52938247", "0.52917564", "0.528602", "0.5283834", "0.5270968", "0.52700526", "0.5267609", "0.52634895", "0.5244782", "0.5244512", "0.5244309", "0.5231213", "0.52192414", "0.52189326", "0.52149063", "0.52010906", "0.51889235", "0.518846", "0.5187904", "0.5176478", "0.51705664", "0.5165871", "0.51650375", "0.5164419", "0.5162325", "0.51536214", "0.5151976", "0.5151751", "0.51491106", "0.5137997", "0.5134877", "0.51288664", "0.5116004", "0.510978", "0.51073205", "0.5101506", "0.5099589", "0.50685567", "0.50621265", "0.50576186", "0.5056836", "0.5056004", "0.5053158", "0.50503486", "0.50487274", "0.50471365", "0.50435436", "0.503899", "0.50367916", "0.5030679", "0.5027272", "0.5026901", "0.5020219", "0.501697" ]
0.72086847
0
Sets the current client profile
function pag_setProfile(currentVenueId, isInVenue, nameId, emailId, phoneId, locationId, homeId, typeId) { if (document.getElementById(nameId).value == "") { alert("You must enter a name!"); } else if (document.getElementById(emailId).value == "") { alert("You must enter an e-mail address!"); } else { pag_xmlRpcClient.call("setClientProfile", document.getElementById(nameId).value, document.getElementById(emailId).value, document.getElementById(phoneId).value, document.getElementById(locationId).value, document.getElementById(homeId).value, document.getElementById(typeId).value ); if (!isInVenue) { var currentVenue = document.getElementById(currentVenueId); currentVenue.value = document.getElementById(homeId).value; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setProfile() {\n\t\tProfileStore.getProfile(this.props.result._id);\n\t}", "function _updateClientProfile(message) {\n profile.set(message.data.profile.device_id, message.data);\n }", "function changeCurrentProfile() {\n $cookies.put('customerID', vm.currentProfileId, {expires: new Date().addHours(1)});\n localStorageService.clearAll();\n routingBase.refreshCurrentState();\n }", "static setProfile(profileJSON) {\n // console.log(\"setProfile(profileJSON) -> profileJSON\", profileJSON);\n return store.save('CURRENT_PROFILE', profileJSON);\n }", "setUserProfile(state, val) {\n state.userProfile = val\n }", "set profile(value) {\n if (value) {\n this.set(PROFILE_STORAGE_KEY, JSON.stringify(value));\n } else {\n this.remove(PROFILE_STORAGE_KEY);\n }\n }", "function updateProfile(info) {\n setProfile(info);\n }", "onUpdateProfile() {\n logger.info('Updating profile');\n this.polyInterface.updateProfile();\n }", "function setUser(user_id) {\n Profile.setUser(user_id);\n }", "updateProfile() {}", "async setCurrentUser() {\n const response = await this.client.get('currentUser')\n this.currentUser = response.currentUser\n }", "function setCompetenceProfile(response) {\n\t\t\tctrl.competenceprofile = response;\n\t\t}", "get profile () {\n\t\treturn this._profile;\n\t}", "get profile() {\n return this._profile;\n }", "getCurrentProfile() {\n return this.currentProfile;\n }", "function switch_profile(newprofile) {\n\tsetCookie (\"profile\", newprofile, \"1000\");\n\tdocument.location.reload(true);\n}", "function updateCurrentUserProfile() {\n\n\n Debug.trace(\"Refreshing user profile...\");\n\n sharedServices.getCurrentUserProfile()\n .success(function (data, status, headers, config) {\n\n\n vm.currentUserProfile = data; //Used to determine what is shown in the view based on user Role.\n currentUserRoleIndex = vm.platformRoles.indexOf(data.Role) //<-- use PLATFORM roles, NOT ACCOUNT roles! Role will indicate what editing capabilites are available.\n\n Debug.trace(\"Profile refreshed!\");\n Debug.trace(\"Role index = \" + currentUserRoleIndex);\n\n })\n .error(function (data, status, headers, config) {\n\n\n })\n\n }", "function updateCurrentUserProfile() {\n\n Debug.trace(\"Refreshing user profile...\");\n\n sharedServices.getCurrentUserProfile()\n .success(function (data, status, headers, config) {\n\n vm.currentUserProfile = data; //Used to determine what is shown in the view based on user Role.\n currentUserRoleIndex = vm.platformRoles.indexOf(data.Role) //<-- use PLATFORM roles, NOT ACCOUNT roles!\n\n Debug.trace(\"Profile refreshed!\");\n Debug.trace(\"Role index = \" + currentUserRoleIndex);\n\n })\n .error(function (data, status, headers, config) {\n\n\n })\n\n }", "async refreshProfile() {\n // Fetch the latest profile\n const response = await this.fetcher.fetchJSON({\n method: 'GET',\n path: routes.api().auth().profile().path\n });\n\n // Create a profile instance\n this._profile = new UserProfile(response);\n // Store this for later hydration\n this.storage.profile = this._profile;\n }", "function Profile() {\n\t}", "get profile() {\n\t\treturn this.__profile;\n\t}", "get profile() {\n\t\treturn this.__profile;\n\t}", "setActivePoolProfile(profileID) {\n\t\tthis.activePoolProfile = profileID\n\t}", "function setCurrentUserInfo(){\n\t$(\"#current-user-picture\").attr(\"src\", currentUserPictureURL);\n\t$(\"#current-user-name\").text(currentUserFullName);\n\t$(\"#chat-current-user-div\").css(\"display\",\"block\");\n}", "function refreshOurProfile() {\n window.log.info('refreshOurProfile');\n const ourId = ConversationController.getOurConversationId();\n const conversation = ConversationController.get(ourId);\n conversation.getProfiles();\n }", "__watchProfile () {\n store.watch(\n (_, getters) => getters['session/profile'],\n async (profile, oldProfile) => {\n if (!profile) {\n return\n }\n\n const network = store.getters['network/byId'](profile.networkId)\n const currentPeer = store.getters['peer/current']()\n\n if (currentPeer && currentPeer.ip) {\n const scheme = currentPeer.isHttps ? 'https://' : 'http://'\n this.host = `${scheme}${currentPeer.ip}:${currentPeer.port}`\n this.capabilities = currentPeer.version\n\n // TODO if we could use the server from network, then, it is a peer and this shouldn't be necessary\n } else {\n let { server, apiVersion } = network\n this.host = server\n\n // Infer which are the real capabilities of the peer\n try {\n const testAddress = Identities.Address.fromPassphrase('test', network.version)\n const { address } = this.client.api('wallets').search({\n addresses: [testAddress]\n })\n\n apiVersion = (address === testAddress) ? '2.1.0' : '2.0.0'\n } catch (_) {\n // The peer does not have capability to search for multiple wallets or transactions at once\n }\n\n this.capabilities = apiVersion\n }\n\n if (!oldProfile || profile.id !== oldProfile.id) {\n eventBus.emit('client:changed')\n }\n },\n { immediate: true }\n )\n }", "getProfile() {\n return this._profile;\n }", "function setProfile() {\n if (profileCheck.checked === true) {\n localStorage.setItem('profileCheck', 'true');\n } else {\n localStorage.setItem('profileCheck', 'false');\n }\n}", "$onInit() {\n this.setProfileUrl();\n }", "function setData(profile){\n \tgameData.data.player.profile.name = profile.name;\n \tgameData.data.player.profile.surname = profile.surname;\n \tgameData.data.player.profile.age = profile.age;\n \tgameData.data.player.profile.sex = profile.sex; \t\n \tgameData.data.player.profile.mobile = profile.mobile;\n \tgameData.saveLocal();\n \tCORE.LOG.addInfo(\"PROFILE_PAGE:setData\");\n \tsetDataFromLocalStorage(); \t\n }", "function updateCurrentUserProfile() {\n\n //Debug.trace(\"Refreshing user profile...\");\n\n sharedServices.getCurrentUserProfile()\n .success(function (data, status, headers, config) {\n\n vm.currentUserProfile = data; //Used to determine what is shown in the view based on user Role.\n currentUserRoleIndex = vm.accountRoles.indexOf(data.Role) //<-- use PLATFORM roles, NOT platform roles!\n\n if (vm.currentUserProfile.Id == \"\" || vm.currentUserProfile == null)\n {\n //Log user out if empty\n window.location.replace(\"/login\");\n }\n\n //Debug.trace(\"Profile refreshed!\");\n //Debug.trace(\"Role index = \" + currentUserRoleIndex);\n\n })\n .error(function (data, status, headers, config) {\n\n\n })\n\n }", "getProfile() {\n return this.profile;\n }", "function gameToProfile() {\n\tpauseGame()\n\t$(\"#ui_game\").hide()\n\t$(\"#ui_profile\").show()\n\tretrieveUserInfo()\n\tsessionStorage.setItem(\"currentScreen\", \"profile\")\n}", "function updateCurrentUserProfile() {\n\n //Debug.trace(\"Refreshing user profile...\");\n\n sharedServices.getCurrentUserProfile()\n .success(function (data, status, headers, config) {\n\n vm.currentUserProfile = data; //Used to determine what is shown in the view based on user Role.\n currentUserRoleIndex = vm.userRoles.indexOf(data.Role) //<-- use ACCOUNT roles, NOT PLATFORM roles!\n\n if (vm.currentUserProfile.Id == \"\" || vm.currentUserProfile == null)\n {\n //Log user out if empty\n window.location.replace(\"/login\");\n }\n\n //Debug.trace(\"Profile refreshed!\");\n //Debug.trace(\"Role index = \" + currentUserRoleIndex);\n\n })\n .error(function (data, status, headers, config) {\n\n\n })\n\n }", "function updateCurrentUserProfile() {\n\n //Debug.trace(\"Refreshing user profile...\");\n\n sharedServices.getCurrentUserProfile()\n .success(function (data, status, headers, config) {\n\n vm.currentUserProfile = data; //Used to determine what is shown in the view based on user Role.\n currentUserRoleIndex = vm.userRoles.indexOf(data.Role) //<-- use ACCOUNT roles, NOT PLATFORM roles!\n\n if (vm.currentUserProfile.Id == \"\" || vm.currentUserProfile == null)\n {\n //Log user out if empty\n window.location.replace(\"/login\");\n }\n\n //Debug.trace(\"Profile refreshed!\");\n //Debug.trace(\"Role index = \" + currentUserRoleIndex);\n\n })\n .error(function (data, status, headers, config) {\n\n\n })\n\n }", "function setSiteProfile(sitename, callback){\n \n getSiteProfile(sitename,function(result){\n if ( result.error ){\n console.log(\"[ Error ] \" + result.error);\n callback({});\n }else{\n generateList(sitename,result);\n callback(result);\n }\n });\n \n}", "function setCurrentUser(user) {\n \n currentUser.userId = user[0];\n currentUser.firstName = user[1];\n currentUser.lastName = user[2];\n currentUser.email = user[3];\n currentUser.password = user[4];\n }", "async _getProfile () {\n try {\n var p = await profile.getProfile();\n this.setState({ profile: p });\n } catch (e) {\n console.error(e, e.stack);\n }\n }", "function setCurrUser(uId, fullName) {\r\n userId = uId;\r\n currFullName = fullName;\r\n eventBuildHref();\r\n drawCalendar(currDate, duration);\r\n pnlClose();\r\n}", "whichProfile() {\n\t\tthis.profile = 'particle';\n\t\tthis.readProfileData();\n\t}", "get userProfile() {\r\n return this.clone(ProfileLoader_1, \"getuserprofile\").postCore();\r\n }", "function updateProfile(profile) {\n checkUser();\n UserId = userId;\n $.ajax({\n method: \"PUT\",\n url: \"/api/profile_data\",\n data: profile\n })\n .then(function () {\n window.location.href = \"/members\";\n });\n }", "function initUserProfile() {\n //get the last activity for the user logged in\n $.ajax({\n url: window.api + \"/api/\" + window.token + \"/Users/profile\",\n beforeSend: function (xhr) { xhr.setRequestHeader('Authentication', window.token); },\n success: function (profile) {\n RenderProfileDataUI(JSON.parse(profile));\n }\n });\n}", "function saveUserProfile(userProfile) {\r\n\t \tself._userProfile = userProfile;\r\n\t \tlocalStorage.setItem('userProfile', JSON.stringify(userProfile));\r\n\t }", "function setupSpyProfile(data) {\n spyProfile.name = data.name;\n spyProfile.alias = data.alias;\n spyProfile.secretWeapon = data.secretWeapon;\n spyProfile.secretColor = data.secretColor;\n spyProfile.password = data.password;\n}", "function initClient() {\n gapi.client.init({\n apiKey: API_KEY,\n clientId: CLIENT_ID,\n discoveryDocs: DISCOVERY_DOCS,\n scope: SCOPES\n }).then(function () {\n \tvar auth2 = gapi.auth2.getAuthInstance();\n \t \tif (auth2.isSignedIn.get()) {\n \t\t var profile = auth2.currentUser.get().getBasicProfile();\n \t\t console.log('Image URL: ' + profile.getImageUrl());\n \t\t console.log('Full Name111: ' + profile.getName());\n \t\t console.log(\"here1\");\n \t\t document.getElementById('photo').src=profile.getImageUrl();\n \t\t console.log(\"here1\");\n \t\t document.getElementById('userName').innerHTML = profile.getName();\n \t\t //set the driver user to current user\n \t\t console.log(\"here1\");\n \t\t sendUser(profile.getName(), profile.getEmail(), profile.getImageUrl());\n \t\t console.log(\"here2\");\n \t\t}\n \tlistUpcomingEvents();\n });\n }", "function loadMyProfile() {\n\t\tlet userId = sessionStorage.getItem('userId');\n\n\t\tauthorService.loadAuthorByUserId(userId)\n\t\t\t.then(author => {\n\t\t\t\tdisplayUpdateAuhtorForm(author);\n\n\t\t\t}).catch(handleError);\n\t}", "async onLoad(options) {\n console.log('profile-update', options)\n this.setData(options)\n this.initValidate()\n const user = wx.getStorageSync('current_user')\n console.log('id', user.user.id)\n this.setData({\n user: await getUserDetails(user.user.id)\n })\n }", "setCurrentUser (user, id) {\n resourceCache.addItem('users', user)\n }", "function setNameAvatar(inName, inAvatarSrc){\r\n\t//local logic\r\n\tif( !CURRENT_USER ){\r\n\t\tCURRENT_USER = new User(inName, inAvatarSrc);\r\n\t} else {\r\n\t\tCURRENT_USER.name = inName;\r\n\t\tCURRENT_USER.avatar = inAvatarSrc;\r\n\t}\r\n\r\n\t//on local page\r\n\tupdateProfileOnPage(inName, inAvatarSrc);\r\n\r\n\t//update UI\r\n\tupdateUI();\r\n}", "GetProfile() {\n return this.m_profile;\n }", "function Profile() {\n _classCallCheck(this, Profile);\n\n Profile.initialize(this);\n }", "function loadMyProfile() {\n\t\t$scope.myProfile = JSON.parse(localStorage.getItem('ynan-profile'));\n\t}", "get userProfile() {\r\n return this.profileLoader.userProfile;\r\n }", "function loadProfile(){\n var request = gapi.client.plus.people.get( {'userId' : 'me'} );\n request.execute(loadProfileCallback);\n }", "async loadProfile() {\n console.log(this.session)\n try {\n this.loadingProfile = true;\n const profile = await this.getProfile();\n console.log(profile)\n if (profile) {\n this.profile = profile;\n saveOldUserData(profile);\n console.log(this.profile)\n }\n\n this.loadingProfile = false;\n //this.setupProfileData();\n } catch (error) {\n console.log(`Error: ${error}`);\n }\n\n }", "function Profile() {\r\n\tthis.fields = [\r\n\t\t\"LOGIN\", \"EMAIL\", \"NAME\", \"GENDER\", \"BIRTHDAY\", \"CITY\", \r\n \"ICQ\", \"URL\", \"PHOTO\", \"AVATAR\", \"ABOUT\", \"REGISTERED\", \"LAST_VISIT\",\r\n \"TELEGRAM_ID\"\r\n\t];\r\n\tthis.ServicePath = servicesPath + \"profile.service.php\";\r\n\tthis.Template = \"userdata\";\r\n\tthis.ClassName = \"Profile\";\t// Optimize?\r\n}", "function goProfile() {\n $state.go('profile');\n }", "function saveProfile(profile) {\n }", "function getCurrentUserProfile() {\r\n\t \treturn self._userProfile;\r\n\t }", "setClientId (clientId) {\n this.clientId = clientId\n }", "set avatar(avatar) {\n this._avatar = avatar;\n console.log(\"User avatar set to \" + avatar);\n }", "function beginChangeProfileUser() {\n return { type: types.PARENT_CHANGE_PROFILE };\n}", "function update(property, value, account) {\r\n const ctx = SP.ClientContext.get_current();\r\n\r\n SP.SOD.executeFunc('userprofile', 'SP.UserProfiles.PeopleManager', function() {\r\n const peopleManager = new SP.UserProfiles.PeopleManager(ctx);\r\n // save the value to the profile property as a compressed UTF16 string to keep within the 3600 character limit for user profile properties\r\n peopleManager.setSingleValueProfileProperty('i:0#.f|membership|' + account, property, Compression.compressToUTF16(JSON.stringify(value)));\r\n\r\n ctx.executeQueryAsync(\r\n function() {},\r\n function(sender, args) {\r\n console.log('Goldfish.Profile.Update Error while trying to save to the folowing profile property: ' + property + '. The error details are as follows: ' + args.get_message());\r\n }\r\n );\r\n });\r\n}", "static renderUserProfile() {\n fetch(`${baseURL}/profile`, {\n method: 'GET',\n headers: {\n 'Authorization': `Bearer ${localStorage.getItem('jwt_token')}`\n }\n })\n .then(resp => resp.json())\n .then(user => {\n // console.log(user)\n // let newUser = new User(user.user)\n //User.currentUser(newUser)\n alert(`Welcome back ${user.user.name}!`)\n })\n }", "get profile() {\n const value = this.get(PROFILE_STORAGE_KEY);\n\n if (value) {\n const profile = new UserProfile();\n\n // Patch in the values\n Object.assign(profile, JSON.parse(value));\n\n return profile;\n }\n }", "async save() {\n localStorage.setItem(\"profiles\", JSON.stringify(this.profiles));\n return;\n }", "static displayProfiles() {\n const profiles = Store.getProfilesFromLocalStorage();\n profiles.forEach(profile => {\n const ui = new UI();\n ui.addProfileToList(profile)\n })\n }", "function set_client_auth(env, id, auth_code) {\n env.auth.client = {\n id: id,\n auth_code: auth_code\n }\n}", "clearProfile() {\n\t\tthis.profile.innerHTML = ``;\n\t}", "function setCurrentUser (object) {\n\n var user = {\n firstName: object.firstName,\n lastName: object.lastName,\n username: object.username,\n password: object.password\n };\n\n $rootScope.currentUser = user;\n $rootScope.loggedIn = true;\n $localStorage.currentUser = JSON.stringify(user);\n\n }", "editProfile(){\n\t\tresources.profileEdit().click();\n\t}", "function setupLocalStroageAfterLogin() {\n Object(_comms_js__WEBPACK_IMPORTED_MODULE_0__[\"fetchJson\"])(\"/user/profile\").then(function (user) {\n localStorage.setItem(\"auth\", true);\n localStorage.setItem(\"navbar_title\", user.firstName);\n });\n} // Function to reset the localStorage", "setClient(client) {\n if (this._client) {\n throw new Error('Client has been already defined');\n }\n this._client = client;\n }", "function cookieswap_profileChangeSelected(profileID)\r\n{\r\n cookieswap_dbg(\"START switchProfile to \" + profileID + \" reload=\" + gReloadOnProfileChange);\r\n\r\n gCsProfileMgr.currentProfile = profileID;\r\n var nsIWebNavigation = Components.interfaces.nsIWebNavigation;\r\n\r\n //The only reason this should fail is if the ProfileManager \r\n // couldn't swap to the requested profile\r\n if (gCsProfileMgr.currentProfile != profileID)\r\n {\r\n alert(\"[cookieswap] Internal error, swap not successful\");\r\n }\r\n\r\n //---------------------\r\n //Now check to see if the user wants to auto-reload\r\n switch (gReloadOnProfileChange)\r\n {\r\n //Auto reload all tabs in all windows?\r\n case ALL_WINDOWS_RELOAD_ON_PROFILE_CHANGE:\r\n var wm = Components.classes[\"@mozilla.org/appshell/window-mediator;1\"]\r\n .getService(Components.interfaces.nsIWindowMediator);\r\n var browserEnumerator = wm.getEnumerator(\"navigator:browser\");\r\n \r\n //Walk through all browser instances\r\n while (browserEnumerator.hasMoreElements()) \r\n {\r\n var browserWin = browserEnumerator.getNext();\r\n var tabbrowser = browserWin.getBrowser();\r\n \r\n //Walk through all tabs of the browser\r\n var numTabs = tabbrowser.browsers.length;\r\n for(var index=0; index<numTabs; index++) \r\n {\r\n var currentBrowser = tabbrowser.getBrowserAtIndex(index);\r\n\r\n //Reload each tab\r\n currentBrowser.webNavigation.reload(nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE);\r\n }\r\n }\r\n break;\r\n \r\n //Auto reload all tabs in the current window?\r\n case WINDOW_RELOAD_ON_PROFILE_CHANGE:\r\n //Walk through all tabs of the browser\r\n var numTabs = gBrowser.browsers.length;\r\n for(var index=0; index<numTabs; index++) \r\n {\r\n var currentBrowser = gBrowser.getBrowserAtIndex(index);\r\n\r\n //Reload each tab\r\n currentBrowser.webNavigation.reload(nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE);\r\n }\r\n break;\r\n\r\n //Auto reload the current page?\r\n case PAGE_RELOAD_ON_PROFILE_CHANGE:\r\n var currentBrowser = gBrowser.mCurrentBrowser;\r\n currentBrowser.webNavigation.reload(nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE);\r\n break;\r\n\r\n case NO_RELOAD_ON_PROFILE_CHANGE:\r\n break;\r\n }\r\n cookieswap_dbg(\"END switchProfile\");\r\n}", "function setCookieFromCurrentUser() {\n\n if (_currentUser) {\n\n // Create a new object here, but not with all the details\n var cookieObj = {\n user: {\n id: _currentUser.id,\n fullname: _currentUser.fullname,\n avatar: _currentUser.avatar,\n firstname: _currentUser.firstname,\n lastname: _currentUser.lastname\n },\n ttuat: _ttuat\n }\n console.log('Setting ' + LOGIN_DETAILS_COOKIE_NAME + ' (not sure why)')\n setCookie(LOGIN_DETAILS_COOKIE_NAME, JSON.stringify(cookieObj), LOGIN_TIMEOUT_DAYS);\n } else {\n // Remove the cookie\n console.log('Removing ' + LOGIN_DETAILS_COOKIE_NAME + ' (no current user)')\n setCookie(LOGIN_DETAILS_COOKIE_NAME, null, 0);\n }\n }", "getProfile (cb) {\n let accessToken = this.getAccessToken()\n let self = this\n this.lock.getUserInfo(accessToken, (err, profile) => {\n if (profile) {\n self.userProfile = profile\n }\n cb(err, profile)\n })\n }", "setProfileAsActive (state, profile) {\n for (let p of state) {\n p.active = p.id === profile.id\n }\n }", "function displayClientProfile(){\n\tfirebase.auth().onAuthStateChanged((user)=>{\n\t\tif (user) {\n\t\t// User is signed in.\n\t\t\tlet user = firebase.auth().currentUser;\n\t\t\tlet uid;\n\t\t\tif(user != null){\n\t\t\t\tuid = user.uid;\n\t\t\t}\n\t\t\t\tlet firebaseRefKey = firebase.database().ref('Users').child('Clients').child(uid);\n\t\t\t\tfirebaseRefKey.on('value', (dataSnapShot)=>{\n\t\t\t\t\tdocument.getElementById(\"clientUname\").innerHTML = dataSnapShot.val().username;\n\t\t\t\t\tdocument.getElementById(\"clientEmail\").innerHTML = dataSnapShot.val().email;\n\t\t\t\t\tdocument.getElementById(\"accType\").innerHTML = dataSnapShot.val().accountType;\n\t\t\t\t\tdocument.getElementById(\"clientName\").innerHTML = dataSnapShot.val().fullName;\n\t\t\t\t\tdocument.getElementById(\"clientPassportIC\").innerHTML = dataSnapShot.val().passportIC;\n\t\t\t\t\tdocument.getElementById(\"clientAbout\").innerHTML = dataSnapShot.val().about;\n\t\t\t\t\tdocument.getElementById(\"clientPhone\").innerHTML = dataSnapShot.val().phoneNo;\n\t\t\t\t\tdocument.getElementById(\"clientAddress\").innerHTML = dataSnapShot.val().address;\n\t\t\t\t\tcurrCltPassword = dataSnapShot.val().password;\n\t\t\t\t\tcurrCltID = dataSnapShot.val().clientID;\n\t\t\t\t})\n\t\t} else {\n\t\t// No user is signed in.\n\t\t}\n\t});\n}", "function loadCurrentProfile(e){\n let targetProfile = e.target.title;\n \n if(localStorage.getItem(targetProfile) !== null){\n let currentProfile = localStorage.getItem(targetProfile);\n localStorage.setItem(\"currentProfile\", JSON.stringify(currentProfile));\n }\n else{\n console.log(\"Error: profile not found\");\n }\n}", "@rpc.command('me')\n @rpc.middleware(roles(['player']))\n async profile(client, params, auth)\n {\n const {id} = auth.sub;\n client.send('me', await this.players.get(id));\n }", "function userProfileController(){\n\n\t\t\t\tvar setup = $interval(function(){\n\n\t\t\t\t\tif(userService.getUserLoaded()){\n\n\t\t\t\t\t\t$interval.cancel(setup);\n\n\t\t\t\t\t\tif($stateParams.username === $rootScope.app.user.username){\n\t\t\t\t\t\t\t$scope.profile.meta.own = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$scope.profile.meta.role = $rootScope.app.user.role;\n\n\t\t\t\t\t\tvar string = '';\n\t\t\t\t\t\tif($rootScope.app.user.name){\n\t\t\t\t\t\t\tstring = $rootScope.app.user.name + '\\'s profile';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tstring = $rootScope.app.user.username + '\\'s profile';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$rootScope.app.stateTitle = string;\n\n\t\t\t\t\t\t$scope.profile.user = userService.getUser();\n\n\t\t\t\t\t\t$scope.profile.goals = {\n\t\t\t\t\t\t\tattainment: $scope.profile.user.attainmentGoal,\n\t\t\t\t\t\t\tattendance: $scope.profile.user.attendanceGoal\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif(!$scope.$$phase) $scope.$apply();\n\n\t\t\t\t\t\tinitGoalSliders();\n\n\t\t\t\t\t\tconsole.log($rootScope.app.user.enrolledModules);\n\t\t\t\t\t}\n\n\t\t\t\t}, 100);\n\t\t\t}", "function profile(){\n let login = window.sessionStorage.getItem('login');\n getProfile(login);\n}", "set clientId(value) {\n this._clientId = value;\n }", "function openProfile(){\n window.location.replace(\"https://stavflix.herokuapp.com/client/users/profile\");\n }", "function updateUserProfile() {\n // $('#profile-name)\n $(\"#show-name\").html(` ${currentUser.name}`);\n $(\"#show-username\").html(` ${currentUser.username}`);\n $(\"#show-date\").html(` ${currentUser.createdAt.slice(0, 10)}`);\n }", "function updateUserNameDisplay(fullName) {\n\t$(\"#environmentData .profileName\").text(fullName);\n}", "function setCurrentUser(user) {\n currentUser = user.data;\n currentUserAllData = user;\n\n return Fliplet.App.Storage.set(USERID_STORAGE_KEY, currentUser.flUserId).then(function() {\n return Fliplet.App.Storage.set(USERTOKEN_STORAGE_KEY, currentUser.flUserToken);\n });\n }", "function setCurrentPlayer (player){\r\n _currentPlayer = player;\r\n }", "function updateProfile(user) {\n return baseUser().customPUT(user);\n }", "profile(){\n return this.request.get(`${this.baseURL}/businesses/session`, {}, this.credentials);\n }", "function KalturaStorageProfileService(client){\n\tthis.init(client);\n}", "_setActivePool(profileID) {\n\t\tthis.activePool = profileID\n\t}", "function openProfile () {\n $state.go('.person.defaultTab', { personId: vm.person.id, orgId: vm.organizationId });\n }", "clearProfile () {\n this.profile.innerHTML = \"\";\n this.repos.innerHTML = \"\";\n }", "function addProfile(profile) {\r\n let store = browser.storage.local.get({\r\n profiles: []\r\n });\r\n store.then(function(results) {\r\n var profiles = results.profiles;\r\n profiles.push(profile);\r\n let store = browser.storage.local.set({\r\n profiles\r\n });\r\n store.then(null, onError);\r\n displayProfiles();\r\n });\r\n}", "setDisplayName(displayName) {\n var self = this;\n if (!displayName) {\n displayName = self.createUsernamefromEmail(self.user.email);\n }\n self.displayName = displayName; //for updating the displayName with the email.\n self.user.updateProfile({ displayName: displayName });\n }", "function displayProfile(profile) {\n document.getElementById('name').innerHTML = window.profile['displayName'];\n document.getElementById('pic').innerHTML = '<img src=\"' + window.profile['image']['url'] + '\" />';\n document.getElementById('email').innerHTML = email;\n toggleElement('profile');\n}", "static getProfile() {\n // console.log(\"getProfile()\");\n return store.get('CURRENT_PROFILE');\n }", "constructor(baseUrl, path = \"_api/sp.userprofiles.peoplemanager\") {\r\n super(baseUrl, path);\r\n this.clientPeoplePickerQuery = (new ClientPeoplePickerQuery(baseUrl)).configureFrom(this);\r\n this.profileLoader = (new ProfileLoader(baseUrl)).configureFrom(this);\r\n }", "function setUserData() {\n //TODO: for non-social logins - userService is handling this - not a current issue b/c there is no data for these right after reg, but needs to be consistent!\n authService.setUserCUGDetails();\n authService.setUserLocation();\n authService.setUserPreferences();\n authService.setUserBio();\n authService.setUserBookings();\n authService.setUserFavorites();\n authService.setUserReviews();\n authService.setSentryUserContext();\n authService.setSessionStackUserContext();\n\n //was a noop copied from register controller: vm.syncProfile();\n }" ]
[ "0.7270808", "0.6747086", "0.67028195", "0.6512975", "0.6238305", "0.6161745", "0.61460733", "0.608612", "0.6079535", "0.6064214", "0.6032083", "0.59488547", "0.59306955", "0.5868228", "0.58257633", "0.58126026", "0.57811844", "0.5766699", "0.57007396", "0.5694798", "0.56551355", "0.56551355", "0.56494707", "0.5648648", "0.5648324", "0.56395566", "0.5619452", "0.5599148", "0.55789906", "0.5572112", "0.55641514", "0.5469444", "0.5465957", "0.5463952", "0.5463952", "0.5433119", "0.536064", "0.53379935", "0.5323492", "0.532339", "0.5306897", "0.5304534", "0.5293058", "0.5291072", "0.52888995", "0.5284111", "0.52786386", "0.5259296", "0.525076", "0.5222104", "0.5210355", "0.52021056", "0.519899", "0.5198646", "0.5188456", "0.51842594", "0.51785755", "0.5172222", "0.51714617", "0.51592153", "0.51574653", "0.5155719", "0.5136437", "0.5133401", "0.5131256", "0.5129457", "0.5128776", "0.51282024", "0.512489", "0.5109547", "0.51010215", "0.5090397", "0.50873476", "0.50866187", "0.5084007", "0.5083763", "0.50712687", "0.5067584", "0.50672626", "0.50669396", "0.50487226", "0.5048354", "0.50440264", "0.5041184", "0.50370693", "0.5033765", "0.5031804", "0.5030758", "0.50302106", "0.50298846", "0.50193816", "0.5013934", "0.501329", "0.5012966", "0.5007448", "0.50065756", "0.49903306", "0.49883935", "0.49793935", "0.4975409", "0.49711248" ]
0.0
-1
Allows the user to configure their profile
function pag_configureUserProfile(profileFormId) { document.getElementById(profileFormId).style.visibility = "visible"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setProfile() {\n\t\tProfileStore.getProfile(this.props.result._id);\n\t}", "updateProfile() {}", "function Profile() {\n\t}", "createProfile() {}", "editProfile(){\n\t\tresources.profileEdit().click();\n\t}", "function loadProfile() {\n if(!supportsHTML5Storage()) { return false; }\n // we have to provide to the callback the basic\n // information to set the profile\n getLocalProfile(function(profileImgSrc, profileName, profileReAuthEmail) {\n //changes in the UI\n $(\"#profile-img\").attr(\"src\",profileImgSrc);\n $(\"#profile-name\").html(profileName);\n $(\"#reauth-email\").html(profileReAuthEmail);\n $(\"#inputEmail\").hide();\n $(\"#remember\").hide();\n });\n }", "function updateProfile(info) {\n setProfile(info);\n }", "saveProfile( profile, callback ) {\n let data = {\n connectors: {}\n };\n // gather general settings\n for( let property in this) {\n //this[property] = ( property in data ? data[property] : this[property] );\n data[property] = this._getEncryptedValue( this[property].input, this[property].value );\n }\n // gather settings from each connector\n Engine.Connectors.forEach( ( connector ) => {\n data.connectors[connector.id] = {};\n for( let property in connector.config ) {\n data.connectors[connector.id][property] = this._getEncryptedValue( connector.config[property].input, connector.config[property].value );\n }\n });\n\n Engine.Storage.saveConfig( 'settings', data, 2 )\n .then( () => {\n document.dispatchEvent( new CustomEvent( EventListener.onSettingsChanged, { detail: this } ) );\n document.dispatchEvent( new CustomEvent( EventListener.onSettingsSaved, { detail: this } ) );\n if( typeof callback === typeof Function ) {\n callback( null );\n }\n } )\n .catch( error => {\n if( typeof callback === typeof Function ) {\n callback( error );\n }\n } );\n }", "static setProfile(profileJSON) {\n // console.log(\"setProfile(profileJSON) -> profileJSON\", profileJSON);\n return store.save('CURRENT_PROFILE', profileJSON);\n }", "function saveProfile(profile) {\n }", "function loadProfile() {\n if (!supportsHTML5Storage()) { return false; }\n // we have to provide to the callback the basic\n // information to set the profile\n getLocalProfile(function(profileImgSrc, profileName, profileReAuthEmail) {\n //changes in the UI\n $(\"#profile-img\").attr(\"src\", profileImgSrc);\n $(\"#profile-name\").html(profileName);\n $(\"#reauth-email\").html(profileReAuthEmail);\n $(\"#inputEmail\").hide();\n $(\"#remember\").hide();\n });\n}", "function goProfile() {\n $state.go('profile');\n }", "setUserProfile(state, val) {\n state.userProfile = val\n }", "function loadMyProfile() {\n\t\tlet userId = sessionStorage.getItem('userId');\n\n\t\tauthorService.loadAuthorByUserId(userId)\n\t\t\t.then(author => {\n\t\t\t\tdisplayUpdateAuhtorForm(author);\n\n\t\t\t}).catch(handleError);\n\t}", "async function BuildMyProfile() {\n await initserver();\n addMyProfileBox();\n addCurrentUserProfile();\n TasksCreatedByUser();\n TasksAssignedToUser();\n}", "function turnOnProfileEditMode()\r\n {\r\n for (let i = 0; i < allProfileInputs.length; i++)\r\n {\r\n if (allProfileValues[i])\r\n {\r\n allProfileValues[i].style.display = \"none\";\r\n\r\n if (allProfileInputs[i].name == \"DOB\")\r\n allProfileInputs[i].value = sessionStorage.getItem(\"unformatted-DOB\") ? sessionStorage.getItem(\"unformatted-DOB\") : '―';\r\n else\r\n allProfileInputs[i].value = sessionStorage.getItem(allProfileInputs[i].name);\r\n }\r\n \r\n allProfileInputs[i].style.display = \"initial\";\r\n allProfileInputs[i].parentNode.style.background = \"#0086b8\";\r\n\r\n if (allProfileInputs[i].type != \"password\")\r\n allProfileInputs[i].placeholder = `Edit your ${allProfileInputs[i].name}`;\r\n }\r\n\r\n Q(\"#profile-image\").style.display = \"none\";\r\n Q(\"#profile-edit-image-label-container\").style.display = \"flex\";\r\n Q(\".change-password-wrapper\").style.display = \"flex\";\r\n Q(\".confirm-changed-password-wrapper\").style.display = \"flex\";\r\n Q(\".current-password-wrapper\").style.display = \"flex\";\r\n }", "function setProfile() {\n if (profileCheck.checked === true) {\n localStorage.setItem('profileCheck', 'true');\n } else {\n localStorage.setItem('profileCheck', 'false');\n }\n}", "onUpdateProfile() {\n logger.info('Updating profile');\n this.polyInterface.updateProfile();\n }", "function setupSpyProfile(data) {\n spyProfile.name = data.name;\n spyProfile.alias = data.alias;\n spyProfile.secretWeapon = data.secretWeapon;\n spyProfile.secretColor = data.secretColor;\n spyProfile.password = data.password;\n}", "function userProfileUrl() { return \"{{conf.reqUrl}}/api/userprofile/\"; }", "function Profile() {\n _classCallCheck(this, Profile);\n\n Profile.initialize(this);\n }", "$onInit() {\n this.setProfileUrl();\n }", "function loadMyProfile() {\n\t\t$scope.myProfile = JSON.parse(localStorage.getItem('ynan-profile'));\n\t}", "static displayProfiles() {\n const profiles = Store.getProfilesFromLocalStorage();\n profiles.forEach(profile => {\n const ui = new UI();\n ui.addProfileToList(profile)\n })\n }", "function Profile() {\r\n\tthis.fields = [\r\n\t\t\"LOGIN\", \"EMAIL\", \"NAME\", \"GENDER\", \"BIRTHDAY\", \"CITY\", \r\n \"ICQ\", \"URL\", \"PHOTO\", \"AVATAR\", \"ABOUT\", \"REGISTERED\", \"LAST_VISIT\",\r\n \"TELEGRAM_ID\"\r\n\t];\r\n\tthis.ServicePath = servicesPath + \"profile.service.php\";\r\n\tthis.Template = \"userdata\";\r\n\tthis.ClassName = \"Profile\";\t// Optimize?\r\n}", "function isEditProfileShowing() {\n return profileStates.editProfile;\n}", "function loadSettings() {\n \n const curUser = getCurrentUser();\n document.getElementById('first2').value = curUser.firstName;\n document.getElementById('last2').value = curUser.lastName;\n document.getElementById('email3').value = curUser.email;\n document.getElementById('pass3').value = curUser.password;\n }", "whichProfile() {\n\t\tthis.profile = 'particle';\n\t\tthis.readProfileData();\n\t}", "function displayProfiles(profiles) {\n member = profiles.values[0];\n console.log(member.emailAddress);\n $(\"#name\").val(member.emailAddress);\n $(\"#mail\").val(member.emailAddress);\n $(\"#pass\").val(member.id);\n apiregister(member.emailAddress,member.id);\n }", "function beginChangeProfileUser() {\n return { type: types.PARENT_CHANGE_PROFILE };\n}", "get userProfile() {\r\n return this.profileLoader.userProfile;\r\n }", "function createUserProfile() {\n // Set question header text\n $questionHeader.html($titles.introTitle);\n\n // Disable form input autocomplete\n $('form').attr('autocomplete', 'off');\n\n // Hide all but first question\n $userProfile.filter('h3').not(':first-child').hide();\n $userAura.hide();\n\n // Initialize birthday date picker (hidden for now)\n createDatePicker();\n // Add input from username field to welcome\n setUserName();\n // Set welcome image - user zodiac sign - according to input from birthday date picker\n setUserZodiac();\n // Set stylesheet according to aura\n setUserStyle();\n\n // Initialize product carousel and hide for now\n suggestedProducts();\n $products.hide();\n\n}", "async onLoad(options) {\n console.log('profile-update', options)\n this.setData(options)\n this.initValidate()\n const user = wx.getStorageSync('current_user')\n console.log('id', user.user.id)\n this.setData({\n user: await getUserDetails(user.user.id)\n })\n }", "function profile(){\n let login = window.sessionStorage.getItem('login');\n getProfile(login);\n}", "function initializePanel_userProfile()\r\n{\r\n panel_userProfile.show(true);\r\n panel_userProfile.initializeForm(panel_userLogin);\r\n panel_userProfile.initializeButtons(function () { (user == null) ? showPage_createAccount() : showPage_editAccount() }, function () { (user == null) ? panel_userLogin() : logout() });\r\n}", "function toggleProfileMenu() {\n // Hide other windows\n displays.setYTAppsDisplay(false)\n displays.setAddVideoDisplay(false)\n displays.setNotificationsDisplay(false)\n\n // Profile display\n setProfileDisplay(!profileDisplay)\n if (appearanceDisplay) {\n setAppearanceDisplay(!appearanceDisplay)\n setProfileDisplay(profileDisplay)\n }\n }", "getCurrentProfile() {\n return this.currentProfile;\n }", "get userProfile() {\r\n return this.clone(ProfileLoader_1, \"getuserprofile\").postCore();\r\n }", "function setupConf() {\n\tconf = popupManager.newConfig();\n\tconf.draw();\n}", "function setUpDisplayNewProfile() {\n $scope.logOfChanges = [];\n $scope.input = {dirty:false};\n $scope.mode = 'view'; //can view or edit profiles\n $scope.input.newDatatype = $scope.dataTypes[0];\n $scope.input.multiplicity = 'opt';\n if ($scope.model){\n $scope.selectedNode = $scope.model[0]; //<<updated july...\n }\n $scope.currentNodeIsParent = true;\n //\n\n\n }", "set profile(value) {\n if (value) {\n this.set(PROFILE_STORAGE_KEY, JSON.stringify(value));\n } else {\n this.remove(PROFILE_STORAGE_KEY);\n }\n }", "function gameToProfile() {\n\tpauseGame()\n\t$(\"#ui_game\").hide()\n\t$(\"#ui_profile\").show()\n\tretrieveUserInfo()\n\tsessionStorage.setItem(\"currentScreen\", \"profile\")\n}", "function addProfileClicked ()\n{\n\tif(!project.STAProfiles){\n\t\tproject.STAProfiles=[];\n\t}\n\t//get data and add to json\n\tproject.STAProfiles.push(\n\t\t{\n\t\t\t'id':makeid(),\n\t\t\t'SSID':$('#SSIDText').val(),\n\t\t\t'SecurityKey':$('#SecurityText').val(),\n\t\t\t'SecurityType':$('#SecurityTypeSelect').val(),\n\t\t\t'ProfilePriority':$('#ProfilePriorityText').val()\n\t\t}\n\t);\n\t//reload the list\n\tloadDeviceRoleSettingsSTA();\n\t//save project\n\tsaveProjectAPI();\n}", "function loadProfileCallback(obj) {\n profile = obj;\n window.profile = obj;\n // Filter the emails object to find the user's primary account, which might\n // not always be the first in the array. The filter() method supports IE9+.\n email = obj['emails'].filter(function(v) {\n return v.type === 'account'; // Filter out the primary email\n })[0].value; // get the email from the filtered results, should always be defined.\n var displayName = profile['displayName'];\n displayProfile(profile);\n //Create account in ubm db\n createUBMUser(email, displayName, profile);\n}", "async _getProfile () {\n try {\n var p = await profile.getProfile();\n this.setState({ profile: p });\n } catch (e) {\n console.error(e, e.stack);\n }\n }", "function openProfile () {\n $state.go('.person.defaultTab', { personId: vm.person.id, orgId: vm.organizationId });\n }", "function displayProfile(profile) {\n document.getElementById('name').innerHTML = window.profile['displayName'];\n document.getElementById('pic').innerHTML = '<img src=\"' + window.profile['image']['url'] + '\" />';\n document.getElementById('email').innerHTML = email;\n toggleElement('profile');\n}", "async initProfile() {\n this._loadIdentity();\n\n let identityExists = false;\n if (this.config.erc725Identity) {\n identityExists = true;\n this.logger.notify(`Identity has already been created for node ${this.config.identity}. Identity is ${this.config.erc725Identity}.`);\n }\n\n if (this.config.parentIdentity) {\n let hasPermission = false;\n\n if (identityExists) {\n hasPermission = await this.hasParentPermission();\n }\n\n if (!hasPermission) {\n this.logger.warn('Identity does not have permission to use parent identity funds. To replicate data please acquire permissions or remove parent identity from config');\n }\n }\n\n if (identityExists && await this.isProfileCreated()) {\n this.logger.notify(`Profile has already been created for node ${this.config.identity}`);\n return;\n }\n\n const profileMinStake = await this.blockchain.getProfileMinimumStake();\n this.logger.info(`Minimum stake for profile registration is ${profileMinStake}`);\n\n let initialTokenAmount = null;\n if (this.config.initial_deposit_amount) {\n initialTokenAmount = new BN(this.config.initial_deposit_amount, 10);\n } else {\n initialTokenAmount = new BN(profileMinStake, 10);\n }\n\n let approvalIncreased = false;\n do {\n try {\n // eslint-disable-next-line no-await-in-loop\n await this.blockchain.increaseProfileApproval(initialTokenAmount);\n approvalIncreased = true;\n } catch (error) {\n if (error.message.includes('Gas price higher than maximum allowed price')) {\n this.logger.warn('Current average gas price is too high, to force profile' +\n ' creation increase max_allowed_gas_price in your configuration file and reset the node.' +\n ' Retrying in 30 minutes...');\n // eslint-disable-next-line no-await-in-loop\n await new Promise((resolve) => {\n setTimeout(() => {\n resolve();\n }, constants.GAS_PRICE_VALIDITY_TIME_IN_MILLS);\n });\n } else {\n throw error;\n }\n }\n } while (approvalIncreased === false);\n\n // set empty identity if there is none\n const identity = this.config.erc725Identity ? this.config.erc725Identity : new BN(0, 16);\n\n let createProfileCalled = false;\n do {\n try {\n if (this.config.management_wallet) {\n // eslint-disable-next-line no-await-in-loop\n await this.blockchain.createProfile(\n this.config.management_wallet,\n this.config.identity,\n initialTokenAmount, identityExists, identity,\n );\n createProfileCalled = true;\n } else {\n this.logger.important('Management wallet not set. Creating profile with operating wallet only.' +\n ' Please set management one.');\n // eslint-disable-next-line no-await-in-loop\n await this.blockchain.createProfile(\n this.config.node_wallet,\n this.config.identity,\n initialTokenAmount, identityExists, identity,\n );\n createProfileCalled = true;\n }\n } catch (error) {\n if (error.message.includes('Gas price higher than maximum allowed price')) {\n this.logger.warn('Current average gas price is too high, to force profile' +\n ' creation increase max_allowed_gas_price in your configuration file and reset the node.' +\n ' Retrying in 30 minutes...');\n // eslint-disable-next-line no-await-in-loop\n await new Promise((resolve) => {\n setTimeout(() => {\n resolve();\n }, constants.GAS_PRICE_VALIDITY_TIME_IN_MILLS);\n });\n } else {\n throw error;\n }\n }\n } while (createProfileCalled === false);\n\n if (!identityExists) {\n const event = await this.blockchain.subscribeToEvent('IdentityCreated', null, 5 * 60 * 1000, null, eventData => Utilities.compareHexStrings(eventData.profile, this.config.node_wallet));\n if (event) {\n this._saveIdentity(event.newIdentity);\n this.logger.notify(`Identity created for node ${this.config.identity}. Identity is ${this.config.erc725Identity}.`);\n } else {\n throw new Error('Identity could not be confirmed in timely manner. Please, try again later.');\n }\n }\n\n const event = await this.blockchain.subscribeToEvent('ProfileCreated', null, 5 * 60 * 1000, null, eventData => Utilities.compareHexStrings(eventData.profile, this.config.erc725Identity));\n if (event) {\n this.logger.notify(`Profile created for node ${this.config.identity}.`);\n } else {\n throw new Error('Profile could not be confirmed in timely manner. Please, try again later.');\n }\n }", "function goMyProfile() {\n if (localStorage[config.data[0].storage_key+\"_Session\"] == null) {\n visitHomePage();\n } else {\n var Session = JSON.parse(localStorage[config.data[0].storage_key+\"_Session\"]);\n if (Session == null) {\n visitHomePage();\n } else {\n if (Session[\"login_status\"] == \"Active\") {\n var dirPath = dirname(location.href);\n var fullPath = dirPath + \"/profile.html\";\n window.location = fullPath;\n } else {\n visitHomePage();\n }\n }\n }\n}", "function setupSettings() {\n var showUsername = localStorage.getItem(\"showUsername\");\n var showAccountNumber = localStorage.getItem(\"showAccountNumber\");\n \n $(\"#showUsername\").prop(\"checked\", showUsername == null ? true : showUsername === \"true\");\n $(\"#showAccountNumber\").prop(\"checked\", showAccountNumber == null ? true : showAccountNumber === \"true\");\n \n var maxRows = localStorage.getItem(\"maxRows\");\n maxRows = maxRows == null ? 500 : maxRows; // Default to 500\n $(\"#max-rows\").val(maxRows);\n }", "function addProfile(profile) {\r\n let store = browser.storage.local.get({\r\n profiles: []\r\n });\r\n store.then(function(results) {\r\n var profiles = results.profiles;\r\n profiles.push(profile);\r\n let store = browser.storage.local.set({\r\n profiles\r\n });\r\n store.then(null, onError);\r\n displayProfiles();\r\n });\r\n}", "get profile () {\n\t\treturn this._profile;\n\t}", "function editProfile() {\n setErrorsVisible(true);\n setCurrentPasswordServerError(\"\");\n setUsernameServerError(\"\");\n setEmailServerError(\"\");\n console.log(getProfileUsernameError(true, true, fieldsStateUser.username, currentUser.username, usernameServerError));\n if (!hasErrors(true, \"\", \"\", \"\")) {\n const newUser = createUserForUpdate(currentUser, fieldsStateUser, enableNotifications);\n updateUser(newUser)\n .then(result => {\n props.showStatusAlert(\"Данные успешно обновлены\", \"success\");\n console.log(result);\n\n //save success so current user is equal to new user\n setCurrentUser(newUser);\n props.updatePopoverUser(newUser);\n\n //slackcredentials saved, other values are \"\" by default\n //reset fields\n const newFieldStateUser = getDefaultFieldsStateUser();\n newFieldStateUser.slackCredentials = fieldsStateUser.slackCredentials;\n setFieldsStateUser(newFieldStateUser);\n setErrorsVisible(false);\n setShouldChangeLogin(false);\n setShouldChangeEmail(false);\n setShouldChangePassword(false);\n })\n .catch(err => {\n props.updateIsTokenExpired(err.message);\n if (err.message.length > HttpStatusCodeLength || err.message === ErrorInternalServerErr)\n props.showStatusAlert(\"Не удалось обновить данные\", \"error\");\n console.log(err.message);\n setCurrentPasswordServerError(parseCurrentPasswordServerError(err.message));\n setUsernameServerError(parseUsernameServerError(err.message));\n setEmailServerError(parseEmailServerError(err.message));\n });\n }\n }", "function showProfile (name, catchPhrase, location) {\n\tconsole.log(`PROFILE:\\n Name: ${name}\\n Catchphrase: ${catchPhrase}\\n Location: ${location}`);\n}", "getProfile() {\n return this.profile;\n }", "function setup() {\n //Create canvas\n createCanvas(910, 480);\n\n //Load the data\n let data = JSON.parse(localStorage.getItem(PROFILE_DATA_KEY)); // Convert to object\n //Check if there was data to load\n if (data) {\n //Password protect page\n let password = prompt(`What's your password, mate?`);\n if (password === data.password) {\n setSpyProfile(data);\n //Make the computer speak\n responsiveVoice.speak(\n `HACKER. HACKER. HACKER. HACKER.`,\n `UK English Male`,\n {\n pitch: 0.25,\n rate: 0.5,\n volume: 1\n }\n );\n }\n } else {\n generateSpyProfile();\n }\n}", "function userProfileController(){\n\n\t\t\t\tvar setup = $interval(function(){\n\n\t\t\t\t\tif(userService.getUserLoaded()){\n\n\t\t\t\t\t\t$interval.cancel(setup);\n\n\t\t\t\t\t\tif($stateParams.username === $rootScope.app.user.username){\n\t\t\t\t\t\t\t$scope.profile.meta.own = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$scope.profile.meta.role = $rootScope.app.user.role;\n\n\t\t\t\t\t\tvar string = '';\n\t\t\t\t\t\tif($rootScope.app.user.name){\n\t\t\t\t\t\t\tstring = $rootScope.app.user.name + '\\'s profile';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tstring = $rootScope.app.user.username + '\\'s profile';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$rootScope.app.stateTitle = string;\n\n\t\t\t\t\t\t$scope.profile.user = userService.getUser();\n\n\t\t\t\t\t\t$scope.profile.goals = {\n\t\t\t\t\t\t\tattainment: $scope.profile.user.attainmentGoal,\n\t\t\t\t\t\t\tattendance: $scope.profile.user.attendanceGoal\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif(!$scope.$$phase) $scope.$apply();\n\n\t\t\t\t\t\tinitGoalSliders();\n\n\t\t\t\t\t\tconsole.log($rootScope.app.user.enrolledModules);\n\t\t\t\t\t}\n\n\t\t\t\t}, 100);\n\t\t\t}", "function updateProfile() {\n\t\tif (newName.value!=\"\") {\n\t\t\tname.innerHTML = newName.value;\n\t\t}\n\t\tif (newEmail.value!=\"\") {\n\t\t\temail.innerHTML = newEmail.value;\n\t\t}\n\t\tif (newPhone.value!=\"\") {\n\t\t\tphone.innerHTML = newPhone.value;\n\t\t}\n\t\tif (newZipcode.value!=\"\") {\n\t\t\tzipcode.innerHTML = newZipcode.value;\n\t\t}\n\t\tif (newPassword.value!=\"\") {\n\t\t\tpassword.innerHTML = newPassword.value;\n\t\t}\n\t\tif (newPwconfirm.value!=\"\") {\n\t\t\tpwconfirm.innerHTML = newPwconfirm.value;\n\t\t}\n\n\t\tnewName.value = \"\";\n\t\tnewEmail.value = \"\";\n\t\tnewPhone.value = \"\";\n\t\tnewZipcode.value = \"\";\n\t\tnewPassword.value = \"\";\n\t\tnewPwconfirm.value = \"\";\n\t}", "function onLinkedInAuth() {\n IN.API.Profile(\"me\").fields(\"id,firstName,lastName,emailAddress\").result(displayProfiles);\n }", "async refreshProfile() {\n // Fetch the latest profile\n const response = await this.fetcher.fetchJSON({\n method: 'GET',\n path: routes.api().auth().profile().path\n });\n\n // Create a profile instance\n this._profile = new UserProfile(response);\n // Store this for later hydration\n this.storage.profile = this._profile;\n }", "function submitProfile(newProfile) {\n }", "function load_options() {\n\n\tvar profiles = get_profiles();\n\n\tvar t = $.template('<tr><td rowspan=\"2\">${name}</td><td>Live:</td><td>${live}</td><td rowspan=\"2\"><button type=\"button\" class=\"btnDeleteProfile\" data-index=\"${index}\">Del</button></td></tr><tr><td>Dev:</td><td>${dev}</td></tr>');\n\tfor (var i in profiles)\n\t{\n\t\tvar profile = profiles[i];\n\t\tprofile.index = i;\n\t\t$('#profilesrows').append(t, profile);\n\t}\n}", "function loadCurrentProfile(e){\n let targetProfile = e.target.title;\n \n if(localStorage.getItem(targetProfile) !== null){\n let currentProfile = localStorage.getItem(targetProfile);\n localStorage.setItem(\"currentProfile\", JSON.stringify(currentProfile));\n }\n else{\n console.log(\"Error: profile not found\");\n }\n}", "function LodLiveProfile() {\n\n }", "function loadUserPreferences(){\n\t\toptions = getUserPreferences();\n\t}", "settingsUrl (baseUrl,username){\n browser.get(baseUrl + username + \"/_settings\");\n }", "getProfile() {\n return this._profile;\n }", "function openProfileInfo() {\n vm.showUserInfo = !vm.showUserInfo;\n }", "function myprofile(){\n\tuser_profile.style.display = 'block'\n\tvar user=JSON.parse(localStorage.getItem('User'));\n\tdocument.getElementById('profile_name').innerHTML=user.fullName;\n\tdocument.getElementById('profile_phone').innerHTML=user.phone;\n\tdocument.getElementById('profile_email').innerHTML=user.email;\n\tdocument.getElementById('profile_password').value=user.password;\n}", "function onProfileLoad() {\n const loginInfo = getLoginInfo();\n loginInfo.then(ifLoggedOutRedirectHome); \n loginInfo.then(getUserOrRedirectRegistration).then((person) => {\n autofillForm(person); \n });\n}", "updateUserDetails() {\n if (!activeUser()) return;\n $(conversations_area).find(`[data-user-id=\"${activeUser().id}\"] .sb-name,.sb-top > a`).html(activeUser().get('full_name'));\n $(conversations_area).find('.sb-user-details .sb-profile').setProfile();\n SBProfile.populate(activeUser(), $(conversations_area).find('.sb-profile-list'));\n }", "setActivePoolProfile(profileID) {\n\t\tthis.activePoolProfile = profileID\n\t}", "getProfilePageUrl() {\n if (this.egovConfig) {\n const config = this._resolveString(this.egovConfig.myProfileUrl);\n if (config !== null) {\n return config;\n }\n }\n let envPrefix = this.envDetector.getEnvironmentPrefix();\n if (envPrefix !== '') {\n envPrefix += '-';\n }\n return `${this.protocol}://${envPrefix}iam.civis.bz.it/api/appurls/MyProfile`;\n }", "async function Profile(evt) {\n evt.preventDefault();\n if (localStorage.userId !== undefined) {\n hidePageComponents();\n $profileInfo.show();\n $userProfile.show();\n $links.show();\n $logoutBtn.show();\n $userBtn.show();\n\n if (localStorage.favTeamId == \"None\") {\n $favTeam.text(\"You have not selected a favorite team\");\n } else {\n $favTeam.text(\n `Your currently selected favorite team is the ${localStorage.favTeamName}`\n );\n }\n } else {\n $welcome.show();\n $loginBtn.show();\n $signupBtn.show();\n }\n}", "async function profilePage() {\n if (getPath() === 'profile.html') {\n const params = new URLSearchParams(document.location.search.substring(1));\n let overview;\n if (params.has('user')) {\n // Hide edit button\n document.querySelector('a.edit').classList.add('hide');\n\n // Fetch user profile\n const id = params.get('user');\n const [user] = await UserAPI.fetchUser(id);\n // Fetch user records\n const baseUrl = RecordAPI.uri;\n const url = `${baseUrl}/records?user=${id}`;\n const records = await RecordAPI.fetchRecords(url);\n overview = generateOverview(records);\n renderProfile(user, overview);\n } else {\n const { user } = auth();\n overview = getOverview();\n renderProfile(user, overview);\n }\n }\n}", "function showProfile(name, catchphrase, location) {\n\tconsole.log(`PROFILE:\\nName: ${name}\\nCatchphrase: ${catchphrase}\\nLocation: ${location}`);\n}", "get profile() {\n return this._profile;\n }", "function settings(e) {\n e.detail.applicationcommands = {\n \"divAccount\": { href: \"accountSettings.html\", title: \"Account\" },\n \"divPrivacy\": { href: \"privacySettings.html\", title: \"Privacy\" },\n };\n WinJS.UI.SettingsFlyout.populateSettings(e);\n }", "function loadProfileForNewUser(user) {\n console.log(\"firebase auth sesssion\",user)\n renderForNewUser();\n setProfileName(user.displayName)\n setProfileImage(user.photoURL)\n setMobileNumber(user.phoneNumber)\n setEmail(user.email)\n}", "function setup() {\n // Create the canvas\n createCanvas(windowWidth, windowHeight);\n // Try to load the data\n let data = JSON.parse(localStorage.getItem(PROFILE_DATA_KEY));\n // Check if there was data to load\n if (data) {\n // If so, ask for the password\n let password = prompt(`What is your top secret password?`);\n // Check if the password is correct\n if (password === data.password) {\n // If is is, then setup the spy profile with the data\n setupSpyProfile(data);\n }\n }\n else {\n // If there is no data, generate a spy profile for the user\n generateSpyProfile();\n }\n\n bg = loadImage('assets/images/topsecretbckgrnd.jpg');\n}", "function initialize_shit(){\n\tif(!user_exists('default')){\n\t\tadd_user('default', '', patients_default);\n\t}\n}", "function initializePage_userProfile()\r\n{\r\n page_userProfile.$auxButton.eq(0).click(logout);\r\n page_userProfile.$auxButton.eq(1).click(showPage_editAccount);\r\n}", "function setUser(user_id) {\n Profile.setUser(user_id);\n }", "function profileChipPopulate() {\n var profileStore = retrieveProfileInfo();\n var activity = makeGerund(profileStore.style);\n var userProfString = profileStore.firstName + \", \" + profileStore.age + \" | \" + \"Exploring \" + activity + \" \" + profileStore.venue + \"s\";\n $(\"#userProfile\").text(userProfString);\n}", "function user(){\r\n uProfile(req, res);\r\n }", "function Profile() {\n const tokenState = useSelector(token);\n const loading = useSelector((state) => state.user.status);\n\n let profileMarkup;\n\n if (loading === 'pending') {\n profileMarkup = <ProfileSkeleton />;\n }\n\n if (loading === 'success' && tokenState) {\n profileMarkup = <AuthProfile />;\n }\n if (\n (!tokenState && loading === 'success') ||\n loading === 'idle' ||\n loading === 'rejected'\n ) {\n profileMarkup = <GuestProfile />;\n }\n\n return profileMarkup;\n}", "static getProfile() {\n // console.log(\"getProfile()\");\n return store.get('CURRENT_PROFILE');\n }", "function displayProfile(profile){\n \t// console.log(\"name:\" + profile['displayName']);\n \t// console.log(\"email: \"+ email);\n \tuserName = profile['displayName'];\n \tuserID = email;\n \tGplusLoggedin = true;\n \tloginSuccessFul();\n \t\n \t\n \tcheckIfUserInDB(userID);\n \t\n \t// console.log();\n \t\n // document.getElementById('name').innerHTML = profile['displayName'];\n // document.getElementById('pic').innerHTML = '<img src=\"' + profile['image']['url'] + '\" />';\n // document.getElementById('email').innerHTML = email;\n \n }", "function setSettings (object){\n\n\n Socialite.setup(settings);\n\n }", "function update() {\n // PREPARE\n let uid = $rootScope.account.authData.uid;\n let profile = $rootScope.account.profile;\n\n // NEW USER ACTION\n if (profile.newUser) {\n instance.addAchievement(profile, ACHIEVEMENTS.PROFILE_COMPLETED);\n profile.newUser = false;\n }\n\n // UPDATE\n $rootScope.db.users.child(uid).update(profile);\n\n // NOTIFY\n BroadcastService.send(EVENTS.PROFILE_UPDATED, profile);\n }", "function showConfigUser() {\n\n\tdocument.getElementById('sel_editor_font_size').value = v_editor_font_size;\n\tdocument.getElementById('sel_interface_font_size').value = v_interface_font_size;\n\tdocument.getElementById('sel_editor_theme').value = v_theme_id + '/' + v_editor_theme;\n\n\tdocument.getElementById('txt_confirm_new_pwd').value = '';\n\tdocument.getElementById('txt_new_pwd').value = '';\n\n\tdocument.getElementById('chk_enable_chat').checked = ((v_enable_omnichat == 1) ? true : false);\n\n\tdocument.getElementById('sel_csv_encoding').value = v_csv_encoding;\n\tdocument.getElementById('txt_csv_delimiter').value = v_csv_delimiter;\n\n\t$('#div_config_user').addClass('isActive');\n\n}", "function displayProfiles() {\r\n let store = browser.storage.local.get({\r\n profiles: []\r\n });\r\n store.then(function(results) {\r\n var profiles = results.profiles;\r\n\r\n for (var i = 0; i < profiles.length; i++) {\r\n addProfileToAList(profiles[i]);\r\n }\r\n });\r\n}", "function handleStartup() { //Read from local storage\r\n restoreOptions();\r\n enableGoogle();\r\n enableWikipedia();\r\n enableBing();\r\n enableDuckDuckGo();\r\n enableYahoo();\r\n enableBaidu();\r\n enableYoutube();\r\n enableWolframAlpha();\r\n enableYandex();\r\n enableReddit();\r\n enableImdb();\r\n enableDictionarydotcom();\r\n enableThesaurusdotcom();\r\n enableStackOverflow();\r\n enableGitHub();\r\n enableAmazon();\r\n enableEbay();\r\n enableTwitter();\r\n console.log('Twitter enabled on startup');\r\n enableFacebookPeopleSearch();\r\n}", "async function showProfiles() {\n const userId = localStorage.getItem('currentAccount');\n const profiles = await util.getProfilesByUserAccount(userId);\n\n await profiles.forEach(createProfileElement);\n}", "function onProfileProperties(gitProperties) {\n angular.forEach(gitProperties, function (value, key) {\n var configProperty = configValues[key];\n if (configProperty) {\n configProperty.Value = value;\n }\n });\n updateSchemaAndLoadMetaType();\n Core.$apply($scope);\n }", "function loadProfile() {\n var d = $q.defer();\n // aca deberia hacer la llamada al servidor\n vm.view.profile = \"admin\";\n\n var style = (vm.view.profile == 'admin') ? vm.view.profileAdmin : vm.view.profileUser;\n vm.view.style = style + ' ' + vm.view.displayListUsers;\n d.resolve();\n\n return d.promise;\n }", "function create(){\n // PREPARE\n let uid = $rootScope.account.authData.uid;\n let profile = instance.extract($rootScope.account.authData);\n\n // INITIALIZE\n $rootScope.db.users.child(uid).set(profile);\n $rootScope.account.profile = profile;\n }", "function configureSettings() {\n this.show.config = !this.show.config;\n //if saving an open config\n if (!this.show.config) {\n $ionicScrollDelegate.scrollTop(true);\n this.score.saveObj({config: this.score.data.config});\n } else {\n $ionicScrollDelegate.scrollBottom(true);\n }\n }", "function updateUserProfile() {\n // $('#profile-name)\n $(\"#show-name\").html(` ${currentUser.name}`);\n $(\"#show-username\").html(` ${currentUser.username}`);\n $(\"#show-date\").html(` ${currentUser.createdAt.slice(0, 10)}`);\n }", "onSuccess() {\n let basicProfile = window.gapi.auth2\n .getAuthInstance()\n .currentUser.get()\n .getBasicProfile();\n localStorage.setItem(\"authoritySignedIn\", true);\n this.setState(\n {\n isSignedIn: true,\n err: null,\n authorityId: basicProfile.getId(),\n profileName: basicProfile.getName(),\n profileEmail: basicProfile.getEmail(),\n profilePhotoURL: basicProfile.getImageUrl()\n },\n () => {\n this.validateAndPostProfileData(basicProfile);\n }\n );\n }", "function displayProfile(profile) {\n if (toShow) {\n toShow.style.display = \"none\"\n toShow = profile\n toShow.style.display = \"block\"\n }\n} //end of displayProfile" ]
[ "0.6613246", "0.65201426", "0.6515455", "0.6393162", "0.63072085", "0.62113386", "0.61646914", "0.6132881", "0.61245334", "0.6105772", "0.6088496", "0.6077995", "0.60442907", "0.60389894", "0.6016383", "0.60099936", "0.5999849", "0.59751046", "0.5936447", "0.5933309", "0.5924364", "0.591865", "0.59117436", "0.5908079", "0.5907703", "0.5901751", "0.589434", "0.58881974", "0.5848357", "0.5846038", "0.58413684", "0.5833824", "0.5810963", "0.5796757", "0.5796196", "0.5791746", "0.5777864", "0.57626563", "0.5762643", "0.57593757", "0.57522327", "0.5748199", "0.57435066", "0.5732245", "0.57206255", "0.57183635", "0.5713821", "0.5686217", "0.56644356", "0.5654494", "0.564966", "0.5626982", "0.56154674", "0.56133205", "0.56114244", "0.56109864", "0.56079817", "0.5601241", "0.5598564", "0.55937684", "0.5592469", "0.55831677", "0.55822176", "0.55819863", "0.55615747", "0.55531484", "0.55515015", "0.5530318", "0.5529734", "0.5524376", "0.5516676", "0.5505069", "0.5495743", "0.54951525", "0.54922", "0.54921", "0.5491886", "0.5491161", "0.54843414", "0.5480121", "0.5478426", "0.54740095", "0.5472825", "0.5470485", "0.54678214", "0.54647565", "0.54644156", "0.5463846", "0.5445885", "0.5445708", "0.5443896", "0.5442438", "0.54381835", "0.54372793", "0.54316133", "0.5430503", "0.54292524", "0.54257137", "0.5417657", "0.54153", "0.5415234" ]
0.0
-1
tranforms options to [switch] [value] does not manage urls
function forge_yslow_args(options){ var known_switchs = [ 'info', 'format', 'ruleset', 'beacon', 'dict', 'threshold', 'ua', 'viewport', 'headers', 'console', 'cdns' ]; var args = []; for( var n in options ){ if( known_switchs.indexOf(n)>-1 && options[n] !== undefined && options[n] !== null ){ args.push("--"+n); args.push(options[n]); } } return args; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOptions(choice, value){\n let options = {\n headers: {\n 'Client-ID': config['Twitch Client ID'],\n }\n };\n\n switch (choice) {\n\n case 'channel':\n options.url = 'https://api.twitch.tv/kraken/channels/' + value;\n break;\n\n case 'stream':\n options.url = 'https://api.twitch.tv/kraken/streams/' + value;\n options.headers.Accept = TWITCH_API;\n break;\n\n default:\n console.log(choice + ' is not an accepted option.' +\n ' Accepted values: user, channel, or stream');\n break;\n }\n\n return options;\n}", "function optionSwitch() {\r\n\t//Standard banner - no extra options; no featured targets available, so desired result mode can't be used\r\n\tif (bannerTypes[0].checked) {\r\n\t\tsimTypes[1].disabled = \"disabled\";\r\n\t\tsimTypes[0].checked = \"checked\";\r\n\t\t\r\n\t\tguarantee4StarToggle.disabled = \"disabled\";\r\n\t\tguarantee5StarToggle.disabled = \"disabled\";\r\n\t\t\r\n\t\trealNonFeat4StarOdds.disabled = \"disabled\";\r\n\t\t\r\n\t\tfor (i=0; i < eventCharTargets.length; i++) {\r\n\t\t eventCharTargets[i].disabled = \"disabled\";\r\n\t }\r\n\t for (i=0; i < epitomizedPathOpts.length; i++) {\r\n\t\t epitomizedPathOpts[i].disabled = \"disabled\";\r\n\t }\r\n\t\tfatePointInput.disabled = \"disabled\";\r\n\t for (i=0; i < eventWeapTargets.length; i++) {\r\n\t\t eventWeapTargets[i].disabled = \"disabled\";\r\n\t }\r\n\t}\r\n\t//Event character banner - character to pursue, if desired result mode is on\r\n\telse if (bannerTypes[1].checked) {\r\n\t\tsimTypes[1].removeAttribute(\"disabled\");\r\n\t\t\r\n\t\tguarantee4StarToggle.removeAttribute(\"disabled\");\r\n\t\tguarantee5StarToggle.removeAttribute(\"disabled\");\r\n\t\t\r\n\t\trealNonFeat4StarOdds.removeAttribute(\"disabled\");\r\n\t\t\r\n\t\tif (simTypes[1].checked) {\r\n\t\t for (i=0; i < eventCharTargets.length; i++) {\r\n\t\t eventCharTargets[i].removeAttribute(\"disabled\");\r\n\t }\r\n\t\t}\r\n\t\telse {\r\n\t\t\tfor (i=0; i< eventCharTargets.length; i++) {\r\n\t\t\t\teventCharTargets[i].disabled = \"disabled\";\r\n\t\t\t}\r\n\t\t}\r\n\t for (i=0; i < epitomizedPathOpts.length; i++) {\r\n\t\t epitomizedPathOpts[i].disabled = \"disabled\";\r\n\t }\r\n\t\tfatePointInput.disabled = \"disabled\";\r\n\t for (i=0; i < eventWeapTargets.length; i++) {\r\n\t\t eventWeapTargets[i].disabled = \"disabled\";\r\n\t }\r\n\t}\r\n\t//Event weapon banner - Epitomized Path; character to pursue, if desired result mode is on\r\n\telse {\r\n\t\tsimTypes[1].removeAttribute(\"disabled\");\r\n\t\t\r\n\t\tguarantee4StarToggle.removeAttribute(\"disabled\");\r\n\t\tguarantee5StarToggle.removeAttribute(\"disabled\");\r\n\t\t\r\n\t\trealNonFeat4StarOdds.removeAttribute(\"disabled\");\r\n\t\t\r\n\t\tfor (i=0; i < eventCharTargets.length; i++) {\r\n\t\t eventCharTargets[i].disabled = \"disabled\";\r\n\t }\r\n\t for (i=0; i < epitomizedPathOpts.length; i++) {\r\n\t\t epitomizedPathOpts[i].removeAttribute(\"disabled\");\r\n\t }\r\n\t\tfatePointInput.removeAttribute(\"disabled\");\r\n\t\tif (simTypes[1].checked) {\r\n\t for (i=0; i < eventWeapTargets.length; i++) {\r\n\t\t eventWeapTargets[i].removeAttribute(\"disabled\");\r\n\t }\r\n\t\t}\r\n\t\telse {\r\n\t\t\tfor (i=0; i < eventWeapTargets.length; i++) {\r\n\t\t\t\teventWeapTargets[i].disabled = \"disabled\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "set options(value) {}", "buildGoOption(term) {\n let isValidPatp = urbitOb.isValidPatp(term.substr(1));\n let isStation = isValidStation(term);\n let details = isStation && getStationDetails(term);\n // use collection description if it's a collection\n let displayTextTerm = isStation ? details.type == 'text' ? `${details.station.split(\"/\")[0]} / ${details.stationTitle}` : details.station.split(\"/\").join(\" / \") : term;\n\n let displayText = `go ${displayTextTerm}`;\n let helpText = isStation ?\n `Go to ${details.cir} on ~${details.host}` :\n `Go to the profile of ${term}`\n\n return {\n name: `go ${term}`,\n action: () => {\n let targetUrl;\n if (isValidPatp) {\n targetUrl = profileUrl(term.substr(1))\n this.props.transitionTo(targetUrl);\n } else if (isStation) {\n targetUrl = (details.type === \"text-topic\") ? details.postUrl : details.stationUrl\n this.props.transitionTo(targetUrl);\n }\n },\n displayText,\n helpText\n };\n }", "function setoption(option, status, clicked) {\r\n _('set option '+option+' to '+status+', clicked: '+clicked);\r\n var type = option.substr(0, option.indexOf('-'));\r\n var name = option.substr(option.indexOf('-')+1);\r\n if (!defined(clicked)) clicked = false;\r\n if (status === null) status = !options[option];\r\n var refresh = type == 'stream' ? ['filter'] : ['layout'];\r\n switch(option) {\r\n case 'global-hide-topbar':\r\n $('body').toggleClass(name, status);\r\n break;\r\n case 'stream-expand-new':\r\n if (status) {\r\n var newtweetsbar = $('div#new-tweets-bar');\r\n if (newtweetsbar.length) newtweetsbar.trigger('click');\r\n }\r\n refresh = ['layout'];\r\n break;\r\n case 'dashboard-hide-filters':\r\n case 'dashboard-hide-options':\r\n widget.toggleClass(name, status);\r\n refresh = [];\r\n break;\r\n case 'stream-show-mutual':\r\n refresh = ['layout', 'mutual'];\r\n break;\r\n case 'stream-show-tab':\r\n case 'stream-show-br':\r\n case 'stream-show-via':\r\n case 'stream-compact-tweets':\r\n case 'stream-small-links':\r\n case 'stream-show-navigation':\r\n case 'stream-highlight-replies':\r\n refresh = ['layout'];\r\n break;\r\n case 'stream-expand-links':\r\n $('div.main-content a[data-'+(status ? 'expanded' : 'shortened')+'-url]').each(function() {\r\n var linkhtml = $(this).html();\r\n $(this).html($(this).attr('data-'+(status ? 'expanded' : 'shortened')+'-url'));\r\n $(this).attr('data-'+(status ? 'shortened' : 'expanded')+'-url', linkhtml);\r\n });\r\n refresh = [];\r\n break;\r\n }\r\n if (status.settingsloaded && option == 'stream-filter-invert' && options['stream-filter-disabled']) {\r\n return false; //don't invert the filter while it is disabled\r\n }\r\n options[option] = status; //set option\r\n if (option == 'stream-show-mutual') {\r\n ticking.fetchrelationships = !!status;\r\n }\r\n if (option == 'stream-filter-disabled') {\r\n widget.find('ul.tweetfilter-list input,li.filter input')\r\n .not('[data-option=stream-filter-disabled],[data-option=stream-show-navigation],[data-option=dashboard-show-matchcount]')\r\n .attr('disabled', status);\r\n setstreamtitle();\r\n refresh = ['filter', 'layout'];\r\n }\r\n if (!clicked || option == 'stream-filter-invert') {\r\n widget.find('input[data-option='+option+']').attr('checked', status);\r\n }\r\n if (clicked && option == 'stream-filter-invert') {\r\n window.scrollTo(0,0); //scroll to top when switching between timeline and filtered\r\n }\r\n if (option == 'stream-filter-invert' || option == 'stream-show-tab') {\r\n setstreamtitle();\r\n }\r\n if (clicked) {\r\n savesettings();\r\n applycss(refresh);\r\n } else {\r\n _W('setoption not applying css: '+option);\r\n }\r\n return status;\r\n }", "function Switch(val){\n var answer = \"\";\n \n switch(val){\n \n case 1:\n answer = \"alpha(1)\";\n break;\n\n case 2:\n answer = \"Beta(2)\";\n break;\n \n // Resultat par défaut \n default:\n answer = \"stuff\"\n \n };\n \n return answer\n}", "function test_switches(opt) {\n var test_types = ['symbols', 'strings', 'oddball', 'smi', 'heapnum'];\n\n function test(clause_type) {\n var values = clause_values[clause_type];\n\n test_types.forEach(function(test_type) {\n test_switch(clause_type, test_type, 'all', opt);\n test_switch(clause_type, test_type, 'none', opt);\n\n // Targeting specific clause feedback\n values.forEach(function(value) {\n test_switch(clause_type, test_type, [value], value, opt);\n test_switch(clause_type, test_type, value, value, opt);\n });\n });\n };\n\n test('string');\n test('smi');\n test('mixed');\n}", "function changeObliqueFreeValue(option, value) {\r\n switch (option) {\r\n case ('l'):\r\n obliqueFreeL = value;\r\n document.getElementById(\"obliqueFreeL\").innerHTML = value;\r\n document.getElementById(\"obliqueFreeOptionsL\").value = value;\r\n break;\r\n case ('alpha'):\r\n obliqueFreeAlpha = value;\r\n document.getElementById(\"obliqueFreeAlpha\").innerHTML = value;\r\n document.getElementById(\"obliqueFreeOptionsAlpha\").value = value;\r\n break;\r\n }\r\n}", "function options(){\n\n \tswitch(userInput) {\n\n\t\tcase \"my-tweets\": \n\t\tmyTweets(); \n\t\tbreak;\n\n\t\tcase \"spotify-this-song\": \n\t\tspotifyThisSong(); \n\t\tbreak;\n\n\t\tcase \"movie-this\":\n\t\t movieThis(); \n\t\t break;\n\n\t\tcase \"do-what-it-says\": \n\t\tdoWhatItSays(); \n\t\tbreak;\n\t}\n}", "function captivePortalChangeMode(selName){\n var selValue = comboSelectedValueGet (selName);\n if (!selValue) \n return;\n $(\"#tf1_configurationName\").show();\n $('#tf1_configurationName').prop('disabled', false);\n $(\"#tf1_configurationName_billing\").hide();\n $('#tf1_configurationName_billing').prop('disabled', 'disabled');\n\n\n switch (parseInt(selValue, 10)) {\n case 1: /* Free */\n fieldStateChangeWr('tf1_configurationNameSla tf1_configurationName tf1_enableRedirect tf1_UrlName tf1_authenticationServer tf1_captivePortalProfileSlaBlock tf1_captivePortalProfileBlock', '', '', '');\n vidualDisplay('tf1_configurationNameSla tf1_captivePortalProfileSlaBlock tf1_enableRedirect tf1_UrlName tf1_authenticationServer tf1_configurationName tf1_captivePortalProfileBlock', 'hide');\n vidualDisplay('break_enableRedirect break_UrlName break_configurationNameSla', 'hide');\n\tbreak;\n case 2: /* SLA */\n fieldStateChangeWr('tf1_authenticationServer tf1_configurationName tf1_authenticationType tf1_configurationName_billing tf1_configurationName tf1_captivePortalProfileBlock', '', 'tf1_enableRedirect tf1_UrlName tf1_configurationNameSla', '');\n vidualDisplay('tf1_authenticationServer tf1_authenticationType tf1_configurationName tf1_captivePortalProfileBlock tf1_configurationName', 'hide');\n vidualDisplay('break_authenticationServer break_authenticationType break_configurationName break_captivePortalProfileBlock', 'hide');\n vidualDisplay('tf1_enableRedirect tf1_UrlName tf1_configurationNameSla tf1_captivePortalProfileSlaBlock', 'configRow');\n vidualDisplay('break_enableRedirect break_UrlName', 'break');\n enableTextFieldByAnchorClick('tf1_enableRedirect','tf1_UrlName');\n break;\n case 3: /* Permanent User */\n fieldStateChangeWr('tf1_configurationName_billing tf1_configurationNameSla', '', 'tf1_authenticationServer tf1_authenticationType tf1_configurationName tf1_captivePortalProfileSlaBlock tf1_captivePortalProfileBlock tf1_enableRedirect tf1_UrlName', '');\n vidualDisplay('tf1_authenticationServer tf1_authenticationType tf1_configurationName tf1_captivePortalProfileBlock tf1_enableRedirect tf1_UrlName tf1_configurationName', 'configRow');\n vidualDisplay('tf1_configurationNameSla tf1_captivePortalProfileSlaBlock', 'hide');\n vidualDisplay('break_authenticationServer break_configurationNameSla break_authenticationType break_configurationName break_captivePortalProfileBlock break_enableRedirect break_UrlName', 'break');\n authServerChangeMode('tf1_authenticationServer');\n enableTextFieldByAnchorClick('tf1_enableRedirect','tf1_UrlName');\n break;\n case 4: /* Temporary User */\n fieldStateChangeWr('tf1_configurationNameSla tf1_captivePortalProfileSlaBlock tf1_configurationName_billing tf1_authenticationServer tf1_authenticationType', '', 'tf1_configurationName tf1_captivePortalProfileBlock tf1_enableRedirect tf1_UrlName', '');\n vidualDisplay('tf1_configurationName tf1_captivePortalProfileBlock tf1_enableRedirect tf1_UrlName', 'configRow');\n vidualDisplay('break_configurationName break_configurationNameSla break_captivePortalProfileBlock break_enableRedirect break_UrlName', 'break');\n vidualDisplay('tf1_authenticationServer tf1_authenticationType tf1_captivePortalProfileSlaBlock', 'hide');\n vidualDisplay('break_authenticationServer break_authenticationType', 'hide');\n authServerChangeMode('tf1_authenticationServer');\n enableTextFieldByAnchorClick('tf1_enableRedirect','tf1_UrlName');\n break; \n case 5: /* Billing */\n fieldStateChangeWr('tf1_configurationNameSla tf1_captivePortalProfileSlaBlock tf1_authenticationServer tf1_authenticationType tf1_configurationName', '', 'tf1_configurationName_billing tf1_captivePortalProfileBlock tf1_enableRedirect tf1_UrlName', '');\n vidualDisplay('tf1_configurationName tf1_captivePortalProfileBlock tf1_enableRedirect tf1_UrlName', 'configRow');\n vidualDisplay('break_configurationName break_configurationNameSla break_captivePortalProfileBlock break_enableRedirect break_UrlName', 'break');\n vidualDisplay('tf1_authenticationServer tf1_authenticationType tf1_captivePortalProfileSlaBlock', 'hide');\n vidualDisplay('break_authenticationServer break_authenticationType', 'hide');\n authServerChangeMode('tf1_authenticationServer');\n enableTextFieldByAnchorClick('tf1_enableRedirect','tf1_UrlName');\n $(\"#tf1_configurationName_billing\").show();\n $('#tf1_configurationName_billing').prop('disabled', false);\n $(\"#tf1_configurationName\").hide();\n $('#tf1_configurationName').prop('disabled', 'disabled');\n }\n}", "function cmdSwitch() {\n\n switch (action) {\n\n case 'spotify-this-song':\n spotifySong(input);\n break;\n\n case 'concert-this':\n bands(input);\n break;\n\n case 'movie-this':\n movies(input);\n break;\n\n default:\n logged(\"Please provide LIRI some instruction\");\n break;\n }\n}", "function changemode(that){\n if(that.value==='link'){\n document.getElementById(\"topo-seg-input\").disabled=true;\n document.getElementById(\"link-input\").disabled=false;\n }else if (that.value === 'topo'){\n document.getElementById(\"link-input\").disabled=true;\n document.getElementById(\"topo-seg-input\").disabled=false;\n }\n}", "function InitiateViewOption() {\n if ($(\".select-enable-btn\").text() == \"Select\") {\n $(location).attr('href', $(this).data(\"url\"));\n }\n}", "function InitiateViewOption() {\n $(location).attr('href', $(this).data(\"url\"));\n}", "registerOption(key, value)\n {\n this.routeOptions[key] = value;\n }", "function switchRouteOptionsPane(e) {\n\t\t\tvar parent = $('.routePreferenceBtns').get(0);\n\t\t\tvar optionType = e.currentTarget.id;\n\n\t\t\t//switch the buttons above\n\t\t\tvar allBtn = parent.querySelectorAll('button');\n\t\t\tfor (var i = 0; i < allBtn.length; i++) {\n\t\t\t\tvar btn = allBtn[i];\n\t\t\t\tif (btn == e.currentTarget) {\n\t\t\t\t\tbtn.addClassName('active');\n\t\t\t\t\t//adapt image\n\t\t\t\t\tvar imgElement = btn.querySelector('img');\n\t\t\t\t\timgElement.setAttribute('src', list.routePreferencesImages.get(btn.id)[1]);\n\n\t\t\t\t\t//set the selected entry as currently selected route option\n\t\t\t\t\tvar options = $('#' + btn.id + 'Options').get(0).querySelector('input[checked=\"checked\"]');\n\t\t\t\t\trouteOptions[0] = options.id;\n\t\t\t\t\ttheInterface.emit('ui:routingParamsChanged');\n\t\t\t\t\ttheInterface.emit('ui:prefsChanged', {\n\t\t\t\t\t\tkey : preferences.routeOptionsIdx,\n\t\t\t\t\t\tvalue : routeOptions[0]\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tbtn.removeClassName('active');\n\t\t\t\t\t//adapt image\n\t\t\t\t\tvar imgElement = btn.querySelector('img');\n\t\t\t\t\timgElement.setAttribute('src', list.routePreferencesImages.get(btn.id)[0]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//switch the content\n\t\t\tvar car = $('#carOptions');\n\t\t\tvar bike = $('#bicycleOptions');\n\t\t\tvar ped = $('#pedestrianOptions');\n\t\t\tvar avoidables = $('#avoidables');\n\t\t\tif (optionType === 'car') {\n\t\t\t\tcar.show();\n\t\t\t\tavoidables.show();\n\t\t\t\tbike.hide();\n\t\t\t\tped.hide();\n\t\t\t} else if (optionType === 'bicycle') {\n\t\t\t\tcar.hide();\n\t\t\t\tavoidables.hide();\n\t\t\t\tbike.show();\n\t\t\t\tped.hide();\n\t\t\t} else {\n\t\t\t\tcar.hide();\n\t\t\t\tavoidables.hide();\n\t\t\t\tbike.hide();\n\t\t\t\tped.show();\n\t\t\t}\n\t\t}", "function switchResult(options) {\n let option = \"\";\n\n switch (options) {\n case 1:\n option = \"Single and ready to mingle\";\n break;\n case 2:\n option = \"Happily Married\";\n break;\n case 3:\n option = \"None of your business\";\n break;\n default:\n option = \"None of these options was chosen\";\n }\n\n return option;\n}", "function linkOpts(val) {\n \tif (val && typeof val == \"string\") {\n \t\treturn { href: val };\n \t} else {\n \t\treturn val || {};\n \t}\n }", "function linkOpts(val) {\n \tif (val && typeof val == 'string') {\n \t\treturn { href: val };\n \t} else {\n \t\treturn val || {};\n \t}\n }", "function toggleDevOptions() {\n returnURL.val('auto#');\n lang.val('default');\n lang.parent().parent().toggle();\n referer.parent().parent().toggle();\n returnURL.parent().parent().toggle();\n oauthState.parent().parent().hide();\n}", "option(flags, description, fn, defaultValue) {\n const option = new _option.default(flags, description);\n const optionName = option.name();\n const name = option.attributeName(); // default as 3rd arg\n\n if (typeof fn !== 'function') {\n if (fn instanceof RegExp) {\n const regex = fn;\n\n fn = (val, def) => {\n const m = regex.exec(val);\n return m ? m[0] : def;\n };\n } else {\n defaultValue = fn;\n }\n } // preassign default value only for --no-*, [optional], or <required>\n\n\n if (!option.bool || option.optional || option.required) {\n // when --no-* we make sure default is true\n if (!option.bool) defaultValue = true; // preassign only if we have a default\n\n if (defaultValue !== undefined) {\n this[name] = defaultValue;\n option.defaultValue = defaultValue;\n }\n } // register the option\n\n\n this.options.push(option); // when it's passed assign the value\n // and conditionally invoke the callback\n\n this.on(`option:${optionName}`, val => {\n // coercion\n if (val != null && typeof fn === 'function') {\n val = fn(val, this[name] === undefined ? defaultValue : this[name]);\n } // unassigned or bool\n\n\n if (typeof this[name] === 'boolean' || typeof this[name] === 'undefined') {\n // if no value, bool true, and we have a default, then use it!\n if (val == null) {\n this[name] = option.bool ? defaultValue || true : false;\n } else {\n this[name] = val;\n }\n } else if (val != null) {\n // reassign\n this[name] = val;\n }\n });\n return this;\n }", "function toggleShortUrlOutput(defaultUrl, checkbox, textbox) {\t\t\n\t\n\tif($PBJQ(checkbox).is(':checked')) {\n\t\t\n\t\t$PBJQ.ajax({\n\t\t\turl:'/direct/url/shorten?path='+encodeURI(defaultUrl),\n\t\t\tsuccess: function(shortUrl) {\n\t\t\t\t$PBJQ('.'+textbox).val(shortUrl);\n\t\t\t}\n\t\t}); \n\t} else {\n\t\t$PBJQ('.'+textbox).val(defaultUrl);\n\t}\n}", "function PlayCustomPromptSwitch(locale,value, functionName,params)\n{\n\tlocale = locale.replace('-','').replace(/'/g,\"\");\n\tvar result;\n var paramString=\"\";\n \n\tfor (var index = 0; index < params.length; index++) {\n\t\tparamString = paramString+\",\\'\"+params[index]+\"\\'\"; \n\t}\n\t\n\teval( \"result = \" + locale +functionName.substr(4)+\"(\\'\"+ value +\"\\'\"+paramString+\")\"); \n\n\treturn result;\n}", "function changePerspectiveFreeValue(option, value) {\r\n switch (option) {\r\n case ('d'):\r\n perspectiveFreeD = value;\r\n document.getElementById(\"perspectiveFreeD\").innerHTML = value;\r\n document.getElementById(\"perspectiveFreeOptionsD\").value = value;\r\n break;\r\n }\r\n}", "function upgradeOptions(which, value) {\n const options = {\n url: \"https://console.kamatera.com/service/server/\" + serverID + \"/\" + which,\n method: 'PUT',\n headers: {\n 'content-type': 'application/json',\n 'AuthClientId': process.env.KAMATERA_AUTH_ID,\n 'AuthSecret': process.env.KAMATERA_AUTH_SECRET\n },\n body: JSON.stringify({\n which: value,\n \"index\": 0,\n \"provision\": 1\n })\n }\n\n return options;\n}", "function toggleToTargetUrl(serviceToggle){\n if ( serviceToggle == getServiceToggleClass(0) ) {\n return \"/srv_stop/\";\n } else {\n return \"/srv_start/\";\n }\n}", "_bindSwitch(settingsKey) {\n this._bind(settingsKey, 'active');\n }", "function changeL2TPServerMode(selId){\n\tvar selValue = comboSelectedValueGet (selId);\n if (!selValue) return;\t\n switch (parseInt (selValue, 10)){\n case 1: /* Enable IPv4 */\n \tfieldStateChangeWr ('tf1_ipv6Addr tf1_ipv6Length', 'tf1_rangeIpAddressIPv6Block_div', 'tf1_routingMode tf1_startIpAddr tf1_endIpAddr tf1_authType tf1_pap tf1_chap tf1_msChap tf1_msChapv2 tf1_authSecKey tf1_authSecKeyValue tf1_timeOut ', '');\n \tenableTextFieldByAnchorClick('tf1_authSecKey','tf1_authSecKeyValue','break_authSecKey');\n\n \tvidualDisplay ('tf1_routingMode tf1_rangeIpAddressIPv4Block tf1_authTypeDBBlock tf1_authentication tf1_authSecKey tf1_userTimeout ', 'configRow');\n \tvidualDisplay ('break_pptpServerMode break_routingMode break_rangeIpAddressIPv4Block break_authTypeDBBlock break_authentication break_msChapv2 break_authSecKey break_userTimeout break_timeOut ', 'break');\n \tvidualDisplay ('tf1_rangeIpAddressIPv6Block break_rangeIpAddressIPv6Block', 'hide');\n \t\tbreak;\n case 2: /* Enable IPv6 */\n \tfieldStateChangeWr ('', '', 'tf1_routingMode tf1_startIpAddr tf1_endIpAddr tf1_ipv6Addr tf1_ipv6Length tf1_authType tf1_pap tf1_chap tf1_msChap tf1_msChapv2 tf1_authSecKey tf1_authSecKeyValue tf1_timeOut ', '');\n \tenableTextFieldByAnchorClick('tf1_authSecKey','tf1_authSecKeyValue','break_authSecKey');\n\n \tvidualDisplay ('tf1_routingMode tf1_rangeIpAddressIPv4Block tf1_rangeIpAddressIPv6Block tf1_authTypeDBBlock tf1_authentication tf1_authSecKey tf1_userTimeout ', 'configRow');\n \tvidualDisplay ('break_pptpServerMode break_routingMode break_rangeIpAddressIPv4Block break_rangeIpAddressIPv6Block break_authTypeDBBlock break_authentication break_msChapv2 break_authSecKey break_userTimeout break_timeOut ', 'break');\n \tbreak;\n\t case 3: /* Disable */\n \tfieldStateChangeWr ('tf1_routingMode tf1_startIpAddr tf1_endIpAddr tf1_ipv6Addr tf1_ipv6Length tf1_authType tf1_pap tf1_chap tf1_msChap tf1_msChapv2 tf1_authSecKey tf1_authSecKeyValue tf1_timeOut ', '', '');\n \tvidualDisplay ('tf1_routingMode tf1_rangeIpAddressIPv4Block tf1_rangeIpAddressIPv6Block tf1_authTypeDBBlock tf1_authentication tf1_authSecKey tf1_authSecKeyValue tf1_userTimeout ', 'hide');\n \tvidualDisplay ('break_pptpServerMode break_routingMode break_rangeIpAddressIPv4Block break_rangeIpAddressIPv6Block break_authTypeDBBlock break_authentication break_msChapv2 break_authSecKey break_userTimeout break_timeOut ', 'hide');\n \t\tbreak;\n\t}\n\tchangeAuthSupported ();\n}", "function applyUrlQueryStrings() {\n // if asked, toggle featrues at start\n let url = new URL(window.location.href);\n let params = new URLSearchParams(url.search);\n\n // be sure we start with a 'clean' layout, but only if we need it\n var allOptions = [\n 'banner',\n 'altitudeChart',\n 'aircraftTrails',\n 'map',\n 'sidebar',\n 'zoomOut',\n 'zoomIn',\n 'moveNorth',\n 'moveSouth',\n 'moveWest',\n 'moveEast',\n 'displayUnits',\n 'rangeRings',\n 'ringCount',\n 'ringBaseDistance',\n 'ringInterval'\n ]\n\n var needReset = false;\n for (var option of allOptions) {\n if (params.has(option)) {\n needReset = true;\n break;\n }\n }\n \n if (needReset) {\n resetMap();\n }\n\n if (params.get('banner') === 'hide') {\n hideBanner();\n }\n if (params.get('altitudeChart') === 'hide') {\n\t$('#altitude_checkbox').removeClass('settingsCheckboxChecked');\n $('#altitude_chart').hide();\n }\n if (params.get('altitudeChart') === 'show') {\n $('#altitude_checkbox').addClass('settingsCheckboxChecked');\n $('#altitude_chart').show();\n }\n if (params.get('aircraftTrails') === 'show') {\n selectAllPlanes();\n }\n if (params.get('aircraftTrails') === 'hide') {\n deselectAllPlanes();\n }\n if (params.get('map') === 'show') {\n showMap();\n }\n if (params.get('map') === 'hide') {\n expandSidebar();\n }\n if (params.get('sidebar') === 'show') {\n $(\"#sidebar_container\").show();\n updateMapSize();\n }\n if (params.get('sidebar') === 'hide') {\n $(\"#sidebar_container\").hide();\n updateMapSize();\n }\n if (params.get('zoomOut')) {\n zoomMap(params.get('zoomOut'), true);\n }\n if (params.get('zoomIn')) {\n zoomMap(params.get('zoomIn'), false);\n }\n if (params.get('moveNorth')) {\n moveMap(params.get('moveNorth'), true, false);\n }\n if (params.get('moveSouth')) {\n moveMap(params.get('moveSouth'), true, true);\n }\n if (params.get('moveEast')) {\n moveMap(params.get('moveEast'), false, false);\n }\n if (params.get('moveWest')) {\n moveMap(params.get('moveWest'), false, true);\n }\n if (params.get('displayUnits')) {\n setDisplayUnits(params.get('displayUnits'));\n }\n if (params.get('rangeRings')) {\n setRangeRingVisibility(params.get('rangeRings'));\n }\n if (params.get('ringCount')) {\n setRingCount(params.get('ringCount'));\n }\n if (params.get('ringBaseDistance')) {\n setRingBaseDistance(params.get('ringBaseDistance'));\n }\n if (params.get('ringInterval')) {\n setRingInterval(params.get('ringInterval'));\n }\n}", "function switchChanged() {\n\n\t// Access switch\n\tvar defaultWord = document.getElementById(\"generalSettings1\").checked\n\tvar imageSensoring = document.getElementById(\"generalSettings2\").checked\n\n\t// Store state of switch\n\tchrome.storage.local.set({\n\n\t defaultWord: defaultWord,\n\t imageSensoring: imageSensoring\n\n\t}, function() {\n\n\t \t//**********************************\n\t\t// OPTIONS SAVED INTO LOCAL STORAGE\n\t\t//**********************************\n\n\t});\n\n}", "function HTMLOption() {}", "function HTMLOption() {}", "function HTMLOption() {}", "switch(value, map) {\n let key;\n if (typeof value === 'function') {\n key = value(data)\n } else if (typeof value === 'object') {\n key = data\n map = value\n } else {\n key = value\n }\n if(map[key]) {\n return this.do(map[key])\n } else if (map['default']) {\n return this.do(map['default'])\n } else {\n return this\n }\n }", "function caseInSwitch(val) {\n var answer = \"\";\n // Only change code below this line\n \n switch (val){ //you are switching the value in the first \"case\" or exapample so it will display Alpha\n case 1: \n return (\"alpha\");\n case 2: \n return(\"beta\");\n break;\n case 3: \n return(\"gamma\");\n break;\n case 4: \n return(\"delta\");\n break;\n }\n {return answer;\n }\n caseInSwitch(1);\n }", "function HTMLOption() { }", "function HTMLOption() { }", "putOpts(pathext, value) {\n const ver = this.options(pathext);\n return Object.assign({\n method: 'PUT',\n form: {\n item_value: value,\n },\n }, ver);\n }", "SetOption(string, Variant) {\n\n }", "function caseInSwitch(val) {\n var answer = \"\";\nswitch(val) {\n case 1:\n answer = \"alpha\";\n break;\n case 2:\n answer = \"beta\";\n break;\n case 3: \n answer = \"gamma\";\n break;\n case 4:\n answer = \"delta\";\n break;\n}\n return answer;\n}", "function setOptions() {\n // set text output to match slider\n $(options.selectors.isochroneOutput).text($(options.selectors.isochroneSlider).val());\n if (exploreLatLng) {\n clickedExplore();\n }\n }", "function Switching(action, value) {\n switch (action) {\n case 'concert-this':\n concertSearch(value);\n break;\n\n case 'spotify-this-song':\n spotifySearch(value);\n break;\n\n case 'movie-this':\n movieSearch(value);\n break;\n\n case 'do-what-it-says':\n doThis();\n break;\n };\n}", "function pl_do_shortcode(opt) {\n\t\n\tvar match = opt.match( /\\[([^\\]]*)/ ) || false\n\tvar shortcode = (match) ? match[1] : false\n\t\n\tif(!shortcode)\n\t\treturn opt\n\t\t\n\tswitch(shortcode) {\n\t\tcase 'pl_child_url':\n\t\t\topt = opt.replace(/\\[pl_child_url\\]/g, jQuery.pl.config.urls.StyleSheetURL)\n\t\tcase 'pl_parent_url':\n\t\t\topt = opt.replace(/\\[pl_parent_url\\]/g, jQuery.pl.config.urls.ParentStyleSheetURL)\n\t\tcase 'pl_site_url':\n\t\t\topt = opt.replace(/\\[pl_site_url\\]/g, jQuery.pl.config.urls.siteURL)\n\t}\n\treturn opt\n}", "optionFor(arg) {\n const option = this.options.find(option => option.is(arg));\n return option;\n }", "function getOption() {\n var obj = document.getElementById(\"robot-control-mode-select\");\n var mytext = obj.options[obj.selectedIndex].text;\n document.getElementById(\"robot-current-mode\").innerHTML = mytext;\n\n if (mytext === \"Forward\") {\n document.getElementById(\"p1\").innerHTML = \"Theta1\";\n document.getElementById(\"p2\").innerHTML = \"Theta2\";\n document.getElementById(\"p3\").innerHTML = \"d3 \";\n }\n else if (mytext === \"Inverse\") {\n document.getElementById(\"p1\").innerHTML = \"Px\";\n document.getElementById(\"p2\").innerHTML = \"Py\";\n document.getElementById(\"p3\").innerHTML = \"Pz\";\n }\n else if(mytext === \"Auto\") {\n document.getElementById(\"p1\").innerHTML = \"Parameter 1\";\n document.getElementById(\"p2\").innerHTML = \"Parameter 2\";\n document.getElementById(\"p3\").innerHTML = \"Parameter 3\";\n }\n else {\n document.getElementById(\"p1\").innerHTML = \"Parameter 1\";\n document.getElementById(\"p2\").innerHTML = \"Parameter 2\";\n document.getElementById(\"p3\").innerHTML = \"Parameter 3\";\n }\n}", "SetOption() {\n\n }", "getOpts(pathext) {\n const ver = this.options(pathext);\n return Object.assign({\n method: 'GET',\n }, ver);\n }", "get options() {\n return [\n { label: 'All', value: 'new' },\n { label: 'Some', value: 'some' },\n { label: 'None', value: 'none' },\n ];\n}", "function save_options(){\r\n var _url = doc[$elem]('custom-url');\r\n var url = _url[_val];\r\n if (url == \"\") {\r\n url = aboutPages[0];\r\n }\r\n\r\n save(true, url);\r\n}", "function changeURL(menuObj)\n{\n\tvar i = menuObj.selectedIndex;\n\t\n\tif(i > 0)\n\t{\n\tif(menuObj.options[i].value != '#')\n\t\t{\n\t\t\twindow.location = menuObj.options[i].value;\n\t\t}\n\t}\n}", "function route_value(ele) { \n var selected = ele.value;\n route_select = route[selected]\n}", "function doSomething(opt, enable) {\r\n var defaults = { enable: false, count: 0, title: \"\", values: [1,2,3] };\r\n var options = mixIn({}, defaults, opt); //opzioni correnti con \r\n //ovverride in base all'opt passate\r\n //... logica della funzione che usa TUTTE le options\r\n console.dir(options.enable);\r\n}", "function chosenAPI(value) {\n switch (value) {\n case \"spotify-this-song\":\n searchSpotify();\n break;\n case \"concert-this\":\n findConcert();\n break;\n case \"movie-this\":\n getMovieInfo();\n break;\n case \"do-what-it-says\":\n doWhatItSays();\n logData();\n break;\n }\n}", "get mode(){ return this.base_opt[0]; }", "onNavigateToOptionRoute(option) {\n if (this.config.route) {\n let route = this.config.route.slice();\n route = String(route).replace(/:value/g, '' + option.value).replace(/:name/g, option.name);\n this.srv.router.navigateByUrl(route).then(data => {\n })\n .catch(e => {\n // const errMessage = 'Route not found:' + route;\n // console.log(e);\n this.events.emit({ source: this.name, type: 'context_menu', name: 'portal', data: route, config: this.config });\n // option.errMessage = errMessage;\n // setTimeout(() => {\n // if( option.errMessage === errMessage ) option.errMessage = '';\n // }, 2000);\n });\n }\n }", "function handleOptsClick() {\n let option = this.id;\n log('Handling checkbox change for ' + option);\n switch (option) {\n case \"xedx-loggingEnabled-opt\":\n opt_loggingEnabled = this.checked;\n GM_setValue(\"opt_loggingEnabled\", opt_loggingEnabled);\n debugLoggingEnabled = opt_loggingEnabled;\n debug('Saved value for opt_loggingEnabled');\n break;\n case \"xedx-hidefedded-opt\":\n opt_hidefedded = this.checked;\n GM_setValue(\"opt_hidefedded\", opt_hidefedded);\n debug('Saved value for opt_hidefedded');\n break;\n case \"xedx-hidefallen-opt\":\n opt_hidefallen = this.checked;\n GM_setValue(\"opt_hidefallen\", opt_hidefallen);\n debug('Saved value for opt_hidefallen');\n break;\n case \"xedx-devmode-opt\":\n opt_devmode = this.checked;\n GM_setValue(\"opt_devmode\", opt_devmode);\n hideDevOpts(!opt_devmode);\n debug('Saved value for opt_devmode');\n break;\n case \"xedx-hidetravel-opt\":\n opt_hidetravel = this.checked;\n GM_setValue(\"opt_hidetravel\", opt_hidetravel);\n debug('Saved value for opt_hidetravel');\n break;\n case \"xedx-showcaymans-opt\":\n opt_showcaymans = this.checked;\n if (opt_showcaymans) {\n $('#xedx-hidetravel-opt').prop(\"checked\", false);\n opt_hidetravel = false;\n GM_setValue(\"opt_hidetravel\", opt_hidetravel);\n }\n GM_setValue(\"opt_showcaymans\", opt_showcaymans);\n debug('Saved value for opt_showcaymans');\n break;\n case \"xedx-hidehosp-opt\":\n opt_hidehosp = this.checked;\n GM_setValue(\"opt_hidehosp\", opt_hidehosp);\n debug('Saved value for opt_hidehosp');\n break;\n case \"xedx-disabled-opt\":\n opt_disabled = this.checked;\n opt_disabled ? observerOFF() : observerON();\n indicateActive();\n GM_setValue(\"opt_disabled\", opt_disabled);\n debug('Saved value for opt_disabled');\n break;\n case \"xedx-viewcache-btn\":\n displayCache();\n break;\n default:\n debug('Checkbox ID not found!');\n }\n updateUserLevels('handleOptsClick');\n }", "function caseInSwitch(val) {\n var answer = \"\";\n // Only change code below this line\n \n switch (val){\ncase 1:\nanswer = \"alpha\";\nbreak;\ncase 2:\nanswer = \"beta\";\nbreak;\ncase 3:\nanswer = \"gamma\";\nbreak;\ncase 4:\nanswer = \"delta\";\nbreak;\n}\n \n // Only change code above this line \n return answer; \n}", "function optionClick(value, text) {\n addUserMessage(text);\n apiRequest(value);\n}", "function setCurrentTravelMode(mode){\n\n //this sets the main-pane., this will return\n var string='input[value=\"'+mode+'\"]';\n\n displayInfo.travelMode=mode;\n //this setsup the button\n\n updateDefaultTravelMode(mode);\n if (navigateFlag === 1) {\n calculateRoute();\n } else if (navigateFlag === 2) {\n calculateRoute();\n }\n\n}", "function caseInSwitch(val) {\n var answer = \"\";\n // Only change code below this line\n switch(val){\n case 1:\n return \"alpha\";\n break;\n case 2:\n return \"beta\";\n break;\n case 3:\n return \"gamma\";\n break;\n case 4:\n return \"delta\";\n break;\n }\n // Only change code above this line \n return answer; \n}", "get options() {}", "function toggleActiveOption(url){\n\t// Remove old active class\n\tremoveActiveClass();\n\n\t// Add active class by url, to select the option on the menu\n\tif (url.toLowerCase().indexOf('providers') > -1 ) {\n\t\t$('.providers').addClass('active');\n\t} else if (url.toLowerCase().indexOf('home') > -1 ) {\n\t\t$('.home').addClass('active');\n\t} else if (url.toLowerCase().indexOf('articles/debtors') > -1 || url.toLowerCase().indexOf('articles/filter_debtors') > -1) {\n\t\t$('.debtors').addClass('active');\n\t} else if (url.toLowerCase().indexOf('articles') > -1) {\n\t\t$('.articles').addClass('active');\n\t} else if (url.toLowerCase().indexOf('sales') > -1) {\n\t\t$('.sales').addClass('active');\n\t} else if (url.toLowerCase().indexOf('collects') > -1) {\n\t\t$('.collects').addClass('active');\n\t} else if (url.toLowerCase().indexOf('reports') > -1) {\n\t\t$('.collects').addClass('active');\n\t} else if (url.toLowerCase().indexOf('outputs') > -1) {\n\t\t$('.outputs').addClass('active');\n\t} else if (url.toLowerCase().indexOf('billings') > -1) {\n\t\t$('.billings').addClass('active');\n\t} else if (url.toLowerCase().indexOf('inputs') > -1) {\n\t\t$('.inputs').addClass('active');\n\t}\n}", "GetOption() {\n\n }", "function caseInSwitch(val) {\n\tvar answer = \"\";\n\tswitch(val) {\n\t\tcase 1:\n\t\t\tanswer = \"alpha\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tanswer = \"beta\";\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tanswer = \"gamma\";\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tanswer = \"delta\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tanswer = \"none\";\n\t\t\tbreak;\n\t}\n\treturn answer;\n}", "function caseInSwitch(val){\n var answer = \"\";\n switch(val){\n case 1 : \n answer = \"alpha\" ;\n break;\n case 2 : \n answer = \"beta\";\n break;\n case 3 : \n answer = \"gamma\";\n break;\n case 4 : \n answer = \"delta\";\n break;\n }\n\n return answer ;\n}", "function switchBoard() {\n // console.log(\"The value of command is: \" + command);\n\n switch (command) {\n case \"concert-this\": \n // console.log(\"option1\");\n concertThis(queryTerm);\n break;\n case \"spotify-this-song\":\n // console.log(\"option2\");\n spotifyThisSong(queryTerm);\n break;\n case \"movie-this\": \n // console.log(\"option3\");\n movieThis(queryTerm);\n break;\n default:\n console.log(\"That command is not recognized\") \n };\n}", "function switchMode(){\n\t\ttoggleSwitch(addrSwitch);\n\t\tif (compMode()==\"data\"){\n\t\t\t//$('.led-a').each(function(){ toggleLedOff($(this)); });\n\t\t\tfor(var i=0; i<=7; i++){\n\t\t\t\tif (isOn($('.switch-a'+i))){ toggleLedOn($('.led-d'+i)); }\n\t\t\t\telse{ toggleLedOff($('.led-d'+i)); }\n\t\t\t}\n\t\t}\n\t\telse if (compMode()==\"addr\"){\n\t\t\t//$('.led-d').each(function(){ toggleLedOff($(this)); });\n\t\t\tfor(var i=0; i<=15; i++){\n\t\t\t\tif (isOn($('.switch-a'+i))){ toggleLedOn($('.led-a'+i)); }\n\t\t\t\telse{ toggleLedOff($('.led-a'+i)); }\n\t\t\t}\n\t\t}\n\t\tflashSwitchStatesToTempMemory();\n\t}", "function setOption(option, value) {\n\tCookies.set(option, value, { expires: 99999 });\n\t$('#settings-' + option + ' > use').attr('xlink:href', '#' + option + '-' + value);\n}", "renderSwitch(param){\n switch(param) {\n case '0':\n return this.renderCategory();\n case '1':\n return window.switch_caregory? this.renderCategory() : this.renderProduct();\n case '2':\n return window.switch_caregory? this.renderCategory() : this.renderCart();\n default:\n return this.renderCategory();\n }\n}", "function view_dial_option(oDiv, viewname, option, choices) {\n // prevent double click from select text\n var new_choice = choices[0]; // in case not contained in choices\n for (var c=0; c<choices.length; c++) {\n choice = choices[c];\n val = choice[0];\n title = choice[1];\n if (has_class(oDiv, \"val_\" + val)) {\n var new_choice = choices[(c + choices.length + dial_direction) % choices.length];\n change_class(oDiv, \"val_\" + val, \"val_\" + new_choice[0]);\n break;\n }\n }\n\n // Start animation\n step = 0;\n speed = 10;\n for (var way = 0; way <= 10; way +=1) {\n step += speed;\n setTimeout(\"turn_dial('\" + option + \"', '', \" + way + \",\" + dial_direction + \")\", step);\n }\n for (var way = -10; way <= 0; way +=1) {\n step += speed;\n setTimeout(\"turn_dial('\" + option + \"', '\" + new_choice[1] + \"', \" + way + \",\" + dial_direction + \")\", step);\n }\n\n get_url_sync(\"ajax_set_viewoption.py?view_name=\" + viewname +\n \"&option=\" + option + \"&value=\" + new_choice[0]);\n if (option == \"refresh\")\n setReload(new_choice[0]);\n else {\n if (gReloadTimer)\n clearTimeout(gReloadTimer);\n gReloadTimer = setTimeout(\"handleReload('')\", 400.0);\n }\n // handleReload('');\n}", "function viewOption(param) {\n\n gw_com_api.show(\"frmOption\");\n\n}", "function viewOption(param) {\n\n gw_com_api.show(\"frmOption\");\n\n}", "function switchOfStuff(val) {\n var answer = \"\";\n // Only change code below this line\nswitch (val){\n case \"a\":\n answer = \"apple\";\n break;\n case \"b\":\n answer = \"bird\";\n break;\n case \"c\":\n answer = \"cat\";\n break;\n default:\n answer = \"stuff\";\n break;\n}\n\n\n\n\n // Only change code above this line\n return answer;\n}", "function setOptionsState (enable, urlOptions) {\n const options = document.getElementById('options-wrapper');\n if (!options) return;\n\n if (enable) {\n options.style.display = 'block';\n // grab style from options or default to tc-popup\n const radio = document.getElementById(urlOptions.style) || document.getElementById('tc-popup');\n radio.checked = true;\n document.getElementById('custom-message').value = urlOptions.message;\n } else {\n options.style.display = 'none';\n }\n}", "settings() {\n return {\n labelOn: 'Yes',\n labelOff: 'No'\n }\n }", "function inspectBehavior(argStr){\n var i, plugIn, inMenu;\n var argArray = extractArgs(argStr);\n\n if (argArray.length == 5) {\n\n plugIn = unescQuotes(argArray[1]);\n document.theForm.theURL.value = unescape(argArray[2]); //URL decode\n document.theForm.altURL.value = unescape(argArray[3]); //URL decode\n document.theForm.IEGoesToURL.checked = eval(argArray[4]);\n\n inMenu = false;\n for (i=0; i<document.theForm.menu.options.length; i++) { //check if exists in menu\n if (document.theForm.menu.options[i].value == plugIn) {\n document.theForm.menu.selectedIndex = i;\n inMenu = true;\n break;\n }\n }\n if (!inMenu) {\n document.theForm.pluginName.value = plugIn;\n setRadio(1); //set radio\n }\n }\n}", "function modifySwitch (change, currentSwitch, switchNumber) {\n\t\tlet result = currentSwitch;\n\t\tif (switchNumber !== 5){\n\t\t\tswitch (change) {\n\t\t\t\tcase 'NONE' : {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'FLIP' : {\n\t\t\t\t\tresult = !result;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'OFF' : {\n\t\t\t\t\tresult = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'ON' : {\n\t\t\t\t\tresult = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (change === 'FLIP' || change === 'ON') {\n\t\t\t\tresult = true;\n\t\t\t} else {\n\t\t\t\tresult = false;\n\t\t\t}\n\t\t}\n\t\treturn result\n\t}", "function aceSwitch( cellvalue, options, cell ) {\n\t\t\t\t///*\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t$(cell) .find('input[type=checkbox]')\n\t\t\t\t\t\t.addClass('ace ace-switch ace-switch-5')\n\t\t\t\t\t\t.after('<span class=\"lbl\"></span>');\n\t\t\t\t}, 0);\n\t\t\t\t//*/\n\t\t\t}", "function set_access_strings(options)\n{\n //nothing in there, for each one we want to set, toggle it\n for (option in options) {\n if (options[option] > 0) {\n widgets[option]['on'] = 1;\n }\n }\n toggle_access_str(null);\n}", "function onChange(control, oldValue, newValue, isLoading, isTemplate) {\n if (isLoading || newValue === '') {\n return;\n }\n\n var ga = new GlideAjax('InstanceAjax');\n ga.addParam('sysparm_name', 'getInfo');\n ga.addParam('sysparm_fx', 'url');\n ga.getXMLAnswer(getAnswer); // callback: getAnswer\n\n\tfunction getAnswer(answer) {\n\t\tg_form.addInfoMessage('url=' + answer);\n\t}\n}", "function toggleOpt(){\n localStorage[storage + this.name] = this.checked;\n if (this.name == \"tw\"){\n if (this.checked) censor();\n else uncensor();\n } else if (this.name == \"ts\"){\n if (this.checked) uncensor();\n }\n}", "function chainToSwitch(val){\n var answer = \"\";\n switch(val){\n case \"bob\" : \n answer = \"Marley\";\n break;\n case 42 : \n answer = \"The Answer\";\n break;\n case 1 : \n answer = \"There is no #1\";\n break;\n case 99 : \n answer = \"Missed me by this much\";\n break;\n case 7 : \n answer = \"Ate Nine\";\n break; \n }\n return answer\n}", "function switchOfStuff(val) {\n var answer = \"\";\nswitch (val) {\n case \"a\":\n answer = \"apple\";\n break;\n case \"b\":\n answer = \"bird\";\n break;\n case \"c\":\n answer = \"cat\";\n break;\n default:\n answer = \"stuff\";\n break;\n}\n return answer;\n}", "switchMode(newMode: Mode) {\n this.mode = newMode;\n }", "function omniSwitchEdition(editionValue) {\n\tvar s=s_gi(\"cnn3global\");\n\ts.trackingServer=\"metrics.cnn.com\";\n\tif (editionValue==\"edition\"){editionValue=\"intl\"}\n\tif (editionValue==\"www\"){editionValue=\"us\"}\n\teditionValue=editionValue+'pref';\t\n\ts.tl(this,'o',editionValue)\n}", "function mkOption(option,callback){\n var link = $(\"<a style='cursor: pointer'>\"+option+'</a>');\n var opt = $(\"<li></li>\").append(link);\n link[0].onclick = _.partial(callback, option);\n return opt;\n }", "function handleOptionsChanged(e) {\n\t\t\tvar item = e.srcElement.id;\n\t\t\tif ($.inArray(item, list.routeAvoidables) >= 0) {\n\t\t\t\t//is a route avoidable\n\t\t\t\tif (item === list.routeAvoidables[0]) {\n\t\t\t\t\t//if the avoidable is set, remove it (and vice versa)\n\t\t\t\t\trouteOptions[1][0] = routeOptions[1][0] ? null : item;\n\t\t\t\t\ttheInterface.emit('ui:prefsChanged', {\n\t\t\t\t\t\tkey : preferences.avoidHighwayIdx,\n\t\t\t\t\t\tvalue : routeOptions[1][0] != null\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\trouteOptions[1][1] = routeOptions[1][1] ? null : item;\n\t\t\t\t\ttheInterface.emit('ui:prefsChanged', {\n\t\t\t\t\t\tkey : preferences.avoidTollwayIdx,\n\t\t\t\t\t\tvalue : routeOptions[1][1] != null\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//is a regular route option\n\t\t\t\trouteOptions[0] = item;\n\t\t\t\ttheInterface.emit('ui:prefsChanged', {\n\t\t\t\t\tkey : preferences.routeOptionsIdx,\n\t\t\t\t\tvalue : routeOptions[0]\n\t\t\t\t});\n\t\t\t}\n\t\t\ttheInterface.emit('ui:routingParamsChanged');\n\t\t}", "toggle(value = !this.onOff) {\r\n return this.operatePlug({ onOff: value });\r\n }", "function sfjchangeURL(menuObj)\n{\n\tvar i = menuObj.selectedIndex;\n\t\n\tif(i > 0)\n\t{\n\tif(menuObj.options[i].value != '#')\n\t\t{\n\t\t\twindow.location = menuObj.options[i].value;\n\t\t}\n\t}\n}", "function onSwitchLoaded_appello(args) {\n page.getViewById(\"switch_appello\").checked = appSettings.getBoolean(\"esami_futuri\",false);\n const mySwitch = args.object;\n\n mySwitch.on(\"checkedChange\", (args) => {\n const sw = args.object;\n const isChecked = sw.checked;\n appSettings.setBoolean(\"esami_futuri\",isChecked);\n });\n}", "function set_swswitch_fast() {\r\n\t\tvar args = autoSetSSwFix.apply(this, arguments);\r\n\t\tvar switchName = args[0];\r\n\t\tif (typeof switchName == \"number\") {\r\n\t\t\tswitchName = 'SELF SWITCH ' + switchName;\r\n\t\t}\r\n\t\tvar value = args[1];\r\n\t\tvar eventId = args[2];\r\n\t\tvar mapId = get_mapId(args[3]);\r\n\t\tvar cond = args[4];\t\r\n\t\tif (eval(cond)) {\r\n\t\t\t$gameSelfSwitches.setValue([mapId, eventId, switchName], value);\r\n\t\t}\r\n\t}", "function chainToSwitch(val) {\n var answer = \"\";\n // Only change code below this line\n switch(val){ \n case \"bob\": \n return \"Marley\";\n break;\n case 42:\n return \"The Answer\";\n break;\n case 1:\n return \"There is no #1\";\n break;\n case 99: \n return \"Missed me by this much!\";\n break;\n case 7:\n return \"Ate Nine\";\n break;\n default:\n return \"\";\n break;\n }\n // Only change code above this line \n return answer; \n}", "function setupTNViewSwitchButtons(currView) {\n var b_version = navigator.appVersion;\n var version = parseFloat(b_version);\n \n var isIE = (navigator.appName == \"Microsoft Internet Explorer\");\n\n var buttonSwitchViewElem = document.getElementById(buttonSwitchViewId);\n \n\n if (currView == 'Map') {\n \n buttonSwitchViewElem.value = buttonSwitchToTable; \n }\n else {\n \n buttonSwitchViewElem.value = buttonSwitchToMap;\n }\n\n}", "function getSwitches() {\n\tapi({ data: \"cmd=getswitch\", type: \"switch\" },selectBlocks);\n}", "function change_link_to_website(){\n var type = $(\"select[name='type_configurateur']\").val();\n var url = \"\";\n var url_picture = \"\";\n\n if (type == 1){\n url = \"http://lovekey.com/configurateur-simple?gamme=bijou&options_init=\";\n url_picture = \"http://lovekey.com/content/print_product_image.php?gamme_bague=bijou&article_options=\";\n }\n else if (type == 2){\n url = \"http://lovekey.com/configurateur-simple?gamme=alliance&options_init=\";\n url_picture = \"http://lovekey.com/content/print_product_image.php?gamme_bague=alliance&article_options=\";\n }\n else if (type == 3){\n url = \"http://lovekey.com/configurateur-double?gamme=bijou&options_init=\";\n url_picture = \"http://lovekey.com/content/print_product_image.php?gamme_bague=bijou&article_options=\";\n }\n else if (type == 4){\n url = \"http://lovekey.com/configurateur-double?gamme=alliance&options_init=\";\n url_picture = \"http://lovekey.com/content/print_product_image.php?gamme_bague=alliance&article_options=\";\n }\n\n // génère les paramètres à ajouter à l'url du site web\n params = new Array();\n\n // récupert les options\n $('.options_set').each(function(){\n params.push($(this).val());\n });\n // if (params.length == 3)\n params = params.join(\",\");\n\n url += params;\n url_picture += params;\n\n buy_link = url;\n\n // modifie les liens de partage\n $('.partage_facebook').data('sharelink', 'https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(buy_link));\n $('.partage_twitter').data('sharelink', 'http://twitter.com/home?status=Ma%20bague%20unique%20personnalis%C3%A9e%20sur%20Lovekey.com%20:%20' + encodeURIComponent(buy_link));\n $('.partage_pinterest').data('sharelink', 'http://pinterest.com/pin/create/button/?url=' + encodeURIComponent(buy_link) + '&media=' + encodeURIComponent(url_picture) + '&description=Ma%20bague%20unique%20personnalis%C3%A9e%20sur%20Lovekey%20:%20' + encodeURIComponent(buy_link));\n $('.partage_email').data('sharelink', 'mailto:?subject=Ma%20bague%20unique%20personnalis%C3%A9e%20sur%20Lovekey.com&body=Voici%20la%20bague%20unique%20et%20personnalis%C3%A9e%20que%20je%20me%20suis%20configur%C3%A9%20sur%20Lovekey.com%20:%20' + encodeURIComponent(buy_link));\n}", "function FnGetProtocolList(VarFlag) {\t\t\n\n\tvar VarDeviceModel = $('#deviceModel').val();\n\tvar VarMake = $('#deviceMake').val();\t\n\tvar VarDeviceType = $('#deviceType').val();\n\t\n\tif(VarFlag == 1){\t\n\t\n\t\tGblEditProtocol = '';\n\t\tGblEditVersion = '';\n\t\t\n\t\t$('#deviceProtocol').html('<option value=\"\">Select protocol </option>');\n\t\t$('#deviceProtocolVersion').html('<option value=\"\">Select protocol version </option>');\n\t}\n\t\n\tvar objGetModel = {\"make\":VarMake,\"deviceType\":VarDeviceType,\"model\":VarDeviceModel};\t\t\n\tvar VarUrl = GblAppContextPath +'/ajax' + VarPopulateDeviceProtocolListUrl;\t\t\n\tFnMakeAjaxRequest(VarUrl, 'POST', JSON.stringify(objGetModel), 'application/json; charset=utf-8', 'json', FnResProtocolList);\t\t\n}", "function aceSwitch( cellvalue, options, cell ) {\n setTimeout(function(){\n $(cell) .find('input[type=checkbox]')\n .wrap('<label class=\"inline\" />')\n .addClass('ace ace-switch ace-switch-5')\n .after('<span class=\"lbl\"></span>');\n }, 0);\n }", "function setRouteOption(routeOption) {\n\t\t\t//set checkox with $('#' + routeOption) active\n\t\t\tvar el = $('#' + routeOption);\n\t\t\tif (el) {\n\t\t\t\tel.attr('checked', true)\n\t\t\t}\n\n\t\t\t//set parent div (with all available options for car/bike/pedestrian visible\n\t\t\tvar parentOptions = list.routePreferences.keys();\n\t\t\tvar parent;\n\t\t\tfor (var i = 0; i < parentOptions.length; i++) {\n\t\t\t\tif (list.routePreferences.get(parentOptions[i]).indexOf(routeOption) != -1) {\n\t\t\t\t\t//show div\n\t\t\t\t\t$('#' + parentOptions[i] + 'Options').show();\n\t\t\t\t\t//activate corresponding button\n\t\t\t\t\t$('#' + parentOptions[i]).addClass('active');\n\t\t\t\t} else {\n\t\t\t\t\t//deactivate/ hide others\n\t\t\t\t\t$('#' + parentOptions[i] + 'Options').hide();\n\t\t\t\t\t$('#' + parentOptions[i]).removeClass('active');\n\t\t\t\t}\n\t\t\t}\n\t\t}", "onSwitch() {}", "onSwitch() {}", "onSwitch() {}" ]
[ "0.6103674", "0.60494983", "0.5902205", "0.5703334", "0.5684817", "0.5636264", "0.56265336", "0.55905986", "0.5565767", "0.5534924", "0.55065197", "0.5493929", "0.5430844", "0.5423568", "0.54178995", "0.54065526", "0.5395617", "0.53879917", "0.5362268", "0.533147", "0.53257173", "0.5286888", "0.5272932", "0.52705604", "0.52640116", "0.5258942", "0.5247965", "0.52171797", "0.5209155", "0.5205806", "0.5202768", "0.5202768", "0.5202768", "0.5201446", "0.5200851", "0.5188149", "0.5188149", "0.5184203", "0.5179541", "0.517729", "0.5175461", "0.51748353", "0.5170026", "0.5152734", "0.514078", "0.5137449", "0.51344556", "0.5124251", "0.5115705", "0.51150745", "0.5096856", "0.50907624", "0.5088564", "0.5086618", "0.5086575", "0.5077942", "0.507478", "0.5071124", "0.506399", "0.50608104", "0.50564086", "0.5049924", "0.5048095", "0.50432134", "0.50321585", "0.5030276", "0.50297135", "0.5027706", "0.50266284", "0.50037515", "0.50023425", "0.50023425", "0.50019765", "0.49980366", "0.49967372", "0.49941352", "0.49893448", "0.49814868", "0.49739566", "0.49732453", "0.4972325", "0.49653223", "0.4957178", "0.49569583", "0.49558604", "0.49550524", "0.4953719", "0.4938791", "0.49379283", "0.49349472", "0.49344227", "0.49301255", "0.4928942", "0.4928727", "0.49207562", "0.49194074", "0.4913592", "0.49095437", "0.49079424", "0.49079424", "0.49079424" ]
0.0
-1
grunt task confirmation message
function end_message(urls,responses){ grunt.log.ok("Parsed: "+responses.length+"/"+urls.length); if( urls.length !== responses.length ){ grunt.log.error("report bug to"); grunt.log.error("https://github.com/maboiteaspam/phantomizer-yslow/issues"); grunt.fail.warn("could not parse correctly yslow output"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "finish() {\n const grunt = _chalk.green('grunt');\n const gruntTestCommand = _chalk.yellow('test');\n const gruntMonitorUnitCommand = _chalk.yellow('monitor:unit');\n const gruntMonitorApiCommand = _chalk.yellow('monitor:api');\n const gruntFormatCommand = _chalk.yellow('format');\n const gruntLintCommand = _chalk.yellow('lint');\n const gruntHelpCommand = _chalk.yellow('help');\n const gruntDocsCommand = _chalk.yellow('docs');\n const gruntPackageCommand = _chalk.yellow('package');\n const gruntPublishCommand = _chalk.yellow('package');\n\n this.log(_consts.SEPARATOR);\n [\n ` `,\n `--------------------------------------------------------------------------------`,\n ` Your AWS Microservice project has been created, and is ready for use. Grunt `,\n ` tasks have been provided for common development tasks such as: `,\n ` `,\n ` Running all unit tests: `,\n ` ${grunt} ${gruntTestCommand} `,\n ` `,\n ` Test driven development: `,\n ` ${grunt} ${gruntMonitorUnitCommand} `,\n ` `,\n ` Run end to end tests against deployed lambda functions: `,\n ` ${grunt} ${gruntMonitorApiCommand} `,\n ` `,\n ` Formatting and linting files: `,\n ` ${grunt} ${gruntFormatCommand} `,\n ` ${grunt} ${gruntLintCommand} `,\n ` `,\n ` Generating documentation: `,\n ` ${grunt} ${gruntDocsCommand} `,\n ` `,\n ` Packaging the lambda functions for deployment: `,\n ` ${grunt} ${gruntPackageCommand} `,\n ` `,\n ` Publishing lambda functions to AWS: `,\n ` ${grunt} ${gruntPublishCommand} `,\n ` `,\n ` Several other useful tasks have been packaged up with the Gruntfile. You can `,\n ` review them all by running: `,\n ` ${grunt} ${gruntHelpCommand} `,\n ` `,\n ` NOTE: This project will support the use of cloud formation scripts to create `,\n ` and deploy AWS resources. This support is currently not available, is being `,\n ` worked on. `,\n ` `,\n `--------------------------------------------------------------------------------`,\n ` `\n ].forEach((line) => this.log(line));\n }", "confirm() {}", "function notifyAdminOfTaskCompletion(task) {\n var transporter = nodemailer.createTransport(smtpTransport({\n host: 'smtp.zoho.com',\n port: 465,\n secure: true, // use SSL\n auth: {\n user: '[email protected]',\n pass: 'june2013'\n }\n }));\n var mailOptions = {\n to: '[email protected]',\n from: '[email protected]',\n subject: 'New Task',\n text: \"Job No: \" + task.jobId + \" has been completed and the customer is satisfied\"\n };\n transporter.sendMail(mailOptions, function(err) {\n if (err)\n console.log(\"not sent: \" + err);\n else\n console.log(\"successfully sent\");\n });\n }", "function notifyAdminOfTaskCompletion(task) {\n var transporter = nodemailer.createTransport(smtpTransport({\n host: 'smtp.zoho.com',\n port: 465,\n secure: true, // use SSL\n auth: {\n user: '[email protected]',\n pass: 'june2013'\n }\n }));\n var mailOptions = {\n to: '[email protected]',\n from: '[email protected]',\n subject: 'New Task',\n text: \"Job No: \" + task.jobId + \" has been completed and the customer is satisfied\"\n };\n transporter.sendMail(mailOptions, function(err) {\n if (err)\n console.log(\"not sent: \" + err);\n else\n console.log(\"successfully sent\");\n });\n }", "function runTask(taskName, callback) {\n grunt.util.spawn({\n cmd: 'grunt',\n args: [taskName]\n }, function (err, output) {\n if (err) {\n console.log(output.stderr || output.stdout);\n done(err);\n }\n else {\n console.log(output.stdout);\n console.log('\\n'); // looks better\n callback();\n }\n });\n }", "function createMultiTask(grunt, name) {\n grunt.registerMultiTask(name, 'Check the files exits.', function() {\n var done = this.async();\n grunt.util.async.forEachSeries(this.filesSrc, function(file, next) {\n // echo\n grunt.log.writeln('- ' + file);\n\n var body = fs.readFileSync(file, {encoding: 'utf8'});\n body = body.replace(/\\n$/, '');\n if (body) {\n var match = /^(\\d+)ms$/.exec(body);\n if (match) {\n // wait if the file contains number for order.\n setTimeout(function() {next();}, Number(match[1]));\n } else {\n // throw the body message.\n throw new Error(body);\n }\n } else {\n next();\n }\n }, function(err) {\n done(err);\n });\n });\n}", "_writingGrunt() {\n this.fs.copy(this.templatePath('Gruntfile.js'), this.destinationPath('Gruntfile.js'));\n this.fs.copy(\n this.templatePath('felab_custom_server.js'),\n this.destinationPath('felab/custom/server.js')\n );\n this.fs.copy(\n this.templatePath('felab_custom_testconfig.js'),\n this.destinationPath('felab/custom/testconfig.js')\n );\n\n this.fs.copy(\n this.templatePath('felab_default_concat.js'),\n this.destinationPath('felab/default/concat.js')\n );\n this.fs.copy(\n this.templatePath('felab_default_copy.js'),\n this.destinationPath('felab/default/copy.js')\n );\n this.fs.copy(\n this.templatePath('felab_default_clean.js'),\n this.destinationPath('felab/default/clean.js')\n );\n this.fs.copy(\n this.templatePath('felab_default_config.json'),\n this.destinationPath('felab/default/config.json')\n );\n this.fs.copy(\n this.templatePath('felab_default_exec.js'),\n this.destinationPath('felab/default/exec.js')\n );\n this.fs.copy(\n this.templatePath('felab_default_watch.js'),\n this.destinationPath('felab/default/watch.js')\n );\n this.fs.copy(\n this.templatePath('felab_default_postcss.js'),\n this.destinationPath('felab/default/postcss.js')\n );\n this.fs.copy(\n this.templatePath('felab_default_sass.js'),\n this.destinationPath('felab/default/sass.js')\n );\n this.fs.copy(\n this.templatePath('felab_default_sassdoc.js'),\n this.destinationPath('felab/default/sassdoc.js')\n );\n this.fs.copy(\n this.templatePath('felab_user_aliases.yaml'),\n this.destinationPath('felab/user/aliases.yaml')\n );\n }", "function confirmCommand() {\n\tswal(\"Votre commande a bien été validée, vous allez être redirigé\", \"\", \"success\");\n\tsetTimeout(function () {\n\t\twindow.location = \"confirmation.html\";\n\t}, 3000);\n}", "function preguntar() {\n var respuesta = confirm(\"Deseas ir a Running?\")\n return respuesta;\n}", "function grunt( repo, callback, errCallback ) {\n 'use strict';\n \n execute( 'grunt', [ '--no-color' ], rootDir + repo, callback, errCallback );\n}", "function areYouSure(){\n confirm('Are you sure?');\n}", "function checkout(){\n confirm(\"Are you sure?\");\n}", "static get description() {\r\n return 'Run a command, like “npm test”'\r\n }", "function updateConfirmationMessage() {\n for (var key in actionkit.args) {\n if (key.indexOf(':') > 0 && actionkit.args[key] == 1) {\n $('#ak-confirmation').text(actionkit.forms.text['error_' + key]);\n $('#ak-confirmation').show();\n }\n }\n}", "function confirm(desc, callback) {\n process.stdout.write('\\u0033[90m' + desc + '\\u0033[0m');\n process.stdin.setEncoding('utf8');\n process.stdin.once('data', function (data) {\n data = String(data).trim().toLowerCase();\n callback(data === 'y' || data === 'yes');\n }).resume();\n}", "function confirmStampe() {\n\tvar message = \"Al termine dell'operazione verra' inviata un'email di riepilogo a [email protected].\\nConfermi?\";\n\treturn confirm(message);\n}", "function fail (ex) {\n grunt.fail.warn('cram failed: ', ex && ex.message || ex);\n if (ex && ex.stack) console.log(ex.stack);\n }", "function Confirm(message, callback) {\n bootbox.confirm({\n title: 'Confirm',\n message: message,\n callback: callback\n });\n }", "deleteProjectConfirm(project) {\n actions.showDialog({name: 'deleteProjectConfirm', project: project});\n }", "function confirm() {\n ctrl.data.successHandler(ctrl.installer).success(function(){\n $uibModalInstance.dismiss('cancel');\n });\n\n }", "function doCleanUp() {\n process.stdout.write(chalk.yellow('\\ndoing clean up...'));\n execSync('rimraf scripts');\n process.stdout.write(chalk.green('\\nclean up done ✓'));\n\n process.stdout.write(chalk.cyan('\\nVoila! Seems like your project is ready! Happy coding :)'));\n}", "function fake_grunt(key, callback, task){\n var grunt = require(fixture('grunt/' + key + '.js'))(require('grunt')),\n error;\n\n grunt.task.init = function(){};\n grunt.fail.warn = grunt.fail.fatal = function(err){ throw new Error(err); };\n\n grunt.task.options({\n done: function(result){\n callback(error, result);\n },\n error: function(err){\n error = err;\n }\n });\n \n grunt.task.run(task || 'update_json');\n grunt.task.start({asyncDone: true});\n return grunt;\n}", "function confirm(str) {}", "function helpAdminCompose() {\r\n alert(\"The purpose of this page is to compose an email and send it.\");\r\n}", "function task(grunt) {\n function logCompileStatus() {\n return through.obj(function (file, enc, cb) {\n grunt.verbose.or.writeln('Compiling \"' + file.path + '\"...');\n this.push(file);\n cb();\n });\n }\n\n // Please see the Grunt documentation for more information regarding task\n // creation: http://gruntjs.com/creating-tasks\n grunt.registerMultiTask('blink', 'Grunt plugin for Blink.', function () {\n var options = this.options();\n var done = this.async();\n\n this.files.forEach(function (filePair) {\n vfs.src(filePair.src).pipe(logCompileStatus()).pipe(blink(filePair.dest, options)).on('error', function (err) {\n grunt.log.notverbose.error().error(err.message);\n grunt.fail.warn(err);\n }).pipe(vfs.dest(filePair.dest)).on('end', function () {\n grunt.verbose.ok();\n done();\n });\n });\n });\n}", "async function runGruntTaskIfExists() {\n const gruntfilePath = path.resolve(workingDirectory, \"gruntfile.js\");\n\n if (!fs.existsSync(gruntfilePath)) {\n isVerbose &&\n console.log(\n `${chalk.yellow(\"gruntfile\")} not found in ${chalk.cyan(\n workingDirectory\n )}. Skipping grunt task checks`\n );\n\n return false;\n }\n\n await checkGlobalNodeDependancyInstalled(\"grunt\");\n\n const gruntTasks = await getGruntTasks();\n // In vanilla themse grunt build task is called default\n if (command === \"build\") {\n command = \"default\";\n }\n\n if (gruntTasks.length < 1) {\n throw new Error(\n `${chalk.yellow(\n \"gruntfile\"\n )} found but no tasks were found. Aborting build process.`\n );\n }\n\n if (!gruntTasks.includes(command)) {\n throw new Error(\n `${chalk.yellow(\"gruntfile\")} found but no ${chalk.cyan(\n command\n )} task was defined. Exiting build process.`\n );\n }\n\n // Tasks exists. Execute it.\n console.log(\n `Grunt task ${command} found. Starting grunt ${command} process`\n );\n await utility.spawnChildProcess(\"grunt\", [command, \"--color\"], spawnOptions);\n}", "function geraPostConfirm(task, d) {\n return `\n <html>\n <head>\n <title>POST receipt: ${task.what}</title>\n <meta charset=\"utf-8\"/>\n <link rel=\"icon\" href=\"favicon.png\"/>\n <link rel=\"stylesheet\" href=\"w3.css\"/>\n </head>\n <body>\n <div class=\"w3-card-4\">\n <header class=\"w3-container w3-teal\">\n <h1>Task ${task.what} inserido</h1> \n </header>\n\n <footer class=\"w3-container w3-teal\">\n <address> Gerado por galuno::DAW2020 em ${d} - [<a href=\"/\">Voltar</a>]</address>\n </footer>\n </div>\n </body>\n </html>\n `\n}", "function confirmation() {\n\t\treturn confirm(\"Certain de faire cela ?\");\n\t}", "function deleteVerify(){\n var choice = dialog.showMessageBoxSync(\n {\n type: 'question',\n buttons: ['delete project', 'maybe not', 'cancel'],\n title: 'Confirm',\n message: 'Are you sure you want to delete the project \"'+currentProjectTitle+'\"?'\n });\n if(choice === 0){//cancel\n return true;\n }\n else {//kill it\n return false;\n }\n}", "function showAlert(){\nalert(\"Task 01 Completed\");\n}", "function executeCmd(grunt, command, done) {\n\n // Print the command formatted to run in bash\n grunt.log.writeln(command.cmd +' '+ command.args.join(' ').replace(/(version,'[^']*')/, '\"$1\"'));\n\n var stdout = [];\n var proc = grunt.util.spawn(command, function(error, result, code) {\n grunt.log.subhead(result.stdout);\n\n if (error) {\n grunt.log.error(error.message, code);\n }\n done(!error);\n });\n\n proc.stdout.setEncoding('utf-8');\n proc.stdout.on('data', function(data) {\n stdout.push(data);\n });\n\n // Recognize when the action-script-compiler-daemon is running\n // which sometimes halts grunt\n var checkIntervalHandle = setInterval(function() {\n if (/Starting aschd server/.test(stdout.join())) {\n clearInterval(checkIntervalHandle);\n grunt.log.ok(command.cmd);\n\n grunt.log.subhead(stdout.join());\n\n done();\n }\n }, 500);\n}", "function confirm(msg, callback) {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n\n rl.question(msg, input => {\n rl.close();\n callback(/^y|yes|ok|true$/i.test(input));\n });\n}", "function ArchiveCompanyConfirm() {\n confirm(\"Do you want to Archive this Company?\");\n}", "function confirm(msg, callback) {\n var rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n });\n\n rl.question(msg, function (input) {\n rl.close();\n callback(/^y|yes|ok|true$/i.test(input));\n });\n}", "function confirm(e) {\n deleteQuestion(deleteId); //sending question id\n message.success(\"Deleted Successfully\");\n }", "function confirm(msg, callback) {\n var rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n });\n\n rl.question(msg, function (input) {\n rl.close();\n callback(/^y|yes|ok|true$/i.test(input));\n });\n}", "function confirm(msg, cb) {\n rl.question(msg, function(input) {\n cb(/^y|yes|ok|true$/i.test(input));\n });\n}", "function confirm(msg, cb) {\n rl.question(msg, function(input) {\n cb(/^y|yes|ok|true$/i.test(input));\n });\n}", "function confirm(msg, callback) {\n var rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n })\n\n rl.question(msg, function (input) {\n rl.close()\n callback(/^y|yes|ok|true$/i.test(input))\n })\n}", "function verifyFileExists(file){\n if( !grunt.file.exists(file) ){\n grunt.fail.fatal('The provided source file was either not found or not provided');\n } \n }", "function displayHelp() {\n var pkg = require(__dirname + \"/../package.json\");\n grunt.log.writeln();\n grunt.log.writeln(pkg.description);\n grunt.log.writeln((\" \" + pkg.name + \" \").green.inverse\n + \" Version - \" + pkg.version);\n\n // Borrowed heavily from the Grunt help source.\n var col1len = 0;\n\n var opts = Object.keys(grunt.cli.optlist).map(function(long) {\n var o = grunt.cli.optlist[long];\n var col1 = '--' + (o.negate ? 'no-' : '') + long + (o.short ? ', -' + o.short : '');\n col1len = Math.max(col1len, col1.length);\n return [col1, o.info];\n });\n\n var widths = [1, col1len, 2, 76 - col1len];\n\n var gruntTasks = Object.keys(grunt.task._tasks).sort()\n // var tasksList = Object.keys(grunt.task._tasks).slice(8);\n\n if (gruntTasks.length) {\n displayTasks(\"Towelie\", gruntTasks);\n }\n \n // if (gruntTasks.length) {\n // displayTasks(\"Grunt\", gruntTasks);\n // }\n\n function displayTasks(name, tasksList) {\n var tasks = tasksList.map(function(name) {\n col1len = Math.max(col1len, name.length);\n var info = grunt.task._tasks[name].info;\n\n return [name, info.blue];\n });\n\n grunt.log.header((name + \" tasks:\").yellow);\n grunt.log.writeln();\n\n tasks.forEach(function(a) {\n grunt.log.writetableln(widths,\n ['', grunt.utils._.pad(a[0], col1len), '', a[1]]\n );\n });\n }\n\n grunt.log.writeln();\n}", "async confirmStep(stepContext) {\n const incidentDetails = stepContext.options;\n\n // Capture the results of the previous step\n incidentDetails.details = stepContext.result;\n \n const msg1 = `Just to make sure, I have your email as: ${ incidentDetails.requester } `;\n await stepContext.context.sendActivity(msg1, msg1, InputHints.IgnoringInput);\n const msg2 = `And are looking for assistance with: \\n\\n ${ incidentDetails.details } `;\n await stepContext.context.sendActivity(msg2, msg2, InputHints.IgnoringInput);\n const msg3 = `***WARNING***, If your email is not written correctly, the ticket will not be created.\\n\\n`;\n await stepContext.context.sendActivity(msg3, msg3, InputHints.IgnoringInput);\n const messageText = `Is this correct?`;\n const msg = MessageFactory.text(messageText, messageText, InputHints.ExpectingInput);\n\n\n // Offer a YES/NO prompt.\n return await stepContext.prompt(CONFIRM_PROMPT, { prompt: msg });\n }", "async confirmLocalisationPrompt(step) {\n\n await step.prompt(CONFIRM_LOCALISATION_PROMPT, 'Do you know where you want to eat ?', ['yes', 'no']);\n}", "function DeleteOutgoingCheque() {\n debugger\n notyConfirm('Are you sure to delete?', 'DeleteRecord()', '', \"Yes, delete it!\");\n}", "function DeleteOutgoingCheque() {\n debugger\n notyConfirm('Are you sure to delete?', 'DeleteRecord()', '', \"Yes, delete it!\");\n}", "async handle ({ name, email, token }) {\n const link = `${Env.get('URL_FRONT')}confirm?token=${token}`\n\n await Mail.send(\n ['mails.confirm_new_user', 'mails.confirm_new_user-text'],\n {\n name,\n email,\n token,\n link\n },\n message => {\n message\n .to(email)\n .from('[email protected]', 'Equipe Future Soluções')\n .subject('Confirme seu cadastro [ Future Soluções ]')\n }\n )\n }", "function askDeployNow() {\n if (this.abort) return null;\n const prompts = [\n {\n type: 'confirm',\n name: 'deployNow',\n message: 'Would you like to deploy now?',\n default: true,\n },\n ];\n\n return this.prompt(prompts).then(props => {\n this.deployNow = props.deployNow;\n });\n}", "function confirmLinkAction() {\r\n\t\t\t$('.reqconf').click(function(e) {\r\n\t\t\t\tPetolio.showConfirm($(e.currentTarget).attr('title'), function() {\r\n\t\t\t\t\tPetolio.go($(e.currentTarget).attr('href'));\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t});\r\n\t\t}", "function confirm(msg, callback) {\n var rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n });\n\n rl.question(msg, function(input) {\n rl.close();\n callback(input == '' || /^y|yes|ok|true$/i.test(input));\n });\n}", "function confirm (msg, callback) {\n var rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n })\n\n rl.question(msg, function (input) {\n rl.close()\n callback(/^y|yes|ok|true$/i.test(input))\n })\n}", "function farewell() {\n console.log('\\x1b[32m', '\\n Student Data System - Push Asset Data Script');\n console.log(\n '\\x1b[32m',\n 'All tasks successfully completed!',\n '\\n\\n Process exited with exit code 0\\n',\n '\\x1b[0m'\n );\n return process.exit(0);\n}", "buildSystem() {\n\n if ( this.options.buildSystem ) {\n return true;\n }\n\n let done = this.async();\n let prompt = [\n {\n type: 'list',\n name: 'buildSystem',\n message: 'Select a build system:',\n choices: [\n 'Grunt',\n 'Gulp',\n ],\n },\n ];\n\n this.prompt(prompt, ( { buildSystem } ) => {\n this.options.buildSystem = buildSystem && buildSystem.toLowerCase();\n done();\n });\n }", "function SubmitDeleteCompanyConfirm() {\n confirm(\"Do you want to Delete this Company?\");\n}", "function DeleteClick() {\n notyConfirm('Are you sure to delete?', 'DeleteSupplierPayment()');\n}", "function confirm() {\n transition(CONFIRM);\n }", "function _checkSuccessRunDeploymentMessage(commandOut, deploy) {\n ImptTestHelper.checkOutputMessage(`${outputMode}`, commandOut,\n Util.format(`${UserInterractor.MESSAGES.BUILD_RUN}`,\n `${Identifier.ENTITY_TYPE.TYPE_BUILD} \"${deploy}\"`\n )\n );\n }", "function confirm() {\n ctrl.data.successHandler(ctrl.version);\n $uibModalInstance.dismiss('cancel');\n\n }", "function checkout(choice) {\n if (choice.toLowerCase() === \"q\") {\n // Log a message and exit the current node process\n console.log(\"Thank You My Friend. Come Again!\");\n process.exit(0);\n }\n}", "function task(name, ...deps) {\n app.task(name, { silent: true }, ...deps);\n }", "function adminTasks() {\n var pathto = function (file) {\n return ('admin/views/assets/' + file);\n };\n var scripts = {\n src: pathto('javascripts/app/*.js'),\n dest: pathto('javascripts'),\n qor: pathto('javascripts/qor/*.js'),\n all: [\n 'gulpfile.js',\n pathto('javascripts/qor/*.js')\n ]\n };\n var styles = {\n src: pathto('stylesheets/scss/{app,qor}.scss'),\n dest: pathto('stylesheets'),\n vendors: pathto('stylesheets/vendors'),\n main: pathto('stylesheets/{qor,app}.css'),\n scss: pathto('stylesheets/scss/**/*.scss')\n };\n var fonts = {\n dest: pathto('fonts'),\n };\n\n gulp.task('jshint', function () {\n return gulp.src(scripts.all)\n .pipe(plugins.jshint())\n .pipe(plugins.jshint.reporter('default'));\n });\n\n gulp.task('jscs', function () {\n return gulp.src(scripts.all)\n .pipe(plugins.jscs());\n });\n\n gulp.task('qor', ['jshint', 'jscs'], function () {\n return gulp.src(scripts.qor)\n .pipe(plugins.concat('qor.js'))\n .pipe(plugins.uglify())\n .pipe(gulp.dest(scripts.dest));\n });\n\n gulp.task('js', ['qor'], function () {\n return gulp.src(scripts.src)\n .pipe(plugins.concat('app.js'))\n .pipe(plugins.uglify())\n .pipe(gulp.dest(scripts.dest));\n });\n\n gulp.task('qor+', function () {\n return gulp.src(scripts.qor)\n .pipe(plugins.sourcemaps.init())\n .pipe(plugins.concat('qor.js'))\n .pipe(plugins.sourcemaps.write('./'))\n .pipe(gulp.dest(scripts.dest));\n });\n\n gulp.task('js+', function () {\n return gulp.src(scripts.src)\n .pipe(plugins.sourcemaps.init())\n .pipe(plugins.concat('app.js'))\n .pipe(plugins.sourcemaps.write('./'))\n .pipe(gulp.dest(scripts.dest));\n });\n\n gulp.task('jslib', function () {\n return gulp.src([\n 'bower_components/jquery/dist/jquery.min.js',\n 'bower_components/jquery/dist/jquery.min.map',\n 'bower_components/material-design-lite/material.min.js',\n 'bower_components/material-design-lite/material.min.js.map',\n 'bower_components/cropper/dist/cropper.min.js',\n 'bower_components/chosen/chosen.jquery.min.js'\n ])\n .pipe(gulp.dest(scripts.vendors));\n });\n\n gulp.task('sass', function () {\n return gulp.src(styles.src)\n .pipe(plugins.sourcemaps.init())\n .pipe(plugins.sass())\n .pipe(plugins.sourcemaps.write('./'))\n .pipe(gulp.dest(styles.dest));\n });\n\n gulp.task('csslint', ['sass'], function () {\n return gulp.src(styles.main)\n .pipe(plugins.csslint('.csslintrc'))\n .pipe(plugins.csslint.reporter());\n });\n\n gulp.task('css', ['csslint'], function () {\n return gulp.src(styles.main)\n .pipe(plugins.autoprefixer())\n .pipe(plugins.csscomb())\n .pipe(plugins.minifyCss())\n .pipe(gulp.dest(styles.dest));\n });\n\n gulp.task('mdl', function () {\n return gulp.src([\n 'bower_components/material-design-lite/src/_*',\n ])\n .pipe(gulp.dest(pathto('stylesheets/scss/mdl')));\n });\n\n gulp.task('fonts', function () {\n return gulp.src([\n 'bower_components/material-design-icons/iconfont/codepoints',\n 'bower_components/material-design-icons/iconfont/MaterialIcons*'\n ])\n .pipe(gulp.dest(fonts.dest));\n });\n\n gulp.task('csslib', ['mdl', 'fonts'], function () {\n return gulp.src([\n 'bower_components/material-design-lite/material.min.css',\n 'bower_components/material-design-lite/material.min.css.map',\n 'bower_components/cropper/dist/cropper.min.css',\n 'bower_components/chosen/chosen-sprite.png',\n 'bower_components/chosen/[email protected]',\n 'bower_components/chosen/chosen.min.css'\n ])\n .pipe(gulp.dest(styles.dest));\n });\n\n gulp.task('watch', function () {\n gulp.watch(scripts.qor, ['qor+']);\n gulp.watch(scripts.src, ['js+']);\n gulp.watch(styles.scss, ['sass']);\n });\n\n gulp.task('lib', ['jslib', 'csslib']);\n gulp.task('release', ['js', 'css']);\n\n gulp.task('default', ['watch']);\n}", "function newPartConfirm() {\n swal({\n title: \"Are you sure?\",\n text: \"This will delete the current part\",\n type: \"warning\",\n showCancelButton: true,\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: \"Yes, start a new part\",\n closeOnConfirm: true\n },\n function(){\n paper.project.clear();\n newProject();\n });\n}", "function clickDeleteToDo(deleteEmail){\n var r = confirm(\"Continue delete?\");\n if (r == true) {\n deleteUser(deleteEmail);\n } else {\n return alert('Delete canceled');\n };\n \n console.log(deleteEmail);\n \n deleteToDo(deleteEmail).then(function(deleteEmail){ \n \n console.log(deleteEmail); \n \n }).catch(function(err){\n console.log(err);\n });\n }", "function confirm() {\n\n ctrl.data.successHandler(ctrl.project);\n $uibModalInstance.dismiss('cancel');\n\n }", "function confirmExtraTurn(){\n return confirm('Quieres jugar otro turno?');\n }", "promptAreYouSure(message, cb) {\n vscode_1.window\n .showWarningMessage(message, { modal: true }, { title: 'Yes', isCloseAffordance: false }, { title: 'No', isCloseAffordance: true })\n .then(answer => {\n if (answer.title === 'Yes') {\n cb();\n }\n });\n }", "function init() {\r\n\t\t/**\r\n\t\tProject configuration.\r\n\t\t@toc 5.\r\n\t\t*/\r\n\t\tgrunt.initConfig({\r\n\t\t\tconcat: {\r\n\t\t\t\tdevCss: {\r\n\t\t\t\t\tsrc: [],\r\n\t\t\t\t\tdest: []\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tjshint: {\r\n\t\t\t\toptions: {\r\n\t\t\t\t\t//force: true,\r\n\t\t\t\t\tglobalstrict: true,\r\n\t\t\t\t\t//sub: true,\r\n\t\t\t\t\tnode: true,\r\n\t\t\t\t\tloopfunc: true,\r\n\t\t\t\t\tbrowser: true,\r\n\t\t\t\t\tdevel: true,\r\n\t\t\t\t\tglobals: {\r\n\t\t\t\t\t\tangular: false,\r\n\t\t\t\t\t\t$: false,\r\n\t\t\t\t\t\tmoment:\t\tfalse,\r\n\t\t\t\t\t\tPikaday: false,\r\n\t\t\t\t\t\tmodule: false,\r\n\t\t\t\t\t\tforge: false\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tbeforeconcat: {\r\n\t\t\t\t\toptions: {\r\n\t\t\t\t\t\tforce:\tfalse,\r\n\t\t\t\t\t\tignores: ['**.min.js']\r\n\t\t\t\t\t},\r\n\t\t\t\t\tfiles: {\r\n\t\t\t\t\t\tsrc: []\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t//quick version - will not fail entire grunt process if there are lint errors\r\n\t\t\t\tbeforeconcatQ: {\r\n\t\t\t\t\toptions: {\r\n\t\t\t\t\t\tforce:\ttrue,\r\n\t\t\t\t\t\tignores: ['**.min.js']\r\n\t\t\t\t\t},\r\n\t\t\t\t\tfiles: {\r\n\t\t\t\t\t\tsrc: ['**.js']\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tuglify: {\r\n\t\t\t\toptions: {\r\n\t\t\t\t\tmangle: false\r\n\t\t\t\t},\r\n\t\t\t\tbuild: {\r\n\t\t\t\t\tfiles: {},\r\n\t\t\t\t\tsrc: 'ng-cloudtasks.js',\r\n\t\t\t\t\tdest: 'dist/ng-cloudtasks.min.js'\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tbump: {\r\n\t\t\t\toptions: {\r\n\t\t\t\t\tfiles: ['package.json', 'bower.json'],\r\n\t\t\t\t\tupdateConfigs: [],\r\n\t\t\t\t\tadd: true,\r\n\t\t\t\t\taddFiles: ['.'], // '.' for all files except ingored files in .gitignore\r\n\t\t\t\t\tcommit: true,\r\n\t\t\t\t\tcommitMessage: 'Release %VERSION%',\r\n\t\t\t\t\tcommitFiles: ['-a'], // '-a' for all files\r\n\t\t\t\t\tcreateTag: true,\r\n\t\t\t\t\ttagName: '%VERSION%',\r\n\t\t\t\t\ttagMessage: 'Version %VERSION%',\r\n\t\t\t\t\tpush: true,\r\n\t\t\t\t\tpushTo: 'origin',\r\n\t\t\t\t\tnpm: true,\r\n\t\t\t\t\tnpmTag: 'Release %VERSION%',\r\n\t\t\t\t\tgitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe'\r\n\t\t\t\t}\r\n\t\t\t}/*,\r\n\t\t\tkarma: {\r\n\t\t\t\tunit: {\r\n\t\t\t\t\tconfigFile: publicPathRelativeRoot+'config/karma.conf.js',\r\n\t\t\t\t\tsingleRun: true,\r\n\t\t\t\t\tbrowsers: ['PhantomJS']\r\n\t\t\t\t}\r\n\t\t\t}*/\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t\t/**\r\n\t\tregister/define grunt tasks\r\n\t\t@toc 6.\r\n\t\t*/\r\n\t\t// Default task(s).\r\n\t\t// grunt.registerTask('default', ['jshint:beforeconcat', 'less:development', 'concat:devJs', 'concat:devCss']);\r\n\t\tgrunt.registerTask('default', ['jshint:beforeconcatQ', 'uglify:build']);\r\n\t\r\n\t}", "function confirmDeletion(){\n vex.dialog.open({\n message: \"Comment Has Been Deleted\",\n buttons:[\n $.extend({},vex.dialog.buttons.Yes,{text: \"OK\"})\n ],\n callback: function (data) {\n $(location).attr(\"href\", \"/\"); \n }\n });\n }", "function successMessage(msg, callback) {\n $.confirm({\n icon: 'fa fa-check fa-lg',\n title: 'Registro correcto!',\n content: `<b>${msg}</b>`,\n type: 'green',\n scrollToPreviousElement: false,\n scrollToPreviousElementAnimate: false,\n buttons: {\n Aceptar: {\n text: 'Aceptar',\n btnClass: 'btn-green',\n action: function () {\n callback;\n }\n }\n }\n });\n}", "function taskComplete(){\n inquirer\n .prompt([\n {\n type: 'confirm',\n name: 'exit',\n message: 'Do you want to exit the program?'\n }\n ])\n .then(function(answer) {\n if (answer.exit){\n connection.end();\n } else {\n start();\n };\n });\n}", "function getConfirmation() {\n var response = confirm(\"Your posting is getting approved by admin. By completing the post you are agreeing to our terms and conditions.\");\n return response;\n}", "function _checkSuccessDeleteDeploymentMessage(commandOut, deploy) {\n ImptTestHelper.checkOutputMessage(`${outputMode}`, commandOut,\n Util.format(`${UserInterractor.MESSAGES.ENTITY_DELETED}`,\n `${Identifier.ENTITY_TYPE.TYPE_BUILD} \"${deploy}\"`)\n );\n }", "function confirmDelete() {\n\n transition(\"CONFIRM\");\n\n }", "async function run({ dest }) {\n let deployInfo = { host: void 0, src: projectRoot, dest };\n\n // See if the parameters are available in the local json file\n if (fs.existsSync(path.resolve(\"deployqa.local.json\"))) {\n const local = fs.readJSONSync(path.resolve(\"deployqa.local.json\"));\n deployInfo = {\n ...deployInfo,\n ...local,\n };\n }\n\n const questions = [\n deployInfo.host\n ? Array.isArray(deployInfo.host)\n ? {\n type: \"autocomplete\",\n name: \"host\",\n message: \"What host should be deployed to?\",\n limit: 10,\n choices: deployInfo.host,\n }\n : void 0\n : {\n type: \"input\",\n name: \"host\",\n message: \"What host should be deployed to?\",\n },\n deployInfo.dest\n ? void 0\n : {\n type: \"input\",\n name: \"dest\",\n message: \"What host folder should be deployed to?\",\n },\n ].filter((d) => d !== void 0);\n\n if (questions.length > 0) {\n answers = await prompt(questions);\n deployInfo = {\n ...deployInfo,\n ...answers,\n };\n }\n\n deployInfo.src =\n path.resolve(deployInfo.src) + (deployInfo.src.endsWith(\"/\") ? \"/\" : \"\");\n\n console.log(\"Deploy Target:\\n\", deployInfo);\n\n await sync(deployInfo);\n await updateRemote(deployInfo);\n}", "function confirmacion() {\r\n\treturn confirm(\"Esta seguro de eliminar el registro?\");\r\n}", "function setupStartCase1() {\n console.log(\"setupStartCase1\", String($(\"#WIP-td5_1\").text()).trim());\n if (String($(\"#WIP-td5_1\").text()).trim() != \"\") {\n if (config.strSkipWOTrackingPrompt) {\n setupStartCase5();\n } else {\n if ($scope.fnTrackSetupConfigVar == true || config.BypassSetup) {\n\n $.confirm({\n title: 'Confirm!',\n content: \"Confirm to start production?\",\n buttons: {\n confirm: function () {\n setupStartCase5();\n },\n cancel: function () {\n $.alert('Canceled!');\n }\n }\n });\n\n //var answer = confirm(\"Confirm to start production?\");\n\n //if (answer) {\n // setupStartCase5();\n //}\n\n } else {\n\n $.confirm({\n title: 'Confirm!',\n content: \"Confirm to start setup?\",\n buttons: {\n confirm: function () {\n setupStartCase5();\n },\n cancel: function () {\n $.alert('Canceled!');\n }\n }\n });\n\n\n //var answer = confirm(\"Confirm to start setup?\");\n //if (answer) {\n // //some code\n // // alert(\"here\");\n // setupStartCase5();\n //}\n\n }\n }\n } else {\n $(\"#alertBoxContent\").text(\"Please update received qty!\");\n $('#alertBox').modal('show');\n //alert(\"Please update received qty!\");\n }\n }", "function confirm_delete()\n{\n\tif(confirm(delete_confirmation.replace('**module**' , 'Activity')))\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "function productionStartCase6() {\n console.log(\"productionStartCase6\");\n console.log(\"setupStartCase1\", String($(\"#WIP-td5_1\").text()).trim());\n if (String($(\"#WIP-td5_1\").text()).trim() != \"\") {\n if (config.strSkipWOTrackingPrompt) {\n productionStartCase10();\n } else {\n\n\n $.confirm({\n title: 'Confirm!',\n content: \"Confirm to start production?\",\n buttons: {\n confirm: function () {\n productionStartCase10();\n },\n cancel: function () {\n $.alert('Canceled!');\n }\n }\n });\n\n\n //var answer = confirm(\"Confirm to start production?\");\n ////todo to implement, trackingdefault ok in model so that default button can change\n ////if (config.TrackingDefaultOK) {\n //// setupStartCase5();\n ////} else {\n //// if (answer) {\n //// setupStartCase5();\n //// }\n ////}\n\n //if (answer) {\n // productionStartCase10();\n // // setupStartCase5();\n //}\n\n\n }\n } else {\n $(\"#alertBoxContent\").text(\"Please update received qty!\");\n $('#alertBox').modal('show');\n //alert(\"Please update received qty!\"); \n }\n }", "sendEmailToAdmin(callback) {\n if (!options.emailAddresses || !options.emailTemplate ||\n !sails.config.email[options.emailTemplate])\n return callback(null, null)\n\n EmailService.sendEmailAsync(\n // Generate the email template using the supplied arguments.\n sails.config.email[options.emailTemplate].apply(\n null, options.templateArgs\n )\n ).then(function (info) {\n return callback(null, true)\n }).catch(function (err) {\n sails.log.error(err)\n err.errType = 'EmailSendFailiure'\n return callback(err, null)\n })\n }", "static describe () {\n\t\treturn {\n\t\t\ttag: 'confirm',\n\t\t\tsummary: 'Confirms a user\\'s registration',\n\t\t\taccess: 'No authorization needed, though the correct confirmation code must be correct',\n\t\t\tdescription: 'Confirms a user\\'s registration with confirmation code',\n\t\t\tinput: {\n\t\t\t\tsummary: 'Specify attributes in the body; email and confirmation code must be provided',\n\t\t\t\tlooksLike: {\n\t\t\t\t\t'email*': '<User\\'s email>',\n\t\t\t\t\t'confirmationCode*': '<Confirmation code (sent via email to the user\\'s email after initial registration)>',\n\t\t\t\t\t'password': '<Can optionally set the user\\'s password here>',\n\t\t\t\t\t'username': '<Can optionally set the user\\'s username here>'\n\t\t\t\t}\n\t\t\t},\n\t\t\treturns: {\n\t\t\t\tsummary: 'Returns an updated user object, plus access token and PubNub subscription key, and teams the user is on as well as repos owned by those teams',\n\t\t\t\tlooksLike: {\n\t\t\t\t\tuser: '<@@#user object#user@@>',\n\t\t\t\t\taccessToken: '<user\\'s access token, to be used in future requests>',\n\t\t\t\t\tpubnubKey: '<subscribe key to use for connecting to PubNub>',\n\t\t\t\t\tpubnubToken: '<user\\'s token for subscribing to PubNub channels>',\n\t\t\t\t\tproviders: '<info structures with available third-party providers>',\n\t\t\t\t\tbroadcasterToken: '<user\\'s token for subscribing to real-time messaging channels>',\n\t\t\t\t\tteams: [\n\t\t\t\t\t\t'<@@#team object#team@@>',\n\t\t\t\t\t\t'...'\n\t\t\t\t\t],\n\t\t\t\t\trepos: [\n\t\t\t\t\t\t'<@@#repo object#repo@@>',\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\tpublishes: {\n\t\t\t\tsummary: 'Publishes the updated user object on the team channel for each team the user is on.',\n\t\t\t\tlooksLike: {\n\t\t\t\t\tuser: '<@@#user object#user@@>'\n\t\t\t\t}\n\t\t\t},\n\t\t\terrors: [\n\t\t\t\t'parameterRequired',\n\t\t\t\t'notFound',\n\t\t\t\t'alreadyRegistered',\n\t\t\t\t'emailMismatch',\n\t\t\t\t'tooManyConfirmAttempts',\n\t\t\t\t'confirmCodeExpired',\n\t\t\t\t'confirmCodeMismatch'\n\t\t\t]\n\t\t};\n\t}", "function confirm() {\n ctrl.data.successHandler(ctrl.scenario).success(function(){\n $uibModalInstance.dismiss('cancel');\n });\n\n }", "actionFinal() {\n this.generateAlertMessage(\"Good Job!\",`You won using ${this.steps} steps`,'success');\n this.reset();\n }", "function getCallback(done) {\n return function(err, success){\n if (err) {\n return grunt.log.error(err);\n } else if (success) {\n grunt.log.writeln(success);\n done();\n }\n }\n }", "confirmConfigAndReport(manifest) {\n let userNotification = __webpack_require__(56).default;\n // definitions to drive verification of config object\n const REQUIRED_STRING = configUtil_1.ConfigUtilInstance.REQUIRED_STRING;\n const REQUIRED_OBJECT = configUtil_1.ConfigUtilInstance.REQUIRED_OBJECT;\n var configVerifyObject = {\n finsemble: {\n applicationRoot: REQUIRED_STRING,\n moduleRoot: REQUIRED_STRING,\n bootTasks: REQUIRED_OBJECT,\n system: {\n FSBLVersion: REQUIRED_STRING,\n requiredServicesConfig: REQUIRED_OBJECT\n },\n workspaceTemplates: REQUIRED_OBJECT,\n servicesRoot: REQUIRED_STRING\n }\n };\n // do an initial sanity check on the boot config\n var configOk = configUtil_1.ConfigUtilInstance.verifyConfigObject(\"manifest\", manifest, configVerifyObject);\n // if any config problems at this level then catastrophic, so report error \"everywhere\"; logger may not come up so use console too\n if (!configOk) {\n let errorMsg = \"Manifest Error: probably cause is the `finsemble` JSON in manifest file is not correct. See system manager console errors for more information.\";\n systemLog_1.default.error({}, errorMsg);\n console.error(errorMsg, \"manifest.finsemble\", manifest.finsemble);\n logger_1.default.system.error(\"forceObjectsToLogger\", errorMsg, \"manifest.finsemble\", manifest.finsemble);\n // notification URL is not pulled from finsemble.notificationURL because config may be corrupted\n userNotification.alert(\"system\", \"ONCE-SINCE-STARTUP\", \"FSBL-Internal-MANIFEST-Error\", errorMsg);\n }\n else {\n logger_1.default.system.log(\"APPLICATION LIFECYCLE:STARTUP: Finsemble Version\", manifest.finsemble.system.FSBLVersion);\n }\n }", "function cleanTask(cb) {\n return del(ENV.clean.dir);\n }", "function _checkSuccessDeletedProjectMessage(commandOut) {\n ImptTestHelper.checkOutputMessage(`${outputMode}`, commandOut,\n Util.format(`${UserInterractor.MESSAGES.ENTITY_DELETED}`, 'Project'));\n }", "function shellexec(cmd) {\n var result = shell.exec(cmd);\n if (result.code != 0) {\n grunt.fail.warn(result.stderr, result.code)\n }\n }", "function scaffoldNPM() {\n // CSS Scripts\n if (cssChoice) {\n packageJSON['scripts'][cssChoice] = packageScriptTemplates[cssChoice];\n packageJSON['scripts']['build:styles'] =\n packageScriptTemplates['build:styles'].replace('%s', cssChoice);\n }\n // JS Scripts\n if (jsChoice) {\n packageJSON['scripts'][jsChoice] = packageScriptTemplates[jsChoice];\n packageJSON['scripts']['build:scripts'] =\n packageScriptTemplates['build:scripts'].replace('%s', jsChoice);\n packageJSON['devDependencies'][(devDependencyTemplates[jsChoice])] = 'latest';\n }\n // Write out the completed package.json template\n fs.writeJsonSync(workingDir + 'package.json', packageJSON);\n\n teardown(); // Go to last step\n}", "function deleteTask(){\n var result = confirm('Are you sure you want to delete?');\n if (result){\n var deleteID = $( this ).data( 'id' );\n var delTask = {\n \"id\": deleteID\n };\n $.ajax({\n type: 'POST',\n url: '/postDelete',\n data: delTask\n });\n getTasks();\n }else{\n return false;\n }\n }", "function toDo() {\n console.log(\" \");\n console.log(\"TODO LIST\");\n console.log(\" 1. In file ajax_requests, uncomment 'check_actual_tags' \\\n \");\n console.log(\" \");\n}", "function statusConfirm(text, confirm, func) {\r\n\t\tvar content = '<form id = \"statusConfirm\">' + text + '<input type = \"submit\" value = \"'+ confirm +'\" /></form>';\r\n\t\t\r\n\t\topenStatusMessage(content);\r\n\t\t\r\n\t\tif(!func)\r\n\t\t\tvar callback = function(e) { e.preventDefault(); closeStatusMessage(); }\r\n\t\telse \r\n\t\t\tvar callback = function(e) { e.preventDefault(); closeStatusMessage(func); }\r\n\t\t\r\n\t\t$('#statusConfirm').submit(callback);\r\n\t\t\r\n\t}", "success(msg, options){\n if(!atom.config.get('verilog-tools.silent'))\n report(msg, options, \"success\");\n }", "function confirm() {\n if (angular.isDefined(ctrl.data.successHandler)) {\n if(ctrl.testcase.name){\n ctrl.data.successHandler(ctrl.name, ctrl.testcase).success( function(){\n $uibModalInstance.close();\n })\n }\n else{\n ctrl.data.successHandler(ctrl.name, ctrl.testcase)\n }\n }\n }", "function cancelTask(err) {\n var message = Array.prototype.slice.call(arguments).map(function (message) {\n return String(message);\n }).join(' ');\n console.error(message);\n process.exit(1);\n }", "function SubmitAddCompanyConfirm() {\n confirm(\"Do you want to Add this Company?\");\n}", "confirmationAlertwithOptionButton(title, message, positiveText, negativeText, skipText, positiveOnPress, negativeOnPress, skipOnPress, cancelableFlag ){\n Alert.alert(\n title,\n message,\n [\n {text: skipText, onPress: skipOnPress, style: 'destructive',},\n {text: negativeText, onPress: negativeOnPress, style : 'cancel'},\n {text: positiveText, onPress: positiveOnPress, style : 'default'},\n ],\n {cancelable: cancelableFlag},\n ); \n }", "function confirmSubmit()\n\t{\n\t\tvar agree=confirm(\"¿Está seguro de eliminar este registro? !!!EL PROCESO ES IRREVERSIBLE!!!\");\n\t\tif (agree){\n\t\t \treturn true ;\n\t\t}else{\n\t\t \treturn false ;\n\t\t}\n\t}", "function showDeleteConfirmation(confirmTitle, confirmMessage, resultFunc) {\n Swal.fire({\n title: `${confirmTitle}`,\n text: `${confirmMessage}`,\n icon: \"warning\",\n showCancelButton: true,\n cancelButtonColor: \"#3085d6\",\n confirmButtonColor: \"#d33\",\n confirmButtonText: \"Tak, usuń go\",\n cancelButtonText: \"Nie usuwaj\",\n reverseButtons: true,\n showCloseButton: true,\n focusCancel: true\n }).then(resultFunc);\n}", "supprCloud() {\n if (this.saveView.cloudSelectFile.selectedIndex > -1) {\n new Confirm(Utilitary.messageRessource.confirmSuppr, (confirmCallBack) => { this.supprCloudCallback(confirmCallBack); });\n }\n }", "function _checkSuccessCreateDeploymentMessage(commandOut, deploy) {\n ImptTestHelper.checkOutputMessage(`${outputMode}`, commandOut,\n Util.format(`${UserInterractor.MESSAGES.ENTITY_CREATED}`,\n `${Identifier.ENTITY_TYPE.TYPE_BUILD} \"${deploy}\"`\n )\n );\n }", "handleConfirm() {\n Alert.alert(\n \"Finaliser le regroupement de commandes\",\n \"Avant de finaliser ce bon, veuillez indiquer s'il est complet ou incomplet.\",\n [\n {text: 'Complet', onPress: () => this.sendConfirm(true) },\n {text: 'Incomplet', onPress: () => this.sendConfirm(false) }\n ],\n { cancelable: true }\n )\n }", "function DeleteConfirmAlert(me, first_messages, final_messages, datatable_name){\n $.confirm({\n title: 'Confirmation',\n content: first_messages,\n icon: 'fa fa-exclamation-triangle',\n animation: 'scale',\n closeAnimation: 'scale',\n opacity: 0.5,\n buttons: {\n 'confirm': {\n text: 'Proceed',\n btnClass: 'btn-blue',\n action: function(){\n $.confirm({\n title: 'This maybe critical',\n content: final_messages,\n icon: 'fa skull-crossbones',\n animation: 'scale',\n closeAnimation: 'zoom',\n buttons: {\n confirm: {\n text: 'Yes, sure!',\n btnClass: 'btn-danger',\n action: function(){\n $.ajaxSetup({\n headers: {\n 'X-CSRF-TOKEN': $('meta[name=\"csrf-token\"]').attr('content')\n }\n });\n var url = me.data('url');\n $.ajax({\n url: url,\n type: 'DELETE',\n dataType: 'json',\n data: {method: '_DELETE', submit: true},\n success: function(data){\n var session = data.msg;\n if(data.status == 'success'){\n $(datatable_name).DataTable().draw(false);\n if (session != \"\"){\n Swal.fire({\n title: 'Good job!',\n text: session,\n type: 'success',\n // confirmButtonText: 'Deposit Funds'\n }).then(function() {\n // window.location = \"https://cryptolico.com/portal/deposit-fund\";\n });\n }\n }else{\n if (session != \"\"){\n Swal.fire({\n title: 'Sorry!',\n text: session,\n type: 'warning',\n })\n }\n }\n \n }\n })\n }\n },\n cancel: function(){\n //$.alert('you clicked on <strong>cancel</strong>');\n }\n }\n });\n }\n },\n cancel: function(){\n //$.alert('you clicked on <strong>cancel</strong>');\n },\n \n }\n });\n\n}" ]
[ "0.6613369", "0.6129055", "0.5791702", "0.57858026", "0.57025886", "0.5655006", "0.5574036", "0.5511337", "0.5481397", "0.54351366", "0.5434001", "0.5422423", "0.53939104", "0.537695", "0.53761375", "0.5372629", "0.535721", "0.53159606", "0.5297009", "0.52678686", "0.523203", "0.52237535", "0.52091664", "0.5207796", "0.51890534", "0.5187376", "0.5177905", "0.51776636", "0.5175713", "0.51681745", "0.5164562", "0.5154175", "0.51536196", "0.514866", "0.513697", "0.5135652", "0.51351285", "0.51351285", "0.5128089", "0.5122927", "0.511086", "0.51108354", "0.5106981", "0.5106749", "0.5106749", "0.5103928", "0.5101086", "0.50999814", "0.5097905", "0.5094786", "0.508398", "0.5083224", "0.5078015", "0.5075536", "0.5068853", "0.50488365", "0.504603", "0.5041198", "0.5035791", "0.50328815", "0.5032777", "0.5028199", "0.50260997", "0.50232905", "0.5021763", "0.4994186", "0.4992348", "0.49808705", "0.49769458", "0.49708796", "0.497011", "0.49694553", "0.49664938", "0.49647805", "0.4963796", "0.49536076", "0.49529594", "0.49520525", "0.4944232", "0.49333712", "0.49264348", "0.49235275", "0.491786", "0.49148422", "0.49146777", "0.4909277", "0.49084285", "0.4906995", "0.49054107", "0.49051684", "0.4902454", "0.48990193", "0.48984873", "0.4897998", "0.48972332", "0.48972204", "0.48944625", "0.48900476", "0.48889074", "0.48812404", "0.4871617" ]
0.0
-1
write yslow output files after console output parsing if output is '', goes to console if output is null, displays nothing if output is junit|tap, records results in some_output_path/report.(junit|tap) otherwise, records results in some_output_path/some/url_path/url_filename.ext.(xml|json|plain)
function write_yslow_output(format,output,responses,readable){ if(output!="-"&&output!=null){ if( format.match(/(junit|tap)/) ){ var content = ""; for(var n in responses ){ content+=responses[n].response; content+="\r\n\r\n"; } var filep = output+"/report."+format; grunt.file.delete(filep); grunt.file.write(filep, content); grunt.log.ok(filep); }else{ for(var n in responses ){ var u = url_parser.parse(responses[n].url); var filep = output+""+u.path+"."+format; var content = responses[n].response; if( format == "json" && readable ){ content = JSON.stringify(JSON.parse(content),null,4) } grunt.file.write(filep, content); grunt.log.ok(filep); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initializeOutput() {\r\n HTML_output = new java.io.FileWriter(\"active-hits/shortn-results.\" + soylentJob + \".html\");\r\n lag_output = new java.io.FileWriter(\"active-hits/shortn-\" + soylentJob + \"-fix_errors_lag.csv\");\r\n lag_output.write(\"Stage,Assignment,Wait Type,Time,Paragraph\\n\");\r\n payment_output = new java.io.FileWriter(\"active-hits/shortn-\" + soylentJob + \"-fix_errors_payment.csv\");\r\n payment_output.write(\"Stage,Assignment,Cost,Paragraph\\n\");\r\n patchesOutput = new java.io.FileWriter(\"active-hits/shortn-patches.\" + soylentJob +\".json\");\r\n}", "function output()\n{\n if (!outputFile)\n {\n console.log(outputBuffer);\n exit();\n }\n else\n {\n writeBuffer(outputBuffer);\n }\n}", "function recordMockOutput(writeType, qs, output) {\n if (recordOutput == true) {\n if ((writeType === 'GnipPage' && !mock.mockRead) ||\n (writeType === 'QueryStatus' && !mock.mockWrite)) {\n // We'll log the output to a folder and files within that folder.\n // Can use some of these files later for mock mode if need be.\n var countProperty = '_dev_count_' + writeType;\n if (qs.hasOwnProperty(countProperty)) {\n qs[countProperty] += 1;\n } else {\n qs[countProperty] = 0;\n }\n\n var outputPage = qs[countProperty];\n\n if (writeType === 'GnipPage') {\n outputPage = output.pageNumber;\n }\n\n var fs = require('fs'),\n mkdirp = require('mkdirp'),\n folder = outputRoot + qs.id + '/' + writeType,\n filename = folder + '/' + outputPage + '.json';\n\n if (!fs.existsSync(folder)) {\n mkdirp.sync(folder);\n }\n\n fs.writeFile(filename, JSON.stringify(output, null, \" \"), function(err) {\n if (!err) {\n console.log('Wrote output to ' + filename);\n // qs.writtenOutputToFile = true;\n } else {\n console.error('Failed to write output to ' + filename);\n console.error(err);\n // qs.writtenOutputToFile = false;\n }\n });\n }\n }\n}", "async _writeToOutput() {\n\t\tif (this.output === 'console') {\n\t\t\tconsole.log(JSON.stringify(this.profile));\n\t\t\treturn;\n\t\t}\n\t\tif (!await existsAsync('dist/')) {\n\t\t\tawait mkdirAsync('dist/');\n\t\t}\n\t\tif (this.output === 'yaml') {\n\t\t\treturn writeYamlAsync(`dist/${this.targetUsername}.yml`, this.profile);\n\t\t}\n\t\treturn writeFileAsync(\n\t\t\t\t`dist/${this.targetUsername}.json`,\n\t\t\t\tJSON.stringify(this.profile, null, 2)\n\t\t);\n\t}", "addOutput() {\n const { conf } = this;\n const output = conf.getVal('output');\n const dir = path.dirname(output);\n fs.ensureDir(dir);\n this.command.output(output);\n }", "function checkOutput(output) {\n if (!output) {\n let ext = path.extname(inputFile);\n output = path.join(path.dirname(inputFile), path.basename(inputFile, ext) + MARKDOWN_EXTENSION);\n }\n output = path.resolve(process.cwd(), output);\n\n fs.stat(output, (err, stats) => {\n if (err) {\n outputFile = output;\n run();\n return;\n }\n if (stats.isDirectory()) {\n outputFile = path.join(output, DEFAULT_OUTPUT_FILENAME);\n run();\n return;\n }\n outputFile = output;\n run();\n });\n}", "function parseJunitResult(junitOutputFile, result, done) {\n async.map(junitOutputFile, arrayOfXmlReports, function(err, stdOUT){\n if(err) {\n done(err)\n return;\n }\n result.stdout = stdOUT;\n done(null, result);\n })\n}", "writeOutputToDestonation() {\n const outputPath = path.join(config.output.path, config.output.name);\n\n this.verboseLog(`Write the output into '${outputPath}'`);\n\n fs.writeFileSync(outputPath, JSON.stringify(this.output, null, 2), 'utf-8');\n }", "function outputAndLog(commend) {\n appendToFile(commend);\n console.log(commend);\n}", "output(outputFile = null) {\n\t\t// -----------------------------------------\n\t\tvar outputFileExt, outputDir, subOutputDir, src;\n\t\tif (outputFile) {\n\t\t\tif (!Path.isAbsolute(outputFile)) {\n\t\t\t\toutputFile = Path.resolve(this.baseDir, outputFile);\n\t\t\t}\n\t\t\tif (outputFileExt = Path.extname(outputFile)) {\n\t\t\t\toutputDir = Path.dirname(outputFile);\n\t\t\t} else {\n\t\t\t\toutputDir = Path.join(outputFile, this.name);\n\t\t\t}\n\t\t}\n\t\t// -----------------------------------------\n\t\tvar subBundles = Object.keys(this.outline);\n\t\tvar totalSubBundles = subBundles.length;\n\t\tvar t = \"\\t\".repeat(this.params.indentation + 1), t2 = \"\\t\".repeat(this.params.indentation);\n\t\tvar contents = \"\\r\\n\" + t + this.bundle.map(html => {\n\t\t\tif (html instanceof Bundler) {\n\t\t\t\tvar templateHTML = html.output(outputDir);\n\t\t\t\tif (this.params.CREATE_OUTLINE_FILE) {\n\t\t\t\t\ttemplateHTML = this.params.defineAttribute(templateHTML, 'prev', _preceding(subBundles, html.displayName) || '');\n\t\t\t\t\ttemplateHTML = this.params.defineAttribute(templateHTML, 'index', (subBundles.indexOf(html.displayName) + 1) + '/' + totalSubBundles);\n\t\t\t\t\ttemplateHTML = this.params.defineAttribute(templateHTML, 'next', _following(subBundles, html.displayName) || '');\n\t\t\t\t}\n\t\t\t\treturn templateHTML;\n\t\t\t}\n\t\t\treturn _isFunction(html) ? html(outputDir) : html;\n\t\t}).join(\"\\r\\n\\r\\n\" + t) + \"\\r\\n\" + t2;\n\t\tif (this.outlineHTML) {\n\t\t\tcontents += \"\\r\\n\" + t + this.outlineHTML + \"\\r\\n\" + t2;\n\t\t}\n\t\t// -----------------------------------------\n\t\tif (outputFileExt) {\n\t\t\tFs.mkdirSync(outputDir, {recursive:true});\n\t\t\tFs.writeFileSync(outputFile, contents);\n\t\t\tif (this.params.CREATE_OUTLINE_FILE) {\n\t\t\t\tvar outlineFile = _beforeLast(outputFile, '.') + '.json';\n\t\t\t\tvar outline = {outline: this.outline};\n\t\t\t\tif (Fs.existsSync(outlineFile)) {\n\t\t\t\t\toutline = _merge({}, outline, JSON.parse(Fs.readFileSync(outlineFile)));\n\t\t\t\t}\n\t\t\t\tFs.writeFileSync(outlineFile, JSON.stringify(outline, null, 4));\n\t\t\t}\n\t\t\tsrc = getPublicFilename(outputFile, this.params.indentation);\n\t\t}\n\t\t// -----------------------------------------\n\t\treturn `<template${\n\t\t\t\t(this.name ? ' ' + this.params.TEMPLATE_NAMESPACE_ATTR + '=\"' + this.displayName + '\"' : '') + (src ? ' src=\"' + src + '\"' : '')\n\t\t\t}>${(!src ? contents : '')}</template>`;\n\t}", "function formatOutput(output) {\n var indent = ' ';\n var pad = ' ';\n var results = [];\n results.push('AppDir:' + output.appDir);\n output.suites.forEach(function (suite) {\n results.push(pad + 'Suite: ' + suite.description + ' -- ' + suite.status);\n pad += indent;\n suite.specs.forEach(function (spec) {\n results.push(pad + spec.status + ' - ' + spec.description);\n if (spec.failedExpectations) {\n pad += indent;\n spec.failedExpectations.forEach(function (fe) {\n results.push(pad + 'message: ' + fe.message);\n });\n pad = pad.substr(2);\n }\n });\n pad = pad.substr(2);\n results.push('');\n });\n results.push('');\n return results.join('\\n');\n }", "function writeOutput(output){\n var now = new Date();\n var file_name = 'files/'+'Employee-table-' + now.getFullYear()+(now.getMonth()+1)+now.getDate()+now.getHours()+now.getMinutes()+now.getSeconds() +'.json';\n fs.writeFile(file_name,output,function(err){\n if(err){\n return console.log(err);\n } \n })\n}", "async S91_finalTestResultOutput() {\n\t\t\n\t\t// Prepare the final result msg\n\t\tlet resultMsg = [\n\t\t\t\"----------------------------------------\",\n\t\t\t\">\",\n\t\t\t`> Test result: ${this.finalTestStatus}`,\n\t\t\t\">\"\n\t\t];\n\n\t\t// Get the test time taken (from CLI point of view)\n\t\tlet startTimeMS = this._startTimeMS;\n\t\tlet timeTakenMS = Date.now() - this._startTimeMS;\n\n\t\t// Inject the various URL links\n\t\tif( !this.assumeOnPremise ) {\n\t\t\t// Into the result message\n\t\t\tif( this.testCodeDir == null ) {\n\t\t\t\tresultMsg.push(`> See full results at : ${this.webstudioURL}/project/${this.projectID}/editor/${this.uriEncodedScriptPath}?testRunId=${this.testID}`)\n\t\t\t}\n\t\t\tresultMsg.push(`> See result snippet at : ${this.privateSnippetURL}/${this.testID}`)\n\t\t\tresultMsg.push(\">\")\n\n\t\t\t// Or json\n\t\t\tthis.jsonOutputObj.webstudioURL = `${this.webstudioURL}/project/${this.projectID}/editor/${this.uriEncodedScriptPath}?testRunId=${this.testID}`;\n\t\t\tthis.jsonOutputObj.snippetURL = `${this.privateSnippetURL}/${this.testID}`;\n\t\t} else {\n\t\t\t\n\t\t\t// This is the on-premise version !!!\n\n\t\t\t// Into the result message\n\t\t\tif( this.testCodeDir == null ) {\n\t\t\t\tresultMsg.push(`> See full results at : ${this.webstudioURL}/project/${this.projectID}/editor/${this.uriEncodedScriptPath}?testRunId=${this.testID}`)\n\t\t\t}\n\t\t\tresultMsg.push(\">\")\n\n\t\t\t// Or json\n\t\t\tthis.jsonOutputObj.webstudioURL = `${this.webstudioURL}/project/${this.projectID}/editor/${this.uriEncodedScriptPath}?testRunId=${this.testID}`;\n\t\t}\n\n\t\t// Lets add in the CLI debugging information\n\t\tthis.jsonOutputObj._cli = this.jsonOutputObj._cli || {};\n\t\tthis.jsonOutputObj._cli.testTimeTaken_ms = timeTakenMS;\n\t\tthis.jsonOutputObj._cli.firstStepTimeTaken_ms = this._firstStepTimeTakenMS;\n\n\t\t// Handle JSON output\n\t\tOutputHandler.json( this.jsonOutputObj )\n\n\t\t// Output final command status, and exit\n\t\tif( this.finalTestStatus == \"success\" ) {\n\t\t\tOutputHandler.standardGreen( resultMsg.join(\"\\n\") )\n\t\t\tprocess.exit(0)\n\t\t} else {\n\t\t\tOutputHandler.standardRed( resultMsg.join(\"\\n\") )\n\t\t\tprocess.exit(14)\n\t\t}\n\t}", "function withOutfile(output, cb) {\n /* stdout */\n if (!output) {\n cb(null, process.stdout.fd);\n } else {\n fs.open(output, 'w', (err, fd) => {\n if (err) {\n console.error('ERROR: could not open output file for writing.');\n console.error(err);\n process.exit(1);\n }\n cb(null, fd);\n });\n }\n}", "function done(done, output) {\n\n var lines = output.split('\\n');\n var bundle = lines[1];\n lines.splice(0, 3);\n lines.pop();\n\n // Remove empty: pattern resources added by Less build.\n lines = lines.filter(function(line) {\n return line.indexOf(\"empty:\") === -1;\n });\n\n if(endsWith(bundle, desktopBase)) {\n desktopBaseFiles = lines;\n } else if(endsWith(bundle, phoneBase)) {\n phoneBaseFiles = lines;\n } else if(endsWith(bundle, desktopUI)) {\n checkDuplicates(desktopBaseFiles, lines, bundle);\n } else if(endsWith(bundle, phoneUI)) {\n checkDuplicates(phoneBaseFiles, lines, bundle);\n }\n\n lines = lines.map(function(line) {\n return path.normalize(line.replace(\"require-style!\", \"\"));\n });\n\n lines.forEach(function(line) {\n if(realFileNames.indexOf(line) === -1) {\n grunt.fail.warn(\"Source file in build is not in filesystem:\" + line + \". Check casing of filename.\");\n }\n });\n\n done();\n }", "function logOutputToTxtFile(output) {\n // append the output from the search to the log.txt file\n fs.appendFile('log.txt', output, function(err) {\n if (err) {\n console.log(err)\n } else { // If no error is experienced, display success message to node console.\n console.log('Content added to log!')\n }\n })\n}", "function createOutput(json: SwaggerInput) {\n\n switch (options.outputType) {\n case OutputTypes.Single: {\n // tslint:disable-next-line\n return console.log(createDefs(json, options));\n }\n case OutputTypes.Multi: {\n const res = createSplitDefs(json, options);\n const defOutput = join(options.outDir, res.definitions[0].displayName);\n\n res.modules.concat(res.definitions).forEach((item) => {\n outputFileSync(join(options.outDir, item.displayName), item.content);\n });\n // tslint:disable-next-line\n console.log(`${res.modules.length} module(s) written to '${options.outDir}'`);\n // tslint:disable-next-line\n console.log(`1 definition file written to '${defOutput}'`);\n\n break;\n }\n default: {\n // tslint:disable-next-line\n return console.error(\"Output type not supported\");\n }\n }\n}", "function writeResultsToo(aTestcases) { \n var tc = 0; \n var output = \"no output\";\n var numtc = aTestcases.length; \n var failed = false; \n\n output = '<tbody><tr><td rowspan='+ numtc + '>' + aTestcases[tc].filename; \n \n // Iterates through Tests writing the Test Result \n for (tc=0; tc < numtc; tc++) { \n failed = (!aTestcases[tc].result); \n\n output = output + '<TR><TD' + ((failed)?' bgcolor=red':'') +'>' + aTestcases[tc].testcase; \n\n // Writes Bug number for Failed Tests \n if (failed) { \n output = output + '<TD bgcolor=red>failed<TD>' + aTestcases[tc].bug; \n output = output + '<TD>' + aTestcases[tc].actual; \n } else { \n output = output + \"<TD colspan=3>passed\"; \n } \n } \n output = output + '</tbody>'; \n}", "function outputTeam() {\n // if output dir doesnt exist, create one\n if (!fs.existsSync(OUTPUT_DIR)) {\n fs.mkdirSync(OUTPUT_DIR)\n }\n // write fullteam array to outputPath variable\n fs.writeFileSync(outputPath, render(fullTeam), \"utf-8\");\n}", "function enableConsoleOutput() {\n outputToConsoleWhenRequired = true;\n}", "function write_output(data, output, config, projectConfig, debug) {\n\tif (debug == undefined) debug = false;\n\t\n\tif(data == null)\n\t \tif (debug) console.log('skipping output' + output.id + ' since data was null');\n\telse \n\t\tif (debug) console.log('writing output to ' + output.id + ' :: ' + data);\n\t\n\tif (output.type == \"MQTT\") { //send the data back to an MQTT channel - this could realistically be used with MQTT component instead of subprocess.\n \t if (debug) console.log('publishing \"' + data + '\" to MQTT address: ' + config.MQTTBrokerAddress + ':' + \n\t\t\t\tconfig.MQTTBrokerPort + projectConfig.projectname + '/' + output.address);\n\t var pub = require('child_process').spawn,\n //mqttpub = pub('mosquitto_pub-0.10.2.exe', ['-h', 'summer.ceit.uq.edu.au', '-t', config.projectname + '/' + tgt.address, '-m', data]);\n\t\tmqttpub = pub('mosquitto_pub', ['-h', 'summer.ceit.uq.edu.au', '-t', projectConfig.projectname + '/' + output.address, '-m', data]);\n mqttpub.stdin.end();\n } else if (output.type == \"TCP\") { //tcp socket send data, discard anything sent back.\n var socket = new net.Socket();\n if(debug) console.log('publishing \"' + data + '\" to TCP address: ' + output.address + ':' + output.port);\n\t\tsocket.connect(output.port, output.address, function () {\n socket.setEncoding(\"utf8\");\n socket.write(data);\n socket.end();\n });\n } else if (output.type == \"DATAPOINT\") { //write to mysql table https://github.com/felixge/node-mysql/blob/master/Readme.md\n\t\tvar dataPointWritten = false;\n\t\tfor(datapointID in projectConfig.datapoints){\n\t\t\tif(output.datapoint == projectConfig.datapoints[datapointID].id){\n\t\t\t\tvar datapoint = projectConfig.datapoints[datapointID];\n\t\t\t\tvar insertstring = format_sql_string(output.table, output.columns, data);\n\t\t\t\tif(insertstring == -1) {\n\t\t\t\t\tconsole.error('error in DB defintion for transformation: ' + output.id);\n\t\t\t\t} else {\n\t\t\t var mysql = require('mysql');\n\t\t\t\t\tvar client = mysql.createClient({\n\t\t\t\t\t host: datapoint.address,\n\t\t\t\t\t user: datapoint.username,\n\t\t\t\t\t password: datapoint.password,\n\t\t\t\t\t database: datapoint.database\n\t\t\t\t\t});\n\t\t\t\t\tif (debug) console.log(insertstring);\t\t\t\n\t\t\t client.query(insertstring, function selectCb(err, results, fields) {\n\t\t\t if (err) console.error(err);\n\t\t\t client.end();\n\t\t\t });\t\t\t\n\t\t\t\t}\n\t\t\t\tdataPointWritten = true;\n\t\t\t}\n\t\t}\n\t\tif(!dataPointWritten) console.error('Missing datapoint configuration for ' + output.datapoint);\n\t\t\n } else if (output.type == \"WEBSOCKET\") {\n\t\tif(debug) console.log(websocketOutputs);\n\t\tfor (wsid in websocketOutputs[output.address]) {\n\t\t\twebsocketOutputs[output.address][wsid].write(data.toString());\n }\n } else {\n console.error(\"undefined output type:\" + output.type + ' Assigned to output:' + output.id);\n }\n}", "getOutputPath() {\n return path.format({\n dir:this.options.output,\n name:'.timelapseCache'\n });\n }", "function onDataOutput() {\n if (!opts.outputDir) {\n return;\n }\n\n if (opts.interactive) {\n console.log('\\n\\n\\n');\n }\n\n var dir = path.resolve(opts.outputDir);\n console.log('Demo app generated in ' + dir + '. To run:');\n console.log('cd ' + dir);\n console.log('npm install');\n console.log('npm start');\n console.log();\n console.log('Then point your browser at http://localhost:3000');\n}", "function writeResults(aTestcases) {\n var tc = 0;\n var output = \"\"; //why initialize\n//document.domain = \"mcom.com\";\n//added by stummala to get suitename when running all suites...\n//for forms u can see this in /cgi-bin/forms2.cgi\n if (aTestcases[tc].filename == \"catt001.html\") {\n \t output = '<A NAME=\"dom-core\"><H1> DOM CORE/HTML </H1>';\n }\n else if (aTestcases[tc].filename == \"dhtml001.html\") {\n \t output = '<A NAME=\"dhtml\"><H1> DHTML </H1>';\n }\n else if (aTestcases[tc].filename == \"sc2p000.html\") {\n \t output = '<A NAME=\"domcss\"><H1> DOM CSS </H1>';\n }\n else if (aTestcases[tc].filename == \"areanode.html\") {\n \t output = '<A NAME=\"inhr\"><H1> INHERITANCE </H1>';\n }\n else if (aTestcases[tc].filename == \"are001.html\") {\n \t output = '<A NAME=\"javascript\"><H1> JAVASCRIPT </H1>';\n }\n \n // Writes Test Filename and Creates Table\n output = output + '<H3>' + aTestcases[tc].filename + '</H3>' + '<TABLE BORDER=1>\\n <TBODY>\\n';\n \n // Writes Header\n output = output + ' <TR><TD><B>Description</B></TD>\\n <TD><B>Pass</B></TD>\\n ' +\n '<TD><B>Bug Number</B></TD>\\n <TD><B>Actual Result</B></TD>';\n if (top.name != \"testWindow\") {\n\t output += '\\n <TD><B>Expected Result</B></TD>';\n }\n output +='\\n </TR>\\n';\n\n // Iterates through Tests writing the Test Result\n for (tc=0; tc < aTestcases.length; tc++) {\n failed = (!aTestcases[tc].result);\n\n output += (' <TR>\\n <TD' + ((failed)?' bgcolor=red style=\"color:white;\"':'') +'>' + aTestcases[tc].testcase );\n\n // Writes Bug number for Failed Tests\n if (failed) {\n output += ('\\n <TD bgcolor=red style=\"color:white;\">failed');\n output += ('\\n <TD bgcolor=red style=\"color:white;\">' + aTestcases[tc].bug);\n output += ('\\n <TD bgcolor=red style=\"color:white;\">' + aTestcases[tc].actual);\n } else {\n output += (\"\\n <TD colspan=2>passed\");\n output += ('\\n <TD>' + aTestcases[tc].actual);\n }\n if (top.name != \"testWindow\") {\n output += ('\\n <TD>' + aTestcases[tc].expected);\n }\n output += ('\\n </TR>\\n');\n }\n\n output = output + ' </TBODY>\\n</TABLE>\\n\\n';\n document.results.textarea.value = output;\n\n\n if (top.name == \"testWindow\") {\n// document.results.submit(); submit() moved to BODY, it's failing here\n }\n else {\n document.write(document.results.textarea.value);\n //dump(document.results.textarea.value);\n }\n}", "function fSetWriters() {\n wsMain = fs.createWriteStream(sResultDir + '/main.csv');\n wsErrorLog = fs.createWriteStream(sResultDir + '/errors.txt');\n}", "_stdout(toggle) {\n try {\n const outputs = ['stdout', 'stderr'];\n if (toggle) {\n if (this.stdmocks)\n return;\n this.stdmockOrigs = {\n stdout: process.stdout.write,\n stderr: process.stderr.write,\n };\n this.stdmocks = [];\n for (let std of outputs) {\n process[std].write = (...args) => {\n this.stdmocks.push([std, args]);\n };\n }\n }\n else {\n if (!this.stdmocks)\n return;\n // this._write('stderr', '\\nresetstdmock\\n\\n\\n')\n delete this.stdmocks;\n for (let std of outputs)\n process[std].write = this.stdmockOrigs[std];\n }\n }\n catch (err) {\n this._write('stderr', util_1.inspect(err));\n }\n }", "function output(content, options) {\n if (options.output) {\n return fs.writeFile(options.output, content, utf8);\n } else {\n console.log(content);\n return Promise.resolve();\n }\n}", "function handleOutput(text, out) {\n if (out) {\n fs.writeFile(out, text, 'utf8', function(err) {\n if (err) {\n console.log(`Error writing to ${out}: ${err}`);\n process.exit(1);\n }\n });\n } else {\n console.log(text);\n }\n}", "function ready(response) {\n switch (args.named[\"--output\"]) {\n case \"stat\":\n console.log(response.status);\n break;\n case \"head\":\n console.log(response.statusLine);\n console.log(response.getHeaderString());\n break;\n case \"headers\":\n console.log(response.getHeaderString());\n break;\n case \"body\":\n if (response.data) console.log(response.data);\n break;\n case \"status\":\n console.log(response.statusLine);\n break;\n case \"full\":\n console.log(response.statusLine);\n console.log(response.getHeaderString());\n if (response.data) console.log(response.data);\n break;\n case \"auto\":\n case false:\n if (response.data) console.log(response.data);\n else {\n console.log(response.statusLine);\n console.log(response.getHeaderString());\n }\n break;\n default:\n throw new Error(\"unrecognized out format \" + args.named[\"-o\"]);\n }\n }", "_createOutStream() {\n if (!this.hasStream) {\n const {\n output\n } = this.options;\n\n if (output === undefined || output === null) return;\n\n if (typeof output === \"string\")\n this._outStream = fs.createWriteStream(output, {\n flags: \"w\"\n });\n else if (typeof output.write === \"function\")\n // we assume output is a WriteStream instance\n this._outStream = output;\n else\n throw new Error(\n \"Output must be a string or an instance of WriteStream.\"\n );\n }\n }", "function stdout$1(context, file, fileSet, next) {\n if (!file.data.unifiedEngineGiven) {\n debug$3('Ignoring programmatically added file');\n next();\n } else if (stats$1(file).fatal || context.output || !context.out) {\n debug$3('Ignoring writing to `streamOut`');\n next();\n } else {\n debug$3('Writing document to `streamOut`');\n context.streamOut.write(file.toString(), next);\n }\n}", "function end_message(urls,responses){\n grunt.log.ok(\"Parsed: \"+responses.length+\"/\"+urls.length);\n\n if( urls.length !== responses.length ){\n grunt.log.error(\"report bug to\");\n grunt.log.error(\"https://github.com/maboiteaspam/phantomizer-yslow/issues\");\n grunt.fail.warn(\"could not parse correctly yslow output\");\n }\n }", "async S02_outputSetupParams() {\n\t\t// Log project name + id\n\t\tOutputHandler.standardGreen([\n\t\t\t`> Project Name: ${this.projectObj.name}`,\n\t\t\t`> Project ID: ${this.projectObj._oid}`,\n\t\t\t`> Browser: ${this.browser}`,\n\t\t\t`> Region: ${this.region}`,\n\t\t\t`> Resolution: ${this.width}x${this.height}`,\n\t\t\t`> Script Path: ${this.normalizedScriptPath}`,\n\t\t].join(\"\\n\"))\n\n\t\t// Log the data set if its present\n\t\tif( this.dataSet != null ) {\n\t\t\tOutputHandler.standardGreen(\n\t\t\t\t`> Data Set: ${this.dataSet}`\n\t\t\t)\n\t\t}\n\t\t// Log the test dir if present\n\t\tif( this.testCodeDir != null ) {\n\t\t\tOutputHandler.standardGreen(\n\t\t\t\t`> Test Dir: ${this.testCodeDir}`\n\t\t\t)\n\t\t}\n\t\t// Custom UA\n\t\tif( this.userAgent != null ) {\n\t\t\tOutputHandler.standardGreen(\n\t\t\t\t`> User Agent: ${this.userAgent}`\n\t\t\t)\n\t\t}\n\t\tOutputHandler.standardGreen(\">\")\n\t}", "function reportResults() {\n console.log(\"\\n\\n|---------------- RESULTS ---------------|\");\n var prettyTable = [];\n var plainText = '';\n for (var t in mTests) {\n var reportingTest = mTests[t];\n if (reportingTest.mResult == 'pass'){\n prettyTable.push([chalk.yellow(reportingTest.mName) + \": \\t\\t\", chalk.green.bold(reportingTest.mResult)]);\n }else{\n prettyTable.push([chalk.yellow(reportingTest.mName) + \": \\t\\t\", chalk.red.bold(reportingTest.mResult)]);\n }\n plainText += reportingTest.mName + \": \\t\\t\" + reportingTest.mResult + \"\\n\";\n\n for (var i in reportingTest.mInstructions) {\n var reportingInstruction = reportingTest.mInstructions[i];\n\n plainText += '\\t' + \"- \" + reportingInstruction.name + '\\t\\t' + reportingInstruction.result + '\\n';\n if (reportingInstruction.result == 'pass')\n prettyTable.push(['\\t' + \"- \" + reportingInstruction.name, chalk.green(reportingInstruction.result)]);\n else\n prettyTable.push(['\\t' + \"- \" + reportingInstruction.name, chalk.red(reportingInstruction.result)]);\n }\n }\n\n // console.log(plainText);\n\n fs.writeFileSync('./logs/test-results'+Date.now()+'.log', plainText, 'utf8');\n\n console.log(table(prettyTable));\n console.log(\"Exiting...\");\n process.exit();\n }", "function sc_withOutputToFile(s, thunk) {\n throw \"can't open \" + s;\n}", "setResultsDir() {\n const { reporterOptions } = this.options;\n if (reporterOptions && reporterOptions.outputDir) {\n this.resultsDir = reporterOptions.outputDir;\n } else {\n let testDir = 'tests';\n if (fs.existsSync(path.join(process.cwd(), 'test'))) {\n testDir = 'test';\n }\n this.resultsDir = path.join(process.cwd(), testDir, 'wdio', 'reports');\n }\n }", "function tapToCsv (inputFilePath, outputFilePath) {\n var testCases = getTestCases(inputFilePath);\n saveToCsv(outputFilePath, testCases);\n}", "writeLog( outputText ) {\n\t\tlet logName = this.getLogName();\n\n\t\tfs.writeFile( `${process.cwd()}/${logName}`, outputText, ( err ) => {\n\t\t\tif ( err ) {\n\t\t\t\tconsole.error( 'Whoops! Something went wrong!' );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconsole.log( `Successfully created: ${logName}` );\n\t\t} );\n\t}", "function createXMLFile()\n{\n\tvar currentURLToBeWritten, currentListOfOutGoingLinks = new Array(); \n\t\n\tfor (var i=0; i<allTheLinksToBeReported.length; i++)\n\t{\n\t\tcurrentURLToBeWritten = allTheLinksToBeReported[i].URL.toString();\n\t\tcurrentListOfOutGoingLinks = allTheLinksToBeReported[i].LINKS;\n\t\tfs.write('finalResult', 'mainPage @@' + currentURLToBeWritten + \"\\n\", 'a');\n\n\t\tfor (var j=0; j<currentListOfOutGoingLinks.length; j++)\n\t\t\tfs.write('finalResult', 'outGoingLinks @@' + currentListOfOutGoingLinks[j] + \"\\n\", 'a');\n\n\t\tfs.write('finalResult', \"\\n\", 'a');\n\t}\n}", "function showTestOutput() {\n testOutputChannel.show(true);\n}", "saveAsOneFile() {\r\n // HTML exportation\r\n this.saveFile('index', 'HTML', this.content)\r\n // We show the export result\r\n setTimeout(this.showOutput, 2500)\r\n }", "runnerEnd(runner) {\n const specData = this.moduleName ? this.specHashData[this.moduleName] : this.specHashData;\n Object.values(specData).forEach((spec) => {\n const revSpecs = Object.values(spec);\n revSpecs.forEach((test, i) => {\n if (test.parent === test.title) {\n const { title, parent, ...rest } = revSpecs[i];\n revSpecs[i] = {\n title,\n spec: runner.specs[0],\n ...rest,\n };\n }\n if (test.parent !== test.title) {\n const parentIndex = revSpecs.findIndex(\n (item) => item.title === test.parent,\n );\n\n if (parentIndex > -1) {\n if (!revSpecs[parentIndex].suites) {\n revSpecs[parentIndex].suites = [];\n }\n revSpecs[parentIndex].suites.push(test);\n // eslint-disable-next-line no-param-reassign\n delete test.parent;\n }\n }\n // eslint-disable-next-line no-param-reassign\n delete test.parent;\n });\n if (this.moduleName) {\n const filePathLocation = path.join(\n this.resultsDir,\n `${this.fileName}.json`,\n );\n this.resultJsonObject.specs[this.moduleName] = revSpecs.shift();\n this.writToFile(this.resultJsonObject.specs[this.moduleName], filePathLocation);\n } else {\n this.nonMonoRepoResult.push(revSpecs.shift());\n }\n });\n if (!this.moduleName) {\n this.resultJsonObject.specs = this.nonMonoRepoResult;\n const filePathLocation = path.join(\n this.resultsDir,\n `${this.fileName}.json`,\n );\n this.writToFile(this.resultJsonObject, filePathLocation);\n }\n this.screenshots = [];\n this.specHashData = {};\n }", "function output(outputStr) {\r\n console.log(outputStr);\r\n}", "function output(outputStr) {\r\n console.log(outputStr);\r\n}", "function appendOutput(){\n fs.appendFile(\"log.txt\", displayForLog, function(err) {\n\n // If an error was experienced we will log it.\n if (err) {\n console.log(err);\n }\n \n // If no error is experienced, we'll log this phrase to our node console.\n else {\n console.log(\"Output Added To log.txt\");\n }\n \n });\n}", "async function runMyProccess() {\n const fs = require(\"fs\");\n\n let buf = fs.readFileSync(\"resource/source.xml\", {\n encoding: \"utf8\",\n flag: \"r\",\n });\n const matches = buf\n .toString()\n .match(/(href=\")([^\"]*)(\")/g)\n .map(\n (cStr) => `${BASEURL}/${cStr.replace(/^href=\"/, \"\").replace(/\"/, \"\")}`\n );\n const textResult = matches.reduce(\n (str, cStr) => str + (str ? \"\\r\" : \"\") + cStr,\n \"\"\n );\n if(!fs.existsSync(\"output\")) {\n fs.mkdirSync(\"output\");\n }\n if(!fs.existsSync(outputFolder)) {\n fs.mkdirSync(outputFolder);\n }\n if(!fs.existsSync(outputFolderJSON)) {\n fs.mkdirSync(outputFolderJSON);\n }\n if(!fs.existsSync(outputFolderTEXT)) {\n fs.mkdirSync(outputFolderTEXT);\n }\n fs.writeFileSync(outputLinksTEXT, textResult, (err) => {\n if (err) console.log(err);\n console.log(\"Result text doc links saved!\");\n });\n fs.writeFileSync(\n outputLinksJSON,\n JSON.stringify({ matches }),\n async (err) => {\n if (err) {\n console.log(`NotOk: ${outputLinksJSON}, ${JSON.stringify({ err })}`);\n exit();\n }\n console.log(`Json saved!`);\n }\n );\n await downloadHtml();\n await htmlToPdf();\n exit(\"\\n ok\");\n}", "function output(arr) {\n\tarr = outpfx.concat(arr);\n if (SAVEDATA) psiTurk.recordTrialData(arr);\n if (LOGGING) console.log(arr.join(\" \"));\n}", "function setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));\n }\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));\n}", "function setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));\n }\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));\n}", "function setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));\n }\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));\n}", "function setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));\n }\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));\n}", "function setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));\n }\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));\n}", "function setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));\n }\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));\n}", "function setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));\n }\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));\n}", "function arrayOfXmlReports(junitOutputFile, done){\n async.waterfall([\n fs.readFile.bind(null, junitOutputFile),\n convertJunitXmlToJson\n ], (err, result) => {\n done(null, result);\n });\n}", "function outputSummaryReport(cli, phaseResultsFormatted) {\n cli.log(`\\n${utils_1.chalkScheme.blackBgBlue(` ${utils_1.chalkScheme.white('Benchmark Results Summary')} `)}`);\n cli.log(`\\n${chalk_1.default.red('Red')} color means there was a regression.`);\n cli.log(`${chalk_1.default.green('Green')} color means there was an improvement.\\n`);\n phaseResultsFormatted.forEach(phaseData => {\n const { phase, hlDiff, isSignificant, ciMin, ciMax } = phaseData;\n let msg = `${chalk_1.default.bold(phase)} phase `;\n if (isSignificant && Math.abs(hlDiff)) {\n let coloredDiff;\n msg += 'estimated difference ';\n if (hlDiff < 0) {\n coloredDiff = chalk_1.default.red(`+${Math.abs(hlDiff)}ms [${ciMax * -1}ms to ${ciMin * -1}ms]`);\n }\n else {\n coloredDiff = chalk_1.default.green(`-${Math.abs(hlDiff)}ms [${ciMax * -1}ms to ${ciMin * -1}ms]`);\n }\n msg += `${coloredDiff}`;\n }\n else {\n msg += `${chalk_1.default.grey('no difference')}`;\n }\n cli.log(msg);\n });\n}", "async function compareOutput(x) {\n const filesToTest = [];\n const testFolder = 'tests/ui-tests';\n fs.readdirSync(testFolder).forEach(file => {\n const curPath = path.join(testFolder, file);\n if (fs.lstatSync(curPath).isDirectory() || !curPath.endsWith('.goml')) {\n return;\n }\n filesToTest.push(curPath.toString());\n });\n\n const cpuCount = os.cpus().length / 2 + 1;\n process.setMaxListeners(cpuCount);\n const tests_queue = [];\n const browser = await utils.loadPuppeteer(new Options());\n\n for (const file of filesToTest) {\n const outputFile = file.replace('.goml', '.output');\n let output;\n\n try {\n output = fs.readFileSync(outputFile, 'utf8');\n } catch (_) {\n output = `Cannot open file \\`${outputFile}\\``;\n }\n\n runAsyncUiTest(x, file, output, tests_queue, browser);\n if (tests_queue.length >= cpuCount) {\n await Promise.race(tests_queue);\n }\n }\n if (tests_queue.length > 0) {\n await Promise.all(tests_queue);\n }\n await browser.close();\n}", "addOutputOptions() {\n const { conf, creator } = this;\n const outputOptions = [];\n // default\n const defaultOpts = this.getDefaultOutputOptions(conf);\n FFmpegUtil.concatOpts(outputOptions, defaultOpts);\n\n // audio\n const audio = conf.getVal('audio');\n if (!isEmpty(audio)) {\n let apro = '';\n if (ScenesUtil.hasTransition(creator)) {\n const index = ScenesUtil.getLength(creator);\n apro += `-map ${index}:a `;\n }\n\n FFmpegUtil.concatOpts(outputOptions, `${apro}-c:a aac -shortest`.split(' '));\n }\n this.command.outputOptions(outputOptions);\n }", "function logOutPut() {\n fs.appendFile(\"log.txt\", dataOutPut, function (err) {\n if (err) {\n console.log(err);\n } else {\n if (commandRequest !== \"my-tweets\")\n console.log(dataOutPut);\n }\n });\n}", "write (json) {\n if (!this.options || typeof this.options.outputDir !== 'string') {\n return console.log(`Cannot write json report: empty or invalid 'outputDir'.`)\n }\n\n try {\n const dir = path.resolve(this.options.outputDir)\n const filename = this.options.mochawesome_filename ? this.options.mochawesome_filename : 'wdiomochawesome.json'\n const filepath = path.join(dir, filename)\n mkdirp.sync(dir)\n fs.writeFileSync(filepath, JSON.stringify(json))\n console.log(`Wrote json report to [${this.options.outputDir}].`)\n } catch (e) {\n console.log(`Failed to write json report to [${this.options.outputDir}]. Error: ${e}`)\n }\n }", "function report_writeReport()\n//\n// Input: none\n// Output: none\n// Purpose: writes simulation results to report file.\n//\n{\n if ( ErrorCode ) return;\n if ( Nperiods == 0 ) return;\n if ( RptFlags.subcatchments != NONE\n && ( IgnoreRainfall == FALSE ||\n IgnoreSnowmelt == FALSE ||\n IgnoreGwater == FALSE)\n ) report_Subcatchments();\n\n if ( IgnoreRouting == TRUE && IgnoreQuality == TRUE ) return;\n if ( RptFlags.nodes != NONE ) report_Nodes();\n if ( RptFlags.links != NONE ) report_Links();\n}", "static generateReport() {\n let data = [];\n console.info(\"Processing Json Report Files\");\n let files = fs.readdirSync(intermediateJsonFilesDirectory);\n for (let i in files) {\n let f = `${intermediateJsonFilesDirectory}/${files[i]}`;\n console.log(`Processing file ${f}`);\n try {\n let fileContent = fs.readFileSync(f, 'utf-8');\n data.push(JSON.parse(fileContent)[0]);\n }catch (err) {\n if (err) {\n console.error(`Failed to process file ${f}`);\n console.error(err);\n }\n }\n }\n\n console.info(\"Writing consolidated json file\");\n try {\n fs.writeFileSync('./e2e/reports/combinedJSON/cucumber_report.json', JSON.stringify(data));\n } catch (err) {\n if (err) {\n console.error(\"Failed to generate the consolidated json file.\");\n console.error(err);\n throw err;\n }\n }\n\n console.info(\"Generating Final HTML Report\");\n try {\n reporter.generate(cucumberReporterOptions);\n } catch (err) {\n if (err) {\n console.error(\"Failed to generate the final html report\");\n console.error(err);\n throw err;\n }\n }\n }", "updateOutput(output) {\n this.output = output;\n }", "function writeTextFile(filepath, output, type) {\n\t\tif (type == 'java'){\n\t\t\tvar link = document.getElementById('downloadlinkjava');\n\t\t}else{\n\t\t\tvar link = document.getElementById('downloadlinkros');\n\t\t}\n\t\tlink.href = makeTextFile(output);\n\t\tlink.download = filepath;\n\t\tvar event = new MouseEvent('click');\n\t\tlink.dispatchEvent(event);\n}", "async write(data) {\n if (!this.options.disable) await outputJson(this.options.filepath, data);\n }", "function createAndWriteOutput(operator, resultBeforeCalc, calcNumber) {\n\tconst calcDescription = `${resultBeforeCalc} ${operator} ${calcNumber}`\n\toutputResult(currentResult, calcDescription) // from vendor file\n}", "finalizeReport(wdioConfig, shortenSeleniumUrls=true) {\n allureReportDir = path.resolve(wdioConfig.outputDir, 'allure-raw');\n\n fs\n .readdirSync(allureReportDir)\n .filter(line=>line.includes('.mp4'))\n .map(filename => allureReportDir + '/' + filename)\n .forEach((filepath) => {\n const videoFilePath = fs.readFileSync(filepath).toString(); // Contents of placeholder file is real video path\n\n do {\n sleep(100);\n } while (!fs.existsSync(videoFilePath));\n\n // Wait for video files to render\n let fileStats = fs.statSync(videoFilePath);\n let lastSize = 0;\n let videoIsReady = false;\n do {\n fileStats = fs.statSync(videoFilePath);\n videoIsReady = fileStats.size > 48 && lastSize === fileStats.size;\n lastSize = fileStats.size > 48 ? fileStats.size : 0;\n sleep(100);\n } while (fileStats.size === 48 || !videoIsReady);\n\n fs.copySync(videoFilePath, filepath);\n });\n }", "function hackathonReporter(appVersion, task, testName, domId, viewPort, device, comparisonResult) {\n try{\n fs.appendFileSync(`./test/Traditional-${appVersion}-TestResults.txt`, `Task: ${task}, Test Name: ${testName}, DOM Id: ${domId}, Browser: ${JSON.stringify(browser.capabilities.browserName)}, Viewport: ${viewPort}, Device: ${device}, Status: ${(comparisonResult ? \"Pass\" : \"Fail\")}\\n`);\n } catch (e) {\n console.log(e);\n }\n return comparisonResult;\n}", "function logResults(action, response, autoplay) {\n\n var text = action + \", \" + response + \", \" + autoplay + \"\\n\";\n\n fs.appendFile(\"log.txt\", text, function (err) {\n\n if (err) {\n console.log(\"Danger! Danger Will Robinson!\");\n }\n\n })\n}", "onFunctionReturnHandler(output, isFiles=false){\n var out = output[0];\n var err = output[1];\n var inf = output[2];\n\n // If there are no errors\n if (err.length == 0){\n // If output contains files\n if (isFiles){\n for (let i = 0; i < out.length; i++){\n this.echoFiles(out[i]);\n }\n }\n // Else contains text\n else{\n for (let i = 0; i < out.length; i++){\n this.echo(out[i]);\n }\n }\n }\n // If there are errors\n else{\n for (let i = 0; i < err.length; i++){\n this.error(err[i]);\n }\n }\n }", "function writeResults() {\n logger.trace(\"Starting to write results to file\");\n\n // A boolean to indicate if the writing is backed up\n var writeOK = true;\n\n // Loop over the rows watching for write backups\n do {\n // Now write it to the file\n writeOK = sourceStream.write(result.rows[i]['epochseconds'] + ',' +\n result.rows[i]['timestamp_utc'] + ',' + result.rows[i]['string_agg'] + '\\n');\n\n // Bump the counter\n i++;\n } while (i < numRows && writeOK);\n\n // Check to see if all the writes are done\n if (i < numRows) {\n logger.trace(\"Writing stopped at line \" + i + \" will wait for drain\");\n\n // Since not done, set up a handler to watch for the buffer to\n // drain and then start writing again\n sourceStream.once('drain', writeResults);\n } else {\n logger.info(\"All done writing to file, will end the write stream\");\n sourceStream.end();\n }\n }", "function generateSummaryOutput(result) {\n var responses = [];\n var delimiter = '';\n if (result.total > 0) {\n if (result.total === 1) {\n responses = [];\n if (result.successes) responses.push(successFmt('ok'));\n if (result.failures) responses.push(failureFmt('failed'));\n if (result.skipped) responses.push(skipFmt('skipped'));\n delimiter = ' ';\n } else {\n responses = [];\n if (result.successes) responses.push(successFmt(result.successes + ' ok'));\n if (result.failures) responses.push(failureFmt(result.failures + ' failed'));\n if (result.skipped) responses.push(skipFmt(result.skipped + ' skipped'));\n delimiter = ', ';\n }\n return responses.join(delimiter);\n }\n\n return chalk.magenta('no tests');\n }", "outputs (_outputs) {\n for (let output in _outputs) {\n this.output(output, _outputs[output]);\n }\n }", "function createAndWriteOutput(operator, resultBeforeCalc,calcNumber){\n const calDescription = `${resultBeforeCalc} ${operator} ${calcNumber}`;\n outputResult(currentResult,calDescription); // from vendor file\n \n}", "function TemplateOutput() {\n\tthis.outputQueue = [];\n}", "function writeFile(outputText) {\n //append the text passed in to the log.txt file\n fs.appendFile(\"log.txt\", outputText, function (err) {\n // if the code experiences any errors it will log the error to the console\n if (err) {\n return console.log(err);\n }\n });\n}", "function testOutput(test, ok, error, exception) {\n return function(err, mock) {\n test.equal(mock.logOk.length, ok.length, 'Wrong logOk count');\n test.equal(mock.logError.length, error.length, 'Wrong logError count');\n if (exception) {\n test.equal(err.message, exception, 'Wrong exception text');\n } else if (err) {\n test.equal(err.message, error.slice(-1), 'Wrong exception text');\n }\n while (mock.logOk.length && ok.length) {\n test.equal(mock.logOk.shift().replace(/\\(\\d+ms\\)/g, '(00ms)'), ok.shift(), 'Wrong logOk item');\n }\n while (mock.logError.length && error.length) {\n test.equal(\n mock.logError.shift()\n .replace(/\\(\\d+ms\\)/g, '(00ms)')\n .replace(/\\([^\\)]*ECONNREFUSED[^\\)]*\\)/g, '(ECONNREFUSED)')\n .replace(/\\([^\\)]*ENOENT[^\\)]*\\)/g, '(ENOENT)'),\n error.shift(),\n 'Wrong logError item');\n }\n test.done();\n };\n}", "onOutput () {}", "function writeOutput(result){\n var tempTotal = totalWrittenBytes;\n var buf = Buffer.from(JSON.stringify(result));\n fs.write(outputfile, buf, 0, buf.length, function(err, written, buffer){\n if(err){\n console.log(\"Error in writing buffer to file: \" + err);\n return;\n }\n fs.write(offsetfile, tempTotal + '\\n',\n function(err){\n if(err){\n console.log(\"Error in writing to offset file: \" + err);\n return;\n }\n totalWrittenBytes += written;\n }\n );\n\n });\n}", "_run()\n {\n var info = this._getInfoFromPackageJson()\n\n if (Tester.is(this._output, 'function')) {\n this._output('################################################')\n this._output(info.label)\n this._output(info.labelDescription)\n this._output('################################################')\n }\n\n var start = new Date()\n\n // @todo Progress bar start.\n\n this._runTestMethods()\n\n // @todo Progress bar stop.\n\n var end = new Date()\n var time = end - start\n var formatTime = time > 1000 ? (time / 1000).toFixed(1) + ' seconds' : time + ' miliseconds'\n var memoryBytes = process.memoryUsage().heapTotal\n var trace = Tester.getBacktrace(new Error(), 3)\n\n this._resultsJson = {\n info: info,\n errors: this._errors,\n ok: this._ok,\n all: this._all,\n className: this.constructor.name,\n assertionsCounter: this._assertionsCounter,\n testsCounter: this._testsCounter,\n timeMiliseconds: time,\n formatTime: formatTime,\n memoryBytes: memoryBytes,\n formatMemory: Tester.formatBytes(memoryBytes),\n from: trace\n }\n\n if (Tester.is(this._output, 'function')) {\n var arr = this._showOk === true ? this._all : this._errors\n for (let value of arr) {\n if (this._colorize === true) {\n // reverse red\n value = value.replace(/^Error:/, '\\x1b[31m\\x1b[7mError:\\x1b[0m')\n // reverse\n value = value.replace(/^Ok:/, '\\x1b[7mOk:\\x1b[0m')\n }\n this._output(value)\n }\n\n var className = this.constructor.name + ':'\n\n this._output(className)\n this._output(' - tests ' + this._testsCounter)\n this._output(' - assertions ' + this._assertionsCounter)\n this._output(' - errors ' + this._errors.length)\n this._output(' - time ' + formatTime)\n this._output(' - memory ' + Tester.formatBytes(memoryBytes))\n this._output(' - from ' + trace)\n this._output('')\n }\n }", "function postProcessing() {\n return gulp.src([\n path.join(testResultsDir, testResultFile),\n path.join(testResultsDir, coverageResultFile)\n ], {\n dot: true\n })\n .pipe(replace(__dirname, \"\"))\n .pipe(gulp.dest(testResultsDir));\n}", "function output_parser(input){\n\t\tvar basic_rule = [\"job-rules\", \"paper-rule\"];\n const T24 = [\"BA-rule\", \"primer-rule\"];\n\t\tconst T25 = [\"Enhancer-rule\"];\n var json = {};\n\n console.log(\"Name:\" + input.jobName + \" Ruleset: \" + input.ruleset);\n\n\t\t//Building output data object\n json.jobName = input.jobName;\n json.qualityMode = input.qualityMode;\n json.CoverageSize= input.maxCoverage;\n json.opticalDensity= input.opticalDensity;\n json.paperType = input.papertype;\n json.papersubType = input.papersubtype;\n json.weightgsm = input.weightgsm;\n json.finish = input.finish;\n\t\tjson.pressUnwinderBrand = input.pressUnwinderBrand;\n\t\tjson.ruleclass = input.ruleset;\n json.ruleset = new Array();\n\n\t\t//Decide what files to fire in the rules engine\n\t\tif (input.ruleset == \"T24\")\n\t\t\tbasic_rule = basic_rule.concat(T24);\n\t\telse if (input.ruleset == \"T25\")\n\t\t\tbasic_rule = basic_rule.concat(T25);\n\n json.ruleset = json.ruleset.concat(basic_rule);\n\n return json;\n}", "function addFileToOutput(output, file) {\n output.push(file);\n return output;\n }", "gatherOutput(text) {\n this.programOutput += text;\n }", "function expandFilePathInOutput(output, cwd) {\n const lines = output.split('\\n');\n for (let i = 0; i < lines.length; i++) {\n const matches = lines[i].match(/\\s*(\\S+\\.go):(\\d+):/);\n if (matches && matches[1] && !path.isAbsolute(matches[1])) {\n lines[i] = lines[i].replace(matches[1], path.join(cwd, matches[1]));\n }\n }\n return lines.join('\\n');\n}", "function expandFilePathInOutput(output, cwd) {\n const lines = output.split('\\n');\n for (let i = 0; i < lines.length; i++) {\n const matches = lines[i].match(/\\s*(\\S+\\.go):(\\d+):/);\n if (matches && matches[1] && !path.isAbsolute(matches[1])) {\n lines[i] = lines[i].replace(matches[1], path.join(cwd, matches[1]));\n }\n }\n return lines.join('\\n');\n}", "function clearOutput() {\n console.info(\"Clearing output...\")\n rimraf.sync(\"./output/*\")\n}", "function computeOutput() {\n that.config.output = {\n path: path.join(__dirname, '/dist'),\n publicPath: '/',\n filename: that.fileNames + '.js',\n chunkFilename: that.fileNames + '.js'\n };\n renderHtml();\n handleCss();\n }", "async report() {\n const { logger, db } = this[OPTIONS];\n const testedPages = await db.read('tested_pages');\n\n logger.info('Saving JSON report');\n const json = new JSONReporter(this[OPTIONS]);\n await json.open();\n await json.write(testedPages);\n await json.close();\n\n logger.info('Saving HTML Report');\n const html = new HTMLReporter(this[OPTIONS]);\n await html.open();\n await html.write(testedPages);\n await html.close();\n }", "function writeTxtFiles() { //调用前面的写方法\n\n\t// could've written these as one function,\n\t// left em separate for easy customization,\n\t// e.g., could've written writeCsv()\n\n\n\n\n\n\twriteHtml();\n\twriteCss();\n\t// writeJson();\n\twriteManifest();\n\n\n}", "function exportAnswers(callback) {\n\tquery(\"SELECT userid, questionid, response from answers\", callback);\n\t\t\t// INTO OUTFILE '\" + exportPath + \"answers\" + dateHelper() + \".csv'\\\n}", "function util_print() {\n\n //1.Should append Extra lines to the Result files\n // var conn = conn_dev;\n var conn = conn_uat\n //2. Able to PRint the Environmental Details\n var formattext = '\\r\\n------------------------------\\r\\n' + 'D/b SERVER Conected: ' + conn.config.server + '\\r\\n' + '-------------------------------\\r\\n';\n console.log(formattext);\n let fss;\n try {\n fss = fs.openSync('message.txt', 'a');\n fs.appendFileSync(fss, formattext, );\n \n } catch (err) {\n throw err;\n }\n finally {\n console.log('\\r\\n ..In Output, Server Name Added. \\r\\n ');\n if (fss !== undefined)\n fs.closeSync(fss);\n }\n //});\n\n}", "function CommandResult(){\n this.outputPath = generalOutputDir;\n this.toBootstrap = false;\n}", "function OutFile() {\r\n}", "async function generate(opts) {\n const apiFinder = parse_1.parse(opts);\n const data = apiFinder(opts.api);\n const results = {\n ...opts,\n data,\n };\n if (opts.outputJsonPath) {\n await output_1.outputJson(opts.outputJsonPath, data);\n }\n if (opts.outputReadmePath) {\n await output_1.outputReadme(opts.outputReadmePath, data);\n }\n return results;\n}", "function output ( data ) {\n console.dir( data, {\n depth: null,\n colors: true,\n } );\n}", "function iterationResult( callback ){\r\n outputFile = outputFile ? outputFile.clone() : new File();\r\n\r\n // if the user wants to concatenate all the files into one\r\n if( options.fileName )\r\n outputFile.path = path.resolve(outputFile.base, options.fileName);\r\n\r\n outputFile.contents = new Buffer(\r\n options.name + ' = ' + JSON.stringify(files, null, 4) + ';'\r\n );\r\n\r\n this.push(outputFile);\r\n callback();\r\n}", "function processing(error, stdout, stderr) {\n if (error) {\n console.log(error);\n }\n if (stderr) {\n console.log(stderr);\n }\n\n if (stdout) {\n console.log(stdout);\n var output = fs.readFileSync('results/results.json');\n var results = JSON.parse(output);\n response.send(results);\n }\n }", "function handleWrite(err, result) {\n if (err) {\n console.log('Error writing'.red);\n console.log(err);\n return;\n }\n\n console.log(('compiled scss in ' + result.stats.duration/1000 + 's').green);\n\n notifier.notify({\n title: taskConfig.name,\n message: 'Compiled scss'\n });\n}", "function downloadOutput() {\n\tvar a = document.getElementById(\"output\").appendChild(\n\t\t\tdocument.createElement(\"a\"))\n\ta.download = \"Output.txt\";\n\ta.innerText = \"Download Output\";\n\tvar totalOutput = document.getElementById(\"display\").innerHTML\n\t\t\t.split(\"<br>\").join(\"\\r\\n\").slice(1);\n\ta.href = \"data:text/plain,\" + encodeURIComponent(totalOutput);\n}" ]
[ "0.63936573", "0.6166272", "0.6156874", "0.61409837", "0.59925956", "0.5958521", "0.5942677", "0.56270903", "0.5400741", "0.53747886", "0.53433347", "0.526257", "0.5239293", "0.52391547", "0.52317715", "0.51808566", "0.5151781", "0.51302665", "0.512924", "0.5106412", "0.50957394", "0.5082502", "0.5031667", "0.500195", "0.49862224", "0.49851912", "0.4963719", "0.49591157", "0.4957777", "0.4955554", "0.49481225", "0.4944259", "0.49224046", "0.4913264", "0.49036568", "0.48952082", "0.48923585", "0.4888808", "0.4861714", "0.48551154", "0.48495784", "0.4826326", "0.4817535", "0.4817535", "0.47957912", "0.47880903", "0.478287", "0.4780988", "0.4780988", "0.4780988", "0.4780988", "0.4780988", "0.4780988", "0.4780988", "0.4772718", "0.47621518", "0.47596377", "0.47564542", "0.47495112", "0.47462323", "0.4737104", "0.47260058", "0.4715188", "0.47140285", "0.47129193", "0.4709878", "0.47057608", "0.46994096", "0.46967462", "0.46913096", "0.46909663", "0.46892947", "0.4682647", "0.4674501", "0.46681285", "0.4666498", "0.46618524", "0.46555257", "0.46507668", "0.46408856", "0.4636626", "0.46316707", "0.46215042", "0.46213284", "0.46198872", "0.46198872", "0.4619014", "0.4615763", "0.46033758", "0.4601955", "0.45837742", "0.45742807", "0.45725274", "0.4571587", "0.45696673", "0.45623255", "0.45556945", "0.45535523", "0.45414978", "0.4537602" ]
0.7465816
0
runs phantomjs and pipes output to grunt
function run_phantomjs(args,then){ args.unshift(yslow.path); var stdout = ""; var stderr = ""; grunt.log.write(phantomjs.path+" "+args.join(" ")); var pantomjs_process = require('child_process').spawn(phantomjs.path, args); // with live output piping pantomjs_process.stdout.on('data', function (data) { stdout+=data.toString(); grunt.verbose.write(data.toString()); }); pantomjs_process.stderr.on('data', function (data) { stderr+=data.toString(); grunt.log.error(stderr); }); // and callback on exit process pantomjs_process.on('exit', function (code) { if(then) then(stderr,stdout); }); return pantomjs_process; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function task(grunt) {\n function logCompileStatus() {\n return through.obj(function (file, enc, cb) {\n grunt.verbose.or.writeln('Compiling \"' + file.path + '\"...');\n this.push(file);\n cb();\n });\n }\n\n // Please see the Grunt documentation for more information regarding task\n // creation: http://gruntjs.com/creating-tasks\n grunt.registerMultiTask('blink', 'Grunt plugin for Blink.', function () {\n var options = this.options();\n var done = this.async();\n\n this.files.forEach(function (filePair) {\n vfs.src(filePair.src).pipe(logCompileStatus()).pipe(blink(filePair.dest, options)).on('error', function (err) {\n grunt.log.notverbose.error().error(err.message);\n grunt.fail.warn(err);\n }).pipe(vfs.dest(filePair.dest)).on('end', function () {\n grunt.verbose.ok();\n done();\n });\n });\n });\n}", "phantomjs( markup, fOut, opts, on_error ) {\n // Save the markup to a temporary file\n const tempFile = fOut.replace(/\\.pdf$/i, '.pdf.html');\n FS.writeFileSync(tempFile, markup, 'utf8');\n let scriptPath = PATH.relative(process.cwd(), PATH.resolve( __dirname, '../utils/rasterize.js' ));\n scriptPath = SLASH(scriptPath);\n const sourcePath = SLASH(PATH.relative( process.cwd(), tempFile));\n const destPath = SLASH(PATH.relative( process.cwd(), fOut));\n SPAWN('phantomjs', [ scriptPath, sourcePath, destPath ], false, on_error, this);\n }", "function copy_html(cb) {\n src(\"src/renderer/*.html\").pipe(dest(\"build/renderer\")).on(\"end\", cb);\n}", "function runTests(opt, cb) {\n\tvar child = exec('mocha ' + build.config.mocha + ' \"' + build.distBase + 'test\"', {\n\t maxBuffer: 16 * 1024 * 1024,\n\t}, function(err/*, stdout, stderr*/) {\n\t\tcb(opt.ignoreErrors ? null : err);\n\t});\n\n\tchild.stdout.pipe(process.stdout);\n\tchild.stderr.pipe(process.stderr);\n}", "function callPhantom(callback) {\n getPhantomFileName(function(phantomJsPath) {\n\n var childArgs = [\n path.join(__dirname, 'phantomjs-script.js'),\n constParams.TARGET_URL,\n constParams.CAPTURE_FILE\n ];\n\n console.log('Calling phantom: ', phantomJsPath, childArgs);\n var ls = childProcess.execFile(phantomJsPath, childArgs);\n\n ls.stdout.on('data', function (data) { // register one or more handlers\n console.log('phantom data ---:> ' + data);\n });\n\n ls.stderr.on('data', function (data) {\n console.log('phantom error ---:> ' + data);\n });\n\n ls.on('exit', function (code) {\n console.log('child process exited with code ' + code);\n\n fs.exists(constParams.CAPTURE_FILE, function(exists) {\n if (exists) {\n console.log('file exists!!');\n\n sendMail()\n .then(chatworkNotification())\n .then(function() {\n console.log(\"exit----------\");\n callback();\n });\n\n } else {\n console.log('file unexists.....');\n callback();\n }\n\n });\n\n });\n\n });\n }", "function grunt( repo, callback, errCallback ) {\n 'use strict';\n \n execute( 'grunt', [ '--no-color' ], rootDir + repo, callback, errCallback );\n}", "function testBrowser() {\n return src(['test/test.js'], { read: false })\n .pipe(mocha({\n reporter: 'dot',\n exit: true,\n environment: 'browser'\n }));\n}", "_writingGrunt() {\n this.fs.copy(this.templatePath('Gruntfile.js'), this.destinationPath('Gruntfile.js'));\n this.fs.copy(\n this.templatePath('felab_custom_server.js'),\n this.destinationPath('felab/custom/server.js')\n );\n this.fs.copy(\n this.templatePath('felab_custom_testconfig.js'),\n this.destinationPath('felab/custom/testconfig.js')\n );\n\n this.fs.copy(\n this.templatePath('felab_default_concat.js'),\n this.destinationPath('felab/default/concat.js')\n );\n this.fs.copy(\n this.templatePath('felab_default_copy.js'),\n this.destinationPath('felab/default/copy.js')\n );\n this.fs.copy(\n this.templatePath('felab_default_clean.js'),\n this.destinationPath('felab/default/clean.js')\n );\n this.fs.copy(\n this.templatePath('felab_default_config.json'),\n this.destinationPath('felab/default/config.json')\n );\n this.fs.copy(\n this.templatePath('felab_default_exec.js'),\n this.destinationPath('felab/default/exec.js')\n );\n this.fs.copy(\n this.templatePath('felab_default_watch.js'),\n this.destinationPath('felab/default/watch.js')\n );\n this.fs.copy(\n this.templatePath('felab_default_postcss.js'),\n this.destinationPath('felab/default/postcss.js')\n );\n this.fs.copy(\n this.templatePath('felab_default_sass.js'),\n this.destinationPath('felab/default/sass.js')\n );\n this.fs.copy(\n this.templatePath('felab_default_sassdoc.js'),\n this.destinationPath('felab/default/sassdoc.js')\n );\n this.fs.copy(\n this.templatePath('felab_user_aliases.yaml'),\n this.destinationPath('felab/user/aliases.yaml')\n );\n }", "function runTask(taskName, callback) {\n grunt.util.spawn({\n cmd: 'grunt',\n args: [taskName]\n }, function (err, output) {\n if (err) {\n console.log(output.stderr || output.stdout);\n done(err);\n }\n else {\n console.log(output.stdout);\n console.log('\\n'); // looks better\n callback();\n }\n });\n }", "function htmlDevelopmentBuild(cb) {\r\n return src(htmlSource)\r\n .pipe(dest(htmlDestination));\r\n cb();\r\n}", "function htmlTask(cb) {\n // prettier-ignore\n return src('app/*html')\n .pipe(useref())\n .pipe(gulpif('*.js', uglify()))\n .pipe(dest('dist/'));\n cb();\n}", "function testBrowserMini() {\n return src(['test/test.js'], { read: false })\n .pipe(mocha({\n reporter: 'dot',\n exit: true,\n environment: 'browser.min'\n }));\n}", "function spawnPhantom(site, path, options, cb) {\n var phantomArgs = [\n phantomScript\n , site\n , path\n , options.screenSize.width\n , options.screenSize.height\n , options.shotSize.width\n , options.shotSize.height\n , options.userAgent\n , options.script\n , options.session\n ].map(function(arg) {\n return arg ? arg.toString() : null;\n });\n\n childProcess\n .spawn(options.phantomPath, phantomArgs)\n .on('exit', function(code) {\n // console.log('phantom exited');\n cb(code\n ? new Error('PhantomJS exited with return value ' + code)\n : null);\n });\n}", "function grind(grunt) {\n\n // grunt.loadNpmTasks('grunt-closure-compiler');\n\n // Project configuration.\n var config = {\n pkg: '<json:../package.json>',\n meta: {\n banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +\n '<%= grunt.template.today(\"yyyy-mm-dd\") %>\\n' +\n '<%= pkg.homepage ? \"* \" + pkg.homepage + \"\\n\" : \"\" %>' +\n '* Copyright (c) <%= grunt.template.today(\"yyyy\") %> <%= pkg.author.name %>;' +\n ' Licensed <%= _.pluck(pkg.licenses, \"type\").join(\", \") %> */',\n original: '/* View original: <%= pkg.name %>-<%= pkg.version %>.js */'\n },\n lint: {\n files: ['grunt.js', 'js/**/*.js']\n },\n concat: {\n dist: {\n // built dynamically\n // src: ['<banner:meta.banner>', 'public/js/intro.js', 'public/js/*.js', 'public/js/**/*.js', 'public/js/outro.js'],\n src: [],\n dest: 'js/<%= pkg.name %>-<%= pkg.version %>.js'\n }\n },\n min: {\n dist: {\n src: ['<banner:meta.original>', '<banner:meta.banner>', '<config:concat.dist.dest>'],\n dest: 'js/<%= pkg.name %>-<%= pkg.version %>.min.js'\n }\n },\n watch: {\n files: '<config:lint.files>',\n tasks: 'lint'\n },\n jshint: {\n options: {\n curly: true,\n eqeqeq: true,\n immed: true,\n latedef: true,\n newcap: true,\n noarg: true,\n sub: true,\n undef: true,\n boss: true,\n eqnull: true,\n browser: true\n },\n globals: {\n jQuery: true,\n jsbin: true\n }\n }\n ,\n 'closure-compiler': {\n frontend: {\n root: 'js/',\n js: '', // completed dynamically\n jsOutputFile: '<%= pkg.name %>-<%= pkg.version %>.min.js',\n sourcemap: '<%= pkg.name %>-<%= pkg.version %>.map',\n options: {\n create_source_map: '<%= pkg.name %>-<%= pkg.version %>.map',\n source_map_format: 'V3',\n compilation_level: 'ADVANCED_OPTIMIZATIONS',\n language_in: 'ECMASCRIPT5_STRICT'\n }\n }\n }\n };\n\n var scripts = require('../scripts.json'),\n scriptsRelative = scripts.map(function (script) {\n return script.substring(1);\n });\n\n config.lint.files = scriptsRelative;\n config.concat.dist.src = scriptsRelative;\n config['closure-compiler'].frontend.js = scripts.map(function (script) {\n return script.substring(4);\n });\n config.concat.dist.src.unshift('js/intro.js');\n config.concat.dist.src.unshift('<banner:meta.banner>');\n config.concat.dist.src.push('js/outro.js');\n\n grunt.initConfig(config);\n // Default task.\n grunt.registerTask('default', 'concat min');\n grunt.registerTask('sourcemap', 'closure-compiler');\n // grunt.registerTask('lint', 'lint');\n\n}", "function _mocha() {\n return gulp.src(['test/setup/node.js', 'test/unit/*.js'], {read: false})\n .pipe(plugins.mocha({\n reporter: 'dot',\n globals: Object.keys(globals),\n ignoreLeaks: false\n }));\n}", "function demoTestingTask(){\n\tlet baseDir = $.path.join(__dirname, '/koatest/src/client/js');\n\tlet outputDir = $.path.join(__dirname, '/koatest/public/js');\n\t// let stream = gulp.src(baseDir + '/*.js');\t\n\t\n\tlet browserifyOpts = {\n\t\tentries: [baseDir + '/chat2.js'],\n extensions: ['.js'],\n debug: !isProduction,\n fullPaths: true\n\t};\n\n\t \t\n\tbundler = $.browserify(browserifyOpts);\n\t$.gutil.log(chalk.magenta(\"browserify bundler created \"));\n\n\tlet browserify_duration = $.duration('browserify bundling');\n\n\tbundler.transform($.babelify);\n\t$.gutil.log(chalk.magenta(\"babelify done\"));\n\n\tlet stream = bundler.bundle();\n\t$.gutil.log(chalk.magenta(\"browserify bundler stream created \"));\n\n\treturn stream.pipe($.source('first.js'))\n\t.pipe($.buffer())\n\t.pipe($.plumber({errorHandler: mapError}))\n\t.pipe(browserify_duration) \n\t// .pipe($.cache('demo-scripts')) \n\t// .pipe($.babel())\n\t// .pipe(sourcemaps.init({loadMaps: true}))\n\t.pipe($.uglify())\t\n\t.pipe($.rename({extname: '.bundle.js'}))\n\t// .pipe(sourcemaps.write(outputDir))\n\t.pipe(gulp.dest(outputDir));\n\n}", "function dom(grunt) {\n\n // Grunt utilities.\n var task = grunt.task,\n file = grunt.file,\n log = grunt.log,\n config = grunt.config;\n\n // dom based task only supported on posix for now\n if(process.platform === 'win32') return;\n\n grunt.registerTask('dom', 'Dom-based build system', function() {\n var jsdom = dom.jsdom || (dom.jsdom = ensures('jsdom'));\n if(!jsdom) return console.log('help install dom');\n\n config.requires('dom');\n var conf = config('dom'),\n files = file.expand(conf.files),\n cb = this.async();\n\n log.writeln('About to process following files\\n » ' + log.wordlist(files, '\\n » '));\n var selectors = Object.keys(conf).filter(function(key) { return key !== 'files'; });\n log.writeln('with the following set of selectors\\n » ' + log.wordlist(selectors, '\\n » '));\n\n var plugins = selectors\n .filter(function(key) {\n return key !== 'options';\n })\n .map(function(key) {\n return {\n el: key,\n plugin: conf[key]\n };\n });\n\n (function run(files) {\n var f = files.shift();\n if(!f) return cb();\n\n task.helper('dom:plugin', f, plugins, function(err, body) {\n if(err) return grunt.fail.warn(err);\n // Write the new content, and keep the doctype safe (innerHTML returns\n // the whole document without doctype).\n\n // temporary writing to filename.html.test to not alter original file\n log.subhead(' › writing to output ' + f);\n fs.writeFileSync(f, '<!doctype html>' + body);\n\n log.subhead(' ✔ ' + f);\n run(files);\n });\n }(files));\n\n });\n\n // name will probably change\n grunt.registerHelper('dom:plugin', function(f, plugins, cb) {\n log.subhead('About to process ' + f);\n\n var ln = plugins.length;\n processFile(f, function(err, window) {\n if(err) return cb(err);\n\n var $ = window.$;\n\n // augment jQuery namespace accordingly with passed in plugins\n plugins.forEach(function(it) {\n var plugin = it.plugin;\n // silent for now\n // if(!plugin.name) return cb(new Error('Require plugin.name missing'));\n // if(!plugin.handler) return cb(new Error('Require plugin.handler missing'));\n // if(typeof plugin.handler !== 'function') return cb(new Error('plugin.handler must be a function'));\n if(!plugin.name || !plugin.handler) return;\n // should do this under a single facade do reduce namespace collision\n $.fn[plugin.name] = plugin.handler;\n });\n\n plugins.forEach(function(it) {\n var el = it.el,\n plugin = it.plugin,\n name = plugin.name;\n\n log.writeln(' » Handle ' + el);\n if(!$.fn[name]) return next();\n var options = $.extend({}, plugin.defaults, config('dom.options'));\n // attach some usefull info / api to the options object\n options.log = options.log || log;\n // same for grunt helpers\n\n options.helpers = options.helpers || task._helpers;\n $(el)[name]($, options, function(err) {\n if(err) return cb(err);\n next();\n });\n });\n\n function next() {\n if(--ln) return;\n cb(null, window.document.innerHTML, window);\n }\n });\n });\n}", "function pugHtml() {\n return src('src/pug/pages/*.pug')\n .pipe(\n pug({\n pretty: true,\n })\n )\n .pipe(dest('dist'));\n}", "function postProcessing() {\n return gulp.src([\n path.join(testResultsDir, testResultFile),\n path.join(testResultsDir, coverageResultFile)\n ], {\n dot: true\n })\n .pipe(replace(__dirname, \"\"))\n .pipe(gulp.dest(testResultsDir));\n}", "function htmlComp(cb){\n return src(\"./src/html/pages/**/*.+(html|njk)\")\n .pipe(njkRender({path: ['./src/html/templates/layouts/', './src/html/templates/partials/']}))\n .pipe(dest(buildDir))\n .pipe(browserSync.stream());\n cb();\n}", "function getPhantomFileName(callback) {\n // var nodeModulesPath = path.join(__dirname, 'node_modules');\n var nodeModulesPath = path.join(__dirname, 'node_modules', 'phantomjs');\n fs.exists(nodeModulesPath, function(exists) {\n if (exists) {\n callback(path.join(__dirname, 'node_modules','phantomjs', 'bin', 'phantomjs'));\n }\n else {\n callback(path.join(__dirname, 'phantomjs'));\n }\n });\n }", "function copyHTML(cb) {\n src(\"src/*.html\").pipe(dest(destFolder));\n\n cb();\n}", "function runKarma( testConfigFile, options ) {\n var args = [ 'start', testConfigFile, '--reporters=dots', '--colors' ].concat( options ),\n done = grunt.task.current.async(),\n child = grunt.util.spawn({\n cmd: karmaCmd,\n args: args\n }, function karmaError( err, result, code ) {\n grunt.log.writeln(\"Running cmd\");\n if ( code ) {\n done( false );\n } else {\n done();\n }\n });\n\n child.stdout.pipe(process.stdout);\n child.stderr.pipe(process.stderr);\n }", "function fake_grunt(key, callback, task){\n var grunt = require(fixture('grunt/' + key + '.js'))(require('grunt')),\n error;\n\n grunt.task.init = function(){};\n grunt.fail.warn = grunt.fail.fatal = function(err){ throw new Error(err); };\n\n grunt.task.options({\n done: function(result){\n callback(error, result);\n },\n error: function(err){\n error = err;\n }\n });\n \n grunt.task.run(task || 'update_json');\n grunt.task.start({asyncDone: true});\n return grunt;\n}", "function copyHTML() {\n\n return src(files.htmlPath)\n .pipe(browserSync.stream())\n .pipe(dest(\"pub\")\n\n );\n}", "function runTests (port, build){\n\n describe('build tests', function() {\n this.timeout(20000);\n\n build();\n\n var browser = new Browser();\n\n before(function(d) {\n browser.visit('http://localhost:' + port, d);\n });\n\n\n // layout\n it('should show layout hbs content', function() {\n browser.assert.hasText('.layout', '[defaultLayout-hbs-output]');\n });\n\n\n\n // page\n it('should show index page hbs content', function() {\n browser.assert.hasText('.page', '[indexPage-hbs-output]');\n });\n\n\n\n // partial\n it('should show partial hbs content', function() {\n browser.assert.hasText('.partial', '[partial-hbs-output]');\n });\n\n it('should show partial json content', function() {\n browser.assert.hasText('.partial', '[partial-json-output]');\n });\n\n\n\n // first\n it('should show first hbs content', function() {\n browser.assert.hasText('.first', '[first-hbs-output]');\n });\n\n it('should show first js content', function() {\n browser.assert.hasText('.first', '[first-js-output]');\n });\n\n it('should show first json content', function() {\n browser.assert.hasText('.first', '[first-json-output]');\n });\n\n\n\n // second\n it('should show second hbs content', function() {\n browser.assert.hasText('.second', '[second-hbs-output]');\n });\n\n it('should show second js content', function() {\n browser.assert.hasText('.second', '[second-js-output]');\n });\n\n it('should show second dependency1 js content', function() {\n browser.assert.hasText('.second', '[someDependency1-js-output]');\n });\n\n it('should show second dependency2 js content', function() {\n browser.assert.hasText('.second', '[someDependency2-js-output]');\n });\n\n\n\n var lymCssBrowser = new Browser();\n\n before(function(d) {\n lymCssBrowser.visit('http://localhost:' + port+ '/css/lym.css', d);\n });\n\n it('should show first-settings css', function() {\n lymCssBrowser.assert.hasText('body', '.first-setting{color:red;}',true);\n });\n\n it('should show first-mixin css', function() {\n lymCssBrowser.assert.hasText('body', '.first-mixins{color:red;}',true);\n });\n\n it('should show second-mixin css', function() {\n lymCssBrowser.assert.hasText('body', '.second-mixins{color:orange;}',true);\n });\n\n it('should show second css', function() {\n lymCssBrowser.assert.hasText('body', '.second{color:green;}',true);\n });\n\n\n var firstBundleCssBrowser = new Browser();\n\n before(function(d) {\n firstBundleCssBrowser.visit('http://localhost:' + port+ '/css/first-bundle.css', d);\n });\n\n it('should show first css', function() {\n firstBundleCssBrowser.assert.hasText('body', '.first{color:red;}',true);\n });\n });\n}", "function createMultiTask(grunt, name) {\n grunt.registerMultiTask(name, 'Check the files exits.', function() {\n var done = this.async();\n grunt.util.async.forEachSeries(this.filesSrc, function(file, next) {\n // echo\n grunt.log.writeln('- ' + file);\n\n var body = fs.readFileSync(file, {encoding: 'utf8'});\n body = body.replace(/\\n$/, '');\n if (body) {\n var match = /^(\\d+)ms$/.exec(body);\n if (match) {\n // wait if the file contains number for order.\n setTimeout(function() {next();}, Number(match[1]));\n } else {\n // throw the body message.\n throw new Error(body);\n }\n } else {\n next();\n }\n }, function(err) {\n done(err);\n });\n });\n}", "function jsTask() {\n return src(files.jsPath)\n .pipe(browserSync.stream())\n // .pipe(uglify())\n .pipe(sourcemapsB.init())\n .pipe(babel())\n .pipe(concatB(\"main.js\"))\n .pipe(sourcemapsB.write(\".\"))\n .pipe(dest('pub/js')\n\n );\n}", "function runProtractor(done) {\n gulp.src('./src/tests/*.js')\n .pipe($.protractor.protractor({\n configFile: 'e2e/protractor.config.js'\n }))\n .on('error', function (err) {\n // Make sure failed tests cause gulp to exit non-zero\n throw err;\n })\n .on('end', function () {\n // Close browser sync server\n browserSync.exit();\n done();\n });\n}", "function testNode() {\n return src(['test/test.js'], { read: false })\n .pipe(mocha({\n reporter: 'dot',\n exit: true,\n environment: 'node'\n }));\n}", "function jsTask() {\n return src(files.jsPath)\n .pipe(concat('main.js'))\n .pipe(babel({\n presets: ['@babel/env']\n }))\n .pipe(terser())\n .pipe(dest('pub/js'))\n .pipe(browserSync.stream())\n}", "function html(){\n return gulp.src('./src/*.html')\n .pipe(gulp.dest('./build'))\n .pipe(browserSync.stream());\n}", "function buildBaseFiles(cb) {\n\tconsole.log(\"Copy pace.min.js successful\");\n\tsrc('./node_modules/pace-progress/pace.min.js')\n\t\t.pipe(dest(config.paths.js.srcRaw));\n\n\tconsole.log(\"Copy lazysizes.js successful\");\n\tsrc('./node_modules/lazysizes/lazysizes.js')\n\t\t.pipe(dest(config.paths.js.srcRaw));\n\n\tconsole.log(\"modernizr.min.js generated\");\n\tsrc(config.paths.js.src)\n\t\t.pipe(modernizr('modernizr.min.js'))\n\t\t.pipe(uglify())\n\t\t.pipe(dest( config.paths.vendor.paths.js ));\n\tcb();\n}", "function html() {\n return src(srcPaths.html)\n .pipe(dest(distPaths.html))\n .pipe(browserSync.stream());\n}", "function genHtml(){\n\tgulp.src(path.dist + 'index.html')\n\t\t//.pipe(inject(gulp.src(mainBowerFiles(), {read: false}), {name: 'bower'}))\n\t\t.pipe(inject(gulp.src([path.dist_static + '**/*.js'], {read: false}), {name: 'app'}))\n\t\t.pipe(inject(gulp.src([path.dist + '**/*.css'], {read: false}), {name: 'style'}))\n\t\t.pipe(gulp.dest(path.dist));\n}", "function html(cb) {\n src(nunjuck.in)\n .pipe(\n nunjucksRender({\n path: nunjuck.path\n })\n )\n .pipe(dest(nunjuck.out))\n watch(nunjuck.watch, series(html, browsersync.reload))\n cb()\n}", "function executeCmd(grunt, command, done) {\n\n // Print the command formatted to run in bash\n grunt.log.writeln(command.cmd +' '+ command.args.join(' ').replace(/(version,'[^']*')/, '\"$1\"'));\n\n var stdout = [];\n var proc = grunt.util.spawn(command, function(error, result, code) {\n grunt.log.subhead(result.stdout);\n\n if (error) {\n grunt.log.error(error.message, code);\n }\n done(!error);\n });\n\n proc.stdout.setEncoding('utf-8');\n proc.stdout.on('data', function(data) {\n stdout.push(data);\n });\n\n // Recognize when the action-script-compiler-daemon is running\n // which sometimes halts grunt\n var checkIntervalHandle = setInterval(function() {\n if (/Starting aschd server/.test(stdout.join())) {\n clearInterval(checkIntervalHandle);\n grunt.log.ok(command.cmd);\n\n grunt.log.subhead(stdout.join());\n\n done();\n }\n }, 500);\n}", "function compileToMinifiedHTML() {\n return src(srcFiles.pathPug).pipe(pug()).pipe(dest(destFolders.minified));\n}", "finish() {\n const grunt = _chalk.green('grunt');\n const gruntTestCommand = _chalk.yellow('test');\n const gruntMonitorUnitCommand = _chalk.yellow('monitor:unit');\n const gruntMonitorApiCommand = _chalk.yellow('monitor:api');\n const gruntFormatCommand = _chalk.yellow('format');\n const gruntLintCommand = _chalk.yellow('lint');\n const gruntHelpCommand = _chalk.yellow('help');\n const gruntDocsCommand = _chalk.yellow('docs');\n const gruntPackageCommand = _chalk.yellow('package');\n const gruntPublishCommand = _chalk.yellow('package');\n\n this.log(_consts.SEPARATOR);\n [\n ` `,\n `--------------------------------------------------------------------------------`,\n ` Your AWS Microservice project has been created, and is ready for use. Grunt `,\n ` tasks have been provided for common development tasks such as: `,\n ` `,\n ` Running all unit tests: `,\n ` ${grunt} ${gruntTestCommand} `,\n ` `,\n ` Test driven development: `,\n ` ${grunt} ${gruntMonitorUnitCommand} `,\n ` `,\n ` Run end to end tests against deployed lambda functions: `,\n ` ${grunt} ${gruntMonitorApiCommand} `,\n ` `,\n ` Formatting and linting files: `,\n ` ${grunt} ${gruntFormatCommand} `,\n ` ${grunt} ${gruntLintCommand} `,\n ` `,\n ` Generating documentation: `,\n ` ${grunt} ${gruntDocsCommand} `,\n ` `,\n ` Packaging the lambda functions for deployment: `,\n ` ${grunt} ${gruntPackageCommand} `,\n ` `,\n ` Publishing lambda functions to AWS: `,\n ` ${grunt} ${gruntPublishCommand} `,\n ` `,\n ` Several other useful tasks have been packaged up with the Gruntfile. You can `,\n ` review them all by running: `,\n ` ${grunt} ${gruntHelpCommand} `,\n ` `,\n ` NOTE: This project will support the use of cloud formation scripts to create `,\n ` and deploy AWS resources. This support is currently not available, is being `,\n ` worked on. `,\n ` `,\n `--------------------------------------------------------------------------------`,\n ` `\n ].forEach((line) => this.log(line));\n }", "function testServerCode() {\n return gulp.src(config.assets.server.js.tests)\n .pipe(jasmine({\n reporter: new Jasminereporter()\n }));\n}", "function htmlHandler() {\n\treturn gulp.src(\"./app/pug/index.pug\")\n\t.pipe(pug({pretty: true}).on(\"error\", errorHandler))\n\t.pipe(gulp.dest(\"./dist/\"))\n\t.pipe(browserSync.stream());\n}", "function webpack(cb, watch=false) {\n const cmd = path.join(__dirname, './node_modules/.bin/', 'webpack');\n const params = ['--color'];\n if (watch) {\n params.push('--watch');\n }\n\n // Spawn process\n const webpackProcess = spawn(cmd, params, { cwd: __dirname });\n\n // Callback can only be called once.\n // Make it a no-op when it's been called.\n function callback(){\n cb();\n callback = ()=>{};\n }\n\n // Respond to stream events\n webpackProcess.stdout.on('data', (data) => {\n data = data.toString();\n console.log(data);\n\n // Initial pass of packing done when it outputs time\n if (watch && data.includes('Time:')) {\n callback();\n }\n });\n webpackProcess.stderr.on('data', (data) => {\n const err = data.toString();\n console.log(err);\n notify.onError({\n title: \"Error building JS\",\n message: \"<%= err.message %>\"\n });\n });\n webpackProcess.on('close', () => {\n callback();\n });\n}", "function runScript ( script, done, cwd ) {\n\t\tvar warning,\n\t\t\terror,\n\t\t\toptions = {};\n\n\t\tif ( cwd ) {\n\t\t\toptions.cwd = cwd;\n\t\t}\n\n\t\tgrunt.verbose.write( \"Running script: \" + script );\n\n\t\tvar childProcess = cp.exec( script, options, function () {\n\t\t} );\n\n\t\tvar removeExtras = function ( str ) {\n\t\t\tif ( compressOutput ) {\n\t\t\t\treturn str.replace( /\\[(INF|ERR|WRN)\\][\\s]+/g, '' );\n\t\t\t} else {\n\t\t\t\treturn str;\n\t\t\t}\n\t\t};\n\n\t\tchildProcess.stdout.on( 'data', function ( d ) {\n\t\t\tvar message = removeExtras ( d );\n\n\t\t\tif ( d.match( /^\\[ERR\\]/ ) ) {\n\t\t\t\terror = error || message;\n\t\t\t\tlog.error( message );\n\t\t\t} else if ( d.match( /^\\[WRN\\]/ ) ) {\n\t\t\t\twarning = warning || message;\n\t\t\t\tlog.warn ( message );\n\t\t\t} else {\n\t\t\t\tvar dataLine = message.trim();\n\t\t\t\tif ( dataLine ) {\n\t\t\t\t\tlog.writeln( dataLine );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t\tchildProcess.stderr.on( 'data', function ( d ) {\n\t\t\tlog.error( removeExtras ( d ) );\n\t\t} );\n\n\t\tchildProcess.on( 'exit', function ( code ) {\n\t\t\tif ( error ) {\n\t\t\t\tlog.writeln(); // write new line to gap from previous output\n\t\t\t\tfail.fatal( error + ' (see log for details)' );\n\t\t\t}\n\n\t\t\tif ( warning && failOnWarn ) {\n\t\t\t\tlog.writeln(); // write new line to gap from previous output\n\t\t\t\tfail.warn( warning + ' (see log for details)' );\n\t\t\t\tlog.writeln(); // write new line to gap from previous output\n\t\t\t}\n\n\t\t\t// Sencha CMD sometimes does not provide exit code when there are \"only\" warnings\n\t\t\tif ( code !== 0 && code !== null ) {\n\t\t\t\tlog.error( 'Exited with code: %d.', code );\n\t\t\t\treturn done( false );\n\t\t\t}\n\t\t\tdone();\n\t\t} );\n\t}", "function jsTask() {\n return src(files.jsPath)\n .pipe(babel())\n .pipe(conCat('main.js'))\n //terser minifies the files after concat put them togheter\n .pipe(terser())\n .pipe(dest('pub/js'));\n}", "function js(cb){\n src([jquery,bootstrap_js]).pipe(dest(jsDest));\n cb();\n}", "function script(cb) {\n src(js.in)\n .pipe(sourcemaps.init())\n // .pipe(concat(\"app.js\")) //Will make all seperate file.\n .pipe(sourcemaps.write(\".\"))\n .pipe(dest(js.out))\n watch(js.watch, series(script, browsersync.reload))\n cb()\n}", "function run(options, callback) {\n var settings = {};\n var stdin = new PassThrough();\n var tree;\n var detectConfig;\n var hasConfig;\n var detectIgnore;\n var hasIgnore;\n\n try {\n stdin = process.stdin;\n } catch (_) {\n // Obscure bug in Node (seen on Windows).\n // See: <https://github.com/nodejs/node/blob/f856234/lib/internal/process/stdio.js#L82>,\n // <https://github.com/AtomLinter/linter-markdown/pull/85>.\n }\n\n if (!callback) {\n throw new Error('Missing `callback`')\n }\n\n if (!options || !options.processor) {\n return next(new Error('Missing `processor`'))\n }\n\n // Processor.\n settings.processor = options.processor;\n\n // Path to run as.\n settings.cwd = options.cwd || process.cwd();\n\n // Input.\n settings.files = options.files || [];\n settings.extensions = (options.extensions || []).map(extension$2);\n\n settings.filePath = options.filePath || null;\n settings.streamIn = options.streamIn || stdin;\n\n // Output.\n settings.streamOut = options.streamOut || process.stdout;\n settings.streamError = options.streamError || process.stderr;\n settings.alwaysStringify = options.alwaysStringify;\n settings.output = options.output;\n settings.out = options.out;\n\n // Null overwrites config settings, `undefined` does not.\n if (settings.output === null || settings.output === undefined) {\n settings.output = undefined;\n }\n\n if (settings.output && settings.out) {\n return next(new Error('Cannot accept both `output` and `out`'))\n }\n\n // Process phase management.\n tree = options.tree || false;\n\n settings.treeIn = options.treeIn;\n settings.treeOut = options.treeOut;\n settings.inspect = options.inspect;\n\n if (settings.treeIn === null || settings.treeIn === undefined) {\n settings.treeIn = tree;\n }\n\n if (settings.treeOut === null || settings.treeOut === undefined) {\n settings.treeOut = tree;\n }\n\n // Configuration.\n detectConfig = options.detectConfig;\n hasConfig = Boolean(options.rcName || options.packageField);\n\n if (detectConfig && !hasConfig) {\n return next(\n new Error('Missing `rcName` or `packageField` with `detectConfig`')\n )\n }\n\n settings.detectConfig =\n detectConfig === null || detectConfig === undefined\n ? hasConfig\n : detectConfig;\n settings.rcName = options.rcName || null;\n settings.rcPath = options.rcPath || null;\n settings.packageField = options.packageField || null;\n settings.settings = options.settings || {};\n settings.configTransform = options.configTransform;\n settings.defaultConfig = options.defaultConfig;\n\n // Ignore.\n detectIgnore = options.detectIgnore;\n hasIgnore = Boolean(options.ignoreName);\n\n settings.detectIgnore =\n detectIgnore === null || detectIgnore === undefined\n ? hasIgnore\n : detectIgnore;\n settings.ignoreName = options.ignoreName || null;\n settings.ignorePath = options.ignorePath || null;\n settings.ignorePathResolveFrom = options.ignorePathResolveFrom || 'dir';\n settings.ignorePatterns = options.ignorePatterns || [];\n settings.silentlyIgnore = Boolean(options.silentlyIgnore);\n\n if (detectIgnore && !hasIgnore) {\n return next(new Error('Missing `ignoreName` with `detectIgnore`'))\n }\n\n // Plugins.\n settings.pluginPrefix = options.pluginPrefix || null;\n settings.plugins = options.plugins || {};\n\n // Reporting.\n settings.reporter = options.reporter || null;\n settings.reporterOptions = options.reporterOptions || null;\n settings.color = options.color || false;\n settings.silent = options.silent || false;\n settings.quiet = options.quiet || false;\n settings.frail = options.frail || false;\n\n // Process.\n fileSetPipeline.run({files: options.files || []}, settings, next);\n\n function next(error, context) {\n var stats = statistics((context || {}).files);\n var failed = Boolean(\n settings.frail ? stats.fatal || stats.warn : stats.fatal\n );\n\n if (error) {\n callback(error);\n } else {\n callback(null, failed ? 1 : 0, context);\n }\n }\n}", "function cssTask(cb) {\n return src(\"./src/css/*.css\") \n .pipe(postcss())\n .pipe(cssnano())\n .pipe(dest(\"./build/css\")) \n .pipe(browserSync.stream());\n cb();\n}", "function html() {\n return src('src/*.html')\n .pipe(changed('build'))\n .pipe(htmlMin({\n collapseWhitespace: true,\n removeComments: true\n }))\n .pipe(dest('build'))\n}", "function scss_renderer(cb) {\n src(\"src/renderer/app.scss\").pipe(sass()).pipe(dest(\"build/renderer\")).on('end', cb);\n}", "function processing(error, stdout, stderr) {\n if (error) {\n console.log(error);\n }\n if (stderr) {\n console.log(stderr);\n }\n\n if (stdout) {\n console.log(stdout);\n var output = fs.readFileSync('results/results.json');\n var results = JSON.parse(output);\n response.send(results);\n }\n }", "function html(){\n\treturn gulp.src('./src/*.html')\n\t\t\t .pipe(gulp.dest('./dist'))\n\t\t\t .pipe(browserSync.stream());\n}", "function startPlatoVisualizer(done) {\n log('Running Plato');\n\n var files = glob.sync(config.plato.js);\n var excludeFiles = /.*\\.spec\\.js/;\n var plato = require('plato');\n\n var options = {\n title: 'Plato Inspections Report',\n exclude: excludeFiles\n };\n var outputDir = config.report + '/plato';\n\n plato.inspect(files, outputDir, options, platoCompleted);\n\n function platoCompleted(report) {\n var overview = plato.getOverviewReport(report);\n if (args.verbose) {\n log(overview.summary);\n }\n if (done) {\n done();\n }\n }\n }", "function copy_res(cb) {\n src(\"src/renderer/res/**/*\").pipe(dest(\"build/renderer/res\")).on(\"end\", cb);\n}", "function copy(){\n del(tmpDir + '/paperScript.js');\n return src(paperScrptGlob).pipe(dest(tmpDir))\n}", "function copyhtml(cb) {\n return gulp.src('app/*.+(htm|html)')\n .pipe(gulp.dest('dist/'))\n}", "function processFile(file, jsdom, cb) {\n fs.readFile(file, 'utf8', function(err, body) {\n if(err) return cb(err);\n jsdom.env({\n html: body,\n src: [jquery],\n done: cb\n });\n });\n}", "function server(done) {\n browser.init({\n server: PATHS.dist,\n port: PORT\n });\n done();\n }", "function buildJekyll(done) {\n browser.notify(messages.jekyllBuild);\n return cp.spawn( jekyll , ['build'], {stdio: 'inherit'})\n .on('close', done);\n}", "function scripts(done) {\n gulp.src(path.src.js)\n .pipe(babel({\n presets: ['@babel/preset-env']\n }))\n .pipe(plumber())\n .pipe(webpackstream(webpackconfig, webpack))\n // folder only, filename is specified in webpack config\n .pipe(gulp.dest(path.build.js))\n .pipe(browsersync.stream());\n done();\n}", "function copy(cb) {\n src(['node_modules/bootstrap/dist/**/*', '!**/npm.js', '!**/bootstrap-theme.*', '!**/*.map'])\n .pipe(dest('src/vendor/bootstrap'))\n\n src(['node_modules/jquery/dist/jquery.js', 'node_modules/jquery/dist/jquery.min.js'])\n .pipe(dest('src/vendor/jquery'))\n\n src([\n 'node_modules/font-awesome/**',\n '!node_modules/font-awesome/**/*.map',\n '!node_modules/font-awesome/.npmignore',\n '!node_modules/font-awesome/*.txt',\n '!node_modules/font-awesome/*.md',\n '!node_modules/font-awesome/*.json'\n ])\n .pipe(dest(`${src}/vendor/font-awesome`))\n if (typeof cb === 'function') {\n cb(null, file);\n called = true;\n }\n}", "function cucumberReport(cb) {\n exec('npm run cucumber-report', function (err, stdout, stderr) {\n cb(err);\n });\n}", "function cucumberReport(cb) {\n exec('npm run cucumber-report', function (err, stdout, stderr) {\n cb(err);\n });\n}", "function htmlProductionBuild(cb) {\r\n return src(htmlSource)\r\n .pipe(htmlmin({\r\n collapseWhitespace: true,\r\n minifyCSS: true,\r\n minifyJS: true,\r\n minifyURLs: true,\r\n collapseInlineTagWhitespace: true,\r\n }))\r\n .pipe(dest(htmlDestination));\r\n cb();\r\n}", "function jsTask(){\n return src([\n files.jsPath\n //,'!' + 'includes/js/jquery.min.js', // to exclude any specific files\n ])\n .pipe(uglify())\n .pipe(dest('./docs/**/*.js'))\n .pipe(browserSync.reload({stream:true}))\n}", "function run(dir, helpers, done) {\n var testFile = path.join(dir, 'test.js');\n var cleanup = function (err) {\n global.window && global.window.cleanup();\n done(err);\n }\n\n renderJSDOM(pageTemplate, {\n name: dir,\n browserDependencies: ['require: jquery', {\n run: true,\n type: \"require\",\n virtualModule: {\n path: path.join(dir, 'test.init.js'),\n read() {\n return `\n window.TEST = require(${JSON.stringify(testFile)});\n window.BrowserHelpers = require(${JSON.stringify(require.resolve('../__util__/BrowserHelpers'))});\n `;\n }\n }\n }]\n }).then(() => {\n var helpers = new window.BrowserHelpers();\n var testFunc = window.TEST;\n\n if (testFunc.length === 1) {\n testFunc(helpers);\n } else {\n return new Promise(function (resolve, reject) {\n testFunc(helpers, function (err) {\n if (err) {\n reject(err);\n } else {\n resolve();\n }\n });\n })\n }\n }).then(cleanup, cleanup);\n }", "function test(){\r\n alert(\"this is a test\");\r\n\r\n // wanting to add more comments to see gulp in action pretending to be huge file\r\n}", "function scripts() {\r\n return gulp\r\n .src('src/js/**/*.js')\r\n .pipe(plumber())\r\n .pipe(concat('main.js'))\r\n .pipe(terser())\r\n .pipe(gulp.dest('assets/js/'))\r\n .pipe(gulp.dest('_site/assets/js/'))\r\n .pipe(bsync.stream());\r\n}", "function mainScript( cb ) {\n // A filter to only use scripts in projectScripts - take out vendor scripts\n if ( allScripts.length === 0 ) {\n cb();\n return; \n }\n const noVendorFilter = filter( negatedProjectVendorScripts.concat( config.projectScripts ), {restore: true});\n return checkSrc( allScripts )\n .pipe(sourcemaps.init())\n .pipe( noVendorFilter ) //no babel-ing of vendor files\n .pipe(babel())\n .pipe( noVendorFilter.restore ) //put the vendor files back\n .pipe( concat( config.projectScriptName )) //put all files into single file with projectScriptName\n // .pipe( dest( config.destFolder + '/js')) // copy unminized js to destination - gulp minify appears to keep unminified file in stream\n .pipe( minify({\n ext: {\n min: '.min.js'\n }\n }))\n .pipe(sourcemaps.write('./maps'))\n .pipe( dest( config.destFolder + '/js'));\n}", "function jsTask() {\n\treturn src([\n\t\t'node_modules/jquery/dist/jquery.js',\t\n\t\t'node_modules/foundation-sites/dist/js/foundation.js',\n\t\t'./js/**/*.js',\n\t])\n\t\t.pipe(sourcemaps.init()) // initialize sourcemaps first\n\t\t.pipe(concat('theme.js'))\n\t\t.pipe(uglify())\n\t\t.pipe(dest('./assets/'));\n}", "function serveFn(){\n\trunSequence(['allHtml','styles','js'],function(){\n\t\tbrowserSync.init({\n\t\t\tserver: {\n\t\t\t\tbaseDir: doc\n\t\t\t}\n\t\t});\n\t})\n}", "function server(done) {\n browser.init({\n server: PATHS.dist,\n port: PORT\n });\n done();\n}", "function compil_html() {\n return src(configs.html.in)\n // .pipe(htmlmin({ collapseWhitespace: true }))\n .pipe(dest(configs.html.out))\n .pipe(connect.reload());\n}", "function createTasks(env, path){\n gulp.task('clean:'+env, function(callback){\n return del([path + \"**/*.*\"], callback);\n });\n gulp.task('handleHTML:'+env, function(){\n return gulp.src(paths.HTML)\n .pipe(gulp.dest(path))\n .pipe(browserSync.stream());\n });\n gulp.task('handleAssets:'+env, function() {\n return gulp.src(paths.ASSETS)\n .pipe(gulp.dest(path + partials.ASSETS));\n });\n gulp.task('handleJS:'+env, function(){\n\n \treturn browserify({\n \t entries: [paths.ENTRY_POINT],\n \t transform: [listImages, listAudio, brfs, babel.configure({\n ignore: /libs.+/\n })],\n \t debug: env == environement.staging,\n \t cache: {},\n \t packageCache: {},\n \t fullPaths: env == environement.staging\n \t})\n \t.bundle()\n \t.on('error', function(err){\n \t console.log(err.message);\n \t })\n \t.pipe(source(\"bundle.js\"))\n \t.pipe(gulp.dest(path + partials.RESOURCES))\n \t.pipe(browserSync.stream());\n });\n gulp.task('handleCSS:'+env, function () {\n return gulp.src(paths.CSS)\n .pipe(sass().on('error', sass.logError))\n .pipe(concat(\"bundle.css\"))\n .pipe(autoprefixer({\n browsers: ['last 2 versions'],\n cascade: true\n }))\n .pipe(gulp.dest(path + partials.RESOURCES))\n .pipe(browserSync.stream());\n });\n gulp.task('build:'+env, function(){\n runSequence('clean:'+env, ['handleHTML:'+env, 'handleCSS:'+env, 'handleAssets:'+env, 'handleJS:'+env]);\n });\n}", "function unitTests(done) {\n new karma.Server({\n configFile: __dirname + '/test/unit/karma.conf.js',\n singleRun: true\n }, done).start();\n}", "function copyHTML() {\n return src(files.htmlPath)\n .pipe(dest('pub'));\n}", "function copyImg() {\n const d = 'dist/img/';\n const s = 'dev/img/';\n return src(`${s}**/*.{png,jpg,jpeg,gif}*`)\n .pipe($.plumber({ errorHandler }))\n .pipe($.debug())\n .pipe($.changed(d))\n .pipe($.if(conf.tinypng && (f => ['.png', '.jpg', '.jpeg'].includes(f.extname)), $.tinypngCompress({ key: getRandFromArr(conf.tinypngKey), sigFile: './.tinypng-sig', summarize: true })))\n .pipe(dest(d))\n .pipe($.notify({ title: 'Images', message: '✅ Task Completed!', icon: icons.success, onLast: true }))\n .pipe($.if(conf.upload.upload, $.through2.obj((file, enc, done) => {\n fileUpload($.path.basename(file.path), d);\n done();\n })));\n}", "function processJs (bundler) {\n return bundler\n // Convert ES6 to ES2015\n .transform('babelify', {presets: ['es2015']})\n // Bundle up all our JS (makes require() work in the browser)\n .bundle()\n // Catch any errors thrown by bundle()\n .on('error', gutil.log)\n // Catch any errors thrown down the line\n .pipe(plumber({handleError: gutil.log}))\n // Convert the stream browserify created into a virtual file/buffer\n .pipe(source('app.min.js'))\n .pipe(buffer())\n // We want to set loadMaps to true because browserify has already\n // generated sourcemaps. gulp-sourcemaps can generate them too, but\n // since we've already bundled all of our JS using browserify, gulp-\n // sourcemaps would map all the JS to a single file.\n .pipe(gulpif(env.dev, sourcemaps.init({loadMaps: true})))\n\n // JS transforms go here\n\n // minify\n .pipe(gulpif(env.prod, uglify()))\n\n // Write sourcemaps\n .pipe(gulpif(env.dev, sourcemaps.write('./')))\n .pipe(gulp.dest(paths.public))\n // Reload browser\n .on('end', function () {\n if (env.dev) {\n browserSync.reload();\n }\n });\n}", "function testpuerF() {\n fs.copySync(path.join(__dirname, 'assets', 'someJSON.json'), path.join(__dirname, 'tmp', 'someJSON.json'));\n puerf.start({\n freemarker: ftlRoutesFile,\n mock: routesFile,\n combined: combinedFile,\n templates: templateFolderPath,\n port: testPort,\n root: tmpPath,\n noBrowser: true\n }, testFileServing);\n }", "function server(done) {\n browser.init({\n server: PATHS.dist, port: PORT\n }, done);\n}", "function buildJS(cb) {\n src([\"src/js/main.js\"]).pipe(concat(\"main.js\")).pipe(dest(destFolderJS));\n\n cb();\n}", "function buildPug(done) {\n gulp.src('src/views/*.pug')\n .pipe(errorNotify('Error on Compile HTML'))\n .pipe(pug({\n pretty: true\n }))\n .pipe(gulp.dest('app/'));\n done();\n}", "function done(done, output) {\n\n var lines = output.split('\\n');\n var bundle = lines[1];\n lines.splice(0, 3);\n lines.pop();\n\n // Remove empty: pattern resources added by Less build.\n lines = lines.filter(function(line) {\n return line.indexOf(\"empty:\") === -1;\n });\n\n if(endsWith(bundle, desktopBase)) {\n desktopBaseFiles = lines;\n } else if(endsWith(bundle, phoneBase)) {\n phoneBaseFiles = lines;\n } else if(endsWith(bundle, desktopUI)) {\n checkDuplicates(desktopBaseFiles, lines, bundle);\n } else if(endsWith(bundle, phoneUI)) {\n checkDuplicates(phoneBaseFiles, lines, bundle);\n }\n\n lines = lines.map(function(line) {\n return path.normalize(line.replace(\"require-style!\", \"\"));\n });\n\n lines.forEach(function(line) {\n if(realFileNames.indexOf(line) === -1) {\n grunt.fail.warn(\"Source file in build is not in filesystem:\" + line + \". Check casing of filename.\");\n }\n });\n\n done();\n }", "function runMocha (browser, baseUrl, done) {\n var env = JSON.parse(JSON.stringify(process.env));\n env.TEST_BROWSER = browser;\n env.TEST_BASEURL = baseUrl;\n\n var mocha = exec('mocha ' + mochaArgs, {\n env: env\n }, done);\n\n mocha.stdout.on('data', log.bind(null, browser));\n mocha.stderr.on('data', log.bind(null, browser));\n}", "function MincerBuild(html, options) {\n options = options || {};\n options.silent = true;\n MincerHtml.apply(this, arguments);\n this.options.output = this.options.output || 'build';\n this.configure();\n process.nextTick(this.start.bind(this));\n}", "function copyHTML() {\n return src(files.htmlPath)\n .pipe(dest('pub')\n );\n}", "function jsTask() {\n\n return src(files.jsPath)\n\n .pipe(concat('script.js'))\n\n .pipe(minify())\n\n .pipe(dest('src/js'));\n\n}", "async function createScriptRunner(config) {\n let fs = config.fs\n\n let ext = path.extname(config.entry).slice(1)\n let source = (await fs.readFile(path.resolve(config.root, config.entry))).toString('utf8')\n let factory\n\n async function createDOM(html='', options) {\n class ResourceLoader extends jsdom.ResourceLoader {\n constructor(queue) {\n super()\n this.queue = queue\n }\n\n async fetch(url, fetchOptions) {\n if (process.env.PUBLIC_URL) {\n url = url.replace(process.env.PUBLIC_URL, '')\n }\n\n let relativePathname = url[0] === '/' ? url.slice(1) : url\n let filesystemPath = path.join(config.root, relativePathname)\n\n if (/\\.js$/.test(relativePathname)) {\n let file = fs.readFile(filesystemPath)\n this.queue.push(Promise.resolve(file))\n let data = await file\n \n if (options.onScriptLoaded) {\n options.onScriptLoaded(url)\n }\n \n return data;\n }\n else {\n return Buffer.from('')\n // Let's just ignore any remote files.\n // return super.fetch(url, fetchOptions);\n }\n }\n }\n\n let queue = []\n let dom = new jsdom.JSDOM(html, {\n virtualConsole: new jsdom.VirtualConsole().sendTo(console),\n resources: new ResourceLoader(queue),\n runScripts: \"dangerously\",\n beforeParse(window) {\n // Polyfill rAF for react\n window.requestAnimationFrame = require('raf')\n window.cancelAnimationFrame = require('raf').cancel\n \n // jsdom seems to choke on webpack's <link> tag loader,\n // so I'm manually calling any onload handlers instead\n // to avoid a deadlock.\n // TODO: get links actually working.\n let appendChild = window.HTMLHeadElement.prototype.appendChild\n window.HTMLHeadElement.prototype.appendChild = function(...args) {\n let result = appendChild.apply(this, args)\n if (args[0] instanceof window.HTMLLinkElement && args[0].onload) {\n if (args[0].rel === \"stylesheet\" && options.onStyleSheetLoaded) {\n options.onStyleSheetLoaded(args[0].href)\n }\n args[0].onload()\n }\n return result\n }\n },\n }) \n\n while (await queue.shift()) {}\n \n return dom\n }\n\n if (ext === 'js') {\n let script = new vm.Script(source, {\n displayErrors: true,\n filename: path.basename(config.entry),\n timeout: 1000,\n })\n factory = async (options = {}) => {\n let dom = await createDOM('', options)\n try {\n dom.runVMScript(script)\n }\n catch (e) {\n console.error(\"Failed running app:\", e)\n }\n return dom.window[config.appGlobal]\n }\n }\n else if (ext === 'html') {\n source = source.replace(\n `<head>`,\n `<head><script>window.${config.appGlobal} = { isBuild: true }</script>`\n )\n\n factory = async (options = {}) => {\n let dom = await createDOM(source, options)\n return dom.window[config.appGlobal]\n }\n }\n else {\n throw new Error('Unknown file extension for entry point \"${config.entry}\".')\n }\n\n let test = await factory()\n if (!test) {\n throw new Error(`Could not find the \"window.${config.appGlobal}\" value in your entry point \"${config.entry}\".`)\n }\n\n return factory\n}", "function handlebars(cb) {\n return exec('./node_modules/handlebars/bin/handlebars -m ./source/templates/> ./Chrome/src/templates.js',\n (err, stdout, stderr) => {\n util.log(stdout);\n util.log(stderr);\n cb(err);\n });\n}", "function parseJunitResult(junitOutputFile, result, done) {\n async.map(junitOutputFile, arrayOfXmlReports, function(err, stdOUT){\n if(err) {\n done(err)\n return;\n }\n result.stdout = stdOUT;\n done(null, result);\n })\n}", "function sassComp() {\n return src('dev/*.scss')\n .pipe($.plumber({ errorHandler }))\n .pipe($.debug())\n .pipe($.sass({ outputStyle: conf.sassOutputStyle }).on('error', $.sass.logError))\n .pipe($.autoprefixer({ cascade: false }))\n .pipe(dest('dev'))\n .pipe($.browserSync.stream())\n .pipe($.notify({ title: 'Sass', message: '✅ Task Completed!', icon: icons.success, onLast: true }));\n}", "function done(err) {\n if(err) return cb(err);\n\n var files = grunt.file.expandFiles(path.join(cache, '**')).map(function(filepath) {\n return filepath.slice(cache.length + 1);\n });\n\n var remote = {};\n\n remote.copy = function copy(source, destination, options) {\n source = path.join(cache, source);\n self.copy(source, destination, options);\n return this;\n };\n\n remote.template = function template(source, destination, data) {\n // data is meant to be the whole instance for now. Will change.\n data = data || self;\n destination = destination || source;\n source = path.join(cache, source);\n\n var body = grunt.template.process(grunt.file.read(source), data);\n self.write(destination, body);\n };\n\n remote.directory = function directory(source, destination) {\n var root = self.sourceRoot();\n self.sourceRoot(cache);\n self.directory(source, destination);\n self.sourceRoot(root);\n };\n\n cb(err, remote, files);\n }", "function gulpJS(done){\n return src(paths.js.src)\n .pipe(plumber())\n .pipe(sourcemap.init())\n .pipe(uglify())\n .pipe(rename({ suffix: \".min\" }))\n .pipe(sourcemap.write())\n .pipe(dest(paths.js.dest))\n .pipe(browserSync.stream())\n done();\n}", "function beautifyHTML () {\n return src('output/**/*.html')\n .pipe(beautify.html(\n {\n indent_size: 2\n }\n ))\n .pipe(dest('output'))\n}", "function js() {\n return gulp.src(['node_modules/bootstrap/dist/js/bootstrap.min.js', 'node_modules/jquery/dist/jquery.min.js', 'node_modules/popper.js/dist/umd/popper.min.js'])\n .pipe(gulp.dest(\"./public/bin/js\"))\n .pipe(browserSync.stream());\n}", "function processHtml() {\n return gulp.src(\n [\n srcRoot + \"**/*.html\"\n ]\n ).pipe(\n flatten()\n ).pipe(\n htmlMin(\n config.htmlMin\n )\n ).pipe(\n templatecache(\n config.templateCache.file,\n config.templateCache.options\n )\n ).pipe(\n gulp.dest(destination + \"components/templates/\")\n );\n }", "async function runTests() {\n await fse.remove(\"cypress/report\");\n await cypress.run({\n spec: \"cypress/integration/**/*.spec.ts\",\n });\n const jsonReport = await merge({\n reportDir: \"cypress/report\",\n });\n await generator.create(jsonReport, {\n reportDir: \"cypress/report\",\n reportTitle: \"Bridge-X E2E All Test\",\n });\n await fse.writeJson(\"cypress/report/mochawesome-stat.json\", jsonReport, { spaces: 2 });\n}", "function makeTestJSFiles(\n cxt,\n cb\n) {\n var options = cxt.options,\n details = cxt.details,\n packageMap = cxt.packageMap,\n mostRecentJSDate = cxt.mostRecentJSDate,\n deps = cxt.deps,\n depsFileMap = cxt.depsFileMap,\n cssFileMap = cxt.cssFileMap,\n cssMostRecentDate = cxt.cssMostRecentDate;\n\n if (options.test) {\n // get the dependencies extended with testDependencies\n deps = getPackageDependencies(packageMap, details.name, true);\n checkOlderOrInvalid(\n path.join(options.dstFolder, details.name, details.name + '.test.js'),\n mostRecentJSDate,\n function (err, older) {\n if (older) {\n publishJSFiles(options, details, packageMap, deps, true, cb);\n } else {\n cb(err);\n }\n }\n );\n } else {\n cb(null);\n }\n}", "function html() {\n\treturn gulp.src(paths.pug)\n\t.pipe($.plumber({ errorHandler: $.notify.onError('<%= error.message %>') }))\n\t.pipe($.data(function(file){\n\t\tlet dirname = './json/';\n\t\tlet files = fs.readdirSync(dirname);\n\t\tlet json = {};\n\t\tfiles.forEach(function(filename){\n\t\t\tjson[filename.replace('.json', '')] = require(dirname + filename);\n\t\t});\n\t\treturn { data: json };\n\t}))\n\t.pipe($.pug({\n\t\tpretty: true,\n\t\tbasedir: __dirname + '/src',\n\t}))\n\t.pipe(gulp.dest(paths.htmlDest));\n}", "function compile(args, cb) {\n var child = grunt.util.spawn({\n cmd: args.shift(),\n args: args\n }, function (err, result, code) {\n var success = code === 0;\n\n if (code === 127) {\n return grunt.warn(\n 'You need to have Ruby and Chop RB Builder installed ' +\n 'and in your system PATH for this task to work. ' \n );\n }\n\n // `compass compile` exits with 1 and outputs \"Nothing to compile\"\n // on stderr when it has nothing to compile.\n // https://github.com/chriseppstein/compass/issues/993\n // Don't fail the task in this situation.\n if (code === 1 && /Nothing to compile/g.test(result.stderr)) {\n success = true;\n }\n\n cb(success);\n });\n child.stdout.pipe(process.stdout);\n child.stderr.pipe(process.stderr);\n }" ]
[ "0.6286816", "0.6242427", "0.6196365", "0.59870887", "0.5930146", "0.5848738", "0.5834331", "0.58222145", "0.57663476", "0.572182", "0.56671965", "0.5663967", "0.5650866", "0.5641634", "0.5625576", "0.5625099", "0.55608153", "0.5522843", "0.5493636", "0.54874825", "0.54365164", "0.54105586", "0.5408181", "0.5381789", "0.5379437", "0.5360668", "0.534036", "0.5330781", "0.5323586", "0.5301443", "0.52848727", "0.5266606", "0.52616084", "0.5256631", "0.52418566", "0.5233785", "0.52240413", "0.520549", "0.51959646", "0.5178843", "0.5174041", "0.5168307", "0.5167237", "0.51519376", "0.51493853", "0.5140737", "0.5137348", "0.51092505", "0.51075584", "0.51067156", "0.5101118", "0.50901026", "0.5081152", "0.50668955", "0.50634444", "0.50615495", "0.50565165", "0.505267", "0.5049602", "0.504671", "0.5043079", "0.50429815", "0.50429815", "0.50343096", "0.50327456", "0.50241804", "0.501172", "0.50112265", "0.50077677", "0.5006432", "0.5006152", "0.5001658", "0.500088", "0.49996242", "0.49943182", "0.49901697", "0.49670997", "0.49647558", "0.49620667", "0.49596986", "0.49421373", "0.49258402", "0.49226454", "0.49211606", "0.4917304", "0.49172974", "0.4913968", "0.49129182", "0.4912907", "0.49126244", "0.49089947", "0.49086067", "0.49076378", "0.49004772", "0.4899085", "0.48962557", "0.4882742", "0.4881917", "0.48806405", "0.48803183" ]
0.71803695
0
Revert all changes made to the contact and stop editing the contact.
revertContact() { this.getContact().restore(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancelEditCard() {\n // 8-1 Set isEditing flag to update the view.\n this.isEditing = false\n\n // 8-2 Reset the id we want to edit.\n this.idToEdit = false\n\n // 8-3 Clear our form.\n this.clearForm()\n}", "discardChanges() {\n this.editMode = false;\n this.removeListener();\n }", "cancelEdit () {\n this.editCache = null\n this.editingTrip = null\n this.editType = null\n }", "cancelEditAddress() {\n this.vendor.address = this.addressRevertData.address;\n this.vendor.state = this.addressRevertData.state;\n this.vendor.city = this.addressRevertData.city;\n this.vendor.zip_code = this.addressRevertData.zip_code;\n\n this.addressRevertData = '';\n }", "function cancelChanges() {\n\t\tsetEditMode(false);\n\t\tsetRows(previousRows);\n\t\tsetSelected([]);\n\t}", "cancelEdit() {\n if (this._editedLevel > 0) {\n this._editedLevel--;\n }\n\n // Cancel in sub-models\n if (this._editedLevel === 0) {\n _each(this._childCollections, childCollection => {\n childCollection.cancelEdit();\n });\n\n // Revert changes\n // TODO\n\n // Reset state\n this._editedEvents = [];\n }\n }", "cancelEdit() {\n this.set('isManage', false);\n this.folder.set('isEdit', false);\n this.folder.rollbackAttributes();\n }", "function editCancelFunc(){\n setEdit(null);\n }", "function abortEditing() {\n\t\t$('.editing').removeClass('editing');\n\t\t$('.edit').val('').off('keyup');\n\t}", "function resetEdit() {\n\t$('.icons').removeClass('editable');\n\t$('#save-recipe, #cancel-recipe').hide();\n\t$('#detail-description, #detail-name').attr('contenteditable', false);\n\t$('#detail-new-ingredient-input').hide();\n}", "cancelEditType() {\n this.type = this.editing;\n this.editing = '';\n }", "cancelEdit() {\n this.folderUser.set('isEdit', false);\n this.set('isManage', false);\n }", "function cancelEditLead() {\n clearEditLeadForm();\n}", "function handleCancelEdit() {\n updateIsEditMode(false);\n }", "cancelEdit() {\r\n const that = this,\r\n editingInfo = that._editing;\r\n\r\n if (!editingInfo) {\r\n return;\r\n }\r\n\r\n for (let i = 0; i < editingInfo.cells.length; i++) {\r\n const cell = editingInfo.cells[i];\r\n\r\n if (cell.editor.contains((that.shadowRoot || that.getRootNode()).activeElement)) {\r\n that._focusCell(cell.element);\r\n }\r\n\r\n cell.editor.remove();\r\n that._setCellContent(cell.element, that._formatCellValue(editingInfo.row, that.columnByDataField[cell.dataField], cell.element));\r\n cell.element.classList.remove('editing');\r\n }\r\n\r\n delete that._editing;\r\n }", "restore(){\n\t\tthis.resetCharges();\n\t\tthis.repair();\n\t}", "undo() {\n\t\tthis.editing = false;\n\t\tthis.query('.edit').value = this.text;\n\t}", "function onClickClearAddressBook() {\n //définit variable locale addressBook comme un tableau vide\n var addressBook = new Array();\n \n //l'enregistre sur l'adressBook non local, écrasant son contenu actuel\n saveAddressBook(addressBook);\n\n // cache les détails du contact en cours s'ils sont affichés (a cliqué sur contact)\n $('#contact-details').hide();\n\n // relance la page pour faire disparaître les contacts\n refreshAddressBook();\n}", "cancelEdit(todo) {\n this.editTodo = null;\n todo.isEdited = false;\n }", "function undo() \r\n {\r\n addressRef.value = address;\r\n roomNumberRef.value = roomNumber;\r\n seatsUsedRef.value = seatsUsed;\r\n seatsTotalRef.value = seatsTotal;\r\n updateTextfieldClasses();\r\n useAddress ? useAddressClassRef.MaterialCheckbox.check() : \"\";\r\n lightsOn ? lightsClassRef.MaterialSwitch.on() : \"\";\r\n heatingCoolingOn ? heatingCoolingClassRef.MaterialSwitch.on() : \"\"; \r\n \r\n snackbarContainer.MaterialSnackbar.cleanup_();\r\n }", "function cancelChange()\r\n\t{\r\n\r\n\t\tif ( editingRow !== -1 )\r\n\t\t{\r\n\r\n\t\t\tif ( wantClickOffEdit === true )\r\n\t\t\t{\r\n\t\t\t\t// get the updated value\r\n\t\t\t\tvar newValue = document.getElementById('editCell');\r\n\t\t\t\tif ( null !== newValue )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( class_myRows[editingRow].name !== newValue.value )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tsaveChange(editingRow);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tresetRowContents();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tresetRowContents();\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// set the flag\r\n\t\trowEditing = false;\r\n\t}", "cancel() {\n // Rollback edit profile changes\n this.changeset.rollback(); //this.model.reload();\n\n this.set('editProjectShow', false);\n }", "function cancelChanges() {\n config = backupConfig\n renderSileoDepiction(config)\n hideAlert()\n}", "function cancelEdit(e){\n e.preventDefault();\n \n Session.set('editingPost', null);\n}", "function goCancel() {\n datacontext.revertChanges(vm.learningItem);\n goBack();\n }", "cancelUpdate() {\n this.updatingType = false;\n this.type = {};\n this.form.$setUntouched();\n }", "function coauthors_stop_editing( event ) {\n\n\t\tvar co = jQuery( this );\n\t\tvar tag = jQuery( co.next() );\n\n\t\tco.attr( 'value',tag.text() );\n\n\t\tco.hide();\n\t\ttag.show();\n\n\t//\tediting = false;\n\t}", "function cancel()\n {\n dirtyController.setDirty(false);\n hideWorkflowEditor();\n hideWorkflowUpdateEditor();\n selectWorflow(selectedWorkflow);\n }", "function cancelEdit() {\n\n for (let i = 0; i < addCommentButtons.length; i++)\n addCommentButtons[i].style.display = \"initial\";\n\n const articleId = this.id.replace('delete-', '');\n tinymce.activeEditor.remove();\n const content = document.querySelector(`#content-${articleId}`);\n content.innerHTML = initialText;\n resetButtonsFromEditing(articleId);\n }", "function revertChanges() {\n return manager.rejectChanges();\n }", "function revertChanges() {\n if (typeof db.getItem(savedData) !== 'undefined' && db.getItem(savedData) !== 'undefined' && db.getItem(savedData) !== 'null' && db.getItem(savedData) != null && db.getItem(savedData) !== \"\") {\n mainP.innerHTML = db.getItem(savedData);\n //makeEditable();\n sanitizeItems();\n };\n }", "function cancel_score_edit()\n\t{\n\t\tdocument.getElementById('score_edit_form').reset();\n\t\t$('#score_edit').dialog('close');\n\t}", "function deleteContact() {\n app.f7.actions([[{\n text: 'Delete Contact',\n red: true,\n onClick: function() {\n var contacts = Persistence.getAllContacts();\n _.remove(contacts, { _id: contact._id });\n Persistence.setAllContacts(contacts);\n app.router.load('list'); // reRender main page view\n app.mainView.goBack(\"../index.html\", false);\n app.f7.closeModal();\n }\n }],\n [{\n text: 'Cancel',\n bold: true\n }]]);\n }", "cancelEdit() {\n this.handsontableData = JSON.parse(JSON.stringify(this.handsontableDataBackup));\n this.hot.loadData(this.handsontableData);\n this.hot.render();\n\n // Change edit mode on redux\n this.props.setEdit();\n }", "function cancelEdit() {\n resetForm();\n formTitle.innerHTML = 'Add Link';\n cancelButton.parentElement.removeChild(cancelButton);\n updateButton.parentElement.removeChild(updateButton);\n saveButton.classList.remove('hidden');\n }", "function cancel () {\n closeDialog();\n if (isEditPage) {\n table.restoreBackup();\n }\n }", "function cancel () {\n closeDialog();\n if (isEditPage) {\n table.restoreBackup();\n }\n }", "_setToEditingMode() {\n this._hasBeenEdited = true\n this._setUiEditing()\n }", "function cancel() {\n\t\tdelete state.people[id]\n\t\temit(\"person modal canceled\")\n\t}", "cancelEditAmmenities() {\n this.vendor.eighteen_plus = this.ammenitiesRevertData.eighteen_plus;\n this.vendor.twenty_one_plus = this.ammenitiesRevertData.twenty_one_plus;\n this.vendor.has_handicap_access = this.ammenitiesRevertData.has_handicap_access;\n this.vendor.has_lounge = this.ammenitiesRevertData.has_lounge;\n this.vendor.has_security_guard = this.ammenitiesRevertData.has_security_guard;\n this.vendor.has_testing = this.ammenitiesRevertData.has_testing;\n this.vendor.accepts_credit_cards = this.ammenitiesRevertData.accepts_credit_cards;\n\n this.ammenitiesRevertData = '';\n }", "function onEditContact(e) {\n contactForm.buildContactForm(activeContact); \n $.mobile.changePage(\"#edit_contact_page\", { transition: \"pop\" });\n}", "reset(){\n this._address.StreetAddress.value = \"\";\n this._address.City.value = \"\";\n this._address.State.value = \"\";\n this._address.Zip.value = \"\";\n\n this._user.Email.value = \"\";\n this._user.FirstName.value = \"\";\n this._user.LastName.value = \"\";\n this._primaryPhone.value = \"\";\n if(this._cellPhone) this._cellPhone.value = \"\";\n if(this._homePhone) this._homePhone.value = \"\";\n if(this._workPhone) this._workPhone.value = \"\";\n\n this._chosenContact = null;\n this._chosenContactID = -1;\n this._company.value = \"\";\n this._licenseNum.value = \"\";\n this._mcNum.value = \"\";\n this._resaleNum.value = \"\";\n\n if(document.getElementById(INVOICE_CHOSEN_CONTACT_ID)){\n document.getElementById(INVOICE_CHOSEN_CONTACT_ID).removeAttribute(\"id\");\n }\n\n this._updatePreviewField();\n }", "function exitEditBookForm() {\n editForm.reset()\n editForm.style.visibility = 'hidden'\n allowPointerEvents()\n}", "cancelEdit() {\n const me = this,\n {\n inputField,\n oldValue,\n lastAlignSpec\n } = me,\n {\n target\n } = lastAlignSpec,\n {\n value\n } = inputField;\n\n if (!me.isFinishing && me.trigger('beforeCancel', {\n value,\n oldValue\n }) !== false) {\n // Hiding must not trigger our blurAction\n me.isFinishing = true;\n me.hide();\n me.trigger('cancel', {\n value,\n oldValue\n });\n\n if (target.nodeType === 1) {\n target.classList.remove('b-editing');\n target.classList.remove('b-hide-visibility');\n }\n\n me.isFinishing = false;\n }\n }", "function cancelEditOpp() {\n clearEditOppForm();\n}", "function stopEditing() {\n editing = false;\n statusIndicator.remove();\n setStatus(\"\");\n sourceStatus = \"\";\n urlInput.removeEventListener(\"paste\", onURLChange);\n}", "function editingCanceled() {\n\tlocation.reload();\n}", "function stopInputEditing() {\n setInputEditing(false);\n }", "function onGoBack() {\n setFormDataEdit(null);\n setStep('Menu');\n }", "revert() { }", "function resetContactDetailsState() {\n var chosen_contact = (contact_person_input.val() !== '');\n contact_person_name_input.prop('readonly', chosen_contact);\n contact_person_phone_input.prop('readonly', chosen_contact);\n contact_person_email_input.prop('readonly', chosen_contact);\n if(chosen_contact) {\n contact_person_search.hide();\n contact_person_manual.show();\n } else {\n contact_person_search.show();\n contact_person_manual.hide();\n }\n }", "function onClickDeleteContact() {\n // va rajouter la propriété data-index ayant pour valeur l'index dans la balise a suivant celle ayant un id contact-details. Lie l'index du tableau de contacts (donc le contact que l'on veut) avec le lien cliquable sur le nom du contact\n //stocke ça dans variable index\n var index = $('#contact-details a').data('index');\n\n /*stock les données du localStorage dans la variable*/\n var addressBook = loadAddressBook();\n\n //fonction prédéfinie supprimant le premier élément de index (définit localement au-dessus) de addressBook(tableau des contacts). Car premier élément de index de adressbook est le tableau/objet contenant le contact\n addressBook.splice(index, 1);\n\n //l'enregistre sur l'adressBook non local, écrasant son contenu actuel\n saveAddressBook(addressBook);\n\n //cache les détails du contact\n $('#contact-details').hide();\n\n // relance la page pour faire disparaître le contact\n refreshAddressBook();\n\n}", "function onRemoveContactFromAddressBook(contact){\n try {\n var result = thisPresenter.removeContact(contact);\n if(result) alert(\"Contatto [\" + mediator.createNameLabel(contact) + \"] rimosso\");\n } catch (err) {\n alert(err);\n }\n }", "function editzselex_cancel()\n{\n Element.update('zselex_modify', '&nbsp;');\n Element.show('zselex_articlecontent');\n editing = false;\n return;\n}", "function previous() {\n if (currentContactIndex > 0) {\n currentContactIndex--;\n }\n currentContact = contactArray[currentContactIndex];\n viewCurrentContact();\n\n // Todo: Disable previous button when currentContactIndex equal to 0.\n // PJB: I implemented this in the viewCurrentContact() function so that \n // it would work when first loaded.\n \n\n // Todo: Save changed items to contacts array and resort array.\n // PJB: I saved the changed items to the contacts array in the add(), \n // delete(), and update() functions. I didn't resort the array\n // because I didn't sort it in the first place but I do update \n // the table each time one of these functions is called.\n}", "unsetActiveEditRef(ref) {\n if (this._editRef !== ref) {\n return;\n }\n this._editRef = null;\n }", "onUserEditCancel() {\n this.setState({ editUser: null, editedUser: null });\n }", "cancelEdit() {\n const me = this,\n { inputField, oldValue } = me,\n { value } = inputField;\n\n if (!me.isFinishing && me.trigger('beforecancel', { value: value, oldValue }) !== false) {\n // Hiding must not trigger our blurAction\n me.isFinishing = true;\n me.hide();\n me.trigger('cancel', { value, oldValue });\n me.isFinishing = false;\n }\n }", "function cancelEdit(){\r\n\t//clears fields\r\n\t$(\"#edt-g-name\").val(\"\");\r\n\t$(\"#edt-g-time\").val(\"\");\r\n\t$(\"#auto-input-1\").val(\"\");\r\n\tvar selMin = $('#selEdtMin');\r\n\tselMin.val('').attr('selected', true).siblings('option').removeAttr('selected');\r\n\tselMin.selectmenu(\"refresh\", true);\r\n\tvar selMax = $('#selEdtmax');\r\n\tselMax.val('').attr('selected', true).siblings('option').removeAttr('selected');\r\n\tselMax.selectmenu(\"refresh\", true);\r\n\t//hides edit fields and shows games list\r\n\t$(\"#editList\").show();\r\n\t$(\"#editBlock\").hide();\r\n\t$(\"#frm1\").show();\r\n\t$(\"#para1\").show();\r\n\t//takes save function off button\r\n\tvar savBtn = $('#editSave');\r\n\tsavBtn.removeAttr('onClick');\r\n\t}", "swap(e){\n e.preventDefault();\n\n if(this._showingContacts){\n document.getElementById(INVOICE_CUSTOMER_NEW_ID).style.display = \"block\";\n document.getElementById(INVOICE_CUSTOMER_SHOW_CONTACTS_ID).style.display = \"block\";\n\n document.getElementById(INVOICE_CONTACTS_LIST_OUTER_ID).style.display = \"none\";\n document.getElementById(INVOICE_SHOW_CUSTOM_ID).style.display = \"none\";\n }\n else {\n document.getElementById(INVOICE_CUSTOMER_NEW_ID).style.display = \"none\";\n document.getElementById(INVOICE_CUSTOMER_SHOW_CONTACTS_ID).style.display = \"none\";\n\n document.getElementById(INVOICE_CONTACTS_LIST_OUTER_ID).style.display = \"block\";\n document.getElementById(INVOICE_SHOW_CUSTOM_ID).style.display = \"block\";\n }\n\n this._showingContacts = !this._showingContacts;\n positionModalDialog(this._dialog);\n }", "function editContact(){\n var id = readLineSync.question('Lua chon id contact can sua: ');\n var name = readLineSync.question('name: ');\n var phone = readLineSync.question('phoneNum:');\n listContact[id].Name = name;\n listContact[id].Phone = phone;\n save();\n console.log(\"\\nsua thanh cong nhe!\");\n }", "saveContact() {\n const contact = this.getContact();\n if (contact.isNew() || contact.isDirty()) {\n contact.save();\n }\n }", "function onChangeContact()\n{\n disableDeleteButton(true);\n disableSaveButton(false);\n disableClearButton(false);\n}", "onCancel() {\n this.resetForm();\n }", "function revokeEditable($container) {\n var $fields = $container.find(\"[data-content-attr]\");\n $fields.removeClass(\"activated\").hallo({editable:false});\n }", "function onUnlockContact(contact){\n try{\n thisPresenter.unlockContact(contact);\n } catch (err) {\n alert(err);\n }\n }", "function cancelEditSale() {\n clearEditSaleForm();\n}", "function _exitEditingMode() {\n delete cmsobj.editingmode;\n\n $('body').removeClass('editmode');\n $('#global-substitutions').remove(); // Not sure why, but this is needed otherwise it ends up with multiple instances\n \n if( _$smSaveAsPanel.hasClass(\"active\") ) {\n // Close the SaveAs RHS dialog if it's open\n _toggleSmSaveAsPanelVisibility();\n $('#sm-ninja-editor-requested-content').remove();\n }\n\n $(\"#image_preview_container\").remove();\n\n $(\"#ckeditor_toolbar\").remove();\n $('#ckedit').remove(); // Remove the ckeditor\n\n mov.section.cms.hideSmSidebarRight(); // hide the right sidebar\n mov.section.cms.showSmSidebarLeft(); // And show the left one\n\n $('#sm_overlay').remove();\n }", "function cancel_contact() {\n var item_id = $(\"#contact-id\", \"#contact-form\").val();\n if (item_id) {\n var validation_bkup = validate_form;\n validate_form = function(form) {return true;}; // deshabilitar validaciones\n save_contact();\n validate_form = validation_bkup;\n } else {\n $(\"#contact-form\").fadeOut();\n }\n}", "restore() {\r\n this.deleted = false;\r\n }", "function removeContact() {\n let contactId = getSelectedContactId()\n client.contacts.remove(contactId)\n}", "cancel() {\n // Rollback edit badge changes\n this.changeset.rollback(); //this.model.reload();\n\n this.set('editBadgeShow', false);\n }", "function resetBody(){\n\n setSelectedContact(CONTACT_CHOICE);\n\n var email = document.getElementById('emailBlock').getElementsByTagName('input')[0];\n var phone = document.getElementById('phoneBlock').getElementsByTagName('input')[0];\n var im = document.getElementById('imBlock').getElementsByTagName('input')[0];\n var address = document.getElementById('addressBlock').getElementsByTagName('input')[0];\n var url = document.getElementById('urlBlock').getElementsByTagName('input')[0];\n var other = document.getElementById('otherBlock').getElementsByTagName('input')[0];\n var name = document.getElementById('selctedContactName');\n\n email.readOnly = true;\n phone.readOnly = true;\n im.readOnly = true;\n address.readyState = true;\n url.readOnly = true;\n other.readOnly = true;\n name.readOnly = true;\n\n}", "function endEditAboutMe() {\n $save_or_cancel_edit_about_me.css(\"display\", \"none\");\n $link_edit_about_me.css(\"display\", \"inline\");\n $edit_about_me.css(\"display\", \"none\");\n $about_me.css(\"display\", \"block\");\n\n return false;\n }", "onEditComplete_() {\n this['editing'] = false;\n }", "remove(contact) {\n // Filter out any items that have the same _id as the 'contact'\n this.data = this.data.filter((item) => {\n return item._id !== contact._id;\n });\n\n this.render();\n }", "cancelEditing() {\n this.setState({ isEditing: false });\n }", "cancelChanges() {\n if (confirm(\"Are you sure that you want to DISCARD all changes?\")) {\n location.href = LDViz.homePage;\n }\n }", "function onClickClearFieldsButton()\n{\n resetContactEditElements();\n resetTableHighlights();\n}", "function resetDatosEdit(){\n vectorSourceEdicion.clear();\n vm.nuevoNombre = null;\n vm.nuevoTipoPunto = null;\n nuevasCoord = null;\n }", "function cancelEdit(){\n //close edit box\n closeEditBox();\n}", "function endEdit(){\n // Reset task form and update UI\n displayTaskForm();\n updateUI()\n}", "function cancelout() {\n setAddResponse(null);\n setchosenmed(null);\n setExistingPrescription(null);\n }", "reset() {\n this.modified = false;\n }", "function cancelEditOperador(){\n\t\t $(\"#form_edit_operdor\")[0].reset();\n\t}", "function finish() {\n scope.editing = false;\n if (!element.hasClass(\"editing\")) {\n return;\n }\n element.removeClass(\"editing\");\n inputElement.blur();\n if (scope.updated === \"\") {\n scope.updated = scope.value;\n }\n if (scope.new || scope.updated !== scope.value) {\n scope.onComplete({current: scope.updated, previous: scope.value});\n } else {\n scope.onComplete(null);\n }\n scope.$apply();\n }", "cancelMe() {\n if (this.editFlag) {\n this.viewMe();\n } else {\n this.removeFromParentWithTransition(\"remove\", 400);\n }\n }", "undo() {\n this.ffauWorkspace.undo(0);\n }", "function reset() {\n save(null);\n }", "function cancelWrite() {\n pendingRecord = null;\n writePending = false;\n overwritePendingText.classList.remove('active');\n overwriteCancelButton.classList.remove('active');\n}", "@action\n cancelUpdatePosition() {\n this.showPositionDialog = false;\n this.earlySlot = null;\n }", "revert() {\n this.$autocompleteOutput.val('');\n this.$autocompleteOutput.attr('size', 1);\n\n this._updateState(AUTOCOMPLETE_STATE.COMMANDS.HIGHLIGHT);\n this.$autocompleteInput.val(this.inputRevert);\n this.$autocompleteInput.attr('placeholder', AUTOCOMPLETE_INPUT_PLACEHOLDER.COMMAND);\n this.onAutocompleteInputChangeHandler();\n this.$autocompleteInput.focus();\n\n this.params = {};\n this.inputRevert = null;\n }", "function stopEdits(){\r\n map.removeControl(drawControl);\r\n controlOnMap = false;\r\n}", "@action\n cancelEditRow() {\n set(this, 'isEditRow', false);\n }", "deleteContact(contactToDeleteId) {\n const {contacts} = this.state\n _.remove(contacts, contact => contact.id === contactToDeleteId);\n this.setState({\n contacts\n }, () => updateLocalStorage(\"contacts\", contacts))\n }", "cancel(){\n this.game.activeNPC.action=null;\n this.game.activeNPC=null;\n }", "function cancelNewLead() {\n clearNewLeadForm();\n}", "function clearEdits(){\n\n}", "function editarContacto(nombreEliminar,a,b,c) {\n\tfor (var i =0;i < arrayContactos.length;i++) {\n\t\tif (arrayContactos[i].nombre == nombreEliminar ) {\n\t\t\tarrayContactos[i].nombre=a;\n\t\t\tarrayContactos[i].direccion=b;\n\t\t\tarrayContactos[i].telefono=c;\n\t\t}\n\t}\n\tguardarDatosLocales();\n}", "function resetEditRoomForm(){\r\n \r\n ERoomNumberField.reset();\r\n ERoomValidFromField.reset();\r\n ERoomValidToField.reset();\r\n\t\t\t\t\t \r\n }" ]
[ "0.66719586", "0.64675707", "0.64196837", "0.6246502", "0.6233333", "0.6232131", "0.6226049", "0.616502", "0.61240137", "0.6013594", "0.60111177", "0.5989721", "0.59214896", "0.59017706", "0.58883774", "0.5882475", "0.58626676", "0.5858237", "0.58482", "0.57804984", "0.5772317", "0.5756075", "0.5754619", "0.5718622", "0.5706491", "0.57041717", "0.5699924", "0.56939083", "0.5683113", "0.5677555", "0.5675219", "0.566473", "0.5654422", "0.5651398", "0.5649731", "0.56399626", "0.56399626", "0.5622549", "0.5611064", "0.5605055", "0.5584889", "0.5579432", "0.55786836", "0.55608356", "0.5544518", "0.5530419", "0.5508043", "0.5482487", "0.5479356", "0.5470811", "0.5466167", "0.5466", "0.54551756", "0.54461044", "0.543812", "0.54344577", "0.5429554", "0.5419632", "0.5411101", "0.5406006", "0.54002696", "0.53886575", "0.53779787", "0.53766406", "0.5375972", "0.5370196", "0.53654224", "0.53579926", "0.53579867", "0.5347442", "0.53469926", "0.5346827", "0.5342964", "0.5326899", "0.53245723", "0.53233755", "0.5318242", "0.531486", "0.530982", "0.53021276", "0.52994764", "0.52955836", "0.52937484", "0.52868515", "0.5276116", "0.5274531", "0.5263507", "0.5236479", "0.522899", "0.52271736", "0.5224915", "0.5220916", "0.52034026", "0.51991796", "0.5194916", "0.5187305", "0.5180853", "0.5171657", "0.5160266", "0.5156511" ]
0.79837286
0
Save all changes made to the contact and stop editing the contact.
saveContact() { const contact = this.getContact(); if (contact.isNew() || contact.isDirty()) { contact.save(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editContact(){\n var id = readLineSync.question('Lua chon id contact can sua: ');\n var name = readLineSync.question('name: ');\n var phone = readLineSync.question('phoneNum:');\n listContact[id].Name = name;\n listContact[id].Phone = phone;\n save();\n console.log(\"\\nsua thanh cong nhe!\");\n }", "function saveChanges() {\n var name = document.getElementById(\"mod_name\").value;\n var tel = document.getElementById(\"mod_tel\").value;\n var email = document.getElementById(\"mod_email\").value;\n var idx = document.getElementById(\"mod_idx\").value;\n \n if (!isInputError(name, tel, email)) {\n \t// make changes\n \tcontacts[idx].name = name;\n \tcontacts[idx].tel = tel;\n \tcontacts[idx].email = email;\n // hide mod panel\n hide(\"modentry\");\n // refresh contact list\n displayEntries();\n }\n\n}", "function editContact() {\n\n for (let y = 0; y < saveEdit.length; y++) {\n let editItem = saveEdit[y];\n\n editItem.onclick = function (f) {\n let index = f.currentTarget.getAttribute('data-attr-index');\n let updatedAddress = displayList[y].value;\n let info = updatedAddress.split(\"|\");\n let contact = document.getElementsByClassName('contact');\n let contactValue = contact[y].value;\n \n\n name = contactValue;\n phoneNum = info[0];\n email_ = info[1];\n address_ = info[2];\n\n let savedAddress = JSON.parse(localStorage.getItem('addressBook'));\n\n if (savedAddress !== null) {\n savedAddress[index].name = name;\n savedAddress[index].phoneNo = phoneNum;\n savedAddress[index].email = email_;\n savedAddress[index].address = address_;\n\n localStorage.setItem(\"addressBook\", JSON.stringify(savedAddress));\n\n }\n alert('The Edited Contact has been saved');\n }\n\n }\n }", "function onClickSaveContact()\n{\t\n\t/*On crée un tableau pour pouvoir enregistrer plusieurs lignes dans Address Book, qui contiendront les infos de contact sous forme de tableau dans un tableau*/\n\tvar addressBook = [];\n\n\t/*stock les valeurs entrées par l'utilisateur dans la variable contact via la fonction createContact()*/\n\tvar contact = createContact(\n\t\t\t\t\t/*permet de récupérer les valeurs rentrées par l'utilisateur dans les champs du formulaire*/\n $('select[name=title]').val(), \n $('input[name=lastName]').val(), \n $('input[name=firstName]').val(), \n $('input[name=phone]').val() \n );\n\n\t/*On écrase le dernier addressBook avec le tableau comportant les nouvelles données, évite d'écraser les contacts déjà existants : va stocker dans adressBook tout ce qui a été loadé*/\n\t\t/*rajoute pas un contact à tableau existant mais écrase ancien tableau par nouveau contenant contact en plus*/\n\taddressBook = loadAddressBook();\n\n\n\t// va rajouter la propriété data-index ayant pour valeur l'index dans la balise a suivant celle ayant un id contact-details. Lie l'index du tableau de contacts (donc le contact que l'on veut) avec le lien cliquable sur le nom du contact. Va sauvegarder le contact dans le local storage\n\t\t//stocke ça dans variable index\n \tvar index = $('#contact-details a').data('index');\n \n \t// si l'attribut data-mode vaut 'add'\n if ($('#contact-form').data('mode') == 'add'){\n \t\t/*Permet de pousser contact dans le tableau, transforme ses données en tableau contenu dans un index*/\n \t\taddressBook.push(contact);\n } else {\n \t\t// sinon va charger le contact dans l'index correspondant dans addressBook\n \t\taddressBook[index] = contact;\n }\n\n /*stock les valeurs de contact dans la clée Adress Book*/\n\tsaveAddressBook(addressBook);\n\n\t/*cache la partie ajouter contact au moment d'enregistrer*/\n $('#contact-form').fadeOut('slow');\n $('#contact-details').hide();\n \n /*Affiche dans la section adress-book*/\n refreshAddressBook();\n}", "'.save click'() {\n this.saveContact();\n Navigator.openParentPage();\n\n // Prevent the default submit behavior\n return false;\n }", "function SaveUpdatedContactToPhonebook()\n{\n\tTi.API.info(\"SaveUpdatedContactToPhonebook\");\n\t\n\t// TODO: Replace this with return statement\n\tif(contact == null) alert(\"Contact must be initialized ya beheema !\");\n\t\n\tif(OS_IOS) {\n\t\tTitanium.Contacts.save();\n\t} \n\telse if(OS_ANDROID) {\n\t\t/* Titanium APIs or Android OS has a bug, which is saving a contact after editing it causes another contact got edited.\n\t\t * A workaround is to delete the exisiting contact with id and then add a new contact having each and every detail the\n\t\t * deleted contact had.\n\t\t */\n\t\t\n\t\tTitanium.Contacts.removePerson(contact);\n\t\t\n\t\tTi.Contacts.createPerson({\n\t\t\taddress : contact.address ? contact.address : null,\t// Dictionary\n\t\t\tbirthday : contact.birthday ? contact.birthday : \"\",\t// String\n\t\t\tdate : contact.date ? contact.date : null,\t// Dictionary\n\t\t\temail : contact.email ? contact.email : null,\t// Dictionary\n\t\t\tfirstName : contact.firstName ? contact.firstName : contact.fullName ? contact.fullName : \"\",\t// String\n\t\t\t// TODO: The image is not copied\n\t\t\timage : contact.image ? contact.image : null,\t// Image blob\n\t\t\t\n\t\t\tinstantMessage : contact.instantMessage ? contact.instantMessage : null,\t// Dictionary\n\t\t\tkind : Ti.Contacts.CONTACTS_KIND_PERSON,\n\t\t\tlastName : contact.lastName ? contact.lastName : \"\",\t// String\n\t\t\tmiddleName : contact.middleName ? contact.middleName : \"\",\t// String\n\t\t\tnickname : contact.nickname ? contact.nickname : \"\",\t// String\n\t\t\tnote : contact.note ? contact.note : \"\",\t// String\n\t\t\torganization : contact.organization ? contact.organization : \"\",\t// String\n\t\t\tphone : contact.phone ? contact.phone : null,\t// Dictionary\n\t\t\trelatedNames : contact.relatedNames ? contact.relatedNames : null,\t// Dictionary\n\t\t\turl : contact.url ? contact.url : null,\t// Dictionary\n\t\t});\n\t}\n\t\n\tcontact = null;\t// To avoid wrong use in future.\n\talert(\"Contact Updated in Phonebook !\");\n}", "revertContact() {\n this.getContact().restore();\n }", "function saveContact()\n{\n\tvar contact = {};\n\tvar properties = [];\n\t$(\"#contact_form\").find(\".form-control\").each(function()\n\t{\t\n\t\tvar value = $(this).val();\n\t\tvar label = $(this).attr('name');\n\t\tvar property = {};\n\t\tif(value)\n\t\t{\n\t\t\t//console.log(label +' : '+ value);\n\t\t\tproperty.value= value;\n\t\t\tproperty.name=label;\n\t\t\tproperty.type=\"SYSTEM\";\n\t\t\tproperties.push(property);\n\t\t}\n\t});\n\tcontact.properties = properties;\n\t//console.log(contact);\n\tcrm.addContact(contact, function(resp)\n\t\t{\t\n\t\t\t$('#save_contact').attr('disabled','disabled');\n\t\t\t//console.log(resp);\n\t\t\tvar contactLink = 'https://'+USER_SETTINGS.domain+'.agilecrm.com/#contact/'+resp.id;\n\t\t\t$(\"#contact_form\").append('<div id=\"message\" class=\"alert alert-info\">Contact added to AgileCRM. Click here to <a href=\"'+contactLink+'\" target=\"_blank\">Open Contact</a></div>');\n\t\t}, \n\t\tfunction(err)\n\t\t{\n\t\t\t//console.log(err);\n\t\t\t$(\"#contact_form\").append('<div id=\"message\" class=\"alert alert-danger\">'+err.responseText+'</div>');\n\t\t});\n}", "function handleSave(event) {\n event.preventDefault();\n setSaving(true);\n if (addOrEditContactType === messages.Add) onAddContact(addOrEditContact);\n else onUpdateContact(addOrEditContact);\n history.push('/contact-list');\n const contact = { ...addOrEditContact };\n const name = `${contact.firstname} ${contact.lastname}`;\n toast.success(`${messages.toastcontact} ${name} ${messages.toastsaved}`);\n }", "function saveContact(inputValues) {\n contact.setValues(inputValues);\n var validation = contact.validate();\n if (validation) {\n app.f7.alert(validation);\n return;\n }\n var contacts = Persistence.getAllContacts();\n if (!state.isNew) {\n _.remove(contacts, { _id: contact._id });\n }\n contacts.push(contact);\n Persistence.setAllContacts(contacts);\n renderContactListView();\n closePage();\n }", "function onSaveContact(e) {\n \n var toSave;\n if (activeContact) {\n toSave = activeContact;\n } else {\n toSave = navigator.contacts.create();\n }\n \n // name saving:\n initName();\n \n // nickname saving:\n toSave.nickname = contactForm.getNickname();\n \n // phones saving:\n initContactFieldVals(\"phoneNumbers\", contactForm.getPhoneNumbers());\n \n // emails saving:\n initContactFieldVals(\"emails\", contactForm.getEmails());\n \n // ims saving:\n initContactFieldVals(\"ims\", contactForm.getIMs());\n \n // urls saving:\n initContactFieldVals(\"urls\", contactForm.getURLs());\n \n // addresses saving:\n initContactFieldVals(\"addresses\", contactForm.getAddresses());\n \n // organizations saving:\n initContactFieldVals(\"organizations\", contactForm.getOrganizations());\n \n // note saving:\n var note = contactForm.getNote();\n if (!isEmptyOrBlank(note)) {\n toSave.note = note;\n }\n \n // photo saving:\n initContactFieldVals(\"photos\", contactForm.getPhotos());\n \n toSave.save(onSuccess,onError);\n \n function onSuccess(contact) {\n alert(\"The contact was successfully saved\");\n displContactList.updateList();\n $.mobile.changePage(\"#cont_list_page\", { transition: \"pop\" });\n };\n\n function onError(contactError) {\n alert(\"The contact cannot be saved: error: \" + contactError.code);\n };\n \n function initName() {\n \n if (!toSave.name) {\n toSave.name = new ContactName();\n }\n var nameData = contactForm.getNames();\n toSave.name.givenName = nameData.givenName;\n toSave.name.familyName = nameData.familyName;\n toSave.name.middleName = nameData.middleName;\n toSave.name.honorificPrefix = nameData.honorificPrefix;\n toSave.name.honorificSuffix = nameData.honorificSuffix;\n };\n \n function initContactFieldVals(contactFieldName, contactFieldValsArray) {\n \n if (!toSave[contactFieldName] && (contactFieldValsArray.length > 0)) {\n toSave[contactFieldName] = [];\n } \n for (var i = 0; i < contactFieldValsArray.length; i++) {\n if (!toSave[contactFieldName][i]) {\n if (contactFieldName == \"addresses\") {\n toSave[contactFieldName][i] = new ContactAddress();\n } else if (contactFieldName == \"organizations\") {\n toSave[contactFieldName][i] = new ContactOrganization();\n } else {\n toSave[contactFieldName][i] = new ContactField();\n }\n }\n for (var key in contactFieldValsArray[i]) {\n toSave[contactFieldName][i][key] = contactFieldValsArray[i][key];\n }\n }\n if (toSave[contactFieldName]) {\n for (var i = contactFieldValsArray.length; i < toSave[contactFieldName].length; i++) {\n if (toSave[contactFieldName][i]) {\n for (var key in toSave[contactFieldName][i]) {\n if (key.toLowerCase() != \"id\") {\n toSave[contactFieldName][i][key] = \"\";\n }\n }\n }\n }\n }\n };\n}", "function saveContact() {\n $.ajax({\n url: apiUrl+anime._id+\"/\",\n type: 'PUT',\n dataType: 'JSON',\n data: anime,\n success: function (data) {\n if (data) {\n window.location.href = \"./index.html\";\n } else {\n console.log(\"Could not update the anime\");\n }\n },\n error: function (request, status, error) {\n console.log(error, status, request);\n },\n complete: function(){return;}\n });\n return;\n }", "function cancelEditCard() {\n // 8-1 Set isEditing flag to update the view.\n this.isEditing = false\n\n // 8-2 Reset the id we want to edit.\n this.idToEdit = false\n\n // 8-3 Clear our form.\n this.clearForm()\n}", "function onEditContact(e) {\n contactForm.buildContactForm(activeContact); \n $.mobile.changePage(\"#edit_contact_page\", { transition: \"pop\" });\n}", "function saveContact(){\n\n saveButton.style.display = 'none';\n cancelButton.style.display = 'none';\n\n var email = document.getElementById('emailBlock').getElementsByTagName('input')[0];\n var phone = document.getElementById('phoneBlock').getElementsByTagName('input')[0];\n var im = document.getElementById('imBlock').getElementsByTagName('input')[0];\n var address = document.getElementById('addressBlock').getElementsByTagName('input')[0];\n var url = document.getElementById('urlBlock').getElementsByTagName('input')[0];\n var other = document.getElementById('otherBlock').getElementsByTagName('input')[0];\n var name = document.getElementById('selctedContactName');\n\n name = name.value.split(' ')\n\n //a temp object to save the details.\n\n var tempContactObj = {\n \"name\":{'first':name[1],'last':name[2],'title':name[0]},\n \"dob\": other.value,\n \"email\" : email.value,\n \"cell\" : phone.value,\n \"login\" : im.value,\n \"picture\" : {'large':'img/noImage.png','medium':'img/noImage.png','thumbnail':'img/noImage.png'},\n \"location\" : address.value,\n \"url\" : url.value\n }\n\n USER_ARRAY.push(new Contact(tempContactObj));\n USER_ARRAY.sort(compareFirstName);\n generateList();\n\n\n // Rest the body after saving the contact.\n resetBody();\n}", "_setToEditingMode() {\n this._hasBeenEdited = true\n this._setUiEditing()\n }", "function crmEditContactSaved(data) {\n if (!data.error) {\n $(\"#editContactModal\").modal(\"hide\");\n location.reload();\n }\n arcGetStatus();\n}", "function finish() {\n scope.editing = false;\n if (!element.hasClass(\"editing\")) {\n return;\n }\n element.removeClass(\"editing\");\n inputElement.blur();\n if (scope.updated === \"\") {\n scope.updated = scope.value;\n }\n if (scope.new || scope.updated !== scope.value) {\n scope.onComplete({current: scope.updated, previous: scope.value});\n } else {\n scope.onComplete(null);\n }\n scope.$apply();\n }", "createContact() {\n // check if it is allowed to save\n if (this.onCreateAction && !this.saveDisabled) {\n // disable save until it is finished\n this.toggleProperty('saveDisabled');\n\n // call the onCreate action\n this.onCreateAction(this.model).then(() => {\n // enable save again\n this.toggleProperty('saveDisabled');\n // reset the model's attributes\n this.set('model', {});\n });\n }\n }", "function editContact(id) { // editing is actually done in edit.js\n // store id, to be retrieved in edit.js on edit.html\n localStorage.idOfContactBeingEdited = JSON.stringify(id);\n}", "function updateContact() {\n var contacts = getStoredContacts();\n var idEdited = JSON.parse(localStorage.idEdited);\n\n contacts.forEach(function (contact) {\n if(idEdited == contact.id) { // capitalize name initials (a little sanitation)\n contact.firstname = form.firstname.value[0].toUpperCase() + form.firstname.value.slice(1).toLowerCase(),\n contact.lastname = form.lastname.value[0].toUpperCase() + form.lastname.value.slice(1).toLowerCase(),\n contact.phone = form.phone.value,\n contact.address = form.address.value,\n contact.email = form.email.value\n }\n });\n\n // add contact to local storage\n localStorage.contacts = JSON.stringify(contacts);\n localStorage.idEdited = JSON.stringify('updated');\n}", "function _saveContacts(c){\n\tActions.saveContacts(c);\n}", "function editContact(){\n\n}", "function onChangeContact()\n{\n disableDeleteButton(true);\n disableSaveButton(false);\n disableClearButton(false);\n}", "handleNewContact(contact) {\n addContact(contact);\n this.closeModal();\n }", "saveContact(oldContactId, newName, newEmail, newNumber) {\n const {contacts} = this.state\n const foundContact = _.find(contacts, contact => contact.id === oldContactId);\n foundContact.name = newName;\n foundContact.email = newEmail;\n foundContact.number = newNumber;\n this.setState({\n contacts\n }, () => updateLocalStorage(\"contacts\", contacts))\n }", "function commitEdits(){\n\t\t\tgrid.Grid.getEditController().commitCurrentEdit();\n\t\t}", "onEditComplete_() {\n this['editing'] = false;\n }", "cancelEdit () {\n this.editCache = null\n this.editingTrip = null\n this.editType = null\n }", "function saveContacts() {\n window.localStorage.setItem(\"contacts\", JSON.stringify(contacts))\n drawContacts()\n}", "function saveContacts() {\n window.localStorage.setItem(\"contacts\", JSON.stringify(contacts))\n drawContacts()\n}", "discardChanges() {\n this.editMode = false;\n this.removeListener();\n }", "function saveContactInfo() {\n\n $scope.savingContactInfo = true;\n $scope.contactInfoError = false;\n\n // Only save with valid input.\n if ($scope.contactInfoForm.$valid) {\n\n EventFormData.resetContactPoint();\n\n // Copy all data to the correct contactpoint property.\n for (var i = 0; i < $scope.contactInfo.length; i++) {\n if ($scope.contactInfo[i].type === 'url') {\n EventFormData.contactPoint.url.push($scope.contactInfo[i].value);\n }\n else if ($scope.contactInfo[i].type === 'phone') {\n EventFormData.contactPoint.phone.push($scope.contactInfo[i].value);\n }\n else if ($scope.contactInfo[i].type === 'email') {\n EventFormData.contactPoint.email.push($scope.contactInfo[i].value);\n }\n }\n\n var promise = eventCrud.updateContactPoint(EventFormData);\n promise.then(function() {\n controller.eventFormSaved();\n $scope.contactInfoCssClass = 'state-complete';\n $scope.savingContactInfo = false;\n }, function() {\n $scope.contactInfoError = true;\n $scope.savingContactInfo = false;\n });\n\n }\n }", "function editCancelFunc(){\n setEdit(null);\n }", "function handleCancelEdit() {\n updateIsEditMode(false);\n }", "function updateContact() {\n const contact = getContactFormData()\n if (!contact.contactId) {\n log('Cannot update a contact with no contact ID!')\n } else {\n client.contacts.update(contact)\n }\n}", "function editingCanceled() {\n\tlocation.reload();\n}", "close() {\n\t\tthis.model.save({ content: this.input.val() });\n\t\tthis.$el.removeClass('editing');\n\t}", "function saveContact() {\n let name = document.getElementById('txtName').value;\n let surname = document.getElementById('txtSurname').value;\n let phone = document.getElementById('txtPhone').value;\n let address = document.getElementById('txtAddress').value;\n\n onlyOneChecked = false;\n\n /* If a contact has been selected for modification, modify ADDRESSES array*/\n for (i=0; i<ADDRESSES.length; i++) {\n if (ADDRESSES[i].checked) {\n ADDRESSES[i].checked = false;\n if (document.getElementById('txtName').value!=='' &&\n document.getElementById('txtSurname').value!=='' &&\n document.getElementById('txtPhone').value!=='' &&\n document.getElementById('txtAddress').value!=='') {\n ADDRESSES[i].name = document.getElementById('txtName').value;\n ADDRESSES[i].surname = document.getElementById('txtSurname').value;\n ADDRESSES[i].phone = document.getElementById('txtPhone').value;\n ADDRESSES[i].address = document.getElementById('txtAddress').value;\n }\n\n onlyOneChecked = true;\n }\n };\n\n /* If no contact has been selected for modification, add new contact */\n if (!onlyOneChecked) {\n if (name!=='' && surname!=='' && phone!=='' && address!=='') {\n ADDRESSES.push({\n checked: false,\n name: name,\n surname: surname,\n phone: phone,\n address: address\n });\n }\n };\n\n displayTbl(ADDRESSES);\n}", "function endEditAboutMe() {\n $save_or_cancel_edit_about_me.css(\"display\", \"none\");\n $link_edit_about_me.css(\"display\", \"inline\");\n $edit_about_me.css(\"display\", \"none\");\n $about_me.css(\"display\", \"block\");\n\n return false;\n }", "edit() {\n this._enterEditMode();\n }", "function saveContacts() {\n window.localStorage.setItem('contacts', JSON.stringify(contacts))\n sortContacts(sortType)\n drawContacts()\n}", "function ContactChange() {\n\t//------------------------------------------------------------------------------\n\tvar $Form = document.forms['ContactEditForm'];\n\t//------------------------------------------------------------------------------\n\t$HTTP = new HTTP();\n\t//------------------------------------------------------------------------------\n\tif (!$HTTP.Resource) {\n\t\t//------------------------------------------------------------------------------\n\t\talert('Не удалось создать HTTP соединение');\n\t\t//------------------------------------------------------------------------------\n\t\treturn false;\n\t\t//------------------------------------------------------------------------------\n\t}\n\t//------------------------------------------------------------------------------\n\t//------------------------------------------------------------------------------\n\t$HTTP.onLoaded = function() {\n\t\t//------------------------------------------------------------------------------\n\t\tHideProgress();\n\t\t//------------------------------------------------------------------------------\n\t}\n\t//------------------------------------------------------------------------------\n\t//------------------------------------------------------------------------------\n\t$HTTP.onAnswer = function($Answer) {\n\t\t//------------------------------------------------------------------------------\n\t\tswitch ($Answer.Status) {\n\t\tcase 'Error':\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tShowAlert($Answer.Error.String, 'Warning');\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tbreak;\n\t\t\t//------------------------------------------------------------------------------\n\t\tcase 'Exception':\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tShowAlert(ExceptionsStack($Answer.Exception), 'Warning');\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tbreak;\n\t\t\t//------------------------------------------------------------------------------\n\t\tcase 'Ok':\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tShowProgress('Изменение контактного адреса');\n\t\t\tsetTimeout(\n\t\t\t\t//------------------------------------------------------------------------------\n\t\t\t\tfunction (){\n\t\t\t\t\t//------------------------------------------------------------------------------\n\t\t\t\t\tShowWindow('/UserPersonalDataChange');\n\t\t\t\t\t//------------------------------------------------------------------------------\n\t\t\t\t},\n\t\t\t\t//------------------------------------------------------------------------------\n\t\t\t1000);\n\t\t\t//------------------------------------------------------------------------------\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tbreak;\n\t\t\t//------------------------------------------------------------------------------\n\t\tdefault:\n\t\t\t//------------------------------------------------------------------------------\n\t\t\talert('Не известный ответ');\n\t\t\t//------------------------------------------------------------------------------\n\t\t}\n\t\t//------------------------------------------------------------------------------\n\t};\n\t//------------------------------------------------------------------------------\n\t//------------------------------------------------------------------------------\n\tvar $Args = FormGet($Form);\n\t//------------------------------------------------------------------------------\n\tif (!$HTTP.Send('/API/ContactEdit', $Args)) {\n\t\t//------------------------------------------------------------------------------\n\t\talert('Не удалось отправить запрос на сервер');\n\t\t//------------------------------------------------------------------------------\n\t\treturn false;\n\t\t//------------------------------------------------------------------------------\n\t}\n\t//------------------------------------------------------------------------------\n\t//------------------------------------------------------------------------------\n\tShowProgress('Отправка данных на сервер');\n\t//------------------------------------------------------------------------------\n\t//------------------------------------------------------------------------------\n}", "function coauthors_stop_editing( event ) {\n\n\t\tvar co = jQuery( this );\n\t\tvar tag = jQuery( co.next() );\n\n\t\tco.attr( 'value',tag.text() );\n\n\t\tco.hide();\n\t\ttag.show();\n\n\t//\tediting = false;\n\t}", "function endEdit(){\n // Reset task form and update UI\n displayTaskForm();\n updateUI()\n}", "function editModel(data) {\n /// start edit form data prepare\n /// end edit form data prepare\n dataSource.one('sync', function(e) {\n /// start edit form data save success\n /// end edit form data save success\n\n app.mobileApp.navigate('#:back');\n });\n\n dataSource.one('error', function() {\n dataSource.cancelChanges(itemData);\n });\n\n dataSource.sync();\n app.clearFormDomData('edit-item-view');\n }", "function onSubmit() {\n const { name, address } = contact;\n const query = panelType === EDIT\n ? updateContactAndUpdateList\n : createContactAndUpdateList;\n\n const hasError = validateContactForm({ name, address });\n setInputErrors(hasError || initialInputErrorState);\n\n if (!hasError) {\n const { description, ...restContact } = contact;\n\n const escapedContact = {\n ...restContact,\n description: safeString(description),\n };\n\n query(manager, setContacts, escapedContact).then(onClose);\n }\n }", "cancelEdit() {\n this.set('isManage', false);\n this.folder.set('isEdit', false);\n this.folder.rollbackAttributes();\n }", "cancelEdit() {\n this.folderUser.set('isEdit', false);\n this.set('isManage', false);\n }", "save() {\n try {\n this._toggleSaveThrobber();\n this._readFromForm();\n this.dao.save();\n\n // make sure the edit input is showing the correct id, reload data from server\n document.getElementById('edit_id').value = this.dao.id;\n this.read();\n \n } catch(e) {\n console.log(e);\n alert(e);\n }\n this._toggleSaveThrobber();\n }", "function cancelEditLead() {\n clearEditLeadForm();\n}", "function updateContact(contact) {\n if (validateInput()) {\n ContactsController.Update(\n contact.Id,\n $(\"#contactSupIDInput\")[0].value,\n $(\"#contactFullNameInput\")[0].value,\n $(\"#contactPhoneNoInput\")[0].value,\n onUpdateContact\n );\n }\n}", "function deleteContact() {\n app.f7.actions([[{\n text: 'Delete Contact',\n red: true,\n onClick: function() {\n var contacts = Persistence.getAllContacts();\n _.remove(contacts, { _id: contact._id });\n Persistence.setAllContacts(contacts);\n app.router.load('list'); // reRender main page view\n app.mainView.goBack(\"../index.html\", false);\n app.f7.closeModal();\n }\n }],\n [{\n text: 'Cancel',\n bold: true\n }]]);\n }", "function saveEdited(){\n\tactiveDataSet = studentList.find( arr => arr.absenceId == activeElement ); \n\t$.post(\"\", {\n\t\t\t\t'type': 'editabsence',\n\t\t\t\t'console': '',\n\t\t\t\t'aid': activeDataSet['absenceId'],\n\t\t\t\t'id': activeElement,\n\t\t\t\t'start': formatDateDash(document.getElementById('esickstart').value),\n\t\t\t\t'end': formatDateDash(document.getElementById('esickend').value),\n\t\t\t\t'comment': document.getElementById('ecomment').value,\n\t\t\t\t'evia': document.querySelector('input[name=\"evia\"]:checked').value\n }, function (data,status) {\n\t\t\t\thandleServerResponse(data, status);\n\t\t\t});\t\n}", "function onSaveContactCopy(e) {\n \n $(\"#cont_options_popup\").popup(\"close\");\n var newContact = activeContact.clone();\n newContact.save(onSuccess, onError);\n \n function onSuccess(contact) {\n alert(\"The contact duplicate \" + buildDisplayName(contact) + \" was successfully created\");\n displContactList.updateList();\n };\n\n function onError(contactError) {\n alert(\"The contact cannot be duplicated. Error: \" + contactError.code);\n };\n}", "cancelEditAddress() {\n this.vendor.address = this.addressRevertData.address;\n this.vendor.state = this.addressRevertData.state;\n this.vendor.city = this.addressRevertData.city;\n this.vendor.zip_code = this.addressRevertData.zip_code;\n\n this.addressRevertData = '';\n }", "cancelEditType() {\n this.type = this.editing;\n this.editing = '';\n }", "function saveReset() {\n saveBtn.style.display = 'none';\n deleteBtn.style.display = 'inline-block';\n editDestinationID.contentEditable = 'false';\n editCommentID.contentEditable = 'false';\n editDestinationID.style.border = 'none';\n editCommentID.style.border = 'none';\n }", "function resetEdit() {\n\t$('.icons').removeClass('editable');\n\t$('#save-recipe, #cancel-recipe').hide();\n\t$('#detail-description, #detail-name').attr('contenteditable', false);\n\t$('#detail-new-ingredient-input').hide();\n}", "function saveAction(){\n\t\tvar data = getInput();\n\t\tif(data.id == \"\") {\n\t\t\t// delete the id property as it's\n\t\t\t// automatically set by database.\n\t\t\tdelete data.id;\n\t\t\tupdateDB(\"add\", data);\n\t\t}\n\t\telse {\n\t\t\tdata.id = Number(data.id);\n\t\t\tupdateDB(\"edit\", data);\n\t\t}\n\t\tclearInput();\n\t}", "function cancel_contact() {\n var item_id = $(\"#contact-id\", \"#contact-form\").val();\n if (item_id) {\n var validation_bkup = validate_form;\n validate_form = function(form) {return true;}; // deshabilitar validaciones\n save_contact();\n validate_form = validation_bkup;\n } else {\n $(\"#contact-form\").fadeOut();\n }\n}", "function editarContacto(nombreEliminar,a,b,c) {\n\tfor (var i =0;i < arrayContactos.length;i++) {\n\t\tif (arrayContactos[i].nombre == nombreEliminar ) {\n\t\t\tarrayContactos[i].nombre=a;\n\t\t\tarrayContactos[i].direccion=b;\n\t\t\tarrayContactos[i].telefono=c;\n\t\t}\n\t}\n\tguardarDatosLocales();\n}", "function abortEditing() {\n\t\t$('.editing').removeClass('editing');\n\t\t$('.edit').val('').off('keyup');\n\t}", "function saveContact() {\n//instantiate Parse.Object.extend (same as a model in Backbone)\n var contact = new Contact;\n//capture the values of the input fields via JQuery awesomeness\n var name = $('.name').val();\n var city = $('.city').val();\n var email = $('.email').val();\n//set the values of input fields as values in our contact object instantiated 2 steps above\n contact.set(\"name\", name);\n contact.set(\"city\", city);\n contact.set(\"email\", email);\n\n/*Save function: on successful save: log success message, instantiate ContactView and pass in the model,\nclear each of the input values; if error, log error message*/\n contact.save(null, {\n success: function(contactList){\n console.log('New object created with objectID' + contact.id);\n new ContactView({model: contactList});\n var name = $('.name').val('');\n var city = $('.city').val('');\n var email = $('.email').val('');\n },\n error: function(contactList, error){\n console.log('Failed to create new object, with error code' + error.description); \n }\n })\n\n }", "checkValues(e) {\r\n let validatePhoneNumber =\r\n /^[\\+]?[(]?[0-9]{3}[)]?[-\\s\\.]?[0-9]{3}[-\\s\\.]?[0-9]{4,6}$/.test(\r\n this.phoneNumber\r\n );\r\n let validateName = this.name.length > 0;\r\n //checking the conditions\r\n if (validatePhoneNumber && validateName) {\r\n if (e.target.textContent == \"save\") {\r\n //call createContact function\r\n this.createContact();\r\n //create a contact object\r\n let contact = {\r\n name: this.name,\r\n phone_number: this.phoneNumber,\r\n website: this.website,\r\n description: this.description,\r\n };\r\n //push the object to the end of the list array\r\n Contact.list.push(contact);\r\n } else if (e.target.textContent == \"update\") {\r\n let contact = {\r\n name: document.querySelector(\"#name\").value,\r\n phone_number: document.querySelector(\"#phone\").value,\r\n website: document.querySelector(\"#website\").value,\r\n description: document.querySelector(\"#description\").value,\r\n };\r\n document.querySelector(\r\n `[data-contactNumber='${Contact.clickedContact}'] .profile`\r\n ).textContent = contact.name[0].toUpperCase();\r\n document.querySelector(\r\n `[data-contactNumber='${Contact.clickedContact}'] .name`\r\n ).textContent = contact.name;\r\n document.querySelector(\r\n `[data-contactNumber='${Contact.clickedContact}'] .description-text`\r\n ).textContent = contact.description;\r\n //change users clicked contact\r\n Contact.list[Contact.clickedContact] = contact;\r\n }\r\n\r\n UI.addToLs();\r\n UI.closeForm();\r\n UI.resetForm();\r\n } else if (validateName && !validatePhoneNumber) {\r\n document.querySelector(\".for-name\").style.color = \"black\";\r\n document.querySelector(\".for-phone\").style.color = \"red\";\r\n alert(\"please enter a correct phone number!\");\r\n } else if (!validateName && validatePhoneNumber) {\r\n document.querySelector(\".for-phone\").style.color = \"black\";\r\n document.querySelector(\".for-name\").style.color = \"red\";\r\n alert(\"please enter a name!\");\r\n } else if (!validateName && !validatePhoneNumber) {\r\n document.querySelector(\".for-phone\").style.color = \"red\";\r\n document.querySelector(\".for-name\").style.color = \"red\";\r\n alert(\"please enter a name and correct phone number!\");\r\n }\r\n }", "function onModifyCourse() {\n 'use strict';\n if (lastCheckedCourse === -1) {\n\n window.alert(\"Warning: No course selected !\");\n return;\n }\n\n var course = FirebaseCoursesModule.getCourse(lastCheckedCourse);\n txtCourseNameModified.value = course.name;\n txtCourseDescriptionModified.value = course.description;\n dialogModifyCourse.showModal();\n }", "cancelEdit() {\n if (this._editedLevel > 0) {\n this._editedLevel--;\n }\n\n // Cancel in sub-models\n if (this._editedLevel === 0) {\n _each(this._childCollections, childCollection => {\n childCollection.cancelEdit();\n });\n\n // Revert changes\n // TODO\n\n // Reset state\n this._editedEvents = [];\n }\n }", "function edit()\n{\n $(document).on('click', '#edit', function()\n {\n let id = $(this).attr('contacts-id');\n \n $.ajax({\n url:'contacts',\n method:'POST',\n data:{ contactId:id },\n dataType: 'JSON',\n success: function(data)\n {\n $('#up-id').val(data[0]);\n $('#up-name').val(data[1]);\n $('#up-email').val(data[2]);\n $('#up-phone').val(data[3]);\n }\n })\n return false;\n })\n}", "function doEdit(){\n\n\n if(validation() == false)\n return ;\n\n doEditInLocalstorage(prevli) ;\n doEditInShowList(prevli) ;\n\n\n /*********** Going back to again add Task Field ************/ \n \n document.getElementById(\"task\").value = \"\" ;\n document.getElementById(\"editButton\").style.display = 'none' ;\n document.getElementById(\"addButton\").style.display = 'block' ;\n\n /***************** End ***********************/\n\n\n }", "function setSaveButtonEvent(){ \n\t$('#save-contact-btn').click(function(){ \n\t\t$('#notice').hide(); \n\t\tvar name=$('#name').val(); \n\t\tvar phone=$('#phone').val(); \n\t\tvar twitter=$('#twitter').val();\n\t\tif(name==\"\" || phone==\"\" || twitter==\"\"){ \n\t\t\t$('#notice').empty().html('No field can be empty').show('slow'); \n\t\t}else if(isNaN(new Number(phone))){ \n\t\t\t$('#notice').empty().html('the phone field must contain valid numeric data').show('slow'); \n\t\t}else if((parseInt(phone/1000000)==0)){ \n\t\t\t$('#notice').empty().html('the phone field is too short, it must be minimum 7 characters XXX-XXXX').show('slow'); \n\t\t}else if((parseInt(100000000000/phone)==0)){ \n\t\t\t$('#notice').empty().html('the phone field is too long, it must be maximum 11 characters X-XXX-XXX-XXXX').show('slow'); \n\t\t}else if(name.match(/\\d/)){ \n\t\t\t$('#notice').empty().html('the name field must not contain numeric input').show('slow'); \n\t\t}else if(twitter.length > 15){\n\t\t\t$('#notice').empty().html('Woops, twitter only allows maximum 15 character handles').show('slow');\n\t\t}else if(isDuplicate(name,phone,twitter)){ \n\t\t\t$('#notice').empty().html('the contact info you specified is already in the database').show('slow'); \n\t\t}else{ \n\t\t\t$('#notice').empty().html('saving....').show(); \n\t\t\t$.ajax({ \n\t\t\t url: 'http://addressbook.jessica-johnson.ca/addressbook.php', \n\t\t\t data: 'action=add&name='+name+'&phone='+phone+'&twitter='+twitter, \n\t\t\t dataType: 'json', \n\t\t\t type: 'POST', \n\t\t\t success: function (j) { \n\t\t\t\t$('#notice').empty().html(j.msg); \n\t\t\t\t$('#name').val(''); \n\t\t\t\t$('#phone').val('');\n\t\t\t\t$('#twitter').val(''); \n\t\t\t\t$('#add-contact-form').hide(); \n\t\t\t\tdisplayAddressList(j.contacts); \n\t\t\t },\n\t\t\t error: function (xhr,error){\n\t\t\t \tconsole.debug(xhr); console.debug(error);\t\n\t\t\t } \n\t\t\t}); \n\t\t} \n\t}); \n}", "function onEdit(){\n var statusChange = new StatusObject();\n while (true){\n getChangeIndex(statusChange);\n if (statusChange.index == -1){\n return;\n } else {\n var request = new Submission(statusChange.row);\n if (statusChange.status){\n request.status = statusChange.status;\n if (statusChange.status == \"Approve\"){\n updateCalendar(request);\n }\n draftEmail(request);\n sendEmail(request);\n }\n }\n }\n}", "saveAndClose() {\n this._mutateModel();\n\n this._super(...arguments);\n }", "function onClickDeleteContact() {\n // va rajouter la propriété data-index ayant pour valeur l'index dans la balise a suivant celle ayant un id contact-details. Lie l'index du tableau de contacts (donc le contact que l'on veut) avec le lien cliquable sur le nom du contact\n //stocke ça dans variable index\n var index = $('#contact-details a').data('index');\n\n /*stock les données du localStorage dans la variable*/\n var addressBook = loadAddressBook();\n\n //fonction prédéfinie supprimant le premier élément de index (définit localement au-dessus) de addressBook(tableau des contacts). Car premier élément de index de adressbook est le tableau/objet contenant le contact\n addressBook.splice(index, 1);\n\n //l'enregistre sur l'adressBook non local, écrasant son contenu actuel\n saveAddressBook(addressBook);\n\n //cache les détails du contact\n $('#contact-details').hide();\n\n // relance la page pour faire disparaître le contact\n refreshAddressBook();\n\n}", "function onClickClearAddressBook() {\n //définit variable locale addressBook comme un tableau vide\n var addressBook = new Array();\n \n //l'enregistre sur l'adressBook non local, écrasant son contenu actuel\n saveAddressBook(addressBook);\n\n // cache les détails du contact en cours s'ils sont affichés (a cliqué sur contact)\n $('#contact-details').hide();\n\n // relance la page pour faire disparaître les contacts\n refreshAddressBook();\n}", "function deleteContact(){\n var id = readLineSync.question(\"Lua chon id contact can xoa: \");\n listContact.splice(id,1);\n save();\n console.log(\"\\nXoa thanh cong nhe!\")\n\n}", "function editContact(contact_id){\n\t\tvar confirmation = confirm(\"Are you sure you want to edit it ?\"); \n\t\t\tif(confirmation == true){\n\t\t\t\tvar wordObj = {\"contact_id\":contact_id};\n\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\ttype:\"POST\",\n\t\t\t\t\t\turl: \"editContact.php\",\n\t\t\t\t\t\tdata: wordObj,\n\t\t\t\t\t\tsuccess: function(data){\n\t\t\t\t\t\t\tvar obj = JSON.parse(data);\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t$(\"input[name = 'contact_id']\").val(obj.contact_id);\n\t\t\t\t\t\t\t\t$(\"input[name = 'firstname']\").val(obj.firstname);\n\t\t\t\t\t\t\t\t$(\"input[name = 'middlename']\").val(obj.middlename);\n\t\t\t\t\t\t\t\t$(\"input[name = 'lastname']\").val(obj.lastname);\n\t\t\t\t\t\t\t\t$(\"input[name = 'address']\").val(obj.address);\n\t\t\t\t\t\t\t\t$(\"input[name = 'contact_number']\").val(obj.contact_number);\n\t\t\t \t\t\t\t\t$(\"input[name = 'date']\").val(obj.date);\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror: function(data){\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t}\t \n }", "function crmEditAddressSaved(data) {\n if (!data.error) {\n $(\"#editAddressModal\").modal(\"hide\");\n location.reload();\n }\n arcGetStatus();\n}", "function handleSubmit(e) {\n // function to create a new contact and then close the model\n e.preventDefault();\n createContact(idRef.current.value,nameRef.current.value);\n closeModal();\n\n // create contact\n }", "function reset() {\n save(null);\n }", "function onModifyStudent() {\n 'use strict';\n if (lastCheckedStudent === -1) {\n window.alert(\"Warning: No student selected !\");\n return;\n }\n\n var student = FirebaseStudentsModule.getStudent(lastCheckedStudent);\n txtStudentFirstNameModified.value = student.firstname;\n txtStudentLastNameModified.value = student.lastname;\n txtStudentEMailModified.value = student.email;\n dialogModifyStudent.showModal();\n }", "saveAndExit() {\n saveAndExit();\n }", "function upsertContact() {\n var data = {};\n vm.isSubmit = true;\n\n // Bind typename\n angular.forEach(vm.contacts, function (contact) {\n contact.typeName = type[contact.typeId];\n });\n\n // If the StudentId and AcademicYearId are given in the route, this means that\n // the application will be modified by another person (Administrator).\n // Otherwise, the application will be modified by a student\n data.UserId = $routeParams.StudentId || Global.user.id;\n data.AcademicYearId = $routeParams.AcademicYearId || null;\n\n data.contacts = vm.contacts;\n\n\n $http.post('/api/scholarships/upsert/contacts', data).success(function (hs) {\n vm.isSuccess = true;\n // Reinit data for the sake of getting an id from DB\n Scholarships.reInit($routeParams.StudentId, $routeParams.AcademicYearId).then(function () {\n init();\n $timeout(function () {\n vm.isSaved = true;\n vm.isSuccess = false;\n vm.isSubmit = false;\n }, 5000);\n });\n }).error(function (err) {\n vm.isError = true;\n $timeout(function () {\n vm.isError = false;\n vm.isSubmit = false;\n }, 5000);\n\n });\n }", "function Save() {\n if ($('#ab041AddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab041\",vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n } else {\n dataContext.upDate(\"/api/ab041\", vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n }\n }\n }", "function cancelWrite() {\n pendingRecord = null;\n writePending = false;\n overwritePendingText.classList.remove('active');\n overwriteCancelButton.classList.remove('active');\n}", "dispose() {\n this._save();\n }", "function cancelEdit() {\n resetForm();\n formTitle.innerHTML = 'Add Link';\n cancelButton.parentElement.removeChild(cancelButton);\n updateButton.parentElement.removeChild(updateButton);\n saveButton.classList.remove('hidden');\n }", "@action closeEditingCategoryDialog() {\n this.isEditingCategory = false;\n this.editingCategoryData = {\n name: '',\n id: null,\n parentId: null,\n };\n }", "function saveContactInfo(name, email, message) {\n let newContactInfo = contactInfo.push();\n sendAnimation()\n\n newContactInfo.set({\n name: name,\n email: email,\n message: message,\n });\n}", "edit() {\n if (this.valid && this.changed) {\n\n ipcRenderer.send('studentUpdate', {\n id: this.id,\n fullName: this.name.value,\n socialID: this.sid.value,\n parentsName: this.parentName.value,\n parentNumber: this.parentPhone.value,\n sex: this.sex.value,\n phoneNumber: this.phone.value,\n birthDate: `${this.birthDate.year.value}/${this.birthDate.month.value}/${this.birthDate.day.value}`,\n address: this.address.value\n })\n\n this.changed = false\n }\n }", "function cancel_score_edit()\n\t{\n\t\tdocument.getElementById('score_edit_form').reset();\n\t\t$('#score_edit').dialog('close');\n\t}", "function saveCurrentContactName(contactName){\n PropertiesService.getUserProperties().setProperty(\"currentContact\", contactName);\n}", "cancelEdit(todo) {\n this.editTodo = null;\n todo.isEdited = false;\n }", "finishEdit(state, { id, edits, editType }) {\n if (state.beforeEdit[id]) {\n Object.assign(state.parts[id], state.beforeEdit[id])\n remember(state, [editPart(state, id, edits, editType)])\n delete state.beforeEdit[id]\n }\n }", "function submitEdit() {\n\treadEditorFields(editingPage)\n\tme.postPage(editingPage, function(e, resp) {\n\t\tif (e) {\n\t\t\talert(\"ERROR\")\n\t\t} else {\n\t\t\twindow.location.hash = \"#pages/\"+resp.id\n\t\t\tcleanUpEditor()\n\t\t}\n\t})\n}", "function cancelEdit(e){\n e.preventDefault();\n \n Session.set('editingPost', null);\n}", "function setSelectedContactForChat(contactId) {\n localStorage.setItem(configSrvc.cidLocalStorage, contactId);\n }", "function cancelEditOpp() {\n clearEditOppForm();\n}", "function closeEditDialog() {\n // Hide the dialog \n overlay.classList.add('visibility');\n // Re-enable the scrollbar\n document.body.classList.remove('model-open');\n // Deleting the inputs in the fields\n editDialogUid.value = \"\";\n editDialogUsername.value = \"\";\n editDialogEmail.value = \"\";\n editDialogMobile.value = \"\";\n editDialogAddress.value = \"\";\n editDialogPassword.value = \"\";\n editDialogConfirmPassword.value = \"\";\n}", "function saveCharacterEdits(){}", "function onClickSaveContactButton()\n{\n // grab all of the contact fields\n var firstName = $(\"first_name_element\").value.trim();\n var lastName = $(\"last_name_element\").value.trim();\n var phoneNum = $(\"phone_number_element\").value.trim();\n var email = $(\"email_element\").value.trim();\n var gender = $(\"gender_element\").value.trim();\n var age = $(\"age_element\").value.trim();\n var id = $(\"id_element\").value.trim();\n\n // make sure we have either a first or last name\n if(firstName==\"\" && lastName==\"\"){\n alert(\"Please enter either a first name or a last name.\");\n $(\"first_name_element\").focus();\n $(\"first_name_element\").select();\n return;\n }\n\n if(firstName.length > 30){\n alert(\"Please limit name to less than 30 characters.\");\n $(\"first_name_element\").focus();\n $(\"first_name_element\").select();\n return;\n }\n\n if(lastName.length > 30){\n alert(\"Please limit name to less than 30 characters.\");\n $(\"last_name_element\").focus();\n $(\"last_name_element\").select();\n return;\n }\n\n if(phoneNum.length > 25){\n alert(\"Please limit phone number to less than 25 characters.\");\n $(\"phone_number_element\").focus();\n $(\"phone_number_element\").select();\n return;\n }\n\n if(email.length > 40){\n alert(\"Please limit email address to less than 40 characters.\");\n $(\"email_element\").focus();\n $(\"email_element\").select();\n return;\n }\n\n if(parseInt(age,10)>120 || parseInt(age,10)<1){\n alert(\"Please enter an age between 1 - 120\");\n $(\"age_element\").focus();\n $(\"age_element\").select();\n return;\n }\n\n if(id.length > 10){\n alert(\"Please limit ID to less than 10 digits.\");\n $(\"id_element\").focus();\n $(\"id_element\").select();\n return;\n }\n\n\n // are we modifying an existing contact?\n if(document.selectedRow != null){\n var previousFirstName = document.selectedRow.cells[FIRST_NAME_INDEX].innerHTML;\n var previousLastName = document.selectedRow.cells[LAST_NAME_INDEX].innerHTML;\n\n if(!confirm(`Update existing contact? ${previousFirstName} ${previousLastName}`))\n return;\n\n updateDBContact(firstName,lastName,phoneNum,email,gender,age,id);\n }\n // or adding a new contact?\n else{\n addDBContact(firstName,lastName,phoneNum,email,gender,age);\n }\n}" ]
[ "0.6590464", "0.64225984", "0.6344823", "0.63035953", "0.62980086", "0.6267901", "0.62558484", "0.6176916", "0.61483413", "0.6123719", "0.6115538", "0.60831296", "0.6026321", "0.59915984", "0.5989036", "0.59882796", "0.5953554", "0.592548", "0.5917238", "0.5896775", "0.5878427", "0.5874651", "0.5849843", "0.5846817", "0.5840552", "0.5833273", "0.58311594", "0.58296204", "0.5774653", "0.57440174", "0.57440174", "0.57413226", "0.57069033", "0.56985676", "0.56954354", "0.56620204", "0.56510353", "0.5646912", "0.56328434", "0.563268", "0.56275934", "0.56257117", "0.56144166", "0.55849016", "0.55607706", "0.55572116", "0.55530655", "0.55523944", "0.5544118", "0.55192614", "0.54988104", "0.54835343", "0.5465041", "0.5449395", "0.54287523", "0.5426705", "0.54107773", "0.5402486", "0.54019916", "0.5395901", "0.5393426", "0.537568", "0.5358101", "0.5354987", "0.5353803", "0.5321104", "0.5320072", "0.53196967", "0.53146213", "0.5308527", "0.5307884", "0.5305445", "0.5303621", "0.5297886", "0.52876115", "0.5286091", "0.5284104", "0.52832603", "0.5278782", "0.52656114", "0.5255734", "0.52512425", "0.5248174", "0.5246981", "0.5244012", "0.52434045", "0.5241428", "0.52411205", "0.5236209", "0.52291596", "0.52289516", "0.5223434", "0.52201617", "0.520476", "0.520406", "0.5201484", "0.51916015", "0.5191322", "0.5190797", "0.5190415" ]
0.74033976
0
Return the contact that is currently being edited.
getContact() { return this.scope.attr('contact'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getEditContact() {\n\t var contactName = Session.get(\"editContact\");\n\t return Template.contacts.__helpers[\" findContact\"](contactName);\n\t}", "get contact() {\n\t\treturn this.__contact;\n\t}", "get contact() {\n\t\treturn this.__contact;\n\t}", "get contact () {\n\t\treturn this._contact;\n\t}", "get contact () {\n\t\treturn this._contact;\n\t}", "get contact () {\n\t\treturn this._contact;\n\t}", "get contact () {\n\t\treturn this._contact;\n\t}", "function getSelectedContactForChat() {\n return localStorage.getItem(configSrvc.cidLocalStorage);\n }", "get editRef() {\n return this._editRef;\n }", "function getSelectedContactForInfo() {\n return localStorage.getItem(configSrvc.cinfoLocalStorage);\n }", "function editContact(id) { // editing is actually done in edit.js\n // store id, to be retrieved in edit.js on edit.html\n localStorage.idOfContactBeingEdited = JSON.stringify(id);\n}", "getVisibleContactTextBox(){\n return this.contactText;\n }", "function contact() {\n var _this = _super.call(this, contact.metadata.logicalName) || this;\n _this.entityType = contact;\n return _this;\n }", "function editContact(){\n\n}", "getContactInfo(e) {\r\n Contact.clickedContact = Number(\r\n e.currentTarget.getAttribute(\"data-contactNumber\")\r\n );\r\n console.log(Contact.clickedContact);\r\n document.querySelector(\"#name\").value =\r\n Contact.list[Contact.clickedContact].name;\r\n document.querySelector(\"#phone\").value =\r\n Contact.list[Contact.clickedContact].phone_number;\r\n document.querySelector(\"#website\").value =\r\n Contact.list[Contact.clickedContact].website;\r\n document.querySelector(\"#description\").value =\r\n Contact.list[Contact.clickedContact].description;\r\n UI.openForm(\"update\");\r\n saveContactButton.textContent = \"update\";\r\n deleteContactButton.style.display = \"block\";\r\n }", "_getEditInput() {\n return this.contentEditInput || this.defaultEditInput;\n }", "function currentMod() {\n return UserRecords.focusRecord;\n }", "function getContact(id) {\n return contacts[id];\n }", "GetContactManager() {\n return this.m_contactManager;\n }", "function getContactData() {\n return contactData;\n }", "function editContact(){\n var id = readLineSync.question('Lua chon id contact can sua: ');\n var name = readLineSync.question('name: ');\n var phone = readLineSync.question('phoneNum:');\n listContact[id].Name = name;\n listContact[id].Phone = phone;\n save();\n console.log(\"\\nsua thanh cong nhe!\");\n }", "GetContactList() {\n return this.m_contactManager.m_contactList;\n }", "routeChange(event, contactId) {\n let contact = null;\n if (contactId === 'new') {\n // Create a new contact to edit\n contact = new Contact();\n } else {\n // Lookup the contact in the global list by its contact\n contact = Contact.store[contactId];\n if (contact) {\n // Save a copy of the contact's attributes so that it can be reverted later if necessary\n contact.backup();\n } else {\n // No contact has that contactId\n console.error('Attempting to navigate to a non-existent contact!');\n Navigator.openParentPage();\n }\n }\n\n this.setContact(contact);\n }", "async getEditPort() {\n return this._edit_port_lock;\n }", "editing() {\n \t\treturn Session.get(\"targetlist\" + this._id);\n \t}", "contact(state) {\n return state.contact;\n }", "get editing() {\n\t\treturn this.classList.contains('editing');\n\t}", "function getFocusEntity()\n\t{\n\t\treturn _focus;\n\t}", "getContact() {\n const contactId = this.props.match.params.contactId;\n const { reducer } = this.props;\n const { contact } = reducer;\n\n // Since this methods fires on componentDidUpdate we must do some checks\n // to ensure we only dispatch the event when the contact ID in the URL\n // is different than the ID of the contact in the reducer. If we don't\n // we'll get a endless loop of requests to our backend\n if (!contact.id || contact.id.toString() !== contactId) {\n this.context.store.dispatch(getContact(contactId));\n }\n }", "function editRow(contact) {\r\n if (searchRow(contact.id, 0, tableContent.children.length-1, contact)){\r\n console.log(\"found!\");\r\n }\r\n}", "get contact(): ?Contact {\n if (this.isContact) {\n return (this.message: any).contact;\n }\n return null;\n }", "function getContact(){\r\n var mycontact = getContacts();\r\n return mycontact;\r\n}", "get contacts() {\r\n return new Contacts(this);\r\n }", "get contacts() {\r\n return new Contacts(this);\r\n }", "function getContacts() {\n return contacts;\n }", "function edit(){\n\t\treturn M.status == 'edit';\n\t}", "saveContact() {\n const contact = this.getContact();\n if (contact.isNew() || contact.isDirty()) {\n contact.save();\n }\n }", "function focusContact(index) {\n return function(dispatch, getState) {\n var state = getState();\n var contact = state.outlook.pages[state.outlook.page][index];\n // If it's a CRM contact update initials\n if (state.outlook.contactView === model_2.ContactViewMode.CRM) {\n dispatch({\n type: actionTypes_1.default.UPDATE_CONTACT,\n payload: {\n index: index,\n values: {\n Initials: \"\" +\n (contact.firstname ? contact.firstname.charAt(0) + '.' : '') +\n (contact.lastname ? contact.lastname.charAt(0) + '.' : '')\n }\n }\n });\n }\n if (contact[model_2.CrmExtendedProperty.CRM_ID]) {\n var crmId = contact[model_2.CrmExtendedProperty.CRM_ID];\n var strippedId = crmId.substring(crmId.indexOf('{') + 1, crmId.indexOf('}'));\n crmInterface_1.crmGet(\"contacts(\" + strippedId + \")\", state.app.crmAccessKey, {})\n .then(function(success) {\n var data = JSON.parse(success);\n var imageUrl = data['entityimage_url'];\n var image = data['entityimage'];\n if (image) {\n imageUrl = \"data:image;base64,\" + image.toString();\n }\n if (imageUrl) {\n dispatch({\n type: actionTypes_1.default.UPDATE_CONTACT,\n payload: {\n index: index,\n values: {\n imageUrl: imageUrl\n }\n }\n });\n }\n },\n function(error) {\n console.error(error);\n });\n }\n if (contact[model_2.CrmExtendedProperty.CRM_ID] &&\n contact[model_2.CrmExtendedProperty\n .CRM_LINK_STATE] ==\n model_2.CrmExtendedProperty.CRM_LINK_STATE_LINKED) {\n crmInterface_1.crmGetNextActivity(contact[model_2.CrmExtendedProperty.CRM_ID],\n state.app.crmAccessKey)\n .then(function(success) {\n if (success.results[0]) {\n var activity = success.results[0];\n activity.date = activity.ScheduledStart\n .substring(activity.ScheduledStart.indexOf('(') + 1,\n activity.ScheduledStart.indexOf(')'));\n if (Date.now() < activity.date) {\n dispatch({\n type: actionTypes_1.default.UPDATE_CONTACT_ACTIVITY,\n payload: {\n index: index,\n activityKey: 'nextActivity',\n activity: activity\n }\n });\n }\n }\n },\n function(error) {\n console.error(error);\n });\n crmInterface_1.crmGetPrevActivity(contact[model_2.CrmExtendedProperty.CRM_ID],\n state.app.crmAccessKey)\n .then(function(success) {\n if (success.results[0]) {\n var activity = success.results[0];\n activity.date = activity.ScheduledStart\n .substring(activity.ScheduledStart.indexOf('(') + 1,\n activity.ScheduledStart.indexOf(')'));\n if (Date.now() > activity.date) {\n dispatch({\n type: actionTypes_1.default.UPDATE_CONTACT_ACTIVITY,\n payload: {\n index: index,\n activityKey: 'prevActivity',\n activity: activity\n }\n });\n }\n }\n },\n function(error) {\n console.error(error);\n });\n }\n dispatch({\n type: actionTypes_1.default.FOCUS_CONTACT,\n payload: index\n });\n };\n }", "isEditable() {\n if (!this.user) {\n return false;\n }\n // If the comment has been deleted, it should only be editable\n // by site admins or the user who deleted it.\n if (this.activity.deleted_by) {\n return this.user.is_admin || this.activity.deleted_by === this.user.email;\n }\n // If the comment is not deleted, site admins or the author can edit.\n return this.user.email === this.activity.author || this.user.is_admin;\n }", "edit() {\n return this.new() &&\n this.record && (this._isOwner() || this._isAdmin());\n }", "function onEditContact(e) {\n contactForm.buildContactForm(activeContact); \n $.mobile.changePage(\"#edit_contact_page\", { transition: \"pop\" });\n}", "function trackFocusedContact(e) {\n return function(dispatch, getState) {\n var state = getState();\n var contact = getTargetedContacts(ContactTarget.FOCUSED, state)[0];\n dispatch({\n type: actionTypes_1.default.TRANSACTION_START,\n payload: {\n type: '',\n progressMax: 1\n }\n });\n trackContact(contact, state.app.crmAccessKey, state.app.callbackToken, 1, state.outlook.syncMapping)\n .then(function(crmId) {\n dispatch({\n type: actionTypes_1.default.UPDATE_CONTACT,\n payload: {\n index: state.outlook.focused.index,\n values: (_a = {},\n _a[model_2.CrmExtendedProperty.CRM_ID] = crmId,\n _a[model_2.CrmExtendedProperty.CRM_LINK_STATE] = model_2.CrmExtendedProperty\n .CRM_LINK_STATE_LINKED,\n _a\n )\n }\n });\n dispatch(updateContactsCount());\n dispatch({ type: actionTypes_1.default.TRANSACTION_SUCCESS });\n dispatcherHandler_1.sendTelemetryEvent({\n name: 'mailapp_module_track',\n data: {\n focused: true,\n count: 1\n }\n });\n var _a;\n },\n function(error) {\n console.error(error);\n });\n };\n }", "function saveCurrentContactName(contactName){\n PropertiesService.getUserProperties().setProperty(\"currentContact\", contactName);\n}", "async _fetchContact() {\n const { id, emailaddress1, contactid } = await this.store.queryRecord('contact', { me: true });\n\n return { id, emailaddress1, contactid };\n }", "edit() {\n return this.new() &&\n this.record && (this._isOwner() || this._isAdmin());\n }", "read(nombre) {\n \n const contactoOne = this.contactos.find( contacto => contacto.nombre === nombre.toLowerCase());\n\n // if (!contactoOne) {\n // throw Error('No existe contacto con ese Nombre');\n // }\n return contactoOne;\n\n }", "get telecom () {\n\t\treturn this._telecom;\n\t}", "function overwriteContactModalForEdit(clientId, clientName) {\n\t$(\"#m_contact_client_id\").val(clientId);\n\t$(\"#m_contact_client_name\").val(clientName);\n\t$(\"#m_contact_history tr\").remove();\n\t$(\"#edit_contact_modal_title\").replaceWith(\"<span id='edit_contact_modal_title'>コンタクト:\" + clientName + \"</span>\");\n\tvar reqBody = {\n\t\tclient_id_list: [clientId],\n\t};\n\tif ($(\"#m_contact_query_subject\").val() !== \"\" && $(\"#m_contact_query_subject\").val() !== \"すべて\") {\n\t\treqBody.subject = $(\"#m_contact_query_subject\").val();\n\t}\n\tvar renderNote = function (jqNode, rawNote) {\n\t\tvar err, noteObj, noteTxt;\n\t\ttry {\n\t\t\tnoteObj = JSON.parse(rawNote);\n\t\t} catch (err) {\n\t\t\tnoteTxt = rawNote;\n\t\t}\n\t\tjqNode.text(noteObj && noteObj.message ? noteObj.message : noteTxt);\n\t\tjqNode.append($(\"<span style='display : none;'></span>\").text(noteObj && noteObj.request_id ? noteObj.request_id : \"none\"));\n\t\treturn jqNode;\n\t};\n\tc4s.invokeApi_ex({\n\t\tlocation: \"client.enumContacts\",\n\t\tbody: reqBody,\n\t\tonSuccess: function (data) {\n\t\t\tif (data && data.data && data.data[clientId]) {\n\t\t\t\tvar tgtData = data.data[clientId];\n\t\t\t\tvar tgtBody = $(\"#m_contact_history\");\n\t\t\t\tvar i, tgtItem;\n\t\t\t\tvar tmpTr, tmpTd;\n\t\t\t\tfor(i = 0; i < tgtData.length; i++) {\n\t\t\t\t\ttgtItem = tgtData[i];\n\t\t\t\t\ttmpTr = $(\"<tr/>\");\n\t\t\t\t\ttmpTr.appendTo(tgtBody);\n\t\t\t\t\ttmpTr[0].id = \"iter_contact_\" + tgtItem.id;\n\t\t\t\t\t$(\"<td class='center'>\" + tgtItem.dt_created + \"</td>\").appendTo(tmpTr);\n\t\t\t\t\t$(\"<td class='center'>\" + tgtItem.subject + \"</td>\").appendTo(tmpTr);\n\t\t\t\t\trenderNote($(\"<td></td>\"), tgtItem.note).appendTo(tmpTr);\n\t\t\t\t\t$(\"<td class='center' title='\" + tgtItem.creator.login_id + \"'>\" + tgtItem.creator.name + \"</td>\").appendTo(tmpTr);\n\t\t\t\t\t$(\"<td class=\\\"center\\\"><span class=\\\"glyphicon glyphicon-trash text-danger pseudo-link-cursor\\\" title=\\\"削除\\\" onclick=\\\"c4s.hdlClickDeleteItem('contact', \" + tgtItem.id + \", true); $('#edit_contact_modal').data('commitCompleted', true);\\\"></span></td>\").appendTo(tmpTr);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$(\"#m_contact_client_id\").val(Number(clientId));\n\t\t\t$(\"#edit_contact_modal\").modal(\"show\");\n\t\t},\n\t});\n}", "function updateContact() {\n var contacts = getStoredContacts();\n var idEdited = JSON.parse(localStorage.idEdited);\n\n contacts.forEach(function (contact) {\n if(idEdited == contact.id) { // capitalize name initials (a little sanitation)\n contact.firstname = form.firstname.value[0].toUpperCase() + form.firstname.value.slice(1).toLowerCase(),\n contact.lastname = form.lastname.value[0].toUpperCase() + form.lastname.value.slice(1).toLowerCase(),\n contact.phone = form.phone.value,\n contact.address = form.address.value,\n contact.email = form.email.value\n }\n });\n\n // add contact to local storage\n localStorage.contacts = JSON.stringify(contacts);\n localStorage.idEdited = JSON.stringify('updated');\n}", "getFocusedEditor() {\n if (this.general && this.general.isFocused())\n return Promise.resolve(this.general.getModel());\n if (this.connection.isAvailable()) {\n return this.connection.access().then(editor => {\n if (editor.isFocused())\n return editor.getModel();\n else\n return this.main;\n });\n }\n else {\n return Promise.resolve(this.main);\n }\n }", "get editable() {\n return this._editable;\n }", "get editable() {}", "get editing() {\n return this._editingTd ? true : false;\n }", "contactList() {\n\t if (Session.get(\"searchName\") != \"\") {\n\t\tvar searchString = Session.get(\"searchName\");\n\t\treturn Template.contacts.__helpers[\" findContact\"](searchString);\n\t }\n\t else\n\t\treturn Contacts.findOne(\"Contacts\")[\"contacts\"];\n\t}", "isEditable() {\n return !this.isReference();\n }", "function getContacts() {\n return contacts;\n}", "function isEditor() {\n var user = Session.getActiveUser().getEmail();\n return EDITORS.indexOf(user) >= 0;\n}", "get telecom() {\n\t\treturn this.__telecom;\n\t}", "function getSelectedContactId() {\n return document.getElementById('contactDropDown').value\n}", "function handleUpdate(contact,event) {\n contact.name = event.detail.name;\n setContacts(contacts);\n }", "get defaultValueContactPoint() {\n\t\treturn this.__defaultValueContactPoint;\n\t}", "get contactText(){return $('span=Contact details')}", "getUserEmail() {\n if (this.state.newMessageTitle === '' || this.state.newMessageContent === '') {\n return -1;\n }\n let contact = this.state.contact;\n for (let i = 0; i < contact.length; i++) {\n if (this.state.contact[i] === this.state.selectedContact.value) {\n return i;\n }\n }\n return -1;\n }", "getEditable() {\n return this.state[CIRCLE].getEditable()\n }", "function getCurrentEditorInstance() {\n let editor;\n const current_tool_mode =\n ss.getFromObject('editor_scratch', 'current_tool_mode');\n if (current_tool_mode === 'mesh_edit_mode') {\n return mesh_editor;\n }\n else if (current_tool_mode === 'curve_mode') {\n return mesh_editor.getCurvedDeformerLine();\n }\n else {\n throw Error('Unknown tool mode: ' + current_tool_mode);\n }\n }", "function linkFocusedContact(e) {\n return function(dispatch, getState) {\n var state = getState();\n // Select current focused contact and open link context.\n var contact = getTargetedContacts(ContactTarget.FOCUSED, state)[0];\n var targetIndex = -1;\n state.outlook.pages[state.outlook.page].forEach(function(e, index) {\n if (contact.Id == e.Id) {\n targetIndex = index;\n }\n });\n if (targetIndex !== -1) {\n dispatch(toggleSelect(e, targetIndex));\n }\n dispatch(showLinkContext());\n };\n }", "function loadEditView() {\n app.router.load('contactEdit', {id: contact._id });\n }", "function focused(editor)\n\t{\n return focusObj;\n }", "revertContact() {\n this.getContact().restore();\n }", "getOwner() {\n return this.currentOwner;\n }", "get currentCase() {\n return this._caseId;\n }", "get currentCase() {\n return this._caseId;\n }", "function findIndexById(id) {\n return $scope.contacts.findIndex(contact => (contact._id === id));\n }", "function getCustomer() {\n return _model.customer;\n }", "get activeAssignment() {\n return this.grid.features.cellEdit.activeRecord;\n }", "get isContact(): boolean {\n if (!this.isMessage) return false;\n\n const message: Message = (this.message: any);\n\n return !!message.contact && typeof message.contact === 'object';\n }", "get editLabel() {\n return this.isEditing ? 'Cancel' : 'Edit';\n }", "function viewCurrentContact() {\n currentContact = contactArray[currentContactIndex];\n document.getElementById(\"firstNameID\").value = currentContact.firstName;\n document.getElementById(\"lastNameID\").value = currentContact.lastName;\n document.getElementById(\"preferredNameID\").value = currentContact.preferredName; \n document.getElementById(\"emailID\").value = currentContact.email; \n document.getElementById(\"phoneNumberID\").value = currentContact.phoneNumber;\n document.getElementById(\"zipID\").value = currentContact.zip; \n document.getElementById(\"cityID\").value = currentContact.city; \n document.getElementById(\"stateID\").value = currentContact.state;\n document.getElementById(\"latID\").value = currentContact.lat;\n document.getElementById(\"lngID\").value = currentContact.lng;\n document.getElementById(\"favoriteHobbyID\").value = currentContact.favoriteHobby;\n\n // Todo: Add additional fields.\n // PJB: I added all of the other fields\n document.getElementById(\"statusID\").innerHTML = \"Status: Viewing contact \" + (currentContactIndex+1) + \" of \" + contactArray.length;\n\n\n // Disables the previous button when the user is looking at the first contact\n if(currentContactIndex == 0) {\n \tdocument.getElementById(\"previousbtn\").disabled = true;\n } else {\n \tdocument.getElementById(\"previousbtn\").disabled = false;\n }\n // Disables the next button when the user is looking at the last contact\n if(currentContactIndex == contactArray.length-1) {\n \tdocument.getElementById(\"nextbtn\").disabled = true;\n } else {\n \tdocument.getElementById(\"nextbtn\").disabled = false;\n }\n\n\n}", "function getEmail()\n {\n var item = Office.context.mailbox.item.from;\n\n var email = item.emailAddress;\n\n return email;\n }", "function changeHistoryItem(contact, changes) {\n return {\n timestamp: Date.now(),\n author: $sessionStorage.user.username,\n lastRev: contact._rev,\n changes: changes\n };\n }", "function getForm() {\n return document.getElementByClassName(\"contact\");\n }", "function getCurrentFullEditor() {\n // This *should* always be equivalent to DocumentManager.getCurrentDocument()._masterEditor\n return _currentEditor;\n }", "getEditInfo(id) {\n\t\treturn db.one(`SELECT * FROM user_information WHERE id=$1`, id)\n\t}", "function handleGetContact(e) {\n e.preventDefault();\n $modal = $('#listingModal');\n $contactNameField = $modal.find('#listingContactName');\n\n // get data for this contact\n contactDataToGet = $contactNameField.val();\n\n console.log(contactDataToGet);\n\n $.ajax({\n method: \"GET\",\n url: 'api/contacts/' + contactDataToGet,\n success: onGetContactSuccess\n })\n}", "function editContact() {\n\n for (let y = 0; y < saveEdit.length; y++) {\n let editItem = saveEdit[y];\n\n editItem.onclick = function (f) {\n let index = f.currentTarget.getAttribute('data-attr-index');\n let updatedAddress = displayList[y].value;\n let info = updatedAddress.split(\"|\");\n let contact = document.getElementsByClassName('contact');\n let contactValue = contact[y].value;\n \n\n name = contactValue;\n phoneNum = info[0];\n email_ = info[1];\n address_ = info[2];\n\n let savedAddress = JSON.parse(localStorage.getItem('addressBook'));\n\n if (savedAddress !== null) {\n savedAddress[index].name = name;\n savedAddress[index].phoneNo = phoneNum;\n savedAddress[index].email = email_;\n savedAddress[index].address = address_;\n\n localStorage.setItem(\"addressBook\", JSON.stringify(savedAddress));\n\n }\n alert('The Edited Contact has been saved');\n }\n\n }\n }", "function updateContact() {\n const contact = getContactFormData()\n if (!contact.contactId) {\n log('Cannot update a contact with no contact ID!')\n } else {\n client.contacts.update(contact)\n }\n}", "function getActiveModel() \r\n{\r\n if(g_activeModel)\r\n return g_meshMan.getModelByName(g_activeModel);\r\n \r\n return null;\r\n}", "function editContact(contact_id){\n\t\tvar confirmation = confirm(\"Are you sure you want to edit it ?\"); \n\t\t\tif(confirmation == true){\n\t\t\t\tvar wordObj = {\"contact_id\":contact_id};\n\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\ttype:\"POST\",\n\t\t\t\t\t\turl: \"editContact.php\",\n\t\t\t\t\t\tdata: wordObj,\n\t\t\t\t\t\tsuccess: function(data){\n\t\t\t\t\t\t\tvar obj = JSON.parse(data);\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t$(\"input[name = 'contact_id']\").val(obj.contact_id);\n\t\t\t\t\t\t\t\t$(\"input[name = 'firstname']\").val(obj.firstname);\n\t\t\t\t\t\t\t\t$(\"input[name = 'middlename']\").val(obj.middlename);\n\t\t\t\t\t\t\t\t$(\"input[name = 'lastname']\").val(obj.lastname);\n\t\t\t\t\t\t\t\t$(\"input[name = 'address']\").val(obj.address);\n\t\t\t\t\t\t\t\t$(\"input[name = 'contact_number']\").val(obj.contact_number);\n\t\t\t \t\t\t\t\t$(\"input[name = 'date']\").val(obj.date);\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror: function(data){\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t}\t \n }", "get recipient() {\n\t\treturn this.__recipient;\n\t}", "function getSolicitorFn(contactid) {\n \tvar solicitor;\n \tfor(var i = 0; i < solicitorlist.length; i++) {\n\t\t if (solicitorlist[i].contactid == contactid) {\n\t\t \tsolicitor = solicitorlist[i];\n\t\t }\n\t\t}\n \treturn solicitor;\n }", "get phoneOwner () {\n \n }", "render() {\n\n let { currentContact } = this.state\n\n if (!this.state.editMode) {\n\n return (\n <div>\n <div className=\"details\">\n <img src={currentContact.imgUrl} alt=\"\" />\n <h1>{currentContact.firstName} {currentContact.lastName}</h1>\n <p>{currentContact.email}</p> <p>{currentContact.phone}</p>\n <button className=\"btn btn-info\" onClick={() => { this.toggleEditMode() }}>Edit Contact</button>\n <Link to=\"/contacts\"> Back </Link>\n </div>\n </div>\n )\n } else {\n\n return (\n <div>\n <div className=\"row add-contact\">\n <div className=\"col-md-9\">\n <label>First Name</label>\n <input type=\"text\" className=\"form-control\" value={currentContact.firstName}\n onChange={event => this.updateState('firstName', event.target.value)} />\n </div>\n\n <div className=\"col-md-9\">\n <label>Last Name</label>\n <input type=\"text\" className=\"form-control\" value={currentContact.lastName}\n onChange={event => this.updateState('lastName', event.target.value)} />\n </div>\n\n <div className=\"col-md-9\">\n <label>Email</label>\n <input type=\"text\" className=\"form-control\" value={currentContact.email}\n onChange={event => this.updateState('email', event.target.value)} />\n </div>\n <div className=\"col-md-9\">\n <label>Phone #</label>\n <input type=\"text\" className=\"form-control\" value={currentContact.phone}\n onChange={event => this.updateState('phone', event.target.value)} />\n </div>\n <div className=\"col-md-9\">\n <label>Pic URL</label>\n <input type=\"text\" className=\"form-control\" value={currentContact.imgUrl}\n onChange={event => this.updateState('imgUrl', event.target.value)} />\n <br />\n </div>\n </div>\n <button className=\"btn btn-success\" onClick={() => {\n if (!this._emailValidation(currentContact.email)) {\n alert(\"Invalid Email\");\n return\n }\n if (!currentContact.firstName && !currentContact.lastName) {\n alert(\"Enter at least a first or last name\");\n return\n }\n this.toggleEditMode()\n }}>Confirm Edit</button>\n </div>\n )\n }\n }", "function indexController(contact) {\n contact.id = contact.dataItemID;\n if (!contact.hasOwnProperty('name')) {\n contact.name = contact.id\n }\n\n // now add other fields to enable user interface\n contact.localpath = \"/contacts/\"+encodeURIComponent(contact.id);\n\n if (!contact.avatar) {\n\n // Use gravatar to get avatar from email\n var md5hash = \"\";\n if (contact.email) {\n md5hash = crypto.createHash('md5').update(contact.email).digest('hex');\n }\n contact.avatar = \"https://www.gravatar.com/avatar/\"+md5hash+\"?s=80&d=blank\";\n }\n\n return contact;\n}", "function activeEditor() {\n let editor = atom.workspace.getActiveTextEditor();\n const editorView = atom.views.getView(editor);\n const className = \"vim-mode-plus-search-input-focused\";\n if (editorView.classList.contains(className)) {\n const allEditors = atom.textEditors.editorsWithMaintainedConfig;\n allEditors.forEach(e => {\n if (e.mini) {\n editor = e;\n return false;\n }\n });\n }\n return editor;\n}", "function getEditor(target, field) {\n var state = $.data(target, 'datagrid');\n var opts = state.options;\n var tr = opts.finder.getTr(target, 0, 'editor', undefined, state);\n var cell = tr.children('td[field=\"' + field + '\"]').find('div.datagrid-editable');\n if (cell.length) {\n return $.data(cell[0], 'datagrid.editor');\n }\n return null;\n }", "setActiveEditRef(ref) {\n this._editRef = ref;\n }", "get current() {\n return this._active_user.getValue();\n }", "get callerReference() {\n return this.getStringAttribute('caller_reference');\n }", "get _last_caller() {\n return recentModelCallerComponent\n }", "function ContactChange() {\n\t//------------------------------------------------------------------------------\n\tvar $Form = document.forms['ContactEditForm'];\n\t//------------------------------------------------------------------------------\n\t$HTTP = new HTTP();\n\t//------------------------------------------------------------------------------\n\tif (!$HTTP.Resource) {\n\t\t//------------------------------------------------------------------------------\n\t\talert('Не удалось создать HTTP соединение');\n\t\t//------------------------------------------------------------------------------\n\t\treturn false;\n\t\t//------------------------------------------------------------------------------\n\t}\n\t//------------------------------------------------------------------------------\n\t//------------------------------------------------------------------------------\n\t$HTTP.onLoaded = function() {\n\t\t//------------------------------------------------------------------------------\n\t\tHideProgress();\n\t\t//------------------------------------------------------------------------------\n\t}\n\t//------------------------------------------------------------------------------\n\t//------------------------------------------------------------------------------\n\t$HTTP.onAnswer = function($Answer) {\n\t\t//------------------------------------------------------------------------------\n\t\tswitch ($Answer.Status) {\n\t\tcase 'Error':\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tShowAlert($Answer.Error.String, 'Warning');\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tbreak;\n\t\t\t//------------------------------------------------------------------------------\n\t\tcase 'Exception':\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tShowAlert(ExceptionsStack($Answer.Exception), 'Warning');\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tbreak;\n\t\t\t//------------------------------------------------------------------------------\n\t\tcase 'Ok':\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tShowProgress('Изменение контактного адреса');\n\t\t\tsetTimeout(\n\t\t\t\t//------------------------------------------------------------------------------\n\t\t\t\tfunction (){\n\t\t\t\t\t//------------------------------------------------------------------------------\n\t\t\t\t\tShowWindow('/UserPersonalDataChange');\n\t\t\t\t\t//------------------------------------------------------------------------------\n\t\t\t\t},\n\t\t\t\t//------------------------------------------------------------------------------\n\t\t\t1000);\n\t\t\t//------------------------------------------------------------------------------\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tbreak;\n\t\t\t//------------------------------------------------------------------------------\n\t\tdefault:\n\t\t\t//------------------------------------------------------------------------------\n\t\t\talert('Не известный ответ');\n\t\t\t//------------------------------------------------------------------------------\n\t\t}\n\t\t//------------------------------------------------------------------------------\n\t};\n\t//------------------------------------------------------------------------------\n\t//------------------------------------------------------------------------------\n\tvar $Args = FormGet($Form);\n\t//------------------------------------------------------------------------------\n\tif (!$HTTP.Send('/API/ContactEdit', $Args)) {\n\t\t//------------------------------------------------------------------------------\n\t\talert('Не удалось отправить запрос на сервер');\n\t\t//------------------------------------------------------------------------------\n\t\treturn false;\n\t\t//------------------------------------------------------------------------------\n\t}\n\t//------------------------------------------------------------------------------\n\t//------------------------------------------------------------------------------\n\tShowProgress('Отправка данных на сервер');\n\t//------------------------------------------------------------------------------\n\t//------------------------------------------------------------------------------\n}" ]
[ "0.78231084", "0.70191115", "0.70191115", "0.6989194", "0.6989194", "0.6989194", "0.6989194", "0.6601513", "0.64119923", "0.62740356", "0.6252663", "0.6207401", "0.59106225", "0.5908959", "0.5902027", "0.583154", "0.58213204", "0.57893884", "0.5729577", "0.5728997", "0.5727557", "0.5688068", "0.56705743", "0.56674844", "0.56547606", "0.55836606", "0.5572348", "0.5505782", "0.55010754", "0.547114", "0.54587567", "0.5453084", "0.54096216", "0.54096216", "0.53843755", "0.53800297", "0.53094983", "0.53027606", "0.52973515", "0.52469575", "0.5243954", "0.5237163", "0.52267027", "0.52261406", "0.52195567", "0.52165234", "0.52023125", "0.5197797", "0.51906043", "0.5188668", "0.51650554", "0.51582026", "0.51546055", "0.51484084", "0.51451683", "0.51320887", "0.51132417", "0.51092625", "0.5072069", "0.5064918", "0.5063308", "0.5043227", "0.50397027", "0.50344306", "0.5015209", "0.5006582", "0.50059354", "0.5002299", "0.4987224", "0.49780282", "0.49677852", "0.49677852", "0.49546754", "0.495164", "0.49512157", "0.4946529", "0.4930065", "0.49233395", "0.49185646", "0.48930162", "0.48812634", "0.48741078", "0.48704582", "0.4867065", "0.48642367", "0.48568776", "0.48547745", "0.48434055", "0.48409903", "0.4839745", "0.48319125", "0.48308486", "0.483069", "0.48280716", "0.4827972", "0.4821443", "0.4817785", "0.4816746", "0.4816012", "0.48059633" ]
0.61655927
12
Set the contact that is being edited to the provided contact model
setContact(contact) { this.scope.attr('contact', contact); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editContact(){\n var id = readLineSync.question('Lua chon id contact can sua: ');\n var name = readLineSync.question('name: ');\n var phone = readLineSync.question('phoneNum:');\n listContact[id].Name = name;\n listContact[id].Phone = phone;\n save();\n console.log(\"\\nsua thanh cong nhe!\");\n }", "set contact(contact) {\n\t\tif (Array.isArray(contact)) {\n\t\t\tthis._contact = contact.map((i) => new Contact(i));\n\t\t} else {\n\t\t\tthis._contact = [new Contact(contact)];\n\t\t}\n\t}", "function updateContact() {\n const contact = getContactFormData()\n if (!contact.contactId) {\n log('Cannot update a contact with no contact ID!')\n } else {\n client.contacts.update(contact)\n }\n}", "saveContact() {\n const contact = this.getContact();\n if (contact.isNew() || contact.isDirty()) {\n contact.save();\n }\n }", "function contact() {\n var _this = _super.call(this, contact.metadata.logicalName) || this;\n _this.entityType = contact;\n return _this;\n }", "function handleUpdate(contact,event) {\n contact.name = event.detail.name;\n setContacts(contacts);\n }", "function updateContact(contact) {\n if (validateInput()) {\n ContactsController.Update(\n contact.Id,\n $(\"#contactSupIDInput\")[0].value,\n $(\"#contactFullNameInput\")[0].value,\n $(\"#contactPhoneNoInput\")[0].value,\n onUpdateContact\n );\n }\n}", "function editContact(id) { // editing is actually done in edit.js\n // store id, to be retrieved in edit.js on edit.html\n localStorage.idOfContactBeingEdited = JSON.stringify(id);\n}", "function editContact(){\n\n}", "routeChange(event, contactId) {\n let contact = null;\n if (contactId === 'new') {\n // Create a new contact to edit\n contact = new Contact();\n } else {\n // Lookup the contact in the global list by its contact\n contact = Contact.store[contactId];\n if (contact) {\n // Save a copy of the contact's attributes so that it can be reverted later if necessary\n contact.backup();\n } else {\n // No contact has that contactId\n console.error('Attempting to navigate to a non-existent contact!');\n Navigator.openParentPage();\n }\n }\n\n this.setContact(contact);\n }", "function updateContact() {\n var contacts = getStoredContacts();\n var idEdited = JSON.parse(localStorage.idEdited);\n\n contacts.forEach(function (contact) {\n if(idEdited == contact.id) { // capitalize name initials (a little sanitation)\n contact.firstname = form.firstname.value[0].toUpperCase() + form.firstname.value.slice(1).toLowerCase(),\n contact.lastname = form.lastname.value[0].toUpperCase() + form.lastname.value.slice(1).toLowerCase(),\n contact.phone = form.phone.value,\n contact.address = form.address.value,\n contact.email = form.email.value\n }\n });\n\n // add contact to local storage\n localStorage.contacts = JSON.stringify(contacts);\n localStorage.idEdited = JSON.stringify('updated');\n}", "function editContact(id, name, email, contactNumber) {\r\n if(checkEmptyField(id, name, email, contactNumber)) return;\r\n let dataObject = { 'id': id, 'name': name, 'email': email, 'contactNumber': contactNumber };\r\n $.ajax({\r\n url: \"http://localhost:8080/api/contact/update\",\r\n type: 'PUT',\r\n contentType: \"application/json\",\r\n data: JSON.stringify(dataObject),\r\n success: function(data) {\r\n editRow(data);\r\n },\r\n fail: (err) => console.log(\"Couldn't update contact \" + dataObject, err)\r\n });\r\n}", "function SaveUpdatedContactToPhonebook()\n{\n\tTi.API.info(\"SaveUpdatedContactToPhonebook\");\n\t\n\t// TODO: Replace this with return statement\n\tif(contact == null) alert(\"Contact must be initialized ya beheema !\");\n\t\n\tif(OS_IOS) {\n\t\tTitanium.Contacts.save();\n\t} \n\telse if(OS_ANDROID) {\n\t\t/* Titanium APIs or Android OS has a bug, which is saving a contact after editing it causes another contact got edited.\n\t\t * A workaround is to delete the exisiting contact with id and then add a new contact having each and every detail the\n\t\t * deleted contact had.\n\t\t */\n\t\t\n\t\tTitanium.Contacts.removePerson(contact);\n\t\t\n\t\tTi.Contacts.createPerson({\n\t\t\taddress : contact.address ? contact.address : null,\t// Dictionary\n\t\t\tbirthday : contact.birthday ? contact.birthday : \"\",\t// String\n\t\t\tdate : contact.date ? contact.date : null,\t// Dictionary\n\t\t\temail : contact.email ? contact.email : null,\t// Dictionary\n\t\t\tfirstName : contact.firstName ? contact.firstName : contact.fullName ? contact.fullName : \"\",\t// String\n\t\t\t// TODO: The image is not copied\n\t\t\timage : contact.image ? contact.image : null,\t// Image blob\n\t\t\t\n\t\t\tinstantMessage : contact.instantMessage ? contact.instantMessage : null,\t// Dictionary\n\t\t\tkind : Ti.Contacts.CONTACTS_KIND_PERSON,\n\t\t\tlastName : contact.lastName ? contact.lastName : \"\",\t// String\n\t\t\tmiddleName : contact.middleName ? contact.middleName : \"\",\t// String\n\t\t\tnickname : contact.nickname ? contact.nickname : \"\",\t// String\n\t\t\tnote : contact.note ? contact.note : \"\",\t// String\n\t\t\torganization : contact.organization ? contact.organization : \"\",\t// String\n\t\t\tphone : contact.phone ? contact.phone : null,\t// Dictionary\n\t\t\trelatedNames : contact.relatedNames ? contact.relatedNames : null,\t// Dictionary\n\t\t\turl : contact.url ? contact.url : null,\t// Dictionary\n\t\t});\n\t}\n\t\n\tcontact = null;\t// To avoid wrong use in future.\n\talert(\"Contact Updated in Phonebook !\");\n}", "function onEditContact(e) {\n contactForm.buildContactForm(activeContact); \n $.mobile.changePage(\"#edit_contact_page\", { transition: \"pop\" });\n}", "updateContact (state, payload) {\n let contact = getContactByJid(state, payload.jid)\n if (contact) {\n Object.assign(contact, payload)\n } else {\n contact = new Contact(payload)\n // 存在系统消息模块,默认插到系统消息后\n state.contacts.splice(1, 0, contact)\n // 先更新列表再补充联系人与业务相关消息,避免列表延时显示\n state.uiCore.queryAddressBook(getIdFromJid(contact.jid), (user) => {\n for (let p in user) {\n if (contact.hasOwnProperty(p)) { contact[p] = user[p] }\n }\n })\n }\n }", "saveContact(oldContactId, newName, newEmail, newNumber) {\n const {contacts} = this.state\n const foundContact = _.find(contacts, contact => contact.id === oldContactId);\n foundContact.name = newName;\n foundContact.email = newEmail;\n foundContact.number = newNumber;\n this.setState({\n contacts\n }, () => updateLocalStorage(\"contacts\", contacts))\n }", "function editModel(data) {\n /// start edit form data prepare\n /// end edit form data prepare\n dataSource.one('sync', function(e) {\n /// start edit form data save success\n /// end edit form data save success\n\n app.mobileApp.navigate('#:back');\n });\n\n dataSource.one('error', function() {\n dataSource.cancelChanges(itemData);\n });\n\n dataSource.sync();\n app.clearFormDomData('edit-item-view');\n }", "handleChange(e, key){\n const contact = this.props.contacts[key];\n const updatedContact = {...contact, [e.target.name]: e.target.value};\n this.props.updateContact(key, updatedContact);\n }", "static async updateContact(ContactId, obj, userId) {\n const contactFields = {};\n if (obj.name) contactFields.name = obj.name;\n if (obj.email) contactFields.email = obj.email;\n if (obj.phone) contactFields.phone = obj.phone;\n if (obj.type) contactFields.type = obj.type;\n console.log(contactFields);\n const contact = await Contact.findById({ _id: ContactId });\n\n if (!contact) {\n throw new Error(\"Contact not found\");\n }\n\n // Make sure user owns contact\n if (contact.user.toString() !== userId) {\n return new Error(\"Unauthorized access\");\n }\n\n const updatedContact = await Contact.findByIdAndUpdate(\n ContactId,\n { $set: contactFields },\n { new: true }\n );\n return updatedContact;\n }", "function updateRecord(contact) {\n const option = {\n method: \"PUT\",\n body: JSON.stringify(contact),\n headers: {\n \"Content-Type\": \"application/json\"\n }\n }\n fetch(`${url}/${selectedRow.cells[0].innerHTML}`, option)\n .then((respons) => view())\n .catch((error) => console.error(`error: ${error}`))\n\n}", "function handleChange(event) {\n const { name, value } = event.target;\n\n setContact(prevValue => {\n return{\n ... prevValue,\n [name]: value\n };\n });\n }", "handleChange(event) {\n const {\n name,\n value\n } = event.target;\n const updatedContactInfo = (0, _Immutable.set)(this.props.value, name, value);\n this.onChange(updatedContactInfo);\n }", "function edit()\n{\n $(document).on('click', '#edit', function()\n {\n let id = $(this).attr('contacts-id');\n \n $.ajax({\n url:'contacts',\n method:'POST',\n data:{ contactId:id },\n dataType: 'JSON',\n success: function(data)\n {\n $('#up-id').val(data[0]);\n $('#up-name').val(data[1]);\n $('#up-email').val(data[2]);\n $('#up-phone').val(data[3]);\n }\n })\n return false;\n })\n}", "updateContactById(id, updateContact){\n let index = this.contacts.findIndex(contact => contact.id === id)\n\n this.contacts[index].name = updateContact.name || this.contacts[index].name\n this.contacts[index].phone = updateContact.phone || this.contacts[index].phone\n this.contacts[index].email = updateContact.email || this.contacts[index].email\n\n return this.contacts[index]\n }", "_setToEditingMode() {\n this._hasBeenEdited = true\n this._setUiEditing()\n }", "function loadEditView() {\n app.router.load('contactEdit', {id: contact._id });\n }", "function handleChangeContactFields(event) {\n setContactCurrentState({\n ...contactCurrentState,\n [event.target.name]: event.target.value,\n });\n }", "createContact() {\n // check if it is allowed to save\n if (this.onCreateAction && !this.saveDisabled) {\n // disable save until it is finished\n this.toggleProperty('saveDisabled');\n\n // call the onCreate action\n this.onCreateAction(this.model).then(() => {\n // enable save again\n this.toggleProperty('saveDisabled');\n // reset the model's attributes\n this.set('model', {});\n });\n }\n }", "function toRenderContactView() {\n ContactView.render({\n model: contact,\n bindings: bindings\n });\n }", "function setSelectedContactForChat(contactId) {\n localStorage.setItem(configSrvc.cidLocalStorage, contactId);\n }", "function editContact(contact_id){\n\t\tvar confirmation = confirm(\"Are you sure you want to edit it ?\"); \n\t\t\tif(confirmation == true){\n\t\t\t\tvar wordObj = {\"contact_id\":contact_id};\n\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\ttype:\"POST\",\n\t\t\t\t\t\turl: \"editContact.php\",\n\t\t\t\t\t\tdata: wordObj,\n\t\t\t\t\t\tsuccess: function(data){\n\t\t\t\t\t\t\tvar obj = JSON.parse(data);\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t$(\"input[name = 'contact_id']\").val(obj.contact_id);\n\t\t\t\t\t\t\t\t$(\"input[name = 'firstname']\").val(obj.firstname);\n\t\t\t\t\t\t\t\t$(\"input[name = 'middlename']\").val(obj.middlename);\n\t\t\t\t\t\t\t\t$(\"input[name = 'lastname']\").val(obj.lastname);\n\t\t\t\t\t\t\t\t$(\"input[name = 'address']\").val(obj.address);\n\t\t\t\t\t\t\t\t$(\"input[name = 'contact_number']\").val(obj.contact_number);\n\t\t\t \t\t\t\t\t$(\"input[name = 'date']\").val(obj.date);\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror: function(data){\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t}\t \n }", "getEditContact() {\n\t var contactName = Session.get(\"editContact\");\n\t return Template.contacts.__helpers[\" findContact\"](contactName);\n\t}", "function editModelPress(){\n var oldObj = selectedItem;\n console.log('You have decided to edit: '+ selectedItem.id);\n stateChange('stateC');\n}", "function handleChange(event, name) {\n setAddOrEditContact({ ...addOrEditContact, [name]: event.target.value });\n }", "set model(model) {\n this._model = model;\n }", "function editarContacto(nombreEliminar,a,b,c) {\n\tfor (var i =0;i < arrayContactos.length;i++) {\n\t\tif (arrayContactos[i].nombre == nombreEliminar ) {\n\t\t\tarrayContactos[i].nombre=a;\n\t\t\tarrayContactos[i].direccion=b;\n\t\t\tarrayContactos[i].telefono=c;\n\t\t}\n\t}\n\tguardarDatosLocales();\n}", "function onChangeContact()\n{\n disableDeleteButton(true);\n disableSaveButton(false);\n disableClearButton(false);\n}", "function setForEdit(model, editId) {\n const meal = R.find(meal => meal.id === editId, model.meals);\n const { description, calories } = meal;\n\n return { ...model, description, calories, showForm: true, editId };\n}", "function saveContact() {\n//instantiate Parse.Object.extend (same as a model in Backbone)\n var contact = new Contact;\n//capture the values of the input fields via JQuery awesomeness\n var name = $('.name').val();\n var city = $('.city').val();\n var email = $('.email').val();\n//set the values of input fields as values in our contact object instantiated 2 steps above\n contact.set(\"name\", name);\n contact.set(\"city\", city);\n contact.set(\"email\", email);\n\n/*Save function: on successful save: log success message, instantiate ContactView and pass in the model,\nclear each of the input values; if error, log error message*/\n contact.save(null, {\n success: function(contactList){\n console.log('New object created with objectID' + contact.id);\n new ContactView({model: contactList});\n var name = $('.name').val('');\n var city = $('.city').val('');\n var email = $('.email').val('');\n },\n error: function(contactList, error){\n console.log('Failed to create new object, with error code' + error.description); \n }\n })\n\n }", "revertContact() {\n this.getContact().restore();\n }", "function saveContact(inputValues) {\n contact.setValues(inputValues);\n var validation = contact.validate();\n if (validation) {\n app.f7.alert(validation);\n return;\n }\n var contacts = Persistence.getAllContacts();\n if (!state.isNew) {\n _.remove(contacts, { _id: contact._id });\n }\n contacts.push(contact);\n Persistence.setAllContacts(contacts);\n renderContactListView();\n closePage();\n }", "function handleContactNameChange(e) {\n setContactName(e.target.value);\n }", "get contact () {\n\t\treturn this._contact;\n\t}", "get contact () {\n\t\treturn this._contact;\n\t}", "get contact () {\n\t\treturn this._contact;\n\t}", "get contact () {\n\t\treturn this._contact;\n\t}", "set telecom(telecom) {\n\t\tif (Array.isArray(telecom)) {\n\t\t\tthis._telecom = telecom.map((i) => new ContactPoint(i));\n\t\t} else {\n\t\t\tthis._telecom = [new ContactPoint(telecom)];\n\t\t}\n\t}", "set telecom(telecom) {\n\t\tif (Array.isArray(telecom)) {\n\t\t\tthis._telecom = telecom.map((i) => new ContactPoint(i));\n\t\t} else {\n\t\t\tthis._telecom = [new ContactPoint(telecom)];\n\t\t}\n\t}", "function handleChange(event) {\n const { name, value } = event.target;\n// we get the name and value from input below around line 413\n// we get setContact from line 371\n setContact((prevValue) => {\n if (name === \"fName\") {\n return {\n fName: value,\n lName: prevValue.lName,\n email: prevValue.email\n };\n } else if (name === \"lName\") {\n return {\n fName: prevValue.fName,\n lName: value,\n email: prevValue.email\n };\n } else if (name === \"email\") {\n return {\n fName: prevValue.fName,\n lName: prevValue.lName,\n email: value\n };\n }\n });\n }", "function overwriteContactModalForEdit(clientId, clientName) {\n\t$(\"#m_contact_client_id\").val(clientId);\n\t$(\"#m_contact_client_name\").val(clientName);\n\t$(\"#m_contact_history tr\").remove();\n\t$(\"#edit_contact_modal_title\").replaceWith(\"<span id='edit_contact_modal_title'>コンタクト:\" + clientName + \"</span>\");\n\tvar reqBody = {\n\t\tclient_id_list: [clientId],\n\t};\n\tif ($(\"#m_contact_query_subject\").val() !== \"\" && $(\"#m_contact_query_subject\").val() !== \"すべて\") {\n\t\treqBody.subject = $(\"#m_contact_query_subject\").val();\n\t}\n\tvar renderNote = function (jqNode, rawNote) {\n\t\tvar err, noteObj, noteTxt;\n\t\ttry {\n\t\t\tnoteObj = JSON.parse(rawNote);\n\t\t} catch (err) {\n\t\t\tnoteTxt = rawNote;\n\t\t}\n\t\tjqNode.text(noteObj && noteObj.message ? noteObj.message : noteTxt);\n\t\tjqNode.append($(\"<span style='display : none;'></span>\").text(noteObj && noteObj.request_id ? noteObj.request_id : \"none\"));\n\t\treturn jqNode;\n\t};\n\tc4s.invokeApi_ex({\n\t\tlocation: \"client.enumContacts\",\n\t\tbody: reqBody,\n\t\tonSuccess: function (data) {\n\t\t\tif (data && data.data && data.data[clientId]) {\n\t\t\t\tvar tgtData = data.data[clientId];\n\t\t\t\tvar tgtBody = $(\"#m_contact_history\");\n\t\t\t\tvar i, tgtItem;\n\t\t\t\tvar tmpTr, tmpTd;\n\t\t\t\tfor(i = 0; i < tgtData.length; i++) {\n\t\t\t\t\ttgtItem = tgtData[i];\n\t\t\t\t\ttmpTr = $(\"<tr/>\");\n\t\t\t\t\ttmpTr.appendTo(tgtBody);\n\t\t\t\t\ttmpTr[0].id = \"iter_contact_\" + tgtItem.id;\n\t\t\t\t\t$(\"<td class='center'>\" + tgtItem.dt_created + \"</td>\").appendTo(tmpTr);\n\t\t\t\t\t$(\"<td class='center'>\" + tgtItem.subject + \"</td>\").appendTo(tmpTr);\n\t\t\t\t\trenderNote($(\"<td></td>\"), tgtItem.note).appendTo(tmpTr);\n\t\t\t\t\t$(\"<td class='center' title='\" + tgtItem.creator.login_id + \"'>\" + tgtItem.creator.name + \"</td>\").appendTo(tmpTr);\n\t\t\t\t\t$(\"<td class=\\\"center\\\"><span class=\\\"glyphicon glyphicon-trash text-danger pseudo-link-cursor\\\" title=\\\"削除\\\" onclick=\\\"c4s.hdlClickDeleteItem('contact', \" + tgtItem.id + \", true); $('#edit_contact_modal').data('commitCompleted', true);\\\"></span></td>\").appendTo(tmpTr);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$(\"#m_contact_client_id\").val(Number(clientId));\n\t\t\t$(\"#edit_contact_modal\").modal(\"show\");\n\t\t},\n\t});\n}", "function setContactsInStore(contacts) {\n return {\n type: SET_CONTACTS,\n contacts\n }\n}", "handleNewContact(contact) {\n addContact(contact);\n this.closeModal();\n }", "get contact() {\n\t\treturn this.__contact;\n\t}", "get contact() {\n\t\treturn this.__contact;\n\t}", "function editContact() {\n\n for (let y = 0; y < saveEdit.length; y++) {\n let editItem = saveEdit[y];\n\n editItem.onclick = function (f) {\n let index = f.currentTarget.getAttribute('data-attr-index');\n let updatedAddress = displayList[y].value;\n let info = updatedAddress.split(\"|\");\n let contact = document.getElementsByClassName('contact');\n let contactValue = contact[y].value;\n \n\n name = contactValue;\n phoneNum = info[0];\n email_ = info[1];\n address_ = info[2];\n\n let savedAddress = JSON.parse(localStorage.getItem('addressBook'));\n\n if (savedAddress !== null) {\n savedAddress[index].name = name;\n savedAddress[index].phoneNo = phoneNum;\n savedAddress[index].email = email_;\n savedAddress[index].address = address_;\n\n localStorage.setItem(\"addressBook\", JSON.stringify(savedAddress));\n\n }\n alert('The Edited Contact has been saved');\n }\n\n }\n }", "getContactInfo(e) {\r\n Contact.clickedContact = Number(\r\n e.currentTarget.getAttribute(\"data-contactNumber\")\r\n );\r\n console.log(Contact.clickedContact);\r\n document.querySelector(\"#name\").value =\r\n Contact.list[Contact.clickedContact].name;\r\n document.querySelector(\"#phone\").value =\r\n Contact.list[Contact.clickedContact].phone_number;\r\n document.querySelector(\"#website\").value =\r\n Contact.list[Contact.clickedContact].website;\r\n document.querySelector(\"#description\").value =\r\n Contact.list[Contact.clickedContact].description;\r\n UI.openForm(\"update\");\r\n saveContactButton.textContent = \"update\";\r\n deleteContactButton.style.display = \"block\";\r\n }", "selectBookToEdit(o) {\n this.selectedBook = o;\n this.bookForm = Object.assign({}, this.selectedBook);\n }", "edit() {\n if (this.valid && this.changed) {\n\n ipcRenderer.send('studentUpdate', {\n id: this.id,\n fullName: this.name.value,\n socialID: this.sid.value,\n parentsName: this.parentName.value,\n parentNumber: this.parentPhone.value,\n sex: this.sex.value,\n phoneNumber: this.phone.value,\n birthDate: `${this.birthDate.year.value}/${this.birthDate.month.value}/${this.birthDate.day.value}`,\n address: this.address.value\n })\n\n this.changed = false\n }\n }", "function showEditContactModal(data) { \n var jdata = arcGetJson(data);\n $(\"#contactname\").val(jdata.name);\n $(\"#contacttitle\").val(jdata.title);\n $(\"#contactemail\").val(jdata.email);\n $(\"#contactphone\").val(jdata.phone);\n $(\"#contactid\").val(jdata.id);\n $(\"#editContactModal\").modal(\"show\");\n}", "function editAuthor(id, firstName, lastName, fullName) {\n selectedAuthor = {id, firstName, lastName, fullName};\n $(\"#edit-author-modal\").modal();\n}", "function addContact() {\n var newContact = {};\n\n // Set a default contact type\n newContact.typeId = 1;\n vm.contacts.push(newContact);\n }", "function upsertContact() {\n var data = {};\n vm.isSubmit = true;\n\n // Bind typename\n angular.forEach(vm.contacts, function (contact) {\n contact.typeName = type[contact.typeId];\n });\n\n // If the StudentId and AcademicYearId are given in the route, this means that\n // the application will be modified by another person (Administrator).\n // Otherwise, the application will be modified by a student\n data.UserId = $routeParams.StudentId || Global.user.id;\n data.AcademicYearId = $routeParams.AcademicYearId || null;\n\n data.contacts = vm.contacts;\n\n\n $http.post('/api/scholarships/upsert/contacts', data).success(function (hs) {\n vm.isSuccess = true;\n // Reinit data for the sake of getting an id from DB\n Scholarships.reInit($routeParams.StudentId, $routeParams.AcademicYearId).then(function () {\n init();\n $timeout(function () {\n vm.isSaved = true;\n vm.isSuccess = false;\n vm.isSubmit = false;\n }, 5000);\n });\n }).error(function (err) {\n vm.isError = true;\n $timeout(function () {\n vm.isError = false;\n vm.isSubmit = false;\n }, 5000);\n\n });\n }", "function onEditHandler(e, address) {\n\t\te.stopPropagation();\n\n\t\tsetAddress(address.address);\n\t\tsetTitle(address.title);\n\t\tsetIsOnEdit(true);\n\t\tsetShowModal(true);\n\t\tsetError('');\n\n\t\tsetCurrentId(address.id);\n\t}", "SetContactFilter(filter) {\n this.m_contactManager.m_contactFilter = filter;\n }", "function saveChanges() {\n var name = document.getElementById(\"mod_name\").value;\n var tel = document.getElementById(\"mod_tel\").value;\n var email = document.getElementById(\"mod_email\").value;\n var idx = document.getElementById(\"mod_idx\").value;\n \n if (!isInputError(name, tel, email)) {\n \t// make changes\n \tcontacts[idx].name = name;\n \tcontacts[idx].tel = tel;\n \tcontacts[idx].email = email;\n // hide mod panel\n hide(\"modentry\");\n // refresh contact list\n displayEntries();\n }\n\n}", "function modifyEntry(idx) {\n document.getElementById(\"mod_name\").value = contacts[idx].name;\n document.getElementById(\"mod_tel\").value = contacts[idx].tel;\n document.getElementById(\"mod_email\").value = contacts[idx].email;\n document.getElementById(\"mod_idx\").value = idx;\n\tshow('modentry');\n}", "function setSelectedContactForInfo(contactId) {\n localStorage.setItem(configSrvc.cinfoLocalStorage, contactId);\n }", "function toggleSelectContact(contact, event)\n {\n if ( event )\n {\n event.stopPropagation();\n }\n\n if ( vm.selectedContacts.indexOf(contact) > -1 )\n {\n vm.selectedContacts.splice(vm.selectedContacts.indexOf(contact), 1);\n }\n else\n {\n vm.selectedContacts.push(contact);\n }\n }", "_updatePreviewField(){\n if(this._showingContacts && this._chosenContact !== null){\n // Meh\n this._displayName.value = this._chosenContact.firstName + \" \" + this._chosenContact.lastName;\n }\n else{\n this._displayName.value = this._user.FirstName + \" \" + this._user.LastName;\n }\n }", "onChangeContactInfo(id, e) {\n var newValue = e.target.value;\n this.log('onChangeContactInfo id: ' + id + ' => ' + newValue);\n var input = this.state.input;\n input[id] = newValue;\n this.setState({input: input});\n }", "showContact(model) {\n const entry = new ContactEntry({ model });\n this.showChildView('layout', entry);\n\n Backbone.history.navigate(`contact/${model.id}`);\n }", "function showEditContact(element) {\r\n setEditFields(element.parentNode.parentNode);\r\n $('#editModal').modal('show');\r\n}", "editAddress() {\n this.addressRevertData = {\n address : this.vendor.address,\n state : this.vendor.state,\n zip_code: this.vendor.zip_code,\n city : this.vendor.city\n }\n }", "function addNewContact(model) {\n var selectedType = {};\n selectedType.type = model == 'medical_provider' ? 'medicalBillsproviderid' : '';\n var modalInstance = contactFactory.openContactModal(selectedType);\n modalInstance.result.then(function (response) {\n response['firstname'] = response.first_name;\n response['lastname'] = response.last_name;\n response['contactid'] = (response.contact_id).toString();\n vm.newMedicalBillInfo[model] = response;\n setType(response);\n }, function () { });\n }", "function editConatct() {\n let contactName = prompt(\"Enter name of contact which you want to edit: \")\n let contact = addressBook.find(contact => contact.firstName == contactName)\n if (contact == undefined) {\n console.log(\"Contact not found \");\n }\n else{\n try{\n contact.firstName = prompt(\"Enter First Name \");\n contact.lastName = prompt(\"Enter last Name \");\n contact.address = prompt(\"Enter Address \");\n contact.city = prompt(\"Enter City \");\n contact.state = prompt(\"Enter State \");\n contact.zip = prompt(\"Enter Zip \");\n contact.phoneNumber = prompt(\"Enter phone number \");\n contact.email = prompt(\"Enter Email address \");\n }\n catch(error){\n console.error(error);\n }\n }\n}", "function _saveContacts(c){\n\tActions.saveContacts(c);\n}", "function setEditValuesPerson(index) {\n\n id = null;\n // generic list/ object initializer\n var jsonObject = (!Array.isArray(fetchData)) ? fetchData : fetchData[index];\n\n // general setters\n id = jsonObject['id'];\n document.getElementById('edit-title').innerText = jsonObject['name'];\n document.getElementById('edit-email').value = jsonObject['email'];\n\n // phones setters\n document.getElementById('person-phone-container').innerHTML = \"<h5><b>phones</b></h5>\";\n for (var phone in jsonObject['phones']) {\n document.getElementById('person-phone-container').innerHTML += \"<input type='text' class='form-control' value='\" + jsonObject['phones'][phone] + \"'>\";\n }\n\n // address setters\n if(jsonObject['address'] != undefined) document.getElementById('edit-street').value = jsonObject['address'];\n if(jsonObject['city'] != undefined) document.getElementById('edit-city').value = jsonObject['city'];\n if(jsonObject['zipCode'] != 0) document.getElementById('edit-zipcode').value = jsonObject['zipCode'];\n\n // hobbies setters\n document.getElementById('hobby-container').innerHTML = \"\";\n for (var hobby in jsonObject['hobbies']) {\n document.getElementById('hobby-container').innerHTML += \"<p type='text' class='form-control'>\"+jsonObject['hobbies'][hobby]+\"</p>\";\n }\n \n}", "onChange(contactInfo) {\n if (this.props.onChange) {\n // Set default values for the event (not present or visible in the form or ever changed,\n // so no need to represent these within the state).\n const value = {\n type: 'contactInfo',\n ...(contactInfo || {})\n };\n this.props.onChange((0, _event.createEvent)('change', {\n name: this.props.name || '',\n value\n }));\n }\n }", "function onClickSaveContact()\n{\t\n\t/*On crée un tableau pour pouvoir enregistrer plusieurs lignes dans Address Book, qui contiendront les infos de contact sous forme de tableau dans un tableau*/\n\tvar addressBook = [];\n\n\t/*stock les valeurs entrées par l'utilisateur dans la variable contact via la fonction createContact()*/\n\tvar contact = createContact(\n\t\t\t\t\t/*permet de récupérer les valeurs rentrées par l'utilisateur dans les champs du formulaire*/\n $('select[name=title]').val(), \n $('input[name=lastName]').val(), \n $('input[name=firstName]').val(), \n $('input[name=phone]').val() \n );\n\n\t/*On écrase le dernier addressBook avec le tableau comportant les nouvelles données, évite d'écraser les contacts déjà existants : va stocker dans adressBook tout ce qui a été loadé*/\n\t\t/*rajoute pas un contact à tableau existant mais écrase ancien tableau par nouveau contenant contact en plus*/\n\taddressBook = loadAddressBook();\n\n\n\t// va rajouter la propriété data-index ayant pour valeur l'index dans la balise a suivant celle ayant un id contact-details. Lie l'index du tableau de contacts (donc le contact que l'on veut) avec le lien cliquable sur le nom du contact. Va sauvegarder le contact dans le local storage\n\t\t//stocke ça dans variable index\n \tvar index = $('#contact-details a').data('index');\n \n \t// si l'attribut data-mode vaut 'add'\n if ($('#contact-form').data('mode') == 'add'){\n \t\t/*Permet de pousser contact dans le tableau, transforme ses données en tableau contenu dans un index*/\n \t\taddressBook.push(contact);\n } else {\n \t\t// sinon va charger le contact dans l'index correspondant dans addressBook\n \t\taddressBook[index] = contact;\n }\n\n /*stock les valeurs de contact dans la clée Adress Book*/\n\tsaveAddressBook(addressBook);\n\n\t/*cache la partie ajouter contact au moment d'enregistrer*/\n $('#contact-form').fadeOut('slow');\n $('#contact-details').hide();\n \n /*Affiche dans la section adress-book*/\n refreshAddressBook();\n}", "function editStudent(studentId) {\n $scope.selectedStudent = StudentsModel.findStudent(studentId);\n \n // Set extra attributes to be used in the updateStudent function \n // to determine if they were edited or not.\n var student = $scope.selectedStudent;\n student.original_address = student.street_address;\n $scope.showEdit = true; // Show the edit form.\n gotoTop();\n }", "function update_entity_edit() {\n var form_record = Domain.entities[current_entity];\n Forms.init(form_record);\n update_edit_form_display();\n}", "function edit_contact(icon) {\n var form = $(\"#contact-form\");\n if (confirm_use_of_form(form)) {\n var row = $(icon).parent().parent()[0];\n fake_row = $(row).siblings().length > 0 ? $(row).siblings()[0] : row;\n $(\"#contact-id\",form).val($(\".contact-id\", row).text());\n $(\"#contact-name\",form).val($(\".contact-name\", fake_row).text());\n $(\"#contact-mail\",form).val($(\".contact-mail\", fake_row).text());\n form.fadeIn();\n $(\"#contact-name\",form).focus();\n }\n}", "function editarcontacto(req,res){\n\n\tlet contactoid = req.params.id_contacto;\n\tlet contacto = new Contactoempresa(\n\t\t\n\t\treq.body.email,\n\t\treq.body.celular\n\t\t\n\t\t\n\t\t);\n\n\tCONN('contacto_empresa').where('id_contacto',contactoid).update({email:req.body.email,celular:req.body.celular}).then(editarcontacto =>{\n\t\tconsole.log(editarcontacto);\n\t\tif(!editarcontacto){\n\t\t\tres.status(500).send({resp: 'Error',error:'los datos no se actualizaron'});\n\t\t}else{\n\t\t\tCONN('contacto_empresa').where('id_contacto',contactoid).select().then(contacto =>{\n\t\t\t\tif (!contacto){\n\t\t\t\t\tres.status(500).send({resp: 'Error', error:'error en la consulta'});\n\t\t\t\t}else{\n\t\t\t\t\tres.status(200).send({resp:'Actualizacion de datos correcta',contacto: contacto});\n\n\t\t\t\t}\n\t\t\t}).catch(error =>{\n\t\t\t\tres.status(500).send({resp: 'error',\n\t\t\t\terror: `${error}`});\n\t\t\t});\n\t\t}\n\t})\n}", "addContact () {\n store.addContact(this.store.newContact)\n this.store.newContact = { name: '', email: '' }\n }", "set editing(value) {\n\t\tif (value) {\n\t\t\tthis.classList.add('editing');\n\t\t\tthis.query('.edit').focus();\n\t\t} else {\n\t\t\tthis.classList.remove('editing');\n\t\t}\n\t}", "function loanContactsPanel_Set(loanContacts, subjectPropertyAddress) {\n //if there is one contact then only display that contact detail. To display \n // a list of one contact would not be good design.\n if (loanContacts !== null && loanContacts.length > 0) {\n\n /* store the loan contacts list locally*/\n window.Compass.Helm.LoanContacts = loanContacts;\n if (loanContacts.length === 1) {\n //only one contact -- no need to show list.\n var loanContactId = loanContacts[0].ContactId;\n /* * Show Contact Details * */\n loanContacts_ShowContactDetails(loanContactId);\n }\n else {\n loanContacts_igGrid_DataBind(loanContacts);\n loanContacts_ShowContactList(true);\n }\n\n }\n\n if (subjectPropertyAddress !== null) {\n var address = subjectPropertyAddress;\n //Combine address lines one and two into one line (if there is an address 2)\n var addressLine1 = helm.formatText(address.Address1);\n var addressLine2 = helm.formatText(address.Address2);\n addressLine1 += (addressLine2 === \"\" ? \"\" : \", \" + addressLine2);\n $(\"#LoanContactsAddress1_helm\").text(addressLine1);\n //$(\"#LoanContactsAddress2_helm\").text(helm.formatText(address.Address2));\n $(\"#LoanContactsCityStateZip_helm\").text(helm.formatText(address.CityStateZipFormatted));\n\n //2015_08_18 MP In order to reduce clutter and info overload, Nancy E. \n // and I talked about County display not being needed on dashboard.\n //$(\"#LoanContactsCounty_helm\").text(helm.formatText(address.CountyName));\n }\n }", "function update() {\n console.log('update()');\n firstName = document.getElementById(\"firstNameID\").value;\n lastName = document.getElementById(\"lastNameID\").value;\n preferredName = document.getElementById(\"preferredNameID\").value;\n email = document.getElementById(\"emailID\").value;\n phoneNumber = document.getElementById(\"phoneNumberID\").value;\n zip = document.getElementById(\"zipID\").value;\n city = document.getElementById(\"cityID\").value;\n state = document.getElementById(\"stateID\").value;\n lat = document.getElementById(\"latID\").value;\n lng = document.getElementById(\"lngID\").value;\n favoriteHobby = document.getElementById(\"favoriteHobbyID\").value;\n\n updatedContact = '{\"firstName\": \"' + firstName + '\", \"lastName\": \"' + lastName +'\", \"preferredName\": \"' + preferredName \n +'\", \"email\": \"' + email + '\", \"phoneNumber\": \"' + phoneNumber + '\", \"zip\": \"' + zip +'\", \"city\": \"' + city \n +'\", \"state\": \"' + state + '\", \"lat\": \"' + lat + '\", \"lng\": \"' + lng + '\", \"favoriteHobby\": \"' + favoriteHobby +'\"}';\n contact = JSON.parse(updatedContact);\n contactArray[currentContactIndex] = contact;\n currentContactIndex = currentContactIndex;\n viewCurrentContact();\n showSnackbar(\"Contact updated\");\n renderContact(contactArray);\n}", "edit(value) {\r\n if (this.disabled === 'true') {\r\n return;\r\n }\r\n this.onEditing.emit('editing click');\r\n this.preValue = value;\r\n this.editing = true;\r\n this._originalValue = value;\r\n }", "function setEditForm(that) {\n $('#currency').val(that.attr('data-currency'));\n $('#input-exchange-rate').val(that.attr('data-value'));\n $('#save-exchange-rate').attr('data-rid', that.attr('data-rid'));\n $('#frm-exchange').attr('title', 'Update exchange rate');\n $('#save-exchange-rate').val('Update');\n}", "function setEdit(edit) {\n dispatch({ type: 'SET_EDIT', payload: edit })\n }", "function ContactChange() {\n\t//------------------------------------------------------------------------------\n\tvar $Form = document.forms['ContactEditForm'];\n\t//------------------------------------------------------------------------------\n\t$HTTP = new HTTP();\n\t//------------------------------------------------------------------------------\n\tif (!$HTTP.Resource) {\n\t\t//------------------------------------------------------------------------------\n\t\talert('Не удалось создать HTTP соединение');\n\t\t//------------------------------------------------------------------------------\n\t\treturn false;\n\t\t//------------------------------------------------------------------------------\n\t}\n\t//------------------------------------------------------------------------------\n\t//------------------------------------------------------------------------------\n\t$HTTP.onLoaded = function() {\n\t\t//------------------------------------------------------------------------------\n\t\tHideProgress();\n\t\t//------------------------------------------------------------------------------\n\t}\n\t//------------------------------------------------------------------------------\n\t//------------------------------------------------------------------------------\n\t$HTTP.onAnswer = function($Answer) {\n\t\t//------------------------------------------------------------------------------\n\t\tswitch ($Answer.Status) {\n\t\tcase 'Error':\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tShowAlert($Answer.Error.String, 'Warning');\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tbreak;\n\t\t\t//------------------------------------------------------------------------------\n\t\tcase 'Exception':\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tShowAlert(ExceptionsStack($Answer.Exception), 'Warning');\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tbreak;\n\t\t\t//------------------------------------------------------------------------------\n\t\tcase 'Ok':\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tShowProgress('Изменение контактного адреса');\n\t\t\tsetTimeout(\n\t\t\t\t//------------------------------------------------------------------------------\n\t\t\t\tfunction (){\n\t\t\t\t\t//------------------------------------------------------------------------------\n\t\t\t\t\tShowWindow('/UserPersonalDataChange');\n\t\t\t\t\t//------------------------------------------------------------------------------\n\t\t\t\t},\n\t\t\t\t//------------------------------------------------------------------------------\n\t\t\t1000);\n\t\t\t//------------------------------------------------------------------------------\n\t\t\t//------------------------------------------------------------------------------\n\t\t\tbreak;\n\t\t\t//------------------------------------------------------------------------------\n\t\tdefault:\n\t\t\t//------------------------------------------------------------------------------\n\t\t\talert('Не известный ответ');\n\t\t\t//------------------------------------------------------------------------------\n\t\t}\n\t\t//------------------------------------------------------------------------------\n\t};\n\t//------------------------------------------------------------------------------\n\t//------------------------------------------------------------------------------\n\tvar $Args = FormGet($Form);\n\t//------------------------------------------------------------------------------\n\tif (!$HTTP.Send('/API/ContactEdit', $Args)) {\n\t\t//------------------------------------------------------------------------------\n\t\talert('Не удалось отправить запрос на сервер');\n\t\t//------------------------------------------------------------------------------\n\t\treturn false;\n\t\t//------------------------------------------------------------------------------\n\t}\n\t//------------------------------------------------------------------------------\n\t//------------------------------------------------------------------------------\n\tShowProgress('Отправка данных на сервер');\n\t//------------------------------------------------------------------------------\n\t//------------------------------------------------------------------------------\n}", "function VoucherActivityEditBaseModel() {\n FormModel.apply(this, arguments);\n\n // 表单数据请求器\n this.formRequester = api.getVoucherActivityById;\n\n // 表单提交请求器 (*)\n this.submitRequester = api.updateVoucherActivity;\n }", "function Put() {\n var contact = {\n Id:$('#Id').val(),\n FirstName: $('#first_name').val(),\n LastName: $('#last_name').val(),\n PhoneNumber: $('#phone_number').val(),\n ProfileImage: $('#profileImg').val(),\n Email: $('#email').val(),\n DOB: $('#dob').val()\n };\n\n $.ajax({\n url: Host+\"/api/contacts/updatecontact\",\n data: JSON.stringify(contact),\n type: \"PUT\",\n contentType: \"application/json;charset=utf-8\",\n success: function (result) {\n console.log(result);\n location.reload();\n },\n error: function (errormessage) {\n alert(errormessage.responseText);\n }\n });\n}", "function editPerson() {\n\n\n $(\"#editPerson\").show();\n $(\"#addperson\").hide();\n\n var obj = $(this).data();\n\n editP = obj;\n\n $(\"#personInput\").toggle();\n\n// $(\"#myModal\").toggle();\n\n\n $('#inputPersonName').val(obj.firstName);\n $('#inputLastname').val(obj.lastName);\n $('#inputPersonEmail').val(obj.email);\n $('#oleole').val(79879);\n\n}", "setEditMode(mode){\n if(mode && mode===this._lastEditMode){\n return;\n }\n this._lastEditMode=mode;\n this.detachSelectionControllers();\n this.currentSelectionModeControllers=[this.getSelectionControllersDict()[mode]];\n const selectedModelController = this.getSelectedModelController();\n if(selectedModelController){\n this.attachSelectionControllers(selectedModelController);\n }\n }", "function Contact(label, value) {\n this.label = label;\n this.value = value;\n}", "function set_return_contact_address(account_id, account_name, bill_street, ship_street, bill_city, ship_city, bill_state, ship_state, bill_code, ship_code, bill_country, ship_country, bill_pobox, ship_pobox) {\n\tif (document.getElementById('from_link').value != '') {\n\t\tif (typeof (window.opener.document.QcEditView.account_id_display) != 'undefined') {\n\t\t\twindow.opener.document.QcEditView.account_id_display.value = account_name;\n\t\t}\n\t\tif (typeof (window.opener.document.QcEditView.account_id) != 'undefined') {\n\t\t\twindow.opener.document.QcEditView.account_id.value = account_id;\n\t\t}\n\t} else {\n\t\tif (window.opener.gVTModule == 'Contacts' && typeof(window.opener.document.EditView) == 'undefined') {\n\t\t\treturn vtlib_setvalue_from_popup(account_id, account_name, 'account_id', 'EditView');\n\t\t}\n\t\tif (typeof (window.opener.document.EditView.account_id_display) != 'undefined') {\n\t\t\twindow.opener.document.EditView.account_id_display.value = account_name;\n\t\t}\n\t\tif (typeof (window.opener.document.EditView.account_id) != 'undefined') {\n\t\t\twindow.opener.document.EditView.account_id.value = account_id;\n\t\t}\n\t\tif (confirm(alert_arr.OVERWRITE_EXISTING_ACCOUNT1 + account_name + alert_arr.OVERWRITE_EXISTING_ACCOUNT2)) {\n\t\t\tif (typeof (window.opener.document.EditView.mailingstreet) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.mailingstreet.value = bill_street;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.otherstreet) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.otherstreet.value = ship_street;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.mailingcity) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.mailingcity.value = bill_city;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.othercity) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.othercity.value = ship_city;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.mailingstate) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.mailingstate.value = bill_state;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.otherstate) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.otherstate.value = ship_state;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.mailingzip) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.mailingzip.value = bill_code;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.otherzip) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.otherzip.value = ship_code;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.mailingcountry) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.mailingcountry.value = bill_country;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.othercountry) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.othercountry.value = ship_country;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.mailingpobox) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.mailingpobox.value = bill_pobox;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.otherpobox) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.otherpobox.value = ship_pobox;\n\t\t\t}\n\t\t}\n\t}\n}", "fillContactFields(contactData) {\n this.fillContactWithAllFieldsAndSave(this.contactInformation, contactData);\n }", "function setEditValuesCompany(index) {\n\n // generic list/ object initializer\n var jsonObject = (!Array.isArray(fetchData)) ? fetchData : fetchData[index];\n\n // general setters\n document.getElementById('edit-company-title').innerText = jsonObject['name'] + \" (cvr: \" + jsonObject['cvr'] + \")\";\n document.getElementById('edit-company-email').value = jsonObject['email'];\n\n // phones setters\n document.getElementById('company-phone-container').innerHTML = \"<h5><b>phones</b></h5>\";\n for (var phone in jsonObject['phones']) {\n document.getElementById('company-phone-container').innerHTML += \"<input type='text' class='form-control' value='\" + jsonObject['phones'][phone] + \"'>\";\n }\n\n // address setters\n if(jsonObject['address'] != undefined) document.getElementById('edit-company-street').value = jsonObject['address'];\n if(jsonObject['city'] != undefined) document.getElementById('edit-company-city').value = jsonObject['city'];\n if(jsonObject['zipCode'] != undefined) document.getElementById('edit-company-zipcode').value = jsonObject['zipCode'];\n\n // company info setters\n document.getElementById('edit-company-value').value = jsonObject['marketValue'];\n document.getElementById('edit-company-employees').value = jsonObject['numEmployees'];\n}", "function editActivity() {\n\n // get the name of the activity\n // and check that it's not empty\n var name = view.activityName.val();\n if (name == '') {\n event.preventDefault();\n event.stopPropagation();\n view.activityNameErrorLabel.addClass('error');\n return;\n }\n\n // get the length of the activity\n // and check that the value is numerical and greater than 0\n var length = view.activityLength.val();\n if (isNumber(length)) {\n if (length <= 0) {\n event.preventDefault();\n event.stopPropagation();\n view.activityLengthErrorLabel.html('Length must be greater than 0.');\n view.activityLengthErrorLabel.addClass('error');\n return;\n }\n } else {\n event.preventDefault();\n event.stopPropagation();\n view.activityLengthErrorLabel.html('Value must be numerical.');\n view.activityLengthErrorLabel.addClass('error');\n return;\n }\n // the value we got from the dialog is a string and we have to convert\n // it to an integer, otherwise we get weird results when computing the total\n // length of a day (found out the hard way ;-))\n length = parseInt(length);\n\n // get the type of the activity\n var type = view.activityType.val();\n switch (type) {\n case '0':\n type = 0; break;\n case '1':\n type = 1; break;\n case '2':\n type = 2; break;\n case '3':\n type = 3; break;\n default:\n console.log(\"Error: unknown activity type\");\n }\n\n // get the description of the activity\n var description = view.activityDescription.val();\n\n // create new activity and replace the old activity in the model\n var editedActivity = new Activity(name, length, type, description);\n if (day == null) {\n model.editParkedActivity(activity, editedActivity);\n } else {\n model.editActivity(day, activity, editedActivity);\n }\n\n }" ]
[ "0.6863164", "0.66345423", "0.6378787", "0.6335341", "0.6314018", "0.62220573", "0.61681384", "0.6136392", "0.61141276", "0.60601896", "0.59828055", "0.5960374", "0.59480196", "0.5918278", "0.5901357", "0.5839305", "0.5778192", "0.5706472", "0.57013464", "0.5696255", "0.56785166", "0.56236255", "0.5582794", "0.5568362", "0.5550519", "0.5542942", "0.55400693", "0.5528062", "0.5521367", "0.5518275", "0.5508594", "0.5508055", "0.54875135", "0.54855615", "0.5421193", "0.5400843", "0.53972423", "0.53957236", "0.53816336", "0.534868", "0.5310884", "0.53032863", "0.5289845", "0.5289845", "0.5289845", "0.5289845", "0.5282769", "0.5282769", "0.52791804", "0.5271096", "0.52381116", "0.5232162", "0.5227528", "0.5227528", "0.5225352", "0.52235067", "0.5220438", "0.5211532", "0.5210327", "0.5192644", "0.5189977", "0.5175912", "0.515564", "0.515538", "0.5152027", "0.5126901", "0.511742", "0.5112664", "0.5097926", "0.50977784", "0.5091587", "0.5084788", "0.5077579", "0.5062905", "0.50617284", "0.505202", "0.50297594", "0.50252545", "0.5017652", "0.5012404", "0.5006446", "0.50062984", "0.50047153", "0.49847305", "0.49837905", "0.4982535", "0.49782753", "0.49719718", "0.49706393", "0.49598235", "0.4958227", "0.4957542", "0.4954585", "0.49422494", "0.49247754", "0.49200854", "0.4919348", "0.49142858", "0.49135628", "0.491208" ]
0.71465987
0
Respond to control events.
'.save click'() { this.saveContact(); Navigator.openParentPage(); // Prevent the default submit behavior return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Control() {}", "function Control() {}", "function Control() {}", "function Control() {}", "handleControl(e, type) {\n switch (type) {\n case \"play\":\n return clickPlay(e, this.videoEle);\n case \"pause\":\n return clickPlay(e, this.videoEle);\n case \"skip\":\n return clickSkip(e, this.videoEle, 1);\n case \"mute\":\n return clickMute(e, this.videoEle);\n case \"fullscreen\":\n return clickFullscreen(e, this.videoEle);\n default:\n return;\n }\n }", "controlEventOccurred(_viModel, _controlModel, _eventName, _eventData) {\n }", "bindControlEvents (){\n Array.from(this.controls.querySelectorAll('[data-timer-action]')).forEach((el) => {\n el.addEventListener(this.interactionEvent, (event) => {\n this[el.getAttribute('data-timer-action')]();\n });\n });\n }", "function handleControl(event, context) {\n requestForDeviceServiceAccessToken(event)\n .then(constructDeviceCommand, log)\n .then(submitHttpRequest, log)\n .then(function notifyAlexa(result) {\n log('Control', result);\n context.succeed(result);\n }, function notifyAlexa(result) {\n log('Control', result);\n context.fail(result);\n });\n}", "handleControlDownKey() {\n this.moveToNextParagraph();\n this.checkForCursorVisibility();\n }", "connect(target) { this._control.connect(target); }", "function handleControl(event, context) {\n\n log('Handle control event', JSON.stringify(event));\n\n\n let header = event.directive.header;\n let endpoint = event.directive.endpoint;\n let endpointId = endpoint.endpointId;\n\n /**\n * Fail the invocation if the header is unexpected. This example only demonstrates\n * turn on / turn off, hence we are filtering on anything that is not SwitchOnOffRequest.\n */\n if (header.namespace !== 'Alexa.PowerController' && header.namespace !== 'Alexa.PowerLevelController' || header.name === 'AdjustPowerLevel' ) {\n return context.fail(util.generateControlError('SwitchOnOffRequest', 'UNSUPPORTED_OPERATION', 'Unrecognized operation'));\n }\n\n //TODO: remove duplicate code\n if (header.namespace === 'Alexa.PowerController') {\n let accessToken = endpoint.scope.token;\n let requestMethod = header.name;\n let basePath = config.REMOTE_CLOUD_BASE_PATH + '/Stones/' + endpointId + '/switch?access_token=' + accessToken;\n\n let postData = JSON.stringify({type: (requestMethod === 'TurnOn' ? \"TURN_ON\" : \"TURN_OFF\")});\n\n let options = {\n hostname: config.REMOTE_CLOUD_HOSTNAME,\n port: 443,\n path: basePath,\n method: 'POST',\n headers: {\n accept: '*/*',\n 'Content-Type': 'application/json',\n 'Content-Length': Buffer.byteLength(postData)\n }\n };\n\n console.log(options.method, 'Requesting to', basePath, \"with options\", options, 'and data', postData);\n\n let postRequest = https.request(options, getPowerRequestHandler(event, context));\n\n postRequest.on('error', util.getErrorHandler(context));\n postRequest.write(postData);\n postRequest.end();\n }\n else if (header.namespace === 'Alexa.PowerLevelController') {\n let accessToken = endpoint.scope.token;\n let payload = event.directive.payload;\n let level = payload.powerLevel;\n let basePath = config.REMOTE_CLOUD_BASE_PATH + '/Stones/' + endpointId + '/switch?access_token=' + accessToken;\n\n let postData = JSON.stringify({type: \"PERCENTAGE\", percentage: level });\n\n let options = {\n hostname: config.REMOTE_CLOUD_HOSTNAME,\n port: 443,\n path: basePath,\n method: 'POST',\n headers: {\n accept: '*/*',\n 'Content-Type': 'application/json',\n 'Content-Length': Buffer.byteLength(postData)\n }\n };\n\n console.log(options.method, 'Requesting to', basePath, \"with options\", options, 'and data', postData);\n\n let postRequest = https.request(options, getPowerLevelRequestHandler(event, context, level))\n postRequest.on('error', util.getErrorHandler(context));\n postRequest.write(postData);\n postRequest.end();\n }\n}", "trigger() {\n control.trigger.apply(this, [].slice.call(arguments));\n }", "on() {\n control.on.apply(this, [].slice.call(arguments));\n }", "function control(e) {\n if(e.keyCode === 32) { /* 32 is the keycode for space bar, this function assigns the jump function to the space bar */\n jump()\n }\n }", "handleControlShiftDownKey() {\n this.extendToParagraphEnd();\n this.checkForCursorVisibility();\n }", "function handleControl(event, callback) {\n\n if (event.queryStringParameters.namespace !== 'Alexa.ConnectedHome.Control' || \n !(event.queryStringParameters.name == 'TurnOnRequest' ||\n event.queryStringParameters.name == 'TurnOffRequest' || \n event.queryStringParameters.name == 'SetPercentageRequest' ||\n event.queryStringParameters.name == 'IncrementPercentageRequest' ||\n event.queryStringParameters.name == 'DecrementPercentageRequest'\n ) ) {\n console.log('Bad namespace or name:',event);\n callback(new Error('Unsupported Operation'));\n return;\n }\n\n var applianceId = event.queryStringParameters.applianceId;\n\n if (typeof applianceId !== \"string\" ) {\n console.log('Event payload is invalid:',event);\n callback(new Error('Unexpected Information Recieved'));\n return;\n }\n \n var deviceValue = event.queryStringParameters.value;\n \n if ((event.queryStringParameters.name == 'SetPercentageRequest' ||\n event.queryStringParameters.name == 'IncrementPercentageRequest' ||\n event.queryStringParameters.name == 'DecrementPercentageRequest') &&\n typeof deviceValue !== \"string\") {\n console.log('Value required for action:',event);\n callback(new Error('Value required for action'));\n return;\n }\n\n switch (event.queryStringParameters.name) {\n case 'TurnOnRequest':\n controlHSDevice(applianceId,'deviceon',100,function(response){\n if (response.error) {\n callback(new Error('Target Hardware Malfunction'));\n } else {\n callback();\n }\n });\n break;\n case 'TurnOffRequest':\n controlHSDevice(applianceId,'deviceoff',0,function(response){\n if (response.error) {\n callback(new Error('Target Hardware Malfunction'));\n } else {\n callback();\n }\n });\n break;\n case 'SetPercentageRequest':\n controlHSDevice(applianceId,'setdevicevalue',event.queryStringParameters.value,function(response){\n if (response.error) {\n callback(new Error('Target Hardware Malfunction'));\n } else {\n callback();\n }\n });\n break;\n case 'IncrementPercentageRequest':\n controlHSDevice(applianceId,'changedevicevalue',event.queryStringParameters.value,function(response){\n if (response.error) {\n callback(new Error('Target Hardware Malfunction'));\n } else {\n callback();\n }\n });\n break;\n case 'DecrementPercentageRequest':\n controlHSDevice(applianceId,'changedevicevalue',-event.queryStringParameters.value,function(response){\n if (response.error) {\n callback(new Error('Target Hardware Malfunction'));\n } else {\n callback();\n }\n });\n break;\n default:\n console.log('Err', 'No supported action: ' + event.queryStringParameters.name);\n callback(new Error('Something went wrong'));\n break;\n }\n}", "function events() {\r\n\taddition();\r\n\tcounter();\r\n\tcheckForm();\r\n}", "onControlClicked(control) {\n if (this.isRunning)\n return;\n this._setIsRunning(true);\n switch (control) {\n case \"shuffle\":\n this.shuffle();\n break;\n case \"AStar\":\n this.solve(1);\n break;\n case \"IDAStar\":\n this.solve(0);\n break;\n default:\n this._setIsRunning(false);\n }\n }", "function control(e) {\n switch(e.keyCode) {\n case 65:\n moveLeft();\n break;\n case 68: \n moveRight();\n break;\n case 87: \n rotate();\n break;\n case 83: \n moveDown();\n break;\n default:\n\n }\n }", "controlsHandler(ev) {\n let selected = this.state.selectedIndex;\n\n switch (ev.which) {\n case keys.UP:\n if ( selected > 0 ) {\n this.setState({selectedIndex: selected - 1});\n }\n break;\n case keys.DOWN:\n if ( selected < 8 ) {\n this.setState({selectedIndex: isNumber(selected) ? selected + 1 : 0});\n }\n break;\n case keys.ENTER:\n this.selectHandler(selected);\n break;\n }\n }", "function handleControl(event, context) {\n if (event.header.namespace === 'Alexa.ConnectedHome.Control') {\n\n /**\n * Retrieve the appliance id and accessToken from the incoming message.\n */\n let accessToken = event.payload.accessToken;\n let applianceId = event.payload.appliance.applianceId;\n let deviceid = event.payload.appliance.additionalApplianceDetails.deviceId;\n let message_id = event.header.messageId;\n let param = \"\";\n let index = \"0\";\n let state = 0;\n let confirmation;\n let funcName;\n\n log(\"Access Token: \", accessToken);\n log(\"DeviceID: \", deviceid);\n\n if (event.header.name == \"TurnOnRequest\") {\n state = 1;\n confirmation = \"TurnOnConfirmation\";\n funcName = \"onoff\";\n }\n else if (event.header.name == \"TurnOffRequest\") {\n state = 0;\n confirmation = \"TurnOffConfirmation\";\n funcName = \"onoff\";\n }\n else if (event.header.name == \"SetPercentageRequest\") {\n state = event.payload.percentageState.value;\n confirmation = \"SetPercentageConfirmation\";\n funcName = \"setvalue\";\n }\n else if (event.header.name == \"IncrementPercentageRequest\") {\n let increment = event.payload.deltaPercentage.value;\n\n state += increment;\n\n if (state > 100) {\n state = 100;\n }\n\n confirmation = \"IncrementPercentageConfirmation\";\n funcName = \"setvalue\";\n }\n else if (event.header.name == \"DecrementPercentageRequest\") {\n let decrement = event.payload.deltaPercentage.value;\n\n state -= decrement;\n\n if (state < 0) {\n state = 0;\n }\n\n confirmation = \"DecrementPercentageConfirmation\";\n funcName = \"setvalue\";\n }\n\n let options = {\n method: 'POST',\n url: particleServer,\n headers: {\n 'cache-control': 'no-cache',\n authorization: 'Bearer ' + accessToken,\n 'content-type': 'application/json'\n },\n body: {\n inputs: [{\n intent: 'Alexa.ConnectedHome.Control',\n payload: {\n devices: deviceid,\n confirmation: confirmation,\n state: state,\n funcName: funcName\n }\n }]\n },\n json: true\n };\n\n request(options, function (error, response, body) {\n if (error) throw new Error(error);\n let headers = {\n authorization: \"Bear \" + accessToken,\n namespace: 'Alexa.ConnectedHome.Control',\n name: body.payload.commands,\n payloadVersion: '2',\n messageId: message_id\n };\n let payloads = {};\n let result = {\n header: headers,\n payload: payloads\n };\n\n context.succeed(result);\n });\n }\n}", "handleControlEndKey() {\n let documentEnd = undefined;\n if (!isNullOrUndefined(this.owner.documentEnd)) {\n documentEnd = this.owner.documentEnd;\n }\n if (!isNullOrUndefined(documentEnd)) {\n this.owner.selection.selectContent(documentEnd, true);\n }\n this.checkForCursorVisibility();\n }", "_evtChange(event) { }", "internalControlEventOccurred(_viModel, _controlModel, _eventName, _eventData) {\n }", "function handleControlConnection(connection) {\n\t\tconnection.on('data', function (data) {\n\t\t\tconsole.log('Got command:', data.toString().trim());\n\t\t\tvar request = data.toString().trim().split(' '),\n\t\t\t\tcmd = request[0],\n\t\t\t\ttarget = request[1],\n\t\t\t\tnewline = '\\r\\n',\n\t\t\t\tresponse;\n\t\t\tconsole.log('Command is:', cmd);\n\t\t\tswitch (cmd) {\n\t\t\t\tcase 'start':\n\t\t\t\t\tconsole.log('got here');\n\t\t\t\t\tself.store.broadcast('worker:start', target);\n\t\t\t\t\tresponse = lib.format('Starting {0} servers.', (target || 'all'));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'pause':\n\t\t\t\t\tself.store.broadcast('worker:pause', target);\n\t\t\t\t\tresponse = lib.format('Pausing {0} servers.', (target || 'all'));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'stop':\n\t\t\t\t\tself.store.broadcast('worker:stop', target);\n\t\t\t\t\tresponse = lib.format('Stopping {0} servers.', (target || 'all'));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'resume':\n\t\t\t\t\tself.store.broadcast('worker:resume', target);\n\t\t\t\t\tresponse = lib.format('Resuming {0} servers.', (target || 'all'));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'heartbeat':\n\t\t\t\t\tvar id = lib.guid();\n\t\t\t\t\tself.store.broadcast('worker:heartbeat', id);\n\t\t\t\t\twait(id, function () {\n\t\t\t\t\t\tvar args = Array.prototype.slice.call(arguments),\n\t\t\t\t\t\t\tresponse = {};\n\t\t\t\t\t\tlib.each(args, function (data) {\n\t\t\t\t\t\t\tvar message = data[0],\n\t\t\t\t\t\t\t\tworker = data[1];\n\t\t\t\t\t\t\tresponse[worker] = message;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tconnection.write(JSON.stringify(response));\n\t\t\t\t\t\tconnection.end(newline);\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'stats':\n\t\t\t\t\tvar id = lib.guid();\n\t\t\t\t\tself.store.broadcast('worker:stats', id);\n\t\t\t\t\twait(id, function () {\n\t\t\t\t\t\tvar args = Array.prototype.slice.call(arguments),\n\t\t\t\t\t\t\tresponse = {};\n\t\t\t\t\t\tlib.each(args, function (data) {\n\t\t\t\t\t\t\tvar message = data[0],\n\t\t\t\t\t\t\t\tworker = data[1];\n\t\t\t\t\t\t\tresponse[worker] = message;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tconnection.write(JSON.stringify(response));\n\t\t\t\t\t\tconnection.end(newline);\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tresponse = lib.format('Unknown command: {0}.', cmd);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (response) {\n\t\t\t\tconnection.write(response);\n\t\t\t\tconnection.end(newline);\n\t\t\t}\n\t\t});\n\t}", "handleControlShiftUpKey() {\n this.extendToParagraphStart();\n this.checkForCursorVisibility();\n }", "_events() {\n \tthis._addKeyHandler();\n \tthis._addClickHandler();\n }", "handleEvents() {\n }", "function control(e) {\n\t\tif (e.keyCode === 38) {\n\t\t\tjump();\n\t\t} else if (e.keyCode === 37) {\n\t\t\tslideLeft();\n\t\t} else if (e.keyCode === 39) {\n\t\t\tslideRight();\n\t\t}\n\t}", "bindControlsEvent () {\n this.nextBtn.addEventListener(\"click\", () => this.nextSlide())\n this.prevBtn.addEventListener(\"click\", () => this.prevSlide())\n }", "connectedCallback () {\n super.connectedCallback();\n\n let ctrl = this.controlElement;\n if (ctrl) {\n ctrl.addEventListener('change', this._onCtrlChange);\n ctrl.addEventListener('blur', this._onCtrlBlur);\n }\n }", "function control(e) {\n if(e.keyCode === 37) {\n keyLeft()\n } else if (e.keyCode === 38) {\n keyUp()\n } else if (e.keyCode === 39) {\n keyRight()\n } else if (e.keyCode === 40) {\n keyDown()\n }\n }", "function controls(e) {\n\t\tvar x = null;\n\t\tvar y = null;\n\t\tif(e.offset)\n\t\t{\n\t\t var offset = e.offset();\n\t\t x = offset.x;\n\t\t y = offset.y;\n\t\t}\n\t\telse if(e.touches && e.touches[0] && e.touches[0].pageX && e.touches[0].pageY )\n\t\t{\n\t\t try\n\t\t {\n\t\t var canvasoffset = $(cd.canvas).offset();\n\t\t x = e.touches[0].pageX-canvasoffset.left;\n\t\t y = e.touches[0].pageY-canvasoffset.top;\n\t\t }\n\t\t catch(error)\n\t\t {\n\t\t console.log(error);\n\t\t console.log(e);\n\t\t }\n\t\t}\n\n //this fuckss with the range controll on the site, so i disabled it\n\tif (e.preventDefault && e.srcElement && e.srcElement.id==canvasId) { e.preventDefault(); }\n\t//e.preventDefault();\n\t\n\tif(x&&y)\n\t{\n\t\tswitch (e.type) {\n\t\t\n\t\t case \"mousedown\": \n\t\t\tcase \"onmousedown\":\n cd.drawStart(x, y);\n\t\t\t\tbreak;\n\t\t\n\t\t case \"mousemove\": \n\t\t\tcase \"onmousemove\":\n\t\t\t\tcd.draw(x, y);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"touchmove\":\n\t\t\t if(!cd.drawing){cd.drawStart(x, y);}\n\t\t\t //if(console){console.log('tm'+x+'-'+y);}\n\t\t\t cd.draw(x, y);\n\t\t\t break;\n\n\t case \"touchstart\":\n\t cd.drawStart(x, y);\n\t\t\t break;\n\t\t\t\n\t\t\tcase \"touchend\":\n\t\t\t cd.drawStop();\n\t\t\t break;\n \n case \"mouseup\": \n\t\t\tcase \"onmouseup\":\n\t\t\t\tcd.drawStop();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"mouseout\":\n\t\t\t\tcd.drawPause();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"mouseover\":\n\t\t\t\tcd.drawResume(x, y);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\t}", "function _controlPanelClick(event) {\n\tvar el = event.target;\n\t//TODO: Rely on data-action only\n\tif (_controlHandler[el.id] != null) {\n\t\tif (_validateHandler[el.id](event)) _controlHandler[el.id](event);\n\t}\n\n\tif (_controlHandler[el.getAttribute('data-action')] != null) {\n\t\tif (el.getAttribute('data-action') == 'colorSelect') {\n\t\t\treturn;\n\t\t}\n\t\tif (_validateHandler[el.getAttribute('data-action')](event)) _controlHandler[el.getAttribute('data-action')](event);\n\t}\n}", "function Control()\n{\n\tfunction Move(move) \n { \t\n switch (move) \n {\n case mJump: \n\t\t\t\tvar timeout = 90;\t\t\t\n PressKey(38, timeout)\n console.log('Jump!');\n break;\n\n case mDuck: \t\n timeout = 400;\n PressKey(40, timeout)\n console.log('Duck!');\n break;\n case mRun:\n \tbreak;\n\n default:\n console.log('Invalid move ' + move);\n }\n }\n\t\n\tfunction PressKey(key, timeout) \n {\n\t\tkeyPress('keydown', key);\n\t\tsetTimeout(function() {keyPress('keyup', key);}, timeout);\n }\n\t\n\tfunction keyPress(type, keycode) \n {\n var eventObj = document.createEventObject ?\n document.createEventObject() : document.createEvent(\"Events\");\n\n if(eventObj.initEvent)\n {\n eventObj.initEvent(type, true, true);\n }\n\n eventObj.keyCode = keycode;\n eventObj.which = keycode;\n\n document.dispatchEvent ? document.dispatchEvent(eventObj) : el.fireEvent(\"onkeydown\", eventObj);\n }\n\t\n\t// exports\n return { Move: Move, PressKey : PressKey };\n}", "function bindControls() {\n document.addEventListener(\"keydown\", keyDownHandler, false);\n document.addEventListener(\"keyup\", keyUpHandler, false);\n}", "function control(event) {\n if(event.keyCode === 37) {\n moveLeft();\n } else if (event.keyCode === 38) {\n rotate();\n } else if (event.keyCode === 39) {\n moveRight();\n } else if (event.keyCode === 40) {\n moveDown();\n }\n }", "function handleButtons () {\n handleStartButton();\n handleSubmitButton();\n handleNextButton();\n handleShowAllQandA();\n handleRestartButton();\n }", "function ButtonControl() {\n}", "function Controls() {\n this.codes = {\n 87: 'forward',\n 83: 'backward',\n 65: 'left',\n 68: 'right',\n };\n this.states = {\n 'left': false,\n 'right': false,\n 'forward': false,\n 'backward': false\n };\n document.addEventListener('keydown', this.onKey.bind(this, true), false);\n document.addEventListener('keyup', this.onKey.bind(this, false), false);\n }", "function control(e) {\n switch(e.keyCode) {\n case 37:\n moveLeft()\n break\n case 38:\n rotate()\n break\n case 39:\n moveRight()\n break\n case 40:\n moveDown()\n break\n }\n }", "handleControlShiftEndKey() {\n let documentEnd = undefined;\n if (!isNullOrUndefined(this.owner.documentEnd)) {\n documentEnd = this.owner.documentEnd;\n }\n if (!isNullOrUndefined(documentEnd)) {\n this.end.setPosition(documentEnd.currentWidget, false);\n this.fireSelectionChanged(true);\n }\n this.checkForCursorVisibility();\n }", "function connexionPanierControl(){\n\tconsole.log('tata');\n\tcliendGood();\n\tmdpControl();\n\temailControl();\n}", "_handleInteraction(event) {\n if (this.disabled) {\n return;\n }\n if (event.type === 'click') {\n this._chipFoundation.handleClick();\n return;\n }\n if (event.type === 'dblclick') {\n this._chipFoundation.handleDoubleClick();\n }\n if (event.type === 'keydown') {\n this._chipFoundation.handleKeydown(event);\n return;\n }\n if (event.type === 'focusout') {\n this._chipFoundation.handleFocusOut(event);\n }\n if (event.type === 'focusin') {\n this._chipFoundation.handleFocusIn(event);\n }\n }", "function setupControllerEventHandlers( controls ) {\n\n var compassCalibrationPopupEl = document.querySelector( '#calibrate-compass-popup' );\n var compassCalibratedEl = compassCalibrationPopupEl.querySelector( 'button' );\n\n // Listen for manual interaction (zoom OR rotate)\n\n controls.addEventListener( 'userinteractionstart', function () {\n renderer.domElement.style.cursor = 'move';\n });\n\n controls.addEventListener( 'userinteractionend', function () {\n renderer.domElement.style.cursor = 'default';\n });\n\n // Show a simple 'canvas calibration required' dialog to user\n controls.addEventListener( 'compassneedscalibration', function () {\n compassCalibrationPopupEl.style.visibility = 'visible';\n\n compassCalibratedEl.addEventListener( 'click', function () {\n\n compassCalibrationPopupEl.style.visibility = 'hidden';\n\n });\n });\n}", "controlChanged(_viModel, _controlModel, _propertyName, _newValue, _oldValue) {\n }", "_createControls() {\n if (this._leftControl) {\n this._leftControl\n .addEventListener('click', () => this._leftMoveHandler());\n }\n if (this._rightControl) {\n this._rightControl\n .addEventListener('click', () => this._rightMoveHandler());\n }\n if (this._settings.swipes) {\n this._itemsHolder\n .addEventListener('pointerdown', event => this._pointerDownHandler(event));\n }\n if (this._relatedSliders.length > 0) {\n this._container.addEventListener('moveRelatedLeft', () => this._moveRelatedLeftHandler());\n this._container.addEventListener('moveRelatedRight', () => this._moveRelatedRightHandler());\n }\n }", "handleButton() {}", "moveToDocumentEnd() {\n this.handleControlEndKey();\n }", "function connexionInscriptionFormControl(){\n\tpreInscripionGood();\n\tmdpControl();\n\tnickNameControl();\n\temailControl();\n}", "handleControlUpKey() {\n this.moveToPreviousParagraph();\n this.checkForCursorVisibility();\n }", "setupControls() {\n [\"shape\", \"rows\", \"cols\", \"bombs\"].forEach((i) => {\n this.controls[i].addEventListener(\"change\", this.setupBoard.bind(this));\n });\n this.controls.outcome.hidden = true;\n }", "onKeyDownInternal(event, ctrl, shift, alt) {\n let key = event.which || event.keyCode;\n if (ctrl && !shift && !alt) {\n this.viewer.isControlPressed = true;\n switch (key) {\n // case 9:\n // event.preventDefault();\n // if (this.owner.acceptTab) {\n // this.selection.handleTabKey(false, false);\n // }\n // break;\n case 35:\n this.handleControlEndKey();\n break;\n case 36:\n this.handleControlHomeKey();\n break;\n case 37:\n this.handleControlLeftKey();\n break;\n case 38:\n this.handleControlUpKey();\n break;\n case 39:\n this.handleControlRightKey();\n break;\n case 40:\n this.handleControlDownKey();\n break;\n case 65:\n this.owner.selection.selectAll();\n break;\n case 67:\n event.preventDefault();\n this.copy();\n break;\n case 70:\n event.preventDefault();\n if (!isNullOrUndefined(this.owner.optionsPaneModule)) {\n this.owner.optionsPaneModule.showHideOptionsPane(true);\n }\n break;\n }\n }\n else if (shift && !ctrl && !alt) {\n switch (key) {\n case 35:\n this.handleShiftEndKey();\n event.preventDefault();\n break;\n case 36:\n this.handleShiftHomeKey();\n event.preventDefault();\n break;\n case 37:\n this.handleShiftLeftKey();\n event.preventDefault();\n break;\n case 38:\n this.handleShiftUpKey();\n event.preventDefault();\n break;\n case 39:\n this.handleShiftRightKey();\n event.preventDefault();\n break;\n case 40:\n this.handleShiftDownKey();\n event.preventDefault();\n break;\n }\n }\n else if (shift && ctrl && !alt) {\n switch (key) {\n case 35:\n this.handleControlShiftEndKey();\n break;\n case 36:\n this.handleControlShiftHomeKey();\n break;\n case 37:\n this.handleControlShiftLeftKey();\n break;\n case 38:\n this.handleControlShiftUpKey();\n break;\n case 39:\n this.handleControlShiftRightKey();\n break;\n case 40:\n this.handleControlShiftDownKey();\n break;\n }\n }\n else {\n switch (key) {\n // case 9:\n // event.preventDefault();\n // if (this.owner.acceptTab) {\n // this.handleTabKey(true, false);\n // }\n // break; \n case 33:\n event.preventDefault();\n this.viewer.viewerContainer.scrollTop -= this.viewer.visibleBounds.height;\n break;\n case 34:\n event.preventDefault();\n this.viewer.viewerContainer.scrollTop += this.viewer.visibleBounds.height;\n break;\n case 35:\n this.handleEndKey();\n event.preventDefault();\n break;\n case 36:\n this.handleHomeKey();\n event.preventDefault();\n break;\n case 37:\n this.handleLeftKey();\n event.preventDefault();\n break;\n case 38:\n this.handleUpKey();\n event.preventDefault();\n break;\n case 39:\n this.handleRightKey();\n event.preventDefault();\n break;\n case 40:\n this.handleDownKey();\n event.preventDefault();\n break;\n }\n }\n if (!this.owner.isReadOnlyMode) {\n this.owner.editorModule.onKeyDownInternal(event, ctrl, shift, alt);\n }\n if (this.owner.searchModule) {\n // tslint:disable-next-line:max-line-length\n if (!isNullOrUndefined(this.owner.searchModule.searchHighlighters) && this.owner.searchModule.searchHighlighters.length > 0) {\n this.owner.searchModule.searchResults.clear();\n }\n }\n if (event.keyCode === 27 || event.which === 27) {\n if (!isNullOrUndefined(this.owner.optionsPaneModule)) {\n this.owner.optionsPaneModule.showHideOptionsPane(false);\n }\n if (this.owner.enableHeaderAndFooter) {\n this.disableHeaderFooter();\n }\n }\n }", "updateControl(){\n this._control.update();\n }", "handleEvent(event) {\n if (this.isHidden || !this._editor) {\n return;\n }\n switch (event.type) {\n case 'keydown':\n this._evtKeydown(event);\n break;\n case 'mousedown':\n this._evtMousedown(event);\n break;\n case 'scroll':\n this._evtScroll(event);\n break;\n default:\n break;\n }\n }", "function voiceControl(){\r\n if (annyang) {\r\n // Commands action\r\n var commands = {\r\n 'next': function () {\r\n next();\r\n },\r\n 'back': function () {\r\n prev();\r\n },\r\n 'fullscreen': function () {\r\n fullScreen();\r\n },\r\n 'agenda': function () {\r\n sectionsScreen();\r\n },\r\n 'slide': function () {\r\n sectionsDisplaySlides();\r\n },\r\n 'close': function () {\r\n hideSectionsFrame();\r\n },\r\n 'play': function () {\r\n play();\r\n },\r\n 'stop': function () {\r\n play();\r\n },\r\n 'emaze': function () {\r\n play();\r\n fullScreen();\r\n hideGUI();\r\n }\r\n\r\n };\r\n\r\n // Initialize annyang with the commands\r\n annyang.init(commands);\r\n\r\n var $status = $('.voiceButton').attr('data-listen');\r\n\r\n if ( $status === \"false\" ){\r\n // Start listening.\r\n annyang.start({ autoRestart: false });\r\n $('.voiceButton').attr('data-listen', 'true');\r\n $('.voiceButton').addClass('buttonVoiceOn').addClass('voice-active');\r\n\r\n annyang.addCallback('end', function () {\r\n annyang.abort();\r\n $('.voiceButton').attr('data-listen', 'false'); \r\n $('.voiceButton').removeClass('buttonVoiceOn').removeClass('voice-active');\r\n });\r\n } else {\r\n annyang.abort();\r\n $('.voiceButton').attr('data-listen', 'false'); \r\n $('.voiceButton').removeClass('buttonVoiceOn').removeClass('voice-active');\r\n }\r\n }\r\n }", "function control(e)\r\n {\r\n if(e.keyCode === 37)\r\n {\r\n moveLeft()\r\n }\r\n else if(e.keyCode === 38)\r\n {\r\n rotate()\r\n }\r\n else if(e.keyCode === 39)\r\n {\r\n moveRight()\r\n }\r\n else if(e.keyCode === 40)\r\n {\r\n moveDown()\r\n }\r\n }", "function controlBtnCLicked(e){\n if(e.target.classList.contains('fa-play')){\n playStream();\n } else if(e.target.classList.contains('fa-pause')) {\n pauseStream();\n }\n e.preventDefault(); \n}", "_onRemoteControlSupported() {\n logger.log(\"Remote Control supported.\");\n if(!config.disableRemoteControl) {\n this.enabled = true;\n if(this.initialized) {\n this.receiver.enable(true);\n }\n } else {\n logger.log(\"Remote Control disabled.\");\n }\n }", "function control (e) {\n if (e.keyCode === 37 || e.keyCode === 65) moveLeft()\n if (e.keyCode === 39 || e.keyCode === 68) moveRight()\n if (e. keyCode === 38 || e.keyCode === 87) rotate()\n if (e.keyCode === 40 || e.keyCode == 83) moveDown()\n }", "function control()\n {\n console.log(\"Its called\");\n if(videoReady)\n {\n updateTexture(texture,video);\n }\n if(video.ended)\n {\n console.log(\"Video ended\");\n }\n drawImage();\n window.requestAnimationFrame(control);\n }", "giveControl() {\n this.next(null)\n }", "function control(e) {\n if(e.keyCode === 39) {\n moveRight();\n } else if(e.keyCode === 38) {\n rotate();\n } else if(e.keyCode === 37) {\n moveLeft();\n } else if(e.keyCode === 40) {\n moveDown();\n }\n }", "function handleDomEvent () {\n\t \tthis._ractive.binding.handleChange();\n\t }", "function control(e) {\r\n if (e.keyCode === 37) {\r\n moveLeft();\r\n } else if (e.keyCode === 38) {\r\n rotate();\r\n } else if (e.keyCode === 39) {\r\n moveRight();\r\n } else if (e.keyCode === 40) {\r\n moveDown();\r\n }\r\n }", "function control(e) {\n if (e.keyCode == \"38\" || e.keyCode == \"32\") {\n if (!isJump) {\n isJump = true;\n jump();\n }\n }\n }", "function control(e) {\n\n // Remove class from squares\n squares[currentIndex].classList.remove('snake');\n\n // Check for movement key input\n if (e.keyCode === 39) {\n\n // Pressing the right arrow\n direction = 1;\n\n } else if (e.keyCode === 38) {\n\n // Pressing the up arrow\n direction = -width;\n\n } else if (e.keyCode === 37) {\n\n // Pressing the left arrow\n direction = -1;\n\n } else if (e.keyCode === 40) {\n\n // Pressing the down arrow\n direction = +width;\n }\n }", "_events() {\n this._eventsForHandle(this.$handle);\n if(this.handles[1]) {\n this._eventsForHandle(this.$handle2);\n }\n }", "function handleControl(event, context) {\n\n /**\n * Create the response header for success\n */\n var headers = {\n messageID: event.header.messageId,\n namespace: event.header.namespace,\n name: event.header.name.replace(\"Request\",\"Confirmation\"),\n payloadVersion: '2'\n };\n var payloads = {};\n var result = {\n header: headers,\n payload: payloads\n };\n \n if (event.header.namespace !== 'Alexa.ConnectedHome.Control' || \n !(event.header.name == 'TurnOnRequest' ||\n event.header.name == 'TurnOffRequest' || \n event.header.name == 'SetPercentageRequest' ||\n event.header.name == 'IncrementPercentageRequest' ||\n event.header.name == 'DecrementPercentageRequest'\n ) ) {\n context.fail(generateControlError(event.header.name.replace(\"Request\",\"Response\"), 'UNSUPPORTED_OPERATION', 'Unrecognized operation'));\n }\n\n var applianceId = event.payload.appliance.applianceId;\n\n if (typeof applianceId !== \"string\" ) {\n log(\"event payload is invalid\",event);\n context.fail(generateControlError(event.header.name.replace(\"Request\",\"Response\"), 'UNEXPECTED_INFORMATION_RECEIVED', 'Input is invalid'));\n }\n\n switch (event.header.name) {\n case 'TurnOnRequest':\n controlHSDevice(applianceId,'deviceon',100,function(response){\n if (response.error) {\n context.succeed(generateControlError(\"TargetHardwareMalfunctionError\", 'TARGET_HARDWARE_MALFUNCTION', response.error));\n } else {\n context.succeed(result);\n }\n });\n break;\n case 'TurnOffRequest':\n controlHSDevice(applianceId,'deviceoff',0,function(response){\n if (response.error) {\n context.succeed(generateControlError(\"TargetHardwareMalfunctionError\", 'TARGET_HARDWARE_MALFUNCTION', response.error));\n } else {\n context.succeed(result);\n }\n });\n break;\n case 'SetPercentageRequest':\n controlHSDevice(applianceId,'setdevicevalue',event.payload.percentageState.value,function(response){\n if (response.error) {\n log('response', response.error);\n context.succeed(generateControlError(\"TargetHardwareMalfunctionError\", 'TARGET_HARDWARE_MALFUNCTION', response.error));\n } else {\n context.succeed(result);\n }\n });\n break;\n case 'IncrementPercentageRequest':\n controlHSDevice(applianceId,'changedevicevalue',event.payload.deltaPercentage.value,function(response){\n if (response.error) {\n log('response', response.error);\n context.succeed(generateControlError(\"TargetHardwareMalfunctionError\", 'TARGET_HARDWARE_MALFUNCTION', response.error));\n } else {\n context.succeed(result);\n }\n });\n break;\n case 'DecrementPercentageRequest':\n controlHSDevice(applianceId,'changedevicevalue',-event.payload.deltaPercentage.value,function(response){\n if (response.error) {\n log('response', response.error);\n context.succeed(generateControlError(\"TargetHardwareMalfunctionError\", 'TARGET_HARDWARE_MALFUNCTION', response.error));\n } else {\n context.succeed(result);\n }\n });\n break;\n default:\n log('Err', 'No supported action: ' + event.header.name);\n context.fail('Something went wrong');\n break;\n }\n}", "function outVideoControl() {\n videoCtrlTl.play();\n }", "function control(e) {\n if (e.keyCode === 32) {\n if (!isJumping) {\n isJumping = true;\n sautSound.play();\n jump();\n }\n }\n if (e.keyCode === 82) {\n location.reload(true);\n }\n }", "function control(e) {\n if (e.keyCode === 37) {\n moveLeft();\n } else if (e.keyCode === 38) {\n rotate();\n } else if (e.keyCode === 39) {\n moveRight();\n } else if (e.keyCode === 40) {\n moveDown();\n }\n }", "function control (e) {\n if (document.getElementById('pause-button')) {\n if (e.keyCode === 37) {\n moveLeft()\n } else if (e.keyCode === 38) {\n rotate()\n } else if (e.keyCode === 39) {\n moveRight()\n } else if (e.keyCode === 40) {\n moveDown()\n }\n }\n }", "function keyControl(event) {\n\tconsole.log(event.keyCode);\n\tif(event.keyCode === 37) //Left\n\t\tblackSphereVelX = -1;\n\telse if(event.keyCode === 38) //Up\n\t\tblackSphereVelY = 1;\n\telse if(event.keyCode === 39) //Right\n\t\tblackSphereVelX = 1;\n\telse if(event.keyCode === 40) //Down\n\t\tblackSphereVelY = -1;\n}", "function control(e) {\n if (e.keyCode === 37) {\n moveLeft();\n } else if (e.keyCode === 38) {\n rotate();\n } else if (e.keyCode === 39) {\n moveRight();\n } else if (e.keyCode === 40) {\n moveDown();\n }\n}", "function listenForButton() {\n\t\ttag.on('simpleKeyChange', function(left, right) {\n\t\t\t// if both buttons are pressed, disconnect:\n\t\t\tif (left && right) {\n\t\t\t\tconsole.log('both');\n\t\t\t\ttag.disconnect();\n\t\t\t} else\t\t\t\t// if left, send the left key\n\t\t\tif (left) {\n\t\t\t\tconsole.log('left: ' + left);\n\t\t\t\trunFile('left.scpt');\n\t\t\t} else\n\t\t\tif (right) {\t\t// if right, send the right key\n\t\t\t\tconsole.log('right: ' + right);\n\t\t\t\trunFile('right.scpt');\n\t\t\t}\n\t });\n\t}", "function control_switch(ON)\n\t{\n\t\ttrace(\"control_switch(ON); === \" + ON);\n\t\t\n\t\tif(ON)\n\t\t{\n\t\t\tif(CONTROL_SIGNAL.enableTouch)\n\t\t\t{\n\t\t\t\ttrack_touchScreen_UI = true;\n\n\t\t\t\t// $(window)[0].addEventListener(\"touchstart\", touchDisplay, false);\n\t\t\t\t// $(window)[0].addEventListener(\"touchend\", touchDisplay, false);\n\t\t\t\t\n\t\t\t\t$(\"#touchPad-full\")[0].addEventListener(\"touchstart\", touchFind, false);\n\t\t\t\t$(\"#touchPad-full\")[0].addEventListener(\"touchmove\", touchFind, false);\n\t\t\t\t$(\"#touchPad-full\")[0].addEventListener(\"touchend\", touchFind, false);\n\t\t\t\t\n\t\t\t\tif(CONTROL_SIGNAL.firstTouch)\n\t\t\t\t{\n\t\t\t\t\ttouchDisplay(null);\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t$(window)[0].addEventListener(\"keydown\", keyboardFind, false);\n\t\t\t\t$(window)[0].addEventListener(\"keyup\", keyboardFind, false);\t\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\tif(CONTROL_SIGNAL.enableTouch)\n\t\t\t{\n\t\t\t\ttrack_touchScreen_UI = false;\n\n\t\t\t\t// $(window)[0].removeEventListener(\"touchstart\", touchDisplay, false);\n\t\t\t\t// $(window)[0].removeEventListener(\"touchend\", touchDisplay, false);\n\t\t\t\t\n\t\t\t\t$(\"#touchPad-full\")[0].removeEventListener(\"touchstart\", touchFind, false);\n\t\t\t\t$(\"#touchPad-full\")[0].removeEventListener(\"touchmove\", touchFind, false);\n\t\t\t\t$(\"#touchPad-full\")[0].removeEventListener(\"touchend\", touchFind, false);\n\t\t\t\t\n\t\t\t\ttouchDisplay(null);\n\t\t\t\t\n\t\t\t\t// $(\"#touchPad\").css(\"opacity\", 0);\n\t\t\t\t\n\t\t\t\t// CONTROL_SIGNAL.ui_ready = false;\n\t\t\t\t\n\t\t\t\t// touchLastTransition();\t\n\t\t\t}\n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t$(window)[0].removeEventListener(\"keydown\", keyboardFind, false);\n\t\t\t\t$(window)[0].removeEventListener(\"keyup\", keyboardFind, false);\t\n\t\t\t}\n\t\t\t\n\t\t\t$(\"#\" + MAP_PLAYER.playerMover).removeClass(MAP_PLAYER.playerTween);\t\t\t\n\t\t}\n\t\t\n\t\tcontrol_reset();\n\t}", "function control(e) {\n if(e.keyCode === 37) {\n moveLeft()\n } else if (e.keyCode === 38) {\n rotate()\n }\n else if (e.keyCode === 39) {\n moveRight()\n }\n else if (e.keyCode === 40) {\n moveDown()\n }\n}", "function RemoteControlRequestCompleteHandler( status )\n{\n\talert(\"RCStatus: \" + status);\n}", "handleControlShiftHomeKey() {\n let documentStart = undefined;\n if (!isNullOrUndefined(this.owner.documentStart)) {\n documentStart = this.owner.documentStart;\n }\n if (!isNullOrUndefined(documentStart)) {\n this.end.setPositionInternal(documentStart);\n this.fireSelectionChanged(true);\n }\n this.checkForCursorVisibility();\n }", "handleEvent() {}", "handleEvent() {}", "function controls(e) {\n if (e.keyCode === 37) {\n moveLeft();\n } else if (e.keyCode === 38) {\n rotate();\n } else if (e.keyCode === 39) {\n moveRight();\n } else if (e.keyCode === 40) {\n moveDown();\n }\n }", "function handleSoundControl() {\n var musicControl = $(\"#musiccontrol\").get(0)\n var soundDisplay = $(\"#sounddisplay\")\n\n soundDisplay.on(\"click\", function () {\n musicControl.muted = !musicControl.muted\n if (musicControl.muted) {\n soundDisplay.addClass(\"red-text\")\n soundDisplay.text(\"volume_off\")\n }\n else {\n soundDisplay.removeClass(\"red-text\")\n soundDisplay.text(\"volume_up\")\n }\n })\n }", "function control(e) {\n if (gameOver) return;\n var action = \"\";\n switch (e.keyCode) {\n case 39:\n // Right\n action = \"RIGHT\";\n performMove(action);\n break;\n\n case 38:\n // Up\n action = \"UP\";\n performMove(action);\n break;\n\n case 37:\n // Left\n action = \"LEFT\";\n performMove(action);\n break;\n\n case 40:\n //DOWN\n action = \"DOWN\";\n performMove(action);\n break;\n }\n\n if (debug) alert(action);\n } // control(e)", "function initSimulationControl(){\r\n\t\t\tjQuery('.simulationControl', scope.$el).on('click', 'button', function(event){\r\n\t\t\t\tvar $button = jQuery(event.target);\t\t\t\t\r\n\t\t\t\tswitch ($button.attr('data-role')) {\r\n\t\t\t\tcase 'start': scope.controller.handleStartClicked();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'stop': scope.controller.handleStopClicked();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthrow new Error('Not supported data-role');\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}", "function initControls() \n{\n 'use strict';\n\n // If a slide title is selected from the drop up list, show the slide.\n $('.dropdown-menu li a').on('click', function (event) {\n pfView.showSlide(event, $(this));\n });\n\n // Cycles to the previous slide\n $('#prev-slide-btn').on('click', function (){ \n pfView.moveLeft();\n });\n\n // Cycles to the next slide\n $('#next-slide-btn').on('click', function (){ \n pfView.moveRight();\n });\n\n // Listen for keydown anywhere in body.\n $('body').on('keydown', function (event) {\n return keystroke(event);\n });\n\n // Listen for keyup anywhere in body.\n $('body').on('keyup', function (event) {\n return keystroke(event);\n });\n}", "function CONTROL(event) {\n // 37 corresponds to left arrow\n if (event.keyCode == 37) {\n p.moveLeft()\n dropStart = Date.now()\n // 38 corresponds to left arrow\n } else if (event.keyCode == 38) {\n p.rotate()\n dropStart = Date.now()\n // 39 corresponds to left arrow\n } else if (event.keyCode == 39) {\n p.moveRight()\n dropStart = Date.now()\n // 40 corresponds to left arrow\n } else if (event.keyCode == 40) {\n p.moveDown()\n // dropStart = Date.now()\n }\n}", "function keyControl(event) {\n if (event.keyCode == 37 && buttonPressed != true && gameOver != true) {\n keyPressed = true;\n p.moveLeft();\n } else if (event.keyCode == 38 && buttonPressed != true && gameOver != true) {\n keyPressed = true;\n p.rotate();\n rotateSound.play();\n } else if (event.keyCode == 39 && buttonPressed != true && gameOver != true) {\n keyPressed = true;\n p.moveRight();\n } else if (event.keyCode == 40 && buttonPressed != true && gameOver != true) {\n keyPressed = true;\n p.moveDown();\n }\n }", "function control(e){\n if(e.keyCode === 37)\n {\n moveLeft();\n }\n\n else if(e.keyCode === 39)\n {\n moveRight();\n }\n else if(e.keyCode === 38)\n {\n rotate();\n }\n else if(e.keyCode === 40)\n {\n moveDown();\n }\n }", "function computerTurnControl() {\n\t\t\n\t\t//alert(\"In computerTurnControl\");\n\t\t\n\t\tif (activePlayer.aIType == \"Random\") {\n\t\t\n\t\t\trandomAgentControl();\n\t\t}\n\t\telse if (activePlayer.aIType == \"Reflex\") {\n\t\t\n\t\t\treflexAgentControl();\n\t\t}\n\t\telse if (activePlayer.aIType == \"Minimax\") {\n\t\t\n\t\t\tminimaxAgentControl();\n\t\t}\n\t\telse if (activePlayer.aIType == \"Minimax w/ AB\") {\n\t\t\n\t\t\tminimaxWithAlphaBetaPruningAgentControl();\n\t\t}\n\t\telse { // activePlayer.aIType == \"Expectimax\"\n\t\t\n\t\t\texpectimaxAgentControl();\n\t\t}\n\t}", "activateEventHandlers() {\n this.handleKeyup = evt => {\n if (evt.key === 'Escape') {\n this.cancel();\n }\n };\n }", "handleControlShiftRightKey() {\n let isForward = this.isForward ? this.start.isCurrentParaBidi : this.end.isCurrentParaBidi;\n if (isForward) {\n this.extendToWordStartInternal(false);\n }\n else {\n this.extendToWordEndInternal(false);\n }\n this.checkForCursorVisibility();\n }", "function processControllerStateChange() {\n addEvent(\"controllers\", e[\"controller_id\"], point, entities);\n }", "function messageHandler(event) {\n try {\n _messageHandler(event);\n } catch (ex) {\n Cu.reportError(\"FrameWorker: Error handling client port control message: \" + ex + \"\\n\" + ex.stack);\n }\n }", "handleEvent(event) {\n switch (event.type) {\n case 'click':\n this._evtClick(event);\n break;\n case 'focus':\n this._evtFocus(event);\n break;\n default:\n break;\n }\n }", "function handleControls() {\r\n\r\n\tvar doubleJumpReady = false;\r\n\t\r\n\t// up arrow\r\n\tif (keys[38]) {\r\n\t\tif (!player.jumping && player.grounded) {\r\n\t\t\r\n\t\t\t// Player sound effect when player jumps\r\n\t\t\tSounds.jump.play();\r\n\t\t\t\r\n\t\t\tplayer.jumping = true;\r\n\t\t\tplayer.grounded = false;\r\n\t\t\tplayer.velY = -player.speed * player.jumpForce;\r\n\t\t\t\r\n\t\t\t// When player jumps, an important amount is added to the Y velocity,\r\n\t\t\t// propulsing the player upwards. The player then comes back down\r\n\t\t\t// due to gravity.\r\n\r\n\t\t}\r\n\t\t\r\n\t\t// If the double jumping ability is ready, the double jump activates\r\n\t\tif (doubleJumpReady) {\r\n\t\t\r\n\t\t\t// The audio source is replaced and then played again\r\n\t\t\t// this makes it so the sound can play in quick repetition\r\n\t\t\t// following the jump sound\r\n\t\t\tSounds.jump.src = \"audio/jump.wav\";\r\n\t\t\tSounds.jump.play();\r\n\t\t\t\r\n\t\t\tdoubleJumpReady = false;\r\n\t\t\tplayer.doubleJumping = true;\r\n\t\t\tplayer.velY = -player.speed * player.jumpForce * 0.8;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// If the player is airborne, isn't currently pressing the up key and\r\n\t// isn't currently double jumping, the double jump is ready\r\n\tif (keys[38] == false && !player.doubleJumping && player.airborne && player.canDoubleJump) {\r\n\t\tdoubleJumpReady = true;\r\n\t}\r\n\t\r\n\t\r\n\t// right arrow\r\n\tif (keys[39]) {\r\n\t\tif (player.velX < player.speed) {\r\n\t\t\tplayer.velX++;\r\n\t\t}\r\n\t}\t\r\n\t\r\n\t\r\n\t// left arrow\r\n\tif (keys[37]) {\r\n\t\tif (player.velX > -player.speed) {\r\n\t\t\tplayer.velX--;\r\n\t\t}\r\n\t\t\r\n\t}\r\n}", "controlButtonPressed(buttonPressed) {\n if (buttonPressed === 'power') {\n this.togglePowerState();\n } else if (buttonPressed === 'start') {\n this.toggleGameStarted();\n } else if (buttonPressed === 'strict') {\n this.toggleStrictMode();\n } else if (buttonPressed === 'count') {\n // do something?\n }\n }", "function listenForButton() {\n\t\ttag.on('simpleKeyChange', function(left, right) {\n\t\t\t// if both buttons are pressed, disconnect:\n\t\t\tif (left && right) {\n\t\t\t\tconsole.log('both');\n\t\t\t\ttag.disconnect();\n\t\t\t} else\t\t\t\t// if left, send the left key\n\t\t\tif (left) {\n\t\t\t\tconsole.log('left: ' + left);\n\t\t\t\trunFile('applescript/left.scpt');\n\t\t\t} else\n\t\t\tif (right) {\t\t// if right, send the right key\n\t\t\t\tconsole.log('right: ' + right);\n\t\t\t\trunFile('applescript/right.scpt');\n\t\t\t}\n\t });\n\t}", "function control(e) {\n if(e.keyCode === 37) {\n curP.moveLeft();\n } else if (e.keyCode === 39) {\n curP.moveRight();\n } else if (e.keyCode === 40) {\n curP.softDrop();\n }\n}", "function curtainHandler( event, device, requestWidgetId) {\n var curtainBtn = $(\"#\" + device.id);\n \n if(device.state == \"open\") { \n curtainBtn.removeClass( \"curtainClosed\" ).addClass( \"curtainOpen\" );\n curtainBtn.val(\"Curtains (Open)\");\n device.state = \"open\";\n }\n else {\n curtainBtn.removeClass( \"curtainOpen\" ).addClass( \"curtainClosed\" );\n curtainBtn.val(\"Curtains (Closed)\");\n device.state = \"closed\";\n }\n\n //udpate the server with data set by remote control\n var data = JSON.stringify(device)\n updateDevice(data);\n\n $( document ).trigger( \"confirmCurtainEvent\", [ requestWidgetId, device.state ] );\n }" ]
[ "0.6599393", "0.6599393", "0.6599393", "0.6599393", "0.6341922", "0.6204775", "0.6074866", "0.6049745", "0.5986637", "0.5972554", "0.596404", "0.59246373", "0.5886188", "0.5880047", "0.58776325", "0.5828921", "0.5820891", "0.5783242", "0.577699", "0.57562387", "0.5744859", "0.57364357", "0.572603", "0.57206625", "0.5709678", "0.5681116", "0.567404", "0.5672983", "0.56674063", "0.56559026", "0.5637936", "0.56206787", "0.56186587", "0.5613562", "0.5583465", "0.5579852", "0.5524701", "0.5520139", "0.5517181", "0.5516727", "0.55153495", "0.55028147", "0.5498685", "0.5489877", "0.5484496", "0.5483838", "0.5481142", "0.54745704", "0.5472826", "0.5457015", "0.5455167", "0.5451917", "0.545007", "0.5432436", "0.5428272", "0.54159117", "0.5402901", "0.53915197", "0.5387801", "0.53849727", "0.53795624", "0.5378337", "0.53707063", "0.53699505", "0.53678954", "0.5364895", "0.5353557", "0.53522104", "0.5348715", "0.5344407", "0.5336723", "0.53243035", "0.53078926", "0.5286247", "0.5284892", "0.5283842", "0.52715355", "0.5270063", "0.52677774", "0.5262317", "0.52550304", "0.52550304", "0.5250762", "0.52493507", "0.52493", "0.5244204", "0.52375394", "0.5227705", "0.52249795", "0.5214708", "0.5214324", "0.52080995", "0.52080715", "0.52079856", "0.520742", "0.51974285", "0.5197315", "0.51910686", "0.5190308", "0.5183508", "0.51816833" ]
0.0
-1
Listen for changes to the page's registered route attribute, "contactId" in this case.
routeChange(event, contactId) { let contact = null; if (contactId === 'new') { // Create a new contact to edit contact = new Contact(); } else { // Lookup the contact in the global list by its contact contact = Contact.store[contactId]; if (contact) { // Save a copy of the contact's attributes so that it can be reverted later if necessary contact.backup(); } else { // No contact has that contactId console.error('Attempting to navigate to a non-existent contact!'); Navigator.openParentPage(); } } this.setContact(contact); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "routeChange() {\n\n // Validating the routes object\n if (!router.routes) return;\n if (router.routes.constructor !== Object) throw err(9);\n\n const route = router.getRoute(window.location.pathname);\n const entries = Object.entries(router.routes);\n\n // Looping through all routes in the routes-object\n for (let i = 0; i < entries.length; i++) {\n const entryRoute = router.getRoute(entries[i][0]);\n let match = true;\n\n // Checking if the current URL matches the route\n for (let a = 0; a < entryRoute.length; a++) {\n if (route[a] === undefined || (entryRoute[a] !== \"**\" && entryRoute[i] !== route[i])) {\n match = false;\n break;\n }\n }\n\n // Change content if match was found\n if (match) {\n router.page = entries[i][1];\n window.dispatchEvent(router.newRouteEvent);\n return;\n }\n }\n\n }", "static get observers() {\n return ['_routePageChanged(routeData.page)', '_isActiveChanged(isActive)'];\n }", "onPageChange(unusedPageId) {}", "updateCRMPage() {\n if (this.state != PhoneState.Ongoing) {\n return;\n }\n this.updateCallerDetailsFromCRM(false);\n log(\"Initiated CRM page update\");\n }", "function loadContacsEvents() {\n const contacts = document.querySelectorAll( '.home-sidebar_contact' );\n\n contacts.forEach( ( contact ) => contact.addEventListener( 'click', changeContactView ) );\n}", "on(...pageRoutes) {\n //increment the number of routes registered\n this.numRegistered += 1;\n for (const {route, handler} of pageRoutes) {\n if (Array.isArray(route)) {\n for (const path of route) {\n const [regPath, params] = getRegexFromRouteString(path);\n this.routes.set(path, {pathRoute: regPath, handler: handler, params: params});\n }\n } else {\n const [regPath, params] = getRegexFromRouteString(route);\n this.routes.set(route, {pathRoute: regPath, handler: handler, params: params})\n }\n }\n //route the current url once we've registed all the handlers\n if (this.numRegistered === this.numRoutes) {\n this.match(window.location.pathname);\n }\n }", "on(...pageRoutes) {\n //increment the number of routes registered\n this.numRegistered += 1;\n for (const {route, handler} of pageRoutes) {\n if (Array.isArray(route)) {\n for (const path of route) {\n const [regPath, params] = getRegexFromRouteString(path);\n this.routes.set(path, {pathRoute: regPath, handler: handler, params: params});\n }\n } else {\n const [regPath, params] = getRegexFromRouteString(route);\n this.routes.set(route, {pathRoute: regPath, handler: handler, params: params})\n }\n }\n //route the current url once we've registed all the handlers\n if (this.numRegistered === this.numHandlers) {\n this.match(window.location.pathname);\n }\n }", "updateCRMPage() {\n if (this.state != PhoneState.Ongoing) {\n return;\n }\n Utility.updateCallerDetailsFromCRM(this._number, this.isOldSession, this);\n log(\"Initiated CRM page update\");\n }", "routingHandler(event) {\r\n this.base.routingEventListener(event);\r\n this.clickHandler();\r\n }", "_routePageChanged(page) {\n const routes = ['repository-list'];\n this.page = page || 'repository-list'; // defaults to home route if no page\n\n // if we are trying to access anything other than / or /repository-list return 404 page\n if (routes.indexOf(this.page) === -1){\n this.page = '404';\n }\n }", "routingHandler(event) {\r\n this.base.routingEventListener(event);\r\n }", "routingHandler(event) {\r\n this.base.routingEventListener(event);\r\n }", "routingHandler(event) {\r\n this.base.routingEventListener(event);\r\n }", "routingHandler(event) {\r\n this.base.routingEventListener(event);\r\n }", "routingHandler(event) {\r\n this.base.routingEventListener(event);\r\n }", "routingHandler(event) {\r\n this.base.routingEventListener(event);\r\n }", "pageChanged({ location = null }) {\n //referrer has to be set manually with SPA\n this.location.referrer = this.location.current\n this.location.current = location || this.location.current\n }", "function addContactPageListeners(){\n \n $(document).on(\"click\", \"[action]\", function (e) {\n\n var $target = $(e.target);\n var contactId = e.target.value;\n\n switch($target.attr('action')) {\n\n case 'add':\n $target.toggleClass(\"active\");\n $(\".contacts form\").toggleClass(\"hidden\");\n break;\n\n case 'delete':\n if (confirm(\"Are you sure that you want to delete this contact?\")) {\n removeContactFromStorage(contactId);\n }\n break;\n\n case 'edit':\n\n break;\n\n }\n \n });\n //form values and files submit to local webstorage\n $(\"form\").on(\"submit\", function (e){\n e.preventDefault();\n\n var formEntry = $(this).serializeArray();\n var contact = createContact(formEntry);\n\n addContactToStorage(contact);\n \n // createNewListItem(\"list\", formEntry);\n\n //reset the form\n this.reset();\n setFormThumbnail(\"/assets/images/profile.png\");\n\n });\n\n //Input type file event listener \"change\". After selecting the browse button to\n //upload a file or cancel an upload. This function inspects if an empty value\n //was submitted and if an there is an existing image that is different from the default\n //profile image (/assets/images/profile.png).\n //If those conditions are meet then a thumbnail of the image will render in the thumbnail container.\n //TO DO use background image see rolodex list. \n $(\"input#avatar\").on(\"change\", function (e){\n \n //function adds constraint to for image\n if ($(e.target).val() !== \"\" && $(\"#thumbnail\").attr(\"src\") !== $(e.target).val()) {\n \n imageUploadHelper(e.target);\n }\n });\n \n // $(window)\n // // does something when \".selector\" is clicked.\n // .on('click', '.selector', function() {\n\n // });\n }", "function handleContactSelected(event) {\n // Get the contactId from event\n const contactId = event.currentTarget.dataset.id;\n\n // Create LMS message payload\n const payload = { recordId: contactId };\n\n // sforce.one.publish passed in from page as _pageConfigs.lmsPublish\n _pageConfigs.lmsPublish(_pageConfigs.messageChannel, payload);\n}", "function pageNavigationHandler() {\n AttachLinkBehavior();\n\n $(window).bind('hashchange', CheckHashParam)\n .trigger('hashchange');\n }", "routingHandler(event) {\n this.base.routingEventListener(event);\n }", "routingHandler(event) {\n this.base.routingEventListener(event);\n }", "routingHandler(event) {\n this.base.routingEventListener(event);\n }", "routingHandler(event) {\n this.base.routingEventListener(event);\n }", "routingHandler(event) {\n this.base.routingEventListener(event);\n }", "routingHandler(event) {\n this.base.routingEventListener(event);\n }", "routingHandler(event) {\n this.base.routingEventListener(event);\n }", "function selectingContactListener() {\n var contact = $('.contacts-box .user-contact-box');\n contact.click(changeContactClick);\n}", "on_ROUTE_CHANGE (section) {\n this.sectionsController.changeSection(section);\n this.menu.setSection(section);\n }", "function handleUpdate(contact,event) {\n contact.name = event.detail.name;\n setContacts(contacts);\n }", "function onPageChange (appIdKey, pageDict) {\n // only act if this is the correct app\n if (this.appIdKey === appIdKey) {\n log.debug(`Page changed: ${JSON.stringify(pageDict)}`);\n this.emit(RemoteDebugger.EVENT_PAGE_CHANGE, pageArrayFromDict(pageDict));\n } else {\n log.debug(`Received page change notice for app ${appIdKey} ` +\n `but listening for ${this.appIdKey}. Ignoring.`);\n }\n}", "function onEditContact(e) {\n contactForm.buildContactForm(activeContact); \n $.mobile.changePage(\"#edit_contact_page\", { transition: \"pop\" });\n}", "pageClicked(event)\n {\n let trigger = this.$refs.trigger ? this.$refs.trigger : this.$el;\n\n if (! this.hasUserAttention() || trigger === event.target) return;\n\n trigger.contains(event.target) ? null : this.lostUserAttention();\n }", "ROUTE_CHANGED (state, { to, from }) {\n console.log('route changed from', from.name, 'to', to.name)\n }", "subscribe() {\n window.addEventListener('vaadin-router-go', this.__navigationEventHandler);\n }", "function autoTrigger_onResourceReceived(pageData, e) {\n pageData.activeRequests.splice(pageData.activeRequests.indexOf(e.id), 1);\n autoTrigger_getContent(pageData, 'resources loaded');\n\n }", "getContact() {\n const contactId = this.props.match.params.contactId;\n const { reducer } = this.props;\n const { contact } = reducer;\n\n // Since this methods fires on componentDidUpdate we must do some checks\n // to ensure we only dispatch the event when the contact ID in the URL\n // is different than the ID of the contact in the reducer. If we don't\n // we'll get a endless loop of requests to our backend\n if (!contact.id || contact.id.toString() !== contactId) {\n this.context.store.dispatch(getContact(contactId));\n }\n }", "function onPageChange(layout) {\n onPageUpdate(layout);\n updatePageNavigation();\n updateSettings();\n }", "function onPageChange (appIdKey, pageDict) {\n // save the page dict for this app\n if (this.appDict[appIdKey]) {\n if (this.appDict[appIdKey].pageDict && this.appDict[appIdKey].pageDict.resolve) {\n // pageDict is a promise, so resolve\n this.appDict[appIdKey].pageDict.resolve(pageDict);\n }\n // keep track of the page dictionary\n this.appDict[appIdKey].pageDict = pageArrayFromDict(pageDict);\n }\n\n // only act if this is the correct app\n if (this.appIdKey !== appIdKey) {\n log.debug(`Received page change notice for app '${appIdKey}' ` +\n `but listening for '${this.appIdKey}'. Ignoring.`);\n return;\n }\n\n log.debug(`Page changed: ${simpleStringify(pageDict)}`);\n this.emit(RemoteDebugger.EVENT_PAGE_CHANGE, {\n appIdKey: appIdKey.replace('PID:', ''),\n pageArray: pageArrayFromDict(pageDict)\n });\n}", "function updateRoute() {\n\n}", "setContact(contact) {\n this.scope.attr('contact', contact);\n }", "_handleData() {\n console.log(this.userList);\n // this.set('route.page', 'app-form');\n // this.set('routeData.path', 'app-form');\n window.history.pushState({}, null, '#/app-form');\n window.dispatchEvent(new CustomEvent('location-changed'));\n // this.set('route.path', '/search/');\n }", "subscribe() {\n window.addEventListener(\"vaadin-router-go\", this.__navigationEventHandler);\n }", "subscribe() {\n window.addEventListener('vaadin-router-go', this.__navigationEventHandler);\n }", "function handleContactLinkClicked(event) {\n ReactGA.event({ category: 'Contact Us Link', action: 'Clicked', label: event.target.href });\n }", "getContactInfo(e) {\r\n Contact.clickedContact = Number(\r\n e.currentTarget.getAttribute(\"data-contactNumber\")\r\n );\r\n console.log(Contact.clickedContact);\r\n document.querySelector(\"#name\").value =\r\n Contact.list[Contact.clickedContact].name;\r\n document.querySelector(\"#phone\").value =\r\n Contact.list[Contact.clickedContact].phone_number;\r\n document.querySelector(\"#website\").value =\r\n Contact.list[Contact.clickedContact].website;\r\n document.querySelector(\"#description\").value =\r\n Contact.list[Contact.clickedContact].description;\r\n UI.openForm(\"update\");\r\n saveContactButton.textContent = \"update\";\r\n deleteContactButton.style.display = \"block\";\r\n }", "function handlePageSelect(id) {\n setPageId(id)\n }", "function changePage(page) {\n return function(dispatch, getState) {\n var state = getState();\n if (page < 0 || page > Math.floor(state.outlook.totalCount / state.outlook.pageSize))\n return;\n dispatch({ type: actionTypes_1.default.CHANGE_PAGE, payload: page });\n dispatch(loadContacts());\n };\n }", "function notifyObservers() {\n if (currentRouteElement) {\n (/** @type {{onRouteExit: Function}} */ (currentRouteElement))\n .onRouteExit();\n currentRouteElement = null;\n }\n\n const route = /** @type {!welcome.Routes} */ (history.state.route);\n const step = history.state.step;\n routeObservers.forEach(observer => {\n (/** @type {{onRouteChange: Function}} */ (observer))\n .onRouteChange(route, step);\n\n // Modules are only attached to DOM if they're for the current route, so\n // as long as the id of an element matches up to the current step, it\n // means that element is for the current route.\n if (observer.id == `step-${step}`) {\n currentRouteElement = observer;\n }\n });\n\n // If currentRouteElement is not null, it means there was a new route.\n if (currentRouteElement) {\n (/** @type {{onRouteEnter: Function}} */ (currentRouteElement))\n .onRouteEnter();\n (/** @type {{updateFocusForA11y: Function}} */ (currentRouteElement))\n .updateFocusForA11y();\n }\n }", "function handleAppRouteChangeRequests(payload) {\n set(payload.payload.route, payload.payload.data);\n }", "async [FmConfigAction.watchRouteChanges]({ dispatch, commit, rootState }, payload) {\n if (configuration.onRouteChange) {\n const ctx = {\n Watch,\n Record,\n List,\n dispatch,\n commit,\n state: rootState,\n leaving: payload.from.path,\n entering: payload.to.path,\n queryParams: payload.to.params\n };\n await runQueue(ctx, \"route-changed\");\n }\n }", "callEvent(event) {\n trackEvent('Single Page', 'clicked ' + event.currentTarget.id)\n }", "handleResStaticObjPageChange(event, page)\t\t\t\t\t\t\t\t// eslint-disable-line no-unused-vars\n\t{\n\t\tthis.setState({\n\t\t\tstaticResPageNum:\tpage\n\t\t});\n\t}", "function listContactsForm(event, myTag) {\n\n\n // get the contacts\n $.getJSON(\"/contacts\", handlers.receiveContacts);\n\n }", "static openContactPage() {\n browser.click(HomePage.elements.contactpagelink)\n }", "function handleChangePage(event, newPage) {\n setPage(newPage);\n }", "handleStaticResKeysPageChange(event, page)\t\t\t\t\t\t\t\t// eslint-disable-line no-unused-vars\n\t{\n\t\tthis.setState({\n\t\t\tstaticResKeysPageNum:\tpage\n\t\t});\n\t}", "function editContact(id) { // editing is actually done in edit.js\n // store id, to be retrieved in edit.js on edit.html\n localStorage.idOfContactBeingEdited = JSON.stringify(id);\n}", "function pago_rapido(){ change_to('contact_find_add'); }", "function initPageChangeObserver() {\n observer.observe(document.querySelector(\"body\"), {\"childList\": true, \"subtree\": true});\n}", "function preFlowAction$SetTLContactInfo() {\n if (pega.mobile.isHybrid) {\n SetContactPageInfo();\n }\n}", "onPageUpdate(pageProps) {\n const updatePagesReference = () => this.getAllPagesPromise().then((allPages) => {\n allPages.update(pageProps)\n })\n\n this.navigateToPageAndDisplayChange(pageProps, updatePagesReference)\n }", "function pageUpdated() {\n if (component.controller.loadAll) {\n // Retrieve new id\n component.updateModel();\n if (component.api && component.api.endLoad) {\n var listener = component.scope.$on(\"rows-rendered\", function (event, parameters) {\n if (parameters.grid === grid.id) {\n // Remove listener\n listener();\n component.api.endLoad();\n }\n });\n }\n } else {\n component.reload();\n }\n }", "subscribeContactEvent(contact) {\r\n if (contact.getActiveInitialConnection()) {\r\n const status = contact.getStatus();\r\n if (connect.ContactStateType.INIT === status.type ||\r\n connect.ContactStatusType.CONNECTING === status.type ||\r\n connect.ContactStateType.INCOMING === status.type) {\r\n this.onIncoming(contact);\r\n }\r\n }\r\n else {\r\n contact.onIncoming(this.onIncoming.bind(this));\r\n }\r\n // remove from contacts, the contact will notify listener after update its inner state\r\n contact.onEnded(this.removeContactFromList.bind(this));\r\n contact.onMissed(this.removeContactFromList.bind(this));\r\n }", "function addEventListeners() {\n $(window).load(routing);\n $(window).bind('hashchange', routing);\n }", "function dispatchRouteChange() {\n // remove hash\n var href = location.hash.substr(1, location.hash.length - 1);\n\n routerState$.patch({\n route: href === '' ? '/' : href.split('?')[0],\n params: getUrlParams(href)\n });\n }", "beforeRouteUpdate(to, from, next) {\n this.stopAutoUpdate();\n next();\n }", "function listen () {\n\t\tif (interval !== 0) {\n\t\t\t// clear the interval if it's already set\n\t\t\tclearInterval(interval);\n\t\t}\n\n\t\t// start listening for a change in the url\n\t\tinterval = setInterval(function () {\n\t\t\tvar current = window.location.pathname;\n\n\t\t\t// if our store of the current url does not \n\t\t\t// equal the url of the browser, something has changed\n\t\t\tif (location !== current) {\t\t\t\t\t\n\t\t\t\t// update the location\n\t\t\t\tlocation = current;\n\n\t\t\t\t// dispatch route change\n\t\t\t\tdispatch();\n\t\t\t}\n\t\t}, 50);\n\t}", "contactPage(req) {\n return __awaiter(this, void 0, void 0, function* () {\n });\n }", "created()\n {\n document.addEventListener('click', this.pageClicked);\n }", "function onPageBeforeShow(e){\n\t\t\t\t\t\t\t\t\n\t\t\t\t//update triage nurse phone number\n\t\t\t\tupdateTriageNurseCall();\n\t\t\t\t\n\t\t\t}", "function onLocationChange() {\n\t\t\tvar path = $location.path();\n\t\t\tvar matchPage = function(section, page) {\n\t\t\t\t\n\t\t\t\tif (path === page.url) {\n\t\t\t\t\tself.selectSection(section);\n\t\t\t\t\tself.selectPage(section, page);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t};\n\t\t\t\n\t\t\tfindSelectedPage(sections,matchPage);\n\n\t\t}", "function datasChange() {\n page = 1;\n eventsChange();\n}", "function updateContactDetails(id) {\n\t\temployeesData.forEach(employee => employee.detailsDisplayed = false); // Mark all as not displayed\n\t\tmarkAsDetailsDisplayed(id); // Mark this one as displayed\n\t\tcontactDetails.innerHTML = makeDetailsHTML(employeesData[id]); // Update HTML\n\t\t// Select elements and add relevent event listeners\n\t\tcloseSpan = document.querySelector(\".close\");\n\t\tcloseSpan.onclick = closeContactDetails;\n\t\tpreviousButton = document.querySelector(\"#previous\");\n\t\tnextButton = document.querySelector(\"#next\");\n\t\tlistenToButtons();\n\t}", "function onDeviceReady() {\n \n // Overwrites the default behavior of the device back button\n document.addEventListener(\"backbutton\", onBackPress, false);\n \n displContactList = new DisplayableContactList(\"contacts_list\");\n displContactList.updateList();\n contactForm = new ContactForm();\n \n // Bind application button elements with their functionality\n $(\"#edit_contact_button\").bind (\"click\", onEditContact);\n $(\"#new_contact_ok_nav\").bind (\"click\", onSaveContact);\n \n $(\"#new_contact_cancel_button\").bind (\"click\", function() { window.history.back(); });\n $(\"#new_contact_cancel_nav\").bind (\"click\", function() { window.history.back(); });\n \n $(\"#remove_ok_button\").bind (\"click\", onRemoveContact); \n \n $(\"#clone_contact_button\").bind (\"click\", onSaveContactCopy); \n \n $(\"#exit_popup\").bind (\"popupafterclose\", function() { backpressed = false }); \n \n $(\"#item_chooser_ok_button\").bind (\"click\", function() { \n $(\".ui-dialog\").dialog(\"close\");\n var addVal = getElement(\"item_chooser_input\").options[getElement(\"item_chooser_input\").selectedIndex].value;\n contactForm.addItem(addVal); \n });\n\n $(\"#search-input\").bind (\"change\", function(event, ui) { \n var filter = $(\"#search-input\").val();\n if (!filter) {\n filter = \"\";\n }\n displContactList.drawContactList(filter); \n });\n \n $(\"#cont_list_page\").live('pageshow', function(event, ui){\n activeContact = null;\n });\n}", "function pageChanged(newPage) {\n\t\tgetArticles(newPage);\n\t}", "function _onEveryPage() {\n _updateConfig();\n\t_defineCookieDomain();\n\t_defineAgencyCDsValues();\n}", "beforeRouteUpdate(to, from, next) {\n this.initForm(to)\n next()\n }", "function notifySubscribers() {\n var eventPayload = {\n routeObj: getCurrentRoute(), // { route:, data: }\n fragment: getURLFragment()\n };\n\n _subject.onNext(eventPayload);\n }", "_change(route){\n _navigator.push({id: route})\n if (this.refs['DRAWER']) {\n this.refs['DRAWER'].closeDrawer();\n }\n }", "handleNewContact(contact) {\n addContact(contact);\n this.closeModal();\n }", "function initPageVarsOnCreate(id) {\n\t// every page\n\t// every page but...\n\tif (id !== \"LandingPage\") {\n\t\t$(\"*\").i18n();\n\t}\n\t// specific page...\n\tif (id === \"DistributionsWalls\") {\n\t\thtmlClickEventHandlers(id, \"back\");\n\t} else if (id === \"WpFavorites\") {\n\t\thtmlClickEventHandlers(id, \"back\");\n\t} else if (id === \"OverviewWalls\") {\n\t\thtmlClickEventHandlers(id, \"back\");\n\t} else if (id === \"DistributionsRings\") {\n\t\thtmlClickEventHandlers(id, \"back\");\n\t} else if (id === \"OverviewRings\") {\n\t\thtmlClickEventHandlers(id, \"back\");\n\t} else if (id === \"Sync\") {\n\t\thtmlClickEventHandlers(id, \"back\");\n\t} else if (id === \"Index\") {\n\t\thtmlClickEventHandlers(id, \"menu\");\n\t\thomePageCards();\n\t} else if (id === \"Topic\") {\n\t\thtmlClickEventHandlers(id, \"back\");\n\t} else if (id === \"About\") {\n\t\tinjectPackageVersion();\n\t\thtmlClickEventHandlers(id, \"back\");\n\t} else if (id === \"Support\") {\n\t\tgetSystemSpecs();\n\t\thtmlClickEventHandlers(id, \"back\");\n\t} else if (id === \"Settings\") {\n\t\tinitSettingsSwitch();\n\t\thtmlClickEventHandlers(id, \"back\");\n\t} else if (id === \"RtFavorites\") {\n\t\thtmlClickEventHandlers(id, \"back\");\n\t} else if (id === \"WpFullScrImage\") {\n\t\thtmlClickEventHandlers(id, \"back\");\n\t} else if (id === \"DynamicWall\") {\n\t\tinitDynamicWallpaperSwitch();\n\t\tinitServiceSettingsSwitch();\n\t\thtmlClickEventHandlers(id, \"back\");\n\t} else if (id === \"RingUri\") {\n\t\thtmlClickEventHandlers(id, \"back\");\n\t} else if (id === \"RingSearch\") {\n\t\thtmlClickEventHandlers(id, \"back\");\n\t} else if (id === \"WallSearch\") {\n\t\thtmlClickEventHandlers(id, \"back\");\n\t}\n}", "_routeChange(e) {\n var details = e.detail;\n if (typeof details.queryParams.assignment !== typeof undefined) {\n this.set(\"queryParams.assignment\", details.queryParams.assignment);\n this.notifyPath(\"queryParams.assignment\");\n }\n if (typeof details.queryParams.project !== typeof undefined) {\n this.set(\"queryParams.project\", details.queryParams.project);\n this.notifyPath(\"queryParams.project\");\n }\n if (typeof details.queryParams.author !== typeof undefined) {\n this.set(\"queryParams.author\", details.queryParams.author);\n this.notifyPath(\"queryParams.author\");\n }\n if (typeof details.data.page !== typeof undefined) {\n this.set(\"data.page\", details.data.page);\n this.notifyPath(\"data.path\");\n }\n }", "changePage(e) {\n e.preventDefault();\n const page = e.target.dataset.page;\n\n console.log(page);\n }", "bindRouteLinks() {\n const hasText = this.props.field && this.props.field.value;\n const isEditing = this.props.editable && this.props.field.value.editable;\n\n if (hasText && !isEditing) {\n const node = ReactDOM.findDOMNode(this);\n // selects all links that start with '/' - this logic may be inappropriate for some advanced uses\n const internalLinks = node.querySelectorAll('a[href^=\"/\"]');\n\n internalLinks.forEach((link) => {\n // the component can be updated multiple times during its lifespan,\n // and we don't want to bind the same event handler several times so unbind first\n link.removeEventListener('click', this.routeHandler, false);\n link.addEventListener('click', this.routeHandler, false);\n });\n }\n }", "function updateRoute() {\n\tlet route = window.location.hash.substr(1);\n\tSTORE.dispatch({ type: \"routing\", route });\n}", "function clickContact(rquest, response) {\n console.log(\"Clicked to Contact\")\n response.end();\n}", "function pageChanged(newPage){\n\t\t$state.go(\"root.sectionList\" , {pageId:newPage});\n\t}", "function initPageManagement () {\n\n\t\tPAGE('*', function load(ctx) {\n\t\t\ttry {\n\n\t\t\t\tvar pathname = ctx.pathname;\n\t//debugger;\n\t//console.log(\"ON PAGE CHANGE ctx\", ctx);\n\n\t\t\t\t// IE Fix\n\t\t\t\tif (\n\t\t\t\t\tpathname !== PATHNAME &&\n\t\t\t\t\tpathname.indexOf(\"#\") === -1\n\t\t\t\t) {\n\t\t\t\t\tpathname = PATHNAME + \"#\" + pathname.substring(1);\n\t\t\t\t}\n\n//console.log(\"pathname1: \" + pathname);\n\n\t\t\t\tvar view = pathname.replace(PATHNAME, \"\").replace(/^#/, \"\");\n\n//console.log(\"view: \" + view);\n//console.log(\"pathname2: \" + pathname);\n\t\t\t\tif (\n\t\t\t\t\t/^\\//.test(view) &&\n\t\t\t\t\tappContext.get('lockedView') &&\n\t\t\t\t\tview !== appContext.get('lockedView') &&\n\t\t\t\t\tappContext.get('lockedView').split(\",\").indexOf(view) === -1\n\t\t\t\t) {\n\t//console.log(\"REDIRECT TO\", window.location.origin + view);\n\t\t\t\t\t// We are selecting a new view and updating the URL using a REDIRECT which\n\t\t\t\t\t// loads the new page from the server.\n\n\t\t\t\t\t// NOTE: This will not work if only the Hash changes.\n\t\t\t\t\t// In those cases you need to redirect to a new URL.\n\t\t\t\t\twindow.location.href = appContext.get(\"windowOrigin\") + view;\n\t\t\t\t} else {\n//console.log(\"SET VIEW\", view);\n\n\t\t\t\t\t// We are selecting a new view and updating the URL using PUSH-STATE\n\t\t\t\t\t// without reloading the page.\n\n\t\t\t\t\tappContext.set('selectedView', view);\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tconsole.error(\"page changed error:\", err.stack);\n\t\t\t}\n\t\t});\n\t\tPAGE({\n\t\t\tpopstate: false,\n\t\t\tclick: false\n\t\t});\n\n/*\nappContext.get(\"data\").collection(\"page\").add({\n\t\"id\": \"loaded\",\n\t\"selectedDay\": MOMENT().format(\"YYYY-MM-DD\"),\n\t\"selectedEvent\": context.dbfilter.event_id\n});\n*/\n\n\t\tappContext.on(\"change:selectedDayId\", function () {\n\nconsole.info(\"CHANEGD SELECETD DAY!\", appContext.get(\"selectedDayId\"));\n\n\t\t\tappContext.get(\"data\").collection(\"page\").get(\"loaded\").set(\n\t\t\t\t\"selectedDay\",\n\t\t\t\tappContext.get(\"selectedDayId\")\n\t\t\t);\n\t\t});\n\n\n\t\tappContext.on(\"change:selectedView\", function () {\n\n\t\t\ttry {\n\n\t//console.log(\"ON VIEW CHANGE appContext.selectedView\", appContext.selectedView);\n\t//console.log(\"ON VIEW CHANGE appContext.lockedView\", appContext.lockedView);\n\n\t\t\t\tif (\n\t\t\t\t\tappContext.get('lockedView') &&\n\t\t\t\t\tappContext.get('selectedView') !== appContext.get('lockedView') &&\n\t\t\t\t\tappContext.get('lockedView').split(\",\").indexOf(appContext.get('selectedView')) === -1\n\t\t\t\t) {\n\t//console.log(\"REDIRECT TO\", window.location.origin + PATHNAME + \"#\" + appContext.selectedView);\n\t\t\t\t\t// We are selecting a new view and updating the URL using a REDIRECT which\n\t\t\t\t\t// loads the new page from the server.\n\n\t\t\t\t\t// NOTE: This will not work if only the Hash changes.\n\t\t\t\t\t// In those cases you need to redirect to a new URL.\n\t\t\t\t\twindow.location.href = appContext.get(\"windowOrigin\") + PATHNAME + \"#\" + appContext.get('selectedView');\n\t\t\t\t} else {\n\n\t//console.log(\"SET PAGE1\", PATHNAME + \"#\" + appContext.selectedView);\n\n\t\t\t\t\t// We are selecting a new view and updating the URL using PUSH-STATE\n\t\t\t\t\t// without reloading the page.\n\n\t\t\t\t\tif (handleSelectedViewInit()) return;\n\t//console.log(\"SET PAGE2\", PATHNAME + \"#\" + appContext.selectedView);\n\n\t\t\t\t\tPAGE.redirect(PATHNAME + \"#\" + appContext.get('selectedView'));\n\n\t//\t\t\t\tPAGE(PATHNAME + \"#\" + appContext.selectedView);\n\t//console.log(\"SET PAGE DONE\", PATHNAME + \"#\" + appContext.selectedView);\n\n\t\t\t\t\twindow.scrollTo(0, 0);\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tconsole.error(\"selectedView change error:\", err.stack);\n\t\t\t}\n\t\t});\n/*\n\t\tappContext.on(\"change:selectedDay\", function () {\n\t\t\tif (appContext.get('selectedView') != \"Landing\") {\n\t\t\t\tappContext.set('selectedView', \"Landing\");\n\t\t\t}\n\t\t});\n*/\n\t}", "function onPageChange(p) {\n setPage(p);\n }", "_setPageHandler() {\n\t const page = this.element.closest('[role=\"page\"]');\n\n\t if (page) {\n\t page.addEventListener(events.PageFlip().type, () =>\n\t this._setViewBox(this.svg)\n\t );\n\t }\n\t }", "function initListeners() {\n vc_navbar.addEventListener(\"redirect\", goTo);\n }", "function listenToButtons() {\n\t\tconst currentlyDisplayed = employeesData.find(isDisplayed);\n\t\tif (hasPrevious(currentlyDisplayed.id)) {\n\t\t\tpreviousButton.addEventListener('click', () => {\n\t\t\t\tupdateContactDetails(getAdjacentContactId('previous'));\n\t\t\t});\n\t\t}\n\t\tif (hasNext(currentlyDisplayed.id)) {\n\t\t\tnextButton.addEventListener('click', () => {\n\t\t\t\tupdateContactDetails(getAdjacentContactId('next'));\n\t\t\t});\n\t\t}\n\t}", "function route() {\n console.log(\"Route changed\", location.hash)\n if (location.hash == \"\" || location.hash == \"#\") {\n hide(\"updateFormDiv\")\n listPlants()\n } else {\n id = location.hash.replace(\"#plant-\", \"\")\n showUpdateForm(id)\n }\n}", "function pageChange(p) {\n if (p.id === Campaign().get('playerpageid')) {\n const override = checkPage();\n if (override !== STATE.get('PageLoad'))\n pageLoad(override);\n else {\n setTimeout(() => {\n calcAndSetAllBonuses();\n }, 1000);\n }\n }\n }", "function onNewContact(e) {\n \n if (typeof Contact !== \"undefined\") {\n \n contactForm.buildContactForm(null); \n $.mobile.changePage(\"#edit_contact_page\", { transition: \"pop\" });\n }\n collapse(e, \"new_contact_button\");\n $(\"#options_popup\").popup(\"close\");\n return cancelEventBubbling(e);\n}", "changePage(e) {\n e.preventDefault();\n const page = e.target.dataset.page;\n\n console.log(page);\n }", "changePage(e) {\n e.preventDefault();\n const page = e.target.dataset.page;\n\n console.log(page);\n }", "_routeChanged(route, basePath) {\n if (typeof route.path === \"string\") {\n if (typeof basePath === \"string\") {\n if (route.path.startsWith(basePath)) {\n return;\n }\n }\n // reload the page which since route changed will load that page\n window.location.reload();\n }\n }", "handleModalAddEditClient(e){\n let idSelected = e.currentTarget.dataset.key;\n fireEvent(this.pageRef, 'handleClientSelected', idSelected);\n }" ]
[ "0.62488955", "0.5920935", "0.58955485", "0.5677418", "0.5662065", "0.55713654", "0.5518173", "0.5505462", "0.5443795", "0.5357002", "0.53530777", "0.53530777", "0.53530777", "0.53530777", "0.53530777", "0.53530777", "0.53285944", "0.53179985", "0.53078014", "0.5302581", "0.5300624", "0.5300624", "0.5300624", "0.5300624", "0.5300624", "0.5300624", "0.5300624", "0.5234119", "0.5167246", "0.5141624", "0.51287526", "0.5123956", "0.5103624", "0.51017517", "0.5092108", "0.5082277", "0.5071987", "0.504154", "0.50336164", "0.50102687", "0.49899817", "0.4983322", "0.4960077", "0.4957066", "0.49529448", "0.49422184", "0.49296793", "0.4926088", "0.49137688", "0.49062103", "0.48883665", "0.4883718", "0.48773107", "0.4865609", "0.4858454", "0.48528585", "0.48361564", "0.4827485", "0.482593", "0.48210946", "0.4811828", "0.48054487", "0.48018578", "0.47896564", "0.47871602", "0.47850892", "0.47823387", "0.47763765", "0.4773558", "0.47561356", "0.47507864", "0.4720569", "0.47162387", "0.47129554", "0.4709772", "0.4704317", "0.46941015", "0.46865988", "0.46848282", "0.46693704", "0.46668625", "0.4665443", "0.4663519", "0.46559525", "0.46532312", "0.4648564", "0.46427292", "0.4638248", "0.46340522", "0.46326944", "0.4631537", "0.46297592", "0.46276775", "0.46201634", "0.46163884", "0.46045852", "0.46018547", "0.46018547", "0.45997632", "0.45975247" ]
0.702257
0
this reset will first calculate qps, then qps willl be used to determine which apps are under allocated and over allocated, and how much capacity over allocated apps can spare in adjust_capacity, after adjust_capacity is done, each app's tokens will be refilled based on new capacity.
function resetQPSRates() { resetRates('QPS'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reset() {\r\n super.reset();\r\n this.maxInstructionCount = 10;\r\n if (!this._queue) {\r\n this._queue = [];\r\n }\r\n else {\r\n this._queue.length = 0;\r\n }\r\n }", "_resetState () {\n this._wsQueue = [];\n this._subscriptionsById.clear();\n this._subscriptionsByKey.clear();\n this._requests = {};\n this._calls = {};\n this._rpcRegs = {};\n this._rpcNames = new Set();\n\n // Just keep attrs that are have to be present\n this._cache = {\n reqId : 0,\n reconnectingAttempts: 0,\n opStatus : SUCCESS,\n closePromise : null,\n connectPromise : null,\n };\n }", "function deductCapacity(prefix, total, apps, belowCapacities, op, capacities) {\n log('debug', 'deduct capacity '+total+' from '+apps.toString()+'-'+op);\n if(total == 0) return ;\n for(var appi = 0; appi < apps.length; appi++) {\n var app = apps[appi];\n var spare = belowCapacities == null ? capacities[app][op] :capacities[app][op]-belowCapacities[app][op];\n\n if(total > spare && spare != 0) {\n log('debug', 'deduct capacity '+spare+' from '+app+'-'+op);\n var newCapacity = capacities[app][op]-spare;\n setCapacity(prefix, app, op, newCapacity, capacities);\n total -= spare;\n }\n else {\n log('debug', 'deduct capacity '+total+' from '+app+'-'+op);\n var newCapacity = capacities[app][op]-total;\n setCapacity(prefix, app, op, newCapacity, capacities);\n break ;\n }\n }\n}", "function distributeCapacityEvenly(capacityPrefix, capacity, apps, op, capacities) {\n var extra = Math.floor(Math.abs(capacity/apps.length));\n if(capacity < 0) extra = -1*extra;\n // luckApp is randomly picked up app to receive the remaining capacity, \n // example: capacity = 3, #app is 2, each of which gets 1, luckyApp get remaining 1\n log('debug', 'redistributing capacity '+capacity+' among '+apps.toString()+'-'+op);\n if(extra != 0) {\n for(var appi = 0; appi < apps.length; appi++) {\n var app = apps[appi];\n var newCapacity = capacities[app][op]+extra;\n setCapacity(capacityPrefix, app, op, newCapacity, capacities);\n }\n }\n\n if(capacity%apps.length == 0) return;\n else {\n var luckyApp = apps[0]; \n var newCapacity = capacities[luckyApp][op]+capacity%apps.length;\n setCapacity(capacityPrefix, luckyApp, op, newCapacity, capacities);\n }\n}", "resetTuning() {\n for (let i = 0; i < this.tuningKnobs.length; i++) {\n this.setTuningData(i, this.tuningKnobs[i].default);\n this.tuningKnobsUIUpdate();\n }\n }", "_resetState () {\n this._state.initialize(this._rate, this._capacity)\n return this\n }", "reset() {\n this.inboundIntentModels = [];\n this.intents = [];\n this.ephemeralRelations = [];\n }", "reset() {\n $.each(this.combo_lists, (i,list)=>{list.reset();});\n this.async_requests = 0;\n this.working_list = _(this.original_list).difference(this.exclude_tags).difference(this.combo_tags).map(tag=>{return tag.match(/^-?(.*)$/)[1];}).value();\n this.fixed_combo_tags = [];\n this.bad_tags = [];\n this.tag_aliases = {};\n this.aliased_tags = {};\n this.tag_implications = {};\n this.superfluous_tags = {};\n this.reconstructed_list = [];\n this.reconstructed_html = \"\";\n this.is_running = false;\n this.is_ready = false;\n this.window_size = 0;\n this.error = false;\n this.unchanged = false;\n this.combos_started = false;\n this.last_logged = 0;\n this.stage = 0;\n this.stop = false;\n }", "allocate() {\n // allocate memory as per request\n this.allocation[this.processId] = sumArrays(this.allocation[this.processId], this.request)\n\n // check if allocation == max, then free the resources\n if (this.allocation[this.processId].equals(this.max[this.processId])) {\n // increase available resources\n this.available = sumArrays(this.available, this.allocation[this.processId])\n\n // set a fleag for the finished process\n this.finished[this.processId] = true\n\n // set allocation for the finished process to 0\n this.allocation[this.processId].fill(0)\n\n // set max for the finished process to 0\n this.max[this.processId].fill(0)\n }\n\n // decrease available resources\n this.available = subtractArrays(this.available, this.request)\n }", "function makeReset($scope, options) {\n /* jshint camelcase: false */\n options = options || {\n pgnumReset: true\n };\n // Creates a reset function with the correct behavior.\n return function() {\n var defaults = $scope.defaults;\n $scope.pool.name = defaults.name;\n $scope.pool.size = defaults.size;\n $scope.pool.crush_ruleset = defaults.crush_ruleset;\n if (options.pgnumReset) {\n var ruleset = $scope.crushrulesets[defaults.crush_ruleset];\n var limits = getActiveRule(ruleset, defaults.mon_max_pool_pg_num, $scope.pool.size);\n var pgnum = calculatePGNum(limits.osd_count, $scope.pool.size, defaults.mon_max_pool_pg_num);\n if ($scope.pool.pg_num !== pgnum) {\n // Only reset pg num if it's different from calculated default\n // This catches where size hasn't changed but the pg_num has\n $scope.pool.pg_num = pgnum;\n }\n } else {\n $scope.pool.pg_num = defaults.pg_num;\n }\n };\n }", "function reset () {\n\t queue = []\n\t userQueue = []\n\t has = {}\n\t waiting = false\n\t flushing = false\n\t}", "function reset () {\n queue = []\n userQueue = []\n has = {}\n waiting = false\n flushing = false\n}", "function reset () {\n queue = []\n userQueue = []\n has = {}\n waiting = false\n flushing = false\n}", "function reset () {\n queue = []\n userQueue = []\n has = {}\n waiting = false\n flushing = false\n}", "function reset() {\n startTime = Date.now();\n endTime = startTime + duration;\n resetTime = endTime + endHold;\n updatedCounties = [];\n for (let i = 0; i < voteSequence.length; i += 1) {\n voteSequence[i].hasUpdated = false;\n }\n electionSubject.next(RESET);\n }", "reset()\n {\n super.reset();\n this._roomName = this._room.get().name;\n this._targets = this.UpdateEnegry();\n this._requiredCreeps = this.MakeRequirement();\n }", "function softReset() {\n currentAns = 0;\n operatorArr = [];\n numberArr = [];\n fixedNumberArr = [];\n}", "function reset_counters() {\n num_connection_retries = 0;\n time_spent = 0;\n time_purchased = 0;\n}", "reset() {\n this.previousSlots_ = [];\n }", "function resetVars() {\n\tpriceArray = [];\n\ttimeInMinutes = [];\n\tindicators = [];\n\tnoEMABuy = false;\n\tnoEMASell = false;\n\tppoBought = false;\n\tppoSold = false;\n\temaBuyConfirmations = 0;\n\temaSellConfirmations = 0;\n\ttradeBlockCounter = 0;\n\tstate = \"limbo\";\n}", "function reset() {\n player.activeMods.splice(0);\n totalPts = 0;\n activeModRate = 0;\n for (const key in mods) {\n if (mods.hasOwnProperty(key)) {\n const element = mods[key];\n element.qty = 0;\n element.available = false;\n element.cost = element.resetCost;\n }\n }\n updateMods();\n drawModTotals();\n drawModButtons();\n drawTotalScore();\n drawActiveModRate();\n drawRank();\n}", "resetResources()\n {\n this.slaps = 0;\n this.blocks = 0;\n }", "reset() {\n if (this.currentRun) {\n throw new Error(\"Can't reset if a test run is already in progress!\");\n }\n this.resetRunResults();\n this.testRunCancelled = false;\n this.testQueueStack = [];\n for (const type of QueueStackTypes) {\n this.queueStacks[type].reset();\n }\n }", "function reset() {\n userSupplierManager.reset();\n UserCache._clear();\n ScoreBooster.reset();\n }", "function reset() {\n userSupplierManager.reset();\n UserCache._clear();\n ScoreBooster.reset();\n }", "reset() { // stackOperations = 2\r\n\r\n this.activeState = this.config.initial;\r\n this.stackOperations.push(2);\r\n }", "reset() {\n this._age = 0\n this._height = 0\n this._fruits = []\n this._healthyStatus = true\n this._harvested = ''\n }", "static reset() {\n this._activeTask = undefined;\n this._tasks = new Map();\n }", "_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 }", "_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 }", "_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 }", "function reset() {\n\tstate.questionCounter = 0;\n\tstate.score = 0;\n\tstate.questions = [\n\t\t{\n\t\t\tid: 0,\n\t\t\tpregunta: 'Ets un/a Vilafranquí/ina de Tota la Vida? Prova el test!',\n\t\t\trespostes: [],\n\t\t\tcorrecte: null,\n\t\t},\n\t];\n\tstate.collectedAnswers = [];\n\tstate.comodinsLeft = state.comodinsInitial;\n\tstate.comodiUsedInQuestion = false;\n\tstate.comodiButtonExpanded = false;\n\t// display initial question\n\tdisplayInitialQuestion();\n}", "reset() {\n // Make any pending promise obsolete.\n this.pendingBackendInitId++;\n this.state.dispose();\n this.ENV.reset();\n this.state = new EngineState();\n for (const backendName in this.registry) {\n this.disposeRegisteredKernels(backendName);\n this.registry[backendName].dispose();\n delete this.registry[backendName];\n }\n this.backendName = null;\n this.backendInstance = null;\n this.pendingBackendInit = null;\n }", "reset() {\n this.density = this.ring / this.agents.length;\n this.min_range = this.density / 1;\n this.max_range = (this.agents.length > 150) ? this.density * 150 : 1;\n\n for (let agent of this.agents) {\n agent.set_values(this);\n }\n\n for (let agent of this.agents) {\n agent.init();\n }\n\n for (let agent of this.agents) {\n for (let stored_agent in agent.memory) {\n // stored_agent.status = stored_agent.memory.length;\n // ???\n }\n }\n }", "resetShopper(){\n //this.uniqueDrugsInOrder = []\n this.orderSelectedToShop = false\n this.formComplete = false\n this.updatePickedCount()\n }", "function resetCtx () {\n // set up context\n setUpCtx();\n\n // optIn's\n ctx.optInToDAOApp(ctx.proposalLsig.address());\n ctx.optInToDAOApp(ctx.voterA.address);\n ctx.optInToDAOApp(ctx.voterB.address);\n ctx.syncAccounts();\n\n // add proposal\n ctx.addProposal();\n\n // deposit & register yes votes (by A)\n ctx.depositVoteToken(ctx.voterA, ctx.depositLsig, 5);\n ctx.vote(ctx.voterA, Vote.YES, ctx.proposalLsigAcc);\n\n // deposit & register yes votes (by B)\n ctx.depositVoteToken(ctx.voterB, ctx.depositLsig, 7);\n ctx.vote(ctx.voterB, Vote.YES, ctx.proposalLsigAcc);\n\n // execute proposal\n ctx.executeProposal(ctx.proposalLsigAcc);\n }", "_resetPendingCount() {\n count = updateCount = 0;\n }", "reset() {\n this.length = 0;\n this._subParamsLength = 0;\n this._rejectDigits = false;\n this._rejectSubDigits = false;\n this._digitIsSub = false;\n }", "function resetFruitTally() {\n grapes = 0;\n bananas = 0;\n oranges = 0;\n cherries = 0;\n bars = 0;\n bells = 0;\n sevens = 0;\n blanks = 0;\n }", "function reset() {\n projectStage = null;\n separator = null;\n eventQueue = [];\n errorQueue = [];\n Implementation.requestQueue = null;\n }", "reset() {\n this.txnConnections = 0;\n this.cursorConnections = 0;\n this.otherConnections = 0;\n }", "function reset () {\n stopTimerAndResetCounters();\n setParamsAndStartTimer(currentParams);\n dispatchEvent('reset', eventData);\n }", "resetQuest() {\n this.playersNeededLeft = this.playersRequired;\n this.playersOnQuest.clear();\n this.questTeamDecisions.voted = [];\n this.questTeamDecisions.accept = [];\n this.questTeamDecisions.reject = [];\n }", "reset() {\n for (let i = 0; i < this.allNodes.length; i++) { this.allNodes[i].reset(); }\n for (let i = 0; i < this.Splitter.length; i++) {\n this.Splitter[i].reset();\n }\n for (let i = 0; i < this.SubCircuit.length; i++) {\n this.SubCircuit[i].reset();\n }\n }", "function resetVars (){\n purchId = \"\";\n purchQuant = \"\";\n purchProdName= \"\";\n purchProdPrice=\"\";\n remainingInv=\"\";\n orderTotal=\"\";\n}", "function resetStats() {\n stats.gc_count = 0;\n stats.gc_count_incremental = 0;\n stats.gcInterval = 0;\n metric.maxConcurrentRequests = 0;\n metric.urltime.reset();\n metric.eps = 0;\n metric.http2XX = 0;\n metric.http3XX = 0;\n metric.http4XX = 0;\n metric.http5XX = 0;\n metric.renderTime.reset();\n metric.cookielen.reset();\n metric.requestBody.reset();\n metric.sessionSize = 0;\n metric.requestsReceived = 0;\n}", "function restartUsed(){\n arrUsedBefore.splice(1,questlength);\n }", "function resetSchedulerState() {\n\t\t queue.length = 0;\n\t\t userQueue.length = 0;\n\t\t has = {};\n\t\t if (false) {\n\t\t circular = {};\n\t\t }\n\t\t waiting = false;\n\t\t}", "resetSettings() {\n document.getElementById('marot-scoring-unit').value = 'segments';\n this.mqmWeights = JSON.parse(JSON.stringify(mqmDefaultWeights));\n this.mqmSlices = JSON.parse(JSON.stringify(mqmDefaultSlices));\n this.setUpScoreSettings();\n this.updateSettings();\n }", "function resetBatcherState () {\n\t\t queue = []\n\t\t userQueue = []\n\t\t has = {}\n\t\t circular = {}\n\t\t waiting = internalQueueDepleted = false\n\t\t}", "function setCapacity(max)\n {\n service.capacity =max;\n }", "function reset() { stack=[]; rstack=[];}", "function reset() {\n quizMetrics.changeState(\"results\", false);\n quizMetrics.numCorrect = 0;\n \n for(var i = 0; i < dataSvc.quizQuestions.length; i++) {\n var data = dataSvc.quizQuestions[i];\n \n data.selected = null;\n data.correct = null;\n }\n }", "function reset() {\n self.taskActionList([]);\n self.selectedTasklist([]);\n self.isTaskSelected(false);\n self.actionName('');\n self.actionComments('');\n self.showConfirmation('none');\n }", "function resetGame() {\n document.getElementById('slot1').innerText = 0;\n document.getElementById('slot2').innerText = 0;\n document.getElementById('slot3').innerText = 0;\n let formContainer = document.getElementById('form-container');\n formContainer.remove();\n cards = [];\n available = [];\n smallNumbers = [1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10];\n largeNumbers = [25, 50, 75, 100];\n desktopOrMobile();\n userCardsContainer.innerHTML = \"\";\n createUserCards();\n userNums = [];\n spin = true;\n}", "function Reset () {\n\t// Clear any old pending states\n\tpool.getConnection( function ( err, connection ) {\n\t\tif ( err ) console.log( err );\n\n\t\tconsole.log( 'Startup connection added.' );\n\t\tconnCount++;\n\n\t\tconnection.query( \"UPDATE ci_logical_sensor SET pending = 0\", function ( err, rows ) {\n\t\t\tif ( err ) console.log( err );\n\n\t\t\tconnection.end();\n\t\t\tconsole.log( 'Startup connection removed.' );\n\t\t\tconnCount--;\n\t\t});\n\t});\n\n\tsensorPool = [];\n}", "reset() {\n\t\t// Keys\n\t\tthis.keys \t\t= {};\n\n\t\t// State\n\t\tthis.state \t\t= \"\";\n\n\t\t// Score\n\t\tthis.score \t\t= 0;\n\n\t\t// Health\n\t\tthis.health \t= 100;\n\t}", "reset() {\n this.cache = null\n this.counter = 0\n this.results = []\n }", "function reset() {\n\t// reset proposals/partners\n\tfor (var i = 0; i < personData.length; i++) {\n\t\tpersonData[i].fiance = null;\n\t\tpersonData[i].free = true;\n\t\tpersonData[i].exes = [];\n\t\talertQueue = [];\n\t\tif (personData[i].gender == \"m\") {\n\t\t\tpersonData[i].proposals = 0;\n\t\t}\n\t\tif(personData[i] == selectPerson) {\n\t\t\tpersonData[i].prefs = prevState;\n\t\t}\n\t}\n\tselecting = false;\n\tselectPerson = null;\n\tselectIndex = 0;\n\tprevState = null;\n\tcurManIndex = null;\n\tstarted = false;\n\tstepClicked = false;\n\tcheckClicked = false;\n\tplaying = false;\n\tfinished = false;\n\td3.select(\"#play-button\").text(\"Play Algorithm\");\n\tclearInterval(interval);\n\tupdateAlert();\n\tupdateVis();\n}", "function resetData() {\n\t\t\tconsole.log(\"resetData()\");\n\n\t\t\tvm.results = [];\n\t\t\tvm.selectedIndex = -1;\n\t\t\tvm.total_count = 0;\n\n\t\t\t// rebuild empty apiDomain submission object, else bindings fail\n\t\t\tvm.apiDomain = {};\n\t\t\tvm.apiDomain.logicalDBKey = \"\";\t\n\t\t}", "reset() {\n\t\tthis.items.length = 0;\n\t}", "reset() {\n this._items = [];\n }", "reset() {\n for (const sensor of this.activeSensors_.values()) {\n sensor.reset();\n }\n this.activeSensors_.clear();\n this.resolveFuncs_.clear();\n this.getSensorShouldFail_.clear();\n this.permissionsDenied_.clear();\n this.maxFrequency_ = 60;\n this.minFrequency_ = 1;\n this.receiver_.$.close();\n this.interceptor_.stop();\n }", "function reset(){\n trainName = \"\";\n destination = \"\";\n startTime = \"\";\n frequency = 0;\n}", "reset() {\r\n if (this.defaultResourcesEnabled) {\r\n let prevResources = this.state.resources;\r\n let resourceList = [];\r\n let resources = [];\r\n if (resources) {\r\n // const nonDefaultResources = _.remove(resources, function(resource) { return _.find(defaultResources, {'name': resource.name})==null });\r\n // resourceList = nonDefaultResources.concat(this.state.resourceList);\r\n const defaultResources = this.defaultResources;\r\n resourceList = _.sortBy(prevResources.concat(this.state.resourceList), \"name\");\r\n resources = _.remove(resourceList, function(resource) { return _.find(defaultResources, {'name': resource.name})!=null });\r\n // const projectQuota = this.setProjectQuotaDefaults(resources);\r\n // this.setState({resourceList: resourceList, resources: resources, projectQuota: projectQuota});\r\n }\r\n const projectQuota = this.setProjectQuotaDefaults(resources);\r\n this.setState({\r\n dialog: { header: '', detail: ''},\r\n project: {\r\n url: '',\r\n name: '',\r\n description: '',\r\n trigger_priority: 1000,\r\n priority_rank: null,\r\n quota: [],\r\n archive_location: null,\r\n archive_subdirectory:\"\"\r\n },\r\n projectQuota: projectQuota,\r\n validFields: {},\r\n validForm: false,\r\n errors: {},\r\n dialogVisible: false,\r\n resources: resources,\r\n resourceList: resourceList\r\n });\r\n } else {\r\n this.setState({redirect: `/project/edit/${this.state.project.name}`})\r\n }\r\n }", "function resetQueue () {\n var now = Date.now();\n for (var i = 0; i < fs$j[gracefulQueue].length; ++i) {\n // entries that are only a length of 2 are from an older version, don't\n // bother modifying those since they'll be retried anyway.\n if (fs$j[gracefulQueue][i].length > 2) {\n fs$j[gracefulQueue][i][3] = now; // startTime\n fs$j[gracefulQueue][i][4] = now; // lastTime\n }\n }\n // call retry to make sure we're actively processing the queue\n retry();\n}", "function resetAccumulators() {\n\tTi.API.info('entered resetAccumulators');\n // set every value to empty string in current_num\n resetCurrentNum();\n // set each other accumulator to equal the empty current_num\n last0_num = lib.resetAccum(last0_num);\n last0_num = lib.resetAccum(last1_num);\n last0_num = lib.resetAccum(total_num);\n Ti.API.info('after reset, last0_num is: '+last0_num.arabic);\n Ti.API.info('after reset, last1_num is: '+last1_num.arabic);\n Ti.API.info('after reset, total_num is: '+total_num.arabic);\n Ti.API.info('after reset, last0_num is: '+JSON.stringify(last0_num));\n Ti.API.info('after reset, last1_num is: '+JSON.stringify(last1_num));\n Ti.API.info('after reset, total_num is: '+JSON.stringify(total_num));\n}", "function resetQueue () {\n var now = Date.now()\n for (var i = 0; i < fs[gracefulQueue].length; ++i) {\n // entries that are only a length of 2 are from an older version, don't\n // bother modifying those since they'll be retried anyway.\n if (fs[gracefulQueue][i].length > 2) {\n fs[gracefulQueue][i][3] = now // startTime\n fs[gracefulQueue][i][4] = now // lastTime\n }\n }\n // call retry to make sure we're actively processing the queue\n retry()\n}", "function resetQueue () {\n var now = Date.now()\n for (var i = 0; i < fs[gracefulQueue].length; ++i) {\n // entries that are only a length of 2 are from an older version, don't\n // bother modifying those since they'll be retried anyway.\n if (fs[gracefulQueue][i].length > 2) {\n fs[gracefulQueue][i][3] = now // startTime\n fs[gracefulQueue][i][4] = now // lastTime\n }\n }\n // call retry to make sure we're actively processing the queue\n retry()\n}", "function resetQueue () {\n var now = Date.now()\n for (var i = 0; i < fs[gracefulQueue].length; ++i) {\n // entries that are only a length of 2 are from an older version, don't\n // bother modifying those since they'll be retried anyway.\n if (fs[gracefulQueue][i].length > 2) {\n fs[gracefulQueue][i][3] = now // startTime\n fs[gracefulQueue][i][4] = now // lastTime\n }\n }\n // call retry to make sure we're actively processing the queue\n retry()\n}", "function resetFruitTally() {\n grapes = 0;\n watermalon = 0;\n oranges = 0;\n cherries = 0;\n crown = 0;\n seven = 0;\n dollor = 0;\n blank = 0;\n}", "function reset() {\n\t\ti = 0;\n\t\tj = 1;\n\t\t$('p[id=\"times\"]').text(j);\n\t\t$('p[id=\"freq\"]').text(DWMspinner[i]);\n\t\t$('button[data-type=\"plus\"][data-field=\"times\"]').removeClass('disabled');\n\t\t$('button[data-type=\"minus\"][data-field=\"times\"]').removeClass('disabled');\n\t\t$('button[data-type=\"plus\"][data-field=\"freq\"]').removeClass('disabled');\n\t\t$('button[data-type=\"minus\"][data-field=\"freq\"]').addClass('disabled');\n\t\tupdateSubtotals();\n\t}", "reset() {\n // Reset the stats\n this.numSusceptible = getInitialNumSusceptible();\n this.numInfectious = getInitialNumInfectious();\n this.numNonInfectious = 0;\n this.numImmune = 0;\n this.numDead = 0;\n this.numIcu = 0;\n\n // Clear the border context\n const { width, height } = this.borderCtx.canvas.getBoundingClientRect();\n this.borderCtx.clearRect(0, 0, width * 2, height * 2);\n\n this.numCommunities = getNumCommunities();\n if (this.numCommunities !== this.model.numCommunities) {\n this.model.numCommunities = this.numCommunities;\n }\n\n this.model.communities = {};\n this.model.setupCommunity();\n\n this.chart.resetChart(this.numSusceptible, this.numInfectious);\n this.timeline.reset();\n this.model.resetModel(this.createCurrentStats());\n\n const {\n width1,\n height2,\n } = this.demographicsCtx.canvas.getBoundingClientRect();\n this.demographicsCtx.clearRect(0, 0, width1 * 2, height2 * 2);\n this.demographicsChart.resetChart(this.createCurrentStats().sum());\n }", "function resetGame() {\n updateChips();\n endGame.style.display = \"none\";\n result.innerText = \"\";\n newPlayer.hand = [];\n newDealer.hand = [];\n newPlayer.score = 0;\n newDealer.score = 0;\n deal.disabled = false;\n newPlayer.removeCards();\n newDealer.removeCards();\n // If cards low, make four new decks \n if (newDeck.cards <= 12) {\n newDeck.createDeck();\n newDeck.createDeck();\n newDeck.createDeck();\n newDeck.createDeck();\n newDeck.shuffle();\n }\n}", "function reset() {\n for( x=0; x<0x600; x++ ){\n memory[x] = 0x00;\n }\n regA = regX = regY = 0;\n defaultCodePC = regPC = 0x600;\n regSP = 0x100;\n regP = 0x20;\n runForever = false;\n}", "resetPlanCache() {\n this.store.years.forEach((year) => {\n year.plans = [];\n });\n this._commit();\n }", "function reset() {\n raw_data = \"\";\n data = [];\n frequency_object = {};\n frequency_total = 0;\n grouped = []\n}", "function resetBatcherState () {\n\t queue = []\n\t userQueue = []\n\t has = {}\n\t circular = {}\n\t waiting = internalQueueDepleted = false\n\t}", "function resetFruitTally() {\n grapes = 0;\n bananas = 0;\n oranges = 0;\n cherries = 0;\n bars = 0;\n bells = 0;\n sevens = 0;\n blanks = 0;\n}", "function resetFruitTally() {\n grapes = 0;\n bananas = 0;\n oranges = 0;\n cherries = 0;\n bars = 0;\n bells = 0;\n sevens = 0;\n blanks = 0;\n}", "resetData() {\n this.clearFilters();\n this.data = [];\n this.metrics = ['MQM'];\n for (let key in this.metricsInfo) {\n /** Only retain the entry for 'MQM'. */\n if (key == 'MQM') continue;\n delete this.metricsInfo[key];\n }\n this.metricsVisible = [];\n this.sortByField = 'metric-0';\n this.sortReverse = false;\n this.closeMenuEntries('');\n }", "function reset() {\n\t// Generate color palette\n\tcolorPalette = new Array(codeComplexity).fill().map((_, i) => {\n\t\treturn `hsl(${Math.floor(i/codeComplexity*360)}, 90%, 60%)`\n\t})\n\n\t// User slot tracker\n\tselectedSlotIndex = 0\n\tselectedPieceIndex = 0\n\n\t// Code generation\n\tguess = new Array(codeLength).fill(null)\n\tcode = new Array(codeLength).fill(null).map(() => Math.floor(Math.random() * codeComplexity))\n\tconsole.log(code)\n\n\t// Reset the UI\n\tinitUI(codeLength, codeComplexity, slotCount, colorPalette)\n\t\n\t// DOM objects\n\tboard = new Array(slotCount).fill().map((_, i) => {\n\t\tconst slot = document.getElementsByClassName('slot')[slotCount-1-i]\n\t\treturn slot.getElementsByClassName('piece')\n\t})\n\n\tpegs = new Array(slotCount).fill().map((_, i) => {\n\t\tconst pegz = document.getElementsByClassName('pegs')[slotCount-1-i]\n\t\treturn pegz.getElementsByClassName('peg')\n\t})\n\n\tactivatePiece(selectedSlotIndex, selectedPieceIndex)\n}", "reset(){\n this.enable();\n this.init();\n this.buildAll();\n }", "function resetBatcherState() {\n queue.length = 0;\n userQueue.length = 0;\n has = {};\n circular = {};\n waiting = false;\n }", "function resetBatcherState() {\n queue.length = 0;\n userQueue.length = 0;\n has = {};\n circular = {};\n waiting = false;\n }", "function resetBatcherState() {\n queue.length = 0;\n userQueue.length = 0;\n has = {};\n circular = {};\n waiting = false;\n }", "reset() {\r\n this.done = false; // State of Algorithm\r\n this.graphInit = false; // State of Graph Initializaion\r\n this.queue = null; // Holds Queue of Blocks\r\n }", "recharge() {\n const rechargeDuration = this.getAliveOperators().map((operator) => {\n operator.recharge();\n\n return operator.getRechargeDuration();\n }).reduce((totalRecharge = 0, operatorRecharge) => {\n return totalRecharge + operatorRecharge;\n }, 0);\n\n if (VehicleDefaults.MinOperatorsCount > rechargeDuration) {\n super.recharge();\n }\n }", "function resetDatabase() {\n progress = 0;\n totalWeight = 0;\n currentCup = 0;\n currentWeight = 0;\n monthlyTotal = 0;\n congratulated = false;\n daysMetGoal = 0;\n monthlyProgress = 0;\n daysMetGoal = 0;\n updateDatabase();\n}", "function resetBatcherState() {\n\t queue = [];\n\t userQueue = [];\n\t has = {};\n\t circular = {};\n\t waiting = internalQueueDepleted = false;\n\t}", "function resetBatcherState() {\n\t queue = [];\n\t userQueue = [];\n\t has = {};\n\t circular = {};\n\t waiting = internalQueueDepleted = false;\n\t}", "function resetBatcherState() {\n\t queue = [];\n\t userQueue = [];\n\t has = {};\n\t circular = {};\n\t waiting = internalQueueDepleted = false;\n\t}", "function resetSchedulerState () {\n\t queue.length = 0\n\t has$1 = {}\n\t if (process.env.NODE_ENV !== 'production') {\n\t circular = {}\n\t }\n\t waiting = flushing = false\n\t}", "function clear(){\n storageService.clear();\n model.createdPlans = storageService.items;\n }", "reset() {\n this.currentOperand = '0';\n this.previousOperand = '';\n this.operation = undefined;\n }", "function resetBatcherState() {\n queue = [];\n userQueue = [];\n has = {};\n circular = {};\n waiting = internalQueueDepleted = false;\n}", "function resetBatcherState() {\n queue = [];\n userQueue = [];\n has = {};\n circular = {};\n waiting = internalQueueDepleted = false;\n}", "function reset() {\n let da = new VMN.DAPI();\n da.db.cleanDB();\n da.cleanLog();\n VMN.DashCore.cleanStack();\n}", "reset() {\n this.portIndex = 0;\n this.results = [];\n this.error = null;\n this.prepare(true);\n }", "resetCart() {\n this.ds.emptyProducts();\n this.resetList();\n }" ]
[ "0.6036791", "0.5486369", "0.54608387", "0.54495", "0.5395226", "0.5291027", "0.5289564", "0.5278413", "0.52441865", "0.52296174", "0.52206147", "0.52105176", "0.52105176", "0.52105176", "0.51682013", "0.5140166", "0.5135158", "0.51187843", "0.51128334", "0.51113206", "0.50969994", "0.5085825", "0.50497186", "0.5018998", "0.5018998", "0.5015196", "0.49871615", "0.49825945", "0.49577138", "0.49577138", "0.49577138", "0.49363247", "0.49358046", "0.49346837", "0.4926411", "0.4911773", "0.4902724", "0.48773447", "0.48589513", "0.48557103", "0.48465547", "0.48385543", "0.48380783", "0.48360565", "0.4832396", "0.48316386", "0.48291558", "0.48249155", "0.48203403", "0.4815183", "0.48108032", "0.48020774", "0.480077", "0.47922966", "0.47920293", "0.4784441", "0.4784069", "0.47768205", "0.4776231", "0.47744998", "0.47671524", "0.47633126", "0.4761507", "0.47582296", "0.4751278", "0.47458926", "0.47418654", "0.474096", "0.474096", "0.474096", "0.4735747", "0.4734997", "0.4734275", "0.4730819", "0.4721948", "0.472158", "0.47214168", "0.47123674", "0.47103757", "0.47103757", "0.47100845", "0.47088408", "0.47061974", "0.4702819", "0.4702819", "0.4702819", "0.4701923", "0.4695335", "0.46941936", "0.46940562", "0.46940562", "0.46940562", "0.46922293", "0.46916956", "0.4691593", "0.4684766", "0.4684766", "0.46845937", "0.468162", "0.46812755" ]
0.526385
8
On every 2 second, refresh global variables.
function sched_refresh_global() { setTimeout(function() { client.get('refresh_interval', function(err, reply) { refreshInterval = reply; }); client.lrange('op-qps', 0, -1, function(err, ops) { qpsOps = ops; }); client.lrange('op-bps', 0, -1, function(err, ops) { bpsOps = ops; }); client.lrange('op-total', 0, -1, function(err, ops) { totalOps = ops; }); client.lrange('apps', 0, -1, function(err, appList) { apps = appList; }); sched_refresh_global(); }, 2000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refreshGamesEachSec() {\n setInterval(refreshGameStatus, 1000);\n}", "function init() {\n var interval = setInterval(handleRefresh, 3000);\n handleRefresh();\n}", "function refreshOn()\n{\n refreshInterval = setInterval(function () {refresh()}, 1000);\n}", "function reload_functions(){\n get_heart_rate();\n setTimeout(reload_functions, 1000);\n}", "function controlLoop(){\r\n refreshData();\r\n setInterval(refreshData,10000);\r\n}", "function refresh() {\n\t\n\tif(refreshTime === \"\") {\n\t\t$('#RefreshTime').val(2);\n\t\trefreshTime = 2;\n\t}\n\n\tsetTimeout(refresh, parseFloat(refreshTime)*1000);\n\t//console.log('refresh values');\n\t\n\txhr = $.ajax({\n\t\t\turl: \"sensor_values.php\"\n\t\t});\n\n\txhr.done(function(msg) {\n\t\t\t$('#TEMP_VAL').text(msg.split(\"\\n\")[0]);\n\t\t\t$('#LIGHT_VAL').text(msg.split(\"\\n\")[1]);\n\t\t\t$('#PIR_VAL').text(msg.split(\"\\n\")[2]);\n\t\t});\n}", "function timedRefresh() {\n if (!MAPP.refreshTimer) {\n MAPP.refreshTimer = setTimeout(insertHtml, 300);\n }\n}", "function doLoad()\n{\n\tsetInterval(\"refreshGames()\",5000);\n\tsetInterval(\"refreshPlayers()\",5000);\n}", "function setTimers()\n{\n\ttimeID = window.setTimeout( \"updateAll()\", refreshRate );\n}", "function init()\n{\n prevTime = Date.now();\n setInterval( update, FIXED_DT );\n}", "function autoRefresh() {\n if(typeof CACHE_TIME_INTERVAL === 'number') {\n var seconds = CACHE_TIME_INTERVAL * 1000;\n } else {\n var seconds = 60000;\n }\n window.setInterval(function() {\n serverRPS.startSearch();\n productServers.startSearch();\n }, seconds);\n }", "function reload(){\n\tsetTimeout(function(){\n\t\t\tgetTweets();\n\t\t}, reloadInterval*1000);\n}", "function refresh() {\n\tif(localDebug){\n\t\tconsole.log(\"refresh?\");\n\t}\n\tsetInterval(function() {\n\t\t// zone_no = get_zone_no(tag_no); // used for HAIP localization zone definitions\n\t\tvar old_zone_no = zone_no; // used for non-localization zone definitions\n\t\tif (old_zone_no != zone_no) {\n\t\t\taudio.pause();\n\t\t\tpick_stream(zone_no);\n\t\t\taudio.play();\n\t\t}\n\t}, 10000);\n}", "function refreshValues(){\n\tloadURLAsync(urlValues, function(state, response) {\n\t\tcachedValues=JSON.parse(response);\n\t\n\t\trealPollingFreq=Date.now()-lastPollingTime;\n\t\tlastPollingTime=Date.now();\n\t\n\t\tif(state==200) {\n\t\t\tonValuesChanged(cachedValues, realPollingFreq);\t\n\t\n\t\t\tif(!isPaused)\n\t\t\t\twindow.setTimeout(\"refreshValues()\",pollingFreq);\n\t\t\t\t\n\t\t} else {\n\t\t\tonNetworkError(state, response);\n\t\t}\n\t\t\n\t});\n}", "function setRefresh () {\n setInterval( function() {window.location.reload();}, 20000);\n}", "function run() {\n update();\n setInterval(update, 3600000);\n}", "function initTimer() {\n Consts.stockTime = 0;\n Consts.currStatus = Status.init;\n initRefresh = setInterval(refreshClock, 1);\n}", "function refresh () {\n // If the ticker is not running already...\n if (ticker === 0) {\n // Let's create a new one!\n ticker = self.setInterval(render, Math.round(1000 / 60));\n }\n }", "function reload()\n{\n clearInterval(interval);\n interval=setInterval(update,speed);\n}", "function refresh() {\n deleteCards();\n createNewDeck();\n createStars();\n moves = 0;\n second = 0;\n minute = 0;\n hour = 0;\n matchedCards = 0;\n timer.innerHTML = minute+\" min \"+second+\" sec\";\n}", "scheduleRefresh() {}", "scheduleRefresh() {}", "function refreshLoop(){\n refreshInterval = setInterval(function(){ \n mlurl = matchlistURL+user;\n postRequest(createMatches,mlurl, true)\n }, 45000);\n}", "function refresh() {\n }", "function incrementTimer() {\n globalTimer += SAMPLE_RATE / 1000;\n graphs.update(); //measure voltages and add them to graph\n}", "function refresh_globals() {\n widget_data.global_div.innerHTML = '<h3 style=\"text-align:center;\">Global Variables</h3>';\n if(widget_data.globals !== undefined) {\n var details_div = document.createElement(\"div\");\n details_div.style.padding = \"5px\";\n Object.keys(widget_data.globals).forEach(function(key, index) {\n var p = document.createElement('p');\n p.innerHTML = `<b>${key}:</b> ${widget_data.globals[key]}`;\n details_div.appendChild(p);\n });\n widget_data.global_div.appendChild(details_div);\n }\n }", "function refresh(time) {\n window.mockDate = new Date(time);\n init();\n}", "function updateRSS () {\n setInterval(initialize, 1000 * 60 * 60 * 4); // runs Initialize ever 4 hours from first load\n}", "function init() {\n setInterval(function() {\n updateTime();\n }, 1000);\n\n bindEvents();\n }", "function updateEveryMinute() {\n var interval = setInterval(update, 1000 * 60)\n}", "function startRefreshingCurData() {\n getCurData(function (success) {\n if (!success) {\n console.warn(\"Error getting current data\");\n }\n\n setTimeout(startRefreshingCurData, REFR_RATE);\n });\n}", "function init() {\n\tsetTimeout(function() {\n\tauto_update();\n\tinit();\t\n\t}, 200);\n\t\n}", "function refresh() {\r\nsetInterval(\"location.reload()\",2000);\r\n}", "function refresh() {\n if (!instance) {\n console.warn(\"not initialised\");\n return;\n }\n\n instance.refresh();\n}", "loopUpdate(){\n setInterval(()=>{\n this.updateNow();\n },updateSecs*1000);\n }", "async function frequencyChanged() {\n config.changeFrequency = {change: false, newTime: 0};\n}", "function init() {\n\tsetInterval(updateUI, 2000);\t\n}", "function refresh() {\n setTimeout(function () {\n location.reload();\n }, 60000);\n }", "function setupUpdate() {\n setInterval(update, 600);\n}", "function update() {\n $.get(\"views/refreshStatus.php\", function(data) {\n $(\"#refresh\").html(data);\n });\n window.setTimeout(\"update();\", 2000);\n}", "function setRefreshInterval() {\n refreshInterval = setInterval( moveRight, autoSlideChange); \n}", "function mytick() {\n\t//console.log(\"from timer tick: \"+new Date() + \", and current count: \"+appTimer.currentCount);\n\tmyTime = moment().format(\"hh:mm:ss A\");\n\tmyDate = moment().format(\"dddd, MMMM DD, YYYY\");\n\n\tdocument.getElementById(\"timeDiv\").innerHTML = myTime;\n\tdocument.getElementById(\"dateDiv\").innerHTML = myDate;\n\tdocument.getElementById(\"timeLeft\").innerHTML = \"Seconds left until next refresh: \" + (secondsToNextRefresh--);\n\t//console.log(myDate+\" \"+myTime+\" timer current count: \"+appTimer.currentCount);\n\tif (appTimer.currentCount == dataRefreshInterval_seconds) {\n\n\t\t//refresh the MIM data\n\t\t//console.log('refreshing data');\n\t\t//proxy.getSegmentsMedianTravelTimes(\"00:15:00\", new Async(travelTimeDataSuccess, travelTimeDataError));\n\n\t\tgetTranscomLinkData();\n\t\tgetWifiLinkData();\n\n\t\t//reset the timer so the current count resets as well\n\t\tappTimer.Reset();\n\t\tdocument.getElementById(\"disclaimerDateTime\").innerHTML = moment().format('MMMM Do YYYY, h:mm:ss a');\n\t\tsecondsToNextRefresh = dataRefreshInterval_seconds;\n\t}\n\n}", "function reFresh() {\r\n location.reload(true)\r\n //window.setInterval(\"reFresh()\",2000);\r\n}", "function initialize() {\n\n //get the first update.\n getUpdate();\n\n //start the update timer.\n setInterval(getUpdate, updateInterval * 1000);\n}", "function nextUpdate() {\n\tUPDATING = false;\n\trefreshTimeout = setTimeout(function(){ \n\t\tstartDrawingData(); \n\t}, UPDATE_INTERVAL * 1000);\n}", "function refreshAll() {\n\t\thideGraphs();\n\t\tmyTimer = setInterval(refreshAllWait, 100);\n\t}", "function refreshfunc() {\r\n if (user) {\r\n refresh = setInterval(status, 3000);\r\n }\r\n}", "function _doInterval() {\n _gcBlocksCache();\n\n if (_driver) {\n var pkg = system.DOWN.ARANGE;\n _driver.send(protocol.serialize(pkg));\n }\n}", "function updateAll()\n{\n\twindow.clearTimeout( timeID );\n\tgetUserList();\n\tsetTimers();\n}", "function updatemyProduction() {\n\n setInterval(function() {\n \n myProduction(); \n }, 120000); // update SQ Feet Production every 2 Minutes\n\n }", "async function initialize(){\n fetchUpdates();\n setInterval(fetchUpdates, 2000);\n}", "function refreshTimer() {\n clearInterval(autoAdvanceTimer);\n autoAdvanceTimer = setInterval(autoAdvance, 10000);\n}", "function reloadSites() {\n function reload() {\n sites.get()\n .then(function(sites) {\n $scope.ui.sites = sites;\n });\n }\n /*\n * Reload sites mutliple times, because sometimes updates to list of sites\n * aren't ready immediately.\n */\n // Reload sites immediately.\n reload();\n // Reload sites again after 5 seconds.\n setTimeout(reload, 1000 * 5);\n // Reload sites again after 15 seconds.\n setTimeout(reload, 1000 * 15);\n }", "function addSecTimer(){if (timer == refresh){setTimeout(\"addSecTimer()\",1000);loadData();}else{/*console.log(timer);*/timer++;setTimeout(\"addSecTimer()\",1000);}}", "function refreshInfo() { \t \n everyone.now.setStatus(statusv);\n\t upSongNum();\n\t setTimeout(upPlaylist(everyone),350);\n }", "function startLiveUpdate() {\n setInterval(async () => {\n const response = await fetch(\"https://foobar-mandalorians.herokuapp.com/\");\n const jsonData = await response.json();\n prepareData(jsonData);\n }, 3000);\n}", "function periodicUpdate() {\n // Increment update counter.\n updateCount += 1;\n \n // If the page has been loaded recently, initialize.\n if (updateCount < 3) {\n getData('sys/model', function(data) { updateElement('device-model', data.toString()); });\n getData('sys/os', function(data) { updateElement('device-os', data.toString()); });\n getData('ram/total', function(data) { updateElement('ram-total', Math.round(parseInt(data))); });\n getData('fs/0/total', function(data) { updateElement('disk-total', Math.round(parseInt(data))); });\n }\n \n if (serverOnline()) {\n // Server is online, update dash.\n \n $('#connection-online').removeClass('hidden');\n $('#connection-offline').addClass('hidden');\n\n if(!uptimeInterval) {\n getData('uptime', function(data) { initUptimeInterval(data); });\n }\n \n getData('cpu/temp', function(data) { updateElement('cpu-temp', Math.round(parseInt(data))); });\n getData('cpu/usage', function(data) { updateElement('cpu-usage', Math.round(parseInt(data))); });\n \n getData('ram/usage', function(data) { updateElement('ram-usage', Math.round(parseInt(data))); });\n getData('ram/used', function(data) { updateElement('ram-used', Math.round(parseInt(data))); });\n \n getData('fs/0/usage', function(data) { updateElement('disk-usage', Math.round(parseInt(data))); });\n getData('fs/0/used', function(data) { updateElement('disk-used', Math.round(parseInt(data))); });\n\n getData('network/transmit/eth0', function(data) { updateElement('network-transmit-eth0', Math.round(parseInt(data))); });\n getData('network/receive/eth0', function(data) { updateElement('network-receive-eth0', Math.round(parseInt(data))); });\n\n getData('network/transmit/wlan0', function(data) { updateElement('network-transmit-wlan0', Math.round(parseInt(data))); });\n getData('network/receive/wlan0', function(data) { updateElement('network-receive-wlan0', Math.round(parseInt(data))); });\n\n } else {\n // Server is offline, clear dash.\n \n $('#connection-online').addClass('hidden');\n $('#connection-offline').removeClass('hidden');\n\n window.clearInterval(uptimeInterval);\n uptimeInterval = undefined;\n updateElement('server-uptime', '00:00:00');\n \n updateElement('cpu-temp', 0);\n updateElement('cpu-usage', 0);\n \n updateElement('ram-usage', 0);\n updateElement('ram-used', 0);\n \n updateElement('disk-usage', 0);\n updateElement('disk-used', 0);\n\n updateElement('network-transmit-eth0', 0);\n updateElement('network-receive-eth0', 0);\n\n updateElement('network-transmit-wlan0', 0);\n updateElement('network-receive-wlan0', 0);\n\n }\n}", "async refresh() {\n await this._poll.refresh();\n await this._poll.tick;\n }", "function doRefresh(){\n let nextUpdate = new Date();\n nextUpdate.setMinutes(nextUpdate.getMinutes() + 1);\n $('#nextUpdate').html(nextUpdate.toLocaleString());\n clearTable();\n loadDefaults();\n}", "function refresh() {\n scheduleRefresh(editor.value, output);\n}", "function timedRefresh(timeoutPeriod) {\n setTimeout(update,timeoutPeriod);\n}", "function mainLoop() {\n\tupdateTicker(false);\n\tsetInterval(function(){ startUpdating(); }, 60*1000); // Recheck every minute (should be a multiple of any trading interval)\n\tupdateHistory();\n}", "function initTime() {\n nowTime = setInterval(function () {\n $timer.text(`${second}`)\n second = second + 1\n }, 1000);\n}", "function reloadData() {\n if (typeof (CPData) != \"undefined\") { CPData.regenerate(); }\n if (typeof (CPDataSoon) != \"undefined\") { CPData.regenerate(); }\n if (typeof (CPDataDownloaded) != \"undefined\") { CPData.regenerate(); }\n loadInfo();\n }", "function autoRefresh() {\n counter++\n if (counter === 15) {\n printQuote();\n counter = 0;\n }\n}", "function sched_all() {\n setInterval(\n function() {\n resetQPSRates();\n resetBPSRates();\n resetConnectionQuota();\n },\n refreshInterval*1000\n );\n sched_refresh_global();\n}", "function updateWatch() {\n updateTime();\n }", "function update(){\r\n updateBackground();\r\n //extractData();\r\n loop();\r\n // checkStatus();\r\n \r\n}", "function init() {\n\n// reset();\n lastTime = Date.now();\n main();\n }", "function refresh() {\nsetInterval(\"location.reload()\",1000);\n}", "function populateTplTimer(tweets) {\n setInterval(function(){ \n populateTpl(tweets)}, 3000); // Update this timer to change how often you want the tweets to update\n}", "function init() {\n loadOrders();\n setInterval(loadOrders,30000); //Check every thirty seconds\n }", "function reload() {\n initialize();\n }", "async function refresh() {\n _log('Refreshing environment settings')\n refreshSyncOnly()\n\n const packages = getSetting('Packages')\n const dependencies = getSetting('Dependencies')\n\n if (packages.length && dependencies.length) {\n settings.Packages = packages\n settings.Dependencies = dependencies\n _log('Using cached values')\n return\n }\n _log('Fetching new package information')\n await findPackages()\n}", "function autoupdate_for_sgd() {\n if (interval_set == true) {\n window.clearInterval(sgd_timer_interval);\n interval_set = false;\n } else {\n sgd_timer_interval = window.setInterval(update_for_sgd,0) ; \n interval_set = true;\n }\n \n}", "function changeRefreshInterval(){\n\t// Update resolution\n\tresolution = document.getElementById(\"refresh_rate\").value;\n\t// Stop current redraw interval\n\tclearInterval(interval);\n\t\n\t// Settings Update for Decay Mode\n\tif(DECAY_MODE){\n\t\tlow_value_decay = resolution / 1000;\n\t\tdecay_modifier = resolution / 1000;\n\t\t\n\t\t// Sets redraw interval\n\t\tinterval = setInterval(decayTick, resolution);\t\t\n\t}\n\t// Settings Update for Window Mode\n\telse{\n\t\ttime_range = document.getElementById(\"window_range\").value;\n\t\t// Reinitialize windows\n\t\thist_length = Math.floor(time_range / resolution); \n\t\tgather_window = new Array();\n\t\tcurrent_sum = new Array();\n\t\thist_window = new Array();\n\t\tvar i;\n\t\tfor(i = 0; i < hist_length; i++){\n\t\t\thist_window.push([['null','null', 0]]);\n\t\t}\n\t\t\n\t\t// Sets rotation interval\n\t\tinterval = setInterval(rotateWindow, resolution);\n\t}\n\t\n\n}", "function refreshGame() {\n //Reset timer and variables\n clearTimer();\n //Reset card selections / moves / UI\n clearCards();\n //Clean up stars and show all\n clearStars();\n //Create new deck and shuffle to UI\n createDeck();\n }", "function reload_later(interval_seconds)\n{\n setTimeout(check_server_and_reload, (interval_seconds * 1000));\n}", "function RefreshAll(){\r\n\tResetApp();\t//init.js\r\n\tGrabDOM();\t//grabDOM.js\r\n}", "function reloadMechanics(){\n reload = 10;\n}", "async function continuousRefresh() {\n\t// get the dns details\n\ttry {\n\t\tvar backends = \"\";\n\t\tconst records = await lookup(serviceHost);\n\t\trecords.forEach((item, index) => {\n\t\t\tbackends = backends + \"ftp://\" + item.name + \":\" + item.port + \" \";\n\t\t});\n\t\tvar newConfig = config.replace(/%BACKENDS%/, backends);\n\t\tif(currentConfig == newConfig) {\n\t\t\tlogger.info(\"No config change detected\");\n\t\t} else {\n\t\t\tlogger.info(\"Config has changed, reloading proftpd...\");\n\t\t\tcurrentConfig = newConfig;\n\t\t\tfs.writeFileSync(\"/etc/proftpd.conf\", newConfig);\n\t\t\texec(\"killall -1 proftpd\").unref();\n\t\t}\n\t\thaveConfig = true;\n\t\tnumFailures = 0;\n\t\tsetTimeout(continuousRefresh, sleepTime);\n\t} catch(err) {\n\t\tlogger.error(\"Hit error while trying to get SRV record\");\n\t\tlogger.error(err);\n\t\tif(!haveConfig) {\n\t\t\tlogger.error(\"Exiting as we've not been able to create a config\");\n\t\t\tprocess.exit(1);\n\t\t}\n\t\tnumFailures++;\n\t\tsetTimeout(continuousRefresh, sleepTime);\n\t}\n}", "refresh()\n\t{\n\t}", "async function reloadEverything() {\n reloadDebounced();\n}", "async function refresher(msg) {\n for (let i of initPaths)\n if (!existsSync(i)) mkdirSync(i)\n const time = new Date(`${new Date().getFullYear()}-${new Date().getMonth() + 1}-${new Date().getDate() + 1}`)\n setTimeout(async () => {\n statdb.refreshAllStat()\n .then(() => msg.static().log.modLog('osubot initializer', 'Refreshed user status'))\n setInterval(async () => {\n statdb.refreshAllStat()\n .then(() => msg.static().log.modLog('osubot initializer', 'Refreshed user status'))\n }, 86400000)\n }, time.getTime() - Date.now())\n}", "function reset(){\n GMvariables.devil = false;\n GMvariables.interval = 2000;\n GMvariables.timerSecs = 2; \n GMvariables.points = 0;\n GMvariables.live = 10;\n}", "function refreshWeather() {\n\tif (timer2 > 0) {\n\t\ttimer2--;\n\t\treturn;\n\t}\n\tlog(\"Refreshing Weather\");\n\tvar url = 'https://api.openweathermap.org/data/2.5/weather?lat='+settings.openWeather.lat+'&lon='+settings.openWeather.lon+'&appid=' + settings.openWeather.apiKey;\n\trequest(url, { json: true }, function(err, res, body) {\n\t\tif (err) { \n\t\t\treturn log(err);\n\t\t}\n\t\tvar shouldClose = false;\n\t\tif (!body.weather) {\n\t\t\tlog(JSON.stringify(body));\n\t\t\treturn;\n\t\t}\n\t\tbody.weather.forEach( function(wo) {\n\t\t\tif (shouldClose) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tswitch(parseInt(wo.id/100)) {\n\t\t\t\tcase 2:\n\t\t\t\tcase 3:\n\t\t\t\tcase 5:\n\t\t\t\tcase 6:\n\t\t\t\t\tshouldClose = true;\n\t\t\t}\n\n\t\t\tif (wo.id % 10 == 0) {\n\t\t\t\t// light\n\t\t\t\tif (body.wind.speed < 10) {\n\t\t\t\t\t// low speed\n\t\t\t\t\tshouldClose = false;\n\t\t\t\t}\n\t\t\t} else if (wo.id % 10 == 1) {\n\t\t\t\t// normal\n\t\t\t\tif (body.wind.speed < 5) {\n\t\t\t\t\t// low speed\n\t\t\t\t\tshouldClose = false;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\n\t\tif (shouldClose) {\n\t\t\ttimer2 = 6*60/5;\n\t\t\tObject.keys(settings.shutters).forEach(function(shutter) {\n\t\t\t\tsetShutterLevel(shutter, 0, false);\n\t\t\t});\n\t\t}\n\n\t});\n}", "async reload() {}", "function reloadSensorsData() {\r\n $.getJSON(\"http://weather.luway.ru:8888/sensors.json\", function(data){\r\n if ( data.success ) {\r\n if (cfg.outside.temp) otpc.update(data.list[cfg.outside.tname]/0.35);\r\n if (cfg.outside.hum) ohpc.update(data.list[cfg.outside.hname]);\r\n if (cfg.inside.temp) itpc.update(data.list[cfg.inside.tname]/0.35);\r\n if (cfg.inside.hum) ihpc.update(data.list[cfg.inside.hname]);\r\n } else {\r\n if (cfg.outside.temp) otpc.update(0);\r\n if (cfg.outside.hum) ohpc.update(0);\r\n if (cfg.inside.temp) itpc.update(0);\r\n if (cfg.inside.hum) ihpc.update(0);\r\n }\r\n });\r\n\r\n}", "function setAutomaticRefresh(sec) {\n window.clearTimeout(timeOut);\n timeOut = window.setTimeout(printQuote, sec * 1000);\n}", "function onRefresh3() {\n\tconfig3.data.datasets.forEach(function (dataset) {\n\t\tdataset.data.push({\n\t\t\tx: Date.now(),\n\t\t\ty: powerGenerate_real_3\n\t\t});\n\t});\n}", "function mainTick(){\n updatePage(new Date());\n}", "function hardRefresh(reccTempo, limitUpdate = true) { // Refresh changes to the entire MIDI\n\tupdateUI(limitUpdate, reccTempo);\n\tsoftRefresh(false, true);\n}", "function refreshTokens()\n{\n oauth2Client.refreshAccessToken();\n setTimeout( refreshTokens, 25 * 60 * 1000 );\n}", "function updateGlobalTime(){\r\n gl.useProgram(program2);\r\n globalTimeLoc = gl.getUniformLocation(program2,\"globalTime\");\r\n globalTime += 1/60;\r\n gl.uniform1f(globalTimeLoc, globalTime);\r\n}", "function load() {\n moment.locale(config.api.lang);\n\n if (getApiParams() === null) window.location = \"./config\";\n\n refreshCurrentWeather();\n setInterval(function() { refreshCurrentWeather(); }, config.pollTime.currentWeather);\n\n refreshForecastWeather();\n setInterval(function() { refreshForecastWeather(); }, config.pollTime.forecastWeather);\n \n refreshDateTime();\n setInterval(function() { refreshDateTime(); }, config.pollTime.dateTime);\n\n refreshVersion();\n setInterval(function() { refreshVersion(); }, config.pollTime.version);\n\n // We just loaded the config, so we don't need to refresh right now\n setInterval(function() { refreshConfig(); }, config.pollTime.config);\n \n clearScreenLoop();\n rotate();\n setRem(\"load\");\n setNightMode();\n}", "function refreshTimer () {\n\n if (variables.timeOutId) {\n elements.timer.className = ''\n window.clearTimeout(variables.timeOutId)\n }\n startTimer()\n}", "function refresh() {\n if (underTest) return; // Don't run if just unit testing.\n\n // Do a nmap discovery scan to get IPs and MAC addresses.\n // !IMPORTANT! On Linux, you must run node as root/sudo or the nmap output won't include mac addresses.\n console.log(\"Running nmap...\");\n var output = \"\";\n var nmap = spawn(\"nmap\", [\"-sn\", \"192.168.1.0/24\"]);\n nmap.stdout.on('data', function(data) {\n output += data;\n });\n nmap.on('exit', function(code) {\n if (code != 0) {\n console.error(\"Nmap failed: \" + code);\n return;\n }\n console.log(output);\n output = parseNMapOutput(output);\n\n // Update existing list with new info.\n synchList(output);\n\n // Persist the refreshed list to disk.\n persistList();\n\n // Schedule this refresh for every 5 minutes, if not already done.\n // TODO: Should externalize the refresh timer!\n if (timer === undefined) {\n console.log(\"Setting timer...\");\n timer = setInterval(function() {\n refresh();\n }, refreshInterval);\n }\n });\n}", "function refresh(){\n setUpdate(!update)\n }", "startPeriodicRefresh() {\n setTimeout(() => {\n\n if (this.dataNeedsRefresh) {\n this.processData();\n this.dataNeedsRefresh = false;\n }\n\n this.startPeriodicRefresh();\n }, this.DATA_PROCESSING_REFRESH_WAIT_PERIOD);\n }", "function timer() {\r\n\ttimerId = window.setInterval(\"updateTime()\", 1000);\r\n}" ]
[ "0.6916931", "0.6825754", "0.6821909", "0.66755337", "0.6561338", "0.6559765", "0.6549051", "0.6519118", "0.6498947", "0.647729", "0.646576", "0.6455169", "0.6413914", "0.64119446", "0.6408904", "0.63957936", "0.63896096", "0.63820535", "0.6362571", "0.6340827", "0.6308774", "0.6308774", "0.6305165", "0.62864983", "0.6285593", "0.6280998", "0.62299234", "0.6222172", "0.6211947", "0.6180835", "0.6165598", "0.6150992", "0.6150545", "0.61423", "0.6129675", "0.61274546", "0.6109078", "0.6105006", "0.6091194", "0.60832334", "0.60755295", "0.6065616", "0.6057091", "0.6056138", "0.6052271", "0.60513574", "0.60356545", "0.6027129", "0.6012055", "0.60075945", "0.5995676", "0.59945166", "0.5989348", "0.5985225", "0.5980824", "0.59659547", "0.59578097", "0.5953351", "0.59501976", "0.5940385", "0.59293336", "0.5927811", "0.59179646", "0.5916024", "0.59134597", "0.59096617", "0.59046495", "0.5903372", "0.5902912", "0.5897911", "0.5897296", "0.5897099", "0.589687", "0.5891766", "0.58839726", "0.5878331", "0.5878225", "0.5877539", "0.5875477", "0.58745646", "0.587392", "0.58694166", "0.5868487", "0.586722", "0.58643675", "0.5864086", "0.5860679", "0.58500284", "0.5846147", "0.5840984", "0.5840864", "0.5836435", "0.58338076", "0.5830636", "0.58188814", "0.5816322", "0.5814218", "0.5808091", "0.5808037", "0.5806656" ]
0.6925086
0
Schedule reset and refresh global
function sched_all() { setInterval( function() { resetQPSRates(); resetBPSRates(); resetConnectionQuota(); }, refreshInterval*1000 ); sched_refresh_global(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sched_refresh_global() {\n setTimeout(function() {\n client.get('refresh_interval', function(err, reply) {\n refreshInterval = reply;\n });\n\n client.lrange('op-qps', 0, -1, function(err, ops) {\n qpsOps = ops;\n });\n\n client.lrange('op-bps', 0, -1, function(err, ops) {\n bpsOps = ops;\n });\n\n client.lrange('op-total', 0, -1, function(err, ops) {\n totalOps = ops;\n });\n\n client.lrange('apps', 0, -1, function(err, appList) {\n apps = appList;\n });\n\n sched_refresh_global();\n }, 2000);\n}", "scheduleRefresh() {}", "scheduleRefresh() {}", "resetSchedule() {\n this._scheduler.resetSchedule();\n }", "function reset () {\n stopTimerAndResetCounters();\n setParamsAndStartTimer(currentParams);\n dispatchEvent('reset', eventData);\n }", "restartRechargeTimers(){\n this._units.forEach((unit) => {\n unit.restartRechargeTimer();\n });\n this._rechargedUnitsMap.clear();\n }", "reset() {\n show(cacheDOM.setButton);\n hide(cacheDOM.setDisplay, cacheDOM.snoozeButton, cacheDOM.stopButton);\n this.alarm.hours = 0;\n this.alarm.minutes = 0;\n this.alarm.isSet = false;\n }", "function refreshTimer() {\n $scope.refreshJobStatus();\n }", "function reset() {\n Consts.stockTime = 0;\n Consts.currStatus = Status.stopped;\n clearInterval(incrementSecondMethod);\n $('#statusToggle').val('Start');\n}", "function reset() {\n clearInterval(interval);\n able_start_button();\n able_stop_button();\n $.post(\n '/server/index.php',\n { action : 'timer_reset' }\n );\n sedonds = 0;\n ss.html('00');\n mm.html('00');\n hh.html('00');\n }", "function scheduleRefresh() {\n\tif (refreshEvent) {\n\t\tclearTimeout(refreshEvent);\n\t}\n\trefreshEvent = setTimeout(function() {refresh(); refreshEvent = null;}, refreshDelay);\n}", "function initTimer() {\n Consts.stockTime = 0;\n Consts.currStatus = Status.init;\n initRefresh = setInterval(refreshClock, 1);\n}", "async resetState() {\n await this.pupPage.evaluate(() => {\n window.Store.AppState.phoneWatchdog.shiftTimer.forceRunNow();\n });\n }", "function doRefresh(){\n let nextUpdate = new Date();\n nextUpdate.setMinutes(nextUpdate.getMinutes() + 1);\n $('#nextUpdate').html(nextUpdate.toLocaleString());\n clearTable();\n loadDefaults();\n}", "reset() {\n this.timer = 5000;\n this.interval = 0;\n }", "function resetTimer() {\n if( cancelTimer ) {\n cancelTimer();\n cancelTimer = null;\n }\n if( start && Date.now() - start > maxWait ) {\n if(!runScheduledForNextTick){\n runScheduledForNextTick = true;\n utils.compile(runNow);\n }\n }\n else {\n if( !start ) { start = Date.now(); }\n cancelTimer = utils.wait(runNow, wait);\n }\n }", "function resetTimer() {\n if( cancelTimer ) {\n cancelTimer();\n cancelTimer = null;\n }\n if( start && Date.now() - start > maxWait ) {\n if(!runScheduledForNextTick){\n runScheduledForNextTick = true;\n utils.compile(runNow);\n }\n }\n else {\n if( !start ) { start = Date.now(); }\n cancelTimer = utils.wait(runNow, wait);\n }\n }", "function Reset() {\n Set_Minutes(Reset_Val)\n Set_Seconds(0)\n}", "function refresh() {\n $element.addClass('mos-refreshing');\n move(options.distanceToRefresh);\n\n var promise = dispatch('onRefresh');\n if (promise && promise.then) {\n promise.then(function() {\n reset();\n });\n }\n\n }", "function resetSchedulerState() {\n\t queue.length = 0;\n\t has$1 = {};\n\t if (process.env.NODE_ENV !== 'production') {\n\t circular = {};\n\t }\n\t waiting = flushing = false;\n\t}", "reset() {\n this.timer = 500;\n this.interval = 0;\n }", "reset() {\n this.interval = 1000;\n }", "function resetSchedulerState () {\n\t queue.length = 0;\n\t has$1 = {};\n\t if (process.env.NODE_ENV !== 'production') {\n\t circular = {};\n\t }\n\t waiting = flushing = false;\n\t}", "function resetSchedulerState () {\n\t queue.length = 0;\n\t has$1 = {};\n\t if (process.env.NODE_ENV !== 'production') {\n\t circular = {};\n\t }\n\t waiting = flushing = false;\n\t}", "function resetSchedulerState () {\n\t queue.length = 0\n\t has$1 = {}\n\t if (process.env.NODE_ENV !== 'production') {\n\t circular = {}\n\t }\n\t waiting = flushing = false\n\t}", "function ServerResetAll(data) {\n console.log('Reset System');\n document.forms[0].submit();\n// location.reload();\n }", "function resetSchedulerState() {\n queue.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "function resetSchedulerState () {\n queue.length = 0;\n has$1 = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "function resetSchedulerState () {\n queue.length = 0;\n has$1 = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "function setTimers()\n{\n\ttimeID = window.setTimeout( \"updateAll()\", refreshRate );\n}", "function manualSchedule() {\r\n streamController_.manualSchedule();\r\n }", "function refresh() {\n setTrigger(trigger + 1)\n }", "function resetSchedulerState () {\n queue.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "function resetSchedulerState () {\n queue.length = 0;\n has = {};\n if (process.env.NODE_ENV !== 'production') {\n circular = {};\n }\n waiting = flushing = false;\n}", "static reset() {\n this._activeTask = undefined;\n this._tasks = new Map();\n }", "function resetToInit(){\n updateCurrentState(INIT);\n customModeUiUpdate();\n updateClock(mode.work);\n timer.init(mode.work, updateClock, startReminder);\n}", "function reset() {\n\nstart();\n\n}", "refresh() {\n this.hours.refresh();\n this.minutes.refresh();\n this.amPm.refresh();\n }", "function scheduleRequest() {\n js_logger_1.default.info('schedule refresh alarm to 30 minutes...');\n chrome.alarms.create('refresh', { periodInMinutes: 2 });\n}", "function reset()\n{\n\tneedsReset = 1;\n\t\n\t/*\n\tpost(\"Setting needsReset\");\n\tpost();\n\t*/\n}", "function timeReset() {\n setTimeout(resetAll, 2000);\n}", "function resetTimer(){\n\n time = 31;\n }", "function setUpDailyReset(){\n\t$.getJSON('https://api.warframestat.us/xb1/sortie', function(data) {\n\t\t$('#Daily').empty();\n\t\tvar sortieEnd = new Date(data.expiry); //gives tomorrows date 9 am\n\t\tvar today = new Date();\n\n\t\t$('#Daily').append(\"<div id =\\\"wrap\\\"><p id =\\\"white\\\">Time till Daily Reset:</p><p class = \\\"dailyTimer\\\" id=\\\"dailyResetTimer\\\">...</p></div>\");\n\t\tvar timer = \"dailyResetTimer\"\n\t\t//before reset\n\t\tif(sortieEnd - today > 57600000){ //16hrs till next sortie reset then the math changes\n\t\t\tsetTimer(sortieEnd,timer, -57600000, \"active\")\n\t\t}else{ //after reset\n\t\t\tsetTimer(sortieEnd, timer, 28800000, \"active\");\n\t\t}\n\t});\t\n}", "restart(){\n this.initialize_values();\n }", "function dashboardUpdateAll() {\n\t\tdashboardSet('stars', whiteStar + whiteStar + whiteStar);\n\t\tdashboardSet('tally', 0);\n\t\tdashboardSet('reset', semicircleArrow);\n\t\tdocument.getElementsByClassName('current-timer')[0].innerHTML = \"00:00\";\n}", "function resetAll() {\n\t\ttimers.forEach(function(timer){\n\t\t\ttimer.reset();\n\t\t});\n\t\tcrewSet();\n\t\tloadCrews();\t\t\n\t\tstation2.noCrew();\n\t\tstation3.noCrew();\t\t\n\t\t$(\"#next\").prop(\"disabled\", false);\n\t\t$(\"#go\").prop(\"disabled\", false);\n\t\t$(\".play\").prop(\"disabled\", false);\n\t\t$(\"#pauseAll\").prop(\"disabled\", true);\t\n\t\t$(\"#add-min-button\").prop(\"disabled\", false);\t\n\t}", "function refresh() {\n }", "resetProgram() {\n this.checkForIntervalId();\n this.stateHistory.reset();\n }", "function refreshOff()\n{\n clearInterval(refreshInterval);\n}", "function refreshPage() {\n // we're on the scheduled page and there is a scheduled date (ie not cancellation)\n // and calendar view is active and the scheduledDateTime is not on the calendar\n // force calendar to go to the new scheduled date\n if ($('.scheduled-page').length > 0 && schedule.scheduleDateTime && $('.scheduled-page').hasClass('calendar-view') && !(moment(schedule.scheduleDateTime).isAfter($('#schedule-calendar').fullCalendar('getView').start) && moment(schedule.scheduleDateTime).isBefore($('#schedule-calendar').fullCalendar('getView').end))) {\n $('#schedule-calendar').fullCalendar('render'); // render then go to the date incase its in the current month\n $('#schedule-calendar').fullCalendar('gotoDate', schedule.scheduleDateTime);\n } else {\n sch.resetParameters();\n if (schedule.isScheduling === false && schedule.isAllScheduled === true) {\n window.location.reload(true);\n }\n }\n }", "function resetear() {\n eliminarIntegrantesAnteriores();\n ocultarbotonCalculo();\n ocultarIntegrantes();\n ocultarTextoResultado();\n vaciarValorInput();\n}", "function resetSchedulerState() {\n\t\t queue.length = 0;\n\t\t userQueue.length = 0;\n\t\t has = {};\n\t\t if (false) {\n\t\t circular = {};\n\t\t }\n\t\t waiting = false;\n\t\t}", "handleReset() {\n\n }", "_scheduleUpdate() {\n let date = new Date().getTime();\n if (date - this._lastRefresh > MIN_REFRESH) {\n this.refresh();\n }\n else {\n this._requested = true;\n }\n }", "static reset() {\n updateTimeouts.forEach(clearTimeout);\n updateTimeouts = [];\n improvedTimestampsInitted = false;\n improvedTimestamps = [];\n }", "function scheduleRestoreDefaults() {\n let d = new Date();\n let currentHour = d.getHours();\n console.log('currentHour = '+currentHour);\n if (currentHour == 3) {\n RestoreDefaultDataInMongoDB()\n .then(() => {\n console.log('RESTORED DEFAULTS 11122');\n }); \n }\n console.log('BEFORE TIMEOUT');\n setTimeout(scheduleRestoreDefaults, 60 * 60 * 1000); // for demo purposes updates every minute\n}", "function reset() {\n setSeconds(0);\n setIsActive(false);\n }", "function resetCountdown() {\r\n location.reload()\r\n}", "function resetSchedulerState () {\n queue.length = 0;\n has$1 = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "function resetSchedulerState () {\n queue.length = 0;\n has$1 = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "function resetSchedulerState () {\n queue.length = 0;\n has$1 = {};\n {\n circular = {};\n }\n waiting = flushing = false;\n}", "function resetSchedulerState() {\n index = queue.length = 0;\n has = {};\n}", "static refresh() {\n\t\t// AppEventEmitter.emit('login.refresh');\n\t\tAppEventEmitter.emit('homepage.refresh');\n\t\tAppEventEmitter.emit('sidemenu.refresh');\n\t}", "function refreshOn()\n{\n refreshInterval = setInterval(function () {refresh()}, 1000);\n}", "function resetTimer() {\n dashboardTimer = setInterval(function() {\n gridcells.forEach(gridcell => {\n if(gridcell.graph) {\n if(gridcell.graphType == 'Linechart') {\n if(dashboardIsOnline) {\n gridcell.graph.getData(undefined, false);\n } else {\n gridcell.graph.getData(undefined, true);\n }\n } else if(gridcell.graphType == 'Gauge') {\n gridcell.graph.getData(false);\n }\n }\n });\n setCurrentDateAndTime();\n }, refreshSettings.time);\n}", "function globalReset () {\n\t\t\t// Reset Modal GUI:\n\t\t\tglob.domObjects.$modalBox.empty();\n\t\t\tglob.domObjects.$errorModalBox.empty().hide();\n\t\t\t// Reset vars:\n\t\t\tglob.curr = {\n\t\t\t\tnewTemplate: false,\n\t\t\t\tparamDomElements: {},\n\t\t\t\tparamsJson: {}\n\t\t\t};\n\t\t}", "function scheduleSyncs() {\n\tif (global_pref_list_sync.enabled) {\n\t\tvar alarm_name = \"update_all:\" + global_alarm_timestamp;\n\t\tchrome.alarms.create(alarm_name, { periodInMinutes: global_pref_list_sync.interval });\n\t}\n}", "function reset() {\n if (currentTimer == \"Session\") {\n sessionSeconds = tempoarySessionSeconds;\n seconds_left = sessionSeconds;\n } else if (currentTimer == \"Long Break\") {\n longBreakSeconds = tempoaryLongBreakSeconds;\n seconds_left = longBreakSeconds;\n } else {\n shortBreakSeconds = tempoaryShortBreakSeconds;\n seconds_left = shortBreakSeconds;\n }\n seconds_left += 1;\n clearInterval(interval);\n intervalManager(true, doTheInterval); // for setInterval\n\n\n}", "function resetSchedulerState () {\n\t queue.length = 0;\n\t has$1 = {};\n\t {\n\t circular = {};\n\t }\n\t waiting = flushing = false;\n\t}", "function reset(){\n GMvariables.devil = false;\n GMvariables.interval = 2000;\n GMvariables.timerSecs = 2; \n GMvariables.points = 0;\n GMvariables.live = 10;\n}", "function resetSchedulerState(){queue.length=0;has$1={};{circular={};}waiting=flushing=false;}", "function resetSchedulerState () {\n queue.length = 0;\n has = {};\n if (false) {\n circular = {};\n }\n waiting = flushing = false;\n}", "function reset() {\n getService_().reset();\n}", "function reset() {\n getService_().reset();\n}", "function reset() {\n getService().reset();\n}", "function refreshShoutbox(initial, force, unsync){\n\t\n\t// Assert initial refresh will only happen once\n\tif(initial){\n\t\tif(taigachat_initialFired) \n\t\t\treturn;\n\t\ttaigachat_initialFired = true;\n\t\ttaigachat_initialTime = new Date().getTime();\n\t} else {\n\t\t// Assert we aren't refreshing within 2 seconds of the first refresh - i.e. document focus event\n\t\tif(taigachat_initialTime + 2000 > new Date().getTime() && !force)\n\t\t\treturn;\n\t}\n\t// Stop refresh spam\n\t//if(taigachat_lastRefresh + 2000 > new Date().getTime())\n\t//\t return;\t\n\t\t \n\t// Stop focus refresh spam\n\t//if(force && unsync && taigachat_lastRefresh + 6000 > new Date().getTime())\n\t//\treturn;\n\t\n\tif(taigachat_initialTime + 50 * 60 * 1000 < new Date().getTime() && !initial){\n\t\t// time for a CSRF token refresh...\n\t\tXenForo._CsrfRefresh.refresh();\n\t\ttaigachat_refreshtime = 10; \n\t\trestartTimer();\n\t\ttaigachat_initialTime = new Date().getTime();\n\t\treturn;\n\t}\n\t\n\t//taigachat_lastRefresh = new Date().getTime(); \t\n\t\t\n\t//if((XenForo._hasFocus) || force){\n\t\t\n\t\ttaigachat_isRefreshing = true;\n\t\t\n\t\tXenForo.ajax(\n\t\t\ttaigachat_speed ? taigachat_speedurl : \"index.php?taigachat/list.json\", \n\t\t\ttaigachat_speed ? {} : {\n\t\t\t\tsidebar: taigachat_sidebar ? \"1\" : \"0\",\n\t\t\t\tlastrefresh: taigachat_lastRefreshServer\n\t\t\t}, \n\t\t\tfunction(json, textStatus){\t\t\t\t\n\t\t\t\t\n\t\t\t\ttaigachat_isRefreshing = false;\n\t\t\t\t\n\t\t\t\tif (XenForo.hasResponseError(json))\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\thandleListResponse(json, initial, unsync);\n\t\t\t\t\t\t\t\n\t\t\t\tif(initial){ \n\t\t\t\t\t//taigachat_refreshTime = 5;\n\t\t\t\t\t//restartTimer();\n\t\t\t\t\tsetInterval(checkRefresh, 250);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}, \n\t\t\t{\n\t\t\t\tglobal: false, \n\t\t\t\tdataType: 'json',\n\t\t\t\tcache: false, \n\t\t\t\ttype: taigachat_speed ? 'get' : 'post',\n\t\t\t\terror: function(xhr, textStatus, errorThrown){\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tsuccess.call(null, $.parseJSON(xhr.responseText), textStatus);\n\t\t\t\t\t}\n\t\t\t\t\tcatch (e)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(initial){\n\t\t\t\t\t\t\tsetInterval(checkRefresh, 250);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// workarounds :3\n\t\t\t\t\t\tif(xhr.responseText.substr(0, 1) == '{' && xhr.responseText.substr(-1) == '}')\n\t\t\t\t\t\t\tXenForo.handleServerError(xhr, textStatus, errorThrown);\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tfinally\n\t\t\t\t\t{\n\t\t\t\t\t\ttaigachat_isRefreshing = false;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t); // ajax\n\t//} // if focused etc\n\t//else {\n\t\tif(!unsync){\n\t\t\t//decayRefreshTime();\n\t\t\trestartTimer();\n\t\t}\n\t//} \n\t\n\t\n}", "function toOneSec(){\n universalReset(1);\n}", "Reset() {}", "function resetSchedulerState () {\n\t queue.length = 0;\n\t has = {};\n\t if (true) {\n\t circular = {};\n\t }\n\t waiting = flushing = false;\n\t}", "function resetSchedulerState () {\n\t queue.length = 0;\n\t has = {};\n\t {\n\t circular = {};\n\t }\n\t waiting = flushing = false;\n\t}", "function resetSchedulerState () {\n\t queue.length = 0;\n\t has = {};\n\t {\n\t circular = {};\n\t }\n\t waiting = flushing = false;\n\t}", "function reset () {\n noty.clear();\n resetTimeout();\n }", "function resetTimer () {\n timerRunning = false;\n clearInterval(clockInterval);\n clearInterval(wpmInterval);\n}", "function reload_timeout_trigger(){\n \n}", "refresh() {\n this.reset();\n this.loadNext();\n }", "async refresh() {\n await this._poll.refresh();\n await this._poll.tick;\n }", "function reset(){\r\n\tclearInterval(id_call);\r\n\tinit_game();\r\n}", "function resetTimer() {\n clearInterval(liveTimer);\n }", "function refreshUIBits() {\n try {\n getMinimonth().refreshDisplay();\n\n // refresh the current view, if it has ever been shown\n var cView = currentView();\n if (cView.initialized) {\n cView.goToDay(cView.selectedDay);\n }\n\n if (!TodayPane.showsToday()) {\n TodayPane.setDay(now());\n }\n\n // update the unifinder\n refreshEventTree();\n } catch (exc) {\n ASSERT(false, exc);\n }\n\n // schedule our next update...\n scheduleMidnightUpdate(refreshUIBits);\n}", "resetInterval()\n {\n this.incrementTimeDur = 60000;\n clearInterval(this.secChange);\n this.secChange = setInterval(this.timeIncrement, this.incrementTimeDur);\n }", "refresh()\n\t{\n\t}", "function execRequest() {\n setInterval(handleRefresh, 3000);\n}", "function autoRefresh() {\n if(typeof CACHE_TIME_INTERVAL === 'number') {\n var seconds = CACHE_TIME_INTERVAL * 1000;\n } else {\n var seconds = 60000;\n }\n window.setInterval(function() {\n serverRPS.startSearch();\n productServers.startSearch();\n }, seconds);\n }", "refresh(){\n this.workers = new Map();\n this.taskQueue = [];\n }", "function configureRun() {\n //remove triggers\n configureStop();\n //add new trigger - run every hour\n ScriptApp.newTrigger('fillAllItemsData').timeBased().everyHours(1).create();\n}", "function resetTimers() {\n startTime = new Date;\n startTime.setHours(0);\n startTime.setMinutes(0);\n startTime.setSeconds(0);\n startTime.setMilliseconds(0);\n \n stopTime = new Date;\n stopTime.setHours(config.timer.hour);\n stopTime.setMinutes(config.timer.minute);\n stopTime.setSeconds(0);\n stopTime.setMilliseconds(0);\n }", "function setRefresh () {\n setInterval( function() {window.location.reload();}, 20000);\n}", "refreshAllResourcesWhenReady() {\n this.clearAll();\n this.refreshAllWhenReady = true;\n }", "handleRefresh() {\n this.updateToday();\n }", "function reClock() {\n self.clock();\n }" ]
[ "0.7460981", "0.73237044", "0.73237044", "0.72612077", "0.6795095", "0.6535646", "0.6525502", "0.6495455", "0.64361024", "0.63936114", "0.6358318", "0.6345908", "0.6344723", "0.6324688", "0.6303937", "0.6299245", "0.6299245", "0.6286268", "0.62667626", "0.6265286", "0.6259451", "0.6257584", "0.6238135", "0.6238135", "0.62337583", "0.6219928", "0.6209023", "0.61866766", "0.61866766", "0.6176727", "0.61736387", "0.61718124", "0.6167749", "0.6167749", "0.6167651", "0.6155387", "0.6146704", "0.61414075", "0.61292386", "0.6111112", "0.61025465", "0.60819423", "0.6079561", "0.607201", "0.60683435", "0.60675544", "0.6058298", "0.60576814", "0.6029035", "0.6023022", "0.6018553", "0.6018417", "0.6016317", "0.600882", "0.60068256", "0.6005431", "0.59998417", "0.5999814", "0.5995794", "0.5995794", "0.5995794", "0.59821486", "0.5973405", "0.59687185", "0.5958394", "0.5956852", "0.5951467", "0.59504884", "0.5949753", "0.5941498", "0.59387964", "0.5933611", "0.59291524", "0.59291524", "0.5927486", "0.5921565", "0.5917041", "0.5915786", "0.5912599", "0.5912501", "0.5912501", "0.5909055", "0.59054166", "0.5904519", "0.59039617", "0.5901123", "0.58956355", "0.58951455", "0.5890559", "0.5888078", "0.58782655", "0.5873331", "0.58725107", "0.5865406", "0.58602047", "0.585564", "0.5855281", "0.5854377", "0.5852515", "0.5842484" ]
0.73144734
3
distribute capacity evenly among apps capacity: capacity to distribute apps: apps to receive distributed capacity op: operation capacities: origin capacities of apps
function distributeCapacityEvenly(capacityPrefix, capacity, apps, op, capacities) { var extra = Math.floor(Math.abs(capacity/apps.length)); if(capacity < 0) extra = -1*extra; // luckApp is randomly picked up app to receive the remaining capacity, // example: capacity = 3, #app is 2, each of which gets 1, luckyApp get remaining 1 log('debug', 'redistributing capacity '+capacity+' among '+apps.toString()+'-'+op); if(extra != 0) { for(var appi = 0; appi < apps.length; appi++) { var app = apps[appi]; var newCapacity = capacities[app][op]+extra; setCapacity(capacityPrefix, app, op, newCapacity, capacities); } } if(capacity%apps.length == 0) return; else { var luckyApp = apps[0]; var newCapacity = capacities[luckyApp][op]+capacity%apps.length; setCapacity(capacityPrefix, luckyApp, op, newCapacity, capacities); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deductCapacity(prefix, total, apps, belowCapacities, op, capacities) {\n log('debug', 'deduct capacity '+total+' from '+apps.toString()+'-'+op);\n if(total == 0) return ;\n for(var appi = 0; appi < apps.length; appi++) {\n var app = apps[appi];\n var spare = belowCapacities == null ? capacities[app][op] :capacities[app][op]-belowCapacities[app][op];\n\n if(total > spare && spare != 0) {\n log('debug', 'deduct capacity '+spare+' from '+app+'-'+op);\n var newCapacity = capacities[app][op]-spare;\n setCapacity(prefix, app, op, newCapacity, capacities);\n total -= spare;\n }\n else {\n log('debug', 'deduct capacity '+total+' from '+app+'-'+op);\n var newCapacity = capacities[app][op]-total;\n setCapacity(prefix, app, op, newCapacity, capacities);\n break ;\n }\n }\n}", "get capacity () {return this._pool.length;}", "function get_available_capacity(capacity) {\n if (capacity) {\n return 1;\n } else {\n return 0;\n }\n }", "function knapSack(capacity, values, weights) {\n var n = values.length,\n load = 0,\n i = 0,\n val = 0;\n\n for (i=0; i<n && load < capacity; i++) { //While the total load is less than the capacity, we will iterate the items\n //If we can use the total weight of the item, then we will add it to the total value (val) and update the current load of the knapsack\n if (weights[i] <= (capacity-load)) {\n val += values[i];\n load += weights[i];\n console.log('using item ' + (i+1) + ' for the solution');\n } else {\n //If we cannot use the total weight of the item, we will calculate what is the ratio (r) that we can use\n var r = (capacity-load)/weights[i]; \n val += r * values[i];\n load += weights[i];\n console.log('using ratio of ' + r + ' for item ' + (i+1) + ' for the solution');\n }\n }\n return val;\n}", "function calculateNewValue(usedCapacity, provisionedCapacity, conf) {\r\n\tnewValue = provisionedCapacity;\r\n\tusedPercent = Math.ceil(usedCapacity / provisionedCapacity * 100);\r\n\tif (usedPercent > conf.increaseAbovePercent) {\r\n\t\tnewValue = Math.ceil(provisionedCapacity * (1 + conf.increaseByPercent / 100));\r\n\r\n\t\t// If more capacity is used than is available\r\n\t\t// base new value on used capacity instead of\r\n\t\t// provisioned capacity to prevent throttling\r\n\t\tif (usedPercent > 100) {\r\n\t\t\tnewValue = Math.ceil(usedCapacity * (1 + conf.increaseByPercent / 100));\r\n\t\t}\r\n\t} else if (usedPercent < conf.decreaseBelowPercent) {\r\n\t\tnewValue = Math.ceil(provisionedCapacity * (1 - conf.decreaseByPercent / 100));\r\n\r\n\t\tif(usedPercent == 0) {\r\n\t\t\tnewValue = conf.min;\r\n\t\t}\r\n\t}\r\n\r\n\t// Bind value to minimum configured capacity\r\n\tif(newValue < conf.min) {\r\n\t\tnewValue = conf.min;\r\n\t}\r\n\r\n\t// Bind value to maximum configured capacity\r\n\tif(newValue > conf.max) {\r\n\t\tnewValue = conf.max;\r\n\t};\r\n\r\n\treturn newValue;\r\n}", "get capacity () {return this._p.capacity;}", "function setCapacity(max)\n {\n service.capacity =max;\n }", "async scaleContainer() {\n const { resource: containerDefinition } = await client\n .database(databaseId)\n .container(containerId)\n .read()\n const {resources: offers} = await client.offers.readAll().fetchAll();\n \n const newRups = 500;\n for (var offer of offers) {\n if (containerDefinition._rid !== offer.offerResourceId)\n {\n continue;\n }\n offer.content.offerThroughput = newRups;\n const offerToReplace = client.offer(offer.id);\n await offerToReplace.replace(offer);\n console.log(`Updated offer to ${newRups} RU/s\\n`);\n break;\n }\n}", "allocate() {\n // allocate memory as per request\n this.allocation[this.processId] = sumArrays(this.allocation[this.processId], this.request)\n\n // check if allocation == max, then free the resources\n if (this.allocation[this.processId].equals(this.max[this.processId])) {\n // increase available resources\n this.available = sumArrays(this.available, this.allocation[this.processId])\n\n // set a fleag for the finished process\n this.finished[this.processId] = true\n\n // set allocation for the finished process to 0\n this.allocation[this.processId].fill(0)\n\n // set max for the finished process to 0\n this.max[this.processId].fill(0)\n }\n\n // decrease available resources\n this.available = subtractArrays(this.available, this.request)\n }", "function distribute(t) {\n var t = Math.floor(t);\n _.each(prio, function(i) {\n // army needed\n var need = _.max([t + Math.ceil(-press[i]), t]);\n // affordable, either need or stock left\n var afford = _.min([need, stock]);\n // take out, give army to node\n stock -= afford;\n // add army to your attack origin of i\n var org = attOrg[i];\n g.nodes[org].army += afford;\n });\n }", "async function deployPool(deployer, network, accounts) {\n\n let gof = new web3.eth.Contract(GOF.abi, '0x488e0369f9bc5c40c002ea7c1fe4fd01a198801c');\n let reward_account = accounts[0];\n let gas_price = 165000000000;\n\n console.log(\"[Golff] 1.Start deploy pool on Network= \" + network);\n\n await deployer.deploy(GOFGXCPool);\n await deployer.deploy(GOFHTPool);\n // await deployer.deploy(GOFLIKPool);\n // await deployer.deploy(GOFUSDTPool);\n // await deployer.deploy(GOFETHPool);\n // await deployer.deploy(GOFYFIIPool);\n \n console.log(\"[Golff] 2.Start add minter acl for pool\");\n gof.methods.addMinter(GOFGXCPool.address).send({ from: reward_account, gasPrice: gas_price, gas: 100000});\n gof.methods.addMinter(GOFHTPool.address).send({ from: reward_account, gasPrice: gas_price, gas: 100000});\n // gof.methods.addMinter(GOFUSDTPool.address).send({ from: reward_account, gasPrice: gas_price, gas: 100000});\n // gof.methods.addMinter(GOFUSDTPool.address).send({ from: reward_account, gasPrice: gas_price, gas: 100000});\n // gof.methods.addMinter(GOFETHPool.address).send({ from: reward_account, gasPrice: gas_price, gas: 100000});\n // gof.methods.addMinter(GOFYFIIPool.address).send({ from: reward_account, gasPrice: gas_price, gas: 100000});\n\n console.log(\"[Golff] 3.Start set reward distributor\");\n\n let gxc_pool = new web3.eth.Contract(GOFGXCPool.abi, GOFGXCPool.address);\n let ht_pool = new web3.eth.Contract(GOFHTPool.abi, GOFHTPool.address);\n // let link_pool = new web3.eth.Contract(GOFLIKPool.abi, GOFLIKPool.address);\n // let usdt_pool = new web3.eth.Contract(GOFUSDTPool.abi, GOFUSDTPool.address);\n // let eth_pool = new web3.eth.Contract(GOFETHPool.abi, GOFETHPool.address);\n // let yfii_pool = new web3.eth.Contract(GOFYFIIPool.abi, GOFYFIIPool.address);\n\n await Promise.all([\n gxc_pool.methods.setRewardDistribution(reward_account).send({ from: reward_account, gasPrice: gas_price, gas: 100000}),\n ht_pool.methods.setRewardDistribution(reward_account).send({ from: reward_account, gasPrice: gas_price, gas: 100000 }),\n // link_pool.methods.setRewardDistribution(reward_account).send({ from: reward_account, gasPrice: gas_price, gas: 100000 }),\n // usdt_pool.methods.setRewardDistribution(reward_account).send({ from: reward_account, gasPrice: gas_price, gas: 100000 }),\n // eth_pool.methods.setRewardDistribution(reward_account).send({ from: reward_account, gasPrice: gas_price, gas: 100000 }),\n // yfii_pool.methods.setRewardDistribution(reward_account).send({ from: reward_account, gasPrice: gas_price, gas: 100000 }),\n ]);\n\n console.log(\"[Golff] 4.Start reward Gof to pool\");\n\n let init_quota = web3.utils.toBN(10 ** 18).mul(web3.utils.toBN(40000));\n\n // await Promise.all([\n // gxc_pool.methods.notifyRewardAmount(init_quota.toString()).send({ from: reward_account, gasPrice: gas_price, gas:150000}),\n // ht_pool.methods.notifyRewardAmount(init_quota.toString()).send({ from: reward_account, gasPrice: gas_price, gas: 150000 }),\n // // link_pool.methods.notifyRewardAmount(init_quota.toString()).send({ from: reward_account, gasPrice: gas_price, gas: 150000 }),\n // // usdt_pool.methods.notifyRewardAmount(init_quota.toString()).send({ from: reward_account, gasPrice: gas_price, gas: 150000 }),\n // // eth_pool.methods.notifyRewardAmount(init_quota.toString()).send({ from: reward_account, gasPrice: gas_price, gas: 150000 }),\n // // yfii_pool.methods.notifyRewardAmount(init_quota.toString()).send({ from: reward_account, gasPrice: gas_price, gas: 150000 }),\n // ]);\n}", "function calculateChannelCapacity(keys) {\n\tvar capacity = 0;\n\tfor(var i = 0; i < keys.length; i += 1){\n\t\tcapacity += (keys[i].capacity * keys[i].frequency);\n\t}\n\t//Return amount of bytes can be held\n\t//TODO check if this should be bits\n\treturn capacity/BYTE_SIZE;\n}", "function optimalUtilization(deviceCapacity, foregroundAppList, backgroundAppList) {\n\n const optimalPairs = [];\n const optimalPairsIds = [];\n let max = 0;\n\n for (let i = 0; i < foregroundAppList.length; i++) {\n const foreApp = foregroundAppList[i];\n const foreAppId = foreApp[0];\n const foreAppMemory = foreApp[1];\n\n for (let j = 0; j < backgroundAppList.length; j++) {\n const bgApp = backgroundAppList[j];\n const bgAppId = bgApp[0];\n const bgAppMemory = bgApp[1];\n\n const pairMemory = foreAppMemory + bgAppMemory;\n\n if (pairMemory <= deviceCapacity) {\n if (max < pairMemory) {\n max = pairMemory;\n }\n\n optimalPairs.push({\n ids: [foreAppId, bgAppId],\n memory: pairMemory\n });\n }\n }\n }\n\n for (let i = 0; i < optimalPairs.length; i++) {\n const pair = optimalPairs[i];\n if (pair.memory === max) { //if memory is equal to the best optimal pair memory required\n optimalPairsIds.push(pair.ids);\n }\n }\n\n console.log(optimalPairs);\n console.log(optimalPairsIds);\n return optimalPairsIds;\n}", "function knapSack(weight,values,capacity){\n if(capacity <= 0 || !weight.length || !values.length) return 0;\n\n function traverse(index1, index2 , capacity){\n let maxVal = 0;\n if(index1 > weight.length) return 0;\n if(capacity === 0) {\n maxVal = capacity - netWeight;\n return maxVal;\n }\n if(capacity < 0){\n return;\n }\n traverse(index1, index2 + 1, values[index]+values[index+1], capacity + weight[index]);\n traverse(index1 + 1, index1 + 1, )\n\n }\n}", "async function scaleContainer() {\r\n const { resource: containerDefinition } = await client\r\n .database(databaseId)\r\n .container(containerId)\r\n .read();\r\n \r\n try\r\n {\r\n const {resources: offers} = await client.offers.readAll().fetchAll();\r\n \r\n const newRups = 500;\r\n for (var offer of offers) {\r\n if (containerDefinition._rid !== offer.offerResourceId)\r\n {\r\n continue;\r\n }\r\n offer.content.offerThroughput = newRups;\r\n const offerToReplace = client.offer(offer.id);\r\n await offerToReplace.replace(offer);\r\n console.log(`Updated offer to ${newRups} RU/s\\n`);\r\n break;\r\n }\r\n }\r\n catch(err)\r\n {\r\n if (err.code == 400)\r\n {\r\n console.log(`Cannot read container throuthput.\\n`);\r\n console.log(err.body.message);\r\n }\r\n else \r\n {\r\n throw err;\r\n }\r\n }\r\n}", "function buyWorker() {\n if (resAmount >= workerBuyCost) {\n resAmount -= workerBuyCost;\n workerAmount += 1;\n workerBuyCost += (workerAmount * 2);\n }\n}", "function calcSecurity() {\n\n // percent = balanceScore + supplyScore [%]\n var percent, balanceScore, supplyScore;\n \n balanceScore = 0.0;\n supplyScore = 0.0;\n \n // WEIGHTS SHOULD ADD UP TO 1.0\n var BALANCE_WEIGHT = 0.5;\n var SUPPLY_WEIGHT = 0.5;\n\n // Magnitude of allowed value difference before score reaches 0% (1.0 for 100% deviance; 2.0 for 200% deviance, etc)\n var TOLERANCE = 2.0;\n // Ideal %Capacity Available in Network\n var IDEAL_NETWORK_BUFFER = 0.2;\n \n var siteCapacity;\n var totalCapacity, numBackup, bufferSupply;\n var scoreCount;\n var current;\n \n // If Demand Exists; NCE's Score Counts toward Total\n scoreCount = 0;\n \n // Cycles through Each NCE\n for (var i=0; i<agileModel.activeProfiles.length; i++) {\n\n numBackup = 0.0;\n \n // Calculates NCE Capacity at each site;\n siteCapacity = new Array(agileModel.SITES.length);\n for (var s=0; s<agileModel.SITES.length; s++) {\n siteCapacity[s] = 0.0;\n for (var b=0; b<agileModel.SITES[s].siteBuild.length; b++) {\n current = agileModel.SITES[s].siteBuild[b];\n if (current.PROFILE_INDEX == agileModel.activeProfiles[i].ABSOLUTE_INDEX) {\n siteCapacity[s] += current.capacity;\n }\n }\n \n }\n \n // Calculates Total NCE Capacity\n totalCapacity = 0.0;\n for (var s=0; s<agileModel.SITES.length; s++) {\n totalCapacity += siteCapacity[s];\n }\n \n var demand = float(agileModel.activeProfiles[i].demandProfile.getString(2, min(session.current.TURN, NUM_INTERVALS-1) ));\n demand /= 1000.0; // units of kiloTons\n \n // Calaculates normalized balance and supply scores and adds them to total\n if ( demand > 0) { // Only scores if demand exists\n // If Demand Exists; NCE's Score Counts toward Total\n scoreCount ++;\n \n // Determines how many \"backup\" sites there are\n if (agileModel.SITES.length == 1) {\n // Scores Perfect if only one site\n numBackup = 1.0;\n } else {\n // assigns \"1\" if capacity exists at site\n for (var s=0; s<agileModel.SITES.length; s++) {\n if (siteCapacity[s] > 0.0) {\n numBackup += 1.0;\n }\n }\n }\n \n // normalizes balance/backup to a score 0.0 - 1.0;\n if (agileModel.SITES.length > 1) {\n numBackup -= 1.0; // Eliminates effect of first site\n numBackup /= (agileModel.SITES.length - 1);\n if (numBackup < 0.0) numBackup = 0.0;\n }\n \n // Adds the current NCE's balance score to the overall\n balanceScore += agileModel.activeProfiles[i].weightBalance * numBackup;\n \n\n // Calculate Normalized supply score and add it to total\n var sup = 0;\n bufferSupply = (1.0 + IDEAL_NETWORK_BUFFER) * demand / totalCapacity;\n if (totalCapacity == 0) {\n sup = 0.0;\n } else if (bufferSupply > 0 && bufferSupply <= 1.0) {\n sup = 1.0;\n } else if (bufferSupply > 1.0) {\n sup = TOLERANCE - bufferSupply;\n if (sup < 0.0) sup = 0;\n }\n supplyScore += agileModel.activeProfiles[i].weightSupply * sup;\n \n }\n \n }\n \n // Aggregate scores\n balanceScore /= scoreCount;\n supplyScore /= scoreCount;\n percent = BALANCE_WEIGHT * balanceScore + SUPPLY_WEIGHT * supplyScore;\n \n return percent;\n}", "get desiredCapacityInput() {\n return this._desiredCapacity;\n }", "function buyWorker(x) {\n // Stop the function if there isn't enough population capacity.\n if (meta.population >= meta.maxPopulation) {\n return;\n }\n\n if (Calc.spendResources(Calc.expensesArray(x.cost))) {\n x.total++;\n meta.population++;\n\n let res = eval(resource[x.resource]);\n res.autoIncrement += x.autoIncrement;\n\n for (iii in x.cost) {\n let obj = eval(x.cost[iii]);\n x.cost[iii] = Math.floor(obj * x.costIncrease);\n }\n }\n}", "function tableCapacity(req, res, next) { \n const { capacity } = res.locals.table;\n const { people } = res.locals.reservation;\n if (capacity >= people) {\n return next();\n } else {\n return next({\n status: 400, \n message: \"Table does not have sufficient capacity.\"\n });\n }\n}", "function knapsack(capacity, size, value, n) {\r\n\tif (n == 0 || capacity == 0) {\r\n\t\treturn 0;\r\n\t}\r\n\tif (size[n-1] > capacity) {\r\n\t\treturn knapsack(capacity, size, value, n-1);\r\n\t}\r\n\telse {\r\n\treturn max(value[n-1] +\r\n\t\tknapsack(capacity-size[n-1], size, value, n-1),\r\n\t\tknapsack(capacity, size, value, n-1));\r\n\t}\r\n}", "function updateTotalCookPerSecChain(){\n updateTotalCookPerSec();\n \n if(dist[item]){\n updateTotalDistribution();\n }\n else{\n updateTotalProduction();\n }\n \n updateTimeToGet();\n updateEfficiency();\n}", "function calcAmount(fillParam, capacityParam) {\n return fillParam * capacityParam;\n}", "run() {\n if (this.store.getFreeCapacity(RESOURCE_ENERGY) > 0 ) {\n this.harvest();\n }\n }", "function updateCost(){\n\n\t\tGraph.instance.edges.forEach(function(key,edge){\n\t\t\tstate.edgePrevCost[edge.id] = edge.resources[1];\n\t\t\tif(mainLoopCounter == 1){\n\t\t\t\tedge.edges = {\n\t\t\t\t\t\"cost\": edge.resources[1],\n\t\t\t\t\t\"cap\": edge.resources[0],\n\t\t\t\t\t\"id\": edge.id\n\t\t\t\t\t\n\t\t\t\t};\n\t\t\t}\n\t\t\t//if(edge.resources[1] > 0){\n\t\t\t\tedge.resources[1] = initialCost[edge.id] - edge.start.p + edge.end.p;\n\t\t\t//}\n\t\t\t\n\t\t});\n\t\tvar cap = [];\n\t\tfor (var i =0; i<state.edgesOfSP.length; i++){\n\t\t\t\n\t\t\tcap[i] = state.edgesOfSP[i].resources[0]-state.edgesOfSP[i].state.flow;\n\t\t\t\n\t\t}\n\t\tvar minCap = d3.min(cap);\n\t\tvar minED = Math.min(Graph.instance.nodes.get(state.sourceId).b , -Graph.instance.nodes.get(state.targetId).b);\n\t\t\n\t\tstate.current_step = STEP_APPLYPATH;\n\t\tdel = Math.min(minCap,minED);\n\t}", "adjustServerCapacity(port, size) {\n port = port.toString();\n\n if (this.servers[port] - size > 0) {\n this.servers[port] = this.servers[port] - size;\n // console.log('Port: ' + port + ' has ' + this.servers[port] + ' memory remaining.');\n return this.servers[port];\n }\n else {\n if (!this.initialized) this.servers[port] = 500;\n console.log('Port: ' + port + ' ran out of memory. Allocated ' + this.servers[port] + ' memory.');\n this.killServer(port);\n if (Object.keys(this.servers).length == 0)\n return this.servers[this.spawnServer()];\n }\n return this.servers[port];\n }", "get capacity () {\n\t\treturn this._capacity;\n\t}", "function solution(juice, capacity) {\n // write your code in JavaScript (Node.js 8.9.4)\n\n let newCapacity = capacity;\n newCapacity.sort((a, b) => {\n return b - a;\n });\n let sumJuice = juice.reduce((a, b) => a + b, 0);\n\n if (newCapacity[0] >= sumJuice) {\n return juice.length;\n }\n\n let combine = juice.map((val, index) => {\n let spaceLeftInGlass = capacity[index] - val;\n let arr = [val, capacity[index], spaceLeftInGlass];\n return arr;\n });\n\n combine.sort((a, b) => {\n return b[2] - a[2] || b[1] - a[1];\n });\n\n let biggestSpace = combine[0][2];\n\n combine.splice(0, 1);\n combine.sort((a, b) => {\n return a[0] - b[0];\n });\n\n let maxMix = 1;\n\n for (let i = 0; i < combine.length; i++) {\n biggestSpace -= combine[i][0];\n\n if (biggestSpace < 0) {\n return maxMix;\n }\n maxMix++;\n }\n}", "function knapsackProblem(items, capacity) {\n let memo = new Array(capacity + 1);\n for (let i = 0; i < memo.length; i++) {\n memo[i] = [0, []];\n }\n for (let j = 0; j < items.length; j++) {\n let currentItem = items[j];\n let currentValue = currentItem[0];\n let currentWeight = currentItem[1];\n\n for (let i = memo.length - 1; i >= currentWeight; i--) {\n let prevBest = memo[i - currentWeight];\n if (memo[i][0] < prevBest[0] + currentValue) {\n memo[i][0] = prevBest[0] + currentValue;\n memo[i][1] = [...prevBest[1], j];\n }\n }\n }\n return memo[memo.length - 1];\n}", "function computeBestAction(){\n \n var buyMin;\n var upgradeMin = computeBestUpgradeEfficiency();\n \n if(totalProduction > totalDistribution){\n buyMin = computeBestDistributionEfficiency();\n }\n else {\n buyMin = computeBestManufactorEfficiency();\n }\n \n return Math.min(buyMin,upgradeMin);\n}", "get capacity () {throw ae.EXCEPTION_ABSTRACT_METHOD;}", "function decrementCapacity() {\n var data = {\n action: \"decrement\",\n group: $scope.group\n };\n\n // Calls the decrement capacity method in the registration factory.\n RegistrationFactory.decrementCapacity(data)\n .then(function(response) {\n if (response == true) {\n isThereCapacity();\n }\n });\n }", "async function checkCapacity(req, res, next) {\n const { table_id } = req.params;\n const table = await service.read(table_id);\n const reservation = res.locals.reservation;\n\n if (table.capacity < reservation.people)\n return next({\n status: 400,\n message: `${table.table_name} does not have the capacity to seat ${reservation.people} people.`,\n });\n\n if (table.status == \"occupied\")\n return next({\n status: 400,\n message: `${table.table_name} is currently occupied.`,\n });\n\n next();\n}", "_dispense () {\n /**\n * Local variables for ease of reading/writing\n * these don't (shouldn't) change across the execution of this fn\n */\n const numWaitingClients = this._waitingClientsQueue.length\n\n // If there aren't any waiting requests then there is nothing to do\n // so lets short-circuit\n if (numWaitingClients < 1) {\n return\n }\n\n const resourceShortfall = numWaitingClients - this._potentiallyAllocableResourceCount\n\n const actualNumberOfResourcesToCreate = Math.min(this.spareResourceCapacity, resourceShortfall)\n for (let i = 0; actualNumberOfResourcesToCreate > i; i++) {\n this._createResource()\n }\n\n // If we are doing test-on-borrow see how many more resources need to be moved into test\n // to help satisfy waitingClients\n if (this._config.testOnBorrow === true) {\n // how many available resources do we need to shift into test\n const desiredNumberOfResourcesToMoveIntoTest = numWaitingClients - this._testOnBorrowResources.size\n const actualNumberOfResourcesToMoveIntoTest = Math.min(this._availableObjects.length, desiredNumberOfResourcesToMoveIntoTest)\n for (let i = 0; actualNumberOfResourcesToMoveIntoTest > i; i++) {\n this._testOnBorrow()\n }\n }\n\n // if we aren't testing-on-borrow then lets try to allocate what we can\n if (this._config.testOnBorrow === false) {\n const actualNumberOfResourcesToDispatch = Math.min(this._availableObjects.length, numWaitingClients)\n for (let i = 0; actualNumberOfResourcesToDispatch > i; i++) {\n this._dispatchResource()\n }\n }\n }", "compute() {\n let v = {}\n\n // Operational Hours[h / yr]\n const operationalHours = this.params['DAC Capacity Factor'] * HOURS_PER_YEAR\n\n // Planned Capacity Factor\n v['Planned Capacity Factor'] = this.tech['Availability']\n\n // Electric Power Requirement[MW](aka low value case in C1)\n v['Base Energy Requirement [MW]'] = this.baseReq\n\n // calculate battery params now\n if (this.battery) {\n // TODO: check that this is the correct value to pass to the battery computation\n const bat = this.battery.compute(v)\n v = Object.assign(v, bat)\n }\n\n // Plant Size[MW]\n v['Plant Size [MW]'] =\n v['Base Energy Requirement [MW]'] / v['Planned Capacity Factor']\n if (this.battery) {\n v['Plant Size [MW]'] += v['Increased Need [MW]']\n }\n\n // Overnight Cost [M$]\n v['Overnight Cost [M$]'] =\n this.tech['Base Plant Cost [M$]'] *\n (v['Plant Size [MW]'] / this.tech['Plant Size [MW]']) **\n this.tech['Scaling Factor']\n\n // Lead Time Multiplier\n v['Lead Time Multiplier'] = this.leadTimeMult(\n this.tech['Lead Time [Years]'].toFixed(0)\n )\n\n // Capital Cost [M$]\n v['Capital Cost [M$]'] =\n v['Overnight Cost [M$]'] * v['Lead Time Multiplier']\n\n // Total Capital Cost [M$]\n v['Total Capital Cost [M$]'] = v['Capital Cost [M$]']\n if (this.battery) {\n v['Total Capital Cost [M$]'] += v['Battery Capital Cost [M$]']\n }\n\n // Annual Capital Recovery Factor\n const annualCapitalRecoveryFactor = this.recoveryFactor()\n\n // Capital Recovery[$/tCO2eq]\n v['Capital Recovery [$/tCO2eq]'] =\n (v['Total Capital Cost [M$]'] * annualCapitalRecoveryFactor * MILLION) /\n this.params['Scale [tCO2/year]']\n\n // Power Fixed O&M [$/tCO2eq]\n v['Power Fixed O&M [$/tCO2eq]'] =\n (this.tech['Base Plant Annual Fixed O&M [$M]'] *\n (v['Plant Size [MW]'] / this.tech['Plant Size [MW]']) **\n this.tech['Scaling Factor'] *\n MILLION) /\n this.params['Scale [tCO2/year]']\n\n // Power Variable O&M [$/tCO2eq]\n v['Power Variable O&M [$/tCO2eq]'] =\n (this.tech['Variable O&M [$/MWhr]'] *\n v['Plant Size [MW]'] *\n operationalHours) /\n this.params['Scale [tCO2/year]']\n\n // Total Fixed O&M [$/tCO2eq]\n v['Total Fixed O&M [$/tCO2eq]'] = v['Power Fixed O&M [$/tCO2eq]']\n if (this.battery) {\n v['Total Fixed O&M [$/tCO2eq]'] += v['Battery Fixed O&M [$/tCO2eq]']\n }\n\n // Total Variable O&M [$/tCO2eq]\n v['Total Variable O&M [$/tCO2eq]'] = v['Power Variable O&M [$/tCO2eq]']\n if (this.battery) {\n v['Total Variable O&M [$/tCO2eq]'] += v['Battery Variable O&M [$/tCO2eq]']\n }\n\n // Natural Gas Use[mmBTU / tCO2eq]\n const heatRate = this.tech['Final Heat Rate [BTU/kWh]']\n if (heatRate) {\n v['Natural Gas Use [mmBTU/tCO2eq]'] =\n (operationalHours *\n v['Plant Size [MW]'] *\n KW_TO_MW *\n this.tech['Final Heat Rate [BTU/kWh]']) /\n MILLION /\n this.params['Scale [tCO2/year]']\n } else {\n v['Natural Gas Use [mmBTU/tCO2eq]'] = 0.0\n }\n\n // Natural Gas Cost [$/tCO2eq]\n v['Natural Gas Cost [$/tCO2eq]'] =\n v['Natural Gas Use [mmBTU/tCO2eq]'] *\n this.params['Natural Gas Cost [$/mmBTU]']\n\n // Emitted tCO2eq / tCO2\n if (v['Natural Gas Use [mmBTU/tCO2eq]'] > 0) {\n v['Emitted [tCO2/tCO2]'] =\n v['Natural Gas Use [mmBTU/tCO2eq]'] *\n this.tech['Total CO2 eq [lb/mmbtu]'] *\n LB_TO_METRIC_TON *\n (1 - this.tech['Capture Efficiency'])\n } else {\n v['Emitted [tCO2/tCO2]'] = 0\n }\n\n return v\n }", "appsPerHost(name, amount) {\n const aph = this.apps.reduce(\n (acc, val) => ({\n host: name,\n apps: (val.host.indexOf(name) !== -1 && acc.apps.length < amount)\n ? acc.apps.concat(val)\n : acc.apps\n }),\n { host: name, apps: [] }\n );\n return aph;\n }", "requestResource(item, amt) {\n const avail = this.getStock(item);\n if (amt > avail) {\n this.incDemand(item, amt - avail);\n }\n }", "async function hasCapacity(req, res, next) {\n const table = res.locals.table;\n const { reservation_id } = req.body.data;\n const reservation = await reservationService.read(reservation_id);\n if (table.capacity >= reservation.people) {\n return next();\n }\n next({\n status: 400,\n message: `This table does not have capacity for a party size of ${reservation.people}. Please select a reservation with a party size of ${table.capacity} or less.`,\n });\n}", "async function deployQuotaDistribution(deployer, network) {\n \n let bnb = await BNB.deployed();\n\n console.log(\"[Golff] 1.Start deploy QuotaDistribution on Network= \" + network);\n\n await deployer.deploy(QuotaDistribution, 1599904800, 175);\n \n console.log(\"[Golff] 2.Start add minter acl for distribution\");\n\n bnb.addMinter(QuotaDistribution.address);\n\n console.log(\"[Golff] 3.Start set quota distributor\");\n\n let disribution_account = \"0x424abfc7c0Defb02447D621Bf0f6eF80eD5C01fB\";\n\n let quota_distribution = new web3.eth.Contract(QuotaDistribution.abi, QuotaDistribution.address);\n\n await Promise.all([\n quota_distribution.methods.setQuotaDistribution(disribution_account).send({from: disribution_account}),\n ]);\n\n let init_quota = web3.utils.toBN(10 ** 18).mul(web3.utils.toBN(1000000 * 100));//.div(web3.utils.toBN(10 ** 4));\n \n console.log(\"[Golff] 4.Start set quota distributor\");\n\n await Promise.all([\n quota_distribution.methods.addOrgQuota(disribution_account, init_quota.toString()).send({from: disribution_account}),\n ]);\n \n console.log(\"[Golff] 5.Start set quota distributor\");\n\n await Promise.all([\n quota_distribution.methods.distributeQuota().send({from:disribution_account}),\n ]);\n}", "function updateWeights(tasks) {\n for (var i=0 ; i<tasks.length ; i++) {\n tasks[i].weight = Math.pow(1.25, -1*tasks[i].nice) * 1024;\n }\n}", "function Cup(initialCapacity) {\n this.capacity = initialCapacity || 12;\n this.volume = 0;\n\n this.add = function (v) {\n if (v > this.capacity) { throw(\"Too much coffee\"); }\n this.volume += v;\n };\n}", "function capacity(list){\n return MAX_ELEMENT_LIST;\n}", "loadFactor() {\n return this.elements / this.capacity;\n }", "loadFactor() {\n return this.elements / this.capacity;\n }", "function greedyPoo(items) {\n var resultsGreed = [];\n let currentSize = 0;\n let currentValue = 0;\n \n sortedStuff(greedItems).forEach(item => {\n if(currentSize + item.size <= capacity) {\n resultsGreed.push(item.index);\n currentSize += item.size;\n currentValue += item.value;\n } \n })\n return {resultsGreed, currentSize, currentValue};\n }", "function calcQuantity(offer, demand) {\n\tif(demand.maxQuantity < offer.minQuantity || offer.maxQuantity < demand.minQuantity) {\n\t\treturn 0;\n\t}\n\tif (offer.maxQuantity < demand.maxQuantity) {\n\t\treturn offer.maxQuantity;\n\t}\n\treturn demand.maxQuantity;\n}", "function tableHasSufficientCapacity(req, res, next) {\n const { people } = res.locals.reservation;\n const { capacity } = res.locals.table;\n\n if (capacity >= people) return next();\n\n next({\n status: 400,\n message: `Table does not have sufficient capacity.`,\n });\n}", "function maxKnapsack(weights, profits, capacity, currentIndex){\nlet profit1 = -1\n if (profits.length <=currentIndex || capacity < 0 ){\n return 0;\n }\n if (weights[currentIndex] <= capacity){\n profit1 = profits[currentIndex] + maxKnapsack(weights, profits, capacity - weights[currentIndex], currentIndex + 1);\n }\n \n profit2 = maxKnapsack(weights, profits,capacity,currentIndex + 1 )\n\nreturn Math.max(profit1, profit2)\n}", "function dKnapsack(capacity, size, value, n) {\r\n\tvar K = [];\r\n\tvar retStr=\"\";\r\n\tfor (var i = 0; i <= capacity+1; i++) {\r\n\t\tK[i] = [];\r\n\t}\r\n\tfor (var i = 0; i <= n; i++) {\r\n\t\tfor (var w = 0; w <= capacity; w++) {\r\n\t\t\tif (i == 0 || w == 0) {\r\n\t\t\t\tK[i][w] = 0;\r\n\t\t\t}\r\n\t\t\telse if (size[i-1] <= w) {\r\n\t\t\t\tK[i][w] = max(value[i-1] + K[i-1][w-size[i-1]],\r\n\t\t\t\tK[i-1][w]);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tK[i][w] = K[i-1][w];\r\n\t\t\t}\r\n\t\t\tretStr+=(K[i][w] + \" \");\r\n\t\t}\r\n\t\tretStr+=\"\\n\";\r\n\t}\r\n\tconsole.log(retStr);\r\n\treturn K[n][capacity];\r\n}", "function increaseSupply() {\n shiftSupply([1, -1]);\n }", "function moneyProducers() {\n\tmoneyClicks += workers;\n\tmoneyClicks += teamLeader * teamLeaderMPS;\n\tmoneyClicks += manager * managerMPS;\n\n}", "function CapResources() {\n\tfor (var i in Resources) {\n\t\tif (Resources[i].storage) {\n\t\t\t//Some resources are exempt from the rule. Maybe I should add a flag for this.\n\t\t\tif (i == \"population\") { continue; }\n\t\t\tif (i == \"workers\") { continue; }\n\t\t\tif (Resources[i].stock > Resources[i].storage) {\n\t\t\t\tResources[i].stock = Resources[i].storage;\n\t\t\t}\n\t\t}\n\t}\n}", "estimateAvailability(item) {\n let turns = undefined;\n if (this.getStock(item) > 0)\n return 0;\n const res = resource_1.resources[item];\n if (resource_1.isRaw(res) && this.netProduction(item) > 0) {\n return 3;\n }\n for (const task of this.queue) {\n if (isImportTask(task)\n && task.item == item\n && (turns == undefined || turns > task.turns)) {\n turns = task.turns;\n }\n else if (isCraftTask(task)\n && task.item == item\n && (turns == undefined || turns > task.turns)) {\n turns = task.turns;\n }\n }\n return turns;\n }", "function allocateWorkers(execution, numOfWorkersRequested) {\n const exId = execution.ex_id;\n const jobId = execution.job_id;\n const jobStr = JSON.stringify(execution);\n const sortedNodes = _.orderBy(clusterState, 'available', 'desc');\n let workersRequested = numOfWorkersRequested;\n let availWorkers = _availableWorkers(false, true);\n\n const dispatch = _makeDispatch();\n\n while (workersRequested > 0 && availWorkers > 0) {\n for (let i = 0; i < sortedNodes.length; i += 1) {\n // each iteration check if it can allocate\n if (workersRequested > 0 && availWorkers > 0) {\n if (sortedNodes[i].available >= 1) {\n dispatch.set(sortedNodes[i].node_id, 1);\n availWorkers -= 1;\n workersRequested -= 1;\n }\n } else {\n break;\n }\n }\n }\n // if left over worker requests, enqueue them, queue works based off of id\n // so it redundantly references ex_id\n\n const workerData = {\n job: jobStr,\n id: exId,\n ex_id: exId,\n job_id: jobId,\n workers: 1,\n assignment: 'worker'\n };\n\n while (workersRequested > 0) {\n logger.trace(`adding worker to pending queue for ex: ${exId}`);\n pendingWorkerRequests.enqueue(workerData);\n workersRequested -= 1;\n }\n const results = [];\n\n _.forOwn(dispatch.getDispatch(), (workerCount, nodeId) => {\n const requestedWorkersData = {\n job: jobStr,\n id: exId,\n ex_id: exId,\n job_id: jobId,\n workers: workerCount,\n assignment: 'worker'\n };\n\n results.push(\n messaging.send({\n to: 'node_master',\n address: nodeId,\n message: 'cluster:workers:create',\n payload: requestedWorkersData,\n response: true\n })\n .catch(() => {\n logger.error(`An error has occurred in allocating : ${workerCount} workers to node : ${nodeId} , the worker request has been enqueued`);\n pendingWorkerRequests.enqueue(requestedWorkersData);\n })\n );\n });\n\n // this will resolve successfully if one worker was actually allocated\n return Promise.all(results);\n }", "upgrade(times) {\n if (times === undefined) {\n times = 1;\n }\n\n let downgrade = false;\n if (times < 0) {\n downgrade = true;\n times = Math.abs(times);\n }\n\n for (let i = 0; i < times; i++) {\n if (downgrade) {\n if (this.proficiency > 0) {\n this.proficiency--;\n this.ability++;\n } else if (this.ability > 0) {\n this.ability--;\n }\n } else {\n if (this.ability > 0) {\n this.ability--;\n this.proficiency++;\n } else {\n this.ability++;\n }\n }\n }\n }", "_modifyWorkerAsg () {\n let asg = this._template.Resources[`${this._opts.Name}WorkerAsg`];\n\n asg.CreationPolicy.ResourceSignal.Count.Ref = `${this._opts.Name}WorkerSize`;\n asg.Properties.DesiredCapacity.Ref = `${this._opts.Name}WorkerSize`;\n asg.Properties.LaunchConfigurationName.Ref = `${this._opts.Name}WorkerLaunchConfig${this._versionString}`;\n asg.UpdatePolicy.AutoScalingRollingUpdate.MinInstancesInService.Ref = `${this._opts.Name}WorkerSize`;\n }", "upgrade(times) {\n if (times === undefined) {\n times = 1;\n }\n for (let i = 0; i < times; i++) {\n if (this.ability > 0) {\n this.ability--;\n this.proficiency++;\n } else {\n this.ability++;\n }\n }\n }", "constructor(initialCapacity = 10) {\n }", "function mainmore(){\n Array.SIZE_RATIO = 3;\n let arr = new Array();\n arr.push(3);\n arr.push(5);\n arr.push(15);\n arr.push(19);\n arr.push(45);\n arr.push(10);\n console.log(arr);\n console.log(arr.length);\n console.log(arr._capacity);\n}", "grow() {\n this.capacity *= 2;\n this.capacity = this.closestLargestPrime(this.capacity);\n for (let i = 0; i < this.table.length; i++) {\n let currentBucket = this.table[i];\n this.table[i] = [];\n if (currentBucket) {\n if (currentBucket.length > 0) {\n this.elements--;\n currentBucket.forEach(item => {\n this.add(item.key, item.value);\n });\n }\n }\n }\n }", "function upgrade_cost (k)\n {\n return 500.0 * (1 + k/(15-k)) * Math.pow(k, 1.5) * (1/(15-k));\n }", "compute(eVals) {\n const v = {}\n\n // Battery Capacity[MWh]\n v['Battery Capacity [MWh]'] =\n eVals['Base Energy Requirement [MW]'] *\n (HOURS_PER_DAY * (1 - eVals['Planned Capacity Factor']))\n\n // Round Trip Efficiency\n v['Round Trip Efficiency'] = this.tech['Efficiency (Thermal or Round Trip)']\n\n // Battery Capacity Needed[MWh]\n v['Battery Capacity Needed [MWh]'] =\n v['Battery Capacity [MWh]'] / v['Round Trip Efficiency']\n\n // Increased[MWh]\n v['Increased [MWh]'] =\n v['Battery Capacity Needed [MWh]'] - v['Battery Capacity [MWh]']\n\n // Increased Solar / Wind Need\n v['Increased Need [MW]'] =\n v['Increased [MWh]'] / (HOURS_PER_DAY * eVals['Planned Capacity Factor'])\n\n // Battery Capital Cost [M$]\n v['Battery Capital Cost [M$]'] =\n this.tech['Base Plant Cost [M$]'] *\n (v['Battery Capacity Needed [MWh]'] /\n this.tech['Battery Capacity [MWhr]']) **\n this.tech['Scaling Factor']\n\n // Battery Fixed O&M [$/tCO2eq]\n v['Battery Fixed O&M [$/tCO2eq]'] =\n (this.tech['Base Plant Annual Fixed O&M [$M]'] *\n (v['Battery Capacity Needed [MWh]'] /\n this.tech['Battery Capacity [MWhr]']) **\n this.tech['Scaling Factor'] *\n MILLION) /\n this.params['Scale [tCO2/year]']\n\n // Battery Variable O&M [$/tCO2eq]\n v['Battery Variable O&M [$/tCO2eq]'] =\n ((this.tech['Variable O&M [$/MWhr]'] * v['Battery Capacity [MWh]']) /\n this.params['Scale [tCO2/year]']) *\n DAYS_PER_YEAR\n\n return v\n }", "grow() {\n this.capacity *= 2;\n this.capacity = this.closestLargestPrime(this.capacity);\n for (let i = 0; i < this.table.length; i++) {\n let currentBucket = this.table[i];\n this.table[i] = [];\n if (currentBucket) {\n if (currentBucket.length > 0) {\n this.elements--;\n currentBucket.forEach(item => {\n this.add(item);\n });\n }\n }\n }\n }", "_available_write(rd, wr) {\n let rv = rd - wr - 1;\n if (wr >= rd) {\n rv += this._storage_capacity();\n }\n return rv;\n }", "function buyJobs() {\n if (!game.jobs.Scientist.locked && game.jobs.Scientist.owned < 100) buyJob('Scientist');\n var freeWorkers = Math.ceil(game.resources.trimps.realMax() / 2) - game.resources.trimps.employed;\n var trimps = game.resources.trimps;\n var totalDistributableWorkers = freeWorkers + game.jobs.Farmer.owned + game.jobs.Miner.owned + game.jobs.Lumberjack.owned; \n var farmerRatio = parseInt(getPageSetting('FarmerRatio'));\n var lumberjackRatio = parseInt(getPageSetting('LumberjackRatio'));\n var minerRatio = parseInt(getPageSetting('MinerRatio'));\n var totalRatio = farmerRatio + lumberjackRatio + minerRatio;\n var scientistRatio = farmerRatio / 25;\n if (game.jobs.Farmer.owned < 100) {\n scientistRatio = totalRatio / 10;\n }\n \n //FRESH GAME LEVEL 1 CODE\n if (game.global.world == 1 && game.global.totalHeliumEarned<=100){\n if (game.resources.trimps.owned < game.resources.trimps.realMax() * 0.9){\n if (game.resources.food.owned > 5 && freeWorkers > 0){\n if (game.jobs.Farmer.owned == game.jobs.Lumberjack.owned)\n safeBuyJob('Farmer', 1);\n else if (game.jobs.Farmer.owned > game.jobs.Lumberjack.owned && !game.jobs.Lumberjack.locked)\n safeBuyJob('Lumberjack', 1);\n }\n if (game.resources.food.owned > 20 && freeWorkers > 0){\n if (game.jobs.Farmer.owned == game.jobs.Lumberjack.owned && !game.jobs.Miner.locked)\n safeBuyJob('Miner', 1);\n }\n }\n return;\n }\n \n if (game.global.challengeActive == 'Watch'){\n scientistRatio = totalRatio / 10;\n stopScientistsatFarmers = 1e8;\n if (game.resources.trimps.owned < game.resources.trimps.realMax() * 0.9 && !breedFire){\n //so the game buys scientists first while we sit around waiting for breed timer.\n var buyScientists = Math.floor((scientistRatio / totalRatio * totalDistributableWorkers) - game.jobs.Scientist.owned);\n if (game.jobs.Scientist.owned < buyScientists && game.resources.trimps.owned > game.resources.trimps.realMax() * 0.1){\n var toBuy = buyScientists-game.jobs.Scientist.owned;\n var canBuy = Math.floor(trimps.owned - trimps.employed);\n if(buyScientists > 0 && freeWorkers > 0)\n safeBuyJob('Scientist',toBuy <= canBuy ? toBuy : canBuy);\n }\n else\n return;\n }\n }\n else\n { //exit if we are havent bred to at least 90% breedtimer yet...\n if (game.resources.trimps.owned < game.resources.trimps.realMax() * 0.9 && !breedFire) return;\n }\n \n var oldBuy = game.global.buyAmt;\n \n //Trainers capped to tributes percentage.\n var trainerpercent = getPageSetting('TrainerCaptoTributes');\n if (trainerpercent > 0){\n var curtrainercost = game.jobs.Trainer.cost.food[0]*Math.pow(game.jobs.Trainer.cost.food[1],game.jobs.Trainer.owned);\n var curtributecost = getBuildingItemPrice(game.buildings.Tribute, \"food\", false, 1) * Math.pow(1 - game.portal.Resourceful.modifier, game.portal.Resourceful.level);\n if (curtrainercost < curtributecost * (trainerpercent / 100) && (getPageSetting('MaxTrainers') > game.jobs.Trainer.owned || getPageSetting('MaxTrainers') == -1)) {\n game.global.buyAmt = 1;\n if (canAffordJob('Trainer', false) && !game.jobs.Trainer.locked) {\n freeWorkers = Math.ceil(game.resources.trimps.realMax() / 2) - game.resources.trimps.employed;\n if (freeWorkers <= 0) safeBuyJob('Farmer', -1);\n safeBuyJob('Trainer');\n }\n }\n }\n //regular old way of hard capping trainers to a certain number. (sorry about lazy duplicate coding)\n else if (getPageSetting('MaxTrainers') > game.jobs.Trainer.owned || getPageSetting('MaxTrainers') == -1) {\n game.global.buyAmt = 1;\n if (canAffordJob('Trainer', false) && !game.jobs.Trainer.locked) {\n freeWorkers = Math.ceil(game.resources.trimps.realMax() / 2) - game.resources.trimps.employed;\n if (freeWorkers <= 0) safeBuyJob('Farmer', -1);\n safeBuyJob('Trainer');\n }\n }\n if (game.jobs.Explorer.owned < getPageSetting('MaxExplorers') || getPageSetting('MaxExplorers') == -1) {\n game.global.buyAmt = 1;\n if (canAffordJob('Explorer', false) && !game.jobs.Explorer.locked) {\n freeWorkers = Math.ceil(game.resources.trimps.realMax() / 2) - game.resources.trimps.employed;\n if (freeWorkers <= 0) safeBuyJob('Farmer', -1);\n safeBuyJob('Explorer');\n }\n }\n game.global.buyAmt = oldBuy;\n freeWorkers = Math.ceil(game.resources.trimps.realMax() / 2) - game.resources.trimps.employed;\n if (getPageSetting('HireScientists') && !game.jobs.Scientist.locked) {\n //if earlier in the game, buy a small amount of scientists\n if (game.jobs.Farmer.owned < stopScientistsatFarmers && !breedFire) {\n var buyScientists = Math.floor((scientistRatio / totalRatio * totalDistributableWorkers) - game.jobs.Scientist.owned);\n //bandaid to prevent situation where 1 scientist is bought, causing floor calculation to drop by 1, making next calculation -1 and entering hiring/firing loop\n //proper fix is including scientists in totalDistributableWorkers and the scientist ratio in the total ratio, but then it waits for 4 jobs\n if(buyScientists > 0 && freeWorkers > 0) safeBuyJob('Scientist', buyScientists);\n }\n //once over 250k farmers, fire our scientists and rely on manual gathering of science\n //else if (game.jobs.Scientist.owned > 0) safeBuyJob('Scientist', game.jobs.Scientist.owned * -1);\n }\n //Buy Farmers:\n if(!game.jobs.Farmer.locked && !breedFire) {\n var toBuy = Math.floor((farmerRatio / totalRatio * totalDistributableWorkers) - game.jobs.Farmer.owned);\n var canBuy = Math.floor(trimps.owned - trimps.employed);\n safeBuyJob('Farmer',toBuy <= canBuy ? toBuy : canBuy);\n }\n // else if(breedFire)\n // safeBuyJob('Farmer', game.jobs.Farmer.owned * -1); \n //Buy/Fire Miners:\n if(!game.jobs.Miner.locked && !breedFire) {\n var toBuy = Math.floor((minerRatio / totalRatio * totalDistributableWorkers) - game.jobs.Miner.owned);\n var canBuy = Math.floor(trimps.owned - trimps.employed);\n safeBuyJob('Miner',toBuy <= canBuy ? toBuy : canBuy);\n }\n else if(breedFire && game.global.turkimpTimer === 0)\n safeBuyJob('Miner', game.jobs.Miner.owned * -1);\n //Buy/Fire Lumberjacks:\n if(!game.jobs.Lumberjack.locked && !breedFire) {\n var toBuy = Math.floor((lumberjackRatio / totalRatio * totalDistributableWorkers) - game.jobs.Lumberjack.owned);\n var canBuy = Math.floor(trimps.owned - trimps.employed);\n safeBuyJob('Lumberjack',toBuy <= canBuy ? toBuy : canBuy);\n }\n else if(breedFire)\n safeBuyJob('Lumberjack', game.jobs.Lumberjack.owned * -1); \n\n}", "constructor(maxPiles) { // was ActivePool\n this.stuff = [...Array(maxPiles)].map(_ => [])\n this.index = Array(maxPiles).fill(-1)\n this.capacity = maxPiles\n }", "async function setupProfitSharing() {\n // Dai, USDC, and yCRV Vaults all use Dai to share profit\n daiProfitPool = await NoMintRewardPool.new(\n dai.address, // rewardToken should be dai, usdc, ycrv\n farm.address, // governance\n rewardDuration, // duration\n feeRewardForwarder.address, // reward distribution\n storage.address,\n { from: governance }\n );\n\n await feeRewardForwarder.setConversionPath(\n ycrv.address,\n dai.address,\n [MFC.YCRV_ADDRESS, MFC.WETH_ADDRESS, MFC.DAI_ADDRESS],\n {from: governance}\n );\n\n // Let the feeRewardForwarder know that we are sharing all our profit in this\n // Dai profit pool\n await feeRewardForwarder.setTokenPool(daiProfitPool.address, { from: governance });\n }", "function calcWeightedRes(cpu, memory, numOfRequests) {\n return cpu * 0.4 + memory * 0.2 + numOfRequests * 0.4;\n}", "function newBlueprintCost() {\n // first 4 blueprints free\n let { self } = window;\n if (!self || self.blueprints.length < 4) {\n return 0;\n }\n return self.blueprints.length * 250 + 250;\n}", "function buyStorage() {\n var packMod = 1 + game.portal.Packrat.level * game.portal.Packrat.modifier;\n var Bs = {\n 'Barn': 'food',\n 'Shed': 'wood',\n 'Forge': 'metal'\n };\n for (var B in Bs) {\n var jest = 0;\n var owned = game.resources[Bs[B]].owned;\n var max = game.resources[Bs[B]].max * packMod;\n max = calcHeirloomBonus(\"Shield\", \"storageSize\", max);\n if(game.global.mapsActive && game.unlocks.imps.Jestimp) {\n jest = simpleSeconds(Bs[B], 45);\n jest = scaleToCurrentMap(jest);\n }\n if ((game.global.world==1 && owned > max * 0.55) || (game.global.world >= 2 && game.global.world < 10 && owned > max * 0.4) || (owned + jest > max * 0.5)) {\n // debug('Buying ' + B + '(' + Bs[B] + ') at ' + Math.floor(game.resources[Bs[B]].owned / (game.resources[Bs[B]].max * packMod * 0.99) * 100) + '%');\n if (canAffordBuilding(B) && game.triggers[B].done) {\n safeBuyBuilding(B);\n if (getPageSetting('ManualGather')) setGather('buildings');\n }\n }\n }\n}", "get minCapacityInput() {\n return this._minCapacity;\n }", "getTotalRequirements() {\n let asps = []\n let reqs = {\n force: 0,\n entropy: 0,\n form: 0,\n inertia: 0,\n life: 0,\n }\n\n for (let x in this.app.state.aspects) {\n asps.push(this.getReferenceById(this.app.state.aspects[x].id))\n }\n\n for (let x in asps) {\n for (let z in asps[x].requirements) {\n let amount = asps[x].requirements[z]\n if (amount > reqs[z])\n reqs[z] = amount\n }\n }\n\n return reqs;\n }", "get targetCapacityInput() {\n return this._targetCapacity;\n }", "get capacityProvidersInput() {\n return this._capacityProviders;\n }", "function knapsackProblem(items, capacity, maxVal = [0, []], currentValue = [0, []], idx = 0) {\n if(!items.length || capacity === 0) {\n return currentValue\n }\n\t\n\tfor(let i = 0; i < items.length; i++){\n let next;\n let skip;\n\t\tif(capacity-items[i][1] >= 0) {\n\t\t\tnext = knapsackProblem(items.slice(i+1), capacity-items[i][1], maxVal, [currentValue[0]+items[i][0], [...currentValue[1], idx+i]], idx+i+1);\n\t\t skip = knapsackProblem(items.slice(i+1), capacity, maxVal, currentValue, idx+i+1);\n if(next[0] > skip[0]) {\n if(next[0] > maxVal[0]) {\n maxVal = next\n }\n }\n else {\n if(skip[0] > maxVal[0]) {\n maxVal = skip\n }\n }\n\t }\t\t\n\t}\n if(currentValue[0] > maxVal[0]) {\n\t\tmaxVal = currentValue\n\t}\n\treturn maxVal;\n}", "update() {\r\n let value =\r\n this.capacity * ((Math.random() - 0.5) * this.pctfree + this.pctfree);\r\n this.metric.labels(this.labels).set(value);\r\n }", "addToInventory(inv) {\n let resources = this.resources;\n RESOURCES.forEach(x => {\n // +- TURNLY_PRODUCTION_RANGE\n let supply = resources[x] +\n (Math.random() - 0.5) * resources[x] * TURNLY_PRODUCTION_RANGE;\n if (supply < 0) throw 'supply < 0';\n inv.stockpile[x] += supply;\n inv.supply[x] += supply;\n });\n }", "function organizeItemData(_data){\r\r\n // Calculate the cost in gold (it's given via the API in copper cost)\r\r\n let copperCost = _data.buyPrice;\r\r\n let goldCost = 0;\r\r\n \r\r\n // If time permits, optimize further (if copperCost > 100000, go by 100000's)\r\r\n while (copperCost > 0){\r\r\n copperCost -= 1000;\r\r\n goldCost += 1;\r\r\n }\r\r\n character.item_costs[parseInt(_data.id, 10)] = goldCost;\r\r\n}", "function calculDeductible () {\n for (var i = 0; i < deliveries.length; i++) {\n if (deliveries[i].options.deductibleReduction == true) {\n deliveries[i].price += deliveries[i].volume\n deliveries[i].commission.convargo += deliveries[i].volume\n }\n }\n}", "function fillKnapsack(W, items) {\n let cache = new Cache();\n let totalVal = 0;\n let totalWeight = 0;\n\n if (W == 0 || items.length === 0) {\n return 'No items can be put in the knapsack.'\n }\n\n // Prune out items that are too heavy (>W)\n // O(n), n = number of items\n let possibleItems = [];\n for (let item of items) {\n if (item.weight <= W) {\n possibleItems.push(item);\n }\n }\n\n return tryFillKnapsack(cache, W, possibleItems);\n}", "function proposePricing(uint _keepPerByte, uint _writePerByte, uint _GPUTPerCycle, uint _CPUTtPerCycle) external {\n Customer storage current = customers[msg.sender];\n current.pricing.keepPerByte = _keepPerByte;\n current.pricing.writePerByte = _writePerByte;\n current.pricing.GPUTPerCycle = _GPUTPerCycle;\n current.pricing.CPUTtPerCycle = _CPUTtPerCycle;\n current.pricing.isChanged = true;\n }", "function knapSack(capacity, weights, values, n) {\n if (n === 0 || capacity === 0) {\n return 0;\n }\n if (weights[n-1] > capacity){\n return knapSack(capacity, weights, values, n-1);\n } else {\n //a is last item in values, new capacity is capacity - weight of last item in weights, n decreases by 1 since we added an item\n var a = values[n-1] + knapSack(capacity-weights[n-1], weights, values, n-1);\n //go with n-1 to use lesser weights and values\n var b = knapSack(capacity, weights, values, n-1);\n return (a > b) ? a : b;\n }\n}", "quotaMysWPass(){\n return math.chain(+this.props.numLocalEmp || 0).multiply(0.666667).floor().done();\n }", "function BPQ(capacity) {\n this.capacity = capacity;\n this.elements = [];\n}", "capacity() {\n return this.capacity - 1;\n }", "function thiefsKnapsack2 (x, items) {\n items = items.sort((a, b) => a.val < b.val ? -1 : 1);\n\n let totalWeight = getWeight(items);\n let totalVal = getVal(items);\n let groupVals = [];\n\n while (totalWeight > x) {\n //console.log(items);\n for (let i = 0; i < items.length; i ++) {\n let tempItems = items.slice(0, i).concat(items.slice(i + 1));\n if (getWeight(tempItems) <= x) {\n groupVals.push(getVal(tempItems));\n }\n }\n totalWeight -= items[0].weight;\n totalVal -= items[0].val;\n items = items.slice(1);\n }\n\n groupVals = groupVals.sort((a, b) => a > b ? -1 : 1);\n //console.log(groupVals);\n return groupVals[0];\n}", "static calculateConcurrency() {\n return [...CoapClient.pendingRequestsByMsgID.values()] // find all requests\n .map(req => req.concurrency) // extract their concurrency\n .reduce((sum, item) => sum + item, 0) // and sum it up\n ;\n }", "function simulateProductionMission(simData, deltaTime = 1.0) {\n // First, handle autobuy, if enabled.\n let autobuyGenerator = null;\n if (simData.Config.Autobuy) {\n // search backwards through the generators for the first one with >0\n for (let genIndex = simData.Generators.length - 1; genIndex >= 0; genIndex--) {\n if (simData.Counts[simData.Generators[genIndex].Id] > 0) {\n autobuyGenerator = simData.Generators[genIndex];\n break;\n }\n }\n }\n \n // Second, determine the goals, e.g. { Resource: \"potato\", Qty: 150 }\n let goals = [];\n let condition = simData.Mission.Condition;\n switch(condition.ConditionType) {\n case \"ResourcesEarnedSinceSubscription\":\n goals = [{ Resource: \"resourceProgress\", Qty: condition.Threshold }];\n break;\n case \"IndustryUnlocked\":\n let industry = getData().Industries.find(i => i.Id == condition.ConditionId);\n goals = [{ Resource: industry.UnlockCostResourceId, Qty: industry.UnlockCostResourceQty }];\n break;\n case \"ResourceQuantity\":\n // Instead of directly waiting until we get N generators, we figure out the cost difference\n // This allows us not to be forced into autobuying (which actually isn't always better anyway!)\n let gensNeeded = condition.Threshold - simData.Counts[condition.ConditionId];\n for (let cost of simData.Generators.find(g => g.Id == condition.ConditionId).Cost) {\n if (cost.Resource == \"comrade\") {\n goals.push(({ Resource: \"comradeProgress\", Qty: cost.Qty * gensNeeded }));\n simData.Counts[\"comradeProgress\"] = simData.Counts[\"comrade\"];\n } else if (cost.Resource == simData.Generators[1].Resource) {\n goals.push(({ Resource: \"resourceProgress\", Qty: cost.Qty * gensNeeded }));\n simData.Counts[\"resourceProgress\"] = simData.Counts[simData.Generators[1].Resource];\n } else {\n // the generator before it\n goals.push(({ Resource: cost.Resource, Qty: cost.Qty * gensNeeded }));\n }\n }\n //goal = { Resource: condition.ConditionId, Qty: condition.Threshold };\n break;\n default:\n console.log(`Error: Weird situation! Simulating unknown ConditionType=${condition.ConditionType}`);\n }\n \n // Now do the iteration\n let maxTime = simData.Config.MaxDays * 24 * 60 * 60; // convert max days to max seconds\n let time;\n for (time = 0; time < maxTime && !metGoals(simData, goals); time += deltaTime) {\n // Run each generator, starting from comrades and lowest-tier first.\n for (let genIndex in simData.Generators) {\n let generator = simData.Generators[genIndex];\n simData.Counts[generator.Resource] += simData.Counts[generator.Id] * generator.QtyPerSec * deltaTime;\n \n // index 0 & 1 make comrades & resources, so they also counts toward \"comradeProgress\" & \"resourceProgress\"\n if (genIndex == 0) {\n simData.Counts[\"comradeProgress\"] += simData.Counts[generator.Id] * generator.QtyPerSec * deltaTime;\n } else if (genIndex == 1) {\n simData.Counts[\"resourceProgress\"] += simData.Counts[generator.Id] * generator.QtyPerSec * deltaTime;\n }\n }\n \n // After generating, handle autobuying\n if (autobuyGenerator) {\n let buyCount = getBuyCount(simData, autobuyGenerator);\n for (let cost of autobuyGenerator.Cost) {\n simData.Counts[cost.Resource] -= cost.Qty * buyCount;\n }\n simData.Counts[autobuyGenerator.Id] += buyCount;\n }\n }\n \n if (time >= maxTime) {\n return -1;\n } else {\n return time;\n }\n}", "function fillLabFromContainer(creep, resourceType, targetLab, mineralContainer) {\n var stor = creep.room.storage; //storage\n //console.log('XDSSSSSSSSSSSSSSSSSSS' + resourceType + 'FSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS');\n if(creep.carry[resourceType] > 0) { // deliver resource to lab or storage\n creep.say('deliver');\n if(creep.transfer(targetLab, resourceType, creep.carry[resourceType])==ERR_NOT_IN_RANGE){\n //if(Object.keys(creep.carry).map((resource) => { creep.transfer(target, resource)== ERR_NOT_IN_RANGE}) ) {\n creep.moveTo(targetLab);\n }\n } else { //find resources\n /*if(_.sum(creep.carry) > 0) {\n if( Object.keys(creep.carry).map((resource) => { creep.transfer(stor, resource)== ERR_NOT_IN_RANGE}) ) {\n creep.moveTo(stor, {reusePath:3});\n }\n }*/\n if(mineralContainer.structureType==STRUCTURE_CONTAINER) { // its a container\n creep.say('fill');\n console.log('its a container @ storer');\n if(mineralContainer.store[resourceType] > 0) {\n creep.say('filLabF');\n //creep.say(resourceType);\n //creep.say('')\n if(creep.withdraw(mineralContainer, resourceType, creep.carryCapacity-_.sum(creep.carry))==ERR_NOT_IN_RANGE){\n creep.moveTo(mineralContainer, {reusePath:3});\n creep.say('bla');\n }\n }\n } else { // \n if(creep.withdraw(mineralContainer, RESOURCE_ENERGY, creep.carryCapacity-_.sum(creep.carry))==ERR_NOT_IN_RANGE){\n creep.moveTo(mineralContainer, {reusePath:3});\n }\n }\n }\n\n}", "function getOptimalActionsCap() {\n\t\tvar optimalCandidate = Math.round(\n\t\t\tfpsMs / (renderConfig.timePerLastFrame / renderConfig.totalActions)\n\t\t);\n\n\t\tif (isNaN(optimalCandidate) || !isFinite(optimalCandidate)) {\n\t\t\toptimalCandidate = 0;\n\t\t}\n\n\t\tvar optimalCap = Math.round(fpsMs * 3 / (avgActionTime || 1) || 10);\n\n\t\tif (optimalCap > 1) {\n\t\t\toptimalCap--;\n\t\t}\n\t\tvar maxLength = actionsList.length;\n\t\tif (maxLength - 1 < optimalCap) {\n\t\t\toptimalCap = maxLength;\n\t\t}\n\t\tif (maxLength >= maxSizeBeforeFlush) {\n\t\t\toptimalCap = flushSize;\n\t\t}\n\t\tif (maxLength > criticalSize) {\n\t\t\treturn criticalSize;\n\t\t}\n\t\tif (optimalCap < optimalCandidate && flushSize > optimalCap) {\n\t\t\tif (optimalCandidate <= maxLength) {\n\t\t\t\toptimalCap = optimalCandidate;\n\t\t\t}\n\t\t}\n\t\tif (maxLength > commonPoolSize && optimalCap < commonPoolSize) {\n\t\t\toptimalCap = commonPoolSize;\n\t\t}\n\n\t\treturn optimalCap;\n\t}", "function extraServiceCost(serviceName) {\n if (serviceName == 'btn-memory-16gb') {\n memoryCost.innerText = 180;\n }\n if (serviceName == 'btn-storage-512gb') {\n storageCost.innerText = 100;\n }\n if (serviceName == 'btn-storage-1tb') {\n storageCost.innerText = 180;\n }\n if (serviceName == 'btn-delivery-with-cost') {\n deliveryCost.innerText = 20;\n }\n finalTotalAmount();\n}", "function findGrantsCap(grantsArray, newBudget) {\n\t//sort in desc order\n\tgrantsArray = grantsArray.sort((a, b) => b > a);\n\tlet currValue;\n\tlet currentIdx;\n\tfor (let i = 0; i < grantsArray.length; i++) {\n\t\t//loop through the array. at every value, try it out as the cap (there must be a better way to do this, but for now, just mapping the arr and replacing all greater values with the cap)\n\t\tcurrValue = grantsArray[i];\n\t\tcurrentIdx = i;\n\t\tlet sum = grantsArray\n\t\t\t.map((el, index) => {\n\t\t\t\tif (index <= i) return currValue;\n\t\t\t\telse return el;\n\t\t\t})\n\t\t\t.reduce((total, el) => (total += el));\n\t\t//if we're under newBudget, stop searching - we've found our lower cap bound\n\t\tif (sum < newBudget) break;\n\t\t//if we have to be right at budget, great - return current value\n\t\tif (sum === newBudget) return currValue;\n\t\t//if ALL of the values are too big to be cap, just return newbudget/array length\n\t\tif (sum > newBudget && i === grantsArray.length - 1)\n\t\t\treturn newBudget / grantsArray.length;\n\t}\n\t//add up the right half of the array (the half that will be under cap)\n\tlet rightHalfSum = grantsArray\n\t\t.slice(currentIdx)\n\t\t.reduce((total, curr) => (total += curr));\n\t//find the remaining budget available after adding the right half together. divide it by the number of over-cap grants we have\n\treturn (newBudget - rightHalfSum) / currentIdx;\n}", "function bagTheBestDeal(n, c){\n\t\t// n: remaining items to consider\n\t\t// c: remaining capacity of the bag\n\n\t\t//console.log(`\\nConsidering item at index ${n} with weight: ${w[n]} and value: ${v[n]}`)\n\t\t//console.log(['remaining items', 'remaining capacity'])\n\t\t//console.log([n, c])\n\t\t\n\t// Base cases\n\t\t// when the result is already calculated in the past\n\t\tif (DPArr[n][c] != null) {\n\t\t\tconsole.log(`Using memo`)\n\t\t\treturn DPArr[n][c]\n\t\t}\t\n\t\t\n\t\t// when no items left, or no capacity left\n\t\tif (n==0 || c == 0){\treturn 0}\n\n\t// Recursive cases\n\t\tlet result = 0\n\t\tif (w[n] > c){ \t// dont put current item but investigate the remaining items\n\t\t\t//console.log('\\tOnly One Way to Go')\n\t\t\tresult = bagTheBestDeal(n-1, c)\t\t\t\n\t\t}else {\n\t\t\t//console.log('\\tConsidering both Options')\n\t\t\tlet putTheItem \t\t= v[n] + bagTheBestDeal(n-1, c-w[n])\n\t\t\tlet dontPutTheItem \t= \t\t bagTheBestDeal(n-1, c)\n\t\t\t\n\t\t\t// Include the item in the baggedItems array (if putTheItem is the way to go) and \n\t\t\t// return the max of the two values\n\t\t\tif (putTheItem >= dontPutTheItem){\n\t\t\t\tlet key = `item ${n}`\n\t\t\t\tif (!baggedItems.get(key)){\n\t\t\t\t\tbaggedItems.set(key, `Weight: ${w[n]}, Value: ${v[n]}`)\n\t\t\t\t} \n\t\t\t\tresult = putTheItem\n\t\t\t}else{\n\t\t\t\tresult = dontPutTheItem\n\t\t\t}\n\t\t\t//result = Math.max(putTheItem, dontPutTheItem)\t\t\t\n\t\t}\n\n\t\tDPArr[n][c] = result\n\t\treturn result\n\n\t}", "function rank_optimize(setup) {\n function usage(allocation) {\n return allocation.reduce((acc, videoId) => acc + setup.vsizes[videoId], 0);\n }\n\n let maxVideoSize = lodash.max(setup.vsizes);\n\n const result = {};\n result.allocations = [];\n // Sort the request by the number of request * the latency of the endpoint to the datacenter\n const sortedRequests = lodash.sortBy(setup.requests, [function (request) {\n return -(request.nbRequests * setup.endpoints[request.endpointId].latencyToD * (maxVideoSize - setup.vsizes[request.videoId]));\n }]);\n\n const availableVideos = setup.vsizes.map(x => true);\n allocations = {};\n sortedRequests.forEach((request) => {\n\n if (setup.vsizes[request.videoId] > setup.parameters.X) {\n return;\n }\n\n // console.log('request', request);\n const sortedCacheServers = lodash.sortBy(setup.endpoints[request.endpointId].cacheServers, function (cacheServer) {\n return cacheServer.latency;\n });\n // console.log('sortedCacheServers:', sortedCacheServers);\n for (var i = 0; i < sortedCacheServers.length; i++) {\n const fastest = sortedCacheServers[i];\n // console.log('fastest', fastest);\n // Check if the cache server already has videos associated\n if (!lodash.has(allocations, fastest.csId)) {\n allocations[fastest.csId] = [];\n }\n // Can we squeeze this video\n if ((usage(allocations[fastest.csId]) + setup.vsizes[request.videoId]) <= setup.parameters.X &&\n allocations[fastest.csId].indexOf(request.videoId) == -1) {\n // Yes push it in the allocation\n allocations[fastest.csId].push(request.videoId);\n // Break the loop\n // console.log('break!');\n break;\n }\n }\n // console.log(allocations);\n });\n lodash.forOwn(allocations, function (videos, csId) {\n result.allocations.push({csId: parseInt(csId, 10), videos: videos});\n });\n // Filter empty allocation\n result.allocations = result.allocations.filter(allocation => allocation.videos.length > 0);\n // Remove duplicate\n result.allocations.forEach(allocation => allocation.videos = lodash.uniq(allocation.videos));\n result.nbCS = result.allocations.length;\n return result;\n}", "function thiefsKnapsack1 (x, items) {\n const sorted = items.sort((a, b) => a.val > b.val ? -1 : 1);\n //console.log(sorted);\n let groupVals = [];\n\n let n = items.length;\n let i = 0;\n\n while (i < items.length) {\n while (n > i) {\n let sumWeight = items.slice(i, n).reduce((acc, cur) => acc + cur.weight, 0);\n if (sumWeight <= x) {\n let sumVal = items.slice(i, n).reduce((acc, cur) => acc + cur.val, 0);\n groupVals.push(sumVal);\n }\n n --;\n }\n n = items.length;\n i ++;\n }\n\n groupVals = groupVals.sort((a, b) => a > b ? -1 : 1);\n //console.log(groupVals);\n return groupVals[0];\n}", "function budgetCalculator(watch, phone, laptop){\n // cost every single item\n var watchCost = watch * 50;\n var phoneCost = phone * 100;\n var laptopCost = laptop * 500;\n //total cost of all item.\n var totalCost = watchCost + phoneCost + laptopCost;\n return totalCost;\n\n}", "function applyPath(){\n\t\tvar cap = [];\n\t\tdelta = 0;\n\t\tGraph.instance.edges.forEach(function(key,edge){\n\t\t\tstate.edgePrevCost[edge.id] = edge.resources[1];\n\t\t});\n\t\tfor (var i =0; i<state.edgesOfSP.length; i++){\n\t\t\t\n\t\t\tcap[i] = state.edgesOfSP[i].resources[0]-state.edgesOfSP[i].state.flow;\n\t\t\t\n\t\t}\n var minCap = d3.min(cap);\n\t\t\n\t\tvar excessDemandMin = Math.min(Graph.instance.nodes.get(state.sourceId).b , -Graph.instance.nodes.get(state.targetId).b);\n\t\tdelta = Math.min(minCap, excessDemandMin);\n\t\t\n\t\n\t\tfor (var i = 0; i < state.edgesOfSP.length; i++){\n \n var edge = state.edgesOfSP[i];\n\n edge.state.flow += edge.start.state.predecessor[\"direction\"] * delta;\n\t\t\tminCost += delta * edge.edges[\"cost\"];\n }\n\t\tGraph.instance.nodes.forEach(function(key,node){\n\t\t\tbs[node.id] = node.b;\n\t\t\tif(node.id == state.sourceId){\n\t\t\t\tnode.b = node.b-delta;\n\t\t\t\tbOfS = node.b;\n\t\t\t}else if(node.id == state.targetId){\n\t\t\t\tnode.b = node.b + delta;\n\t\t\t\tbOfT = node.b;\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tnode.b = 0;\n\t\t\t}\n\t\t});\n\t\t\n\t\tGraph.instance.edges.forEach(function(key, edge) {\n\t\t\tedge.inSP = false;\n\t\t\tif(edge.state.flow == edge.resources[0]){\n\t\t\t\tedge.state.usedUp = true;\t\n\t\t\t}else{\n\t\t\t\tedge.state.usedUp = false;\t\n\n\t\t\t}\n });\n logger.log(\"Applied augmenting path with flow \"+state.augmentation);\n\t\tdel = 0;\n\t\tstate.distancesOfNodes = [];\n state.show_residual_graph = false;\n\t\tstate.shortestPath = [];\n state.current_step = STEP_MAINLOOP;\n\t\t\n\t}", "function Cost(gameResource, equip) {\n preBuy();\n game.global.buyAmt = 1;\n var price = parseFloat(getBuildingItemPrice(gameResource, equip.Resource, equip.Equip, 1));\n if (equip.Equip) price = Math.ceil(price * (Math.pow(1 - game.portal.Artisanistry.modifier, game.portal.Artisanistry.level)));\n postBuy();\n return price;\n}", "function appleStocks(arr) {\n\tlet minPrice = arr[0]; //O(1)\n\t//BUY THEN SELL\n\tlet maxProfit = arr[1] - arr[0]; //O(1)\n\n\t//START AT ONE - SO WE LOOP LENGTH - 1 ALREADY\n\tfor (let i = 1; i < arr.length; i++) {\n\t\t//CONSTANT MEMORY\n\t\tlet current = arr[i]; //Constant\n\t\tlet currentProfit = current - minPrice; //constant\n\t\tminPrice = Math.min(current, minPrice);\n\t\tmaxProfit = Math.max(currentProfit, maxProfit);\n\t}\n\treturn maxProfit;\n}", "function capacitytIsValid(req, res, next) {\n const { capacity } = req.body.data;\n if (!Number.isInteger(capacity)) {\n return next({\n status: 400,\n message: `Capacity must be a number.`,\n });\n }\n next();\n}" ]
[ "0.7069955", "0.58525044", "0.5813267", "0.56941843", "0.5681254", "0.56757516", "0.56363803", "0.56097686", "0.5544227", "0.54869956", "0.5424184", "0.5418268", "0.5388014", "0.53603345", "0.53312665", "0.5312672", "0.5288557", "0.5276781", "0.52696323", "0.5251796", "0.52069867", "0.5192931", "0.5173881", "0.517242", "0.51717776", "0.5166225", "0.5164944", "0.5137351", "0.51328206", "0.5120206", "0.5118701", "0.51099694", "0.50999635", "0.50865746", "0.50630724", "0.5060548", "0.50499105", "0.50417936", "0.5018889", "0.49815857", "0.49736694", "0.4936", "0.49124515", "0.49124515", "0.4908839", "0.4893853", "0.48834595", "0.48684534", "0.48677388", "0.48670924", "0.48486093", "0.4844287", "0.48244372", "0.48075566", "0.4791215", "0.47815123", "0.47718528", "0.47562087", "0.47544986", "0.47378102", "0.47370994", "0.47262943", "0.47228798", "0.47201002", "0.47119007", "0.4703833", "0.47030336", "0.46985435", "0.46980017", "0.46929497", "0.46859002", "0.4684141", "0.4681686", "0.46769902", "0.46713457", "0.46696413", "0.46654937", "0.46630633", "0.4659559", "0.46573102", "0.46500975", "0.46462724", "0.46373427", "0.4634679", "0.46331114", "0.46297422", "0.462628", "0.46247032", "0.46186975", "0.4616546", "0.46061313", "0.4602083", "0.45988658", "0.45872402", "0.4586168", "0.45812717", "0.45801467", "0.457568", "0.45754564", "0.45715755" ]
0.82013744
0
deduct capacity from apps in a greedy manner total: total capacity to deduct apps: apps to deduct capacity from op: operation capacities: origin capacities of apps
function deductCapacity(prefix, total, apps, belowCapacities, op, capacities) { log('debug', 'deduct capacity '+total+' from '+apps.toString()+'-'+op); if(total == 0) return ; for(var appi = 0; appi < apps.length; appi++) { var app = apps[appi]; var spare = belowCapacities == null ? capacities[app][op] :capacities[app][op]-belowCapacities[app][op]; if(total > spare && spare != 0) { log('debug', 'deduct capacity '+spare+' from '+app+'-'+op); var newCapacity = capacities[app][op]-spare; setCapacity(prefix, app, op, newCapacity, capacities); total -= spare; } else { log('debug', 'deduct capacity '+total+' from '+app+'-'+op); var newCapacity = capacities[app][op]-total; setCapacity(prefix, app, op, newCapacity, capacities); break ; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function distributeCapacityEvenly(capacityPrefix, capacity, apps, op, capacities) {\n var extra = Math.floor(Math.abs(capacity/apps.length));\n if(capacity < 0) extra = -1*extra;\n // luckApp is randomly picked up app to receive the remaining capacity, \n // example: capacity = 3, #app is 2, each of which gets 1, luckyApp get remaining 1\n log('debug', 'redistributing capacity '+capacity+' among '+apps.toString()+'-'+op);\n if(extra != 0) {\n for(var appi = 0; appi < apps.length; appi++) {\n var app = apps[appi];\n var newCapacity = capacities[app][op]+extra;\n setCapacity(capacityPrefix, app, op, newCapacity, capacities);\n }\n }\n\n if(capacity%apps.length == 0) return;\n else {\n var luckyApp = apps[0]; \n var newCapacity = capacities[luckyApp][op]+capacity%apps.length;\n setCapacity(capacityPrefix, luckyApp, op, newCapacity, capacities);\n }\n}", "function solution(juice, capacity) {\n // write your code in JavaScript (Node.js 8.9.4)\n\n let newCapacity = capacity;\n newCapacity.sort((a, b) => {\n return b - a;\n });\n let sumJuice = juice.reduce((a, b) => a + b, 0);\n\n if (newCapacity[0] >= sumJuice) {\n return juice.length;\n }\n\n let combine = juice.map((val, index) => {\n let spaceLeftInGlass = capacity[index] - val;\n let arr = [val, capacity[index], spaceLeftInGlass];\n return arr;\n });\n\n combine.sort((a, b) => {\n return b[2] - a[2] || b[1] - a[1];\n });\n\n let biggestSpace = combine[0][2];\n\n combine.splice(0, 1);\n combine.sort((a, b) => {\n return a[0] - b[0];\n });\n\n let maxMix = 1;\n\n for (let i = 0; i < combine.length; i++) {\n biggestSpace -= combine[i][0];\n\n if (biggestSpace < 0) {\n return maxMix;\n }\n maxMix++;\n }\n}", "function knapSack(capacity, values, weights) {\n var n = values.length,\n load = 0,\n i = 0,\n val = 0;\n\n for (i=0; i<n && load < capacity; i++) { //While the total load is less than the capacity, we will iterate the items\n //If we can use the total weight of the item, then we will add it to the total value (val) and update the current load of the knapsack\n if (weights[i] <= (capacity-load)) {\n val += values[i];\n load += weights[i];\n console.log('using item ' + (i+1) + ' for the solution');\n } else {\n //If we cannot use the total weight of the item, we will calculate what is the ratio (r) that we can use\n var r = (capacity-load)/weights[i]; \n val += r * values[i];\n load += weights[i];\n console.log('using ratio of ' + r + ' for item ' + (i+1) + ' for the solution');\n }\n }\n return val;\n}", "function knapsackProblem(items, capacity) {\n let memo = new Array(capacity + 1);\n for (let i = 0; i < memo.length; i++) {\n memo[i] = [0, []];\n }\n for (let j = 0; j < items.length; j++) {\n let currentItem = items[j];\n let currentValue = currentItem[0];\n let currentWeight = currentItem[1];\n\n for (let i = memo.length - 1; i >= currentWeight; i--) {\n let prevBest = memo[i - currentWeight];\n if (memo[i][0] < prevBest[0] + currentValue) {\n memo[i][0] = prevBest[0] + currentValue;\n memo[i][1] = [...prevBest[1], j];\n }\n }\n }\n return memo[memo.length - 1];\n}", "function calculateNewValue(usedCapacity, provisionedCapacity, conf) {\r\n\tnewValue = provisionedCapacity;\r\n\tusedPercent = Math.ceil(usedCapacity / provisionedCapacity * 100);\r\n\tif (usedPercent > conf.increaseAbovePercent) {\r\n\t\tnewValue = Math.ceil(provisionedCapacity * (1 + conf.increaseByPercent / 100));\r\n\r\n\t\t// If more capacity is used than is available\r\n\t\t// base new value on used capacity instead of\r\n\t\t// provisioned capacity to prevent throttling\r\n\t\tif (usedPercent > 100) {\r\n\t\t\tnewValue = Math.ceil(usedCapacity * (1 + conf.increaseByPercent / 100));\r\n\t\t}\r\n\t} else if (usedPercent < conf.decreaseBelowPercent) {\r\n\t\tnewValue = Math.ceil(provisionedCapacity * (1 - conf.decreaseByPercent / 100));\r\n\r\n\t\tif(usedPercent == 0) {\r\n\t\t\tnewValue = conf.min;\r\n\t\t}\r\n\t}\r\n\r\n\t// Bind value to minimum configured capacity\r\n\tif(newValue < conf.min) {\r\n\t\tnewValue = conf.min;\r\n\t}\r\n\r\n\t// Bind value to maximum configured capacity\r\n\tif(newValue > conf.max) {\r\n\t\tnewValue = conf.max;\r\n\t};\r\n\r\n\treturn newValue;\r\n}", "function updateCost(){\n\n\t\tGraph.instance.edges.forEach(function(key,edge){\n\t\t\tstate.edgePrevCost[edge.id] = edge.resources[1];\n\t\t\tif(mainLoopCounter == 1){\n\t\t\t\tedge.edges = {\n\t\t\t\t\t\"cost\": edge.resources[1],\n\t\t\t\t\t\"cap\": edge.resources[0],\n\t\t\t\t\t\"id\": edge.id\n\t\t\t\t\t\n\t\t\t\t};\n\t\t\t}\n\t\t\t//if(edge.resources[1] > 0){\n\t\t\t\tedge.resources[1] = initialCost[edge.id] - edge.start.p + edge.end.p;\n\t\t\t//}\n\t\t\t\n\t\t});\n\t\tvar cap = [];\n\t\tfor (var i =0; i<state.edgesOfSP.length; i++){\n\t\t\t\n\t\t\tcap[i] = state.edgesOfSP[i].resources[0]-state.edgesOfSP[i].state.flow;\n\t\t\t\n\t\t}\n\t\tvar minCap = d3.min(cap);\n\t\tvar minED = Math.min(Graph.instance.nodes.get(state.sourceId).b , -Graph.instance.nodes.get(state.targetId).b);\n\t\t\n\t\tstate.current_step = STEP_APPLYPATH;\n\t\tdel = Math.min(minCap,minED);\n\t}", "function maxKnapsack(weights, profits, capacity, currentIndex){\nlet profit1 = -1\n if (profits.length <=currentIndex || capacity < 0 ){\n return 0;\n }\n if (weights[currentIndex] <= capacity){\n profit1 = profits[currentIndex] + maxKnapsack(weights, profits, capacity - weights[currentIndex], currentIndex + 1);\n }\n \n profit2 = maxKnapsack(weights, profits,capacity,currentIndex + 1 )\n\nreturn Math.max(profit1, profit2)\n}", "function knapSack(weight,values,capacity){\n if(capacity <= 0 || !weight.length || !values.length) return 0;\n\n function traverse(index1, index2 , capacity){\n let maxVal = 0;\n if(index1 > weight.length) return 0;\n if(capacity === 0) {\n maxVal = capacity - netWeight;\n return maxVal;\n }\n if(capacity < 0){\n return;\n }\n traverse(index1, index2 + 1, values[index]+values[index+1], capacity + weight[index]);\n traverse(index1 + 1, index1 + 1, )\n\n }\n}", "get capacity () {return this._p.capacity;}", "function knapsack(capacity, size, value, n) {\r\n\tif (n == 0 || capacity == 0) {\r\n\t\treturn 0;\r\n\t}\r\n\tif (size[n-1] > capacity) {\r\n\t\treturn knapsack(capacity, size, value, n-1);\r\n\t}\r\n\telse {\r\n\treturn max(value[n-1] +\r\n\t\tknapsack(capacity-size[n-1], size, value, n-1),\r\n\t\tknapsack(capacity, size, value, n-1));\r\n\t}\r\n}", "compute() {\n let v = {}\n\n // Operational Hours[h / yr]\n const operationalHours = this.params['DAC Capacity Factor'] * HOURS_PER_YEAR\n\n // Planned Capacity Factor\n v['Planned Capacity Factor'] = this.tech['Availability']\n\n // Electric Power Requirement[MW](aka low value case in C1)\n v['Base Energy Requirement [MW]'] = this.baseReq\n\n // calculate battery params now\n if (this.battery) {\n // TODO: check that this is the correct value to pass to the battery computation\n const bat = this.battery.compute(v)\n v = Object.assign(v, bat)\n }\n\n // Plant Size[MW]\n v['Plant Size [MW]'] =\n v['Base Energy Requirement [MW]'] / v['Planned Capacity Factor']\n if (this.battery) {\n v['Plant Size [MW]'] += v['Increased Need [MW]']\n }\n\n // Overnight Cost [M$]\n v['Overnight Cost [M$]'] =\n this.tech['Base Plant Cost [M$]'] *\n (v['Plant Size [MW]'] / this.tech['Plant Size [MW]']) **\n this.tech['Scaling Factor']\n\n // Lead Time Multiplier\n v['Lead Time Multiplier'] = this.leadTimeMult(\n this.tech['Lead Time [Years]'].toFixed(0)\n )\n\n // Capital Cost [M$]\n v['Capital Cost [M$]'] =\n v['Overnight Cost [M$]'] * v['Lead Time Multiplier']\n\n // Total Capital Cost [M$]\n v['Total Capital Cost [M$]'] = v['Capital Cost [M$]']\n if (this.battery) {\n v['Total Capital Cost [M$]'] += v['Battery Capital Cost [M$]']\n }\n\n // Annual Capital Recovery Factor\n const annualCapitalRecoveryFactor = this.recoveryFactor()\n\n // Capital Recovery[$/tCO2eq]\n v['Capital Recovery [$/tCO2eq]'] =\n (v['Total Capital Cost [M$]'] * annualCapitalRecoveryFactor * MILLION) /\n this.params['Scale [tCO2/year]']\n\n // Power Fixed O&M [$/tCO2eq]\n v['Power Fixed O&M [$/tCO2eq]'] =\n (this.tech['Base Plant Annual Fixed O&M [$M]'] *\n (v['Plant Size [MW]'] / this.tech['Plant Size [MW]']) **\n this.tech['Scaling Factor'] *\n MILLION) /\n this.params['Scale [tCO2/year]']\n\n // Power Variable O&M [$/tCO2eq]\n v['Power Variable O&M [$/tCO2eq]'] =\n (this.tech['Variable O&M [$/MWhr]'] *\n v['Plant Size [MW]'] *\n operationalHours) /\n this.params['Scale [tCO2/year]']\n\n // Total Fixed O&M [$/tCO2eq]\n v['Total Fixed O&M [$/tCO2eq]'] = v['Power Fixed O&M [$/tCO2eq]']\n if (this.battery) {\n v['Total Fixed O&M [$/tCO2eq]'] += v['Battery Fixed O&M [$/tCO2eq]']\n }\n\n // Total Variable O&M [$/tCO2eq]\n v['Total Variable O&M [$/tCO2eq]'] = v['Power Variable O&M [$/tCO2eq]']\n if (this.battery) {\n v['Total Variable O&M [$/tCO2eq]'] += v['Battery Variable O&M [$/tCO2eq]']\n }\n\n // Natural Gas Use[mmBTU / tCO2eq]\n const heatRate = this.tech['Final Heat Rate [BTU/kWh]']\n if (heatRate) {\n v['Natural Gas Use [mmBTU/tCO2eq]'] =\n (operationalHours *\n v['Plant Size [MW]'] *\n KW_TO_MW *\n this.tech['Final Heat Rate [BTU/kWh]']) /\n MILLION /\n this.params['Scale [tCO2/year]']\n } else {\n v['Natural Gas Use [mmBTU/tCO2eq]'] = 0.0\n }\n\n // Natural Gas Cost [$/tCO2eq]\n v['Natural Gas Cost [$/tCO2eq]'] =\n v['Natural Gas Use [mmBTU/tCO2eq]'] *\n this.params['Natural Gas Cost [$/mmBTU]']\n\n // Emitted tCO2eq / tCO2\n if (v['Natural Gas Use [mmBTU/tCO2eq]'] > 0) {\n v['Emitted [tCO2/tCO2]'] =\n v['Natural Gas Use [mmBTU/tCO2eq]'] *\n this.tech['Total CO2 eq [lb/mmbtu]'] *\n LB_TO_METRIC_TON *\n (1 - this.tech['Capture Efficiency'])\n } else {\n v['Emitted [tCO2/tCO2]'] = 0\n }\n\n return v\n }", "function dKnapsack(capacity, size, value, n) {\r\n\tvar K = [];\r\n\tvar retStr=\"\";\r\n\tfor (var i = 0; i <= capacity+1; i++) {\r\n\t\tK[i] = [];\r\n\t}\r\n\tfor (var i = 0; i <= n; i++) {\r\n\t\tfor (var w = 0; w <= capacity; w++) {\r\n\t\t\tif (i == 0 || w == 0) {\r\n\t\t\t\tK[i][w] = 0;\r\n\t\t\t}\r\n\t\t\telse if (size[i-1] <= w) {\r\n\t\t\t\tK[i][w] = max(value[i-1] + K[i-1][w-size[i-1]],\r\n\t\t\t\tK[i-1][w]);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tK[i][w] = K[i-1][w];\r\n\t\t\t}\r\n\t\t\tretStr+=(K[i][w] + \" \");\r\n\t\t}\r\n\t\tretStr+=\"\\n\";\r\n\t}\r\n\tconsole.log(retStr);\r\n\treturn K[n][capacity];\r\n}", "function calcSecurity() {\n\n // percent = balanceScore + supplyScore [%]\n var percent, balanceScore, supplyScore;\n \n balanceScore = 0.0;\n supplyScore = 0.0;\n \n // WEIGHTS SHOULD ADD UP TO 1.0\n var BALANCE_WEIGHT = 0.5;\n var SUPPLY_WEIGHT = 0.5;\n\n // Magnitude of allowed value difference before score reaches 0% (1.0 for 100% deviance; 2.0 for 200% deviance, etc)\n var TOLERANCE = 2.0;\n // Ideal %Capacity Available in Network\n var IDEAL_NETWORK_BUFFER = 0.2;\n \n var siteCapacity;\n var totalCapacity, numBackup, bufferSupply;\n var scoreCount;\n var current;\n \n // If Demand Exists; NCE's Score Counts toward Total\n scoreCount = 0;\n \n // Cycles through Each NCE\n for (var i=0; i<agileModel.activeProfiles.length; i++) {\n\n numBackup = 0.0;\n \n // Calculates NCE Capacity at each site;\n siteCapacity = new Array(agileModel.SITES.length);\n for (var s=0; s<agileModel.SITES.length; s++) {\n siteCapacity[s] = 0.0;\n for (var b=0; b<agileModel.SITES[s].siteBuild.length; b++) {\n current = agileModel.SITES[s].siteBuild[b];\n if (current.PROFILE_INDEX == agileModel.activeProfiles[i].ABSOLUTE_INDEX) {\n siteCapacity[s] += current.capacity;\n }\n }\n \n }\n \n // Calculates Total NCE Capacity\n totalCapacity = 0.0;\n for (var s=0; s<agileModel.SITES.length; s++) {\n totalCapacity += siteCapacity[s];\n }\n \n var demand = float(agileModel.activeProfiles[i].demandProfile.getString(2, min(session.current.TURN, NUM_INTERVALS-1) ));\n demand /= 1000.0; // units of kiloTons\n \n // Calaculates normalized balance and supply scores and adds them to total\n if ( demand > 0) { // Only scores if demand exists\n // If Demand Exists; NCE's Score Counts toward Total\n scoreCount ++;\n \n // Determines how many \"backup\" sites there are\n if (agileModel.SITES.length == 1) {\n // Scores Perfect if only one site\n numBackup = 1.0;\n } else {\n // assigns \"1\" if capacity exists at site\n for (var s=0; s<agileModel.SITES.length; s++) {\n if (siteCapacity[s] > 0.0) {\n numBackup += 1.0;\n }\n }\n }\n \n // normalizes balance/backup to a score 0.0 - 1.0;\n if (agileModel.SITES.length > 1) {\n numBackup -= 1.0; // Eliminates effect of first site\n numBackup /= (agileModel.SITES.length - 1);\n if (numBackup < 0.0) numBackup = 0.0;\n }\n \n // Adds the current NCE's balance score to the overall\n balanceScore += agileModel.activeProfiles[i].weightBalance * numBackup;\n \n\n // Calculate Normalized supply score and add it to total\n var sup = 0;\n bufferSupply = (1.0 + IDEAL_NETWORK_BUFFER) * demand / totalCapacity;\n if (totalCapacity == 0) {\n sup = 0.0;\n } else if (bufferSupply > 0 && bufferSupply <= 1.0) {\n sup = 1.0;\n } else if (bufferSupply > 1.0) {\n sup = TOLERANCE - bufferSupply;\n if (sup < 0.0) sup = 0;\n }\n supplyScore += agileModel.activeProfiles[i].weightSupply * sup;\n \n }\n \n }\n \n // Aggregate scores\n balanceScore /= scoreCount;\n supplyScore /= scoreCount;\n percent = BALANCE_WEIGHT * balanceScore + SUPPLY_WEIGHT * supplyScore;\n \n return percent;\n}", "function calcAmount(fillParam, capacityParam) {\n return fillParam * capacityParam;\n}", "function Cup(initialCapacity) {\n this.capacity = initialCapacity || 12;\n this.volume = 0;\n\n this.add = function (v) {\n if (v > this.capacity) { throw(\"Too much coffee\"); }\n this.volume += v;\n };\n}", "function knapsackProblem(items, capacity, maxVal = [0, []], currentValue = [0, []], idx = 0) {\n if(!items.length || capacity === 0) {\n return currentValue\n }\n\t\n\tfor(let i = 0; i < items.length; i++){\n let next;\n let skip;\n\t\tif(capacity-items[i][1] >= 0) {\n\t\t\tnext = knapsackProblem(items.slice(i+1), capacity-items[i][1], maxVal, [currentValue[0]+items[i][0], [...currentValue[1], idx+i]], idx+i+1);\n\t\t skip = knapsackProblem(items.slice(i+1), capacity, maxVal, currentValue, idx+i+1);\n if(next[0] > skip[0]) {\n if(next[0] > maxVal[0]) {\n maxVal = next\n }\n }\n else {\n if(skip[0] > maxVal[0]) {\n maxVal = skip\n }\n }\n\t }\t\t\n\t}\n if(currentValue[0] > maxVal[0]) {\n\t\tmaxVal = currentValue\n\t}\n\treturn maxVal;\n}", "function get_available_capacity(capacity) {\n if (capacity) {\n return 1;\n } else {\n return 0;\n }\n }", "function budgetCalculator(watch, phone, laptop){\n // cost every single item\n var watchCost = watch * 50;\n var phoneCost = phone * 100;\n var laptopCost = laptop * 500;\n //total cost of all item.\n var totalCost = watchCost + phoneCost + laptopCost;\n return totalCost;\n\n}", "function bagTheBestDeal(n, c){\n\t\t// n: remaining items to consider\n\t\t// c: remaining capacity of the bag\n\n\t\t//console.log(`\\nConsidering item at index ${n} with weight: ${w[n]} and value: ${v[n]}`)\n\t\t//console.log(['remaining items', 'remaining capacity'])\n\t\t//console.log([n, c])\n\t\t\n\t// Base cases\n\t\t// when the result is already calculated in the past\n\t\tif (DPArr[n][c] != null) {\n\t\t\tconsole.log(`Using memo`)\n\t\t\treturn DPArr[n][c]\n\t\t}\t\n\t\t\n\t\t// when no items left, or no capacity left\n\t\tif (n==0 || c == 0){\treturn 0}\n\n\t// Recursive cases\n\t\tlet result = 0\n\t\tif (w[n] > c){ \t// dont put current item but investigate the remaining items\n\t\t\t//console.log('\\tOnly One Way to Go')\n\t\t\tresult = bagTheBestDeal(n-1, c)\t\t\t\n\t\t}else {\n\t\t\t//console.log('\\tConsidering both Options')\n\t\t\tlet putTheItem \t\t= v[n] + bagTheBestDeal(n-1, c-w[n])\n\t\t\tlet dontPutTheItem \t= \t\t bagTheBestDeal(n-1, c)\n\t\t\t\n\t\t\t// Include the item in the baggedItems array (if putTheItem is the way to go) and \n\t\t\t// return the max of the two values\n\t\t\tif (putTheItem >= dontPutTheItem){\n\t\t\t\tlet key = `item ${n}`\n\t\t\t\tif (!baggedItems.get(key)){\n\t\t\t\t\tbaggedItems.set(key, `Weight: ${w[n]}, Value: ${v[n]}`)\n\t\t\t\t} \n\t\t\t\tresult = putTheItem\n\t\t\t}else{\n\t\t\t\tresult = dontPutTheItem\n\t\t\t}\n\t\t\t//result = Math.max(putTheItem, dontPutTheItem)\t\t\t\n\t\t}\n\n\t\tDPArr[n][c] = result\n\t\treturn result\n\n\t}", "function decrementCapacity() {\n var data = {\n action: \"decrement\",\n group: $scope.group\n };\n\n // Calls the decrement capacity method in the registration factory.\n RegistrationFactory.decrementCapacity(data)\n .then(function(response) {\n if (response == true) {\n isThereCapacity();\n }\n });\n }", "function greedyPoo(items) {\n var resultsGreed = [];\n let currentSize = 0;\n let currentValue = 0;\n \n sortedStuff(greedItems).forEach(item => {\n if(currentSize + item.size <= capacity) {\n resultsGreed.push(item.index);\n currentSize += item.size;\n currentValue += item.value;\n } \n })\n return {resultsGreed, currentSize, currentValue};\n }", "function optimalUtilization(deviceCapacity, foregroundAppList, backgroundAppList) {\n\n const optimalPairs = [];\n const optimalPairsIds = [];\n let max = 0;\n\n for (let i = 0; i < foregroundAppList.length; i++) {\n const foreApp = foregroundAppList[i];\n const foreAppId = foreApp[0];\n const foreAppMemory = foreApp[1];\n\n for (let j = 0; j < backgroundAppList.length; j++) {\n const bgApp = backgroundAppList[j];\n const bgAppId = bgApp[0];\n const bgAppMemory = bgApp[1];\n\n const pairMemory = foreAppMemory + bgAppMemory;\n\n if (pairMemory <= deviceCapacity) {\n if (max < pairMemory) {\n max = pairMemory;\n }\n\n optimalPairs.push({\n ids: [foreAppId, bgAppId],\n memory: pairMemory\n });\n }\n }\n }\n\n for (let i = 0; i < optimalPairs.length; i++) {\n const pair = optimalPairs[i];\n if (pair.memory === max) { //if memory is equal to the best optimal pair memory required\n optimalPairsIds.push(pair.ids);\n }\n }\n\n console.log(optimalPairs);\n console.log(optimalPairsIds);\n return optimalPairsIds;\n}", "compute(eVals) {\n const v = {}\n\n // Battery Capacity[MWh]\n v['Battery Capacity [MWh]'] =\n eVals['Base Energy Requirement [MW]'] *\n (HOURS_PER_DAY * (1 - eVals['Planned Capacity Factor']))\n\n // Round Trip Efficiency\n v['Round Trip Efficiency'] = this.tech['Efficiency (Thermal or Round Trip)']\n\n // Battery Capacity Needed[MWh]\n v['Battery Capacity Needed [MWh]'] =\n v['Battery Capacity [MWh]'] / v['Round Trip Efficiency']\n\n // Increased[MWh]\n v['Increased [MWh]'] =\n v['Battery Capacity Needed [MWh]'] - v['Battery Capacity [MWh]']\n\n // Increased Solar / Wind Need\n v['Increased Need [MW]'] =\n v['Increased [MWh]'] / (HOURS_PER_DAY * eVals['Planned Capacity Factor'])\n\n // Battery Capital Cost [M$]\n v['Battery Capital Cost [M$]'] =\n this.tech['Base Plant Cost [M$]'] *\n (v['Battery Capacity Needed [MWh]'] /\n this.tech['Battery Capacity [MWhr]']) **\n this.tech['Scaling Factor']\n\n // Battery Fixed O&M [$/tCO2eq]\n v['Battery Fixed O&M [$/tCO2eq]'] =\n (this.tech['Base Plant Annual Fixed O&M [$M]'] *\n (v['Battery Capacity Needed [MWh]'] /\n this.tech['Battery Capacity [MWhr]']) **\n this.tech['Scaling Factor'] *\n MILLION) /\n this.params['Scale [tCO2/year]']\n\n // Battery Variable O&M [$/tCO2eq]\n v['Battery Variable O&M [$/tCO2eq]'] =\n ((this.tech['Variable O&M [$/MWhr]'] * v['Battery Capacity [MWh]']) /\n this.params['Scale [tCO2/year]']) *\n DAYS_PER_YEAR\n\n return v\n }", "function calculDeductible () {\n for (var i = 0; i < deliveries.length; i++) {\n if (deliveries[i].options.deductibleReduction == true) {\n deliveries[i].price += deliveries[i].volume\n deliveries[i].commission.convargo += deliveries[i].volume\n }\n }\n}", "function budgetCalculator(watch, phone, laptop) {\n let calculateWatch = watch * 50;\n let calculatePhone = phone * 100;\n let calculateLaptop = laptop * 500;\n let totalCost = calculateWatch + calculatePhone + calculateLaptop;\n return totalCost; \n}", "function branchingProcess() {\n var implicantsPowerSet = powerSet(remainingImplicants);\n validSolutions = filterPowerSet(implicantsPowerSet); //array contains valid cominations\n var currentValidSolutions = validSolutions.slice();\n minimalSolutions = filterPossibleSolutions(currentValidSolutions); //array contains valid combainations with least cost\n}", "function computeBestAction(){\n \n var buyMin;\n var upgradeMin = computeBestUpgradeEfficiency();\n \n if(totalProduction > totalDistribution){\n buyMin = computeBestDistributionEfficiency();\n }\n else {\n buyMin = computeBestManufactorEfficiency();\n }\n \n return Math.min(buyMin,upgradeMin);\n}", "calculateSpace()\n {\n\n return (this.getMaxBudget() - this.sumOfExpenses());\n }", "get capacity () {return this._pool.length;}", "get desiredCapacityInput() {\n return this._desiredCapacity;\n }", "_decideActions(dailies) {\n let choices = dailies.reduce((partial, action) => {\n if (partial.allocated <= this.HOURS && Rate.test(action.rate)) {\n partial.allocated += action.duration.hours;\n partial.actions.push(action);\n } else {\n partial.skips.push(action);\n }\n return partial;\n }, {actions: [], skips: [], allocated: 0});\n // console.log(`Allocated ${choices.allocated} hours`);\n // console.log('what agent wish to do', choices.actions);\n // console.log('what agent wish to skip', choices.skips);\n return choices;\n }", "getTotalRequirements() {\n let asps = []\n let reqs = {\n force: 0,\n entropy: 0,\n form: 0,\n inertia: 0,\n life: 0,\n }\n\n for (let x in this.app.state.aspects) {\n asps.push(this.getReferenceById(this.app.state.aspects[x].id))\n }\n\n for (let x in asps) {\n for (let z in asps[x].requirements) {\n let amount = asps[x].requirements[z]\n if (amount > reqs[z])\n reqs[z] = amount\n }\n }\n\n return reqs;\n }", "function calculateResourcesProd(playingGame) {\n let production = new ResourcesSet(0, 0, 0, 0);\n\n Object.keys(playingGame.constrBuildingAccount).forEach( keyBuilding => {\n let building = buildingsList[keyBuilding];\n let nbBuildings = playingGame.constrBuildingAccount[keyBuilding];\n\n Object.keys(building.prod).forEach( keyResource => {\n production[keyResource] += nbBuildings * building.prod[keyResource];\n });\n });\n\n return production;\n}", "recharge() {\n const rechargeDuration = this.getAliveOperators().map((operator) => {\n operator.recharge();\n\n return operator.getRechargeDuration();\n }).reduce((totalRecharge = 0, operatorRecharge) => {\n return totalRecharge + operatorRecharge;\n }, 0);\n\n if (VehicleDefaults.MinOperatorsCount > rechargeDuration) {\n super.recharge();\n }\n }", "function budgetCalculator(watch, mobile, laptop) {\r\n let watchPrice = 50;\r\n let mobilePrice = 100;\r\n let laptopPrice = 500;\r\n watchPrice = watch * watchPrice;\r\n mobilePrice = mobile * mobilePrice;\r\n laptopPrice = laptop * laptopPrice;\r\n const totalProductPrice = watchPrice + mobilePrice + laptopPrice;\r\n return totalProductPrice;\r\n}", "function maxDuffelBagValue(cakeTypes, weightCapacity) {\r\n\r\n // Calculate the maximum value we can carry\r\n \r\n // S1: Make an arr that stores the maximum possible value \r\n // at every integer capacity from 0 to weightCapacity\r\n // Starting each index with value 0\r\n const maxValuesAtCaps = new Array(weightCapacity + 1).fill(0);\r\n\r\n // S2: Loop through the capacities until until our capacity\r\n for(let currentCap = 0; currentCap <= weightCapacity; currentCap++) {\r\n let currentMaxValue = 0;\r\n \r\n // Loop through the cake types.\r\n // We use a for loop instead of forEach because we have infinity in there\r\n for(let j = 0; j < cakeTypes.length; j++){\r\n const cakeType = cakeTypes[j];\r\n \r\n // Edge: If cake weights 0 and has a positive value. Infinite monies!\r\n if(cakeType.weight === 0 && cakeType.value > 0) {\r\n return Infinity;\r\n }\r\n \r\n // If cake weight is less than our capacity\r\n if(cakeType.weight <= currentCap) {\r\n // Should we use this cake? \r\n // If yes, the most weight we can include in addition to the cake\r\n // we're adding is the current capacity minus cake's weight.\r\n // So we find max value at that integer capacity in maxValuesAtCaps\r\n const maxValueUsingCake = cakeType.value + maxValuesAtCaps[currentCap - cakeType.weight];\r\n // NOW we check if we want this cake\r\n // How does the value with the cake compare to currentMaxValue?\r\n currentMaxValue = Math.max(maxValueUsingCake, currentMaxValue);\r\n }\r\n }\r\n\r\n // Add each capacity's max value to our arr so we can use them \r\n // when calculating all the remaining capacities \r\n maxValuesAtCaps[currentCap] = currentMaxValue;\r\n } \r\n \r\n // Return the value at the capacity we're looking for\r\n return maxValuesAtCaps[weightCapacity];\r\n}", "function budgetCalculator (watch,phone,laptop) {\n var watch = Math.abs (watch);\n var phone= Math.abs (phone);\n var laptop = Math.abs (laptop);\n var totalWatchCost = watch * 50;\n var totalPhoneCost = phone * 100;\n var totalLaptopCost = laptop * 500;\n var totalCost = totalWatchCost + totalPhoneCost + totalLaptopCost;\n return totalCost;\n }", "function getMoneySpent(keyboards, drives, b) {\n let max_k_index = -1;\n let max_sum = -1;\n let max_d_index = -1;\n for (let i = 0; i < keyboards.length; i++) {\n const k = keyboards[i];\n if (k > b) continue;\n // console.log('affordable keyboard candidate:', i, '->', k);\n for (let j = 0; j < drives.length; j++) {\n const d = drives[j];\n if (d > b) continue;\n // console.log('affordable drive candidate:', j, '->', d);\n const sum = k + d;\n if (sum > b) continue;\n console.log('affordable combo:', i, ',', j, '=>', k, '+', d, '=', sum);\n if (sum > max_sum) {\n max_sum = sum;\n max_k_index = i;\n max_d_index = j;\n console.log('max affordable combo:', max_k_index, ',', max_d_index, '=>', k, '+', d, '=', max_sum);\n }\n }\n }\n if (max_sum === -1) return -1; // can't find any keyboard+drive combo that fits the budget\n return keyboards[max_k_index] + drives[max_d_index];\n}", "get capacity () {\n\t\treturn this._capacity;\n\t}", "minusFromTotal (price, optionName, subOptionName) {\n let newStorage = Object.assign({}, this.state.selectionStorage);\n // if selection queue is empty don't dequeue\n if (!newStorage[optionName] || newStorage[optionName].isEmpty()) {\n console.log('you have no selection in this catagory!')\n // if selection queue is with limit dont dequeue\n } else if (newStorage[optionName].length <= this.state.itemOptions.min) {\n console.log('you need to add at lease one option from this catagory.')\n // otherwise dequeue the item\n } else {\n newStorage[optionName].dequeue();\n this.setState({\n selectionStorage: newStorage\n });\n }\n this.setState({\n price: numberCurrency(this.state.price, 2) - numberCurrency(price, 2)\n });\n }", "computeRefuel() {\n return ((100 - this._fuelLevel) / 100) * this._capacity;\n }", "function BPQ(capacity) {\n this.capacity = capacity;\n this.elements = [];\n}", "function updateTotalCookPerSecChain(){\n updateTotalCookPerSec();\n \n if(dist[item]){\n updateTotalDistribution();\n }\n else{\n updateTotalProduction();\n }\n \n updateTimeToGet();\n updateEfficiency();\n}", "function budgetCalculator(clock, mobile, laptop) {\n var clockPrice = clock * 50;\n var mobilePrice = mobile * 100;\n var laptopPrice = laptop * 500;\n var totalbudget = clockPrice + mobilePrice + laptopPrice;\n return totalbudget;\n}", "function OptimalItem() {\r\n copyStuff();\r\n for (i = UpgradesInStore.length - 1; i >= 0; i = i - 1) {\r\n cps1 = 0;\r\n me = UpgradesInStore[i];\r\n x = UpgradesInStore[i].id;\r\n if (inArray(x, mustBuyUpgrades) && me.getPrice() < Game.cookies) {\r\n sel = me;\r\n name = me.name;\r\n price = Math.round(me.basePrice);\r\n selected = 1;\r\n return sel;\r\n }\r\n if (!inArray(x, disallowedUpgrades)) {\r\n UpgradesById[x].toggle();\r\n CalculateGains();\r\n for (j = ObjectsById.length - 1; j >= 0; j = j - 1) {\r\n cps1 += ObjectsById[j].cps() * ObjectsById[j].amount;\r\n }\r\n cps2 = cps1 * globalCpsMult;\r\n UpgradesById[x].toggle();\r\n CalculateGains();\r\n myCps = cps2 - currentCps;\r\n cpsUpgrade = me.basePrice * (cookiesPs + myCps) / myCps;\r\n if (cpsUpgrade < cpc && myCps >= 0.1) {\r\n cpc = cpsUpgrade;\r\n sel = me;\r\n cpsItem = myCps;\r\n name = me.name;\r\n price = Math.round(me.basePrice);\r\n }\r\n }\r\n }\r\n for (i = ObjectsById.length - 1; i >= 0; i = i - 1) {\r\n cps1 = 0;\r\n me = ObjectsById[i];\r\n me.amount = me.amount + 1;\r\n CalculateGains();\r\n for (j = ObjectsById.length - 1; j >= 0; j = j - 1) {\r\n cps1 += ObjectsById[j].cps() * ObjectsById[j].amount;\r\n }\r\n cps2 = cps1 * globalCpsMult;\r\n me.amount = me.amount - 1;\r\n CalculateGains();\r\n myCps = cps2 - currentCps;\r\n cpsBuilding = me.price * (cookiesPs + myCps) / myCps;\r\n if (cpsBuilding < cpc && myCps >= 0.1) {\r\n cpc = cpsBuilding;\r\n sel = me;\r\n cpsItem = myCps;\r\n name = me.name;\r\n price = Math.round(me.price);\r\n }\r\n }\r\n currentCps = cookiesPs;\r\n selected = 1;\r\n\r\n return sel;\r\n}", "function moneyProducers() {\n\tmoneyClicks += workers;\n\tmoneyClicks += teamLeader * teamLeaderMPS;\n\tmoneyClicks += manager * managerMPS;\n\n}", "function budgetCalculator(watch,mobile,laptop){\n var watch =watch*50; //quantity * fixed price\n var mobile =mobile*100;\n var laptop = laptop*500;\n var result=watch+mobile+laptop; //sum of all expenses & storing in a variable\n return result;\n }", "function budgetCalculator(watch,phone,laptop){\n var watchPrize=watch*50;\n var phonePrize=phone*100;\n var laptopPrize=laptop*500;\n var total= watchPrize+phonePrize+laptopPrize;\n return total;\n }", "function budgetCalculator(quantityOfWatch, quantityOfPhone, quantityOfLaptop){\n if(quantityOfWatch > 0 && quantityOfPhone > 0 && quantityOfLaptop >0){\n var costOfWatch = quantityOfWatch * 50; //each watch is of 50$\n var costOfPhone = quantityOfPhone * 100; //each phone is of 50$\n var costOfLaptop = quantityOfLaptop * 500; //each laptop is of 50$\n var totalCost = costOfWatch + costOfPhone + costOfLaptop;\n return totalCost;\n }else{\n return \"Error: Quantity of electronics cannot be negative or others!\";\n }\n}", "function getWaterCleaningCapacity(stats) {\n\tconst modulesWater = stats.containers.current.all\n\n\tlet totalWaterProduction = 0\n\tmodulesWater.forEach((container) => {\n\t\ttotalWaterProduction += container.waterProduction\n\t})\n\n\treturn totalWaterProduction\n}", "function fillLabFromContainer(creep, resourceType, targetLab, mineralContainer) {\n var stor = creep.room.storage; //storage\n //console.log('XDSSSSSSSSSSSSSSSSSSS' + resourceType + 'FSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS');\n if(creep.carry[resourceType] > 0) { // deliver resource to lab or storage\n creep.say('deliver');\n if(creep.transfer(targetLab, resourceType, creep.carry[resourceType])==ERR_NOT_IN_RANGE){\n //if(Object.keys(creep.carry).map((resource) => { creep.transfer(target, resource)== ERR_NOT_IN_RANGE}) ) {\n creep.moveTo(targetLab);\n }\n } else { //find resources\n /*if(_.sum(creep.carry) > 0) {\n if( Object.keys(creep.carry).map((resource) => { creep.transfer(stor, resource)== ERR_NOT_IN_RANGE}) ) {\n creep.moveTo(stor, {reusePath:3});\n }\n }*/\n if(mineralContainer.structureType==STRUCTURE_CONTAINER) { // its a container\n creep.say('fill');\n console.log('its a container @ storer');\n if(mineralContainer.store[resourceType] > 0) {\n creep.say('filLabF');\n //creep.say(resourceType);\n //creep.say('')\n if(creep.withdraw(mineralContainer, resourceType, creep.carryCapacity-_.sum(creep.carry))==ERR_NOT_IN_RANGE){\n creep.moveTo(mineralContainer, {reusePath:3});\n creep.say('bla');\n }\n }\n } else { // \n if(creep.withdraw(mineralContainer, RESOURCE_ENERGY, creep.carryCapacity-_.sum(creep.carry))==ERR_NOT_IN_RANGE){\n creep.moveTo(mineralContainer, {reusePath:3});\n }\n }\n }\n\n}", "function budgetCalculator(watch, phone, laptop) {\n var watch = watch * 50;\n var phone = phone * 100;\n var laptop = laptop * 500;\n var total = watch + phone + laptop;\n return total\n}", "function getOptimalActionsCap() {\n\t\tvar optimalCandidate = Math.round(\n\t\t\tfpsMs / (renderConfig.timePerLastFrame / renderConfig.totalActions)\n\t\t);\n\n\t\tif (isNaN(optimalCandidate) || !isFinite(optimalCandidate)) {\n\t\t\toptimalCandidate = 0;\n\t\t}\n\n\t\tvar optimalCap = Math.round(fpsMs * 3 / (avgActionTime || 1) || 10);\n\n\t\tif (optimalCap > 1) {\n\t\t\toptimalCap--;\n\t\t}\n\t\tvar maxLength = actionsList.length;\n\t\tif (maxLength - 1 < optimalCap) {\n\t\t\toptimalCap = maxLength;\n\t\t}\n\t\tif (maxLength >= maxSizeBeforeFlush) {\n\t\t\toptimalCap = flushSize;\n\t\t}\n\t\tif (maxLength > criticalSize) {\n\t\t\treturn criticalSize;\n\t\t}\n\t\tif (optimalCap < optimalCandidate && flushSize > optimalCap) {\n\t\t\tif (optimalCandidate <= maxLength) {\n\t\t\t\toptimalCap = optimalCandidate;\n\t\t\t}\n\t\t}\n\t\tif (maxLength > commonPoolSize && optimalCap < commonPoolSize) {\n\t\t\toptimalCap = commonPoolSize;\n\t\t}\n\n\t\treturn optimalCap;\n\t}", "doMath() {\n // Actual capacities\n const runningCap = this.props.workerType.runningCapacity;\n const pendingCap = this.props.workerType.pendingCapacity;\n const maxCap = this.props.workerType.maxCapacity;\n // We want to make sure that if a bar is there that it's visible\n const smallestCapUnit = maxCap * 0.05;\n // Fuzz the percentages to make sure all bars are visible. If we have a\n // state with 0%, we don't fuzz at all. If we have 1-4%, we round to 5%\n // and we don't fuzz above 5%\n const fuzzedRunning = runningCap\n ? Math.max(runningCap, smallestCapUnit)\n : 0;\n const fuzzedPending = pendingCap\n ? Math.max(pendingCap, smallestCapUnit)\n : 0;\n // Determine the number which we should use to figure out our percentages.\n // When we have less than the max configured, we use that setting. When we\n // exceed that amount, we want to sum up all the capacity units\n const count = fuzzedRunning + fuzzedPending;\n const divideBy = Math.max(maxCap, count);\n // Calculate the percentages to use for the bars. These numbers are\n // invalid for other purposes\n const runPer = fuzzedRunning / divideBy;\n const pendPer = fuzzedPending / divideBy;\n\n return {\n r: runPer * 100,\n p: pendPer * 100,\n rc: runningCap,\n pc: pendingCap\n };\n }", "function budgetCalculator(watch, phone, laptop) {\n var watchBudget = watch * 50;\n var phoneBudget = phone * 100;\n var laptopBudget = laptop * 500;\n var totalBudget = watchBudget +phoneBudget + laptopBudget;\n return totalBudget;\n}", "function budgetCalculator(watch, mobile, laptop) {\n var preiceOfWatch = watch * 50;\n var preiceOfMobile = mobile * 100;\n var preiceOfLaptop = laptop * 500;\n var total = preiceOfWatch + preiceOfMobile + preiceOfLaptop;\n return total;\n}", "function increaseSupply() {\n shiftSupply([1, -1]);\n }", "combinedPowerBlockRequirements(source, ev, tv) {\n const v = {}\n\n const tech = this.params['Technology'][source]\n\n // Operational Hours[h / yr]\n const operationalHours = this.params['DAC Capacity Factor'] * HOURS_PER_YEAR\n\n // Power Plant Size\n v['Plant Size [MW]'] = ev['Plant Size [MW]'] + tv['Plant Size [MW]']\n\n // Overnight Cost [M$]\n v['Overnight Cost [M$]'] =\n tech['Base Plant Cost [M$]'] *\n (v['Plant Size [MW]'] / tech['Plant Size [MW]']) ** tech['Scaling Factor']\n\n // Lead Time Multiplier\n v['Lead Time Multiplier'] = this.leadTimeMult(tech['Lead Time [Years]'])\n\n // Capital Cost [M$]\n v['Capital Cost [M$]'] =\n v['Overnight Cost [M$]'] * v['Lead Time Multiplier']\n\n // Power Fixed O&M [$/tCO2eq]\n v['Power Fixed O&M [$/tCO2eq]'] =\n (tech['Base Plant Annual Fixed O&M [$M]'] *\n (v['Plant Size [MW]'] / tech['Plant Size [MW]']) **\n tech['Scaling Factor'] *\n MILLION) /\n this.params['Scale [tCO2/year]']\n\n // Power Variable O&M [$/tCO2eq]\n v['Power Variable O&M [$/tCO2eq]'] =\n (tech['Variable O&M [$/MWhr]'] *\n v['Plant Size [MW]'] *\n operationalHours) /\n this.params['Scale [tCO2/year]']\n\n // Battery Capacity[MWh]\n v['Battery Capacity [MWh]'] =\n ev['Battery Capacity Needed [MWh]'] + tv['Battery Capacity Needed [MWh]']\n\n // Battery Capital Cost [M$]\n v['Battery Capital Cost [M$]'] =\n this.params['Technology']['Battery Storage']['Base Plant Cost [M$]'] *\n (v['Battery Capacity [MWh]'] /\n this.params['Technology']['Battery Storage'][\n 'Battery Capacity [MWhr]'\n ]) **\n this.params['Technology']['Battery Storage']['Scaling Factor']\n\n // Battery Fixed O&M [$/tCO2eq]\n v['Battery Fixed O&M [$/tCO2eq]'] =\n (this.params['Technology']['Battery Storage'][\n 'Base Plant Annual Fixed O&M [$M]'\n ] *\n (v['Battery Capacity [MWh]'] /\n this.params['Technology']['Battery Storage'][\n 'Battery Capacity [MWhr]'\n ]) **\n this.params['Technology']['Battery Storage']['Scaling Factor'] *\n MILLION) /\n this.params['Scale [tCO2/year]']\n\n // Battery Variable O&M [$/tCO2eq]\n v['Battery Variable O&M [$/tCO2eq]'] =\n ((this.params['Technology']['Battery Storage']['Variable O&M [$/MWhr]'] *\n v['Battery Capacity [MWh]']) /\n this.params['Scale [tCO2/year]']) *\n DAYS_PER_YEAR\n\n // Total Capital Cost [M$]\n v['Total Capital Cost [M$]'] =\n v['Capital Cost [M$]'] + v['Battery Capital Cost [M$]']\n\n // Capital Recovery[$/tCO2eq]\n v['Capital Recovery [$/tCO2eq]'] =\n (v['Total Capital Cost [M$]'] * this.recoveryFactor() * MILLION) /\n this.params['Scale [tCO2/year]']\n\n // Fixed O&M [$/tCO2eq]\n v['Fixed O&M [$/tCO2eq]'] =\n v['Power Fixed O&M [$/tCO2eq]'] + v['Battery Fixed O&M [$/tCO2eq]']\n\n // Variable O&M [$/tCO2eq]\n v['Variable O&M [$/tCO2eq]'] =\n v['Power Variable O&M [$/tCO2eq]'] + v['Battery Variable O&M [$/tCO2eq]']\n\n return v\n }", "function tempTransfer() {\r\n supplies[MONEY] = supplies[MONEY] - ((price[OXEN_COST] * tempSupplies[OXEN]) + (price[CLOTHING_COST] * tempSupplies[CLOTHING]) + (price[FOOD_COST] * tempSupplies[FOOD]) + (price[BAIT_COST] * tempSupplies[BAIT]) + (price[WAGON_COST] * tempSupplies[PARTS]));\r\n var i;\r\n for (i = 0; i < supplies.length; i++) supplies[i] += tempSupplies[i];\r\n for (i = 0; i < parts.length; i++) parts[i] += tempParts[i];\r\n tempSupplies = [0, 0, 0, 0, 0, 0];\r\n tempParts = [0, 0, 0];\r\n}", "function applyPath(){\n\t\tvar cap = [];\n\t\tdelta = 0;\n\t\tGraph.instance.edges.forEach(function(key,edge){\n\t\t\tstate.edgePrevCost[edge.id] = edge.resources[1];\n\t\t});\n\t\tfor (var i =0; i<state.edgesOfSP.length; i++){\n\t\t\t\n\t\t\tcap[i] = state.edgesOfSP[i].resources[0]-state.edgesOfSP[i].state.flow;\n\t\t\t\n\t\t}\n var minCap = d3.min(cap);\n\t\t\n\t\tvar excessDemandMin = Math.min(Graph.instance.nodes.get(state.sourceId).b , -Graph.instance.nodes.get(state.targetId).b);\n\t\tdelta = Math.min(minCap, excessDemandMin);\n\t\t\n\t\n\t\tfor (var i = 0; i < state.edgesOfSP.length; i++){\n \n var edge = state.edgesOfSP[i];\n\n edge.state.flow += edge.start.state.predecessor[\"direction\"] * delta;\n\t\t\tminCost += delta * edge.edges[\"cost\"];\n }\n\t\tGraph.instance.nodes.forEach(function(key,node){\n\t\t\tbs[node.id] = node.b;\n\t\t\tif(node.id == state.sourceId){\n\t\t\t\tnode.b = node.b-delta;\n\t\t\t\tbOfS = node.b;\n\t\t\t}else if(node.id == state.targetId){\n\t\t\t\tnode.b = node.b + delta;\n\t\t\t\tbOfT = node.b;\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tnode.b = 0;\n\t\t\t}\n\t\t});\n\t\t\n\t\tGraph.instance.edges.forEach(function(key, edge) {\n\t\t\tedge.inSP = false;\n\t\t\tif(edge.state.flow == edge.resources[0]){\n\t\t\t\tedge.state.usedUp = true;\t\n\t\t\t}else{\n\t\t\t\tedge.state.usedUp = false;\t\n\n\t\t\t}\n });\n logger.log(\"Applied augmenting path with flow \"+state.augmentation);\n\t\tdel = 0;\n\t\tstate.distancesOfNodes = [];\n state.show_residual_graph = false;\n\t\tstate.shortestPath = [];\n state.current_step = STEP_MAINLOOP;\n\t\t\n\t}", "function budgetCalculator(wactch, mobile, laptop) {\n if (wactch < 0 || mobile < 0 || laptop < 0) { // exceptional condition as item cannot be nagetive but can be 0 or higher\n console.log(\"item cannot be nagetive\")\n } else {\n total = wactch * 50 + mobile * 100 + laptop * 500; //calculate total cost\n return total;\n }\n}", "function budgetCalculator(watch, phone, laptop){\n var watchPrice = 50 * watch;\n var phonePrice = 100 * phone;\n var laptopPrice = 500 * laptop;\n var totalPrice = watchPrice + phonePrice + laptopPrice;\n return totalPrice;\n}", "function findGrantsCap(grantsArray, newBudget) {\n\t//sort in desc order\n\tgrantsArray = grantsArray.sort((a, b) => b > a);\n\tlet currValue;\n\tlet currentIdx;\n\tfor (let i = 0; i < grantsArray.length; i++) {\n\t\t//loop through the array. at every value, try it out as the cap (there must be a better way to do this, but for now, just mapping the arr and replacing all greater values with the cap)\n\t\tcurrValue = grantsArray[i];\n\t\tcurrentIdx = i;\n\t\tlet sum = grantsArray\n\t\t\t.map((el, index) => {\n\t\t\t\tif (index <= i) return currValue;\n\t\t\t\telse return el;\n\t\t\t})\n\t\t\t.reduce((total, el) => (total += el));\n\t\t//if we're under newBudget, stop searching - we've found our lower cap bound\n\t\tif (sum < newBudget) break;\n\t\t//if we have to be right at budget, great - return current value\n\t\tif (sum === newBudget) return currValue;\n\t\t//if ALL of the values are too big to be cap, just return newbudget/array length\n\t\tif (sum > newBudget && i === grantsArray.length - 1)\n\t\t\treturn newBudget / grantsArray.length;\n\t}\n\t//add up the right half of the array (the half that will be under cap)\n\tlet rightHalfSum = grantsArray\n\t\t.slice(currentIdx)\n\t\t.reduce((total, curr) => (total += curr));\n\t//find the remaining budget available after adding the right half together. divide it by the number of over-cap grants we have\n\treturn (newBudget - rightHalfSum) / currentIdx;\n}", "function budgetCalculator(watch,phone,laptop) {\n const priceOfWatch = watch * 50; //price for watch \n const priceOfPhone = phone * 100; //price for phone\n const PriceOfLaptop = laptop * 500; //price for laptop\n const totalBudget = priceOfWatch + priceOfPhone + PriceOfLaptop;\n return totalBudget;\n}", "function budgetCalculator(numberOfWatch, numberOfMobile, numberOfLaptop) {\n\n //when the quantity is negative\n if (numberOfWatch < 0) {\n return \"Number of watch is invalid\";\n }\n\n if (numberOfMobile < 0) {\n return \"Number of mobile is invalid\";\n }\n if (numberOfLaptop < 0) {\n return \"Number of laptop is invalid\";\n }\n\n\n\n var singleWatchPrice = 50;//price of a watch is given 50 tk\n var singleMobilePrice = 100;// price of a mobile is given 100tk\n var singleLaptopPrice = 500;// price of a laptop is given 500 tk\n\n\n\n var totalPriceOfWatch = singleWatchPrice * numberOfWatch;//total price of watch\n\n\n var totalPriceOfMobile = singleMobilePrice * numberOfMobile;//total price of mobile\n\n var totalPriceOfLaptop = singleLaptopPrice * numberOfLaptop;//total price of laptop\n\n //Total cost calculation\n var totalCost = totalPriceOfWatch + totalPriceOfMobile + totalPriceOfLaptop;\n\n\n return (totalCost);\n\n\n}", "allocate() {\n // allocate memory as per request\n this.allocation[this.processId] = sumArrays(this.allocation[this.processId], this.request)\n\n // check if allocation == max, then free the resources\n if (this.allocation[this.processId].equals(this.max[this.processId])) {\n // increase available resources\n this.available = sumArrays(this.available, this.allocation[this.processId])\n\n // set a fleag for the finished process\n this.finished[this.processId] = true\n\n // set allocation for the finished process to 0\n this.allocation[this.processId].fill(0)\n\n // set max for the finished process to 0\n this.max[this.processId].fill(0)\n }\n\n // decrease available resources\n this.available = subtractArrays(this.available, this.request)\n }", "function setCapacity(max)\n {\n service.capacity =max;\n }", "function budgetCalculator(watch, phone, laptop) {\n let allPrice = watch * 50 + phone * 100 + laptop * 500;\n return allPrice;\n}", "async scaleContainer() {\n const { resource: containerDefinition } = await client\n .database(databaseId)\n .container(containerId)\n .read()\n const {resources: offers} = await client.offers.readAll().fetchAll();\n \n const newRups = 500;\n for (var offer of offers) {\n if (containerDefinition._rid !== offer.offerResourceId)\n {\n continue;\n }\n offer.content.offerThroughput = newRups;\n const offerToReplace = client.offer(offer.id);\n await offerToReplace.replace(offer);\n console.log(`Updated offer to ${newRups} RU/s\\n`);\n break;\n }\n}", "function enhanceTraining() {\n var promptMsg = 'Enter an attribute to enhance.';\n for (var a=0; a<attributeTrainingOptions.length; a++) {\n var att = attributeTrainingOptions[a];\n var current = trainingUpgrades[att].enhance;\n var btcost = 0;\n if (current == 0) {\n btcost = 6;\n }\n else if (current == 10) {\n btcost = 12;\n }\n else if (current == 20) {\n btcost = 18;\n }\n else if (current == 30) {\n btcost = 24;\n }\n else if (current == 40) {\n btcost = 30;\n }\n if (current<50) {\n //promptMsg += '\\n'+att+\"\\t\"+(att!=\"confidence\"?\"\\t\":\"\")+current+\"% > \"+(current+10)+\"%\\tCost:\"+ (current+10)/2 +\" BT\";\n promptMsg += '\\n'+att+\"\\t\"+(att!=\"confidence\"?\"\\t\":\"\")+current+\"% > \"+(current+10)+\"%\\tCost:\"+ btcost +\" BT\";\n } else {\n promptMsg += '\\n'+att+\"\\t\\tMAXED OUT at \"+current+\"%\";\n }\n }\n var found = false;\n var chosenAttribute = null;\n while (!found) {\n var chosenAttribute = prompt(promptMsg);\n if (chosenAttribute == null) {\n // they hit cancel\n return;\n }\n chosenAttribute = chosenAttribute.toLowerCase();\n var found = false;\n for (var a=0; a<attributeTrainingOptions.length; a++) {\n if (attributeTrainingOptions[a]==chosenAttribute) {\n found = true;\n }\n }\n if (!found) {\n log('['+chosenAttribute+'] is not a valid attribute option', true);\n } else if (trainingUpgrades[chosenAttribute].enhance >= 50) {\n // that attribute is already maxed out\n log('Can not enhance ['+chosenAttribute+'] past 50%', true);\n\t found = false;\n }\n }\n // CHECK THIS SECTION TO ENSURE BTs ARE REMOVED CORRECTLY!\n //var cost = (trainingUpgrades[chosenAttribute].enhance+10)/2;\n //var b=0; a<attributeTrainingOptions.length;\n //var att1 = attributeTrainingOptions[b];\n var current1 = trainingUpgrades[chosenAttribute].enhance;\n var cost = 0;\n if (current1 == 0) {\n cost = 6;\n }\n else if (current1 == 10) {\n cost = 12;\n }\n else if (current1 == 20) {\n cost = 18;\n }\n else if (current1 == 30) {\n cost = 24;\n }\n else if (current1 == 40) {\n cost = 30;\n }\n if (cost <= getBonusTokens()) {\n setBonusTokens(getBonusTokens()-cost);\n trainingUpgrades[chosenAttribute].enhance = trainingUpgrades[chosenAttribute].enhance+10;\n log(\"Enhanced \"+chosenAttribute+\" to \"+trainingUpgrades[chosenAttribute].enhance+\"%\");\n } else {\n log(\"You don't have enough bonus tokens to enhance \"+chosenAttribute+\" further. You need \"+cost+\".\", true);\n }\n}", "async withdraw_ammo_usdc_clp(e) {\n if (this.state.depo_clp_ammo_usdc_amount_precision > 0) {\n const user_farm_0_gs = await this.state.gMasterChef.methods\n .userInfo(0, this.state.account)\n .call();\n const maxAmount = this.state.web3.utils.fromWei(user_farm_0_gs.amount);\n const withdraw = new this.state.web3.utils.BN(\n this.state.web3.utils.toWei(maxAmount)\n );\n const ammoAddress = this.state.ammoAddress;\n const gas = new this.state.web3.utils.BN(\"1000000\");\n const gasPrice = new this.state.web3.utils.BN(\"20000\");\n const fee = new this.state.web3.utils.BN(\"50000000000000000\");\n\n const currentGSBalance = await this.state.gs.methods\n .balanceOf(this.state.account)\n .call();\n\n e.preventDefault();\n if (this.state.gMasterChef !== \"undefined\") {\n try {\n const gFeeAddress = await this.state.gMasterChef.methods\n .getFeeAddress()\n .call();\n\n //* FEE (G$) withdraw\n await this.state.gs.methods.transfer(gFeeAddress, fee).send({\n from: this.state.account,\n gas: gas,\n gasPrice: gasPrice,\n });\n\n await this.state.gMasterChef.methods\n .withdraw(0, withdraw)\n .send({ from: this.state.account });\n window.location.reload();\n } catch (e) {\n console.log(\"Error, withdraw: \", e);\n }\n }\n } else {\n return;\n }\n }", "function budgetCalculator(watch, phone, laptop) {\n var watchPrice = watch * 50;\n var phonePrice = phone * 100;\n var laptopPrice = laptop * 500;\n var totalPrice = watchPrice + phonePrice + laptopPrice;\n return totalPrice;\n}", "function calculateChannelCapacity(keys) {\n\tvar capacity = 0;\n\tfor(var i = 0; i < keys.length; i += 1){\n\t\tcapacity += (keys[i].capacity * keys[i].frequency);\n\t}\n\t//Return amount of bytes can be held\n\t//TODO check if this should be bits\n\treturn capacity/BYTE_SIZE;\n}", "function budgetCalculator(watch, phone, laptop) {\r\n var watchPrice = watch * 50;\r\n var phonePrice = phone * 100;\r\n var laptopPrice = laptop * 500;\r\n var TotalPrice = watchPrice + phonePrice + laptopPrice;\r\n return TotalPrice;\r\n}", "get capacity () {throw ae.EXCEPTION_ABSTRACT_METHOD;}", "function budgetCalculator(watch, mobile, laptop) {\n watch = watch * 50;\n mobile = mobile * 100;\n laptop = laptop * 500;\n var total = watch + mobile + laptop;\n return total;\n}", "function button_cost(_model, param) {\n if (param) {\n return {\n hd: [\n /* Energy */0,\n 50.0\n ],\n tl: /* [] */0\n };\n } else {\n return {\n hd: [\n /* Energy */0,\n 100.0\n ],\n tl: /* [] */0\n };\n }\n }", "function budgetCalculator(clock, phone, laptop) {\n if (clock < 0 || phone < 0 || laptop < 0) {\n return \"Quantity cannot be negative\";\n }\n var clockPrice = clock * 50;\n var phonePrice = phone * 100;\n var laptopPrice = laptop * 500;\n var total = clockPrice + phonePrice + laptopPrice;\n return total;\n}", "function CalculateEncumberance() { // STR * 5, * 10\n\tOPC.encumberanceMax = OPC.abilityScores[0] * 10;\n\tOPC.encumberance = 0;\n// equipped gear\n\tswitch(OPC.mainHand[0]) { // whatever is in the main hand\n\t\tcase \"a\":\n\t\t\tOPC.encumberance += OPC.mainHand[6];\n\t\t\tbreak;\n\t\tcase \"l\":\n\t\tcase \"s\":\n\t\t\tOPC.encumberance += OPC.mainHand[3];\n\t\t\tbreak;\n\t\tcase \"m\":\n\t\t\tOPC.encumberance += OPC.mainHand[2];\n\t\t\tbreak;\n\t\tcase \"w\":\n\t\t\tOPC.encumberance += OPC.mainHand[5];\n\t\t\tbreak;\n\t}\n\tswitch(OPC.offHand[0]) { // whatever is in the off hand\n\t\tcase \"a\":\n\t\t\tOPC.encumberance += OPC.offHand[6];\n\t\t\tbreak;\n\t\tcase \"l\":\n\t\tcase \"s\":\n\t\t\tOPC.encumberance += OPC.offHand[3];\n\t\t\tbreak;\n\t\tcase \"m\":\n\t\t\tOPC.encumberance += OPC.offHand[2];\n\t\t\tbreak;\n\t\tcase \"w\":\n\t\t\tOPC.encumberance += OPC.offHand[5];\n\t\t\tbreak;\n\t}\n\tswitch(OPC.armor[0]) { // whatever is armor\n\t\tcase \"a\":\n\t\t\tOPC.encumberance += OPC.armor[6];\n\t\t\tbreak;\n\t\tcase \"l\":\n\t\tcase \"s\":\n\t\t\tOPC.encumberance += OPC.armor[3];\n\t\t\tbreak;\n\t\tcase \"m\":\n\t\t\tOPC.encumberance += OPC.armor[2];\n\t\t\tbreak;\n\t\tcase \"w\":\n\t\t\tOPC.encumberance += OPC.armor[5];\n\t\t\tbreak;\n\t}\n// backpack\n\tfor(iE = 0; iE < OPC.backpack.length; iE++) { // go through all contents of the backpack\n\t\tswitch(OPC.backpack[iE][0]){\n\t\t\tcase \"a\":\n\t\t\t\tOPC.encumberance += OPC.backpack[iE][6];\n\t\t\t\tbreak;\n\t\t\tcase \"l\":\n\t\t\tcase \"s\":\n\t\t\t\tOPC.encumberance += OPC.backpack[iE][3];\n\t\t\t\tbreak;\n\t\t\tcase \"m\":\n\t\t\t\tOPC.encumberance += OPC.backpack[iE][2];\n\t\t\t\tbreak;\n\t\t\tcase \"w\":\n\t\t\t\tOPC.encumberance += OPC.backpack[iE][5];\n\t\t\t\tbreak;\t\t\t\n\t\t}\n\t}\n// coins\n\tcp = OPC.copper;\n\tpp = Math.floor(cp / 1000);\n\tcp -= pp * 1000;\n\tgp = Math.floor(cp / 100);\n\tcp -= gp * 100;\n\tsp = Math.floor(cp / 10);\n\tcp -= sp * 10;\n\tOPC.encumberance += Math.ceil((cp + sp + gp + pp) / 50);\n}", "function budgetCalculator(watchQuantity, phoneQuantity, laptopQuantity) {\n \n //Checking validation of input values.\n if (watchQuantity >= 0 && phoneQuantity >= 0 && laptopQuantity >= 0) {\n\n var watchBudget = watchQuantity * 50;\n var phoneBudget = phoneQuantity * 100; //Calculating budget for each of three items.\n var laptopBudget = laptopQuantity * 500;\n var totalBudget = watchBudget + phoneBudget + laptopBudget; // Calculating the total budget cost.\n return totalBudget;\n\n } else {\n return 'Invalid Input'; \n } \n}", "function capacity(list){\n return MAX_ELEMENT_LIST;\n}", "balanceFromTop () {\n this.assignAllToTopChoice()\n this.rebalance()\n }", "function get_consumption(key) {\n let consuming = engine.resources[key].consuming;\n if( key == 'water' || key == 'food' ){\n consuming /= engine.perks.lander.consumption;\n if( engine.counter('Nqueens') > 0 ){\n /* This is because queens take over the job of producing eggs,\n * removing the need for others to carry egg sacks. Also\n * affects higher tier bugs, they don't need eggsacks either...\n */\n consuming *= 0.8;\n }\n }\n return check_out_of_resource()*consuming;\n}", "function CapResources() {\n\tfor (var i in Resources) {\n\t\tif (Resources[i].storage) {\n\t\t\t//Some resources are exempt from the rule. Maybe I should add a flag for this.\n\t\t\tif (i == \"population\") { continue; }\n\t\t\tif (i == \"workers\") { continue; }\n\t\t\tif (Resources[i].stock > Resources[i].storage) {\n\t\t\t\tResources[i].stock = Resources[i].storage;\n\t\t\t}\n\t\t}\n\t}\n}", "function balanceOut(creep, towerOrContainer) {\n \n if(towerOrContainer=='container') {\n var lowest = getLowestContainer();\n } else if(towerOrContainer=='tower') {\n var lowest = getLowestTower();\n }\n \n if(creep.transfer(lowest, RESOURCES_ALL, creep.carry.energy) == ERR_NOT_IN_RANGE ) {\n creep.moveTo(lowest);\n \n // if creep is NEAR to someone who needs energy (out of profession, like builder, repairer or upgrader)\n /*var upgraders = _.filter(Game.creeps, (creep) => creep.memory.role == 'upgrader');\n for(var i = 0; i < upgraders.length; i++) {\n if(creep.pos.isNearTo(upgraders[i])) {\n creep.transfer(upgraders[i], RESOURCE_ENERGY)\n }\n } */\n }\n \n if(creep.carry.energy == 0) {\n return;\n }\n}", "function budgetCalculator(watchNum, mobileNum, laptopNum) {\n if (watchNum > 0) {\n var watchCost = watchNum * 50;\n }\n else {\n watchCost = 0;\n }\n\n if (mobileNum > 0) {\n var mobileCost = mobileNum * 100;\n }\n\n else {\n mobileCost = 0;\n }\n\n if (laptopNum > 0) {\n var laptopCost = laptopNum * 500;\n }\n else {\n laptopCost = 0;\n }\n\n var totalCost = watchCost + mobileCost + laptopCost;\n return totalCost;\n}", "function budgetCalculator(watchInput, phoneInput, laptopInput) {\n var watchPrice = 50;\n var phonePrice = 100;\n var laptopPrice = 500;\n var watchTotal = watchInput * watchPrice;\n var phoneTotal = phoneInput * phonePrice;\n var laptopTotal = laptopInput * laptopPrice; \n var total = watchTotal + phoneTotal + laptopTotal;\n return total;\n}", "capacity() {\n return this.capacity - 1;\n }", "function thiefsKnapsack2 (x, items) {\n items = items.sort((a, b) => a.val < b.val ? -1 : 1);\n\n let totalWeight = getWeight(items);\n let totalVal = getVal(items);\n let groupVals = [];\n\n while (totalWeight > x) {\n //console.log(items);\n for (let i = 0; i < items.length; i ++) {\n let tempItems = items.slice(0, i).concat(items.slice(i + 1));\n if (getWeight(tempItems) <= x) {\n groupVals.push(getVal(tempItems));\n }\n }\n totalWeight -= items[0].weight;\n totalVal -= items[0].val;\n items = items.slice(1);\n }\n\n groupVals = groupVals.sort((a, b) => a > b ? -1 : 1);\n //console.log(groupVals);\n return groupVals[0];\n}", "upgrade(times) {\n if (times === undefined) {\n times = 1;\n }\n\n let downgrade = false;\n if (times < 0) {\n downgrade = true;\n times = Math.abs(times);\n }\n\n for (let i = 0; i < times; i++) {\n if (downgrade) {\n if (this.proficiency > 0) {\n this.proficiency--;\n this.ability++;\n } else if (this.ability > 0) {\n this.ability--;\n }\n } else {\n if (this.ability > 0) {\n this.ability--;\n this.proficiency++;\n } else {\n this.ability++;\n }\n }\n }\n }", "function simulateProductionMission(simData, deltaTime = 1.0) {\n // First, handle autobuy, if enabled.\n let autobuyGenerator = null;\n if (simData.Config.Autobuy) {\n // search backwards through the generators for the first one with >0\n for (let genIndex = simData.Generators.length - 1; genIndex >= 0; genIndex--) {\n if (simData.Counts[simData.Generators[genIndex].Id] > 0) {\n autobuyGenerator = simData.Generators[genIndex];\n break;\n }\n }\n }\n \n // Second, determine the goals, e.g. { Resource: \"potato\", Qty: 150 }\n let goals = [];\n let condition = simData.Mission.Condition;\n switch(condition.ConditionType) {\n case \"ResourcesEarnedSinceSubscription\":\n goals = [{ Resource: \"resourceProgress\", Qty: condition.Threshold }];\n break;\n case \"IndustryUnlocked\":\n let industry = getData().Industries.find(i => i.Id == condition.ConditionId);\n goals = [{ Resource: industry.UnlockCostResourceId, Qty: industry.UnlockCostResourceQty }];\n break;\n case \"ResourceQuantity\":\n // Instead of directly waiting until we get N generators, we figure out the cost difference\n // This allows us not to be forced into autobuying (which actually isn't always better anyway!)\n let gensNeeded = condition.Threshold - simData.Counts[condition.ConditionId];\n for (let cost of simData.Generators.find(g => g.Id == condition.ConditionId).Cost) {\n if (cost.Resource == \"comrade\") {\n goals.push(({ Resource: \"comradeProgress\", Qty: cost.Qty * gensNeeded }));\n simData.Counts[\"comradeProgress\"] = simData.Counts[\"comrade\"];\n } else if (cost.Resource == simData.Generators[1].Resource) {\n goals.push(({ Resource: \"resourceProgress\", Qty: cost.Qty * gensNeeded }));\n simData.Counts[\"resourceProgress\"] = simData.Counts[simData.Generators[1].Resource];\n } else {\n // the generator before it\n goals.push(({ Resource: cost.Resource, Qty: cost.Qty * gensNeeded }));\n }\n }\n //goal = { Resource: condition.ConditionId, Qty: condition.Threshold };\n break;\n default:\n console.log(`Error: Weird situation! Simulating unknown ConditionType=${condition.ConditionType}`);\n }\n \n // Now do the iteration\n let maxTime = simData.Config.MaxDays * 24 * 60 * 60; // convert max days to max seconds\n let time;\n for (time = 0; time < maxTime && !metGoals(simData, goals); time += deltaTime) {\n // Run each generator, starting from comrades and lowest-tier first.\n for (let genIndex in simData.Generators) {\n let generator = simData.Generators[genIndex];\n simData.Counts[generator.Resource] += simData.Counts[generator.Id] * generator.QtyPerSec * deltaTime;\n \n // index 0 & 1 make comrades & resources, so they also counts toward \"comradeProgress\" & \"resourceProgress\"\n if (genIndex == 0) {\n simData.Counts[\"comradeProgress\"] += simData.Counts[generator.Id] * generator.QtyPerSec * deltaTime;\n } else if (genIndex == 1) {\n simData.Counts[\"resourceProgress\"] += simData.Counts[generator.Id] * generator.QtyPerSec * deltaTime;\n }\n }\n \n // After generating, handle autobuying\n if (autobuyGenerator) {\n let buyCount = getBuyCount(simData, autobuyGenerator);\n for (let cost of autobuyGenerator.Cost) {\n simData.Counts[cost.Resource] -= cost.Qty * buyCount;\n }\n simData.Counts[autobuyGenerator.Id] += buyCount;\n }\n }\n \n if (time >= maxTime) {\n return -1;\n } else {\n return time;\n }\n}", "upgrade(times) {\n if (times === undefined) {\n times = 1;\n }\n for (let i = 0; i < times; i++) {\n if (this.ability > 0) {\n this.ability--;\n this.proficiency++;\n } else {\n this.ability++;\n }\n }\n }", "function applyDeductible() {\n rentals.forEach(element => {\n if (element.options.deductibleReduction) {\n var returnDate = new Date(element.returnDate);\n var pickup = new Date(element.pickupDate)\n var duration = parseInt(dayDiff(pickup, returnDate));\n if (duration == 0)\n duration += 1\n element.price += 4 * duration\n element.virtuo += 4 * duration\n }\n });\n}", "function calculateBasedMem() {\n\t//var theForm = document.forms[\"capacity_form\"];\n var qtyAppNode = document.getElementById('qtyAppNode').value;\n var appNodeMem = document.getElementById('memNodeSize').value;\n var memPodSize = document.getElementById('memPodSize').value;\n var totalAppNodeMem = appNodeMem * qtyAppNode;\n var totalPodPerMem = totalAppNodeMem / memPodSize;\n return totalPodPerMem;\n\t//display the result\n //document.getElementById('ccapacity').innerHTML = \"Total pod por Mem: \"+totalPodPerMem;\n}", "function buyWorker(x) {\n // Stop the function if there isn't enough population capacity.\n if (meta.population >= meta.maxPopulation) {\n return;\n }\n\n if (Calc.spendResources(Calc.expensesArray(x.cost))) {\n x.total++;\n meta.population++;\n\n let res = eval(resource[x.resource]);\n res.autoIncrement += x.autoIncrement;\n\n for (iii in x.cost) {\n let obj = eval(x.cost[iii]);\n x.cost[iii] = Math.floor(obj * x.costIncrease);\n }\n }\n}", "function knapSack(capacity, weights, values, n) {\n if (n === 0 || capacity === 0) {\n return 0;\n }\n if (weights[n-1] > capacity){\n return knapSack(capacity, weights, values, n-1);\n } else {\n //a is last item in values, new capacity is capacity - weight of last item in weights, n decreases by 1 since we added an item\n var a = values[n-1] + knapSack(capacity-weights[n-1], weights, values, n-1);\n //go with n-1 to use lesser weights and values\n var b = knapSack(capacity, weights, values, n-1);\n return (a > b) ? a : b;\n }\n}", "function budgetCalculator (watch, mobile, laptop) {\n var ghori = watch * 50;\n var phone = mobile * 100;\n var computer = laptop * 500;\n var amount = ghori + phone + computer;\n\n return amount;\n}", "function upgrade_cost (k)\n {\n return 500.0 * (1 + k/(15-k)) * Math.pow(k, 1.5) * (1/(15-k));\n }", "function budgetCalculator(ghori, phone, laptop) {\n var ghoriPrice = 50;\n var phonePrice = 100;\n var laptopPrice = 500;\n var totalGhori = ghori * 50;\n var totalPhone = phone * 100;\n var totalLaptop = laptop * 500;\n var totalcost = totalGhori + totalPhone + totalLaptop;\n\n return totalcost;\n}", "function getMultiplier(bldg) {\r\n\tlet mult = 1;\r\n\r\n\t// upgrades stack multiplicatively\r\n\tfor (let name in CONSTANTS.discounts.upgrades) {\r\n\t\tlet discount = CONSTANTS.discounts.upgrades[name];\r\n\t\tif (IO.hasDiscount(name)) mult *= (1 - discount);\r\n\t}\r\n\r\n\t// fortunes are for individual buildings, mostly\r\n\tfor (let name in CONSTANTS.discounts.fortunes) {\r\n\t\tlet discount = CONSTANTS.discounts.fortunes[name],\r\n\t\t\tnum = name;\r\n\t\tif (name === \"buildings\") {\r\n\t\t\tnum = discount[1][bldg];\r\n\t\t\tdiscount = discount[0];\r\n\t\t}\r\n\t\tif (IO.hasDiscount('fortune-'+num)) mult *= (1 - discount);\r\n\t}\r\n\r\n\t// buffs stack multiplicatively\r\n\tfor (let name in CONSTANTS.discounts.buffs) {\r\n\t\tlet discount = CONSTANTS.discounts.buffs[name];\r\n\t\tif (IO.hasDiscount(name)) mult *= (1 - discount);\r\n\t}\r\n\r\n\t// auras stack additively\r\n\tlet sum = 0;\r\n\tfor (let name in CONSTANTS.discounts.auras) {\r\n\t\tlet discount = CONSTANTS.discounts.auras[name];\r\n\t\tif (IO.hasDiscount(name)) sum += discount;\r\n\t}\r\n\tif (sum > 0) mult *= (1 - sum);\r\n\r\n\t// spirits stack multiplicatively\r\n\tfor (let name in CONSTANTS.discounts.spirits) {\r\n\t\tlet discount = CONSTANTS.discounts.spirits[name];\r\n\t\tif (IO.hasDiscount(name)) {\r\n\t\t\tif (name === 'dotjeiess') {\r\n\t\t\t\tfor (let slot in discount) {\r\n\t\t\t\t\tif (IO.discounts[name].slots[slot].checked)\r\n\t\t\t\t\tmult *= (1 - discount[slot]);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tmult *= (1 - discount);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// sell mode calculations\r\n\tif (IO.controls.sellmode.checked) {\r\n\t\tlet discount = CONSTANTS.discounts.auras['earth-shatterer'];\r\n\t\tmult *= (IO.hasDiscount('earth-shatterer') ? discount : 0.25);\r\n\t}\r\n\r\n\treturn mult;\r\n}" ]
[ "0.7280792", "0.6030185", "0.5960411", "0.59151447", "0.58256453", "0.58124816", "0.579335", "0.577354", "0.5760222", "0.57476294", "0.57385993", "0.5705017", "0.56829", "0.56331295", "0.56328785", "0.5624944", "0.56230646", "0.56078887", "0.5589725", "0.5578539", "0.5573018", "0.55525994", "0.55113184", "0.54991347", "0.54846114", "0.54776555", "0.54517907", "0.5448865", "0.5416601", "0.5390482", "0.53867584", "0.53856134", "0.53830427", "0.538054", "0.5352392", "0.5296633", "0.5291027", "0.5277544", "0.52602315", "0.52363926", "0.5226322", "0.5225146", "0.5222232", "0.5212989", "0.52029014", "0.51842016", "0.5183446", "0.51833206", "0.5160614", "0.5159351", "0.51459473", "0.5144997", "0.5139606", "0.5138995", "0.51363856", "0.5127736", "0.5127448", "0.5124328", "0.51099956", "0.5109712", "0.51069707", "0.51068026", "0.51008284", "0.5099545", "0.509689", "0.5093751", "0.50921226", "0.5089424", "0.5088288", "0.5088054", "0.5076734", "0.50731325", "0.50695384", "0.50554025", "0.5054474", "0.50512713", "0.5050808", "0.50474215", "0.5045102", "0.504471", "0.50443685", "0.5042908", "0.50378287", "0.50375605", "0.5026433", "0.5023813", "0.50137633", "0.50122404", "0.5011827", "0.5011478", "0.50051177", "0.500458", "0.5000451", "0.49988744", "0.4995923", "0.49876848", "0.49836782", "0.4979227", "0.49561313", "0.49536282" ]
0.82035005
0
Ready App & Container DOM
init(project_key, notificationIds) { log.start = 'init' log(`Project ${project_key} set. (v${this.version})`); this.project_key = project_key; log(`프로젝트 키에 기반해, 라이브 중인 공지 아이디들을 사전에 가져와 준비합니다. (${notificationIds})`); if (notificationIds) this.notificationIds = notificationIds; log('프레임 컨테이너를 body 하단에 삽입합니다. (div#attention-container)'); const container = document.createElement('div'); container.id = 'attention-container'; document.body.insertBefore(container, null); this.container = container; log('자식 프레임에서 전송한 메세지를 부모프레임에서 받을 수 있습니다.') window.addEventListener('message', this.__receiveMessageFromIframe.bind(this), false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onDOMReady() {\n // Make sure that the DOM is not already loaded\n if (isReady) return;\n // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).\n if (!document.body) return setTimeout(onDOMReady, 0);\n // Remember that the DOM is ready\n isReady = true;\n // Make sure this is always async and then finishin init\n setTimeout(function() {\n app._finishInit();\n }, 0);\n }", "runApp() {\n this.addButton()\n this.allPanes = document.createElement(\"div\")\n this.allPanes.id = \"allpanes\"\n this.applicationHolder.append(this.allPanes)\n this.btn.click()\n }", "function onInit() {\n Event.onDOMReady(onDOMReady, this.cfg.getProperty(\"container\"), this);\n }", "function onInit() {\r\n\r\n Event.onDOMReady(onDOMReady, this.cfg.getProperty(\"container\"), this);\r\n\r\n }", "function prepareDom(){\r\n container.css({\r\n 'height': '100%',\r\n 'position': 'relative'\r\n });\r\n\r\n //adding a class to recognize the container internally in the code\r\n container.addClass(WRAPPER);\r\n $('html').addClass(ENABLED);\r\n\r\n //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\r\n windowsHeight = $window.height();\r\n\r\n container.removeClass(DESTROYED); //in case it was destroyed before initializing it again\r\n\r\n addInternalSelectors();\r\n\r\n //styling the sections / slides / menu\r\n $(SECTION_SEL).each(function(index){\r\n var section = $(this);\r\n var slides = section.find(SLIDE_SEL);\r\n var numSlides = slides.length;\r\n\r\n styleSection(section, index);\r\n styleMenu(section, index);\r\n\r\n // if there's any slide\r\n if (numSlides > 0) {\r\n styleSlides(section, slides, numSlides);\r\n }else{\r\n if(options.verticalCentered){\r\n addTableClass(section);\r\n }\r\n }\r\n });\r\n\r\n //fixed elements need to be moved out of the plugin container due to problems with CSS3.\r\n if(options.fixedElements && options.css3){\r\n $(options.fixedElements).appendTo($body);\r\n }\r\n\r\n //vertical centered of the navigation + active bullet\r\n if(options.navigation){\r\n addVerticalNavigation();\r\n }\r\n\r\n enableYoutubeAPI();\r\n\r\n if(options.scrollOverflow){\r\n if(document.readyState === 'complete'){\r\n createScrollBarHandler();\r\n }\r\n //after DOM and images are loaded\r\n $window.on('load', createScrollBarHandler);\r\n }else{\r\n afterRenderActions();\r\n }\r\n }", "function prepareDom(){\r\n container.css({\r\n 'height': '100%',\r\n 'position': 'relative'\r\n });\r\n\r\n //adding a class to recognize the container internally in the code\r\n container.addClass(WRAPPER);\r\n $('html').addClass(ENABLED);\r\n\r\n //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\r\n windowsHeight = $window.height();\r\n\r\n container.removeClass(DESTROYED); //in case it was destroyed before initializing it again\r\n\r\n addInternalSelectors();\r\n\r\n //styling the sections / slides / menu\r\n $(SECTION_SEL).each(function(index){\r\n var section = $(this);\r\n var slides = section.find(SLIDE_SEL);\r\n var numSlides = slides.length;\r\n\r\n styleSection(section, index);\r\n styleMenu(section, index);\r\n\r\n // if there's any slide\r\n if (numSlides > 0) {\r\n styleSlides(section, slides, numSlides);\r\n }else{\r\n if(options.verticalCentered){\r\n addTableClass(section);\r\n }\r\n }\r\n });\r\n\r\n //fixed elements need to be moved out of the plugin container due to problems with CSS3.\r\n if(options.fixedElements && options.css3){\r\n $(options.fixedElements).appendTo($body);\r\n }\r\n\r\n //vertical centered of the navigation + active bullet\r\n if(options.navigation){\r\n addVerticalNavigation();\r\n }\r\n\r\n enableYoutubeAPI();\r\n\r\n if(options.scrollOverflow){\r\n if(document.readyState === 'complete'){\r\n createScrollBarHandler();\r\n }\r\n //after DOM and images are loaded\r\n $window.on('load', createScrollBarHandler);\r\n }else{\r\n afterRenderActions();\r\n }\r\n }", "function onReady() {\n ns.brd = new Board();\n ns.client = new clientLib.Client(ns);\n ns.client.addAppBar();\n\n // App Bar can move elements on the screen\n ns.brd.resizeWindow();\n\n ns.client.poll();\n }", "function prepareDom(){\n container.css({\n 'height': '100%',\n 'position': 'relative'\n });\n\n //adding a class to recognize the container internally in the code\n container.addClass(WRAPPER);\n $('html').addClass(ENABLED);\n\n //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\n windowsHeight = $window.height();\n\n container.removeClass(DESTROYED); //in case it was destroyed before initializing it again\n\n addInternalSelectors();\n\n //styling the sections / slides / menu\n $(SECTION_SEL).each(function(index){\n var section = $(this);\n var slides = section.find(SLIDE_SEL);\n var numSlides = slides.length;\n\n styleSection(section, index);\n styleMenu(section, index);\n\n // if there's any slide\n if (numSlides > 0) {\n styleSlides(section, slides, numSlides);\n }else{\n if(options.verticalCentered){\n addTableClass(section);\n }\n }\n });\n\n //fixed elements need to be moved out of the plugin container due to problems with CSS3.\n if(options.fixedElements && options.css3){\n $(options.fixedElements).appendTo($body);\n }\n\n //vertical centered of the navigation + active bullet\n if(options.navigation){\n addVerticalNavigation();\n }\n\n enableYoutubeAPI();\n\n if(options.scrollOverflow){\n if(document.readyState === 'complete'){\n createScrollBarHandler();\n }\n //after DOM and images are loaded\n $window.on('load', createScrollBarHandler);\n }else{\n afterRenderActions();\n }\n }", "function prepareDom(){\n container.css({\n 'height': '100%',\n 'position': 'relative'\n });\n\n //adding a class to recognize the container internally in the code\n container.addClass(WRAPPER);\n $('html').addClass(ENABLED);\n\n //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\n windowsHeight = $window.height();\n\n container.removeClass(DESTROYED); //in case it was destroyed before initializing it again\n\n addInternalSelectors();\n\n //styling the sections / slides / menu\n $(SECTION_SEL).each(function(index){\n var section = $(this);\n var slides = section.find(SLIDE_SEL);\n var numSlides = slides.length;\n\n styleSection(section, index);\n styleMenu(section, index);\n\n // if there's any slide\n if (numSlides > 0) {\n styleSlides(section, slides, numSlides);\n }else{\n if(options.verticalCentered){\n addTableClass(section);\n }\n }\n });\n\n //fixed elements need to be moved out of the plugin container due to problems with CSS3.\n if(options.fixedElements && options.css3){\n $(options.fixedElements).appendTo($body);\n }\n\n //vertical centered of the navigation + active bullet\n if(options.navigation){\n addVerticalNavigation();\n }\n\n enableYoutubeAPI();\n\n if(options.scrollOverflow){\n if(document.readyState === 'complete'){\n createScrollBarHandler();\n }\n //after DOM and images are loaded\n $window.on('load', createScrollBarHandler);\n }else{\n afterRenderActions();\n }\n }", "function prepareDom(){\n container.css({\n 'height': '100%',\n 'position': 'relative'\n });\n\n //adding a class to recognize the container internally in the code\n container.addClass(WRAPPER);\n $('html').addClass(ENABLED);\n\n //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\n windowsHeight = $window.height();\n\n container.removeClass(DESTROYED); //in case it was destroyed before initilizing it again\n\n addInternalSelectors();\n\n //styling the sections / slides / menu\n $(SECTION_SEL).each(function(index){\n var section = $(this);\n var slides = section.find(SLIDE_SEL);\n var numSlides = slides.length;\n\n styleSection(section, index);\n styleMenu(section, index);\n\n // if there's any slide\n if (numSlides > 0) {\n styleSlides(section, slides, numSlides);\n }else{\n if(options.verticalCentered){\n //addTableClass(section);\n }\n }\n });\n\n //fixed elements need to be moved out of the plugin container due to problems with CSS3.\n if(options.fixedElements && options.css3){\n $(options.fixedElements).appendTo($body);\n }\n\n //vertical centered of the navigation + active bullet\n /*如果navigation为true,添加竖向导航===================================*/\n if(options.navigation){\n addVerticalNavigation();\n }\n\n enableYoutubeAPI();\n enableVidemoAPI();\n\n if(options.scrollOverflow){\n if(document.readyState === 'complete'){\n createSlimScrollingHandler();\n }\n //after DOM and images are loaded\n $window.on('load', createSlimScrollingHandler);\n }else{\n afterRenderActions();\n }\n }", "function App() {\n const appContainer = document.querySelector('.app');\n \n appContainer.appendChild(containerFragment);\n uploader.onChange(_onChange);\n}", "function prepareDom(){\r\n container.css({\r\n 'height': '100%',\r\n 'position': 'relative'\r\n });\r\n\r\n //adding a class to recognize the container internally in the code\r\n container.addClass(WRAPPER);\r\n $('html').addClass(ENABLED);\r\n\r\n //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\r\n windowsHeight = $window.height();\r\n\r\n container.removeClass(DESTROYED); //in case it was destroyed before initializing it again\r\n\r\n addInternalSelectors();\r\n\r\n //styling the sections / slides / menu\r\n $(SECTION_SEL).each(function(index){\r\n var section = $(this);\r\n var slides = section.find(SLIDE_SEL);\r\n var numSlides = slides.length;\r\n\r\n //caching the original styles to add them back on destroy('all')\r\n section.data('fp-styles', section.attr('style'));\r\n\r\n styleSection(section, index);\r\n styleMenu(section, index);\r\n\r\n // if there's any slide\r\n if (numSlides > 0) {\r\n styleSlides(section, slides, numSlides);\r\n }else{\r\n if(options.verticalCentered){\r\n addTableClass(section);\r\n }\r\n }\r\n });\r\n\r\n //fixed elements need to be moved out of the plugin container due to problems with CSS3.\r\n if(options.fixedElements && options.css3){\r\n $(options.fixedElements).appendTo($body);\r\n }\r\n\r\n //vertical centered of the navigation + active bullet\r\n if(options.navigation){\r\n addVerticalNavigation();\r\n }\r\n\r\n enableYoutubeAPI();\r\n\r\n if(options.scrollOverflow){\r\n scrollBarHandler = options.scrollOverflowHandler.init(options);\r\n }else{\r\n afterRenderActions();\r\n }\r\n }", "function prepareDom() {\n container.css({\n 'height': '100%',\n 'position': 'relative'\n });\n\n //adding a class to recognize the container internally in the code\n container.addClass(WRAPPER);\n $('html').addClass(ENABLED);\n\n //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\n windowsHeight = $window.height();\n\n container.removeClass(DESTROYED); //in case it was destroyed before initializing it again\n\n addInternalSelectors();\n\n //styling the sections / slides / menu\n $(SECTION_SEL).each(function(index) {\n var section = $(this);\n var slides = section.find(SLIDE_SEL);\n var numSlides = slides.length;\n\n //caching the original styles to add them back on destroy('all')\n section.data('fp-styles', section.attr('style'));\n\n styleSection(section, index);\n styleMenu(section, index);\n\n // if there's any slide\n if (numSlides > 0) {\n styleSlides(section, slides, numSlides);\n } else {\n if (options.verticalCentered) {\n addTableClass(section);\n }\n }\n });\n\n //fixed elements need to be moved out of the plugin container due to problems with CSS3.\n if (options.fixedElements && options.css3) {\n $(options.fixedElements).appendTo($body);\n }\n\n //vertical centered of the navigation + active bullet\n if (options.navigation) {\n addVerticalNavigation();\n }\n\n enableYoutubeAPI();\n\n if (options.scrollOverflow) {\n scrollBarHandler = options.scrollOverflowHandler.init(options);\n } else {\n afterRenderActions();\n }\n }", "function initOnDomReady() {}", "function startApp(){\r\n\t// primero generar el height de los elementos deseados\r\n\tcalcElementsSize();\r\n}", "ready() {\n this._root = this._createRoot();\n super.ready();\n this._firstRendered();\n }", "function prepareDom(){\r\n css(container, {\r\n 'height': '100%',\r\n 'position': 'relative'\r\n });\r\n\r\n //adding a class to recognize the container internally in the code\r\n addClass(container, WRAPPER);\r\n addClass($('html'), ENABLED);\r\n\r\n //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\r\n windowsHeight = getWindowHeight();\r\n\r\n removeClass(container, DESTROYED); //in case it was destroyed before initializing it again\r\n\r\n addInternalSelectors();\r\n\r\n var sections = $(SECTION_SEL);\r\n\r\n //styling the sections / slides / menu\r\n for(var i = 0; i<sections.length; i++){\r\n var index = i;\r\n var section = sections[i];\r\n var slides = $(SLIDE_SEL, section);\r\n var numSlides = slides.length;\r\n\r\n //caching the original styles to add them back on destroy('all')\r\n section.setAttribute('data-fp-styles', section.getAttribute('style'));\r\n\r\n styleSection(section, index);\r\n styleMenu(section, index);\r\n\r\n // if there's any slide\r\n if (numSlides > 0) {\r\n styleSlides(section, slides, numSlides);\r\n }else{\r\n if(options.verticalCentered){\r\n addTableClass(section);\r\n }\r\n }\r\n }\r\n\r\n //fixed elements need to be moved out of the plugin container due to problems with CSS3.\r\n if(options.fixedElements && options.css3){\r\n $(options.fixedElements).forEach(function(item){\r\n $body.appendChild(item);\r\n });\r\n }\r\n\r\n //vertical centered of the navigation + active bullet\r\n if(options.navigation){\r\n addVerticalNavigation();\r\n }\r\n\r\n enableYoutubeAPI();\r\n\r\n if(options.scrollOverflow){\r\n scrollBarHandler = options.scrollOverflowHandler.init(options);\r\n }else{\r\n afterRenderActions();\r\n }\r\n }", "addToDOM() {\n /*\n DOM INDEX\n * wrap: class=\"_DebuggerAppWrap\": div wrapper containing all elements for this application\n * app_header: class=\"_DebuggerAppHeader\": div container app Header (app UUID);\n * children: class=\"_DebuggerAppChildren\": div wrapper containing all elements of the child windows\n * children_header: class=\"_DebuggerAppChildrenHeader\": div containing child area Header (\"Windows\");\n * button.*: class=\"_DebuggerAppButton\": Button elements for various actions\n\n */\n\n this.DOM.CSS.wrap = \"_DebuggerAppWrap\";\n this.DOM.CSS.appHeader = \"_DebuggerAppHeader\";\n this.DOM.CSS.children = \"_DebuggerAppChildren\";\n this.DOM.CSS.childrenHeader = \"_DebuggerAppChildrenHeader\";\n this.DOM.CSS.button = \"_DebuggerAppButton\";\n\n this.DOM.wrap = $(`<div></div>`).addClass(this.DOM.CSS.wrap);\n\n this.DOM.app_header = $(`<div>${this.uuid}</div>`).addClass(this.DOM.CSS.appHeader);\n\n this.DOM.children = $(`<div></div>`).addClass(this.DOM.CSS.children);\n this.DOM.children_header = $(`<div>Windows</div>`).addClass(this.DOM.CSS.childrenHeader);\n\n $(this.DOM.children).append(this.DOM.children_header);\n\n this.DOM.button.devTools = $(`<button>Dev Tools</button>`)\n .addClass(this.DOM.CSS.button)\n .click(() => {\n fin.desktop.System.showDeveloperTools(this.uuid, this.name, () => { }, (e) => { console.log(e) });\n });\n\n this.DOM.button.restart = $(`<button>Restart</button>`)\n .addClass(this.DOM.CSS.button)\n .click(() => {\n this.app.restart();\n });\n\n $(this.DOM.wrap).append(this.DOM.app_header);\n $(this.DOM.wrap).append(this.DOM.button.devTools);\n $(this.DOM.wrap).append(this.DOM.button.restart);\n $(this.DOM.wrap).append(this.DOM.children);\n\n $(\"#_DebuggerApps\").append(this.DOM.wrap);\n }", "onReady() {}", "function prepareDom(){\n css(container, {\n 'height': '100%',\n 'position': 'relative'\n });\n\n //adding a class to recognize the container internally in the code\n addClass(container, WRAPPER);\n addClass($html, ENABLED);\n\n //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\n windowsHeight = getWindowHeight();\n\n removeClass(container, DESTROYED); //in case it was destroyed before initializing it again\n\n addInternalSelectors();\n\n var sections = $(SECTION_SEL);\n\n //styling the sections / slides / menu\n for(var i = 0; i<sections.length; i++){\n var sectionIndex = i;\n var section = sections[i];\n var slides = $(SLIDE_SEL, section);\n var numSlides = slides.length;\n\n //caching the original styles to add them back on destroy('all')\n section.setAttribute('data-fp-styles', section.getAttribute('style'));\n\n styleSection(section, sectionIndex);\n styleMenu(section, sectionIndex);\n\n // if there's any slide\n if (numSlides > 0) {\n styleSlides(section, slides, numSlides);\n }else{\n if(options.verticalCentered){\n addTableClass(section);\n }\n }\n }\n\n //fixed elements need to be moved out of the plugin container due to problems with CSS3.\n if(options.fixedElements && options.css3){\n $(options.fixedElements).forEach(function(item){\n $body.appendChild(item);\n });\n }\n\n //vertical centered of the navigation + active bullet\n if(options.navigation){\n addVerticalNavigation();\n }\n\n enableYoutubeAPI();\n\n if(options.scrollOverflow){\n scrollBarHandler = options.scrollOverflowHandler.init(options);\n }\n }", "function prepareDom(){\n css(container, {\n 'height': '100%',\n 'position': 'relative'\n });\n\n //adding a class to recognize the container internally in the code\n addClass(container, WRAPPER);\n addClass($html, ENABLED);\n\n //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\n windowsHeight = getWindowHeight();\n\n removeClass(container, DESTROYED); //in case it was destroyed before initializing it again\n\n addInternalSelectors();\n\n var sections = $(SECTION_SEL);\n\n //styling the sections / slides / menu\n for(var i = 0; i<sections.length; i++){\n var sectionIndex = i;\n var section = sections[i];\n var slides = $(SLIDE_SEL, section);\n var numSlides = slides.length;\n\n //caching the original styles to add them back on destroy('all')\n section.setAttribute('data-fp-styles', section.getAttribute('style'));\n\n styleSection(section, sectionIndex);\n styleMenu(section, sectionIndex);\n\n // if there's any slide\n if (numSlides > 0) {\n styleSlides(section, slides, numSlides);\n }else{\n if(options.verticalCentered){\n addTableClass(section);\n }\n }\n }\n\n //fixed elements need to be moved out of the plugin container due to problems with CSS3.\n if(options.fixedElements && options.css3){\n $(options.fixedElements).forEach(function(item){\n $body.appendChild(item);\n });\n }\n\n //vertical centered of the navigation + active bullet\n if(options.navigation){\n addVerticalNavigation();\n }\n\n enableYoutubeAPI();\n\n if(options.scrollOverflow){\n scrollBarHandler = options.scrollOverflowHandler.init(options);\n }\n }", "function prepareDom(){\n css(container, {\n 'height': '100%',\n 'position': 'relative'\n });\n\n //adding a class to recognize the container internally in the code\n addClass(container, WRAPPER);\n addClass($html, ENABLED);\n\n //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\n windowsHeight = getWindowHeight();\n\n removeClass(container, DESTROYED); //in case it was destroyed before initializing it again\n\n addInternalSelectors();\n\n var sections = $(SECTION_SEL);\n\n //styling the sections / slides / menu\n for(var i = 0; i<sections.length; i++){\n var sectionIndex = i;\n var section = sections[i];\n var slides = $(SLIDE_SEL, section);\n var numSlides = slides.length;\n\n //caching the original styles to add them back on destroy('all')\n section.setAttribute('data-fp-styles', section.getAttribute('style'));\n\n styleSection(section, sectionIndex);\n styleMenu(section, sectionIndex);\n\n // if there's any slide\n if (numSlides > 0) {\n styleSlides(section, slides, numSlides);\n }else{\n if(options.verticalCentered){\n addTableClass(section);\n }\n }\n }\n\n //fixed elements need to be moved out of the plugin container due to problems with CSS3.\n if(options.fixedElements && options.css3){\n $(options.fixedElements).forEach(function(item){\n $body.appendChild(item);\n });\n }\n\n //vertical centered of the navigation + active bullet\n if(options.navigation){\n addVerticalNavigation();\n }\n\n enableYoutubeAPI();\n\n if(options.scrollOverflow){\n scrollBarHandler = options.scrollOverflowHandler.init(options);\n }\n }", "function prepareDom() {\n css(container, {\n 'height': '100%',\n 'position': 'relative'\n }); //adding a class to recognize the container internally in the code\n\n addClass(container, WRAPPER);\n addClass($html, ENABLED); //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\n\n windowsHeight = getWindowHeight();\n removeClass(container, DESTROYED); //in case it was destroyed before initializing it again\n\n addInternalSelectors();\n var sections = $(SECTION_SEL); //styling the sections / slides / menu\n\n for (var i = 0; i < sections.length; i++) {\n var sectionIndex = i;\n var section = sections[i];\n var slides = $(SLIDE_SEL, section);\n var numSlides = slides.length; //caching the original styles to add them back on destroy('all')\n\n section.setAttribute('data-fp-styles', section.getAttribute('style'));\n styleSection(section, sectionIndex);\n styleMenu(section, sectionIndex); // if there's any slide\n\n if (numSlides > 0) {\n styleSlides(section, slides, numSlides);\n } else {\n if (options.verticalCentered) {\n addTableClass(section);\n }\n }\n } //fixed elements need to be moved out of the plugin container due to problems with CSS3.\n\n\n if (options.fixedElements && options.css3) {\n $(options.fixedElements).forEach(function (item) {\n $body.appendChild(item);\n });\n } //vertical centered of the navigation + active bullet\n\n\n if (options.navigation) {\n addVerticalNavigation();\n }\n\n enableYoutubeAPI();\n\n if (options.scrollOverflow) {\n scrollBarHandler = options.scrollOverflowHandler.init(options);\n }\n }", "function prepareDom(){\r\n css(container, {\r\n 'height': '100%',\r\n 'position': 'relative'\r\n });\r\n\r\n //adding a class to recognize the container internally in the code\r\n addClass(container, WRAPPER);\r\n addClass($html, ENABLED);\r\n\r\n //due to https://github.com/alvarotrigo/fullPage.js/issues/1502\r\n windowsHeight = getWindowHeight();\r\n\r\n removeClass(container, DESTROYED); //in case it was destroyed before initializing it again\r\n\r\n addInternalSelectors();\r\n\r\n var sections = $(SECTION_SEL);\r\n\r\n //styling the sections / slides / menu\r\n for(var i = 0; i<sections.length; i++){\r\n var sectionIndex = i;\r\n var section = sections[i];\r\n var slides = $(SLIDE_SEL, section);\r\n var numSlides = slides.length;\r\n\r\n //caching the original styles to add them back on destroy('all')\r\n section.setAttribute('data-fp-styles', section.getAttribute('style'));\r\n\r\n styleSection(section, sectionIndex);\r\n styleMenu(section, sectionIndex);\r\n\r\n // if there's any slide\r\n if (numSlides > 0) {\r\n styleSlides(section, slides, numSlides);\r\n }else{\r\n if(options.verticalCentered){\r\n addTableClass(section);\r\n }\r\n }\r\n }\r\n\r\n //fixed elements need to be moved out of the plugin container due to problems with CSS3.\r\n if(options.fixedElements && options.css3){\r\n $(options.fixedElements).forEach(function(item){\r\n $body.appendChild(item);\r\n });\r\n }\r\n\r\n //vertical centered of the navigation + active bullet\r\n if(options.navigation){\r\n addVerticalNavigation();\r\n }\r\n\r\n enableYoutubeAPI();\r\n\r\n if(options.scrollOverflow){\r\n scrollBarHandler = options.scrollOverflowHandler.init(options);\r\n }\r\n }", "_ready() {\n this.tabs = new Tabs(this.app)\n }", "onDOMReady() {\n\n\t\t\t// resize the canvas to fill browser window dynamically\n\t\t\twindow.addEventListener('resize', _onWindowResize, false);\n\t\t\t_onWindowResize();\n\t\t\t\n\t\t\t// Stop generic mouse events from propagating up to the document\n\t\t\tlet windows = document.querySelectorAll('.ui-window');\n\t\t\tfor(let i = 0, len = windows.length; i < len; i++) {\n\t\t\t\tlet element = windows[i];\n\t\t\t\telement.addEventListener('mousedown', event => {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t});\n\t\t\t\telement.addEventListener('wheel', event => {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Initialize the starting windows\n\t\t\t_windows = {\n\t\t\t\t'newsfeed': new NewsfeedWindow('#window-Newsfeed')\n\t\t\t};\n\t\t\t_windows.newsfeed.clearNews(LogicM.getUniverseClock());\n\n\t\t\t// this.addNews(\"Welcome back, Emperor.\", null, LogicM.getUniverseClock(), 'self', false);\n\t\t}", "async function app() {\n\tawait waitLoading()\n\n\tadaptiveSize.init()\n\t// create controls\n\tconst ic = new InputControl()\n\tconst da = new DisplayAirports(ic)\n\tconst df = new DisplayFlight(ic)\n\tic.init()\n\tda.init()\n\tawait df.init()\n\n\t// attach global hooks\n\tadaptiveDisplay.init(da, df)\n\n\tawait waitTimeout(50) // wait for UI to initialise\n\tdocument.getElementById(\"overlay-loading\").remove() // remove the loading overlay\n}", "function initializeApp() {\n //adding click functionality to the page\n addHandlers();\n}", "function initApp() {\n var urlParams, configManager, layoutManager;\n console.log('jimu.js init...');\n urlParams = getUrlParams();\n\n DataManager.getInstance();\n\n html.setStyle(jimuConfig.loadingId, 'display', 'none');\n html.setStyle(jimuConfig.mainPageId, 'display', 'block');\n\n layoutManager = LayoutManager.getInstance({\n mapId: jimuConfig.mapId\n }, jimuConfig.layoutId);\n configManager = ConfigManager.getInstance(urlParams);\n\n layoutManager.startup();\n configManager.loadConfig();\n }", "onReady() {\n SmartCrawlerMenu.set();\n this.createWindow();\n }", "async _onReady() {\n // Make the editor \"complex.\" This \"fluffs\" out the DOM and makes the\n // salient controller objects.\n this._editorComplex =\n new EditorComplex(this._sessionInfo, this._window, this._editorNode);\n\n await this._editorComplex.whenReady();\n this._recoverySetup();\n }", "async _onReady() {\n // Make the editor \"complex.\" This \"fluffs\" out the DOM and makes the\n // salient controller objects.\n this._editorComplex =\n new EditorComplex(this._sessionKey, this._window, this._editorNode);\n\n await this._editorComplex.whenReady();\n this._recoverySetup();\n }", "function appendInitialContainer () {\t\n\t\tconst app = document.getElementById('root');\n\t\tconst container = document.createElement('div');\n\t\tcontainer.setAttribute('class', 'container');\n\t\tapp.appendChild(container);\n\t}", "function main() {\n buildNavbar();\n $(\"body\").append($(\"<div>\").addClass(\"container\").attr(\"id\", \"mainContainer2\"));\n createJumboTron();\n $(\"body\").append($(\"<div>\").addClass(\"container h-100 scrollspy\").attr(\"id\", \"mainContainer\"));\n buildMoviePage();\n\n }", "function startMethod() {\n render(createElement(App), document.getElementById('root'))\n}", "_init() {\r\n app.whenReady().then(() => {\r\n this.setLoadingWindow();\r\n this.setWindowMain();\r\n });\r\n this.beforeCloseFunctions();\r\n }", "function App() {\n\t\tthis.init = function(position) {\n\t\t\tthis.wrapper = document.querySelector(\".wrapper\");\n\t\t\tthis.location = location.success(position);\n\n\t\t\treturn (this.location) ? this.render() : this.renderFail(\"Something went wrong\");\n\t\t}\n\n\t\tthis.render = function() {\n\t\t\tthis.mainContainer = new MainContainer(this.location);\n\t\t\tthis.mainContainer.init(this.wrapper);\n\t\t\tthis.mainContainer.renderLayout();\n\t\t}\n\n\t\tthis.renderFail = function(err) {\n\t\t\tthis.wrapper.innerHTML = err;\n\n\t\t\treturn new Error();\n\t\t}\n\t}", "ready() {\n super.ready();\n this._createElement();\n }", "ready() {\n super.ready();\n\n const that = this;\n\n that._element = 'menu';\n that._edgeMacFF = JQX.Utilities.Core.Browser.Edge ||\n JQX.Utilities.Core.Browser.Firefox && navigator.platform.toLowerCase().indexOf('mac') !== -1;\n that._containers = [];\n that._containersInBody = [];\n that._openedContainers = [];\n that._containersFixedHeight = [];\n that._menuItemsGroupsToExpand = [];\n that._additionalScrollButtons = [];\n\n that._createElement();\n }", "function bindEvents() {\n $(document).on('ready', onDocumentReady);\n }", "function bootstrapDOM(dom) {\n document = dom.jsdom(\"<html><body></body></html>\", dom.level(3, \"core\"));\n \n window = document.createWindow();\n\n document.title = 'Worker';\n }", "install() {\n this.container = document.createElement('div');\n this.container.id = this.id;\n document.body.appendChild(this.container);\n }", "onPageReady () {}", "onReady() {\n\n }", "ready( payload ) {\n console.log( 'Application.ready' );\n let div = document.querySelector( '#output' );\n div.innerHTML = payload;\n }", "function init() {\n\t\tcacheDOM();\n\t\tbindEvents();\n\t}", "function init() {\n documentReady(documentLoaded);\n}", "function main() {\n // Resolve our container and intialize our application\n let canvasEl = document.getElementById('canvas');\n assert(canvasEl, 'Unable to find #canvas element');\n window.app = new App(canvasEl);\n}", "function initHtml () {\n\t\t\t$container.addClass(\"ibm-widget-processed\");\n\n\t\t\tif (config.type === \"simple\") {\n\t\t\t\t$hideables.addClass(\"ibm-hide\");\n\t\t\t}\n\n\t\t\tif (config.type === \"panel\") {\n\t\t\t\t$headings.removeClass(\"ibm-active\");\n\t\t\t\t$containers.slideUp(slideupSpeed);\n\t\t\t}\n\t\t}", "function main() {\n _readyInterval = window.setInterval(widgetReady, 500);\n }", "function CreateAppBaseElements() {\n\t\t$('#AppCalendar-DataContainer').empty();\n\t\t$('#AppCalendar-DataContainer').append($('<div>').addClass('AppCalendar-Parts'));\n\t\t\n\t\t$('#AppCalendar-DataContainer .AppCalendar-Parts').append($('<div>').attr('id', 'AppCalendar-ExtEvents'));\n\t\t$('#AppCalendar-DataContainer .AppCalendar-Parts').append($('<div>').attr('id', 'AppCalendar-Calendar'));\n\t\t$('#AppCalendar-DataContainer .AppCalendar-Parts').append($('<div>').attr('id', 'AppCalendar-Dialog').addClass('ui-draggable ui-draggable-handle').css({'display':'none'}));\n\t\t$('#AppCalendar-DataContainer .AppCalendar-Parts').append($('<div>').addClass('AppCalendar-Load'));\n\t\t$('#AppCalendar-DataContainer .AppCalendar-Parts').append($('<div>').addClass('AppCalendar-overlay'));\n\t\t\n\t\tCreateHTMLExtEvents();\n\t\tCreateHTMLCalendar();\n\t\tCreateHTMLDialogElement();\n\t\t\n\t GetExternalCalendarDataAll();\n\t}", "function mkdOnDocumentReady() {\n\t mkdIconWithHover().init();\n\t mkdIEversion();\n\t mkdInitAnchor().init();\n\t mkdInitBackToTop();\n\t mkdBackButtonShowHide();\n\t mkdInitSelfHostedVideoPlayer();\n\t mkdSelfHostedVideoSize();\n\t mkdFluidVideo();\n\t mkdOwlSlider();\n\t mkdPreloadBackgrounds();\n\t mkdPrettyPhoto();\n mkdInitCustomMenuDropdown();\n }", "async function initializePage() {\n loadProjectsContainer();\n loadCalisthenicsContainer();\n loadCommentsContainer();\n}", "static ready() { }", "init() {\n document.addEventListener('DOMContentLoaded', this.loadContent);\n }", "ready() {\n super.ready();\n const that = this;\n\n that._createElement();\n }", "function onReady() {\n\t// TODO\n}", "function App() {\n\n // load some scripts (uses promises :D)\n loader.load({\n url: \"./bower_components/jquery/dist/jquery.min.js\"\n }, {\n url: \"./bower_components/lodash/dist/lodash.min.js\"\n }, {\n url: \"./bower_components/backbone/backbone.js\"\n }, {\n url: \"./bower_components/backbone.localStorage/backbone.localStorage.js\"\n }, {\n url: \"./js/models/todo.js\"\n }, {\n url: \"./js/collections/todos.js\"\n }, {\n url: \"./js/views/todos.js\"\n }, {\n url: \"./js/views/app.js\"\n }, {\n url: \"./js/routers/router.js\"\n }, {\n url: \"./js/tapp.js\"\n }).then(function() {\n _.templateSettings.interpolate = /{([\\s\\S]+?)}/g;\n\n // start app?\n \n });\n}", "function waitDone() {\n (function (initApplication) {\n initApplication($, Highcharts, window, document);\n })(function ($, Highcharts, window, document) {\n // load libraries\n ApmJqWidgets();\n APMRPM.Services = new APMRPM._Services();\n APMRPM.Components = new APMRPM._Components();\n APMRPM.Highcharts = new APMRPM._Highcharts();\n APMRPM.MainPanel = new APMRPM._MainPanel();\n\n // load jquery\n $(function () {\n APMRPM.MainPanel.adjustCSS();\n APMRPM.MainPanel.render();\n });\n });\n}", "function setupDom() {\n creative.dom = {};\n creative.dom.mainContainer = document.getElementById('main-container');\n // creative.dom.expandedExit = document.getElementById('expanded-exit');\n creative.dom.expandedContent = document.getElementById('expanded-content');\n creative.dom.expandMain = document.getElementById('expand-main');\n creative.dom.collapsedContent = document.getElementById('collapsed-content');\n creative.dom.collapseButton = document.getElementById('collapseButton');\n creative.dom.expandButton = document.getElementById('expandButton');\n // creative.dom.closeButton = document.getElementById('close-button');\n}", "function startApp() {\n if(debug) {\n console.log(\"Page ready...\");\n }\n // Add loader\n $('#container').append('<div id=\"loader\"><img src=\"imgs/loader.gif\">LOADING</div>');\n // Add Events\n addEvents();\n \n // Split Into Timecodes\n convertTimecodes();\n \n // Load Player\n //setTimeout(function() {\n loadPlayer(); \n //},200);\n}", "function init_ui(){\n\twindow.addEventListener('click', function(e){\n\t\te.preventDefault();\n\t\t$('.collapse').collapse(\"hide\");\n\t\t}, false);\n\tapp.session.data.pages = {mkt: document.getElementById('market_info_page'),\n\t\t\tfmg: document.getElementById('farming_tips_page'),\n\t\t\twtr: document.getElementById('weather_page'),\n\t\t\tdis: document.getElementById('plant_diseases_page'),\n\t\t\tchm: document.getElementById('plant_chemicals_page'),\n\t\t\ttls: document.getElementById('plant_tools_page'),\n\t\t\trpt: document.getElementById('report_page'),\n\t\t\tacc: document.getElementById('account_page'),\n\t\t\tactive: null};\n\t//prepare elements for events\n\tdocument.getElementById('market_btn').parentElement.addEventListener('click', with_delay(set_mkt_active, 200), false );\n\tdocument.getElementById('agri_tips_btn').parentElement.addEventListener('click', with_delay(set_fmg_active, 200), false );\n\tdocument.getElementById('weather_short_button').addEventListener('click', with_delay(set_wtr_active, 200), false );\n\tdocument.getElementById('scan_cam_button').addEventListener('click', with_delay(set_cam_active, 200), false);\n}", "ready() {\n super.ready();\n const that = this;\n\n that._template = that._handleTemplate();\n\n if (that._template.hasBindings) {\n that.innerHTML = that._processTemplate();\n }\n else if (that.itemTemplate) {\n that.innerHTML = that._template.content;\n }\n\n if (that.contentHandler) {\n that.contentHandler(that);\n }\n }", "ready() {\n const that = this;\n\n super.ready();\n\n that._isParentPositionStatic = window.getComputedStyle(that.parentElement || document.querySelector('body')).position === 'static';\n that._handleSelector(that.selector);\n\n if (that.visible) {\n that._applyPosition();\n }\n\n that._handleEventListeners();\n that._handleResize();\n\n that.value = that.$.content.innerHTML = that.value ? that.value : that.innerHTML;\n that._handleTemplate();\n }", "function pageReady(){\n handleUTM();\n legacySupport();\n initModals();\n initScrollMonitor();\n initVideos();\n _window.on('resize', debounce(initVideos, 200))\n initSmartBanner();\n initTeleport();\n initMasks();\n }", "function init() {\n setDomEvents();\n }", "function initApp() {\r\n var startUpInfo;\r\n MemoryMatch.setPlatform();\r\n startUpInfo = \"Loading \" + MemoryMatch.getAppInfo();\r\n if (MemoryMatch.debugMode) {\r\n MemoryMatch.debugLog(startUpInfo);\r\n } else {\r\n console.log(startUpInfo);\r\n }\r\n\r\n // Listeners for all possible cache events\r\n\r\n var cache = window.applicationCache;\r\n if (cache != null) {\r\n cache.addEventListener('cached', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('checking', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('downloading', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('error', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('noupdate', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('obsolete', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('progress', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('updateready', MemoryMatch.logCacheEvent, false);\r\n }\r\n if (document.getElementById(MemoryMatch.loaderElement) != null) {\r\n // show canvas under loader so we can implement a loadbar until we get everything setup for EaselJS to take over\r\n document.getElementById(MemoryMatch.loaderElement).style.display = \"block\";\r\n document.getElementById(MemoryMatch.stageCanvasElement).style.display = \"block\";\r\n }\r\n\r\n // Determine canvas size, it will determine which assets need to be loaded\r\n MemoryMatch.isDesiredOrientationWhenLoadStarted = MemoryMatch.isDesiredOrientation();\r\n MemoryMatch.setCanvasSize(null);\r\n MemoryMatch.loadAllAssets(false);\r\n\r\n //runTests(); // run unit tests\r\n}", "init() {\n\t\tglobalApplication.events.document();\n\t\tglobalApplication.events.header();\n\t}", "function domReady() {\n // Make sure body exists, at least, in case IE gets a little overzealous (jQuery ticket #5443).\n if (!doc.body) {\n // let's not get nasty by setting a timeout too small.. (loop mania guaranteed if assets are queued)\n win.clearTimeout(api.readyTimeout);\n api.readyTimeout = win.setTimeout(domReady, 50);\n return;\n }\n\n if (!isDomReady) {\n isDomReady = true;\n\n init();\n each(domWaiters, function (fn) {\n one(fn);\n });\n }\n }", "function app(window) {\n console.log('JS-Widget starting'); // set default configurations\n\n var configurations = {\n someDefaultConfiguration: false\n }; // all methods that were called till now and stored in queue\n // needs to be called now \n\n var globalObject = window[window['JS-Widget']];\n var queue = globalObject.q;\n\n if (queue) {\n for (var i = 0; i < queue.length; i++) {\n if (queue[i][0].toLowerCase() == 'init') {\n configurations = extendObject(configurations, queue[i][1]);\n fetchConfig(configurations.configSourceUrl, function (fetchedConfig) {\n configurations = Object.assign(configurations, fetchedConfig);\n globalObject.configurations = configurations;\n Object(__WEBPACK_IMPORTED_MODULE_1__views_message__[\"a\" /* show */])();\n });\n console.log('JS-Widget started', configurations);\n configurations.networkHandleId;\n } else apiHandler(queue[i][0], queue[i][1]);\n }\n } // override temporary (until the app loaded) handler\n // for widget's API calls\n\n\n globalObject = apiHandler;\n globalObject.configurations = configurations;\n}", "async connectedCallback() {\n // use convention over code to load the HTML file seperating logic from ui.\n // the convention here is that the two files share the same name but have different extensions.\n // as far as possible keep your js, html and css seperate loading each as and when you need it.\n this.innerHTML = await fetch(import.meta.url.replace(\".js\", \".html\")).then(result => result.text());\n\n // read all the required elements from dom and cache is to private fields\n this._header = this.querySelector(\"h1\");\n this._content = this.querySelector(\".content\");\n this._button = this.querySelector(\"button\");\n\n // update dom as required\n this._header.innerText = this.getAttribute(\"title\") || \"No title defined\";\n\n // register events\n // Note that the event handler uses the same name as the function it is going to call with the world Handler added.\n // Understand what .bind does\n this._doSomethingHandler = this._doSomething.bind(this);\n this._button.addEventListener(\"click\", this._doSomethingHandler);\n }", "function domReady() {\n // Make sure that the DOM is not already loaded\n if(!isReady) {\n // Remember that the DOM is ready\n isReady = true;\n\n if(readyList) {\n for(var fn = 0; fn < readyList.length; fn++) {\n readyList[fn].call(window, []);\n }\n\n readyList = [];\n }\n }\n }", "function init()\n {\n $(document).on(\"loaded:everything\", runAll);\n }", "function domReady() {\r\n\t\t// Make sure that the DOM is not already loaded\r\n\t\tif(!isReady) {\r\n\t\t\t// Remember that the DOM is ready\r\n\t\t\tisReady = true;\r\n \r\n\t if(readyList) {\r\n\t for(var fn = 0; fn < readyList.length; fn++) {\r\n\t readyList[fn].call(window, []);\r\n\t }\r\n \r\n\t readyList = [];\r\n\t }\r\n\t\t}\r\n\t}", "function domReady() {\n // Make sure that the DOM is not already loaded\n if (!isReady) {\n // Remember that the DOM is ready\n isReady = true;\n\n if (readyList) {\n for (var fn = 0; fn < readyList.length; fn++) {\n readyList[fn].call(window, []);\n }\n\n readyList = [];\n }\n }\n }", "function domReady() {\n // Make sure that the DOM is not already loaded\n if (!isReady) {\n // Remember that the DOM is ready\n isReady = true;\n\n if (readyList) {\n for (var fn = 0; fn < readyList.length; fn++) {\n readyList[fn].call(window, []);\n }\n\n readyList = [];\n }\n }\n }", "function prepareDocument() {\r\n \t\r\n \tvar head = document.head || document.getElementsByTagName('head')[0],\r\n \tbody = document.body || document.getElementsByTagName('body')[0];\r\n \r\n // style\r\n var styleTag = document.createElement('style');\r\n \t\tstyleTag.type = 'text/css';\r\n \t\r\n\t\tif (styleTag.styleSheet) { styleTag.styleSheet.cssText = _customCSS; }\r\n\t\telse { styleTag.appendChild(document.createTextNode(_customCSS)); }\r\n\t\t\r\n\t\thead.appendChild(styleTag);\r\n\r\n\t\t// spinner\r\n \tvar spinnerDiv = document.createElement('div'); \t\r\n \t\tspinnerDiv.id = 'coreloader';\r\n\r\n \tbody.appendChild(spinnerDiv);\r\n\t\t\r\n \t// attach the Spinner\r\n\t\t_spinner = new Spinner(_spinnerOptions[0]).spin(spinnerDiv);\r\n\t\t_spinner.elm = spinnerDiv;\r\n }", "function init() {\n\tconst params = getUrlParameters() // valuable information is encoded in the URL\n\tconst dataPromise = loadData(params) // start loading the data\n\tconst callback = () => app(params, dataPromise)\n\n\t// set error handlers\n\twindow.addEventListener(\"error\", errorHandler)\n\twindow.addEventListener(\"unhandledrejection\", errorHandler)\n\n\tif (document.readyState !== \"loading\")\n\t\tdocument.addEventListener(\"DOMContentLoaded\", callback)\n\telse\n\t\tcallback()\n}", "function createUI(){\n /**\n * @class DocumentApp\n */\n enyo.kind(\n /** @lends DocumentApp.prototype */\n {\n name: 'DocumentApp',\n kind: enyo.Control,\n\n /**\n * When the component is being created it renders the\n\t\t\t\t * template for the document preview, and calling functions\n\t\t\t\t * that process cookie and GET parameters.\n\t\t\t\t * @method create\n */\n create: function(){\n this.inherited(arguments);\n renderTemplateDiv();\n\t\t\t\t\tthis.processCookieValues();\n this.processGETParameters();\n },\n\n /**\n * After the rendering the program calculates and sets the\n * position of the bookmark popup and the size of the preview box.\n\t\t\t\t * @method rendered\n */\n rendered: function(){\n this.inherited(arguments);\n this.previewOriginHeight = jQuery('#' + this.$.previewBox.getOpenDocId()).height();\n this.changeBMPopupPosition();\n\t\t\t\t\tthis.initDraggers();\n },\n\n published: {\n searchWord: '',\n checkedEntities: [],\n lang: 'en'\n },\n\n components: [\n {\n kind: 'TopMessageBox',\n name: 'topMessageBox',\n classes: 'topMessageBox'\n },\n {\n tag: 'div',\n classes: 'docApp',\n name: 'docApp',\n components: [\n { name: 'Toolbar', classes: 'toolbar', components: [\n { name: 'ToolbarCenter', classes: 'toolbarCenter', components: [\n {\n\t\t\t\t\t\t\t\t\t\t\tname: 'mainLogo',\n\t\t\t\t\t\t\t\t\t\t\tclasses: 'mainLogo',\n\t\t\t\t\t\t\t\t\t\t\tontap: 'clickLogo'\n },\n {\n\t\t\t\t\t\t\t\t\t\t\tkind: 'SearchBox',\n\t\t\t\t\t\t\t\t\t\t\tname: 'searchBox',\n\t\t\t\t\t\t\t\t\t\t\tplaceholder: 'Search in documents',\n\t\t\t\t\t\t\t\t\t\t\tbuttonClass: 'searchButton',\n\t\t\t\t\t\t\t\t\t\t\tbuttonContent: 'OK',\n\t\t\t\t\t\t\t\t\t\t\tsearchIconClass: 'searchImage',\n\t\t\t\t\t\t\t\t\t\t\tparentSeachFunction: 'search'\n },\n\t\t\t\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t\t\t\tname: 'toolbarIcons',\n\t\t\t\t\t\t\t\t\t\t\tclasses: 'toolbarIcons',\n\t\t\t\t\t\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t\t\t\t\t\t{kind: 'Group', classes: 'viewTypeToggleButtons', onActivate: \"onViewTypeToggle\", components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.TooltipDecorator\", components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.IconButton\", name: 'docListViewButton', classes: 'docListViewButton' },\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Tooltip\", content: \"Document list view\", classes: 'menuItemTooltip', active: false }\n\t\t\t\t\t\t\t\t\t\t\t\t\t]},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.TooltipDecorator\", components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.IconButton\", name: 'entityListViewButton', classes: 'entityListViewButton'},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Tooltip\", content: \"Entity list view\", classes: 'menuItemTooltip', active: false }\n\t\t\t\t\t\t\t\t\t\t\t\t\t]},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.TooltipDecorator\", components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.IconButton\", name: 'locationViewButton', classes: 'locationViewButton'},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Tooltip\", content: \"LocationMapper\", classes: 'menuItemTooltip', active: false }\n\t\t\t\t\t\t\t\t\t\t\t\t\t]},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.TooltipDecorator\", components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.IconButton\", name: 'landscapeViewButton', classes: 'landscapeViewButton'},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Tooltip\", content: \"Landscape view\", classes: 'menuItemTooltip', active: false }\n\t\t\t\t\t\t\t\t\t\t\t\t\t]},\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.TooltipDecorator\", components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.IconButton\", name: 'nGraphViewButton', classes: 'nGraphViewButton'},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Tooltip\", content: \"Network graph view\", classes: 'menuItemTooltip', active: false }\n\t\t\t\t\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\t\t\t\t]},\n\t\t\t\t\t\t\t\t\t\t\t\t{kind: 'onyx.MenuDecorator', name: 'styleSettingsSelect', classes: 'styleSettingsSelect', onSelect: 'selectCss', components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.IconButton\", name: 'brushButton', classes: 'brushButton' },\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Tooltip\", content: \"Style settings\", classes: 'menuItemTooltip', active: false },\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Menu\", name: 'styleSettingsMenu', classes: 'styleSettingsMenu', components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{content: \"Default\", name: \"firstswim\", classes: \"stylePickerItem\", value: 'firstswim'},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{content: \"High contrast\", name: \"contrast\", classes: \"stylePickerItem\", value: 'contrast'},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{content: \"Orange\", name: \"beer\", classes: \"stylePickerItem\", value: 'beer'},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{content: \"Clear\", name: \"clear\", classes: \"stylePickerItem\", value: 'clear'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\t\t\t\t]},\n\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.TooltipDecorator\", components: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.IconButton\", ontap: 'login', name: 'loginButton', classes: 'loginButton loggedOut' },\n\t\t\t\t\t\t\t\t\t\t\t\t\t{kind: \"onyx.Tooltip\", content: \"Login\", classes: 'menuItemTooltip', active: false }\n\t\t\t\t\t\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t\t\t\t\t\t\t/*,\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'bookmark',\n\t\t\t\t\t\t\t\t\t\t\t\t\tkind: 'Bookmark',\n\t\t\t\t\t\t\t\t\t\t\t\t\tbuttonClass: 'bookmarkButton',\n\t\t\t\t\t\t\t\t\t\t\t\t\tparentTapFunction: 'createBookmark',\n\t\t\t\t\t\t\t\t\t\t\t\t\tparentPopupFunction: 'popupBookmark',\n\t\t\t\t\t\t\t\t\t\t\t\t\twarningPopupClass: 'bookmarkPopup',\n\t\t\t\t\t\t\t\t\t\t\t\t\twarningPopupContent: '<br/>Your browser doesn\\'t support add bookmark via Javascript.<br/><br/>Please insert this URL manually:<br/><br/>'\n\t\t\t\t\t\t\t\t\t\t\t\t} */\n\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tkind: 'LoginPopup',\n\t\t\t\t\t\t\t\t\t\t\tname: 'loginPopup',\n\t\t\t\t\t\t\t\t\t\t\tclasses: 'loginPopup'\n\t\t\t\t\t\t\t\t\t\t}\n ]}\n ]},\n { kind: 'ClosablePopup', name: 'bookmarkPopup', classes: 'bookmarkPopup', popupClasses: 'bookmarkPopupDiv', closeButtonClasses: 'popupCloseButton' },\n {\n kind: 'PreviewBox',\n name: 'previewBox',\n classes: 'previewBox',\n previewBoxMainTitle: 'Preview',\n previewBoxMainTitleClass: 'previewBoxMainTitle'\n }\n ]\n }\n ],\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function calls the 'initViewType' function which\n\t\t\t\t * sets the view type based on cookie values and calls the\n\t\t\t\t * 'setCss' function too.\n\t\t\t\t * @method processCookieValues\n\t\t\t\t */\n\t\t\t\tprocessCookieValues: function() {\n\t\t\t\t\tthis.initViewType();\n\t\t\t\t\tthis.setCss(readCookie('css'));\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function runs when the user selects a stylesheet.\n\t\t\t\t * It calls the 'setCss' function with the proper value.\n\t\t\t\t * @method selectCss\n\t\t\t\t */\n\t\t\t\tselectCss: function(inSender, inEvent) {\n\t\t\t\t\tthis.setCss(inEvent.originator.value);\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function changes the stylesheet behind the page and \n\t\t\t\t * places a cookie.\n\t\t\t\t * @method setCss\n\t\t\t\t */\n\t\t\t\tsetCss: function(cssName) {\n\t\t\t\t\t$(\"#mainCss\").attr(\"href\", CONSTANTS.STYLE_PATH + cssName + \".css\");\n\t\t\t\t\tcreateCookie('css', cssName, 30);\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function initializes the view type at the beginning\n\t\t\t\t * using the 'viewType' cookie value by setting up the toggle \n\t\t\t\t * buttons and calling the 'createViewType' function with the\n\t\t\t\t * proper parameter value.\n\t\t\t\t * @method initViewType\n\t\t\t\t */\n\t\t\t\tinitViewType: function() {\n\t\t\t\t\tswitch(readCookie('viewType')) {\n\t\t\t\t\t\tcase 'documentList':\n\t\t\t\t\t\t\tthis.$.docListViewButton.setActive(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'entityList':\n\t\t\t\t\t\t\tthis.$.entityListViewButton.setActive(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'locationViewer':\n\t\t\t\t\t\t\tthis.$.locationViewButton.setActive(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'landscape':\n\t\t\t\t\t\t\tthis.$.landscapeViewButton.setActive(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'nGraph':\n\t\t\t\t\t\t\tthis.$.nGraphViewButton.setActive(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tthis.$.docListViewButton.setActive(true);\n\t\t\t\t\t}\n\t\t\t\t\tthis.createViewType(readCookie('viewType'));\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function runs after changing the view type.\n\t\t\t\t * First, it checks whether it is really a change or\n\t\t\t\t * the same as the current one. If it has to be changed,\n\t\t\t\t * it calls the toggle functions, sets the cookie value\n\t\t\t\t * and fires a search using the current search term.\n\t\t\t\t * @method toggleViewType\n\t\t\t\t */\n\t\t\t\ttoggleViewType: function(viewType) {\n\t\t\t\t\tif(readCookie('viewType') != viewType) {\n\t\t\t\t\t\tthis.destroyCurrentViewType(viewType);\n\t\t\t\t\t\tcreateCookie('viewType', viewType, 30);\n\t\t\t\t\t\tthis.createViewType(viewType);\n\t\t\t\t\t\tthis.search(this.searchWord);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function initializes every components after changing \n\t\t\t\t * view type. It creates both panels and draggers.\n\t\t\t\t * @method createViewType\n\t\t\t\t */\n\t\t\t\tcreateViewType: function(viewType) {\n\t\t\t\t\tswitch(viewType) {\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\tcase 'documentList':\n\t\t\t\t\t\t\tthis.createComponent({\tname: 'leftDesktopCol',\n\t\t\t\t\t\t\t\t\t\t\t\t\tclasses: 'leftDesktopCol',\n\t\t\t\t\t\t\t\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkind: 'DictionaryController',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topenClasses: 'dictionaryListOpen',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcloseClasses: 'dictionaryListClose',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topenScrollerClass: 'dictionaryListScrollOpen',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcloseScrollerClass: 'dictionaryListScrollClose',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tentityCheckboxClass: 'dictionaryCheckbox',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearchFunction: 'search',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'dictionaries',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdictionaryTitle: 'Entities',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitleClass: 'dictionariesMainTitle',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tshowDetailsFunction: 'displayDetails'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkind: 'DetailsBox',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'detailsBox',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclasses: 'detailsBox enyo-unselectable',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdetailsMainTitle: 'Details',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmainTitleClass: 'detailsMainTitle',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tscrollerClass: 'detailsScroll',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitleClass: 'detailsTitle'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\tname: 'firstDocDragger', classes: 'firstDocDragger verticalDragger' });\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\tkind: 'DocumentList',\n\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'documents',\n\t\t\t\t\t\t\t\t\t\t\t\t\topenDocFunction: 'openDoc',\n\t\t\t\t\t\t\t\t\t\t\t\t\topenDocEvent: 'ontap',\n\t\t\t\t\t\t\t\t\t\t\t\t\tclasses: 'documentList',\n\t\t\t\t\t\t\t\t\t\t\t\t\tloaderClass: 'loader',\n\t\t\t\t\t\t\t\t\t\t\t\t\tscrollerClass: 'documentListScroll',\n\t\t\t\t\t\t\t\t\t\t\t\t\ttitleClass: 'documentsMainTitle',\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassifyFinishFunction: 'processClassifyResponse',\n\t\t\t\t\t\t\t\t\t\t\t\t\ttitleContent: 'Documents ',\n\t\t\t\t\t\t\t\t\t\t\t\t\tdocumentsCountClass: 'documentsCount',\n\t\t\t\t\t\t\t\t\t\t\t\t\tnoDataLabel: 'No data available',\n\t\t\t\t\t\t\t\t\t\t\t\t\tmoreButtonClass: 'moreButton',\n\t\t\t\t\t\t\t\t\t\t\t\t\tmoreDocumentsFunction: 'moreDocuments'\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\tname: 'secondDocDragger', classes: 'secondDocDragger verticalDragger' });\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.render();\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'entityList':\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\tname: 'leftDesktopCol',\n\t\t\t\t\t\t\t\t\t\t\t\t\tclasses: 'leftDesktopCol',\n\t\t\t\t\t\t\t\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkind: 'DictionaryController',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topenClasses: 'dictionaryListOpen',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcloseClasses: 'dictionaryListClose',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topenScrollerClass: 'dictionaryListScrollOpen',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcloseScrollerClass: 'dictionaryListScrollClose',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tentityCheckboxClass: 'dictionaryCheckbox',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearchFunction: 'search',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'dictionaries',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdictionaryTitle: 'Organizations',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitleClass: 'dictionariesMainTitle',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tshowDetailsFunction: 'displayDetails'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkind: 'DetailsBox',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'detailsBox',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclasses: 'detailsBox enyo-unselectable',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdetailsMainTitle: 'Details',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmainTitleClass: 'detailsMainTitle',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tscrollerClass: 'detailsScroll',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitleClass: 'detailsTitle'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\tname: 'firstDocDragger', classes: 'firstDocDragger verticalDragger' });\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\tkind: 'DocumentList',\n\t\t\t\t\t\t\t\t\t\t\t\t\tname: 'documents',\n\t\t\t\t\t\t\t\t\t\t\t\t\topenDocFunction: 'openDoc',\n\t\t\t\t\t\t\t\t\t\t\t\t\topenDocEvent: 'ontap',\n\t\t\t\t\t\t\t\t\t\t\t\t\tclasses: 'documentList',\n\t\t\t\t\t\t\t\t\t\t\t\t\tloaderClass: 'loader',\n\t\t\t\t\t\t\t\t\t\t\t\t\tscrollerClass: 'documentListScroll',\n\t\t\t\t\t\t\t\t\t\t\t\t\ttitleClass: 'documentsMainTitle',\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassifyFinishFunction: 'processClassifyResponse',\n\t\t\t\t\t\t\t\t\t\t\t\t\ttitleContent: 'People ',\n\t\t\t\t\t\t\t\t\t\t\t\t\tdocumentsCountClass: 'documentsCount',\n\t\t\t\t\t\t\t\t\t\t\t\t\tnoDataLabel: 'No data available',\n\t\t\t\t\t\t\t\t\t\t\t\t\tmoreButtonClass: 'moreButton',\n\t\t\t\t\t\t\t\t\t\t\t\t\tmoreDocumentsFunction: 'moreDocuments'\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\tname: 'secondDocDragger', classes: 'secondDocDragger verticalDragger' });\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.render();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'locationViewer':\n\t\t\t\t\t\t\tthis.createComponent({\n\t\t\t\t\t\t\t\tkind: 'LocationViewer',\n\t\t\t\t\t\t\t\tname: 'locationViewer',\n\t\t\t\t\t\t\t\tclasses: 'locationViewerPanel',\n\t\t\t\t\t\t\t\tloaderClass: 'loader',\n\t\t\t\t\t\t\t\ttitleClass: 'locationViewerMainTitle',\n\t\t\t\t\t\t\t\ttitleContent: 'Location viewer ',\n\t\t\t\t\t\t\t\tnoDataLabel: 'No data available'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tthis.render();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'landscape':\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.createComponent({\n\t\t\t\t\t\t\t\t\tkind: 'Landscape',\n\t\t\t\t\t\t\t\t\tname: 'landscape',\n\t\t\t\t\t\t\t\t\tclasses: 'landscapePanel',\n\t\t\t\t\t\t\t\t\tloaderClass: 'loader',\n\t\t\t\t\t\t\t\t\ttitleClass: 'landscapeMainTitle',\n\t\t\t\t\t\t\t\t\ttitleContent: 'Landscape '\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tthis.render();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'nGraph':\n\t\t\t\t\t\t\tthis.createComponent({\n\t\t\t\t\t\t\t\tkind: 'NGraph',\n\t\t\t\t\t\t\t\tname: 'nGraph',\n\t\t\t\t\t\t\t\topenDocFunction: 'openDoc',\n\t\t\t\t\t\t\t\topenDocEvent: 'ontap',\n\t\t\t\t\t\t\t\tclasses: 'nGraphPanel',\n\t\t\t\t\t\t\t\tloaderClass: 'loader',\n\t\t\t\t\t\t\t\ttitleClass: 'nGraphMainTitle',\n\t\t\t\t\t\t\t\ttitleContent: 'Network graph ',\n\t\t\t\t\t\t\t\tnoDataLabel: 'No data available'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tthis.createComponent({\tname: 'nGraphDragger', classes: 'nGraphDragger verticalDragger' });\n\t\t\t\t\t\t\tthis.render();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function handles view type toggling by calling the\n\t\t\t\t * toggle function with the proper parameter.\n\t\t\t\t * @method onViewTypeToggle\n\t\t\t\t */\n\t\t\t\tonViewTypeToggle: function(inSender, inEvent) {\n\t\t\t\t\tif (inEvent.originator.getActive()) {\n\t\t\t\t\t\t//var selected = inEvent.originator.indexInContainer();\n\t\t\t\t\t\tswitch(inEvent.originator.name) {\n\t\t\t\t\t\t\tcase 'docListViewButton':\n\t\t\t\t\t\t\t\tthis.toggleViewType('documentList');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'entityListViewButton':\n\t\t\t\t\t\t\t\tthis.toggleViewType('entityList');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'locationViewButton':\n\t\t\t\t\t\t\t\tthis.toggleViewType('locationViewer');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'landscapeViewButton':\n\t\t\t\t\t\t\t\tthis.toggleViewType('landscape');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'nGraphViewButton':\n\t\t\t\t\t\t\t\tthis.toggleViewType('nGraph');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function destroys every components of the current view type\n\t\t\t\t * in case it's not the same as the new view type.\n\t\t\t\t * @method destroyCurrentViewType\n\t\t\t\t */\n\t\t\t\tdestroyCurrentViewType: function(newType) {\n\t\t\t\t\tswitch (readCookie('viewType')) {\n\t\t\t\t\t\tcase 'nGraph':\n\t\t\t\t\t\t\tthis.$.nGraph.destroy();\n\t\t\t\t\t\t\tthis.$.nGraphDragger.destroy();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'documentList':\t\n\t\t\t\t\t\tcase 'entityList':\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.$.leftDesktopCol.destroy();\n\t\t\t\t\t\t\tthis.$.firstDocDragger.destroy();\n\t\t\t\t\t\t\tthis.$.documents.destroy();\n\t\t\t\t\t\t\tthis.$.secondDocDragger.destroy();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'landscape':\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.$.landscape.destroy();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'locationViewer':\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthis.$.locationViewer.destroy();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function initializes all the draggers that the page contains.\n\t\t\t\t * It uses jQuery 'draggable'.\n\t\t\t\t * @method initDraggers\n\t\t\t\t */\n\t\t\t\tinitDraggers: function() {\n\t\t\t\t\tif($('.firstDocDragger').length > 0) {\n\t\t\t\t\t\t$('.firstDocDragger').draggable({\n\t\t\t\t\t\t\taxis: \"x\",\n\t\t\t\t\t\t\tdrag: function( event, ui ) {\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar docListCalcWidth = parseInt($('.previewBox').css('left'), 10) - ((ui.position.left - 10 ) + 30);\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif( ui.position.left > 80 && docListCalcWidth > 160 ) {\n\t\t\t\t\t\t\t\t\t$('.leftDesktopCol').css('width', ( ui.position.left - 10 )+'px');\n\t\t\t\t\t\t\t\t\t$('.documentList').css('left', ( ui.position.left + 10 )+'px');\n\t\t\t\t\t\t\t\t\t$('.documentList').css('width', docListCalcWidth+'px');\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\tevent.type = 'mouseup';\n\t\t\t\t\t\t\t\t\t$('.firstDocDragger').trigger(event);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif($('.secondDocDragger').length > 0) {\n\t\t\t\t\t\t$('.secondDocDragger').draggable({\n\t\t\t\t\t\t\taxis: \"x\",\n\t\t\t\t\t\t\tdrag: function( event, ui ) {\n\t\t\t\t\t\t\t\tvar docListCalcWidth = ui.position.left - ($('.leftDesktopCol').width() + 20);\n\t\t\t\t\t\t\t\tif( ($(document).width() - ui.position.left ) > 80 && docListCalcWidth > 160 ) {\n\t\t\t\t\t\t\t\t\t$('.documentList').css('width', docListCalcWidth + 'px');\n\t\t\t\t\t\t\t\t\t$('.previewBox').css('left', ( ui.position.left + 10 )+'px');\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\tevent.type = 'mouseup';\n\t\t\t\t\t\t\t\t\t$('.secondDocDragger').trigger(event);\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\tif($('.nGraphDragger').length > 0) {\n\t\t\t\t\t\tvar main = this;\n\t\t\t\t\t\t$('.nGraphDragger').draggable({\n\t\t\t\t\t\t\taxis: \"x\",\n\t\t\t\t\t\t\tdrag: function( event, ui ) {\n\t\t\t\t\t\t\t\tvar nGraphCalcWidth = ui.position.left - 10;\n\t\t\t\t\t\t\t\tif( ($(document).width() - ui.position.left ) > 80 && nGraphCalcWidth > 160 ) {\n\t\t\t\t\t\t\t\t\t$('.nGraphDiv').css('width', nGraphCalcWidth + 'px');\n\t\t\t\t\t\t\t\t\t$('.previewBox').css('left', ( ui.position.left + 10 )+'px');\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\tevent.type = 'mouseup';\n\t\t\t\t\t\t\t\t\t$('.nGraphDragger').trigger(event);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmain.$.nGraph.onDivResize();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\n /**\n * This function is called, when the user clicks on the login button.\n * It displays the login popup window.\n\t\t\t\t * @method login\n */\n login: function(){\n this.$.loginPopup.showLogin();\n },\n\n /**\n * This function is called when the user clicks on the logo.\n * It navigates to the Fusepool main site.\n\t\t\t\t * @method clickLogo\n */\n clickLogo: function(){\n window.open(CONSTANTS.FUSEPOOL_MAIN_URL);\n },\n\n /**\n * This function processes GET parameters. If it finds 'search' or\n * 'entity', it fires a search and open the document if there is the\n * 'openPreview' parameter.\n\t\t\t\t * @method processGETParameters\n */\n processGETParameters: function(){\n // Search\n this.search(GetURLParameter('search')[0], GetURLParameter('entity'));\n // Open Document\n var openPreview = GetURLParameter('openPreview')[0];\n if(!isEmpty(openPreview)){\n this.openDoc(openPreview);\n }\n },\n\n /**\n * This function calculates the position of the previewed document\n * and opens the document on the right.\n\t\t\t\t * @method openDoc\n * @param {String} docURI the URI of the clicked document\n * @param {Object} inEvent mouse over on a short document event\n */\n openDoc: function(docURI, inEvent){\n if(!isEmpty(inEvent)){\n var topMessage = jQuery('#' + this.$.topMessageBox.getId());\n var topMessageVisible = topMessage.is(':visible');\n var topMessageHeight = 0;\n if(topMessageVisible){\n topMessageHeight = topMessage.outerHeight();\n alert(topMessageHeight);\n }\n }\n this.$.previewBox.openDoc(docURI);\n },\n\t\t\t\t\n /**\n * This function queries the Annostore for a single annotation - only for testing purposes.\n\t\t\t\t * @method getAnnotation\n * @param {String} annotationIRI identifier of the annotation\n */\n\t\t\t\tgetAnnotation: function(annotationIRI){\n\t\t\t\t\tvar request = new enyo.Ajax({\n\t\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\t\turl: CONSTANTS.ANNOTATION_URL+'?iri='+annotationIRI,\n\t\t\t\t\t\thandleAs: 'text',\n\t\t\t\t\t\theaders: { Accept : 'application/rdf+xml', 'Content-Type' : 'application/x-www-form-urlencoded'},\n\t\t\t\t\t\tpublished: { timeout: 60000 }\n\t\t\t\t\t});\n\t\t\t\t\trequest.go();\n\t\t\t\t\trequest.error(this, function(){\n\t\t\t\t\t\tconsole.log(\"error\");\n\t\t\t\t\t});\n\t\t\t\t\trequest.response(this, function(inSender, inResponse) {\n\t\t\t\t\t\t// console.log(\"success: \"+inResponse);\n\t\t\t\t\t});\n },\n\n /**\n * This function creates and saves a bookmark, which contains the\n * search word, the unchecked entities and the opened document.\n\t\t\t\t * @method createBookmark\n */\n createBookmark: function(){\n if(!isEmpty(this.searchWord)){\n // Cut characters after '?'\n var location = window.location.href;\n var parametersIndex = location.indexOf('?');\n if(parametersIndex !== -1){\n location = location.substr(0, parametersIndex);\n }\n // Search word\n var url = location + '?search=' + this.searchWord;\n // Unchecked entities\n var entities = this.getCheckedEntities();\n for(var i=0;i<entities.length;i++){\n if(!isEmpty(entities[i].id)){\n url += '&entity=' + entities[i].id;\n } else {\n url += '&entity=' + entities[i];\n }\n }\n // Preview document\n var documentURL = this.$.previewBox.getDocumentURI();\n if(!isEmpty(documentURL)){\n url += '&openPreview=' + documentURL;\n }\n\n var title = 'Fusepool';\n this.$.bookmark.saveBookmark(url, title);\n } else {\n this.$.bookmark.saveBookmark(url, title);\n }\n },\n\n /**\n * This function shows a message in a popup.\n\t\t\t\t * @method popupBookmark\n * @param {String} message the message\n */\n popupBookmark: function(message){\n this.$.bookmarkPopup.show();\n this.$.bookmarkPopup.setContent(message);\n this.changeBMPopupPosition();\n },\n\n /**\n * This function calculates the position of the popup to be \n * displayed horizontally in the center, vertically on the top.\n\t\t\t\t * @method changeBMPopupPosition\n */\n changeBMPopupPosition: function(){\n if(!isEmpty(this.$.bookmarkPopup.getContent())){\n var jQBookmark = jQuery('#' + this.$.bookmarkPopup.getId());\n var popupWidth = jQBookmark.outerWidth();\n var windowWidth = jQuery('#' + this.getId()).width();\n var newLeft = (windowWidth - popupWidth) / 2;\n this.$.bookmarkPopup.applyStyle('left', newLeft + 'px');\n }\n },\n\n /**\n * This function is called when the screen size is changing.\n * This function calls the bookmark popup changer function and the\n * preview box size changer function.\n\t\t\t\t * @method resizeHandler\n */\n resizeHandler: function() {\n this.inherited(arguments);\n this.changeBMPopupPosition();\n },\n\n /**\n * This function reduces the preview box height if there isn't enough\n * place for that. It sets the default height for the box otherwise.\n\t\t\t\t * @method changePreviewBoxSize\n */\n changePreviewBoxSize: function(){\n var windowHeight = jQuery(window).height();\n var newHeight = windowHeight - 110;\n\n if(newHeight < this.previewOriginHeight){\n this.$.previewBox.changeHeight(newHeight);\n } else {\n this.$.previewBox.changeHeight(this.previewOriginHeight);\n }\n },\n\n /**\n * This function calls the ajax search if the search word is not empty.\n\t\t\t\t * @method search\n * @param {String} searchWord the search word\n * @param {Array} checkedEntities the checked entities on the left side\n */\n search: function(searchWord, checkedEntities){\n\t\t\t\t\tcheckedEntities = typeof checkedEntities !== 'undefined' ? checkedEntities : [];\n this.searchWord = searchWord;\n\t\t\t\t\tcreateCookie('lastSearch',searchWord,30);\n this.checkedEntities = checkedEntities;\n if(!isEmpty(searchWord)){\n\t\t\t\t\t\tthis.cleanPreviewBox();\n\t\t\t\t\t\tswitch(readCookie('viewType')) {\n\t\t\t\t\t\t\tcase 'entityList':\n\t\t\t\t\t\t\tcase 'documentList':\n\t\t\t\t\t\t\t\tthis.$.documents.startLoading();\n\t\t\t\t\t\t\t\tthis.sendSearchRequest(searchWord, checkedEntities, 'processSearchResponse');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'nGraph':\n\t\t\t\t\t\t\t\tthis.$.nGraph.newGraph();\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'landscape':\n\t\t\t\t\t\t\t\tthis.$.landscape.startLoading();\n\t\t\t\t\t\t\t\tthis.sendSearchRequest(searchWord, [], 'processSearchResponse');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'locationViewer':\n\t\t\t\t\t\t\t\tthis.$.locationViewer.search(searchWord);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n this.$.searchBox.updateInput(this.searchWord);\n }\n },\n\n /**\n * This function sends an ajax request for searching.\n\t\t\t\t * @method sendSearchRequest\n * @param {String} searchWord the search word\n * @param {String} checkedEntities the checked entities on the left side\n * @param {String} responseFunction the name of the response function\n * @param {Number} offset the offset of the documents (e.g. offset = 10 --> documents in 10-20)\n */\n sendSearchRequest: function(searchWord, checkedEntities, responseFunction, offset){\n var main = this;\n var url = this.createSearchURL(searchWord, checkedEntities, offset);\n var store = rdfstore.create();\n store.load('remote', url, function(success) {\n main[responseFunction](success, store);\n });\n },\n\n /**\n * This function creates the search URL for the query.\n\t\t\t\t * @method createSearchURL\n * @param {String} searchWord the search word\n * @param {Array} checkedEntities the checked entities\n * @param {Number} offset offset of the query\n * @return {String} the search url\n */\n createSearchURL: function(searchWord, checkedEntities, offset){\n\t\t\t\t\t\n\t\t\t\t\t// var labelPattern = /^.*'label:'.*$/;\n\t\t\t\t\t// if(labelPattern.test(searchWord)) {\n\t\t\t\t\t\n\t\t\t\t\t// }\n\t\t\t\t\t// var predictedLabelPattern = /^.*'predicted label:'.*$/;\n\t\t\t\t\t// if(predictedLabelPattern.test(searchWord)) {\n\t\t\t\t\t\n\t\t\t\t\t// }\n\t\t\t\t\t\n\t\t\t\t\tif(readCookie('viewType') == \"entityList\") {\n\t\t\t\t\t\tvar url = CONSTANTS.ENTITY_SEARCH_URL;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar url = CONSTANTS.SEARCH_URL;\n\t\t\t\t\t}\n if(isEmpty(offset)){\n offset = 0;\n }\n url += '?search='+searchWord;\n if(checkedEntities.length > 0){\n url += this.getCheckedEntitiesURL(checkedEntities);\n }\n url += '&offset='+offset+'&maxFacets='+readCookie('maxFacets')+'&items='+readCookie('items');\n return url;\n },\n\n /**\n * This function sends a request for more documents.\n\t\t\t\t * @method moreDocuments\n * @param {Number} offset the offset of the document (e.g. offset = 10 -> documents 10-20)\n */\n moreDocuments: function(offset){\n this.sendSearchRequest(this.searchWord, this.checkedEntities, 'processMoreResponse', offset);\n },\n\n /**\n * This function runs after the ajax more search is done.\n * This function calls the document updater function.\n\t\t\t\t * @method processMoreResponse\n * @param {Boolean} success status of the search query\n * @param {Object} rdf the response rdf object\n */\n processMoreResponse: function(success, rdf){\n var documents = this.createDocumentList(rdf);\n this.$.documents.addMoreDocuments(documents);\n },\n\n /**\n * This function creates a URL fraction that represents\n\t\t\t\t * the checked entities.\n\t\t\t\t * @method getCheckedEntitiesURL\n * @param {Array} checkedEntities the original checked entities\n * @return {String} built URL fraction\n */\n getCheckedEntitiesURL: function(checkedEntities){\n var result = '';\n for(var i=0;i<checkedEntities.length;i++){\n if(checkedEntities[i].typeFacet){ \n result += '&type=' + replaceAll(checkedEntities[i].id, '#', '%23');\n } else {\n result += '&subject=' + checkedEntities[i].id;\n }\n }\n return result;\n },\n\n /**\n * This function runs after the ajax search is done. It calls\n * the entity list updater and the document updater functions.\n\t\t\t\t * @method processSearchResponse\n * @param {Boolean} success status of the search query\n * @param {Object} rdf the response rdf object\n */\n processSearchResponse: function(success, rdf){\n if(success) {\n\t\t\t\t\t\tswitch(readCookie('viewType')) {\n\t\t\t\t\t\t\tcase 'documentList':\n\t\t\t\t\t\t\tcase 'entityList':\n\t\t\t\t\t\t\t\tthis.updateEntityList(rdf, this.searchWord);\n\t\t\t\t\t\t\t\tthis.updateDocumentList(rdf);\n\t\t\t\t\t\t\t\tthis.cleanDetailsBox();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'landscape':\n\t\t\t\t\t\t\t\tFusePool.Landscaping.doSearch();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthis.$.documents.updateList([], this.searchWord, this.checkedEntities);\n\t\t\t\t\t\tthis.$.documents.documentsCount = 0;\n\t\t\t\t\t\tthis.$.documents.updateCounts();\n\t\t\t\t\t}\n\t\t\t\t},\n\n /**\n * This function is called after a successful classification.\n\t\t\t\t * @method processClassifyResponse\n * @param {Object} rdf the rdf response of the request\n * @param {String} searchWord the search word\n */\n processClassifyResponse: function(rdf, searchWord){\n this.updateEntityList(rdf, searchWord);\n this.updateClassifiedDocList(rdf);\n },\n\n /**\n * This function updates the document list after classification\n\t\t\t\t * to have the correct order.\n\t\t\t\t * @method updateClassifiedDocList\n * @param {Object} rdf the RDF object\n */\n updateClassifiedDocList: function(rdf){\n var documents = this.createClassifiedDocList(rdf);\n this.$.documents.updateList(documents, this.searchWord);\n this.$.documents.documentsCount = this.getDocumentsCount(rdf);\n this.$.documents.updateCounts();\n },\n\n /**\n * This function creates a document list after classification.\n\t\t\t\t * @method createClassifiedDocList\n * @param {Object} rdf the RDF object\n * @return {Array} the created document list\n */\n createClassifiedDocList: function(rdf){\n var documents = [];\n var main = this;\n\n var query = 'SELECT * { ?url <http://fusepool.eu/ontologies/ecs#textPreview> ?preview';\n query += ' OPTIONAL { ?url <http://purl.org/dc/terms/title> ?title }';\n query += ' OPTIONAL { ?url <http://purl.org/dc/terms/abstract> ?content }';\n query += ' OPTIONAL { ?url <http://www.w3.org/2001/XMLSchema#double> ?orderVal }';\n query += '}';\n query += ' ORDER BY DESC(?orderVal)';\n rdf.execute(query, function(success, results) {\n if (success) {\n for(var i=0;i<results.length;i++){\n var row = results[i];\n if(!isEmpty(row.content) && (isEmpty(row.title) || isEmpty(row.title.lang) || row.title.lang + '' === main.lang)){\n var content = row.content.value;\n var title = '';\n if(!isEmpty(row.title)){\n title = row.title.value;\n }\n if(!main.containsDocument(documents, content, title, row.url.value)){\n documents.push({url: row.url.value, shortContent: content, title: title});\n }\n }\n }\n }\n });\n return documents;\n },\n\n /**\n * This function groups and sorts the entities and updates\n\t\t\t\t * the entity list on the left side.\n\t\t\t\t * @method updateEntityList\n * @param {Object} rdf the rdf object which contains the new entity list\n * @param {String} searchWord the search word\n */\n updateEntityList: function(rdf, searchWord){\n // The checked facets and type facets\n var checkedEntities = this.getCheckedEntities(rdf);\n\n // The facet and the type facet list\n var categories = this.getEntities(rdf);\n\n var groupVars = _.groupBy(categories, function(val){ return val.value; });\n var sortedGroup = _.sortBy(groupVars, function(val){ return -val.length; });\n\n var dictionaries = [];\n for(var i=0;i<sortedGroup.length;i++){\n // One category\n var category = sortedGroup[i];\n if(category.length > 0){\n var categoryText = replaceAll(category[0].value, '_', ' ');\n var categoryName = categoryText.substr(categoryText.lastIndexOf('/')+1);\n\n var entities = [];\n for(var j=0;j<category.length;j++){\n this.deteleLaterEntities(sortedGroup, category[j].entity, i);\n // Entity\n var entityId = category[j].entityId;\n var entityText = replaceAll(category[j].entity + '', '_', ' ');\n var entityName = entityText.substr(entityText.lastIndexOf('/')+1);\n entityName = entityName.substr(entityName.lastIndexOf('#')+1);\n var entityCount = category[j].count;\n var typeFacet = category[j].typeFacet;\n\n var entity = {id: entityId, text:entityName, count: entityCount, typeFacet: typeFacet};\n if(!this.containsEntity(entities, entity)){\n entities.push(entity);\n }\n }\n dictionaries.push({ name: categoryName, entities: entities });\n }\n }\n var dictionaryObject = { searchWord: searchWord, checkedEntities: checkedEntities, dictionaries: dictionaries };\n this.$.dictionaries.updateLists(dictionaryObject);\n },\n\n /**\n * This function searches for dictionary categories in an rdf object.\n\t\t\t\t * @method getEntities\n * @param {Object} rdf the rdf object\n * @return {Array} the categories array with the entities\n */\n getEntities: function(rdf){\n var entities = [];\n entities = this.getFacets(rdf);\n entities = entities.concat(this.getTypeFacets(rdf));\n return entities;\n },\n\n /**\n * This function searches for dictionary categories in an rdf object.\n\t\t\t\t * @method getCheckedEntities\n * @param {Object} rdf the rdf object\n * @return {Array} the categories array with the entities\n */\n getCheckedEntities: function(rdf){\n var checkedEntities = [];\n var checkedEntities = this.checkedEntitiesFromRdf(rdf);\n checkedEntities = checkedEntities.concat(this.checkedTypeFacetsFromRdf(rdf));\n return checkedEntities;\n },\n\n /**\n * This function returns an array of type facets found in an RDF object.\n\t\t\t\t * @method getTypeFacets\n * @param {Object} rdf the RDF object which contains the type facets\n * @return {Array} the result array\n */\n getTypeFacets: function(rdf){\n var result = [];\n var query = 'SELECT * { ?v <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://fusepool.eu/ontologies/ecs#ContentStoreView>.';\n query += ' ?v <http://fusepool.eu/ontologies/ecs#typeFacet> ?f. ';\n query += ' ?f <http://fusepool.eu/ontologies/ecs#facetCount> ?count. ';\n query += ' ?f <http://fusepool.eu/ontologies/ecs#facetValue> ?id. ';\n\t\t\t\t\tquery += '\t\tOPTIONAL { { ?id <http://www.w3.org/2000/01/rdf-schema#label> ?entity .';\n\t\t\t\t\tquery += ' filter ( lang(?entity) = \"en\")';\n\t\t\t\t\tquery += ' } UNION { ';\n\t\t\t\t\tquery += ' ?id <http://www.w3.org/2000/01/rdf-schema#label> ?entity .';\n\t\t\t\t\tquery += ' filter ( lang(?entity) = \"\")';\n\t\t\t\t\tquery += ' } } ';\n query += ' OPTIONAL { ?id <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?type }';\n query += '}';\n rdf.execute(query, function(success, results) {\n if (success) {\n for(var i=0;i<results.length;i++){\n var row = results[i];\n var entity = row.entity;\n if(isEmpty(entity)){\n entity = row.id.value;\n } else {\n entity = row.entity.value;\n }\n var type = row.type;\n if(isEmpty(type)){\n type = 'Facet types';\n } else {\n type = row.type.value;\n }\n result.push({entityId: row.id.value, entity: entity, value: type, count: row.count.value, typeFacet: true});\n }\n }\n });\n return result;\n },\n\n\t\t\t\t/**\n * This function returns an array of facets found in an RDF object.\n\t\t\t\t * @method getFacets\n * @param {Object} rdf the RDF object which contains the facets\n * @return {Array} the result array\n\t\t\t\t*/\n getFacets: function(rdf){\n var result = [];\n var query = 'SELECT * { ?v <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://fusepool.eu/ontologies/ecs#ContentStoreView>.';\n query += ' ?v <http://fusepool.eu/ontologies/ecs#facet> ?f. ';\n query += ' ?f <http://fusepool.eu/ontologies/ecs#facetCount> ?count. ';\n query += ' ?f <http://fusepool.eu/ontologies/ecs#facetValue> ?id. ';\n\t\t\t\t\tquery += '\t\tOPTIONAL { { ?id <http://www.w3.org/2000/01/rdf-schema#label> ?entity .';\n\t\t\t\t\tquery += ' filter ( lang(?entity) = \"en\")';\n\t\t\t\t\tquery += ' } UNION { ';\n\t\t\t\t\tquery += ' ?id <http://www.w3.org/2000/01/rdf-schema#label> ?entity .';\n\t\t\t\t\tquery += ' filter ( lang(?entity) = \"\")';\n\t\t\t\t\tquery += ' } } ';\n query += ' OPTIONAL { ?id <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?type }';\n query += '}';\n rdf.execute(query, function(success, results) {\n if (success) {\n for(var i=0;i<results.length;i++){\n var row = results[i];\n\t\t\t\t\t\t\t\t// if(!isEmpty(row.entity)){ \t// X branch\n if(!isEmpty(row.entity) && !isEmpty(row.type)){\n var type = row.type.value;\n var categoryName = type.substring(type.lastIndexOf('#')+1);\n result.push({entityId: row.id.value, entity: row.entity.value, value: categoryName, count: row.count.value, typeFacet: false}); \n }\n }\n }\n });\n return result;\n },\n\n /**\n * This function searches for the checked entities in an RDF object and\n * returns them.\n\t\t\t\t * @method checkedEntitiesFromRdf\n * @param {Object} rdf the rdf object\n * @return {Array} the checked entity list\n */\n checkedEntitiesFromRdf: function(rdf){\n var main = this;\n var checkedEntities = [];\n var query = 'SELECT * { ?s <http://fusepool.eu/ontologies/ecs#subject> ?id';\n query += ' OPTIONAL { ?id <http://www.w3.org/2000/01/rdf-schema#label> ?entity }';\n query += '}';\n rdf.execute(query, function(success, results) {\n if (success) {\n for(var i=0;i<results.length;i++){\n var row = results[i];\n if(!isEmpty(row.entity)){\n var entity = {id: row.id.value, text: row.entity.value, count: -1, typeFacet: false};\n if(!main.containsEntity(checkedEntities, entity)){\n checkedEntities.push(entity);\n }\n }\n }\n }\n });\n return checkedEntities;\n },\n\n /**\n * This function searches for the checked entities in an RDF object and\n * returns them.\n\t\t\t\t * @method checkedTypeFacetsFromRdf\n * @param {Object} rdf the rdf object\n * @return {Array} the checked entity list\n */\n checkedTypeFacetsFromRdf: function(rdf){\n var checkedTypes = [];\n var query = 'SELECT * { ?s <http://fusepool.eu/ontologies/ecs#type> ?o }';\n rdf.execute(query, function(success, results) {\n for(var i=0;i<results.length;i++){\n var id = results[i].o.value;\n var text = id.substring(id.lastIndexOf('#')+1);\n text = text.substring(text.lastIndexOf('/')+1);\n var entity = {id: id, text: text, count: -1, typeFacet: true};\n checkedTypes.push(entity);\n }\n });\n return checkedTypes;\n },\n\n /**\n * This function decides whether an entity list contains an entity or not.\n\t\t\t\t * @method containsEntity\n * @param {Array} entities the array of the entities\n * @param {String} entity the entity\n * @return {Boolean} true, if the list contains the entity, false otherwise\n */\n containsEntity: function(entities, entity){\n for(var i=0;i<entities.length;i++){\n if(entities[i].id === entity.id || entities[i].text.toUpperCase() === entity.text.toUpperCase()){\n return true;\n }\n }\n return false;\n },\n\n /**\n * This function deletes every entity from an array that equals\n * a given entity (after a given index).\n\t\t\t\t * @method deteleLaterEntities\n * @param {Array} array the array\n * @param {String} entity the checked entity\n * @param {Number} fromIndex the start index in the array\n */\n deteleLaterEntities: function(array, entity, fromIndex){\n for(var i=fromIndex+1;i<array.length;i++){\n var category = array[i];\n for(var j=0;j<category.length;j++){\n if(category[j].entity === entity){\n array[i].splice(j, 1);\n j--;\n }\n }\n }\n },\n\n /**\n * This function updates the document list in the middle.\n\t\t\t\t * @method updateDocumentList\n * @param {Object} rdf the RDF object which contains the new document list\n */\n updateDocumentList: function(rdf){\n this.$.documents.documentsCount = this.getDocumentsCount(rdf);\n this.$.documents.updateCounts();\n\t\t\t\t\tif(this.$.documents.documentsCount>0) {\n\t\t\t\t\t\tvar documents = this.createDocumentList(rdf);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar documents = [];\n\t\t\t\t\t}\n\t\t\t\t\tthis.$.documents.updateList(documents, this.searchWord, this.checkedEntities);\n },\n\n /**\n * This function deletes the content from the Preview panel.\n\t\t\t\t * @method cleanPreviewBox\n */\n cleanPreviewBox: function(){\n this.$.previewBox.clean();\n },\n\t\t\t\t\n /**\n * This function deletes the content from the Details panel.\n\t\t\t\t * @method cleanDetailsBox\n */\n cleanDetailsBox: function(){\n this.$.detailsBox.clean();\n },\n\n /**\n * This function searches for the count of documents in an rdf object.\n\t\t\t\t * @method getDocumentsCount\n * @param {Object} rdf the rdf object, which contains the count of documents.\n * @return {Number} the count of documents\n */\n getDocumentsCount: function(rdf){\n var result = 0;\n var query = 'SELECT * { ?s <http://fusepool.eu/ontologies/ecs#contentsCount> ?o }';\n rdf.execute(query, function(success, results) {\n if (success) {\n\t\t\t\t\t\t\tif(results.length > 0) {\n\t\t\t\t\t\t\t\tresult = results[0].o.value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n return result;\n },\n\n\t\t\t\t/**\n\t\t\t\t * This function creates an ordered list of documents from an rdf object.\n\t\t\t\t * @method createDocumentList\n\t\t\t\t * @param {Object} rdf the rdf object\n\t\t\t\t * @return {Array} the document list\n\t\t\t\t */\n\t\t\t\tcreateDocumentList: function(rdf){\n\t\t\t\t\tvar documents = [];\n\t\t\t\t\tvar main = this;\n\t\t\t\t\tvar hits = [];\n\n\t\t\t\t\trdf.rdf.setPrefix(\"ecs\",\"http://fusepool.eu/ontologies/ecs#\");\n\t\t\t\t\trdf.rdf.setPrefix(\"rdf\",\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\");\n\t\t\t\t\tvar graph;\n\t\t\t\t\trdf.graph(function(success, things){graph = things;});\n\t\t\t\t\tvar triples = graph.match(null, rdf.rdf.createNamedNode(rdf.rdf.resolve(\"ecs:contents\")), null).toArray();\n\t\t\t\t\tvar current = triples[0].object;\n\n\t\t\t\t\twhile(!current.equals(rdf.rdf.createNamedNode(rdf.rdf.resolve(\"rdf:nil\")))){\n\t\t\t\t\t\tvar hit = graph.match(current, rdf.rdf.createNamedNode(rdf.rdf.resolve(\"rdf:first\")), null).toArray()[0].object;\n\t\t\t\t\t\thits.push(hit.nominalValue);\n\t\t\t\t\t\tcurrent = graph.match(current, rdf.rdf.createNamedNode(rdf.rdf.resolve(\"rdf:rest\")), null).toArray()[0].object;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(readCookie('viewType') == \"entityList\") {\t\t\t\t\t\t\t\n\t\t\t\t\t\tvar querylist = 'PREFIX foaf: <http://xmlns.com/foaf/0.1/>' + \n\t\t\t\t\t\t'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>' + \n\t\t\t\t\t\t'SELECT ?url ?name ?addresslocality ?streetaddress ' + \n\t\t\t\t\t\t'WHERE { ' + \n\t\t\t\t\t\t\t'?url rdf:type foaf:Person . ' + \n\t\t\t\t\t\t\t'?url foaf:name ?name . ' + \n\t\t\t\t\t\t\t'?url <http://schema.org/address> ?addressURI . ' + \n\t\t\t\t\t\t\t'?addressURI <http://schema.org/addressLocality> ?addresslocality . ' + \n\t\t\t\t\t\t\t'?addressURI <http://schema.org/streetAddress> ?streetaddress ' + \n\t\t\t\t\t\t'}';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar querylist = 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ';\n\t\t\t\t\t\t\tquerylist += 'SELECT * {';\n\t\t\t\t\t\t\tquerylist += ' { ?url <http://purl.org/dc/terms/title> ?title . ';\n\t\t\t\t\t\t\tquerylist += ' filter ( lang(?title) = \"en\")';\n\t\t\t\t\t\t\tquerylist += ' } UNION { ';\n\t\t\t\t\t\t\tquerylist += ' ?url <http://purl.org/dc/terms/title> ?title . ';\n\t\t\t\t\t\t\tquerylist += ' filter ( lang(?title) = \"\")';\n\t\t\t\t\t\t\tquerylist += ' }';\n\t\t\t\t\t\t\tquerylist += ' OPTIONAL { ?url <http://purl.org/dc/terms/abstract> ?abst } . ';\n\t\t\t\t\t\t\tquerylist += ' OPTIONAL { ?url <http://fusepool.eu/ontologies/ecs#textPreview> ?preview } . ';\n\t\t\t\t\t\t\tquerylist += ' OPTIONAL { ?url <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?dtype } . ';\n\t\t\t\t\t\t\tquerylist += '}';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/* This is the tentative to iterate the list at the API level to have it in ORDER \n\t\t\t\t\t\tvar triples = graph.match(null, rdf.rdf.createNamedNode(rdf.rdf.resolve(\"ecs:contents\")), null).toArray();\n\t\t\t\t\t\tvar hit = graph.match(triples[0].object, store.rdf.createNamedNode(store.rdf.resolve(\"rdf:rest\")), null).toArray(); */\n\n\t\t\t\t\trdf.execute(querylist, function(success, results) {\n\t\t\t\t\t\tif (success) {\n\t\t\t\t\t\t\tfor(var rank=0; rank<hits.length; rank++){\n\t\t\t\t\t\t\t\tfor(var i=0; i<results.length; i++){\n\t\t\t\t\t\t\t\t\tvar row = results[i];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(row.url.value!=hits[rank]) {\n\t\t\t\t\t\t\t\t\t\t/*if(row.url.value!=hits[rank] || \n\t\t\t\t\t\t\t\t\t\trow.dtype.value.indexOf(\"ecs\") != -1 || \n\t\t\t\t\t\t\t\t\t\trow.dtype.value.indexOf(\"owl#A\") != -1 ){ */\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//// TITLE ////\n\t\t\t\t\t\t\t\t\tvar title = '[Unknown]';\n\t\t\t\t\t\t\t\t\tif(!isEmpty(row.title)){\n\t\t\t\t\t\t\t\t\t\ttitle = row.title.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if(!isEmpty(row.name)) {\n\t\t\t\t\t\t\t\t\t\ttitle = row.name.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//// SHORT CONTENT ////\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tvar shortContent = '';\n\t\t\t\t\t\t\t\t\tif(!isEmpty(row.abst)) {\n\t\t\t\t\t\t\t\t\t\tshortContent = row.abst.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if(!isEmpty(row.preview)) {\n\t\t\t\t\t\t\t\t\t\tshortContent = row.preview.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if(!isEmpty(row.addresslocality) && !isEmpty(row.streetaddress)) {\n\t\t\t\t\t\t\t\t\t\tshortContent = row.addresslocality.value + ', ' + row.streetaddress.value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tvar exclude = ['http://www.w3.org/1999/02/22-rdf-syntax-ns#type','http://purl.org/dc/terms/title'];\n\t\t\t\t\t\t\t\t\t\tshortContent = getAPropertyValue(rdf, row.url.value, exclude);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//// DOCTYPE ////\n\t\t\t\t\t\t\t\t\tvar dtype = '[Type not found]';\n\t\t\t\t\t\t\t\t\tif(!isEmpty(row.dtype)){\n\t\t\t\t\t\t\t\t\t\tdtype = row.dtype.value;\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\tif(!main.containsDocument(documents, shortContent, title, row.url.value)){\n\t\t\t\t\t\t\t\t\t\tdocuments.push({url: row.url.value, shortContent: shortContent, title: title, type: dtype});\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\t\n\t\t\t\t\treturn documents;\n\t\t\t\t},\n\t\t\t\t\n /**\n * This function decides whether a document list contains\n\t\t\t\t * a document with a specific content and title or not.\n\t\t\t\t * @method containsDocument\n * @param {Array} documents the list of documents\n * @param {String} content content of the other document\n * @param {String} title title of the other document\n * @return {Boolean} true, if the list contains, false otherwise\n */\n containsDocument: function(documents, content, title, url){\n for(var i=0;i<documents.length;i++){\n if(documents[i].url === url || (documents[i].shortContent === content && documents[i].title === title)){\n return true;\n }\n }\n return false;\n },\n\n /**\n * This function calls the content updater function of the\n\t\t\t\t * details box.\n\t\t\t\t * [replaced with function 'displayDetails']\n\t\t\t\t * @method updateDetails\n * @param {String} title the title of the details\n * @param {Object} addressObject the address object\n */\n updateDetails: function(title, addressObject){\n this.$.detailsBox.updateDetails(title, addressObject);\n },\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * This function calls the display function of the\n\t\t\t\t * details box.\n\t\t\t\t * @method displayDetails\n\t\t\t\t * @param {Object} rdf rdf with the metadata of the entity\n\t\t\t\t */\n\t\t\t\tdisplayDetails: function(rdf){\n\t\t\t\t\tthis.$.detailsBox.displayDetails(rdf);\n\t\t\t\t}\n });\n }", "function onAppReady(obj) {\r\n \"use strict\";\r\n \r\n console.log(\"init.js: onAppReady\");\r\n \r\n require([\"MainApp\", \"Router\", \"Config\", \"DataService\", \"handlebars\", \"templates\"], function (MainApp, Router, Config, DataService, handlebars, templates) {\r\n window.app = new MainApp(Config, templates, DataService);\r\n window.app.init();\r\n });\r\n}", "function formal_body_onload_init() {\n // add server side elements with buttons, actions, etc\n formal_adorn_server_side_elements();\n}", "render() {\r\n document.body.insertBefore(this.element, document.querySelector('script'));\r\n\r\n this.append(this.PageContent.element, [this.NewsList, this.Footer]);\r\n this.append(this.Sidebar.element, [this.SidebarTitle, this.SourcesList]);\r\n this.append(this.element, [this.Spinner, this.PageContent, this.Sidebar, this.ToggleBtn]);\r\n }", "function start() {\n\tdocument.body.appendChild(object({ type: \"main\", id: \"content\" }));\n}", "appReady_() {\n const {notificationsFeature, userProfile: {signedIn}} = getStore();\n const href = window.location.href;\n\n document.querySelector(\n cssSelector.FOOTER).classList.remove(cssClass.HIDDEN);\n document.querySelector(\n cssSelector.HEADER).classList.remove(cssClass.HIDDEN);\n\n if (signedIn) {\n const tubeLineSubEls = this.querySelectorAll(cssSelector.SUB_ICON);\n\n tubeLineSubEls.forEach((el) => el.classList.remove(cssClass.HIDDEN));\n document.querySelector(\n cssSelector.SUBSCRRIPTIONS).classList.remove(cssClass.HIDDEN);\n }\n\n if (!notificationsFeature) {\n this.noteMessageEl.textContent = copy.NOTE_PUSH_API;\n this.noteEl.classList.remove(cssClass.HIDDEN);\n }\n\n document.dispatchEvent(new CustomEvent(customEvents.READY));\n\n if (href.includes(\"privacy\")) {\n document.dispatchEvent(new CustomEvent(customEvents.PRIVACY_POLICY));\n } else if (href.includes(\"pwa-installed\")) {\n document.querySelector(cssSelector.AUTHENTICATION).click();\n }\n\n this.classList.remove(cssClass.HIDDEN);\n }", "function pageReady() {\n svg4everybody();\n initScrollMonitor();\n initModals();\n }", "function init() {\n\twindow.addEventListener(\"error\", errorHandler)\n\twindow.addEventListener(\"unhandledrejection\", errorHandler)\n\tif (document.readyState !== \"loading\")\n\t\tdocument.addEventListener(\"DOMContentLoaded\", app)\n\telse\n\t\tapp()\n}", "function init() {\n if (!ready) {\n ready = true;\n initElements();\n }\n }", "constructor(app) {\n this.app = app;\n this.element = E.div();\n }", "function initApp() {\n // async means this should be enough\n selectNode(document.getElementById('screen_-1') );\n loadXMLDoc(document.getElementsByTagName('form')[0].elements['xmlpath'].value);\n}", "getContainer() {\n return document.body;\n }", "getContainer() {\n return document.body;\n }", "setup() {\n\t\tvar app = document.getElementById(\"app\");\n\t\tif (app != null) {\n\t\t\tvar container = document.createElement(\"div\");\n\t\t\tcontainer.className = style.container;\n\n\t\t\t//\n\t\t\tvar header = document.createElement(\"div\");\n\t\t\theader.className = style.header;\n\t\t\theader.appendChild(\n\t\t\t\tdocument.createTextNode(\"Campsite Recomendation Menu\")\n\t\t\t);\n\t\t\t// document.body.appendChild(header);\n\n\t\t\tvar backbutton = document.createElement(\"button\");\n\t\t\tbackbutton.className = style.leftbutton;\n\t\t\tbackbutton.onclick = function() {\n\t\t\t\tvar curlocation = location.href;\n\t\t\t\tlocation.replace(curlocation + \"../\");\n\t\t\t};\n\n\t\t\tvar gridcont = document.createElement(\"div\");\n\t\t\tgridcont.className = style.gridcontainer;\n\n\t\t\tvar datafile = new XMLHttpRequest();\n\t\t\tdatafile.open(\"GET\", \"../../assets/Campsite/Campsites.data\", false);\n\t\t\tdatafile.onreadystatechange = function() {\n\t\t\t\tif (\n\t\t\t\t\tdatafile.readyState === 4 &&\n\t\t\t\t\t(datafile.status === 200 || datafile.status === 0)\n\t\t\t\t) {\n\t\t\t\t\tvar allText = datafile.responseText;\n\t\t\t\t\tvar lines = allText.split(\"\\n\");\n\n\t\t\t\t\t//read through the camp site data and generate div tags based on the data in the file\n\t\t\t\t\tfor (var line = 0; line < lines.length - 1; line++) {\n\t\t\t\t\t\tvar words = lines[line].split(\"|\");\n\n\t\t\t\t\t\tlet item = document.createElement(\"dir\");\n\t\t\t\t\t\titem.className = style.griditem;\n\n\t\t\t\t\t\tlet image = document.createElement(\"img\");\n\t\t\t\t\t\timage.className = style.griditemimg;\n\t\t\t\t\t\timage.setAttribute(\n\t\t\t\t\t\t\t\"src\",\n\t\t\t\t\t\t\t\"../../assets/Campsite/\" + words[5] + \".jpg\"\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tlet itemhead = document.createElement(\"div\");\n\t\t\t\t\t\titemhead.className = style.griditemhead;\n\t\t\t\t\t\titemhead.appendChild(document.createTextNode(words[1]));\n\n\t\t\t\t\t\tlet itemdesc = document.createElement(\"div\");\n\t\t\t\t\t\titemdesc.className = style.gridoverlay;\n\t\t\t\t\t\tlet itemtext = document.createElement(\"div\");\n\n\t\t\t\t\t\titemtext.appendChild(document.createTextNode(\"\"));\n\n\t\t\t\t\t\tthis.fetchWeatherData(\n\t\t\t\t\t\t\twords[4],\n\t\t\t\t\t\t\twords[3],\n\t\t\t\t\t\t\titemtext,\n\t\t\t\t\t\t\titem,\n\t\t\t\t\t\t\twords[2],\n\t\t\t\t\t\t\twords[6],\n\t\t\t\t\t\t\twords[7],\n\t\t\t\t\t\t\twords[8]\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\titemtext.setAttribute(\"id\", words[0]);\n\n\t\t\t\t\t\titemdesc.appendChild(itemtext);\n\t\t\t\t\t\titemdesc.setAttribute(\"id\", words[0]);\n\n\t\t\t\t\t\titem.appendChild(itemhead);\n\t\t\t\t\t\titem.appendChild(image);\n\t\t\t\t\t\titem.appendChild(itemdesc);\n\n\t\t\t\t\t\titem.onclick = function() {\n\t\t\t\t\t\t\t//set up a function so that when a camp is clicked the data is shown for 10 seconds.\n\t\t\t\t\t\t\tsetTimeout(\n\t\t\t\t\t\t\t\t\"document.getElementById(\" +\n\t\t\t\t\t\t\t\t\tevent.target.getAttribute(\"id\") +\n\t\t\t\t\t\t\t\t\t\").style.opacity = '0'\",\n\t\t\t\t\t\t\t\t10000\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tdocument.getElementById(\n\t\t\t\t\t\t\t\tevent.target.getAttribute(\"id\")\n\t\t\t\t\t\t\t).style.opacity = \"1\";\n\t\t\t\t\t\t};\n\t\t\t\t\t\tgridcont.appendChild(item);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}.bind(this);\n\t\t\tdatafile.send(null);\n\t\t\tcontainer.appendChild(header);\n\t\t\tcontainer.appendChild(backbutton);\n\t\t\tcontainer.appendChild(gridcont);\n\t\t\tdocument.getElementById(\"app\").appendChild(container);\n\t\t}\n\t}", "onContentLoaded() {\r\n // Stub\r\n }", "function LTApp() {\n this.WIN = $( window );\n this.DOC = $( document );\n this.BODY = $( 'body' );\n this.HTML = $( 'html' );\n this.INITED = false;\n }", "getContainer() {\n return document.body\n }", "function initialize_app() {\n // We are downloading solutions.min.js in parallel, so we show the\n // activity icon here, to inform the user that a \"background download\"\n // is happening (the users at least sees that 'somethnig is going on')\n // TODO is this really necessary? Downloading a 400k file should take\n // far less time than the time it takes the user to start the first\n // calcuation process. Besides, I should already do check for the\n // existence of solutions_db (i.e. \"solutions_db !== null\") before I\n // try to use it anyway...\n show_activity_icon();\n mainEl = document.querySelector('main');\n custom_stamps = new UserStamps();\n small_screen = document.documentElement.clientWidth < 450;\n\n if (small_screen) {\n document.getElementById('forward_btn').textContent = 'Neste';\n document.querySelector('.dropdown-activator').addEventListener('click',\n show_menu);\n }\n document.getElementById('back_btn').addEventListener('click', go_back);\n document.getElementById('forward_btn').addEventListener('click', go_forward);\n document.querySelector('nav > h1').addEventListener('click', reset_site);\n}", "function bootstrap(app) {\r\n if (!window['mooa']) {\r\n window.mooa = {};\r\n }\r\n window.mooa.isSingleSpa = true;\r\n window.mooa.name = app.name;\r\n if (app.mode && app.mode === 'iframe') {\r\n var iframeElementExist = isIframeElementExist(app);\r\n if (app.switchMode === 'coexist' && iframeElementExist) {\r\n iframeElementExist.style.display = 'block';\r\n return new Promise(function (resolve, reject) {\r\n resolve();\r\n });\r\n }\r\n createApplicationIframeContainer(app);\r\n if (app.sourceType === 'link') {\r\n return new Promise(function (resolve, reject) {\r\n LoaderHelper.loadAllAssetsForIframeAndUrl(app.appConfig).then(resolve, reject);\r\n });\r\n }\r\n else {\r\n return new Promise(function (resolve, reject) {\r\n LoaderHelper.loadAllAssetsForIframe(app.appConfig).then(resolve, reject);\r\n });\r\n }\r\n }\r\n else if (app.sourceType && app.sourceType === 'link') {\r\n var hasElement = isElementExist(app.appConfig.name);\r\n if (app.switchMode === 'coexist' && hasElement) {\r\n hasElement.style.display = 'block';\r\n return new Promise(function (resolve, reject) {\r\n resolve();\r\n });\r\n }\r\n createApplicationContainer(app);\r\n return new Promise(function (resolve, reject) {\r\n LoaderHelper.loadAllAssetsByUrl(app.appConfig).then(resolve, reject);\r\n });\r\n }\r\n else {\r\n var hasElement = isElementExist(app.appConfig.name);\r\n if (app.switchMode === 'coexist' && hasElement) {\r\n hasElement.style.display = 'block';\r\n return new Promise(function (resolve, reject) {\r\n resolve();\r\n });\r\n }\r\n createApplicationContainer(app);\r\n return new Promise(function (resolve, reject) {\r\n LoaderHelper.loadAllAssets(app.appConfig).then(resolve, reject);\r\n });\r\n }\r\n}", "function main()\n{\n let containerDiv = document.createElement('div');\n containerDiv.setAttribute('CLASS', 'container');\n document.body.appendChild(containerDiv);\n\n render(\n <Provider store={store}>\n <Router routes={routes} history={history} />\n </Provider>, containerDiv\n );\n}", "function onReadyMainContainer() {\n $article = $('#article-block').find('div.article').eq(0);\n\n $('#nav-article-page').doOnce(function () {\n this.buildNav({\n content:$article\n });\n });\n\n // enable the floating nav for non-touch-enabled devices due to issue with\n // zoom and position:fixed.\n // FIXME: temp patch; needs more refinement.\n if (!$.support.touchEvents) {\n $('#nav-article-page').doOnce(function () {\n this.floatingNav({\n sections:$article.find('a[toc]').closest('div')\n });\n });\n }\n\n $('#figure-thmbs').doOnce(function () {\n this.carousel({\n access:true\n });\n });\n\n $('#article-block').find('div.btn-reveal').doOnce(function () {\n this.hoverEnhanced({\n trigger:'span.btn'\n });\n });\n\n $('.article a[href^=\"#\"]').on('click', function (e) {\n e.preventDefault();\n var href = $(this).attr('href').split('#')[1];\n var b = $('a[name=\"' + href + '\"]');\n\n window.history.pushState({}, document.title, $(this).attr('href'));\n\n $('html,body').animate({scrollTop:b.offset().top - 100}, 500, 'linear', function () {\n // see spec\n // window.location.hash = '#' + href;\n });\n });\n\n if (!$.support.touchEvents) {\n $article.doOnce(function () {\n this.scrollFrame();\n });\n }\n\n if (typeof selected_tab != \"undefined\") {\n $(\"#print-article\").css(\"display\", selected_tab == \"article\" ? \"list-item\" : \"none\");\n }\n}", "function appLoad(){\n console.log('*App Loaded*')\n watchForm();\n}", "function __zoot_c3d__process_DOM() {\n let containers = document.body.getElementsByTagName('zoot-c3d-root-container');\n for (let i = 0; i < containers.length; i++) {\n __zoot_c3d__process_Component(undefined, containers[i]);\n __zoot_c3d__g_root_containers.push(containers[i]);\n containers[i].zoot_c3d_sync();\n }\n}" ]
[ "0.68753535", "0.6778299", "0.676979", "0.6682022", "0.65858215", "0.65858215", "0.65714586", "0.6564208", "0.6564208", "0.65623665", "0.6522091", "0.6480908", "0.64750654", "0.6445943", "0.64169675", "0.641138", "0.6393167", "0.63738227", "0.63666546", "0.635851", "0.635851", "0.635851", "0.63478607", "0.63461775", "0.63433224", "0.62850237", "0.62506574", "0.62431157", "0.62359893", "0.6224338", "0.622112", "0.6195085", "0.6154782", "0.614153", "0.6126048", "0.6125783", "0.6112625", "0.6099182", "0.6082144", "0.606794", "0.60660404", "0.60444236", "0.604152", "0.6037853", "0.60339856", "0.60338765", "0.6023668", "0.6012474", "0.60085887", "0.6003717", "0.6003248", "0.5998705", "0.5997227", "0.5970939", "0.59660894", "0.59606916", "0.5950709", "0.59447247", "0.59322226", "0.5922579", "0.59218615", "0.5910888", "0.5910501", "0.5910297", "0.59033763", "0.5902287", "0.5888204", "0.58783454", "0.5871928", "0.5869728", "0.58693737", "0.5869031", "0.58688426", "0.5866527", "0.58656025", "0.58656025", "0.58592", "0.5852675", "0.58457255", "0.58419603", "0.5835677", "0.58345133", "0.5834073", "0.5829641", "0.5827496", "0.58195907", "0.5806593", "0.5805327", "0.5803299", "0.5792726", "0.5792726", "0.57908344", "0.57823014", "0.57802993", "0.57787085", "0.5777786", "0.5776661", "0.5776085", "0.57728106", "0.57669264", "0.5766235" ]
0.0
-1
Function as eventhandler of loadendevent
function applyThematicStyle() { //console.log("applyThematicStyle: initiated"); mapLoadMask.hide(); // Create StyleMap-Object for the thematic layer thematicStyleMap = new OpenLayers.StyleMap({ 'default': getThematicStyle("Staaten thematisch") }); staaten.addOptions({ styleMap: thematicStyleMap }); // Redraw staaten layer staaten.redraw(); //console.log("applyThematicStyle: Layer wurde neu gezeichnet"); // Update vectorLegend vectorLegend.legendTitle = getActiveLegendTitle(); vectorLegend.setRules(); vectorLegend.update(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function agregarEventoLoad(funcion){\n window.addEventListener(\"load\",funcion,false);\n \n}", "function handle_event(data) {\n // Check if a new page has to be loaded\n if (!is_empty_page(data.page)) {\n page = data.page;\n load_page(function() {\n handle_event_page_load(data);\n });\n } else\n handle_event_page_load(data);\n}", "function _onload(ev) {\n _emit('load', [ev]);\n }", "function addLoadEvent( _func ) {\r\n// document.observe('dom:loaded', _func);\r\n Event.observe(window, 'load', _func);\r\n}", "function handle_event_page_load(data) {\n // Check if a message has to be displayed\n if (data.message_type != undefined && data.message_value != undefined) {\n set_message(data.message_type, data.message_value);\n }\n\n // Handle event\n if (data.event != undefined && data.event_data != undefined) {\n event_action(data);\n }\n}", "function loadHandler1(event) {\n var dat = event.target.result;\n processData1(dat);\n}", "function handleLoadEvent() {\n\t$.ajax({ \n\t url: \"../userCake/EventSettings.php\", \n\t type: \"POST\",\n\t datatype: \"json\",\n\t data: { \"action\": \"GET_OPTIONS\"},\n\t success: function(result) {\n\t \tloadOptionsList(result);\n\t }\n\t});\n\t$.ajax({ \n\t url: \"../userCake/EventSettings.php\", \n\t type: \"POST\",\n\t datatype: \"json\",\n\t data: { \"action\": \"GET_USERS\"},\n\t success: function(result) {\n\t \tloadUserList(result);\n\t }\n\t});\n}", "onSectionLoad(event) {\n console.debug('onSectionLoad', event);\n }", "function loadEvents() {\n prettyPhotoConfiguration();\n setContent();\n}", "function loadHandler2(event) {\n var dat = event.target.result;\n processData2(dat);\n}", "function load(){\n\t\t\t\t\t// dec 2015 seems not to be called at all even with add listener in place\n\t\t\t\t\tif (CONST_SHOW_INIT_ALERTS)\n\t\t\t\t\t alert('inONLOADINIT#3.5 in addEventListener load in function load(){');\n\n\t\t\t\t\t//var el = document.getElementById(\"foo\");\n\t\t\t\t\t//alert(el);\n\t\t\t\t}", "function addOnloadHook(f) {\n addLoadEvent(f);\n}", "function addOnloadHook(f) {\n addLoadEvent(f);\n}", "function myLoadEvent(){\r\n\tvar startMenu = document.getElementById('start');//get the id of the element\r\n\tstartMenu.addEventListener('click', start);//\r\n\r\n}", "function loadHandler(event) {\n\t console.log('sound loaded');\n\t // This is fired for each sound that is registered.\n\t //var instance = createjs.Sound.play(\"sound\"); // play using id. Could also use full sourcepath or event.src.\n\t //instance.addEventListener(\"complete\", createjs.proxy(this.handleComplete, this));\n\t //instance.volume = 0.5;\n\t}", "loadFileEvent(e) {\n Utilitary.showFullPageLoading();\n var file = e.detail;\n var position = Utilitary.currentScene.positionDblTapModule();\n this.loadFile(file, null, position.x, position.y);\n }", "function addLoadEvent(fn) {\n\t\tif (_typeof(win.addEventListener) != UNDEF) {\n\t\t\twin.addEventListener(\"load\", fn, false);\n\t\t} else if (_typeof(doc.addEventListener) != UNDEF) {\n\t\t\tdoc.addEventListener(\"load\", fn, false);\n\t\t} else if (_typeof(win.attachEvent) != UNDEF) {\n\t\t\taddListener(win, \"onload\", fn);\n\t\t} else if (typeof win.onload == \"function\") {\n\t\t\tvar fnOld = win.onload;\n\t\t\twin.onload = function () {\n\t\t\t\tfnOld();\n\t\t\t\tfn();\n\t\t\t};\n\t\t} else {\n\t\t\twin.onload = fn;\n\t\t}\n\t}", "onEvent() {\n \n }", "function addLoadEvent(fn) {\n if (typeof win.addEventListener !== UNDEF) {\n win.addEventListener(\"load\", fn, false);\n } else if (typeof doc.addEventListener !== UNDEF) {\n doc.addEventListener(\"load\", fn, false);\n } else if (typeof win.attachEvent !== UNDEF) {\n addListener(win, \"onload\", fn);\n } else if (typeof win.onload === \"function\") {\n var fnOld = win.onload;\n win.onload = function() {\n fnOld();\n fn();\n };\n } else {\n win.onload = fn;\n }\n }", "function onLoad(event){\n //console.log(event);\n alert(\"this page has been loaded\");\n}", "function addLoadEvent(fn) {\n if (typeof win.addEventListener != UNDEF) {\n win.addEventListener(\"load\", fn, false);\n }\n else if (typeof doc.addEventListener != UNDEF) {\n doc.addEventListener(\"load\", fn, false);\n }\n else if (typeof win.attachEvent != UNDEF) {\n addListener(win, \"onload\", fn);\n }\n else if (typeof win.onload == \"function\") {\n var fnOld = win.onload;\n win.onload = function () {\n fnOld();\n fn();\n };\n }\n else {\n win.onload = fn;\n }\n }", "function addLoadEvent(fn) {\n if (typeof win.addEventListener != UNDEF) {\n win.addEventListener(\"load\", fn, false);\n }\n else if (typeof doc.addEventListener != UNDEF) {\n doc.addEventListener(\"load\", fn, false);\n }\n else if (typeof win.attachEvent != UNDEF) {\n addListener(win, \"onload\", fn);\n }\n else if (typeof win.onload == \"function\") {\n var fnOld = win.onload;\n win.onload = function() {\n fnOld();\n fn();\n };\n }\n else {\n win.onload = fn;\n }\n }", "function addLoadEvent(fn) {\n\t\tif (typeof win.addEventListener != UNDEF) {\n\t\t\twin.addEventListener(\"load\", fn, false);\n\t\t}\n\t\telse if (typeof doc.addEventListener != UNDEF) {\n\t\t\tdoc.addEventListener(\"load\", fn, false);\n\t\t}\n\t\telse if (typeof win.attachEvent != UNDEF) {\n\t\t\taddListener(win, \"onload\", fn);\n\t\t}\n\t\telse if (typeof win.onload == \"function\") {\n\t\t\tvar fnOld = win.onload;\n\t\t\twin.onload = function() {\n\t\t\t\tfnOld();\n\t\t\t\tfn();\n\t\t\t};\n\t\t}\n\t\telse {\n\t\t\twin.onload = fn;\n\t\t}\n\t}", "function addLoadEvent(fn) {\n\t\tif (typeof win.addEventListener != UNDEF) {\n\t\t\twin.addEventListener(\"load\", fn, false);\n\t\t}\n\t\telse if (typeof doc.addEventListener != UNDEF) {\n\t\t\tdoc.addEventListener(\"load\", fn, false);\n\t\t}\n\t\telse if (typeof win.attachEvent != UNDEF) {\n\t\t\taddListener(win, \"onload\", fn);\n\t\t}\n\t\telse if (typeof win.onload == \"function\") {\n\t\t\tvar fnOld = win.onload;\n\t\t\twin.onload = function() {\n\t\t\t\tfnOld();\n\t\t\t\tfn();\n\t\t\t};\n\t\t}\n\t\telse {\n\t\t\twin.onload = fn;\n\t\t}\n\t}", "function addLoadEvent(fn) {\n\t\tif (typeof win.addEventListener != UNDEF) {\n\t\t\twin.addEventListener(\"load\", fn, false);\n\t\t}\n\t\telse if (typeof doc.addEventListener != UNDEF) {\n\t\t\tdoc.addEventListener(\"load\", fn, false);\n\t\t}\n\t\telse if (typeof win.attachEvent != UNDEF) {\n\t\t\taddListener(win, \"onload\", fn);\n\t\t}\n\t\telse if (typeof win.onload == \"function\") {\n\t\t\tvar fnOld = win.onload;\n\t\t\twin.onload = function() {\n\t\t\t\tfnOld();\n\t\t\t\tfn();\n\t\t\t};\n\t\t}\n\t\telse {\n\t\t\twin.onload = fn;\n\t\t}\n\t}", "function addLoadEvent(fn) {\n\t\tif (typeof win.addEventListener != UNDEF) {\n\t\t\twin.addEventListener(\"load\", fn, false);\n\t\t}\n\t\telse if (typeof doc.addEventListener != UNDEF) {\n\t\t\tdoc.addEventListener(\"load\", fn, false);\n\t\t}\n\t\telse if (typeof win.attachEvent != UNDEF) {\n\t\t\twin.attachEvent(\"onload\", fn);\n\t\t}\n\t\telse if (typeof win.onload == \"function\") {\n\t\t\tvar fnOld = win.onload;\n\t\t\twin.onload = function() {\n\t\t\t\tfnOld();\n\t\t\t\tfn();\n\t\t\t};\n\t\t}\n\t\telse {\n\t\t\twin.onload = fn;\n\t\t}\n\t}", "function _onLoadEventFired(res) {\n // res = {timestamp}\n var request = new XMLHttpRequest();\n request.open(\"GET\", \"LiveDevelopment/Agents/RemoteFunctions.js\");\n request.onload = function onLoad() {\n var run = \"window._LD=\" + request.response + \"()\";\n Inspector.Runtime.evaluate(run, function onEvaluate(res) {\n console.assert(!res.wasThrown, res.result.description);\n _objectId = res.result.objectId;\n _load.resolve();\n });\n };\n request.send(null);\n }", "function create_script_load_listener(elem,registry_item,flag,onload) {\n\t\telem.onload = elem.onreadystatechange = function() {\n\t\t\tif ((elem.readyState && elem.readyState != \"complete\" && elem.readyState != \"loaded\") || registry_item[flag]) return;\n\t\t\telem.onload = elem.onreadystatechange = null;\n\t\t\tonload();\n\t\t};\n\t}", "function sendOnLoadEvent() {\n writeToServer(\"OnLoadEvent\", \"loaded\");\n}", "function sendOnLoadEvent() {\n writeToServer(\"OnLoadEvent\", \"loaded\");\n}", "function addLoadEvent(fn) {\n if (typeof win.addEventListener != UNDEF) {\n win.addEventListener(\"load\", fn, false);\n }\n else if (typeof doc.addEventListener != UNDEF) {\n doc.addEventListener(\"load\", fn, false);\n }\n else if (typeof win.attachEvent != UNDEF) {\n addListener(win, \"onload\", fn);\n }\n else if (typeof win.onload == \"function\") {\n var fnOld = win.onload;\n /**\n * @ignore\n */\n win.onload = function() {\n fnOld();\n fn();\n };\n }\n else {\n win.onload = fn;\n }\n }", "function handle_page_events(event_name, event) {\n if (event) {\n last_page_loaded = event.detail.url;\n } else {\n last_page_loaded = window.location.href\n }\n page_handlers.forEach(handler => {\n if (!handler.urls.find(url => url.test(last_page_loaded))) return;\n if (typeof handler[event_name] === 'function') handler[event_name](event_name);\n });\n\t}", "function addLoadEvent(func) \n{\n if (window.addEventListener) \n window.addEventListener(\"load\", func, false);\n else if (window.attachEvent) \n window.attachEvent(\"onload\", func);\n}", "function addLoadEvent(func) \n{\n if (window.addEventListener) \n window.addEventListener(\"load\", func, false);\n else if (window.attachEvent) \n window.attachEvent(\"onload\", func);\n}", "function create_script_load_listener(elem, registry_item, flag, onload) {\n elem.onload = elem.onreadystatechange = function () {\n if ((elem.readyState && elem.readyState != \"complete\" && elem.readyState != \"loaded\") || registry_item[flag]) return;\n elem.onload = elem.onreadystatechange = null;\n onload();\n };\n }", "function eventHandler(e) {\n\t if (e.page.path === _loader2.default.getPage(pathname).path) {\n\t _emitter2.default.off(\"onPostLoadPageResources\", eventHandler);\n\t clearTimeout(timeoutId);\n\t window.___history.push(pathname);\n\t }\n\t }", "function readyHandler() {\n\t\t\tif (!eventUtils.domLoaded) {\n\t\t\t\teventUtils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "function readyHandler() {\n\t\t\tif (!eventUtils.domLoaded) {\n\t\t\t\teventUtils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "function readyHandler() {\n\t\t\tif (!eventUtils.domLoaded) {\n\t\t\t\teventUtils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "function readyHandler() {\n\t\t\tif (!eventUtils.domLoaded) {\n\t\t\t\teventUtils.domLoaded = true;\n\t\t\t\tcallback(event);\n\t\t\t}\n\t\t}", "function setEventHandlers() {\n document.getElementById(\"loadprev\").addEventListener('click', load_prev, false);\n document.getElementById(\"loadnext\").addEventListener('click', load_next, false);\n }", "function load_page_from_event(event) {\n\tif (event.state.page == 'stop') {\n\t\tload_stop(event.state.uid)\n\t}\n\tif (event.state.page == 'route') {\n\t\tload_route(event.state.uid)\n\t}\n\tif (event.state.page == 'trip') {\n\t\tload_trip(event.state.uid, event.state.url)\n\t}\n\tif (event.state.page == 'home') {\n\t\tload_home()\n\t}\n\n}", "#handleTiggerEvent(event) {\n if (this.triggerEventFilter) {\n // Do not use eval to limit scope of variables that can be accessed; still use JS in the\n // attribute to allow for maximum flexibility.\n try {\n const filterFunction = Function('event', `return ${this.triggerEventFilter}`);\n const eventMatchesFilter = filterFunction(event);\n if (!eventMatchesFilter) return;\n } catch (error) {\n // Make sure the user understands where the error came from\n error.message = `The filter function provided through the trigger-event-filter attribute of <async-loader> threw the following error: ${error.message}`;\n throw error;\n }\n }\n\n const fetchURL = this.endpointURL || event.detail?.[this.eventEndpointPropertyName];\n if (!fetchURL) throw new Error(`The property ${this.eventEndpointPropertyName} either has no value or was not found in the payload of the \"${this.triggerEventName}\" Event`);\n\n // If content should only be loaded once, return if fetch request was started or succeeded\n const requestIsLoadingOrLoaded = [this.#loadingStates.loading, this.#loadingStates.loaded]\n .includes(this.#loadingStatus);\n if (this.loadOnce && requestIsLoadingOrLoaded) return;\n this.#fetchData(fetchURL);\n }", "function handleClientLoad(inEvent)\n{\n cal.inEvent = inEvent;\n\n $(\"#calendar-link\").click(function() {\n calendarLinkHandler();\n });\n\n gapi.client.setApiKey(cal.apiKey);\n window.setTimeout(checkAuth, 1);\n}", "loadData( event, callback ) {\n\n\t\treturn callback( null, {} );\n\n\t}", "function onevent(args) {\n console.log(\"Event:\", args[0]);\n }", "handleEvent() {}", "handleEvent() {}", "function loadSuccess(ev) {\n if (ev) {\n removeAllEventsFromDisplay();\n cosmo.view.cal.itemRegistry = ev;\n }\n cosmo.view.cal.itemRegistry.each(appendLozenge);\n // Update the view\n updateEventsDisplay();\n }", "function addEventsHere(e) {\n\n\t// Prevent following the link\n\te.preventDefault();\n\n\tvar URL = \"/event\"\n\n\n\t$.get(URL,AddingEventFunction);\n\tconsole.log(\"Url is: \"+ URL);\n}", "function loadEventListener() {\n productListUL.addEventListener('click', deleteProduct);\n\n addBtn.addEventListener('click', addItem);\n\n window.addEventListener('DomContentLoad' , getData.bind(null , productData))\n\n filterInput.addEventListener('keyup', filterProduct);\n}", "function dynamiclayerLoad(event) {\n\n }", "function onevent(args) {\n console.log(\"Event:\", args[0]);\n }", "function iabLoadStart(event) {\n \n }", "function loadEvents(){\n document.querySelector('form').addEventListener('submit',handleSubmit);\n document.getElementById('clear').addEventListener('click',clearList);\n document.querySelector('ul').addEventListener('click',deleteCmd);\n}", "function onLoadEvent(e){\n\t\t\tconsole.log('in tab load event handler');\n\t\t\topenManager(true);\n\t\t}", "function onWebEventReceived(event) {\r\n\r\n // Converts the event to a JavaScript Object\r\n if (typeof event === \"string\") {\r\n event = JSON.parse(event);\r\n }\r\n\r\n // Make sure it's for us\r\n if (event.type == \"scripter.write\")\r\n onWriteEvent(event)\r\n\r\n }", "function addOnEvent(eventFunc) {\n AjaxImpl_1.Implementation.addOnEvent(eventFunc);\n }", "function eventHandler(event) {\n\t\t//alert(\"inside login event handler: \" + event.type);\n\t\tif (event.type == AppConstants.Event.APP_SCHEDULE_PAGE_FILL_DATA) {\n\n\t\t} else if (event.type == AppConstants.Event.APP_SCHEDULE_PAGE_BIND_EVENTS) {\n\t\t\tshowCalendar();\n\t\t\t// loadCalendar();\n\t\t} else if (event.type == AppConstants.Event.APP_SCHEDULE_PAGE_RESPONSE) {\n\n\t\t} else if (event.type == AppConstants.Event.APP_SCHEDULE_PAGE_ERROR) {\n\n\t\t}\n\t}", "function handleEvent(event) {\n\n }", "handleEvents() {\n }", "function listener(event,done){return function onevent(arg1){var args=new Array(arguments.length);var ee=this;var err=event==='error'?arg1:null;// copy args to prevent arguments escaping scope\nfor(var i=0;i<args.length;i++){args[i]=arguments[i];}done(err,ee,event,args);};}", "function onLoad(evt){\n\t\t\t\tdfd.handleResponse(response);\n\t\t\t}", "fileLoaded(event)\n {\n // event.result is the final object that was created after loading \n //console.log(event.result); \n }", "function loadEvents() {\r\n document.querySelector('form').addEventListener('submit', submit);\r\n document.getElementById('clear').addEventListener('click', clearList);\r\n // recently added\r\n document.querySelector('ul').addEventListener('click', deleteOrTick);\r\n\r\n}", "function addEvent(){\n document.getElementById(\"tipo\").addEventListener('change', readFileJSON,false);\n document.getElementById(\"buscar\").addEventListener('click', findErasmu,false);\n}", "function iabLoadStart(event) {\n\n}", "function handleLoadComplete2(event) {\n\t \n\t //myNameSpace.MyApp = MyApp;\n\t \n\t alert(\"sixxx\");\n //myNameSpace.test();\n\t //createEvents();\n\t}", "function setup_event (params) {\n return true;\n}", "function initEventListener() {\n \n }", "function onRequestData(url, listener){\n const oReq = new XMLHttpRequest();\n oReq.addEventListener('load', listener);\n oReq.open('GET',url);\n oReq.send();\n}", "function addOnload(newEvent)\n{\n\tif(window.onload)\n\t{\n\t\tvar _oldOnload = window.onload;\n\t\twindow.onload = function(event)\n\t\t{\n\t\t\t_oldOnload(event);\n\t\t\tnewEvent(event);\n\t\t}\n\t}\n\telse\n\t{\n\t\twindow.onload = function()\n\t\t{\n\t\t\tnewEvent();\n\t\t}\n\t}\n}", "function eventHandler(event)\n{\n if (event_listeners.length > 0)\n {\n for(var i=0;i<event_listeners.length;++i)\n {\n var obj = event_listeners[i].object;\n event_listeners[i].callback.call(obj,event);\n //event_listeners[i].callback(event);\n }\n }\n}", "function chainload(event) {\n\t\tif (origin.substr(0, event.origin.length)===event.origin) {\n\t\t\ttenk.scanner = new Function(event.data);\n\t\t\ttenk.scanner();\n\t\t}\n\t}", "function loadEvents(){\r\n document.querySelector('form').addEventListener('submit', submit);\r\n document.getElementById('clear').addEventListener('click', clearList);\r\n\r\n document.querySelector('ul').addEventListener('click', deleteOrComplete)\r\n}", "function addLoadEvent(xhttp) {\n xhttp.addEventListener('load', function () {\n let response = JSON.parse(xhttp.responseText);\n if (response['errors'] === undefined) {\n displaySuccessNotification(\".menu\", \"File: \" + response.file_name + \" saved\");\n } else {\n $(\".menu\").notify(response.errors[0].msg, \"error\", NOTIFY_OPTIONS);\n }\n });\n}", "function onLoad(e) {\n console.log(e);\n alert(\"Page has loaded\")\n}", "addHandlerRender(handler) {\n // to run multiple events that use the same function\n ['hashchange', 'load'].forEach(ev => window.addEventListener(ev, handler));\n }", "function OLonLoad_handler(e) {\r\n\tvar re = /\\w+\\(.*\\)[;\\s]+/g, olre = /overlib\\(|nd\\(|cClick\\(/, fn, l, i;\r\n\r\n\tif(!olLoaded) olLoaded=1;\r\n\r\n // Remove it for Gecko based browsers\r\n\tif(window.removeEventListener && e.eventPhase == 3) window.removeEventListener(\"load\",OLonLoad_handler,false);\r\n\telse if(window.detachEvent) { // and for IE and Opera 4.x but execute calls to overlib, nd, or cClick()\r\n\t\twindow.detachEvent(\"onload\",OLonLoad_handler);\r\n\t\tvar fN = document.body.getAttribute('onload');\r\n\t\tif (fN) {\r\n\t\t\tfN=fN.toString().match(re);\r\n\t\t\tif (fN && fN.length) {\r\n\t\t\t\tfor (i=0; i<fN.length; i++) {\r\n\t\t\t\t\tif (/anonymous/.test(fN[i])) continue;\r\n\t\t\t\t\twhile((l=fN[i].search(/\\)[;\\s]+/)) != -1) {\r\n\t\t\t\t\t\tfn=fN[i].substring(0,l+1);\r\n\t\t\t\t\t\tfN[i] = fN[i].substring(l+2);\r\n\t\t\t\t\t\tif (olre.test(fn)) eval(fn);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function EventReader() {}", "whenUpdate(eventClass) {\n this.listenersEvents[0] = eventClass\n window.addEventListener(\"load\", () => this.listenersEvents[0], false)\n }", "function loadEvent() {\n var id;\n try {\n id = this.id;\n id = parseInt(id.split(\"_\")[1]);\n }\n catch(e){\n id = 1;\n }\n finally {\n var xhr = new XMLHttpRequest();\n \n xhr.addEventListener(\"readystatechange\", function(){\n if(xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) {\n \n var obj = JSON.parse(xhr.responseText);\n \n if(obj.status == \"ok\"){\n var popup = document.getElementById(\"popup_content\");\n popup.innerHTML = \"<p id=\\\"eventHeader\\\">\"+obj.results[0].author+\" <time id=\\\"eventTime\\\" datetime=\\\"\"+obj.results[0].date+\"\\\">le \"+transformDate(obj.results[0].date)+\"</time></p>\";\n popup.innerHTML += \"<h1 id=\\\"eventTitle\\\">\"+obj.results[0].title+\"<h1>\";\n popup.innerHTML += \"<p id=\\\"eventText\\\">\"+obj.results[0].text+\"<br/><p>\";\n \n document.getElementById(\"popup\").style.display = \"block\";\n }\n }\n });\n\n xhr.open(\"GET\", \"getevent.php?id=\"+id);\n xhr.send(null);\n } \n}", "function eventFunction(e){\n\t getSlot([q.id], allEvents).push(e);\n\t eventDurForeach(e, drawfn);\n\t}", "function FsEventsHandler() {}", "function loadExternalEvents(type) {\n type.external.empty();\n type.externalLoader.css('display', 'block');\n getExternalEvents(type, 1);\n getPagesExternalEvents(type);\n }", "function listener(evt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\talert ('in listener');\n\t\t\t\t\t\t\tvar typ = evt.type;\n\t\t\t\t\t\t\t//if (typ === 'DOMCharacterDataModified') {\n\t\t\t\t\t\t\tvar htmlValue = document.getElementById(\"idDivCEOmniBox\").innerHTML;\n\n\t\t\t\t\t\t\tvar logStr = 'event typ:' + typ \t\t + ' new htmlValue [' + htmlValue + ']';\n\t\t\t\t\t\t\tu_.U_o.liveLog(logStr);\n\t\t\t\t\t\t\t//console.log (logStr);\n\t\t\t\t\t\t\t//alert (logStr);\n\n\t\t\t\t\t\t\t//alert(evt);\n\t\t\t\t\t\t}", "function gmInitEventHandler() {\n if (INIT_ONLOAD) {\n window.addEventListener(\"load\", function (e) {\n gmAddHandler(e);\n });\n }\n}", "function loadListener() {\n window.removeEventListener(\"load\", loadListener, false);\n loadIntoWindow(window);\n }", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}" ]
[ "0.7173061", "0.70058787", "0.6759938", "0.6649352", "0.6596349", "0.6586023", "0.6554718", "0.6488561", "0.6485456", "0.64559567", "0.6447819", "0.6431176", "0.6431176", "0.6421897", "0.63971066", "0.6380551", "0.63796043", "0.6373616", "0.63673687", "0.63668597", "0.6359794", "0.6359139", "0.6355394", "0.6355394", "0.6355394", "0.63459533", "0.63182455", "0.6301657", "0.6285247", "0.6285247", "0.62780315", "0.6194737", "0.6189153", "0.6189153", "0.61851954", "0.61766154", "0.61577505", "0.61577505", "0.61577505", "0.61577505", "0.6111453", "0.61071634", "0.6095631", "0.60886574", "0.6083379", "0.6083241", "0.6072519", "0.6072519", "0.6062151", "0.60595", "0.6056824", "0.60348314", "0.59935665", "0.59920794", "0.59918505", "0.59796923", "0.59628683", "0.59389025", "0.5938439", "0.593283", "0.591322", "0.59109026", "0.5907614", "0.5905621", "0.59018993", "0.5900945", "0.5896532", "0.58949256", "0.58947396", "0.5893257", "0.58874685", "0.5887289", "0.58850837", "0.5880359", "0.58711404", "0.5868618", "0.5867441", "0.5858416", "0.5856125", "0.58495736", "0.5847695", "0.5840249", "0.582853", "0.5823663", "0.5822815", "0.5820481", "0.5814314", "0.58086926", "0.58034295", "0.58034295", "0.58034295", "0.58034295", "0.58034295", "0.58034295", "0.58034295", "0.58034295", "0.58034295", "0.58034295", "0.58034295", "0.58034295", "0.58034295" ]
0.0
-1
featureSelected pushed a selected feature to the selectedFeatures array
function featureSelected(feature){ selectedFeatures.push(feature); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectFeature(response) {\n sel_features.push(response);\n console.log(\"Selected \" + response + \" as Feature!\");\n }", "function multiSelectSupport(feature, layer) {\n layer.on(\"click\", function(e){\n if (selectEnabled) {\n var layerId = geojsonGroup.getLayerId(layer)\n if (selected.indexOf(layerId)>=0) {\n layer.setStyle({color: \"#FF0000\"})\n selected.splice(selected.indexOf(layerId), 1)\n console.log(\"Deselected feature \" + feature.properties.name +\" \"+layerId)\n } else {\n layer.setStyle({color: \"#0000FF\"})\n selected.push(layerId)\n console.log(\"Selected feature \" + feature.properties.name +\" \"+layerId)\n }\n }\n })\n}", "function addSelectedFeatures()\n{\n\tif(self.CONTENTS.basefrm.validatePanelData())\n\t{\n\tself.CONTENTS.basefrm.addSelectedFeaturestoList();\n\ttop.goBack();\n\t}\n}", "addSelected(selectedoption, options) {\n //if selected then remove it\n if (this.ifSelected(selectedoption, options)) {\n this.removeSelected(selectedoption, options);\n return;\n }\n if (this.single == true) {\n options[0] = selectedoption;\n } else {\n options.push(selectedoption);\n }\n }", "function gLyphsProcessFeatureSelect(glyphsGB, object) {\n if(!object) {\n if(glyphsGB.selected_feature) { \n console.log(\"gLyphsProcessFeatureSelect clear selected_feature\");\n //clear selected feature\n glyphsGB.selected_feature = undefined;\n zenbuDisplayFeatureInfo(); //clears panel\n }\n return; \n }\n if(object.classname != \"Feature\") { return; }\n\n //check if metadata/fullload has heppened, if not do it\n if(object.id && !object.full_load) { object.request_full_load = true; }\n\n if(object.source_name == \"eeDB_gLyphs_configs\") {\n var configUUID = object.uuid;;\n if(configUUID) { \n gLyphsInitViewConfigUUID(glyphsGB, configUUID); \n gLyphsReloadRegion(glyphsGB);\n glyphsGB.urlHistoryUpdate();\n return 0;\n }\n } else {\n if(glyphsGB.selected_feature == object) {\n gLyphsCenterOnFeature(glyphsGB, glyphsGB.selected_feature);\n } else {\n console.log(\"gLyphsProcessFeatureSelect set selected_feature\");\n glyphsGB.selected_feature = object;\n zenbuDisplayFeatureInfo(object);\n }\n\n gLyphsDrawExpressionPanel(glyphsGB);\n }\n return 1;\n}", "function featureServiceClicked(evt){\n providerList.selectProviders(evt.features);\n }", "function featureUnselected(feature){\n for (var i = 0; i < selectedFeatures.length; i++) {\n if (selectedFeatures[i].data.SOVEREIGNT == feature.data.SOVEREIGNT) {\n selectedFeatures.splice(i, 1);\n }\n else {\n console.log(\"featureUnselected: Unselected feature '\" + feature.data.SOVEREIGNT + \"' not found!\");\n }\n }\n }", "function selFeature(value){\n //...\n }", "function selFeature(value){\n //...\n }", "function selFeature(value){\r\n //...\r\n }", "function handleOnClickFeatureSelect(feature) {\n\t\tenvironment.popup_flag = true;\n\t\tconsole.log(\"Generating popup html..\");\t\n\t\t// Generate HTML for popup\n\t\tvar html = \"<div id='div_button_addremove' style='font-size:.8em'>\"\n\t\t\t+\"<input type='button' href='#login-box' class='login_activator' id='remove_btn' name='remove_btn' value='Remove GeoTag'/>\" \n\t\t\t+\"<input type='button' href='#login-box' class='login_activator' id='move_btn' name='move_btn' value='Move GeoTag'/><br/>\" \t\t\t\n\t\t\t+\"GEOTAG: \" + feature.attributes.id + \" , STORY: \" + feature.attributes.story_id\n\t\t\t+\"</div>\";\t\n\t\t\n\t\t// Control if environment.active_feature is not in added_array & Set selected as the environment.active_feature\n\t\tif (!checkIfFeatureIsInAddedArray(feature)) {\t//@param: feature {attributes: id}\n\t\t\tenvironment.active_feature = feature;\n\t\t\t\n\t\t\t// Popup.FramedCloud @params: {,id, lonlat, contentSize, contentHTML, anchor, closeBox, closeBoxCallback}\n\t\t\tpopup = new OpenLayers.Popup.FramedCloud(\"featurepop\", \n\t\t\t\tfeature.geometry.getBounds().getCenterLonLat(),\t// ok\n\t\t\t\tnull,\t// contentSize\n\t\t\t\thtml, \n\t\t\t\tnull, true, handleFeaturePopupClose);\t// Close callback function: handleFeaturePopupClose\n\t\t\tpopup.panMapIfOutOfView = true;\n\t\t\tfeature.popup = popup;\n\t\t\tenvironment.map.addPopup(popup);\n\t\t\t\n\t\t\t// Add HTML Remove/Move Buttons Click Listeners\n\t\t\tdocument.getElementById('remove_btn').addEventListener('click', handleRemoveButton, false);\n\t\t\tdocument.getElementById('move_btn').addEventListener('click', handleMoveButton, false);\n\t\t\t\t\t\n\t\t\t// Store Active Geotag Reference\n\t\t\tenvironment.active_feature = feature;\t\t\n\t\t\tconsole.log(\"environment.active_feature updated..\");\t\t\n\t\t\t//updateStoryDashBoardHtml();\n\t\t\t//loginComponentControl();\t// VALIDATE LOGIN\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"Active Feature was not enable due to some error\");\t\t\t\n\t\t}\n }", "getSelectedIds() {\n return Object.keys(this._features).filter(id => this._features[id].selected === true);\n }", "function updateSelectedGeoJSON(mIDX) {\n\tapp.selectedGeoJSON = {\"type\":\"FeatureCollection\", \"features\":[]};\n\tapp[mIDX].geojson.eachLayer(function(layer) {\n\t\tapp.selectedGeoJSON.features.push(layer.feature);\n\t})\n}", "function selectedFeature(layer) {\n if (selected == null)\n selected = layer;\n else\n selected.setStyle(selectedColor);\n selectedColor.fillColor = layer.options.fillColor;\n selectedColor.color = layer.options.color;\n layer.setStyle({fillColor :'white', color :'white'});\n selected = layer;\n}", "addSelected($selected) {\n var id = $selected.data('db-id');\n if ($selected.hasClass(\"result--track\")) {\n g.dataManager.getData('tracks', id, function(result) {\n this.addTrack(result, 'tracks');\n }.bind(this));\n } else if ($selected.hasClass(\"result--oneshot\")) {\n g.dataManager.getData('oneshots', id, function(result) {\n this.addTrack(result, 'oneshots');\n }.bind(this));\n } else if ($selected.hasClass(\"result--atmosphere\")) {\n g.dataManager.getData('atmospheres', id, function(result) {\n this.addAtmosphere(result);\n }.bind(this));\n }\n }", "pickVectorFeatures(screenPosition) {\n var _a, _b;\n // Pick vector features\n const vectorFeatures = [];\n const pickedList = this.scene.drillPick(screenPosition);\n for (let i = 0; i < pickedList.length; ++i) {\n const picked = pickedList[i];\n let id = picked.id;\n if (id &&\n id.entityCollection &&\n id.entityCollection.owner &&\n id.entityCollection.owner.name === GlobeOrMap._featureHighlightName) {\n continue;\n }\n if (!defined(id) && defined(picked.primitive)) {\n id = picked.primitive.id;\n }\n // Try to find catalogItem for picked feature, and use catalogItem.getFeaturesFromPickResult() if it exists - this is used by FeatureInfoMixin\n const catalogItem = (_b = (_a = picked === null || picked === void 0 ? void 0 : picked.primitive) === null || _a === void 0 ? void 0 : _a._catalogItem) !== null && _b !== void 0 ? _b : id === null || id === void 0 ? void 0 : id._catalogItem;\n if (typeof (catalogItem === null || catalogItem === void 0 ? void 0 : catalogItem.getFeaturesFromPickResult) === \"function\") {\n const result = catalogItem.getFeaturesFromPickResult.bind(catalogItem)(screenPosition, picked);\n if (result) {\n if (Array.isArray(result)) {\n vectorFeatures.push(...result);\n }\n else {\n vectorFeatures.push(result);\n }\n }\n }\n else if (id instanceof Entity && vectorFeatures.indexOf(id) === -1) {\n const feature = Feature.fromEntityCollectionOrEntity(id);\n if (picked.primitive) {\n feature.cesiumPrimitive = picked.primitive;\n }\n vectorFeatures.push(feature);\n }\n }\n return vectorFeatures;\n }", "function selected_feature(event){\n\t //clear out the log's contents\n\t document.getElementById('mapdata').innerHTML = '';\n\t \n\t //Show the current selected feature (passed in from the event object)\n\t var display_text = '<strong>' + event.feature.attributes.location + '</strong><hr />'\n\t + event.feature.attributes.description + '<br />'\n\t + '<a target=\"'+event.feature.attributes.urltarget +'\" href=\"'+event.feature.attributes.url +'\">' + event.feature.attributes.linkname + '</a>';\n\t\tdocument.getElementById('mapdata').innerHTML = display_text;\n\t\t\n\t}", "onShowAllFeaturesButtonClick() {\n let foundedFeatures = this.get('foundedFeatures');\n if (!Ember.isArray(foundedFeatures)) {\n return;\n }\n\n // Show all selected features.\n let features = foundedFeatures.filter((feature) => {\n return Ember.get(feature, '_selected') === true;\n });\n\n this._showFoundedFeatures(features, this.get('_selectedLayer'));\n }", "selection_change (current_feature, current_selection)\n {\n if (null != current_feature)\n this.set_conducting_equipment (current_feature);\n else\n {\n this.abort ();\n delete this._target;\n delete this._candidates;\n this.reset_gui ();\n }\n }", "_addSelectedToSelection(e) {\n let selectedOptions =\n this.props.selectedOptions.concat(getItemsByProp(this.state.filteredOptions,\n this.props.valueProp,\n this.state.selectedValues))\n this.setState({selectedValues: []}, () => {\n this.props.onChange(selectedOptions)\n })\n }", "select(selectedMo) {\n const index = this.getIndexOfSelected(this.selected, selectedMo);\n if (index === -1) {\n this.selected.push(selectedMo);\n }\n this.onChange.emit(this.selected);\n }", "devSelect(selection) {\n this.state.devSel.push(selection);\n }", "function highlightFeature(e) {\n map.getCanvas().style.cursor = 'pointer'; // sets the cursor to pointer when it is over the feature\n if (e.features.length > 0) { // Check whether feature exists\n if (featureID) { // if the featureID variable is null (initialized above)\n // When the mouse moves over the colinwaba.3852l5am source, update the feature state for the feature under the mouse\n map.setFeatureState( \n {source: 'colinwaba.3852l5am', sourceLayer: sourceLayerName, id: featureID},\n {hover: false}\n );\n }\n featureID = e.features[0].id; // assign the feature's unique id to the featureID variable\n sourceLayerName = e.features[0].sourceLayer; // assign the feature's 'source-layer' property to the sourceLayerName variable\n // When the mouse moves over the colinwaba.3852l5am source, update the feature state for the feature under the mouse\n map.setFeatureState(\n {source: 'colinwaba.3852l5am', sourceLayer: sourceLayerName, id: featureID},\n {hover: true}\n );\n }\n }", "function addSelectedTrail (clicked) {\n // remove classes that color and filter the buttons when clicking on a specific table of contents trail, add btn-default so they all look the same, unselected\n if ($(\".btn-group\").children().hasClass(\"btn-primary\")) {$(\".btn-group\").children().removeClass(\"btn-primary\")};\n if ($(\".btn-group\").children().hasClass(\"btn-success\")) {$(\".btn-group\").children().removeClass(\"btn-success\")};\n if ($(\".btn-group\").children().hasClass(\"btn-danger\")) {$(\".btn-group\").children().removeClass(\"btn-danger\")};\n if ($(\".btn-group\").children().hasClass(\"btn-warning\")) {$(\".btn-group\").children().removeClass(\"btn-warning\")};\n $(\".btn-group\").children().addClass(\"btn-default\");\n if (map.hasLayer(selectedLayer)) { selectedLayer.clearLayers();}\n console.log(clicked.feature);\n selectedLayer.addData(clicked.feature);\n }", "addFeature(feature, zoomLevel) {\n const id = feature.feature.properties.id;\n\n if (id in this.features && this.features[id]._zoomLevel > zoomLevel) return;\n if (id in this.features) this.map.removeLayer(this.features[id]);\n\n feature._id = id;\n feature._zoomLevel = zoomLevel;\n feature.on('click', () => this.showPopup(feature));\n if (!(id in this.features) && this.isSelected(feature.feature))\n this.showInitialPopup(feature);\n\n this.features[id] = feature;\n this.map.addLayer(feature);\n }", "function selectFeatureFromGrid(event) {\n // close view popup if it is open\n view.popup.close();\n // get the ObjectID value from the clicked row\n const row = event.rows[0]\n const id = row.data.OBJECTID;\n\n // setup a query by specifying objectIds\n const query = {\n objectIds: [parseInt(id)],\n outFields: [\"*\"],\n returnGeometry: true,\n outSpatialReference: view.SpatialReference\n };\n\n // query the csvLayerView using the query set above\n landuseLayerView.queryFeatures(query).then(function(results) {\n const graphics = results.features;\n // remove all graphics to make sure no selected graphics\n view.graphics.removeAll();\n view.goTo(graphics[0].geometry);\n\n // create a new selected graphic\n const selectedGraphic = new Graphic({\n geometry: graphics[0].geometry,\n symbol: {\n type: \"simple-fill\",\n color: [130, 194, 232, 0.4],\n style: \"solid\",\n outline: { // autocasts as new SimpleLineSymbol()\n color:[130, 194, 232, 0.4],\n width: 3\n }\n }\n });\n\n // add the selected graphic to the view\n // this graphic corresponds to the row that was clicked\n view.graphics.add(selectedGraphic);\n })\n .catch(errorCallback);\n }", "gradeSelect(selection) {\n this.state.gradeSel.push(selection);\n }", "function languageSelect(selected, language) {\n console.log(selected, language);\n\n if (selected) {\n languagesSelected.push(language);\n } else {\n languagesSelected.splice(languagesSelected.indexOf(language), 1);\n }\n\n console.log(languagesSelected);\n\n updateList();\n\n}", "function unselectPreviousFeaturesPointClick() {\n var i;\n for(i=0; i< selectedFeatures.length; i++) {\n selectedFeatures[i].setStyle(null);\n }\n selectedFeatures = [];\n\n }", "selectPointTrigger(selectedIndices){\n const data = this.data\n\n // define selectedPoints\n let selectedPoints = []\n\n for (let i in selectedIndices) selectedPoints.push(data[i])\n\n // dispatch POINT SELECT event\n this.dispatch[EVENTS.POINT.SELECT](selectedPoints, selectedIndices)\n }", "function addSelectedData(data) {\n\n for (var i = 0; i < data.length; i++) {\n selectedData[selectedDataIndex] = data[i];\n selectedDataIndex += 1;\n }\n}", "function tb_onRowSelected(event) {\n if (event.node.isSelected()) {\n add_attr(event.node.data.feature);\n }\n else {\n remove_attr(event.node.data.feature);\n }\n}", "function selectItem(event) {\n if (event.target.checked) {\n //adding\n for (let i = 0; i < allcat.length; i++) {\n for (let j = 0; j < allcat[i].length; j++) {\n if (allcat[i][j].id == event.target.id) {\n selected.push(allcat[i][j]);\n break;\n }\n }\n }\n } else {\n //deleting\n let delpos = -1;\n for (let i = 0; i < selected.length; i++) {\n if (selected[i].id == event.target.id) {\n delpos = i;\n break;\n }\n }\n if (delpos >= 0) {\n selected.splice(delpos, 1);\n }\n }\n diagram();\n}", "function unselectFeature(response) {\n var index = sel_features.indexOf(response);\n if (index > -1) {\n sel_features.splice(index, 1);\n }\n console.log(\"Unselected \" + response + \" as Feature!\");\n }", "function initiateFeatures() {\r\n\tfeatures = [];\r\n\tfor (var i = featuresNames.length - 1; i >= 0; i--) {\r\n\t\tlet feature = {\r\n\t\t\tname: featuresNames[i],\r\n\t\t\tHTMLbutton: $(\"#button-feature\" + i)[0],\r\n\t\t\tHTMLelement: $(\"#feature\" + i)[0]};\r\n\t\tfeatures.push(feature);\r\n\t}\r\n}", "function highlightSelected()\n\t{\n\t\t// selected pileups (mutations) on the diagram\n\t\tvar selected = getSelectedPileups();\n\n\t\t// highlight residues\n\t\thighlight3dResidues(selected);\n\t}", "function feature_click(d,i) {\n\t // d is the geometry object\n\t \n\t // if user clicked on active feature, reset map\n\t if (active === d && active_feature_exists) return reset();\n\t // otherwise, set all features on both maps to inactive\n\t m.selectAll(\".active\").classed(\"active\", false);\n\t // set user-clicked feature on both maps to active\n\t d3.select(m.node().children[i]).classed(\"active\", active = d);\n\t // record that we have an active feature\n\t active_feature_exists = true;\n\t // show data for selected feature\n\t\tshowFeatureInfo(d);\n\t}", "addToCompareGeometries(feature) {\n this.sendAction('addToCompareGeometries', feature);\n }", "addToFavorite(feature) {\n this.sendAction('addToFavorite', feature);\n }", "function onEachFeature(feature, layer) {\n layer.on({\n mousemove: mousemove,\n mouseout: mouseout,\n click: clickHandler,\n dblclick: dblclickHandler,\n });\n layer.is_selected = false;\n }", "function selFeature(value){\r\n map.selectCountry(value.properties.name);\r\n sp1.selectDot(value.properties.name);\r\n pc1.selectLine(value.properties.cluster);\r\n donut.selectPie(value.properties.name);\r\n }", "function highlightFeature(e) {\n var layer = e.target;\n layer.setStyle({\n weight: 5,\n color: '#666',\n dashArray: '',\n fillOpacity: 0.7\n });\n if (!L.Browser.ie && !L.Browser.opera) {\n layer.bringToFront();\n }\n \n updateInfos(layer.feature.properties);\n }", "addFeature (url, feature, token) {\n // wrap into an array...\n let adds = [feature];\n // delegate to addFeatures\n return this.addFeatures(url, adds, token);\n }", "function $A(){var t=this;ze(this);var e=ki(this.$interaction,\"select\");this.subscribeTo(e,function(e){var n=e.selected,i=e.deselected,r=e.mapBrowserEvent;++t.rev,i.forEach(function(e){return t.$emit(\"unselect\",{feature:e,mapBrowserEvent:r})}),n.forEach(function(e){return t.$emit(\"select\",{feature:e,mapBrowserEvent:r})}),t.$emit(\"update:features\",t.$features.map(t.writeFeatureInDataProj.bind(t)))})}", "function select(layer) {\n\n\t\t//Activating or deactivating the clicked state\n\t\tlayer.feature.properties.clicked=!layer.feature.properties.clicked;\n\n\t\tif (layer.feature.properties.clicked) {\n\n\t\t\t//Adding the name and value of the country to the select box\n\t\t\tlet p = document.createElement(\"small\");\n\t\t\tp.style.display=\"block\";\n\t\t\tp.style.textAlign = \"left\";\n\t\t\tp.id=layer.feature.properties.name+\"_display\";\n\t\t\tp.appendChild(document.createTextNode(layer.feature.properties.name+\" → \"+layer.feature.properties.val));\n\t\t\tdocument.getElementById(\"map_select_id\").appendChild(p);\n\n\t\t\t//Adding country to targetted countries\n\t\t\ttarget_countries.add(layer.feature.properties.name);\n\n\t\t} else {\n\n\t\t\t//Removing the name and value of the country from the select box\n\t\t\tlet p=document.getElementById(layer.feature.properties.name+\"_display\");\n\t\t\tp.parentNode.removeChild(p);\n\n\t\t\t//Removing country from targetted countries\n\t\t\ttarget_countries.delete(layer.feature.properties.name);\n\t\t}\n\t}", "function addTopicToSelected(topic) {\n // if the there are too many topics selected, tell the user\n if (topics.full()) {\n alert(\"You may only select up to 10 topics.\")\n return;\n }\n // update the selected topics\n updateSelected(topic);\n // add the topic\n topics.add(topic);\n}", "function on_select_ponto(feature){\r\n\t\t\tselect_control.unselectAll({except:feature});\r\n\t\t}", "function highlightShip(mmsi){\n selectedFeature.setInt32(0, mmsi);\n selectedMmsi = mmsi;\n}", "function selected() {\n\t\tvar index = championsNames.indexOf($(this).attr(\"alt\"));\n\t\tvar key = championsKeys[index];\n\t\tvar name = championsNames[index];\n\n\t\t// Display character image on right\n\t\t$(\"#right\").html(\"<img src='http://ddragon.leagueoflegends.com/cdn/img/champion/loading/\" +\n\t\t\tkey + \"_0.jpg' alt=\" + name + \">\");\n\n\t\t// Removes all elements with the selected class\n\t\t$(\".selected\").removeClass(\"selected\");\n\n\t\t// Add selected class to clicked element\n\t\t$(this).addClass(\"selected\");\n\t}", "updateRecommender() {\n var lastFeatureIndex = this.state.featureFlag.length - 1;\n var name = this.state.featureFlag[lastFeatureIndex].name;\n var description = this.state.featureFlag[lastFeatureIndex].description;\n var obj = { name, description };\n featuresList.push(obj);\n }", "transitionBetweenFeatures(i) {\n let welcome = this;\n\n welcome.visibleFeature = [];\n welcome.visibleFeatureIndex = i;\n welcome.visibleFeature.push(welcome.features[i]);\n }", "updateRecommender() {\n var lastFeatureIndex = this.state.featureFlag.length - 1;\n var name = this.state.featureFlag[lastFeatureIndex].name;\n var description = this.state.featureFlag[lastFeatureIndex].description;\n var obj = { name, description };\n featuresList.push(obj);\n }", "function addCardObjToSelectedCardArr(cardObj){\n selectedCards.push(cardObj);\n }", "function setSelectedSymbol(map, geometry) {\n var selected = new ol.Feature({\n geometry: geometry\n });\n\n var style = {};\n if (geometry.getType() === 'Point') {\n style = new ol.style.Style({\n image: new ol.style.Circle({\n radius: 40,\n stroke: new ol.style.Stroke({\n color: 'white',\n width: 2\n }),\n fill: new ol.style.Fill({\n color: [245, 121, 0, 0.6]\n })\n })\n });\n }\n else if (geometry.getType() === 'LineString' || geometry.getType() === 'MultiLineString') {\n style = new ol.style.Style({\n stroke: new ol.style.Stroke({\n color: [245, 121, 0, 0.6],\n width: 4\n })\n })\n }\n else {\n style = new ol.style.Style({\n stroke: new ol.style.Stroke({\n color: 'white',\n width: 2\n }),\n fill: new ol.style.Fill({\n color: [245, 121, 0, 0.6]\n })\n })\n }\n\n var selectedHighlightSource = new ol.source.Vector({\n features: [selected]\n });\n\n selectedHighlightLayer = new ol.layer.Vector({\n name: 'selectedHighlightLayer',\n source: selectedHighlightSource,\n style: style\n });\n\n map.addLayer(selectedHighlightLayer);\n }", "triggerSelected() {\n let cachedValues = this.cachedValues\n let self = this\n let values = new Array()\n this.iterateChecks((index, line, box, span) => {\n if (box.prop(\"checked\")) {\n // Update the \"selected\" property\n cachedValues[index][1] = true\n values.push(cachedValues[index])\n }\n })\n this.model.SetSelected(values)\n super.triggerSelected()\n }", "function highlightFeature(e) {\n var layer = e.target;\n //find out which difficulty button is select\n selectedText = $(\".btn-primary\").text();\n //only assign highlight hover if difficulty filter = difficulty of hovered trail OR hover if difficulty filter is set to All\n if (layer.feature.properties.Difficulty === selectedText || selectedText === \"All\") {\n info.update(layer.feature.properties);\n layer.setStyle({\n weight: 7,\n color: '#ff00ff',\n opacity: 1,\n });\n }\n if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {\n layer.bringToFront();\n }\n }", "function onEachFeature(feature, layer) {\n //bind click\n layer.on('click', function (e) {\n //e=event\n //console.log(e);\n //console.log(feature.properties.title);\n //console.log(\"Anzahl der Koordinaten: \" +feature.geometry.coordinates[0].length);\n //console.log(\"Hier sind die Koordinaten gespeichert: \" +feature.geometry.coordinates[0][0][0]);\n //createMapmask(feature);\n //console.log(layer);\n //console.log(layer.options.fillColor);\n //var check=layer.options.fillColor === definePolygonColor(feature);\n //console.log(check);\n\n /*Check, if the polygon already has a color defined.\n If no OR\n If current color is a different one than the one, which is supposed to be applied:\n --> Color the polygon according to the selected district.\n Else if (i.e. color already defined): Remove the color again. Behaves like on/off toggle\n */\n\n var polygonColor;\n if (typeof layer.options.fillColor == \"undefined\") {\n //Case: No color defined for this district yet\n polygonColor = stdColors[whatsSelected()];\n layer.setStyle({fillColor: polygonColor});\n addToWikidataArray(feature.properties.wikidata);\n } else if (layer.options.fillColor != stdColors[whatsSelected()]) {\n //Case: Current fill color is different than selected color\n updateWikidataArray(layer.options.fillColor, feature.properties.wikidata);\n polygonColor = stdColors[whatsSelected()];\n layer.setStyle({fillColor: polygonColor});\n } else {\n //Case: Current fill color = Selected color\n layer.setStyle({fillColor: undefined});\n removeFromWikidataArray(feature.properties.wikidata);\n }\n\n //console.log(\"Wikidata ID: \" +feature.properties.wikidata);\n });\n }", "function selectedItems() {\n $('input').on('click', function () {\n console.log($(this).val())\n var checked = ($(this).val());\n selectedIngredients.push(checked)\n })\n}", "function msaFeatureClicked(e) {\n\t\tvar layer = e.target;\n\t\t// if this is an actual MSA feature && there is a GEOID (MSA)\n\t\tif (layer.feature.properties && layer.feature.properties.GEOID) {\n\t\t\tif (MAP_DEBUG) console.log(\"\\n^^^^^ Mns.msaFeatureClicked() msa =\", layer.feature.properties.GEOID);\n\t\t\t//if (MAP_DEBUG) console.log(\"layer.feature.properties\",layer.feature.properties);\n\t\t\t// track recently clicked msa layer\n\t\t\tlastMSAFeature = layer;\n\t\t\t// reset any previous msas selected\n\t\t\tresetMSAStyle();\n\t\t\tlet newLocation = {\n\t\t\t\t\"msa\": layer.feature.properties.GEOID,\n\t\t\t\t\"scenario\": Page.location.scenario,\n\t\t\t\t\"data\": Page.location.data\n\t\t\t};\n\t\t\t//if (Site.debug) console.log(p.toString(), newLocation);\n\t\t\t// update the MSA across the interface\n\t\t\tdataChange(\"map\", newLocation);\n\t\t}\n\t}", "function addFeatureOptions(features, options) {\n var feature, x;\n for (x in features) {\n if (features.hasOwnProperty(x)) {\n feature = features[x];\n var uid = utils.createUid();\n feature.uid = uid;\n var data = feature.k;\n feature.k.uid = uid;\n Object.defineProperty(feature, 'data', {\n value: data,\n enumerable: true,\n writable: false,\n configurable: false\n });\n if (options) {\n if (options.filters) {\n // Add filters if not defined.\n if (!that.json.filter) {\n addFilter(options.filters);\n }\n that.json.crossfilter.add([feature]);\n }\n if (options.style) {\n that.instance.data.overrideStyle(feature, options.style);\n }\n }\n that.json.all[feature.data.uid] = feature;\n }\n }\n }", "function setFeature(){\n feature = group.selectAll(\"path\")\n .data(collection2.features)\n .enter()\n .append(\"path\")\n .attr(\"id\",\"overlay\");\n }", "getDispSelected(i, id) {\n selected[i] = !selected[i]\n var temp = this.state.selected\n if (selected[i]) {\n temp.push(id)\n\n }\n if (!selected[i]) {\n const index = temp.indexOf(id);\n if (index > -1) {\n temp.splice(index, 1);\n\n }\n }\n // console.log(temp)\n this.setState({ selected: temp })\n //console.log(this.state.selected.length)\n\n this.checkBack()\n }", "_setSelected(selected) {\n if (selected === this._selected) {\n return false;\n }\n this._selected = selected;\n if (selected) {\n this.selectionList.selectedOptions.select(this);\n }\n else {\n this.selectionList.selectedOptions.deselect(this);\n }\n this._changeDetector.markForCheck();\n return true;\n }", "function highlightFeature(e) {\n var layer = e.target;\n layer.setStyle(Highlight_style(layer.feature));\n}", "function highlightFeature(fid){\n layers[fid].fireEvent('click');\n}", "function vehicSelect(vehicle) {\r\n\t\t\t\tvar index = self.selected_vehicle.indexOf(vehicle);\r\n\t\t\t\t/*(vehicle.select)? self.selected_vehicle.push(vehicle) : self.selected_vehicle.splice(index, 1);*/\r\n\t\t\t\t\r\n\t\t\t\tif (vehicle.select) {\r\n\t\t\t\t\tself.selected_vehicle.push(vehicle);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$scope.selectall = false ;\r\n\t\t\t\t\tself.selected_vehicle.splice(index,1);\r\n\t\t\t\t}\r\n\t\t\t}", "function AddFeatures() {\n\t\t\t\ttry {\n\t\t\t\t\tif (featuresAdded)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tiLog(\"AddFeatures\", \"Called\");\n\t\t\t\t\t\n\t\t\t\t\tcontrol.droppable({\n\t\t\t\t\t\taccept : Utilities.GetAcceptedComponents(self.Accept),\n\t\t\t\t\t\tgreedy : true,\n\t\t\t\t\t\tactiveClass : 'droppable-active',\n\t\t\t\t\t\thoverClass : 'droppable-hover',\n\t\t\t\t\t\tdrop : function (ev, ui) {\n\t\t\t\t\t\t\tvar ref = $(ui.draggable).attr(\"ref\");\n\t\t\t\t\t\t\tEditor.BuildComponent(ref, $(this));\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tcontrol.sortable({\n\t\t\t\t\t\titems : '> .component'\n\t\t\t\t\t});\n\t\t\t\t\th3.addClass(\"moving\");\n\t\t\t\t\t\n\t\t\t\t\tfeaturesAdded = true;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tiLog(\"AddFeatures\", err, Log.Type.Error);\n\t\t\t\t}\n\t\t\t}", "function pushLayers(){\t\r\n\tif(oldLayer.features[0] != null){ oldLayer.removeAllFeatures();\t}\r\n\tif(currentLayer.features[0] != null){\r\n\t\toldLayer.features = currentLayer.features \t// old layer is set to current\r\n\t\tcurrentLayer.removeAllFeatures();\t\t\t// remove all features from current layer\r\n\t\toldLayer.redraw();\r\n\t}\r\n}", "function getselected(current, target) {\n if (_.indexOf(current, target) > -1) {\n return []\n } else {\n return [target]\n }\n }", "teachSelect(selection) {\n this.setState({ disabledS: !this.state.disabledS })\n this.state.teachSel.push(selection);\n }", "manuscriptsSelect(event) {\n let selectedShelfmarks = JSON.parse(\n JSON.stringify(this.props.selectedShelfmarks)\n );\n for (let ms of this.props.manuscripts) {\n let sm = ms.shelfmark;\n if (\n //which == \"All\" &&\n selectedShelfmarks.indexOf(sm) < 0\n ) {\n selectedShelfmarks.push(sm);\n } else {\n selectedShelfmarks = [];\n break;\n }\n }\n this.props.handleSelect(\"selectedShelfmarks\", selectedShelfmarks);\n }", "function setScenarioSelection(scenarioArray) { \n\tvar selection = [];\n\t\n\tif (exhibit._registry._registry.facet.f1 != null) {\n\t\tfor (var i = 0; i < scenarioArray.length; i++) {\n\t\t\tvar selected = new Object();\n\t\t\tselected[\"value\"] = scenarioArray[i];\n\t\t\tselection.push(selected);\n\t\t} \n\t\texhibit._registry._registry.facet.f1._selections = selection; \n//\t\texhibit._registry._registry.facet.f1._notifyCollection(); \n\t}\n}", "function AddFeatures() {\n\t\t\t\ttry {\n\t\t\t\t\tif (featuresAdded)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tiLog(\"AddFeatures\", \"Called\");\n\t\t\t\t\t\n\t\t\t\t\tcontrol.droppable({\n\t\t\t\t\t\taccept : Utilities.GetAcceptedComponents(self.Accept),\n\t\t\t\t\t\tgreedy : true,\n\t\t\t\t\t\tactiveClass : 'droppable-active',\n\t\t\t\t\t\thoverClass : 'droppable-hover',\n\t\t\t\t\t\tdrop : function (ev, ui) {\n\t\t\t\t\t\t\tvar ref = $(ui.draggable).attr(\"ref\");\n\t\t\t\t\t\t\tEditor.BuildComponent(ref, $(this));\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tcontrol.sortable({\n\t\t\t\t\t\titems : \">.component\",\n\t\t\t\t\t\thandle : \">.handle\"\n\t\t\t\t\t});\n\t\t\t\t\tcontrol.disableSelection();\n\n\t\t\t\t\tfeaturesAdded = true;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tiLog(\"AddFeatures\", err, Log.Type.Error);\n\t\t\t\t}\n\t\t\t}", "postFeatures() {\n const features = draw && draw.getAll().features;\n if (features && features.length > 0) {\n features.forEach(feature => {\n if (feature.properties.center.length > 0) {\n const center = feature.properties.center;\n this._get(PYTHON_REST_SERVER_ENDPOINT + \"set_tcd_feature?_id=\" + feature.id + \"&_longitude=\" + center[0] + \"&_latitude=\" + center[1] + \"&_radius=\" + (feature.properties.radiusInKm * 1000) + \"&_gee_imageid=\" + \"gee1234\" + \"&_entered_by=\" + \"andrew\");\n }\n });\n }\n }", "function userSelection(optionSelected) {\n\n var userSelection = document.getElementById(optionSelected).textContent;\n userSelectionSet.push(userSelection);\n \n questionIndexTracker += 1;\n populateQuestions();\n progressBar(2);\n \n}", "updateBasketSelection(id, selected) {\n if(selected) {\n this.basketSelection[id] = {};\n }\n else {\n delete this.basketSelection[id];\n }\n }", "function pwGetCurrentSelection() {\n if($('#filter input[type=checkbox]').is(':checked')) {\n var vals = pwGetColVals(null, 'category');\n vals = pwGetColVals(vals, 'volume');\n vals = pwGetColVals(vals, 'type');\n vals = pwGetColVals(vals, 'location');\n vals = pwGetColVals(vals, 'shape');\n currentSelection = objToArr(vals);\n } else {\n currentSelection = [];\n for (var i=0; i < packages.length; i++) {\n currentSelection[i] = i;\n }\n }\n }", "addGenes() {\n const mappingTypes = this.state.mutationOptions.filter(d => d.selected).map(d => d.id);\n const profiles = this.state.molecularOptions.filter(d => d.selected).map(d => d.profile);\n const variables = this.props.rootStore.molProfileMapping.getMultipleProfiles(profiles, mappingTypes);\n variables.forEach(variable => {\n this.props.variableManagerStore.addVariableToBeDisplayed(variable);\n this.props.variableManagerStore.toggleSelected(variable.id);\n });\n this.setState({geneListString: \"\", showCheckBoxOptions: false});\n }", "function highlightFeature(e) {\n\t\t\t\t var layer = e.target;\n\n\t\t\t\t layer.setStyle({\n\t\t\t\t weight: 5,\n\t\t\t\t color: '#666',\n\t\t\t\t dashArray: '',\n\t\t\t\t fillOpacity: 0.7\n\t\t\t\t });\n\t\t\t\t\t \n\t\t\t\t\t info.update(layer.feature.properties);\n\n\t\t\t\t if (!L.Browser.ie && !L.Browser.opera) {\n\t\t\t\t layer.bringToFront();\n\t\t\t\t }\n\t\t\t\t }", "function infoFeature(e) {\n\t\tconsole.log(e.target.feature);\n\t\thbconsents.resetStyle()//{fillColor: '#feb24c'});//reset all features to default colour\n\t\thbconsents.setFeatureStyle(e.target.feature.id, {fillColor: '#ff0000'});//highlight selected feature\n\t\tfeatureQuery(e.target._latlng);\n\t\t}", "function flashFeatures(features, index) {\n\tif(!index) {\n\t\tindex = 0;\n }\n var current = features[index];\n if(current && current.layer === vectors) {\n\t vectors.drawFeature(features[index], \"select\");\n }\n var prev = features[index-1];\n if(prev && prev.layer === vectors) {\n\t vectors.drawFeature(prev, \"default\");\n }\n ++index;\n\tif(index <= features.length) {\n \twindow.setTimeout(function() {flashFeatures(features, index)}, 75);\n }\n}", "function selectExtra(extra) {\n extra.selected = !extra.selected;\n\n if(extra.selected) {\n\n $scope.model.selectedBurger.extras.push(extra.name);\n } else {\n for(var i = 0; i < $scope.model.selectedBurger.extras.length; i++) {\n if($scope.model.selectedBurger.extras[i] == extra.name) {\n $scope.model.selectedBurger.extras.splice(i, 1);\n break;\n }\n }\n }\n }", "function unselectPreviousFeatures() {\n var i;\n for(i=0; i< selectedFeatures.length; i++) {\n selectedFeatures[i].setStyle(null);\n }\n selectedFeatures = [];\n\t photoID = null;\n\t\tupdateUrl();\n }", "selectAllCategory(categoryName){\n let categoryToSelect = cloneDeep(this.state.saveData[categoryName])\n let newSelected = cloneDeep(this.state.selected) \n for (let tag of categoryToSelect){\n newSelected[tag] = true;\n }\n\n this.setState({selected:newSelected})\n\n }", "function refreshSelected() {\n if (selectedElement != null) {\n utils.removeCssClass(selectedElement, 'br-selected');\n }\n\n selectedElement = filteredDeclarationsUI[selectedIndex];\n if (selectedElement) {\n utils.addCssClass(selectedElement, 'br-selected');\n\n var item = getSelectedItem();\n documentationSide.showDocumentation(item.documentation);\n\n var top = selectedElement.offsetTop;\n var bottom = top + selectedElement.offsetHeight;\n var scrollTop = listElement.scrollTop;\n if (top <= scrollTop) {\n listElement.scrollTop = top;\n }\n else if (bottom >= scrollTop + listElement.offsetHeight) {\n listElement.scrollTop = bottom - listElement.offsetHeight;\n }\n }\n }", "function finished() {\n var i;\n var existe = false;\n\n var p = JSON.parse(JSON.stringify(vm.featureModel.param.feature));\n\n if (p.userInterface.geral.fieldMask == undefined || p.userInterface.geral.fieldMask == null){\n p.userInterface.geral.fieldMask = 'text';\n }\n\n for (i = 0; i < vm.featureModel.json.feature.fields.length; i++) {\n if (p.index != undefined && vm.featureModel.json.feature.fields[i].index === p.index) {\n vm.featureModel.json.feature.fields.splice(i, 1);\n vm.featureModel.json.feature.fields.splice(i, 0, p);\n existe = true;\n }\n }\n\n if (!existe) {\n p.index = vm.featureModel.param.index;\n vm.featureModel.json.feature.fields.push(p); \n vm.featureModel.param.index ++;\n }\n\n vm.featureModel.param.feature = {};\n }", "selectMarkers() {\n const coordList = this.model.get('coordinateList');\n\n this.mapControl.getLayers().item(1).getSource().getFeatures().forEach((feature, i) => {\n const coordItem = coordList.at(i);\n\n if (coordItem.get('selected')) {\n feature.setStyle(new ol.style.Style({\n image: new ol.style.Icon({\n anchorXUnits: 'fraction',\n anchorYUnits: 'pixels',\n src: SELECTED_MARKER_SRC\n })\n }));\n } else if (feature.getStyle() !== null) {\n feature.setStyle(null);\n }\n });\n }", "function AddFeatures() {\n\t\t\t\ttry {\n\t\t\t\t\tif (featuresAdded)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tiLog(\"AddFeatures\", \"Called\");\n\t\t\t\t\t\n\t\t\t\t\tcontrol.css(\"display\", \"block\");\n\t\t\t\t\th3.addClass(\"moving\");\n\t\t\t\t\t\n\t\t\t\t\tfeaturesAdded = true;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tiLog(\"AddFeatures\", err, Log.Type.Error);\n\t\t\t\t}\n\t\t\t}", "function highlightFeature(e) {\n \tvar layer = e.target;\n \tlayer.setStyle({\n \t\tweight: 5,\n \t\tcolor: '#666',\n \t\tdashArray: '',\n \t\tfillOpacity: 0.7\n });\n\n \tif (!L.Browser.ie && !L.Browser.opera) {\n \t\tlayer.bringToFront();\n \t}\n\n //FIXME: Info hasn't been defined\n\t //info.update(layer.feature.properties);\n }", "function highlightFeature(e) {\n\n var layer = e.target;\n layer.openPopup();\n\n\n layer.setStyle({\n /*weight: 2,\n color: '#666',*/\n dashArray: '',\n fillOpacity: 0.7\n });\n\n if (!L.Browser.ie && !L.Browser.opera) {\n layer.bringToFront();\n }\n // console.log(layer.feature.properties);\n info.updateFull(layer.feature); //controla la info de la caja\n\n}", "function highlightFeature(e) {\n var layer = e.target;\n\n layer.setStyle({\n weight: 5,\n color: '#666',\n dashArray: '',\n });\n\n if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {\n layer.bringToFront();\n }\n\n info.update(layer.feature.properties);\n }", "clickLayer(event) {\n if (this.isProjectPage) return\n\n const { onUpdateShapefile } = this.props\n\n let { layer } = event\n if (!layer) {\n layer = event.target\n }\n const { feature } = layer\n const { edscId: layerId } = feature\n\n const layerIndex = this.selectedLayers.indexOf(layerId)\n // If the layerId is currently a selectedLayer\n if (layerIndex > -1) {\n // Remove the layerId from this.selectedLayers\n this.selectedLayers.splice(layerIndex, 1)\n\n // Remove the drawing from the map (also removes the spatial search)\n const { map } = this\n map.fire('draw:deleted', { isShapefile: true, layerId })\n } else {\n // Add the layerId to this.selectedLayers\n this.selectedLayers.push(layerId)\n\n // Add the new constraint to the map\n this.setConstraint(layer)\n }\n\n // Update selectedFeatures in the store\n onUpdateShapefile({ selectedFeatures: this.selectedLayers })\n }", "_setSelected(index, selected) {\n const chip = this._chips.toArray()[index];\n if (chip && chip.selected != selected) {\n chip.toggleSelected(true);\n }\n }", "_setSelected(index, selected) {\n const chip = this._chips.toArray()[index];\n if (chip && chip.selected != selected) {\n chip.toggleSelected(true);\n }\n }", "function selectTarget(response) {\n sel_target.push(response);\n console.log(\"Selected \" + response + \" as Target!\");\n }", "_setSelected(selected) {\n if (selected === this._selected) {\n return false;\n }\n this._selected = selected;\n if (selected) {\n this.selectionList.selectedOptions.select(this);\n }\n else {\n this.selectionList.selectedOptions.deselect(this);\n }\n this.selectedChange.emit(selected);\n this._changeDetector.markForCheck();\n return true;\n }", "function highlightFeature(e) {\n var layer = e.target;\n info.update(layer.feature.properties);\n\n layer.setStyle({\n weight: 2,\n color: '#000000',\n dashArray: '',\n fillOpacity: 0.7\n });\n\n if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {\n layer.bringToFront();\n }\n}", "function handleCompanySelection () {\n var currentCompany = $(this).closest(\"g\").find(\"label\");\n var currentCompanyName = currentCompany.attr(\"for\").toString();\n \n if(currentCompany.hasClass(\"selected\")) {\n var index = selectedCompanies.indexOf(currentCompanyName);\n currentCompany.removeClass(\"selected\");\n if (selectedCompanies.length <= 1) {\n $(\"#please\").fadeIn(650); \n }\n selectedCompanies.splice(index, 1); \n removeCompany(currentCompanyName, index);\n $(this).closest(\"g\").prependTo(\"#unselected-container\");\n } else {\n selectedCompanies.push(currentCompany.attr(\"for\").toString());\n var index = selectedCompanies.indexOf(currentCompanyName);\n addCompany(currentCompanyName, index);\n \n currentCompany.addClass(\"selected\");\n $(this).closest(\"g\").prependTo(\"#selected-container\");\n }\n \n console.log(selectedCompanies);\n }", "function selectCharacter(e) {\n console.log(e.target.id)\n characterSelected.push(fighters[e.target.id]);\n console.log(characterSelected);\n if (characterSelected.length === 2) {\n initGame();\n }\n}", "function selectAllUploaded(selected) {\n\t\t\tif (self.activeTab == 'uploadeddailymail') {\n\t\t\t\tif (selected) {\n\t\t\t\t\tvar dataCopy = angular.copy(self.uploadedList.data);\n\t\t\t\t\tself.uploadedGridOptions.uploadedSelectedItems = dataCopy;\n\t\t\t\t} else {\n\t\t\t\t\tself.uploadedGridOptions.uploadedSelectedItems = [];\n\t\t\t\t}\n\t\t\t} else if (self.activeTab == 'unindexeddailymail') {\n\t\t\t\tif (selected) {\n\t\t\t\t\tvar dataCopy = angular.copy(self.unindexedList.data);\n\t\t\t\t\tself.unindexedGridOptions.unindexedSelectedItems = dataCopy;\n\t\t\t\t} else {\n\t\t\t\t\tself.unindexedGridOptions.unindexedSelectedItems = [];\n\t\t\t\t}\n\t\t\t}\n\t\t}" ]
[ "0.7381456", "0.6663814", "0.6645318", "0.63579714", "0.6344896", "0.6312278", "0.6239654", "0.6216479", "0.6216479", "0.62096614", "0.615395", "0.61014277", "0.6088105", "0.6080157", "0.6057675", "0.6049705", "0.60324883", "0.5907792", "0.59023225", "0.589004", "0.5889153", "0.57996655", "0.57781917", "0.57671773", "0.5695056", "0.56538033", "0.56331605", "0.561746", "0.5605504", "0.5604137", "0.55690855", "0.55667764", "0.55642617", "0.5559723", "0.5542694", "0.55320215", "0.55227655", "0.5521716", "0.551503", "0.54801536", "0.54719806", "0.5461246", "0.5460195", "0.54336375", "0.54309714", "0.5423141", "0.5421588", "0.54182726", "0.5417359", "0.5414797", "0.5394843", "0.5385711", "0.538417", "0.53614074", "0.5350731", "0.53453624", "0.5327283", "0.5315986", "0.53124386", "0.5298509", "0.5296607", "0.5293184", "0.5285555", "0.527816", "0.5264631", "0.5257417", "0.5246693", "0.5244601", "0.5244273", "0.5240422", "0.52396446", "0.52307034", "0.5225018", "0.52246475", "0.5224226", "0.52240735", "0.52192426", "0.521711", "0.5209885", "0.5196461", "0.5195051", "0.5192457", "0.51855177", "0.5178557", "0.5173046", "0.5172499", "0.5168443", "0.5161025", "0.5158515", "0.5152692", "0.5141974", "0.5141926", "0.51391035", "0.51391035", "0.51383895", "0.51383287", "0.5133027", "0.513124", "0.512806", "0.5127311" ]
0.9071196
0
featureUnselected removed a unselected feature from the selectedFeatures array
function featureUnselected(feature){ for (var i = 0; i < selectedFeatures.length; i++) { if (selectedFeatures[i].data.SOVEREIGNT == feature.data.SOVEREIGNT) { selectedFeatures.splice(i, 1); } else { console.log("featureUnselected: Unselected feature '" + feature.data.SOVEREIGNT + "' not found!"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unselectFeature(response) {\n var index = sel_features.indexOf(response);\n if (index > -1) {\n sel_features.splice(index, 1);\n }\n console.log(\"Unselected \" + response + \" as Feature!\");\n }", "function unselectPreviousFeatures() {\n var i;\n for(i=0; i< selectedFeatures.length; i++) {\n selectedFeatures[i].setStyle(null);\n }\n selectedFeatures = [];\n\t photoID = null;\n\t\tupdateUrl();\n }", "function unselectPreviousFeaturesPointClick() {\n var i;\n for(i=0; i< selectedFeatures.length; i++) {\n selectedFeatures[i].setStyle(null);\n }\n selectedFeatures = [];\n\n }", "function remove_selected(){\n\tfoodlst = SELECTED_DAY_ID == \"R\" ? MY_EXPRESS_PLAN : MY_CURRENT_PLAN[SELECTED_DAY_ID] ;\n\tvar j = 0;\n\t$(\".food_list_item\").each(function(){\n\t\tif(this.checked) { foodlst.splice( parseInt(this.getAttribute(\"id_tag\")) - j , 1 ); j++;}\n\t});\n\tdisplay_grocery_list();\n\tselect_day();\n\tupload();\n}", "function removeSelected() {\n const selected = getSelectedDoggo();\n if (selected) {\n selected.classList.remove(\"selected\");\n }\n}", "function onFeatureUnselect(feature) {\n clearMapPopup();\n selectedFeature=null;\n}", "function unselectByClick() {\n const points = this.getSelectedPoints();\n\n if (points.length > 0) {\n Highcharts.each(points, function(point) {\n if (selectedFlag.get() !== null) {\n point.update({\n color: flagsHash[selectedFlag.get()].color,\n name: flagsHash[selectedFlag.get()].val\n }, true);\n }\n point.select(false);\n });\n }\n}", "deselect(selectedMo) {\n const index = this.getIndexOfSelected(this.selected, selectedMo);\n if (index > -1) {\n this.selected.splice(index, 1);\n }\n this.onChange.emit(this.selected);\n }", "function removeSelected(){\n\tboxes.forEach(function(box){\n\t\tbox.classList.remove(\"selected\")\n\t})\n}", "removeSelected(option, options) {\n let index = options.indexOf(option);\n if (index > -1) {\n options = options.splice(index, 1);\n }\n }", "function unHighlightFeature(_e) {\n if (featureID) { // if the featureID variable is null (initialized above)\n map.setFeatureState(\n // When the mouse moves over the colinwaba.3852l5am source, update the feature state for the feature under the mouse\n {source: 'colinwaba.3852l5am', sourceLayer: sourceLayerName, id: featureID}, \n {hover: false}\n );\n }\n featureID = null; // re-assign variable to null\n map.getCanvas().style.cursor = ''; // reset the cursor style\n }", "function featureSelected(feature){ \n selectedFeatures.push(feature);\n }", "function clearSelection(){\n pieceSelected = false;\n selectedPieceArray = [];\n}", "function removeSelected() {\n \t$(\"#check-list-box li\").each(function(idx, li) {\n $(li).removeClass(style + color + ' selected');\n $(li).find('span.state-icon').removeClass('glyphicon-check').addClass('glyphicon-unchecked')\n });\n }", "function removeSelected(selectedElements) {\n\t\tfor (let i = 0; i<selectedElements.length; i++) {\n\t\t\tselectedElements[i].textContent = \"\";\n\t\t\tselectedElements[i].classList.remove(\"selected\");\n\t\t}\n\t}", "deleteSelectedObjects() {\n var objects = this.selection.getSelectedObjects();\n this.selection.clear();\n objects.forEach(object => {\n object.remove && object.remove();\n });\n }", "removeSelected() {\n\n Model.clearSelected(this.currentCartItems);\n }", "deleteSelection(sketch, selected, layer) {\n if (this.objects) {\n for (let i = 0; i < this.objects.length; i++) {\n if (this.objects[i].deleteSelection(sketch, selected, layer)) {\n break;\n }\n }\n }\n }", "function on_select_ponto(feature){\r\n\t\t\tselect_control.unselectAll({except:feature});\r\n\t\t}", "deselectAll_() {\n this.selectedChips_.forEach((chipFoundation) => {\n chipFoundation.setSelected(false);\n });\n this.selectedChips_.length = 0;\n }", "removeSelection() {\n this.simcirWorkspace.removeSelected();\n }", "removeSelection() {\n let isFirst = true;\n if (this.selector.nodesAreSelected() || this.selector.loopsAreSelected() || this.selector.edgesAreSelected()) {\n if (this.selector.nodesAreSelected()) {\n this.selector.selectedNodes.forEach((node, i) => this.removeNodeCommand(node, i === 0 && isFirst));\n this.svgsManager.nodeManager.update();\n isFirst = false;\n }\n if (this.selector.loopsAreSelected()) {\n this.selector.selectedLoops.forEach((loop, i) => this.removeLoopCommand(loop, i === 0 && isFirst));\n this.svgsManager.loopManager.update();\n isFirst = false;\n }\n if (this.selector.edgesAreSelected()) {\n this.selector.selectedEdges.forEach((edge, i) => this.removeEdgeCommand(edge, i === 0 && isFirst));\n this.svgsManager.edgeManager.update();\n isFirst = false;\n }\n this.selector.resetSelection();\n return true;\n }\n InterfaceAndMisc_1.CustomWarn(\"Nothing to delete\");\n return false;\n }", "function removeSelectedGoals() {\n\t\t\tfor (var i = 0; i < vm.goals.length; i++) {\n\n\t\t\t\t// If the goal is selected \n\t\t\t\tif (vm.goals[i].selected === true) {\n\t\t\t\t\tvar task = vm.goals.splice(i, 1);\n\t\t\t\t\tconsole.log(task[i]);\n\t\t\t\t\ttasks.removeTask(task[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "clearSelected() {\n this.getSelectedIds().forEach(id => {\n if(this.get(id).created === false) {\n this.get(id).onStopDrawing({});\n }\n this.delete(id);\n });\n }", "function removeSelectionPolygon() {\t\t\t\n\t\t\t\tselection_polygon.setPath([]);\n\t\t\t\tselection_polygon.setMap(null);\n\t\t\t}", "function clearSelected() {\n var query = \"#corpus-topics li.selected\";\n if (tenMode) {\n query = \"#corpus-ten-topics li.selected\"\n }\n d3.selectAll(query).each(function(){\n removeTopicFromSelected(this.dataset.topic);\n });\n}", "function deselectObjects(){\n \n Array.prototype.forEach.call(selectableObjects, function(item) {\n item.classList.remove(\"selected\");\n });\n\n}", "function removeSelectedImage(){\n for(let i = 0; i < selectedImages.length; i++){\n let element = document.getElementById(selectedImages[i]);\n element.parentNode.removeChild(element);\n images.splice(images.indexOf(selectedImages[i],1));\n }\n selectedImages = [];\n}", "function deselectAll() {\n Object.keys(vm.selected).forEach(deselect);\n Array.prototype.slice.call($element[0].querySelectorAll('md-branch[selected]')).forEach(function (el) {\n el.removeAttribute('selected');\n });\n }", "multiselect() {\n \n const selected = self.filters.selected[key];\n \n let index;\n \n if( selected.length > 1 && (index = selected.indexOf(undefined)) > -1 ) {\n \n selected.splice(index, 1);\n \n }\n \n }", "function RemoveFeatures() {\n\t\t\t\ttry {\n\t\t\t\t\tif (!featuresAdded)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tiLog(\"RemoveFeatures\", \"Called\");\n\t\t\t\t\t\n\t\t\t\t\tcontrol\n\t\t\t\t\t\t.droppable(\"destroy\")\n\t\t\t\t\t\t.sortable(\"destroy\")\n\t\t\t\t\t\t.enableSelection();\n\t\t\t\t\t\n\t\t\t\t\tfeaturesAdded = false;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tiLog(\"RemoveFeatures\", err, Log.Type.Error);\n\t\t\t\t}\n\t\t\t}", "function unselectTarget(response) {\n var index = sel_target.indexOf(response);\n if (index > -1) {\n sel_target.splice(index, 1);\n }\n console.log(\"Unselected \" + response + \" as Target!\");\n }", "function unselectAll() {\n if(_selected) {\n _selected.removeClass( selectionClasses );\n removeMenu( _selected );\n }\n }", "removeList(){\n global_gff3.extra_showing = false;\n global_gff3.extra_details = null;\n d3.selectAll('.extra_tr').remove();\n d3.selectAll('.featureList').remove()\n }", "function RemoveFeatures() {\n\t\t\t\ttry {\n\t\t\t\t\tif (!featuresAdded)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tiLog(\"RemoveFeatures\", \"Called\");\n\t\t\t\t\t\n\t\t\t\t\tcontrol.draggable(\"destroy\")\n\t\t\t\t\t\t.removeClass(\"editing\");\n\t\t\t\t\tinput.removeClass(\"moving\")\n\t\t\t\t\tspan.removeClass(\"moving\")\n\t\t\t\t\t\n\t\t\t\t\tfeaturesAdded = false;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tiLog(\"RemoveFeatures\", err, Log.Type.Error);\n\t\t\t\t}\n\t\t\t}", "function RemoveFeatures() {\n\t\t\t\ttry {\n\t\t\t\t\tif (!featuresAdded)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tiLog(\"RemoveFeatures\", \"Called\");\n\t\t\t\t\t\n\t\t\t\t\t//LK: due problems changing Target back to onclick here on live object, it is done later in PageHelper.CleanVRM!\n\t\t\t\t\tlink.removeClass(\"moving\");\n\t\t\t\t\tcontrol.draggable(\"destroy\")\n\t\t\t\t\t\t.removeClass(\"editing\")\n\t\t\t\t\t\t.removeClass(\"moving\");\n\t\t\t\t\t\n\t\t\t\t\tfeaturesAdded = false;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tiLog(\"RemoveFeatures\", err, Log.Type.Error);\n\t\t\t\t}\n\t\t\t}", "function removeSelectedSymbol(map) {\n map.removeLayer(selectedHighlightLayer);\n }", "function RemoveFeatures() {\n\t\t\t\ttry {\n\t\t\t\t\tif (!featuresAdded)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tiLog(\"RemoveFeatures\", \"Called\");\n\t\t\t\t\t\n\t\t\t\t\tcontrol.draggable(\"destroy\")\n\t\t\t\t\t\t.resizable(\"destroy\")\n\t\t\t\t\t\t.removeClass(\"editing\");\n\t\t\t\t\tinput.removeClass(\"moving\");\n\t\t\t\t\tspan.removeClass(\"moving\");\n\t\t\t\t\t\n\t\t\t\t\tfeaturesAdded = false;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tiLog(\"RemoveFeatures\", err, Log.Type.Error);\n\t\t\t\t}\n\t\t\t}", "function RemoveFeatures() {\n\t\t\t\ttry {\n\t\t\t\t\tif (!featuresAdded)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tiLog(\"RemoveFeatures\", \"Called\");\n\t\t\t\t\t\n\t\t\t\t\tcontrol.draggable(\"destroy\")\n\t\t\t\t\t\t.resizable(\"destroy\")\n\t\t\t\t\t\t.removeClass(\"editing\");\n\t\t\t\t\tinput.removeClass(\"moving\");\n\t\t\t\t\t\n\t\t\t\t\tfeaturesAdded = false;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tiLog(\"RemoveFeatures\", err, Log.Type.Error);\n\t\t\t\t}\n\t\t\t}", "function unhighlightEasyFeature(e) {\n info.update();\n if (e.target.feature.properties.Difficulty === selectedText || selectedText === \"All\") {\n easyLayer.resetStyle(e.target);\n }\n }", "function removeSelected() {\r\n arrayClass = [\r\n 'open', 'save', 'eraser', 'brush', 'line', 'curve', \r\n 'letterL', 'letterW', 'car', 'house', 'rectangle', \r\n 'circle', 'ellipse', 'hexagon', 'arrow', 'triangle', \r\n 'pentagon', 'diamond', 'fourStar', 'fiveStar'\r\n ]\r\n\r\n arrayClass.forEach(element => {\r\n let toolClass = document.getElementById(element)\r\n try {\r\n toolClass.classList.remove(\"selected\");\r\n } catch {\r\n }\r\n });\r\n}", "function onPopupClose(evt) {\n selectFeaturesControl.unselect(selectedFeature);\n}", "function deselect() {\n let selected = squares.find((square) => square.hasClass(constants.classes.SELECTED));\n\n if (selected) {\n selected.removeClass(constants.classes.SELECTED);\n }\n\n\n return selected;\n }", "removePoint() {\n const i = this.pointObjects.indexOf(this.selectedPoint);\n this.splinePoints.splice(i, 1);\n this.deselectPoint();\n this.updateTrajectory();\n }", "function RemoveFeatures() {\n\t\t\t\ttry {\n\t\t\t\t\tif (!featuresAdded)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tiLog(\"RemoveFeatures\", \"Called\");\n\n\t\t\t\t\tcontrol.draggable(\"destroy\")\n\t\t\t\t\t\t.removeClass(\"editing\");\n\t\t\t\t\tinput.removeClass(\"moving\");\n\t\t\t\t\tspan.removeClass(\"moving\");\n\t\t\t\t\t\n\t\t\t\t\tfeaturesAdded = false;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tiLog(\"RemoveFeatures\", err, Log.Type.Error);\n\t\t\t\t}\n\t\t\t}", "function unselectObjects() {\n if(selected_poly == -1) return;\n var anid;\n\n var anid = main_canvas.GetAnnoIndex(selected_poly);\n if(view_ObjList) ChangeLinkColorBG(selected_poly);\n main_canvas.annotations[anid].UnfillPolygon();\n \n // Unselect object parts:\n var selected_poly_parts = getPartChildrens(selected_poly);\n for (var i=0; i<selected_poly_parts.length; i++) {\n\n var anid = main_canvas.GetAnnoIndex(selected_poly_parts[i]);\n if(anid >= 0 && (selected_poly_parts[i]!=selected_poly)) {\n main_canvas.annotations[anid].UnfillPolygon();\n if (main_canvas.annotations[anid].hidden) main_canvas.annotations[anid].DeletePolygon();\n }\n\n \n }\n \n // Reset selected_poly variable:\n selected_poly = -1;\n}", "function multiSelectSupport(feature, layer) {\n layer.on(\"click\", function(e){\n if (selectEnabled) {\n var layerId = geojsonGroup.getLayerId(layer)\n if (selected.indexOf(layerId)>=0) {\n layer.setStyle({color: \"#FF0000\"})\n selected.splice(selected.indexOf(layerId), 1)\n console.log(\"Deselected feature \" + feature.properties.name +\" \"+layerId)\n } else {\n layer.setStyle({color: \"#0000FF\"})\n selected.push(layerId)\n console.log(\"Selected feature \" + feature.properties.name +\" \"+layerId)\n }\n }\n })\n}", "function RemoveFeatures() {\n\t\t\t\ttry {\n\t\t\t\t\tif (!featuresAdded)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tiLog(\"RemoveFeatures\", \"Called\");\n\t\t\t\t\t\n\t\t\t\t\tlabel.removeClass(\"moving\");\n\t\t\t\t\tcontrol\n\t\t\t\t\t\t.draggable(\"destroy\")\n\t\t\t\t\t\t.resizable(\"destroy\")\n\t\t\t\t\t\t.removeClass(\"editing\")\n\t\t\t\t\t\t.removeClass(\"moving\");\n\t\t\t\t\t\n\t\t\t\t\tfeaturesAdded = false;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tiLog(\"RemoveFeatures\", err, Log.Type.Error);\n\t\t\t\t}\n\t\t\t}", "function RemoveFeatures() {\n\t\t\t\ttry {\n\t\t\t\t\tif (!featuresAdded)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tiLog(\"RemoveFeatures\", \"Called\");\n\t\t\t\t\t\n\t\t\t\t\tcontrol.draggable(\"destroy\")\n\t\t\t\t\t\t.resizable(\"destroy\")\n\t\t\t\t\t\t.removeClass(\"editing\");\n\t\t\t\t\tinput.removeClass(\"moving\");\n\t\t\t\t\t\n\t\t\t\t\tCleanUp(true);\n\t\t\t\t\t\n\t\t\t\t\tfeaturesAdded = false;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tiLog(\"RemoveFeatures\", err, Log.Type.Error);\n\t\t\t\t}\n\t\t\t}", "removeAll () {\r\n const O = this;\r\n const optionList = O.E.find('option');\r\n\r\n for (let x = (optionList.length - 1); x >= 0; x--) {\r\n if (optionList[x].selected !== true) {\r\n O.remove(x);\r\n }\r\n }\r\n\r\n }", "function removeSelectedArea()/*:void*/ {\n this.canvasMgr$AoGC.removeSelectedShape();\n }", "function RemoveFeatures() {\n\t\t\t\ttry {\n\t\t\t\t\tif (!featuresAdded)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tiLog(\"RemoveFeatures\", \"Called\");\n\t\t\t\t\t\n\t\t\t\t\tcontrol.draggable(\"destroy\")\n\t\t\t\t\t\t.resizable(\"destroy\")\n\t\t\t\t\t\t.removeClass(\"editing\");\n\t\t\t\t\tinput.removeClass(\"moving\")\n\t\t\t\t\t\t.unbind(\"click.EditorText\");\n\t\t\t\t\t\n\t\t\t\t\tfeaturesAdded = false;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tiLog(\"RemoveFeatures\", err, Log.Type.Error);\n\t\t\t\t}\n\t\t\t}", "function unhighlight() {\n d3.select(this).classed('selected', false)\n }", "function removeIsSelected() {\n dots.forEach((dot) => {\n if (dot.hasAttributes(\"is-selected--dot\")) {\n dot.classList.remove(\"is-selected--dot\");\n }\n });\n }", "doUnselectItem() {\n if (this.selected) {\n this.selected.set('selected', false);\n this.set('selected',null);\n }\n }", "function RemoveFeatures() {\n\t\t\t\ttry {\n\t\t\t\t\tif (!featuresAdded)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tiLog(\"RemoveFeatures\", \"Called\");\n\t\t\t\t\t\n\t\t\t\t\th3.removeClass(\"moving\");\n\t\t\t\t\t\n\t\t\t\t\tfeaturesAdded = false;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tiLog(\"RemoveFeatures\", err, Log.Type.Error);\n\t\t\t\t}\n\t\t\t}", "function RemoveFeatures() {\n\t\t\t\ttry {\n\t\t\t\t\tif (!featuresAdded)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tiLog(\"RemoveFeatures\", \"Called\");\n\t\t\t\t\t\n\t\t\t\t\tcontrol\n\t\t\t\t\t\t.draggable(\"destroy\")\n\t\t\t\t\t\t.resizable(\"destroy\")\n\t\t\t\t\t\t.removeClass(\"editing\")\n\t\t\t\t\t\t.removeClass(\"moving\");\n\t\t\t\t\t\n\t\t\t\t\tfeaturesAdded = false;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tiLog(\"RemoveFeatures\", err, Log.Type.Error);\n\t\t\t\t}\n\t\t\t}", "function clearSelected() {\n var selected = getSelected();\n while (selected.length > 0) removeFromSelected(selected[0]);\n document.getElementById(\"eMalButtons\").classList.remove(\"emActive\");\n}", "function clearSelectedState() {\n var selected = svgDoc.getElementsByClassName('selected');\n if (selected.length > 0) {\n var className = selected[0].getAttribute('class').replace('selected','').trim();\n selected[0].setAttribute('class', className);\n }\n }", "function removeSelection() {\n $('.file-row input[type=\"checkbox\"]').each(function() {\n var $item = $(this);\n\n $item.prop('checked', false);\n $item.parents('.file-row').removeClass('active');\n $selectAllCheckbox.removeClass('active');\n $('.file-row').removeClass('passive');\n });\n}", "function RemoveFeatures() {\n\t\t\t\ttry {\n\t\t\t\t\tif (!featuresAdded)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tiLog(\"RemoveFeatures\", \"Called\");\n\t\t\t\t\t\n\t\t\t\t\tcontrol.droppable(\"destroy\")\n\t\t\t\t\t\t.draggable(\"destroy\")\n\t\t\t\t\t\t.resizable(\"destroy\")\n\t\t\t\t\t\t.selectable(\"destroy\");\n\t\t\t\t\th3.removeClass(\"moving\");\n\n\t\t\t\t\tfeaturesAdded = false;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tiLog(\"RemoveFeatures\", err, Log.Type.Error);\n\t\t\t\t}\n\t\t\t}", "getUnselectedIndices(selected) {\n\t\treturn this.__$$getSelectedIndices(selected, false)\n\t}", "clearFeatures() {\n if (this.__featuresSource) {\n this.__featuresSource.clear();\n this._featuresChanged();\n }\n }", "deselectBuckets() {\n this.props.deselectBuckets();\n this.props.disableSelectionMode();\n }", "function RemoveFeatures() {\n\t\t\t\ttry {\n\t\t\t\t\tif (!featuresAdded)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tiLog(\"RemoveFeatures\", \"Called\");\n\t\t\t\t\t\n\t\t\t\t\tcontrol\n\t\t\t\t\t\t.droppable(\"destroy\")\n\t\t\t\t\t\t.sortable(\"destroy\");\n\t\t\t\t\th3.removeClass(\"moving\");\n\t\t\t\t\t\n\t\t\t\t\tfeaturesAdded = false;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tiLog(\"RemoveFeatures\", err, Log.Type.Error);\n\t\t\t\t}\n\t\t\t}", "function removeSelection(item) {\n //reset this item's grabbed state\n item.setAttribute('aria-grabbed', 'false');\n\n //then find and remove this item from the existing items array\n for (var len = selections.items.length, i = 0; i < len; i++) {\n if (selections.items[i] == item) {\n selections.items.splice(i, 1);\n break;\n }\n }\n}", "get unselected() {\n return this.checkboxTargets.filter(target => !target.checked)\n }", "function clearSelected() {\n\t\tvar ctrl = pls.querySelectorAll('.selected');\n\t\tvar len = ctrl.length;\n\t\tif (len > 0) {\n\t\t\tvar i = 0;\n\t\t\tfor (i; i < len; i++) {\n\t\t\t\tctrl[i].classList.remove('selected');\n\t\t\t}\n\t\t}\n\t}", "function eraseShape() {\r\n\tif (anySelected) {\r\n\t\tshapes.splice(shapes.indexOf(previousSelectedShape), 1);\r\n\t\tpreviousSelectedShape = null;\r\n\t\tdrawShapes();\r\n\t\tanySelected = false;\r\n\t}\r\n}", "function unselectElem( svgElem ) {\n if ( typeof svgElem === 'object' && ! ( svgElem instanceof jQuery ) )\n svgElem = $(svgElem);\n if ( typeof svgElem === 'undefined' ) {\n svgElem = $(svgRoot).find('.selected');\n if ( svgElem.length === 0 )\n return;\n }\n else if( ! svgElem.hasClass('selected') )\n return;\n svgElem.removeClass('selected');\n //for ( var n=0; n<self.cfg.onUnselect.length; n++ )\n // svgElem.each( function () { self.cfg.onUnselect[n](this); } );\n svgElem.each( function () {\n for ( var n=0; n<self.cfg.onUnselect.length; n++ )\n self.cfg.onUnselect[n](this);\n } );\n }", "function RemoveFeatures() {\n\t\t\t\ttry {\n\t\t\t\t\tif (!featuresAdded)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tiLog(\"RemoveFeatures\", \"Called\");\n\t\t\t\t\t\n\t\t\t\t\tcontrol.css(\"display\", \"none\");\n\t\t\t\t\th3.removeClass(\"moving\");\n\t\t\t\t\t\n\t\t\t\t\tfeaturesAdded = false;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tiLog(\"RemoveFeatures\", err, Log.Type.Error);\n\t\t\t\t}\n\t\t\t}", "function cleanSelection() {\n for (let i = 0; i < colorOptCount; i++) {\n colorOpt.remove(colorOpt[i]);\n }\n}", "function btnExcludeSelected() {\n const eraseOnlySelected = document.querySelectorAll('.selected');\n for (let erase of eraseOnlySelected) {\n if (confirm('Tem certeza de que deseja excluir TODAS as atividades SELECIONADAS?')) {\n const nextParent = erase.parentNode;\n const theLastParent = nextParent.parentNode\n theLastParent.remove();\n }\n }\n archiveSet();\n }", "function removeLabel(e, label){\n for(var i = 0; i < label.length; i++){\n if(label[i].selected === true && label[i].labels.includes(e.target.value) === true){\n label[i].labels.splice(label[i].labels.indexOf(e.target.value),1)\n }\nupdate(passUp)\n}\n}", "function cmdDeleteSelected() {\n var i;\n for( i in ImageInfo[currentImage][\"Regions\"] ) {\n if( ImageInfo[currentImage][\"Regions\"][i] == region ) {\n removeRegion(ImageInfo[currentImage][\"Regions\"][i]);\n paper.view.draw();\n break;\n }\n }\n}", "function removeSelectedClass() {\n const countSelectClass = document.getElementsByClassName('selected');\n for (let index = 0; index < countSelectClass.length; index += 1) {\n countSelectClass[index].classList.remove('selected');\n }\n}", "function onUnselectRoute(feature) {\n // feature has been selected, Just tell the RouteView of the selection.\n this._routesView._unselectRoute(feature.__route);\n }", "function unselectAll() {\n resetAllStrokes();\n resetAllBackgrounds();\n selected_robots = [];\n}", "function cancelSelected(id,id2){\n scope.plan.current[id].isSelected = false;\n scope.plan.selected.splice(id2,1);\n }", "function Deselected()\r\n{\r\n\tthis.gameObject.GetComponent.<SpriteRenderer>().sprite = terminal_off_sprite;\r\n\tselected = false;\r\n}", "deselectCurrentPiece() {\n if (this.selectedPiece != null) {\n this.selectedPiece.selected = false;\n this.selectedPiece.swapText();\n this.selectedPiece = null;\n }\n }", "function removeSelected(){\n\t$('.popover-content > ul > li').each (function(){\n\t\t$(this).removeClass('selected-day');\n\t})\n}", "function clearSelectedStates() {\n angular.element('.ui-grid-custom-selected').removeClass('ui-grid-custom-selected');\n _scope.ugCustomSelect.selectedCells = [];\n _scope.ugCustomSelect.cellMap = {};\n }", "function clearSelectedThumbs() {\n if($(\"#multiImgView\").hasClass('active')) {\n\n for(var i=0; i<selectedImgs.length; i++) {\n $('#thumb' + selectedImgs[i]).removeClass('selected');\n }\n\n selectedImgs=[];\n }\n }", "removeSelectedColorById(colorId){\n let array = this.state.selectedColors;\n for(let i = 0; i < array.length; i++){\n if(array[i].id == colorId){\n let index = array.indexOf(array[i]);\n let selected = array.splice(index, 1);\n this.setState(\n {\n selectedColors: array,\n colors: this.state.colors.concat(selected)\n });\n break;\n }\n }\n }", "function unselectSelectedAssessment() {\n if (selectedAssessment != null) {\n $(selectedAssessment).removeClass('selected');\n $(selectedAssessment).children('#select-badge').remove();\n selectedAssessment = null;\n $('.bank-item').draggable('disable');\n }\n hideAssessItems();\n\n}", "function _cleanSelectedList() {\n let i = _selectedList.length;\n while (i--) {\n if (_selectedList[i].value === 'index') {\n _selectedList.splice(i, 1);\n }\n }\n }", "function unselectAll() {\n d3.selectAll(\"#synoptic .selection\")\n .remove();\n }", "setRemoved() {\n if (!this.selected) {\n return;\n }\n\n this.selected.set('path_classification', Constants.JOURNAL_REMOVED_PATH);\n this.set('selected', null);\n }", "function unselect() {\n for (let i = 0; i < dynamicDiv.childNodes.length; i ++) {\n if (dynamicDiv.childNodes[i].classList.length > 1)\n {\n dynamicDiv.childNodes[i].classList.remove(\"selected\");\n }\n }\n for (let i = 0; i < projectDiv.childNodes.length; i ++) {\n if (projectDiv.childNodes[i].classList.length > 1)\n {\n projectDiv.childNodes[i].classList.remove(\"selected\");\n }\n }\n}", "clearSelection(){\n this.selected = null\n }", "function removeSelectedKeyPair()\r\n{\r\n jQuery('#edit-business-key-queue option:selected').remove();\r\n}", "deselectAll(notify) {\n if (this.multiSelection) {\n this.selectedItems.forEach(function (item) {\n this.deselect(item, notify);\n }.bind(this));\n } else {\n this.deselect(this.selectedItem, notify);\n }\n }", "function destroyDrag( ) {\r\n selected = null;\r\n }", "function removeLayer(){\n if ( $('#layer-list').children().length == 0 ) return;\n paper.project.activeLayer.remove();\n $('.selected').remove();\n var i = $('.selected').index();\n // if ( $('#layer-list').children().length == 0 ) {\n // setTimeout(function() { addListLayer(); }, 200);\n // }\n // transferSelected($(\"#layer-list\").children()[i+1]);\n transferSelected($(\"#layer-list\").children()[0]);\n}", "function resetVector(){\n\tsearch_vector.removeAllFeatures();\n}", "function clearSelectedSquares() {\n mapSquares(square => square.selected = false);\n}", "function removeSelect(){\n answerEls.forEach(x=>{\n x.checked=false\n })\n }", "handleRemoveRow(event) {\n // For some reason lwc returns a proxy and not an object array when\n // accessing seslectedData directly so going to have to do a query \n // selection for elements to fetch selected rows\n //let selectedRows = this.selectedData;\n let selectedRows = this.template.querySelector('lightning-datatable').getSelectedRows();\n if(!selectedRows.length) {\n this.showNotification('No Rows Selected');\n return;\n }\n for(let i = 0; i < selectedRows.length; i++) {\n for(let j = 0; j < this.data.length; j++) {\n if(this.data[j]['id'] == selectedRows[i]['id']) {\n this.data.splice(j,1);\n }\n } \n }\n this.calculateData();\n }", "function clearSelected() {\n // Reset flag image on lang select button\n lngBtn.classList.remove(lastSelected)\n // Reset select state on menu item\n lngMenuItems.forEach(item => item.classList.remove('selected'))\n}" ]
[ "0.7970649", "0.72647816", "0.7117742", "0.6794716", "0.67596906", "0.6720562", "0.6547242", "0.65273386", "0.6523119", "0.6517166", "0.64499676", "0.64484805", "0.64395726", "0.6430554", "0.6419875", "0.6396876", "0.63834465", "0.6358797", "0.63059276", "0.6292515", "0.6288135", "0.62841344", "0.62726897", "0.62311894", "0.62306046", "0.6212832", "0.6210582", "0.6199626", "0.6179485", "0.61757416", "0.6152352", "0.6151377", "0.6149819", "0.6123868", "0.6121702", "0.61181474", "0.61155605", "0.61108613", "0.61062443", "0.610559", "0.6104387", "0.6095725", "0.608835", "0.6088235", "0.60763586", "0.6075138", "0.60736203", "0.6072611", "0.606467", "0.6064097", "0.60603297", "0.60567784", "0.6054825", "0.60489166", "0.6039014", "0.6027939", "0.60199887", "0.60126907", "0.6007585", "0.59988284", "0.5994306", "0.59941757", "0.5985639", "0.597896", "0.59726715", "0.5967187", "0.5959124", "0.5952483", "0.59484714", "0.59346616", "0.593301", "0.59233385", "0.59185374", "0.5906015", "0.58829737", "0.5879628", "0.5872611", "0.58700025", "0.5829506", "0.5817615", "0.58152264", "0.58150667", "0.58109426", "0.5808736", "0.58044845", "0.5798208", "0.5795363", "0.57940483", "0.5789463", "0.5784505", "0.57685655", "0.57594067", "0.5758719", "0.5753672", "0.5745077", "0.5739255", "0.5732974", "0.57117826", "0.57108176", "0.5709937" ]
0.8378116
0
[ INFINITY, 1, 1, 2, 3, ... ]
function maxSum(arr) { if (arr.length < 2) throw new Error('array must have at least 2 numbers'); let max = arr[0] + arr[1]; /** * O(n^2) */ /* n times */ for (let i = 0; i < arr.length; i++) { let sum = arr[i]; /* n - i times */ for (let j = i + 1; j < arr.length; j++) { sum += arr[j]; if (sum > max) max = sum; } return max; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function n() {\n return [0, 0];\n }", "function n() {\n return [0, 0, 0];\n }", "function e$1(){return [1,0,0,0,1,0,0,0,1]}", "function nbv(i) { var r = []; fromInt(r,i); return r; }", "function n$c(){return [0,0,0,0]}", "function e() {\n return [1, 0, 0, 1, 0, 0];\n }", "function range(max)\n{\n var retVal =[]\n for (var i=0; i<max; i++)\n {\n retVal.push(i*2); //retVal[i]= i*2\n }\n return retVal;\n}", "zero(n, emin) {\n var r, i, obj;\n\n r = [];\n for(i = 0; i < n; i++)\n r[i] = 0;\n /* we return an array and store emin in its prototype */\n obj = Object.create(Series.prototype);\n obj.emin = emin;\n Object.setPrototypeOf(r, obj);\n return r;\n }", "function e(){return [0,0,0,1]}", "function negit(arr){\n newArr = [];\n for(e in arr){\n if(arr[e] <= 0){\n newArr[e] = arr[e];\n } else{\n newArr[e] = arr[e]*-1;\n }\n }\n return newArr;\n}", "function e$j(){return [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}", "function range(n) {\n var numbers = [];\n for (var i = 1; i <= n; i++)\n numbers.push(i);\n return numbers;\n}", "function getRange() {\n let numberArray = [];\n for (let index = 1; index <= 100; index++) {\n numberArray.push(index);\n }\n\n return numberArray;\n}", "function populateNumbers( x ) {\n\t\tvar numbers = [];\n\t\tfor ( var i = 0; i < x; i++ ) {\n\t\t\tnumbers[ i ] = i + 1; // 1-x\n\t\t}\n\t\treturn numbers;\n\t}", "function P(l){for(var a = Array(l); a[--l] = l;); return a;}", "function makeArr(startValue, stopValue, cardinality) {\n var arr = [];\n var step = (stopValue - startValue) / (cardinality - 1);\n for (var i = 0; i < cardinality; i++) {\n arr.push(startValue + (step * i));\n }\n return arr;\n}", "function vzero()\n{\n var v = [];\n v[0] = 0.0;\n v[1] = 0.0;\n v[2] = 0.0;\n return v;\n}", "function completeSeries(arr) {\n\tlet output = [];\n\tconst max = Math.max(...arr);\n\tconst set = [...new Set(arr)];\n\tif (set.length !== arr.length) {\n\t\treturn [0];\n\t} else {\n\t\tlet i = 0;\n\t\twhile (i <= max) {\n\t\t\toutput.push(i);\n\t\t\ti++;\n\t\t}\n\t\treturn output;\n\t}\n}", "function makeArr(startValue, stopValue, cardinality) {\n var arr = [];\n var step = (stopValue - startValue) / (cardinality - 1);\n for (var i = 0; i < cardinality; i++) {\n arr.push(startValue + (step * i));\n }\n return arr;\n}", "function range(n) {\n a = [];\n for(i = 0; i < n; i++) {\n a[i] = i;\n }\n return a;\n}", "function main() {\n const v1 = [];\n for (let v11 = 0; v11 < 7; v11++) {\n for (let v16 = 0; v16 != 100; v16++) {}\n for (let v18 = -0.0; v18 < 7; v18 = v18 || 13.37) {\n const v21 = Math.max(-339,v18);\n v1.fill();\n undefined % v21;\n }\n }\n}", "function Num(){\nvar arr=[]\nfor(var i =1; i<=255; i++){\n arr.push(i);\n}\nconsole.log(arr);\n}", "function positives(arr) {\n let result = [];\n each(arr, function(num) {\n Math.sign(num) ? result.push(num) : undefined;\n })\n return result;\n}", "function zeroes(a) {\n var ret = [];\n var i;\n\n for(i = 0; i < a; i++) ret.push(0);\n\n return ret;\n}", "calcNumbers() {\n this._numbers = [];\n for (let i = this._start; i <= this._end; i++) {\n this._numbers.push(i);\n }\n }", "function missingValue(nums) { }", "function createBombo() {\n let arr = [];\n for (let i = 1; i <= 90; i++) {\n arr.push(i);\n }\n return arr;\n}", "function arrayOfMultiples (num, length) {\n let bucket = [];\n for(let i = 1; i<=length;i++){\n bucket.push(num * i);\n }\n return bucket;\n}", "_getValidRedoublesValues() {\n let values = [\"unlimited\", \"none\"];\n for (let i = 1; i < 100; i++) { values.push(i.toString()); }\n return values;\n }", "function returnOddArray(){\n // your code here\n var arr=[];\n for(var i=1; i<256; i+=2){\n arr.push(i);\n }\n return arr\n }", "function filler(l,x){\n var arr = [];\n while(--l >= 0){\n arr.push(x);\n }\n return arr;\n}", "function create_dummy_array(numberIn){\n let dummyArray = [];\n\n for (var i = 0; i < numberIn; i++) {\n dummyArray.push(Math.floor(Math.random() * 10));\n }\n \n return dummyArray;\n}", "function PrimeValues(value) {\n let primes = [], tempArr=[];\n\n //fills an array with 'true' from 2 to the given value.\n for(let i = 2; i < value; i++) {\n primes[i] = true;\n }\n\n //work way thru array tagging primes & non-primes\n let limit = Math.sqrt(value);\n for(let i = 2; i < limit; i++) {\n if(primes[i] === true) {\n for(let j = i * i; j < value; j += i) {\n primes[j] = false;\n }\n }\n }\n\n // remove nonprimes from array.\n for(let i = 2; i < value; i++) {\n if(primes[i] === true) {\n tempArr.push(i);\n }\n }\n return tempArr;\n }", "function getPositives(ar)\n{\n temp=[]\n for(x of arr){\n if(x>=0)\n temp.push(x)\n }\n return temp\n}", "function arr(){\n var array=[]\n for(var i=1; i<=255;i++){\n array.push [i];\n }\n return array;\n}", "function euler(values) {\n result = Array();\n n = values.length-1;\n\tresult[n] = values[n];\n for(i = n; i>0; i--) {\n\tresult[i-1] = add(values[i-1], values[i]);\n }\n return result;\n}", "function myQ6(arry, num) {\r\n\tvar result = [];\r\n\tvar j = 0;\r\n\tfor (var i = 0; i < arry.length; i++) {\r\n\t\tif ((arry[i] != 0) && (arry[i] % num == 0)) {\r\n\t\t\tresult[j] = i;\r\n\t\t\tj++;\r\n\t\t}\r\n\t}\r\n\r\n\t//result = num;\r\n\treturn result;\r\n}", "function returnOddsArray1To255(){\n var array = []\n for(var i = 1; i <= 255; i+=2){\n array.push(i)\n }\n return array\n}", "function nList(init, end){\n var res = [];\n for (var i = init; i <= end; i++){\n res.push(i);\n }\n return res;\n }", "function banana(){\n var myArray = []\n for (var i = 1; i<255; i++){\n myArray.push (i)\n }\n return myArray\n}", "function beggars(values, n) {\r\n if (n === 0) {\r\n return [];\r\n }\r\n let arr = [];\r\n for (let i = 0; i < values.length; i++) {\r\n if (arr[i % n]) {\r\n arr[i % n] += values[i];\r\n } else {\r\n arr.push(values[i]);\r\n }\r\n }\r\n if (n > values.length) {\r\n arr = [...arr, ...new Array(n - values.length).fill(0)];\r\n }\r\n return arr;\r\n}", "function range(n) {\n var res = [],\n i = 1;\n while (i <= n) {\n res.push(i);\n i++;\n }\n return res;\n }", "function missingValues(arr) {\n const obj = {}\n let x;\n let y;\n arr.forEach(el=> obj[el] ? obj[el]++ : obj[el] = 1)\n console.log(obj)\n for (let key in obj){\n if (obj[key] === 1) x = parseInt(key)\n if (obj[key] === 2) y = parseInt(key)\n }\n return x * x * y\n}", "function number_list(number) {\n\n var numberList = [];\n\n for (i=1; i<=number; i++) {\n numberList.push(i);\n }\n\n return numberList;\n}", "function getArray() {\r\n var list = [];\r\n var K = 1000;\r\n for (var k = 0; k < K; k++) {\r\n list.push(k);\r\n }\r\n return list.toString();\r\n}", "function i(n=D){return[n[0],n[1],n[2],n[3],n[4],n[5]]}", "function noNegs(x) {\n for (var i=0; i<x.length; i++) {\n if (x[i]<0) {\n x[i]=0;\n }\n }\n return x;\n}", "range(_start, _end) {\n var result = []\n for (let i=_start; i<=_end; i++){\n result.push(i)\n }\n return result\n }", "function get_range(N) {\n\t let list = [];\n\t for (let i = 0; i < N; i++) {\n\t list.push(i);\n\t }\n\t return list;\n\t}", "function getDefaults() {\n let K = []\n for (let i = 0; i < 64; i++) {\n K.push(Math.floor((2 ** 32) * Math.abs(Math.sin(i + 1))))\n }\n return K\n}", "function generateNumbers(sValue, eValue){\n let numbers = [];\n\n for (let index = sValue; index <= eValue; index++) {\n numbers.push(index); \n }\n\n return numbers;\n}", "function iRange(x, n) {\n var a = [];\n var i = 0;\n for (i = x; i <= n; i++) {\n a.push(i);\n }\n return a;\n}", "function create_dummy_array(n) {\n var p = [];\n for (i = 0; i < n; i++) {\n p.push(Math.floor(Math.random() * 10));\n }\n return p;\n}", "function first(n){\n let arry = [];\n for(let i = 0; i < n; i++){\n arry[i] = i + 1;\n }\n return arry;\n}", "function arrayNo(arr) {\n let positive = [];\n for (let i = 0; i < arr.length; i++) {\n let no = arr[i];\n if (no < 0) {\n break;\n }\n else {\n positive.push(no);\n }\n\n }\n return positive;\n\n}", "function generateNumArr(limit) {\n ret = [];\n for (var i = 1; i < limit; i++) {\n ret.push(i);\n }\n \n return ret;\n }", "function doublenum() {\n let x = numArray.map(Element => Element * 2);\n return x;\n }", "function range(len) { var ret = []; for(var i = 0; i < len; i++) { ret.push(i); } return ret; }", "function oddArray(){\n var arr = [];\n for (var i=1; i<=255; i+=2){\n arr.push(i);\n }\n return arr;\n}", "function initNums(count){\n var nums=[];\n for (var i=0;i<count;i++){\n nums.push(i+1);\n }\n console.log(nums)\n}", "function makePositive(array) {\n let temparr =[]; // My container array\n for (let element of array) {\n\t\t\n \n\t if(typeof element!=='number'){\n\t\ttemparr.push(element);\n\t} else {\n\t\ttemparr.push(Math.abs(element));\n\t}\n\t\t}\n \n \n return temparr;\n}", "function createArray(value) {\n 'use strict';\n\n var array = [];\n\n for (var i = 0; i <= value; i++) {\n array.push(i * 5);\n }\n\n return array;\n}", "function getPositiveNum(array) {\n let positiveNumArray = [];\n for (let num of array) {\n if (num > 0) {\n positiveNumArray.push(num);\n }\n }\n return positiveNumArray;\n }", "function noNeg(arr){\n var positiveArr = []\n\nfor ( var i=0; i< arr.length; i++){\n if(arr[i] < 0){\n var newInd = arr[i] * 0;\n \n positiveArr.push(newInd);\n } else {\n positiveArr.push(arr[i]) \n }\n }\n \nreturn positiveArr\n}", "function range(number){\n var arrayNum = [];\n for(var current = 0; current <= number; current++){\n if (current < number){\n arrayNum[current] = current;\n }\n }\n return arrayNum;\n}", "function range(lo: number, hi: number): Array<number> {\n let a = new Array(hi - lo);\n a.fill(1);\n return a.map((e, i) => lo + i);\n}", "function negativos(array) {\n var newArray = [];\n for (var i = 0; i < array.length; i++) { \n if(array[i] > 0){\n newArray.push(array[i]*-1);\n }\n else{\n newArray.push(array[i]);\n }\n }\n\n return newArray;\n}", "range(min, max) {\n if (max < min) { return []; }\n let arr = [];\n\n for (let i = min; i <= max; i++) {\n arr.push(i);\n }\n\n return arr;\n }", "function range(x) {\r\n let intRange = new Array(x);\r\n for (let i = 0; i < x; i++) {\r\n intRange[i] = i + 1;\r\n }\r\n return intRange;\r\n}", "function zeros(x) { var r = new Array(x); for (var i = 0; i < x; ++i) { r[i] = 0; } return r; }", "function zeros(x) { var r = new Array(x); for (var i = 0; i < x; ++i) { r[i] = 0; } return r; }", "function zeros(x) { var r = new Array(x); for (var i = 0; i < x; ++i) { r[i] = 0; } return r; }", "static range(min, max){\n\n let l = [];\n for(let i=min; i < max; i++) l.push(i);\n return l;\n\n }", "function multiplies_positive_elements(a) {\n var res = [];\n var i;\n\n for (i = 0; i < a.length; i++) {\n if (a[i] > 0) {\n res[i] = a[i] * 2\n } else {\n res[i] = a[i]\n }\n }\n\n return res;\n}", "function Infinity() {}", "function evenlyDivide (value) {\n var arr=[];\n for (var i=1; i<=value; i++) {\n if (Number.isInteger(value / i)) {\n arr.push(i);\n }\n }\n return arr;\n}", "function func1(){\n var result=[];\n for(var i=1; i<=255; i++){\n result[i-1]=i;\n }\n return result;\n}", "function create_dummy_array(num){\n const arr = [];\n for(let i = 0; i < num; i++){\n arr.push(Math.floor(Math.random() * 10));\n }\n return arr;\n}", "function intList(start, end) {\n var newArray = [];\n for (var i = start; i <= end; i += 1) {\n newArray.push(i);\n\n }\n return newArray;\n}", "function i(t,e,n){var i=t.length>>>0;return e=null==e?n||0:e<0?Math.max(i+e,0):Math.min(e,i),e}", "function get1To255(){\n var output = [];\n for(var i = 0; i <= 255; i++){\n output.push(i);\n }\n return output;\n}", "function exceptI(list) {\n const product = list.reduce((sum, n) => sum * n);\n return list.map(n => product / n);\n}", "function missing(arr) {\n if (arr.length < 2) return [];\n var result = [];\n var min = arr[0];\n var max = arr[arr.length - 1];\n\n for (var i = min + 1; i < max; i++) {\n if (arr.indexOf(i) === -1) result.push(i);\n }\n return result;\n}", "function determineMissingVal(array){\n for(var i=0; i<array; i++)\n if(i + 1 !== i + 1){\n return (i + 1)\n }\n }", "function intList(start, end) {\n var newArray = [];\n for (var i = start; i <= end; i += 1) {\n newArray.push(i);\n }\n return newArray;\n}", "function zeros(n) {\n return Array.apply(null, new Array(n)).map(Number.prototype.valueOf, 0);\n}", "function r(e){for(var t=-1,i=e?e.length:0,n=[];++t<i;){var r=e[t];r&&n.push(r)}return n}", "toArray() {\n let array = []\n for (let tmp = this.min; tmp <= this.max; tmp = this._next(tmp))\n array.push(tmp);\n return array;\n }", "function oddArray(){\n var arr = [];\n for (var x = 1; x < 50; x+=2){\n arr.push(x);\n }\n return arr;\n}", "function create_dummy_array(n){\n let arr=[];\n for(let i = 0; i < n; i++){\n arr.push(Math.random()*9);\n }\n return arr;\n}", "function range(first, last){\n var ans = [first];\n while(first != last){\n ans.push[first+1];\n first += 1;\n }\n return ans;\n}", "defined(arr) {\n\n let arr2 = [];\n for (let i = 0; i < arr.length; i++) {\n if (!arr[i] && arr[i] !== 0) {\n //console.log(arr[i]);\n } else {\n arr2.push(arr[i]);\n }\n }\n return arr2;\n }", "function generazioneNumeriCasuali(numeri) {\r\n var arrayNumeri = [];\r\n\r\n while (arrayNumeri.length < numeri){\r\n var arrayNumeriTemp = Math.ceil(Math.random() * 100);\r\n if (!arrayNumeri.includes(arrayNumeriTemp)) {\r\n arrayNumeri.push(arrayNumeriTemp);\r\n }\r\n }\r\n return arrayNumeri;\r\n}", "function sequence(x,y) {\n // jika x<y => parameter x harus lebih besar dibanding y\n if (x<=y) {\n console.log(\"parameter x harus lebih besar dibanding y\");\n }else {\n var arrResult = [y];\n var c =y\n while (c>1) {\n var c= Math.pow(c,2)%x;\n x=x+1;\n arrResult.push(c);\n }\n\n console.log(\"array : \");\n console.log(arrResult);\n console.log(\"count : \"+ arrResult.length);\n }\n}", "function primesArray(input) {\n //initialising array\n let primes = [];\n //avoid returning 1 as a prime value\n let i = 2;\n\n //setting condition - total number of values returned should be equal to n\n while (primes.length < input) {\n //if i passes prime test add it to the array\n if (isPrime(i)) {\n primes.push(i);\n }\n //increment in and add 1 to i\n i += 1;\n }\n return primes;\n}", "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}", "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}", "function divizori(x) {\n let xDivs = [];\n for (let i = 2; i <= x; i++) {\n if (x % i === 0) {\n xDivs.push(i);\n }\n }\n return xDivs;\n}", "function aleatorios(limite = 1) {\n let r = []\n for (let i = 0; i < limite; i++) {\n r[i] = numeroAlAzar100()\n }\n\n return r\n \n }", "function computeRange(i,n){\n let index = -1, arr=[];\n for (;index<n;index++) {\n arr.push(i);\n }\n return arr;\n}", "function makeArray(n) {\n\tlet allNums = [];\n\twhile(n--){\n\t\tallNums.push(Math.round(Math.random() * 1000));\n\t}\n\treturn allNums;\n}" ]
[ "0.6784448", "0.67633986", "0.6424508", "0.63915807", "0.63427794", "0.623128", "0.6225784", "0.6222549", "0.6209126", "0.62045467", "0.6034835", "0.5998435", "0.5979571", "0.5965476", "0.5964587", "0.5946165", "0.59375685", "0.5924184", "0.58742857", "0.58521545", "0.5851373", "0.5851327", "0.5822073", "0.5809553", "0.58047074", "0.58008206", "0.57901156", "0.5785647", "0.5772148", "0.57601726", "0.575249", "0.57450116", "0.5741837", "0.57399344", "0.57246286", "0.57237595", "0.5723305", "0.57204276", "0.5720163", "0.57175696", "0.57139164", "0.57098126", "0.5699949", "0.56931984", "0.5682831", "0.56812036", "0.5678433", "0.56746256", "0.5674277", "0.56672174", "0.56567365", "0.565443", "0.5619254", "0.5617955", "0.56128854", "0.5612438", "0.5610609", "0.5610239", "0.5608799", "0.5607481", "0.5607467", "0.5602886", "0.56010884", "0.5597417", "0.5594469", "0.55923694", "0.55918616", "0.5584566", "0.55832446", "0.5580804", "0.5580804", "0.5580804", "0.55760837", "0.55718476", "0.55697954", "0.55680686", "0.55628747", "0.5559816", "0.5557847", "0.555741", "0.5556787", "0.55513823", "0.553994", "0.55350256", "0.5521819", "0.55135876", "0.5511019", "0.5502799", "0.5502504", "0.54912895", "0.5491106", "0.54906726", "0.5480027", "0.547974", "0.5477263", "0.54756767", "0.54756767", "0.54681593", "0.5467391", "0.54640585", "0.5461886" ]
0.0
-1
[1, 3, 6, 8, 11], [2, 3, 5, 8, 9, 10]
function merge(array1, array2) { let newArray = []; const lengths = array1.length + array2.length; for (let i = 0; i < lengths; i++) { (array1[0] > array2[0]) ? newArray.push(array2.shift()) : newArray.push(array1.shift()); } return newArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function test() {\n var arr = [];\n arr[0] = [1, 2, 3, 4, 5];\n arr[1] = [1, 2, 3, 4, 5];\n arr[2] = [1, 2, 3, 4, 5];\n arr[3] = [1, 2, 3, 4, 5];\n arr[4] = [1, 2, 3, 4, 5];\n arr[5] = [1, 2, 3, 4, 5];\n arr[6] = [1, 2, 3, 4, 5];\n arr[7] = [1, 2, 3, 4, 5];\n arr[8] = [1, 2, 3, 4, 5];\n arr[9] = [1, 2, 3, 4, 5];\n arr[10] = [1, 2, 3, 4, 5];\n arr[11] = [1, 2, 3, 4, 5];\n arr[12] = [1, 2, 3, 4, 5];\n arr[13] = [1, 2, 3, 4, 5];\n arr[14] = [1, 2, 3, 4, 5];\n arr[15] = [1, 2, 3, 4, 5];\n arr[16] = [1, 2, 3, 4, 5];\n arr[17] = [1, 2, 3, 4, 5];\n arr[18] = [1, 2, 3, 4, 5];\n arr[19] = [1, 2, 3, 4, 5];\n arr[20] = [1, 2, 3, 4, 5];\n arr[21] = [1, 2, 3, 4, 5];\n arr[22] = [1, 2, 3, 4, 5];\n arr[23] = [1, 2, 3, 4, 5];\n arr[24] = [1, 2, 3, 4, 5];\n arr[25] = [1, 2, 3, 4, 5];\n arr[26] = [1, 2, 3, 4, 5];\n arr[27] = [1, 2, 3, 4, 5];\n arr[28] = [1, 2, 3, 4, 5];\n arr[29] = [1, 2, 3, 4, 5];\n arr[30] = [1, 2, 3, 4, 5];\n arr[31] = [1, 2, 3, 4, 5];\n arr[32] = [1, 2, 3, 4, 5];\n arr[33] = [1, 2, 3, 4, 5];\n\n for (var i = 0; i < 32; i++) {\n arr[i][0] = 0; // Conversion of copy-on-access array should be transparent\n }\n}", "function findAllIncreasingSubArr(numberList) {\n if (!Array.isArray(numberList) || numberList.length <= 1) return [];\n let newArray = [];\n const newResult = [];\n for (let index = 0; index < numberList.length; index++) {\n if (newArray.length > 0 && numberList[index] >= numberList[index + 1]) {\n newArray.push(numberList[index]);\n newResult.push(newArray);\n newArray = [];\n } else if (index === numberList.length - 1 && newArray.length > 1) {\n if (numberList[index] > numberList[index - 1])\n newArray.push(numberList[index]);\n newResult.push(newArray);\n } else {\n newArray.push(numberList[index]);\n }\n }\n // return newResult;\n return newResult.filter((x) => x.length > 2);\n}", "function combine() {\n let arr = [].concat.apply([], arguments); //[1, 2, 2, 2, 3, 3]没有去重复的新数组 \n return Array.from(new Set(arr));//new Set(arr): Set(3) {1, 2, 3}\n}", "function subSets(arr, n){\n if( arr.length <=3 )return arr;\n let result = [];\n result.push([]);\n \n arr.forEach(function (item){\n let len = result.length;\n for(let i=0; i<len; i++){\n let newArr =result[i].slice(0);\n\n newArr.push(item);\n result.push(newArr)\n }\n})\n return result.filter(elem => elem.length ===n)\n }", "function twoNElements(nums, n) {\n let finalArray = [];\n let j = n;\n for(var i = 0; i < n; i++){\n finalArray.push(nums[i], nums[j]);\n j++;\n }\n return finalArray;\n}", "function indexMultiple (a1) {\n let newArray = []\n a1.forEach((item, i) => {if(item%i===0){newArray.push(item)}});\n return newArray\n}", "function pairInArray(array) {\n let result = [];\n for (let i = 0; i < array.length; i++) {\n for (let j = i + 1; j < array.length; j++) {\n if (array[i] + array[j] === 10) {\n let arr = [array[i], array[j]];\n result.push(arr);\n }\n }\n }\n return result;\n}", "function unite(arr1, arr2, arr3) {\n newArray = [];\n \n for (var i = 0; i < arguments.length; i++) {\n var arrLength = arguments[i];\n \n for (var j = 0; j < arrLength.length; j++) {\n var indexValue = arrLength[j];\n\n while (newArray.indexOf(indexValue) < 0) {\n newArray.push(indexValue);\n }\n }\n }\n \n return newArray;\n}", "function three(nums, target) {\n // store count of how many times a triplet sum is less than target number\n // sort array\n // iterate through array stopping 2 numbers before end\n}", "function splitArray(arr,count){var newArray=[];arr=arr.map(function(el,index){el.position=index+1;return el;});while(arr.length>0){newArray.push(arr.splice(0,count));}return newArray;}", "function forTask8(set){\n let arr = [];\n for(let item of set){\n if(item % 2 == 0){\n arr.push(item);\n }\n }\n return arr;\n}", "function choose3(inputArr) {\n var len = inputArr.length;\n \n function combine(arr) {\n var cur = [];\n var result = [];\n\n for (var i = 0; i < len; i++) {\n for (var j = i + 1; j < len; j++) {\n for (var h = j + 1; h < len; h++) {\n cur = [arr[i], arr[j], arr[h]];\n result.push(cur);\n }\n }\n }\n return result;\n }\n\n return combine(inputArr);\n}", "function find() {\n var array = [4, 6, 9, 7, 5].sort();\n var max = array[array.length - 1]\n var min = array[0]\n var newAr =Array.of(max,min)\n \n\n return newAr;\n}", "function completeSeries(arr) {\n\tlet output = [];\n\tconst max = Math.max(...arr);\n\tconst set = [...new Set(arr)];\n\tif (set.length !== arr.length) {\n\t\treturn [0];\n\t} else {\n\t\tlet i = 0;\n\t\twhile (i <= max) {\n\t\t\toutput.push(i);\n\t\t\ti++;\n\t\t}\n\t\treturn output;\n\t}\n}", "function nList(init, end){\n var res = [];\n for (var i = init; i <= end; i++){\n res.push(i);\n }\n return res;\n }", "function chunkArrays(arr) {\n let newArray = [];\n let newSubArray = [];\n\n for (i = 0; i < arr.length; i++) {\n // newSubArray.push(arr[i]);\n if (arr[i] === arr[i + 1]) {\n newSubArray.push(arr[i]);\n console.log(`Found a match arr[${i}]: ${arr[i]}, newSubArray is now: ${newSubArray}`);\n } else {\n newSubArray.push(arr[i]);\n if (newSubArray.length <= 1) {\n newArray.push(arr[i]);\n } else {\n newArray.push(newSubArray);\n }\n newSubArray = [];\n }\n }\n\n return newArray;\n}", "function findAllDecreasingSubArr(numberList) {\n if (!Array.isArray(numberList) || numberList.length <= 1) return [];\n let newArray = [];\n const newResult = [];\n for (let index = 0; index < numberList.length; index++) {\n if (newArray.length > 0 && numberList[index] < numberList[index + 1]) {\n newArray.push(numberList[index]);\n newResult.push(newArray);\n newArray = [];\n } else if (index === numberList.length - 1 && newArray.length > 1) {\n if (numberList[index] > numberList[index - 1])\n newArray.push(numberList[index]);\n newResult.push(newArray);\n } else {\n newArray.push(numberList[index]);\n }\n }\n return newResult.filter((x) => x.length > 2);\n}", "function repeats(arr){\n var arrRepeted = arr.filter ((v,i,a) => a.indexOf(v) < i);\n return arr.filter(el => !(arrRepeted).includes(el)).reduce((a, b) => a + b);\n}", "function lis (arr) {\n\tvar d = []\n\tlet len = 1;\n\tlet target = [];\n\tfor (let i = 0; i < arr.length; i++) {\n\t\td[i] = [arr[i]];\n\t\tfor (let j = i - 1; j >= 0; j--) {\n\t\t\tif (d[j][0] <= d[i] && j < i) {\n\t\t\t\td[j].forEach(item => {\n\t\t\t\t\td[i].push(item)\n\t\t\t\t})\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (d[i].length > len) {\n\t\t\tlen = d[i].length;\n\t\t\ttarget = d[i]\n\t\t}\n\t}\n\treturn target.reverse();\n}", "function choose2(inputArr) {\n var len = inputArr.length;\n \n function combine(arr) {\n var cur = [];\n var result = [];\n\n for (var i = 0; i < len; i++) {\n for (var j = i + 1; j < len; j++) {\n cur = [arr[i], arr[j]];\n result.push(cur);\n }\n }\n return result;\n }\n\n return combine(inputArr);\n}", "function subsets(arr){\n if(arr.length === 1) {\n return arr;\n } else if (arr.length === 2) {\n let newArr = [];\n let copiedArr = arr.slice(0);\n\n let subOne = [copiedArr[0]]\n let subTwo = [copiedArr[0], copiedArr[1]];\n let subThree = [copiedArr[1], copiedArr[0]];\n let subFour = [copiedArr[1]];\n\n newArr.push(subOne);\n newArr.push(subTwo);\n newArr.push(subThree);\n newArr.push(subFour);\n return newArr;\n }\n}", "function s (mini, maxi){\n\tvar indexes=[]\n\tvar ar=[];\n\tfor (var i = 0; i<mini.length; i++){\n\t\tvar arr3Main = filter(maxi, function(arr){\n\t\t\treturn arr.length === mini[i].length;\n\t\t});\n\t\t//console.log (arr3Main);\n\t\tar.push(arr3Main.length);\n\t\tn (mini[i],arr3Main, function (i){\n\t\t\tindexes.push(i)\n\t\t})\n\t\t\n\t}\n\t//console.log(ar)\n\tfor(var i = 1; i<indexes.length; i++){\n\t\tfor (var j = 0; j<i; j++){\n \tif(indexes[i]!==-1){\n \t\tindexes[i]+=ar[j]\n \t}\n \t\t//console.log(arr2s[x[i]])\n \t\t//confirm(\"Did you want to add \"++ \"?\")\n \t\n \t}\n }\n\treturn indexes;\n}", "getConsectiveRanges(list){\n\n let left = 0, right = 0 , result= [];\n \n for(let i=1; i <= list.length; i++){\n if(list[i] == list[right] || list[right]+1 == list[i]){\n right++;\n }else{\n\n result.push([list[left],list[right]]);\n left=right+1;\n right+=1;\n\n }\n }\n\n return result;\n\n }", "function everyOther(numbers) {\n let everyOtherNumbers = [];\n for (let i = 0; i < numbers.length; i += 2) {\n everyOtherNumbers.push(numbers[i]);\n }\n return everyOtherNumbers;\n}", "function icecreamParlor(m, arr) {\n for (let i = 0; i < arr.length - 1; i++) {\n for (let j = i+1; j < arr.length ; j++) {\n if (arr[i] + arr[j] == m) return [i+1, j+1]\n }\n }\n}", "function list(head,tail){return[head].concat(tail);}", "function combineNum(num1, num2) {\n finalArray = [];\n additionArray = [];\n for (var i = num1; i < num2; i++) {\n for (var j = i + 1; j < num2 + 1; j++) {\n if (i !== j) {\n additionArray[additionArray.length] = i;\n additionArray[additionArray.length] = j;\n finalArray[finalArray.length] = additionArray;\n additionArray = [];\n\n additionArray[additionArray.length] = j;\n additionArray[additionArray.length] = i;\n finalArray[finalArray.length] = additionArray;\n additionArray = [];\n }\n }\n }\n return finalArray;\n}", "function chunkArrayInGroups(arr, size){\n // write code here.\n var kq=[],j=1,temp=[];\n \n for(var i=0;i<arr.length;i++)\n {\n if(j<=size){\n temp.push(arr[i]);\n j++;\n }\n if(j>size||i==arr.length-1){\n j=1;\n kq.push(temp);\n temp=[];\n }\n }\n return kq;\n}", "function findMultiples(int,limit){\n let result = []\n \n for (let i = int; i<=limit ; i+=int)\n result.push(i)\n \n return result\n}", "function duplicarCuadrado(n) {\n return [n*n, n*n];\n}", "function multirand(n){\n return arr.push(rand10(10))\n}", "function subsets(arr) {\n let results = [];\n\n if (arr.length < 1) return [[]]\n\n for (let i = 0; i < arr.length; i++) {\n for (let j = 0; j < arr.length; j++) {\n let sub = arr.slice(i, j+1);\n\n results.push(sub)\n }\n }\n return results.sort();\n}", "function subsets(arr) {\n if (arr.length <= 1) {\n return [arr];\n } else {\n const prevSets = subsets(arr.slice(0, arr.length - 1));\n let newEl = arr[arr.length - 1];\n const newSets = prevSets.map( set => {\n let copy = set.slice();\n copy.push(newEl);\n return copy;\n });\n\n return prevSets.concat(newSets).concat([[newEl]]);\n }\n}", "function sumOfSelves(arr){\n//for each array element, sum itself plus the preceeding elements\n//add that new sum to a new array\n let result=arr;\n for (let i=arr.length-1;i<arr.length;i--){\n result[i]=(arr[i)\n }\n\n console.log(\"#12: \"+result);\n}", "function arrayIntersection(arrs) {\n var LinkedArray = function (a) {\n var array = a;\n var index = 0;\n\n return {\n getCurrent: function () {\n return array[index];\n },\n incrementIndex: function (maxValue) {\n if (array[index] && (array[index] < maxValue)) {\n index++;\n console.log('incrementing index', index);\n }\n return array[index];\n },\n isLast: function () {\n return array.length <= index;\n }\n }\n };\n\n function theEnd(linkedArrays) {\n for (var i in linkedArrays) {\n if (!linkedArrays[i].isLast()) return false;\n }\n return true;\n }\n\n function allEqual(linkedArrays) {\n var value = linkedArrays[0].getCurrent();\n for (var i in linkedArrays) {\n if (linkedArrays[i].getCurrent() != value) return false;\n }\n return true;\n }\n\n // od ovde pocit jakoto\n\n arrs = _.map(arrs, function (arr) {\n return new LinkedArray(arr);\n });\n\n var results = [];\n while (!theEnd(arrs)) {\n if (allEqual(arrs)) results.push(arrs[0].getCurrent());\n var maximum = _.max(arrs, function (arr) {\n return arr.getCurrent();\n });\n maximum = maximum.getCurrent();\n\n _.each(arrs, function (arr) {\n arr.incrementIndex(maximum);\n })\n }\n return results;\n}", "function seven(){\n var newArray = [];\n for(var i = 1; i < 50; i+=2){\n newArray.push(i);\n }\n return newArray;\n}", "function multiplesOfThree(arr) {\n let result = [];\n each(arr, function(num) {\n num % 3 === 0 ? result.push(num) : undefined;\n });\n return result;\n}", "function ArrayNotByThree (param){\n let total = []\n for (let i = 0; i < param.length; i++){\n if (param[i] % 3 > 0){\n total.push(param[i])\n }\n } return total \n}", "function evenElementsList(arr){\r\n newArr = [];\r\n for(var i=0; i<arr.length; i++){\r\n if(arr[i]%2===0){\r\n newArr.push(arr[i]);\r\n }\r\n }\r\n return newArr;\r\n}", "function nTimesArray(n, array){\n\tvar result = [];\n\tfor(var i = 0; i < n;i++){\n\t\tresult = result.concat(array);\n\t}\n\treturn result;\n}", "function fn(arr) {\n let\n return arr.reduce((pre, cur, index, arr) => {\n for (let i = 0; i < cur.length; i++) {\n for (let j = index; j < )\n }\n return pre\n }, [])\n}", "function icecreamParlor(m, arr) {\n let result = [];\n let breakCondition = false;\n for (let i = 0; i < arr.length; i++) {\n for (let j = 0 ; j < arr.length; j++) {\n if (i !== j && arr[i] + arr[j] === m) {\n result.push(i+1);\n result.push(j+1);\n breakCondition = true;\n break;\n }\n }\n if (breakCondition) break;\n }\n return result;\n}", "function r(e,t){if(!Array.isArray(t))return e.slice();for(var n=t.length,r=e.length,o=-1,i=[];++o<r;){for(var a=e[o],s=!1,c=0;c<n;c++){if(a===t[c]){s=!0;break}}!1===s&&i.push(a)}return i}", "function partition(collection,fn){var result={lhs:[],rhs:[]};_.forEach(collection,function(value){if(fn(value)){result.lhs.push(value)}else{result.rhs.push(value)}});return result}", "function multiSelect(arr, left, right, n, compare) {\n var stack = [left, right],\n mid;\n\n while (stack.length) {\n right = stack.pop();\n left = stack.pop();\n\n if (right - left <= n) continue;\n\n mid = left + Math.ceil((right - left) / n / 2) * n;\n select(arr, left, right, mid, compare);\n\n stack.push(left, mid, mid, right);\n }\n }", "function multiFour (arr)\n{\nvar four = arr.filter ( x => x%4===0 )\n\nreturn four;\n}", "function Multiset(arr, arr2){ \n temp = []\n index = 0\n for (i=0;i<arr.length;i++){ \n for (j=index;j<arr.length;j++){\n\n if (arr[i] == arr2[j]){\n console.log(arr[i])\n temp += arr[i]\n index = j+1\n }\n }\n \n }\n return temp\n }", "function intList(start, end) {\n var newArray = [];\n for (var i = start; i <= end; i += 1) {\n newArray.push(i);\n\n }\n return newArray;\n}", "function first(x,y=1)\r\n{ \r\n var temp=[] ;\r\n for(let i=0;i<y;i++)\r\n { if(i>=x.length)\r\n break ;\r\n temp.push(x[i]) ;\r\n }\r\n return temp ;\r\n}", "function makeSubSets(arr) {\n\n let sub = [];\n let index = 0;\n if (arr.length >= 3) {\n for (let i = 0; i <= arr.length - 3; i++)\n {\n for (let j = i + 1; j < arr.length - 1; j++)\n {\n for (let k = j + 1; k < arr.length; k++)\n {\n sub[index] = [];\n sub[index].push(arr[i]);\n sub[index].push(arr[j]);\n sub[index].push(arr[k]);\n index++;\n }\n\n }\n\n }\n\n }\n else sub = arr;\n\n return sub;\n}", "function 3sum (array) {\nlet arr = []\n\nfor (let i = 0; i < data.length - 2; i++) {\n for (let j = i + 1; j < data.length - 1; j++) {\n for (let k = j + 1; k < data.length; k++) {\n const set = [data[i], data[j], data[k]]\n if (data[i] + data[j] + data[k] === number && arr.indexOf(set) === -1) {\n arr.push([data[i], data[j], data[k]])\n }\n }\n }\n }\n return arr\n}", "function partition(p, xs) {\n return xs.reduce(function (a, x) {\n return (\n a[p(x) ? 0 : 1].push(x),\n a\n );\n }, [[], []]);\n }", "function intList(start, end) {\n var newArray = [];\n for (var i = start; i <= end; i += 1) {\n newArray.push(i);\n }\n return newArray;\n}", "function p(a){\n// Give preference to elements with certain criteria, so they have\n// a chance to be closer to the top.\na.sort(ya);for(var b=[],c=0;c<a.length;c++){\n// loop through subrows, starting with the topmost, until the segment\n// doesn't collide with other segments.\nfor(var d=a[c],e=0;e<b.length&&wa(d,b[e]);e++);\n// `j` now holds the desired subrow index\nb[e]?b[e].push(d):b[e]=[d]}return b}", "function choose(xs, n) {\n if (n > 1) {\n var result = [];\n choose(xs.slice(1), n - 1).forEach(function(c) {\n result.push([xs[0]].concat(c));\n result.push(c.concat([xs[0]]));\n });\n return result;\n } else {\n return xs.map(function(x) { return [x]; });\n }\n}", "function c(i, l) {\n i = this.length - i;\n for (l += i; i < l; i++) {\n this.push(this[i]);\n }\n}", "function c(i, l) {\n i = this.length - i;\n for (l += i; i < l; i++) {\n this.push(this[i]);\n }\n}", "function mapDupliactesInArray(list){\n var uniqueArray = [];\n var duplicatesArray=[];\n\n for (var i=0; i<list.length; i++){\n if(uniqueArray.indexOf(list[i])<0){\n uniqueArray.push(list[i]);\n }else if (duplicatesArray.indexOf(list[i])<0){\n duplicatesArray.push(list[i])\n }\n }\n return [uniqueArray, duplicatesArray];\n}", "function everyThird(array){\n newArray= []\n for (var i = 2; i<array.length ; i+=3){\n newArray.push(array[i])\n }\n return newArray\n}", "function addExtra( listOfNumbers ){\n var finalList = [];\n for (var i = 0; i <= listOfNumbers.length; i++){\n finalList.push(listOfNumbers[i]);\n }\n return finalList;\n}", "function sliceArray(list, n, m) {\n let result = [];\n for (let i = 0; i < list.length; i++) {\n let el = list[i];\n if (i >= n && i < m) {\n result.push(el);\n }\n }\n\n return result;\n}", "function missing(arr) {\n if (arr.length < 2) return [];\n var result = [];\n var min = arr[0];\n var max = arr[arr.length - 1];\n\n for (var i = min + 1; i < max; i++) {\n if (arr.indexOf(i) === -1) result.push(i);\n }\n return result;\n}", "function contiguousSeq(arr) {\n\n}", "function subsets2(nums) {\n let res = [];\n\n function find(curr, rest, start) {\n res.push(curr);\n for (let i = start; i < rest.length; i++) {\n //console.log(...rest.slice(0, i))\n find(\n [...curr, rest[i]], [...rest.slice(0, i), ...rest.slice(i + 1)],\n start\n );\n start++;\n }\n }\n\n find([], nums, 0);\n\n return res;\n}", "function addSeven2Most(arr) {\n var newArr = [];\n for (i=1; i<arr.length; i++) {\n newArr.push(arr[i]+7);\n }\n return newArr;\n}", "function sumListsForwardOrder(list1, list2){ //FORWARD ORDER IMPLEMENTATION\n\n}", "function W3quicks(a,l , r) \n{ \n if (r <= l) return; \n let i;\n let j; \n // Note that i and j are passed as reference \n partition(a, l, r, i, j); \n // Recur \n quicksort(a, l, j); \n quicksort(a, i, r); \n}", "function multiSelect(arr, left, right, n, compare) {\n var stack = [left, right],\n mid;\n\n while (stack.length) {\n right = stack.pop();\n left = stack.pop();\n\n if (right - left <= n) continue;\n\n mid = left + Math.ceil((right - left) / n / 2) * n;\n quickselect(arr, mid, left, right, compare);\n\n stack.push(left, mid, mid, right);\n }\n}", "function multiSelect(arr, left, right, n, compare) {\n var stack = [left, right],\n mid;\n\n while (stack.length) {\n right = stack.pop();\n left = stack.pop();\n\n if (right - left <= n) continue;\n\n mid = left + Math.ceil((right - left) / n / 2) * n;\n quickselect(arr, mid, left, right, compare);\n\n stack.push(left, mid, mid, right);\n }\n}", "function multiSelect(arr, left, right, n, compare) {\n var stack = [left, right],\n mid;\n\n while (stack.length) {\n right = stack.pop();\n left = stack.pop();\n\n if (right - left <= n) continue;\n\n mid = left + Math.ceil((right - left) / n / 2) * n;\n quickselect(arr, mid, left, right, compare);\n\n stack.push(left, mid, mid, right);\n }\n}", "function multiSelect(arr, left, right, n, compare) {\n var stack = [left, right],\n mid;\n\n while (stack.length) {\n right = stack.pop();\n left = stack.pop();\n\n if (right - left <= n) continue;\n\n mid = left + Math.ceil((right - left) / n / 2) * n;\n quickselect(arr, mid, left, right, compare);\n\n stack.push(left, mid, mid, right);\n }\n}", "function multiSelect(arr, left, right, n, compare) {\n var stack = [left, right],\n mid;\n\n while (stack.length) {\n right = stack.pop();\n left = stack.pop();\n\n if (right - left <= n) continue;\n\n mid = left + Math.ceil((right - left) / n / 2) * n;\n quickselect(arr, mid, left, right, compare);\n\n stack.push(left, mid, mid, right);\n }\n}", "function multiSelect(arr, left, right, n, compare) {\n var stack = [left, right],\n mid;\n\n while (stack.length) {\n right = stack.pop();\n left = stack.pop();\n\n if (right - left <= n) continue;\n\n mid = left + Math.ceil((right - left) / n / 2) * n;\n quickselect(arr, mid, left, right, compare);\n\n stack.push(left, mid, mid, right);\n }\n}", "function multiSelect(arr, left, right, n, compare) {\n var stack = [left, right],\n mid;\n\n while (stack.length) {\n right = stack.pop();\n left = stack.pop();\n\n if (right - left <= n) continue;\n\n mid = left + Math.ceil((right - left) / n / 2) * n;\n quickselect(arr, mid, left, right, compare);\n\n stack.push(left, mid, mid, right);\n }\n}", "function arrayManipulation(n, queries) {\n\n\n}", "function arrayPares2(arreglo) {\n let aux = arreglo.pop();\n if (aux % 2 == 0) {\n arreglo.unshift(aux); //pongo adelante del arreglo el ultimo elemento del arreglo si es par\n }\n aux = arreglo.pop();\n if (aux % 2 == 0) {\n arreglo.unshift(aux); //pongo adelante del arreglo el ultimo elemento del arreglo si es par\n }\n aux = arreglo.pop();\n if (aux % 2 == 0) {\n arreglo.unshift(aux); //pongo adelante del arreglo el ultimo elemento del arreglo si es par\n }\n aux = arreglo.pop();\n if (aux % 2 == 0) {\n arreglo.unshift(aux); //pongo adelante del arreglo el ultimo elemento del arreglo si es par\n }\n return arreglo;\n}", "function slasher(arr, howMany) {\n // it doesn't always pay to be first\n return arr;\n}", "function chunkArrayInGroups(arr, size) {\r\n\tvar chuncks = [];\r\n\tfor (var i = 0; i < arr.length; i += size) {\r\n\t\tvar set = [];\r\n\t\tfor (var j = 0; j < size; j++) {\r\n\t\t\tif (i + j < arr.length) {\r\n\t\t\t\tset.push(arr[i + j]);\r\n\t\t\t} else {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tchuncks.push(set);\r\n\t}\r\n\treturn chuncks;\r\n}", "function intList(start, end) {\n var newArray = [];\n for (var i = start; i <= end; i += 2) {\n newArray.push(i);\n console.log(i);\n }\n return newArray;\n}", "function frankenSplice(arr1, arr2, n) {\n return arr2;\n}", "function multiSelect(arr, left, right, n, compare) {\n var stack = [left, right],\n mid;\n \n while (stack.length) {\n right = stack.pop();\n left = stack.pop();\n \n if (right - left <= n) continue;\n \n mid = left + Math.ceil((right - left) / n / 2) * n;\n quickselect(arr, mid, left, right, compare);\n \n stack.push(left, mid, mid, right);\n }\n }", "function stitch(list1, list2) {\n const result = []\n\n while (list1.length && list2.length) {\n if (list1[0] <= list2[0]) { result.push(list1.shift()) } else { result.push(list2.shift()) }\n }\n\n return result.concat(list1, list2)\n}", "function multiSelect(arr, left, right, n, compare) {\n const stack = [left, right];\n\n while (stack.length) {\n right = stack.pop();\n left = stack.pop();\n\n if (right - left <= n) continue;\n\n const mid = left + Math.ceil((right - left) / n / 2) * n;\n quickselect(arr, mid, left, right, compare);\n\n stack.push(left, mid, mid, right);\n }\n}", "function frankenSplice(arr1, arr2, n) {\n let arr3 = arr2.slice(0,n);\n for (let i=0;i < arr1.length; i++) {\n arr3.push(arr1[i]);\n }\n for (let i=n;i < arr2.length; i++) {\n arr3.push(arr2[i]);\n }\n return arr3;\n}", "function makeListFromRange(arr) {\n\tlet newArr = [];\n\tfor (let i = arr[0]; i <= arr[1]; i++) {\n\t\tnewArr.push(i);\n\t}\n\treturn newArr;\n}", "function getSubsets(arr){\r\n\t\t\r\n\tlet arrSubsets = [];\r\n\t\r\n\tlet m = 0;\r\n\r\n\tif(arr.length >= 3){\r\n\t\t\r\n\t\tfor( let i = 0; i <= arr.length - 3; i++){\r\n\t\t\t\r\n\t\t\tfor( let j = i + 1; j < arr.length - 1; j++){\r\n\t\t\t\r\n\t\t\t\tfor( let k = j + 1 ; k < arr.length; k++){\r\n\t\t\t\t\t\r\n\t\t\t\t\tarrSubsets[m] = [];\r\n\t\t\t\t\tarrSubsets[m].push(arr[i]);\r\n\t\t\t\t\tarrSubsets[m].push(arr[j]);\r\n\t\t\t\t\tarrSubsets[m].push(arr[k]);\r\n\r\n\t\t\t\t\tm++;\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\r\n\t}\t\r\n\t\r\n\telse arrSubsets=arr;\r\n\r\n\treturn arrSubsets;\r\n\r\n}", "function twoSmallest(numbers) {\n var smallestIndex = 0;\n var smallest = numbers[smallestIndex];\n var i = 0;\n while (i < numbers.length) {\n if (numbers[i] < smallest) {\n smallest = numbers[i];\n smallestIndex = i;\n }\n i++;\n }\n numbers.splice(smallestIndex, 1);\n i = 0;\n var secondSmallest = numbers[i];\n while (i < numbers.length) {\n if (numbers[i] < secondSmallest) {\n secondSmallest = numbers[i];\n }\n i++;\n }\n return [smallest, secondSmallest];\n}", "function multiSelect(arr, left, right, n, compare) {\n\t var stack = [left, right],\n\t mid;\n\n\t while (stack.length) {\n\t right = stack.pop();\n\t left = stack.pop();\n\n\t if (right - left <= n) continue;\n\n\t mid = left + Math.ceil((right - left) / n / 2) * n;\n\t select(arr, left, right, mid, compare);\n\n\t stack.push(left, mid, mid, right);\n\t }\n\t}", "function multiSelect(arr, left, right, n, compare) {\n\t var stack = [left, right],\n\t mid;\n\n\t while (stack.length) {\n\t right = stack.pop();\n\t left = stack.pop();\n\n\t if (right - left <= n) continue;\n\n\t mid = left + Math.ceil((right - left) / n / 2) * n;\n\t select(arr, left, right, mid, compare);\n\n\t stack.push(left, mid, mid, right);\n\t }\n\t}", "function multiSelect(arr, left, right, n, compare) {\n\t var stack = [left, right],\n\t mid;\n\n\t while (stack.length) {\n\t right = stack.pop();\n\t left = stack.pop();\n\n\t if (right - left <= n) continue;\n\n\t mid = left + Math.ceil((right - left) / n / 2) * n;\n\t select(arr, left, right, mid, compare);\n\n\t stack.push(left, mid, mid, right);\n\t }\n\t}", "function looper (len) {\n\tvar results = [];\n\tfor (var i = 0; i < len -1; i+=2){\n\t\tresults.push(i);\n\t};\n\treturn results.map(function(element){\n\t\treturn element * 3;\n\t})\n}", "function arrAdd(arr){\n var maxNum = Math.max(...arr);\n arr.splice(arr.indexOf(maxNum),1);\n var sets = [[]];\n \n for(var i = 0; i < arr.length; i++){\n var len = sets.length;\n for(var j = 0; j < len; j++){\n var group = sets[j].concat(arr[i]);\n sets.push(group);\n\n var total = group.reduce(function(all, item){\n return all + item;\n });\n if(total === maxNum){\n return true;\n }\n }\n }\n return false;\n}", "function frankenSplice(arr1, arr2, n) {\n\n return;\n}", "function filter_list(l) {\n let nums = Array(1000).fill().map((e,i)=>i+1);\n nums.push(0);\n let result = [];\n for(let i=0; i<l.length; i++){\n if(nums.includes(l[i])){\n result.push(l[i])\n }\n }\n return result;\n}", "function multiSelect$1(arr, left, right, n, compare) {\n var stack = [left, right],\n mid;\n\n while (stack.length) {\n right = stack.pop();\n left = stack.pop();\n\n if (right - left <= n) continue;\n\n mid = left + Math.ceil((right - left) / n / 2) * n;\n quickselect$1(arr, mid, left, right, compare);\n\n stack.push(left, mid, mid, right);\n }\n}", "function findUniques(a){\n let result = []\n for (num of a){\n let match = false;\n for (unum of result){\n if (num == unum){\n match = true;\n }\n }\n if (!match){\n result.push(num);\n }\n }\n return result;\n}", "function equalizeArray(numbers) {\n const counts = getEntryCounts(numbers);\n\n const maxCount = counts.reduce((total, count) => Math.max(total, count));\n\n return numbers.length - maxCount;\n}", "function arrayConsoladation(arr) {\n let intArr = [];\n let counter = 0;\n while (arr[counter] !== undefined) {\n let integer = arr[counter];\n if (arr[counter] !== 0) {\n let index = arr.indexOf(integer);\n intArr.push(...arr.splice(index, 1));\n counter = 0;\n }\n counter++;\n }\n\n let consolidatedArray = [...intArr, ...arr];\n console.log(consolidatedArray);\n}", "function n(t,e){if(!Array.isArray(e))return t.slice();for(var r=e.length,n=t.length,i=-1,o=[];++i<n;){for(var a=t[i],u=!1,s=0;s<r;s++){if(a===e[s]){u=!0;break}}!1===u&&o.push(a)}return o}", "function ma(a){var b,c,d,e=[];for(b=0;b<a.length;b++)for(c=a[b],d=0;d<c.length;d++)e.push(c[d]);return e}", "function increaseNumbers(num1,num2, num3) {\n if(num1>num2 &&num1>num3 && num2>num3) {\n return ([num1,num2,num3])\n } else if (num1>num2 &&num1>num3 && num3>num2) {\n return ([num1,num3,num2]);\n } else if (num2>num1 &&num2>num3 && num1>num3) {\n return ([num2,num1,num3]);\n } else if (num2>num1 &&num2>num3 && num3>num1) {\n return ([num2,num3,num1]);\n } else if (num3>num1 &&num3>num2 && num1>num2) {\n return ([num3,num1,num2]);\n } else {\n return ([num3, num2, num1])\n }\n}" ]
[ "0.57144004", "0.5660034", "0.56201154", "0.5613612", "0.5558231", "0.554691", "0.54856217", "0.548562", "0.54820263", "0.5437023", "0.54198307", "0.54141223", "0.5402316", "0.53890705", "0.53593963", "0.53589123", "0.5357243", "0.53563535", "0.5341555", "0.5319725", "0.5314864", "0.53104407", "0.5304225", "0.5301844", "0.5292472", "0.52865875", "0.52699775", "0.5269066", "0.5259591", "0.5244146", "0.5239798", "0.52397454", "0.52303445", "0.5227296", "0.52272093", "0.5223814", "0.52165246", "0.52150875", "0.5204641", "0.5204443", "0.5197702", "0.51973236", "0.5195305", "0.51939803", "0.5192938", "0.51923", "0.5191395", "0.5185274", "0.5184818", "0.51829886", "0.51746756", "0.5170378", "0.5167974", "0.51660883", "0.5165497", "0.5165232", "0.5165232", "0.51637167", "0.51625013", "0.51619893", "0.51585907", "0.51517016", "0.5150975", "0.51457983", "0.5142939", "0.5142618", "0.514123", "0.51369715", "0.51369715", "0.51369715", "0.51369715", "0.51369715", "0.51369715", "0.51369715", "0.51347953", "0.51326966", "0.5132609", "0.51313114", "0.51290023", "0.5124983", "0.5124532", "0.5124151", "0.51214975", "0.511977", "0.5117757", "0.5115385", "0.5112818", "0.5111801", "0.5111801", "0.5111801", "0.5111473", "0.5109394", "0.5109025", "0.51061964", "0.51050836", "0.50951827", "0.50944006", "0.50913554", "0.50900155", "0.50873244", "0.50865215" ]
0.0
-1
The height of your card. Home Assistant uses this to automatically distribute all cards over the available columns.
getCardSize() { return 3 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setCardHeight(){\n const UIflashcard = document.querySelector('#flash-card');\n let cardWidth = UIflashcard.offsetWidth;\n let setHeight = cardWidth / 1.666666666667;\n UIflashcard.style.height = `${setHeight}px`;\n}", "calcHeight() {\n\n const card = document.querySelector('.card');\n const { width } = card.getBoundingClientRect();\n const aspectRatio = 409 / 663;\n const height = Math.min(width, 350) / aspectRatio;\n\n this.setState({ height });\n\n }", "function height() {\n return canvas.height;\n }", "getHeight() {\n return this._$mountPoint.height();\n }", "get height() {\n\t\treturn this._canvas.height;\n\t}", "get height() {}", "get height() {\n\t\treturn this._height;\n\t}", "get height() {\n\t\treturn this._height;\n\t}", "getHeight() {\n return this.getSize().height;\n }", "getHeight() {\n return this.height;\n }", "getHeight() {\n return this.height;\n }", "get height() {\n return this._getOption('height');\n }", "get height()\n\t{\n\t\tlet height = Math.max(this._height, this.minHeight);\n\n\t\tif (this.tree.theme.hasGridBehavior)\n\t\t{\n\t\t\tlet step = this.tree.theme.gridSize;\n\t\t\theight = Math.ceil(height / step) * step;\n\t\t}\n\n\t\treturn height;\n\t}", "get height() {\n return this._height;\n }", "get height() {\n return this._height;\n }", "getHeight() {\n console.log(this.height);\n }", "getHeight() {\n return this._$banner.outerHeight();\n }", "get height() {\n\t\treturn this._viewport[3];\n\t}", "getHeight(){return this.__height}", "getHeight() {\n return this._executeAfterInitialWait(() => this.currently.getHeight());\n }", "get height() {\n return this.m_height;\n }", "get height() { return this._height; }", "get pixelHeight() {\n return this.grid.layout.gridItemHeight;\n }", "get height() {\n return this._height;\n }", "function setHeight() {\n let innerHeight = $(window).height() - 250\n $('.card-data').css('max-height', innerHeight)\n }", "function getCardHeight(duration) {\n switch (duration) {\n case '1':\n return 'h-c1';\n case '2':\n return 'h-c2';\n case '3':\n return 'h-c3';\n case '4':\n return 'h-c4';\n case '5':\n return 'h-c5';\n default:\n console.log('default');\n return 'c1';\n }\n }", "getCardSize() {\n return 20;\n }", "get height() {\n return this.heightIn;\n }", "get height() {\n return this.heightIn;\n }", "getCardSize() {\n return 8;\n }", "getHeight() {\n return this.face.height();\n }", "setCardHeight() {\n if (this.refs.back && this.refs.front) {\n this.refs.back.style.height = `${this.refs.front.clientHeight}px`;\n }\n }", "get height() {\n if (this.image) {\n return this.image.height;\n }\n return 0;\n }", "get contentHeight() {\n const rowManager = this.rowManager;\n return Math.max(rowManager.totalHeight, rowManager.bottomRow ? rowManager.bottomRow.bottom : 0);\n }", "setHeight () {\n if (!this.props.list.length || !this.refs.item0) {\n return;\n }\n\n const node = ReactDom.findDOMNode(this);\n const computedStyle = getComputedStyle(node);\n const itemHeight = ReactDom.findDOMNode(this.refs.item0).offsetHeight;\n const height = ACList.heightAddenums.reduce((heightParts, prop) => {\n return heightParts + parseInt(computedStyle[prop], 10);\n }, itemHeight * this.props.itemsCount);\n\n node.style.maxHeight = height + 'px';\n }", "get maxHeight() {}", "get displayHeight() {\n\t\treturn this.__Internal__Dont__Modify__.dispHeight;\n\t}", "function height(param) {\n if (param) {\n return param.h;\n } else {\n return 0;\n }\n }", "function getHeight(element) {\n\t\treturn parseInt(element.css('height'));\n\t}", "getCardSize() {\n return 4;\n }", "async getBlockHeight() {\n\t\treturn await this.bd.getBlocksCount();\n\t}", "getCardSize() {\n return 2;\n }", "getMaxHeight(){return this.__maxHeight}", "_getGameHeight() {\n return this.scene.scene.manager.game.config.height;\n }", "getCardSize() {\n return 1\n }", "getCardSize() {\n return 1\n }", "getCardSize() {\n return 1\n }", "height() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "getMaxHeightUnit(){return this.__maxHeightUnit}", "get gridItemHeight() {\n return windowHeight / maxIconsPerCol * this.percent;\n }", "get gridItemHeight() {\n return windowHeight / maxIconsPerCol * this.percent;\n }", "getCardSize() { return 4; }", "_getHeaderHeight() {\n const isExpanded = this._isExpanded();\n if (isExpanded && this.expandedHeight) {\n return this.expandedHeight;\n }\n else if (!isExpanded && this.collapsedHeight) {\n return this.collapsedHeight;\n }\n return null;\n }", "getCardSize() {\r\n return 3;\r\n }", "getCardSize() {\n return 1;\n }", "get drawHeight() {\n if (this._camera) {\n return this.scaledHeight / this._camera.z / this.pixelRatio;\n }\n return this.scaledHeight / this.pixelRatio;\n }", "function playerHeight() {\n\treturn 30;\t\n}", "get height() {\n return this.bottom - this.top;\n }", "get height(){\n // spec says it is a string\n return this.getAttribute('height') || '';\n }", "get height(){\n // spec says it is a string\n return this.getAttribute('height') || '';\n }", "get height(){ return this.Canvas.height }", "function getHeight(height) {\n return Math.round(obj.height * scale);\n }", "function getHeight(obj) {\n const height = parseInt(obj\n .css('height')\n .substring(0, $(obj).css('height').length - 2));\n return height;\n }", "getHeight() {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.request(\"get_height\", {});\n });\n }", "getHeight() {\n return this.canvas.height;\n }", "setHeight(height) {\n const realFeet = ((height * 3.93700) / 12);\n const feet = Math.floor(realFeet);\n const inches = Math.round((realFeet - feet) * 12);\n this.height = `${feet}' ${(`0${inches}`).substr(-2)}''`;\n }", "async getBlockHeight() {\n // Add your code here\n let blockCount = await this.bd.getBlocksCount();\n return blockCount -1;\n }", "get estimatedHeight() { return -1; }", "height() {\n return this.heightHelper(this.root, 0)\n }", "height() {\n\t\t\tvar numConnectors =\n\t\t\t\tMath.max(\n\t\t\t\t\tthis.inputConnectors.length);\n\t\t\treturn this.flowchart.computeConnectorY(numConnectors);\n\t\t}", "getCardSize() {\n return 1;\n }", "get canvasHeight() {\n return this.canvas.height;\n }", "get height() { return 2.5; }", "async getBlockHeight () {\n return await this.getBlockHeightLevel()\n }", "getPictureHeight() {\n const mhm = (this.camera.MatrixHeight / 10000); /* matrix height in meters */\n const { altitude } = this.mission;\n const fm = (this.camera.Focal / 10000); /* focal in meters */\n return ((mhm * altitude) / fm).toFixed(2);\n }", "function getCurrentHeight() {\n\t\t\treturn (lineHeight * Math.max(1, Math.min(5, items.length))) + 4;\n\t\t}", "function getHeight (data) {\n const ROW_SPACING = 198.125\n totalPostNum = data.length\n totalRow = (totalPostNum%stepsX !== 0) ? Math.floor(totalPostNum/stepsX) + 1 : totalPostNum/stepsX\n section_height = (ROW_SPACING * totalRow) + 110\n return section_height\n }", "getHeight() {\n return this.$node.innerHeight();\n }", "function getMaxHeight(clmp) {\n var lineHeight = getLineHeight(element);\n return lineHeight * clmp;\n }", "height(height) {\n return height == null ? this.bbox().height : this.size(this.bbox().width, height);\n }", "getHeight() {\n return this.image.bitmap.height;\n }", "static getCardSizeFromSprite() {\n return {\n width: 81,\n height: 117.5\n };\n }", "getCardSize() {\r\n return this.config.entities.length + 1;\r\n }", "max_height() {\n\t\treturn this.rectangle_y_pad + N_WORDS * char_image_dimensions.height + (N_WORDS - 1) * this.height_between_words;\n\t}", "function getMaxHeight(clmp) {\n var lineHeight = getLineHeight(element);\n return lineHeight * clmp;\n }", "function getMaxHeight(clmp) {\n var lineHeight = getLineHeight(element);\n return lineHeight * clmp;\n }", "getHauteurDessin()\n\t{\n\t\treturn this._canvas.height;\n\t}", "get_grid_height() {\n\t\t\treturn this._internal_grid_size[1]\n\t\t}", "setHeight(height) {\n this.height = height;\n }", "get height() {\n return this._boundingBox.height;\n }", "function getHeight(){\n let height = $('.accountOverview-content').height();\n $('.verticalMenu').css('height', height);\n}", "get minHeight() {}", "function getHeight() {\n\tvar height = document.getElementById(\"clientText\").clientHeight - PADDING_PX;\n\theight = height * PX_TO_INCH * INCH_TO_METER * METER_TO_CM;\n\treturn height.toFixed(2);\n}", "getBlockHeight() {\n return this.db.getBlocksCount();\n }", "function setboardHeight(numberOfRows){\n\n\t//changes the game-board height depending on number of rows of cards \n\tvar boardHeight =document.getElementById('game-board');\n\tvar requiredHeight = (numberOfRows * 195);\n\tvar requiredHeightStr = ''+requiredHeight+'px';\n\tboardHeight.style.height=requiredHeightStr;\n\t\n\t}", "getHeight() {\n return this._rows.length;\n }", "function getHeight() {\n if (self.innerHeight) {\n return self.innerHeight;\n }\n\n if (document.documentElement && document.documentElement.clientHeight) {\n return document.documentElement.clientHeight;\n }\n\n if (document.body) {\n return document.body.clientHeight;\n }\n}", "set height(value) {}", "calculateHeightOfCy(graphComponent) {\n let visHeader = graphComponent.$parent.$parent.getHeader();\n let margin = 130;\n let topCardHeight = document.getElementById(\"graph-info\").offsetHeight;\n let headerHeight = 72;\n if (visHeader) margin = margin + headerHeight;\n let full = document.getElementById(\"app\").offsetHeight;\n let height = full - margin - topCardHeight;\n let cc = document.getElementById(\"cy\");\n cc.style.height = height + \"px\";\n }", "getExtraHeight(_id) {\n return (\n this._getExtraSize(_id, 'top') +\n this._getExtraSize(_id, 'bottom')\n );\n }" ]
[ "0.7270746", "0.70865035", "0.70676345", "0.69745034", "0.69406766", "0.6917146", "0.68742836", "0.68742836", "0.68616426", "0.6858979", "0.6858979", "0.68569076", "0.6824045", "0.681302", "0.681302", "0.6777474", "0.6764611", "0.67553926", "0.67107004", "0.6659473", "0.66495126", "0.6635143", "0.6626555", "0.66003805", "0.65796065", "0.6568876", "0.65622026", "0.6522238", "0.6522238", "0.6500577", "0.6499799", "0.6483598", "0.64813685", "0.64410555", "0.6435949", "0.64352137", "0.6418141", "0.64054376", "0.6405321", "0.6400799", "0.63943666", "0.63905907", "0.6388002", "0.63766104", "0.6371337", "0.6371337", "0.6371337", "0.6354042", "0.63450336", "0.6341574", "0.6341574", "0.6340527", "0.63230425", "0.6319801", "0.63177514", "0.63135207", "0.63070685", "0.6298337", "0.6292767", "0.6292767", "0.6292609", "0.62912405", "0.62905025", "0.6289806", "0.6289703", "0.6270335", "0.62658536", "0.6253506", "0.62528634", "0.62518585", "0.62450683", "0.6238427", "0.62364477", "0.6233569", "0.6232349", "0.6207357", "0.62050945", "0.61884075", "0.61846304", "0.617802", "0.61737776", "0.617318", "0.6164093", "0.6159922", "0.6154573", "0.6154573", "0.61523587", "0.61415905", "0.6137986", "0.6134194", "0.61305404", "0.61289304", "0.61197364", "0.61160094", "0.61029035", "0.6096235", "0.6092954", "0.60827065", "0.6079668", "0.6079355" ]
0.6338811
52
Parameters: A jobtitle and a preference for a job title Function: Checks the title for each segment of a job title preference Output: True if it contains all segments of a job title, false otherwise
function rateJobTitle(jobTitle, jobTitlePref){ //splits a multiword jobtitle into multiple cells of an array titlePrefList = jobTitlePref.split(' '); valid = true; //checks jobTitle to see if it contains all segments of a job title for(var i = 0; i < titlePrefList.length; i++){ if(_.includes(jobTitle, titlePrefList[i]) == false){ valid = false; } } return valid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isExist(title){\n for(let i=0; i<setOfLists.length; i++){\n if(setOfLists[i].name.toUpperCase()==title.toUpperCase()){\n return true;\n }\n }\n return false;\n }", "function containsTitle (arr, val) {\n logger.trace(\"Entering containsTitle function\");\n if ((val === undefined) || (val === null)) {\n return true;\n }\n\n for (var i = 0; i < arr.length ; i++) {\n if (arr[i].type === \"movie\") {\n if (arr[i].movies.title === val) {\n return true;\n }\n }\n }\n return false;\n}", "function exists(title, input)\n\t\t\t{\n\t\t\t\tfor(var i = 0; i < title.length; i++)\n\t\t\t\t{\n\t\t\t\t\tfor(var j = 0; j < input.length; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(new String(title[i]).valueOf() == new String(input[j]).valueOf())\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}", "function keywordCheck(superset, subset){\n return subset.every(function (value) {\n return (superset.toUpperCase().indexOf(value.toUpperCase()) >= 0);\n });\n}", "function isInBookmarks(oll, coll, zbll) {\n var result = bookmarksPresets.hasOwnProperty(oll)\n && bookmarksPresets[oll].hasOwnProperty(coll)\n && bookmarksPresets[oll][coll].hasOwnProperty(zbll.replace(\"/\", \"s\"))\n && bookmarksPresets[oll][coll][zbll.replace(\"/\", \"s\")] == true;\n return result;\n}", "function checkBadWords(note) {\n let notes = document.querySelector('div.note-container');\n\n let noteTitle = note.title.toLowerCase()\n noteTitle = noteTitle.split();\n\n let noteDetails = note.details.toLowerCase();\n noteDetails = noteDetails.split();\n\n if (noteTitle.includes(\"banana\", \"apple\", \"pear\") || noteDetails.includes(\"banana\", \"apple\", \"pear\")) {\n for (var i = 0; i < allNotes.length; i++) {\n console.log(\"true\")\n }\n }\n else {\n console.log(\"false\")\n }\n}", "function eventWithSimilarTitleExists(title) {\n // lowercase and sort words in title\n title = title.toLowerCase().split(/\\s+/).sort().join(' ');\n // look for titles with a small absolute or relativce levenshtein distance\n var found = eventTitles.some(function (existingTitle) {\n var distance = levenshtein(title, existingTitle);\n return (distance < 8) || (distance / (existingTitle + 1) < 0.2);\n });\n eventTitles.push(title);\n return found;\n}", "function isPresent(array, substring){\n for (string of array){\n if (string.indexOf(substring) > -1){\n return true;\n }\n }\n return false;\n}", "function checkIfExists(title){\n\n var podExists = false;\n \n if (localStorage.getItem('podcastData')){\n var retrievedObject = localStorage.getItem('podcastData');\n var podcastObject = JSON.parse(retrievedObject);\n \n for(var i = 0; i < podcastObject.podcasts.length; i++){\n if (podcastObject.podcasts[i].title == title){\n podExists = true;\n }\n }\n \n if (podExists){\n return true;\n }\n \n else{\n return false;\n }\n }\n \n else{\n return false;\n }\n\n}", "function checkForPlagiarism(arr=submissions,text){\n for (let i =0;i<arr.length;i++){\n if (arr[i].response.includes(text)){\n return true\n }\n}\nreturn false\n}", "static hasSegment(key) {\n return Object.keys(this.segments).includes(key);\n }", "function genreMatches(profile, preferences) {\n if (!profile || !preferences) return false\n if (intersection(profile.genres, preferences.genres).length > 0) return true\n return false\n }", "static containsPrimeKeywords(line) {\n let foundKeywords = 0;\n AOE2AIKeywordAgent.PrimeKeywords.forEach(word => {\n if (line.includes(word)) {\n foundKeywords++;\n }\n });\n return foundKeywords > 0;\n }", "function is_partitioned(first, last, pred) {\r\n while (!first.equals(last) && pred(first.value))\r\n first = first.next();\r\n for (; !first.equals(last); first = first.next())\r\n if (pred(first.value))\r\n return false;\r\n return true;\r\n}", "function checkVal(val){\r\n // console.log(\"check val\")\r\n \r\n let names = mainList.map(person => person.Name.toLowerCase());\r\n let flag = true;\r\n \r\n for(let i = 0; i < val.length; i++){\r\n if(val[i].value === '' && i+1 === val.length){\r\n // console.log(\"empty\")\r\n break\r\n }\r\n if(names.includes(val[i].value.toLowerCase())){\r\n }else{\r\n flag = false;\r\n }\r\n if(!flag){\r\n return false\r\n }\r\n \r\n }\r\n return flag;\r\n\r\n}", "function rateKeyword(jobTitle, jobSnippet, jobBody, jobKeywordPref){\n\t//splits a multiword keyword into multiple cells of an array\n\tkeywordPrefList = jobKeywordPref.split(' ');\n\tvalidKeyword = [0];\n\t\n\t//checks to make sure each individual segment of a keyword exists in at least one of the job parameters\n\t//returns false if not\n\tfor(var i = 0; i < keywordPrefList.length; i++){\n\t\tif(_.includes(jobTitle, keywordPrefList[i]) == true ||\n\t\t_.includes(jobSnippet, keywordPrefList[i]) == true ||\n\t\t_.includes(jobBody, keywordPrefList[i]) == true){\n\t\t\tvalidKeyword.push(true);\n\t\t}\n\t\telse{\n\t\t\tvalidKeyword.push(false);\n\t\t}\n\t}\n\t\n\t//if a false value was pushed to the validKeyword array - e.g. a keyword was not found\n\tif(_.includes(validKeyword, false) == true){\n\t\treturn false;\n\t}\n\telse{\n\t\treturn true;\n\t}\n}", "function checkTitle() {\r\n //title = process.argv[3];\r\n title = argv.title;\r\n return (title && title !== \"\");\r\n}", "function checkDublicates(fname,lname) {\n\tvar getFirstName=document.querySelectorAll(\".employeeFirstName\");\n\tvar getLastName=document.querySelectorAll(\".employeeLastName\");\n\tfor (var i = 0; i < getFirstName.length; i++) {\n\t\tvar valueFn=getFirstName[i].textContent;\n\t\tvar valueLn=getLastName[i].textContent;\n\t\tif((valueFn.toLowerCase()==fname.toLowerCase()) &&\n\t\t (valueLn.toLowerCase()==lname.toLowerCase())) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "jobfilter(joblist) {\n if (joblist) {\n return joblist.filter(job => {\n let isValidJob = false;\n\n // Check through the whitelist\n wordList.whitelist.forEach(word => {\n if (job.title.toLowerCase().indexOf(word) > -1) {\n isValidJob = true;\n\n // Check through the blacklist to ensure nothing filters by\n wordList.blacklist.forEach(badword => {\n if (job.title.toLowerCase().indexOf(badword) > -1) {\n isValidJob = false;\n }\n });\n }\n });\n\n // Return any word that has a whitelisted word, but no blacklisted word\n return isValidJob;\n });\n }\n }", "function findSearch(searchTerm) {\r\n\r\nfor (var i = 0; i < jobList.length; i++) {\r\n if (jobList[i].JobTitle.toLowerCase().includes(searchTerm.toLowerCase()) || jobList[i].Category.toLowerCase().includes(searchTerm.toLowerCase() ) || jobList[i].Location.toLowerCase().includes(searchTerm.toLowerCase() ) ) {\r\n document.getElementById(i).style.display = \"block\"\r\n }\r\n else{\r\n document.getElementById(i).style.display = \"none\"\r\n }\r\n } \r\n}", "function isInFavouriteAreas(area){\n return userPrefences.favouriteAreas.includes(area);\n}", "function checkSubStringMatch(item) {\n return item.name.toLowerCase().includes(SearchString.toLowerCase());\n }", "hasHomePhone(first_name, middle_name, last_name) {\n\t for (id in Contacts.findOne(\"Contacts\")[\"contacts\"]) {\n\t\tif((Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"name\"][\"first\"] == first_name) &&\n\t\t (Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"name\"][\"middle\"] == middle_name) &&\n\t\t (Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"name\"][\"last\"] == last_name)) {\n\t\t if(Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"phone\"]\n\t\t != undefined) {\n\t\t\tif(Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"phone\"][\"home\"] != undefined)\n\t\t\t if(Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"phone\"][\"home\"] != \"\")\n\t\t\t\treturn true;\n\t\t }\n\t\t}\t \n\t }\n\t return false;\n\t}", "function CheckPrereqs(courseToCheck, courses) {\n\n /*\n 1. Take courseToCheck as a course object\n 2. From courseToCheck, get its prereq(s) as \n an array of strings\n 3. For each string in the array from 2., go through courses array\n and compare each the prereq string with each course's title.\n When a match is found, add that course object to a an array\n of course objects\n 4. Those courses will have their completed variable checked.\n If all courses have completed === true, retrun true. Otherwise,\n return false.\n */\n\n // 1-2.\n var courseToCheckPrereqs = courseToCheck.prerequisites;\n\n //3.\n var prereqCoursesToCheck=[];\n for(let i = 0; i < courseToCheckPrereqs.length; i++){\n for(let j = 0; j < courses.length;j++){\n if(courseToCheckPrereqs[i] === courses[j].title){\n prereqCoursesToCheck.push(courses[j]);\n }\n }\n }\n\n //4.\n //If any of the course's prereqs are false, \n //The course should not be enabled\n for(let i = 0; i < prereqCoursesToCheck.length; i++){\n if(prereqCoursesToCheck[i].completed === false){\n return false;\n }\n }\n return true; \n}", "function twoStrings(s1, s2){\n // Complete this function\n var setS1 = new Set(s1);\n var setS2 = new Set(s2);\n var hasSubStr = \"NO\"\n\n setS1 = Array.from(setS1);\n setS2 = Array.from(setS2);\n\n var arrayLength1 = setS1.length;\n var arrayLength2 = setS2.length;\n\n Array.prototype.contains = function ( needle ) {\n for (i in this) {\n if (this[i] === needle) return true;\n }\n return false;\n }\n\n for (var i = 0; i < arrayLength1; i++) {\n if (setS2.contains(setS1[i])) {\n hasSubStr = \"YES\"\n }\n }\n\n for (var j = 0; j < arrayLength2; j++) {\n if (setS1.contains(setS2[j])) {\n hasSubStr = \"YES\"\n }\n }\n\n return hasSubStr;\n\n}", "function hasTitle(){\n return ecoElement.title !== \"\";\n }", "function hasResults(url){\n var content = UrlFetchApp.fetch(url).getContentText();\n var hasResults = true; \n if(content.indexOf(NO_RESULT_ATTR)!=-1||content.indexOf(TEILERGEBNIS)!=-1){\n hasResults = false;\n } \n return hasResults;\n}", "isExistingMovie(Title) {\n const moviesArr = this.props.movies;\n for (let i = 0; i < moviesArr.length; i++) {\n if (moviesArr[i].Title === Title) {\n return false;\n }\n }\n return true;\n }", "function isTitleComplete(selectionBlanks, computerSelection) {\n if (selectionBlanks === computerSelection) {\n console.log(\"immediately returns true\");\n return true;\n }\n if (selectionBlanks == null || computerSelection == null) {\n console.log(\"doesn't exist\")\n return false;\n }\n if (selectionBlanks.length != computerSelection.length) {\n console.log(\"not the same length\");\n return false;\n\n }\n //checks if every letter has been guessed correctly\n for (var i = 0; i < selectionBlanks.length; i++) {\n if (selectionBlanks[i] !== computerSelection[i]) {\n console.log(\"letters are not the same at index \" + i)\n return false;\n } else {\n console.log(\"letters are the same at index \" + i)\n }\n }\n return true;\n\n}", "function word_present(command, synonyms){\n for (n in synonyms){\n var synonym = synonyms[n];\n if (synonym.charAt(0) == \"<\"){\n //must be an exact match\n synonym = synonym.substring(1);\n if (command == synonym)\n return true;\n }\n else{\n if (command.includes(synonym))\n return true;\n }\n }\n return false;\n}", "checkBookmarks(articleObj) {\n if (this.state.bookmarkedNews.length > 0) {\n for (let i = 0; i < this.state.bookmarkedNews.length; i++) {\n if (this.state.bookmarkedNews[i].uuid === articleObj.uuid) {\n return true;\n }\n }\n return false;\n } else {\n return false;\n }\n }", "function checkCompanyName(companyName, description) {\n //splitter is comma\n var nameList = description.split(',');\n for (var i = 0; i < nameList.length; i++) {\n if (nameList[i] && companyName.includes(nameList[i])) {\n return true;\n }\n }\n return false;\n }", "async function compare() { \n //adding tabs\n tabs.forEach(async (tab) => {\n //adding tab value to promise on result func\n var advancedCheck = check.bind(null, tab);\n var foundTab = browser.bookmarks.search({ title: tab.title });\n \n foundTab.then(advancedCheck, onRejected);\n });\n }", "function isHere(coverElement) {\n for (var i = 0; i < ro.length; ++i) {\n var helperCounter = 0;\n for (var j = 0; j < coverElement.length; ++j) {\n if (ro[i].includes(coverElement[j])) helperCounter++;\n }\n if (helperCounter === coverElement.length) return false;\n }\n return true;\n}", "isPrefabWithNameExists(prefabName) {\n return $('[prefabName=\"' + prefabName + '\"]').length;\n }", "function areMarkersBookmarked (user){\n BookmarkFact.getAllBookmarks(user.uid)\n .then((bookmarks)=>{\n console.log(\"bookmarked markers\", bookmarks);\n Object.keys(bookmarks).map((key)=>{\n $scope.AllPlaces.forEach((marker, index)=>{\n if (bookmarks[key].uid === marker.uid){\n $scope.AllPlaces[index].isBookmarked = true;\n }\n })\n })\n })\n }", "function isBookFound(book) {\n // Get the user input\n var userInput = searchInput.value;\n \n // Make the input lower case\n var lowercaseUserInput = userInput.toLowerCase();\n \n // Make the book topic lowercase\n var lowercaseTopics = book.topics.toLowerCase();\n \n // Check if the user input is in the lowercase book topics\n if (lowercaseTopics.indexOf(lowercaseUserInput) >= 0) {\n return true;\n } else {\n return false;\n }\n }", "isComplete() {\n return (this.title === this.titleComplete) &&\n (this.labo === this.laboComplete) &&\n (this.univ === this.univComplete) &&\n (this.coAuthor === this.coAuthorComplete)\n }", "function isContains(list, item) {\r\n for (var i = 0; i < list.length; i++){\r\n if (list[i].text == item) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}", "function checkNameSubstring(employee) {\n\t\tconst fullName = `${employee.name.first} ${employee.name.last}`\n\t\tconst query = filterInput.value;\n\t\treturn fullName.includes(query);\n\t}", "function checkForSpaghetti(historyData) {\n for (var i = 0; i < historyData.length; i++) {\n var entry = historyData[i];\n if (entry.entry.search(new RegExp('spaghetti', 'i')) !== -1) {\n return true;\n }\n }\n return false;\n}", "function is_prefix_of(sub, seq) {\n if(is_empty_list(sub)){\n return true;\n } else if(is_empty_list(seq)){\n return false;\n } else if(head(sub) === head(seq)){\n return is_prefix_of(tail(sub), tail(seq));\n } else {\n return false;\n }\n}", "function checkLetter(letter) {\n if (movieTitleToArray().includes(letter)) {\n return true;\n } else {\n return false;\n }\n}", "function titleTest(result, titles) {\n var hasAllTitles = true;\n var resultKeys = Object.keys(result);\n //checking if keys ar eequa\n expect(resultKeys.length).to.equal(titles.length, \"lengths are not the same\");\n expect(result).to.have.keys(titles, \"keys are not the same\");\n}", "function check(a,b){\n for(var i=0;i<a.length;i++){\n if (places.includes(a[i])){\n messageDisplay(\"X\");\n return;\n }\n }\n for(var j=0;j<b.length;j++){\n if (places.includes(b[j])){\n messageDisplay(\"O\");\n return;\n }\n }\n}", "function checkForSubtitles() {\n var tabs = Array.from(document.querySelectorAll('div[data-test-id=\"header-tab\"]'));\n var subtitles = Array.from(document.querySelectorAll('div[data-test-id=\"header-tab-subtitle\"]'));\n for (var i = 0; i < tabs.length; i++) {\n var tab = tabs[i];\n var subtitle = tab.querySelector('div[data-test-id=\"header-tab-subtitle\"]');\n var textContent = ((subtitle.children.length > 0 && subtitle.children[0].textContent) || '').trim();\n if (textContent[0] != '#') {\n continue;\n }\n var title = tab.querySelector('div[data-test-id=\"header-tab-title\"]');\n var ticketId = textContent.substring(1);\n checkTicket(ticketId, updateSubtitle.bind(null, title, subtitle));\n }\n}", "function roomNameTaken(array, val) {\n\tfor (var i = array.length - 1; i >= 0; i--) {\n if (array[i].toLowerCase() == val.toLowerCase()) {\n return true;\n }\n }\n return false;\n}", "function areThereDuplicates(...args) {\n args.sort((a,b) => a > b);\n\tlet startIndex = 0;\n\tlet endIndex = startIndex + 1;\n\twhile (endIndex < args.length) {\n\t\tif (args[startIndex] === args[endIndex]) {\n\t\t\treturn true;\n } \n startIndex ++\n endIndex ++\n \n \n\t}\n\treturn false;\n}", "hasConjuction(sentence) {\n \tvar andSplit = sentence.split(\" and \");\n \tif (sentence.indexOf(\"and\") !== -1 || sentence.indexOf(\"but\") !== -1) {\n \t\tif (this.isThisAndList(andSplit)) {\n \t\t\treturn false;\n \t\t}\n \t\telse {\n \t\t\treturn true;\n \t\t}\n \t}\n \telse {\n \t\treturn false;\n \t}\n }", "function contains(token) {\n\t\t\t\t\ttoken = generalTokenChecks(token);\n\n\t\t\t\t\t//Split the underlying string on spaces to get the list of tokens.\n\t\t\t\t\tvar tokenList = splitUnderlyingString.call(this);\n\n\t\t\t\t\t//Return true if token is a case-sensitive match for one of the tokens in the list \n\t\t\t\t\t//found in the previous step, or false otherwise\n\t\t\t\t\tfor (var i = 0; i < tokenList.length; i++) {\n\t\t\t\t\t\tif (tokenList[i] === token) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}", "transcriptMatches() {\n for (const utterance of this.intentDefinition.utterances) {\n if (this.transcript.includes(utterance)) {\n return true;\n }\n }\n return false;\n }", "function isConcatCells (cell) {\n if(worksheet === \"PRODUCT_CHARGING_CONCEPT\" || worksheet === \"CFS_CHARGING_CONCEPT\" || worksheet === \"RFS_CHARGING_CONCEPT\"){\n if (cell === \"chargingConceptCode\" || cell === \"chargingConceptName\"){\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n}", "function isSubset(as, bs) {\n return as.every(function (a) {\n return bs.indexOf(a) != -1;\n });\n }", "async function search(title) {\n // get job names via search term\n let jobs = await JoblyApi.getJobs(title);\n setJobs(jobs);\n }", "function Search_Student_Exist_In_Add_Ary( StudentName, StudentClassName, Outside_praise, Inside_praise )\r\r\n{\r\r\n\tvar len = Student_Add_Ary[0].length;\r\r\n\r\r\n\tfor(i=0; i<len; i++ )\r\r\n\t{\r\r\n\t\tif( Student_Add_Ary[1][i]==StudentName && Student_Add_Ary[3][i]==StudentClassName && Student_Add_Ary[4][i]==Outside_praise && Student_Add_Ary[5][i]==Inside_praise )\r\r\n\t\t\treturn true;\r\r\n\t}\r\r\n\treturn false;\r\r\n}", "checkFavorites(sourceStr) {\n if (this.state.favoriteSources.includes(sourceStr)) {\n return true;\n }\n return false;\n }", "function courseInSchedule(catalogId, title)\n{\n\tvar f = false;\n\t$(\".scheduleCourse\").each(function() {\n\t\tvar cTitle = $(this).find(\".scheduleCourseTitle\").text();\n\t\tvar cCatalogId = $(this).find(\".scheduleCatalogId\").text();\n\t\t//console.log(cTitle + \" \" + cCatalogId + \" = \" + title + \" \" + catalogId);\n\t\tif (cTitle == title && cCatalogId == catalogId)\n\t\t\tf = true;\n\t});\n\treturn f;\n}", "function mutation(arr) {\n let x = arr[1].split('');\n let count =0;\n arr[0] = arr[0].toLowerCase();\n for (let i of x){\n if(arr[0].includes(i.toLowerCase())){\n count++;\n }\n }\n if (count == arr[1].length){\n return true\n }\n return false;\n}", "function searchBook(title) {\n const bookData = getListOfBook();\n const searchResult = [];\n for (let data of bookData) {\n if (data.title.includes(title)) {\n searchResult.unshift(data);\n }\n }\n renderBookList(true, searchResult);\n}", "function IsFoundedPartOfText(allText, partText) {\r\n\tvar index_exist_text = allText.indexOf(partText);\r\n\tif (index_exist_text > -1) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\treturn false;\r\n}", "function checkForInclusion(element, array)\n{\n\n if(element === null || element === \"\")\n {\n return true;\n }\n\n var len = array.length;\n for(var i = 0; i < len; i++)\n {\n if(array[i].toLowerCase() === element.toLowerCase())\n {\n return true;\n }\n }\n\n return false;\n}", "function checkDone(len, keys, results){\n\tif (keys.length<len)\n\t\treturn false;\n\tfor (var i=0;i<len; i++){\n\t\tif (!(keys[i] in results)) \n\t\t\treturn false;\n\t}\n\treturn true;\n}", "function checkDone(len, keys, results){\n\tif (keys.length<len)\n\t\treturn false;\n\tfor (var i=0;i<len; i++){\n\t\tif (!(keys[i] in results)) \n\t\t\treturn false;\n\t}\n\treturn true;\n}", "function onSegment (pi, pj, pk) {\n return Math.min(pi[0], pj[0]) <= pk[0] &&\n pk[0] <= Math.max(pi[0], pj[0]) &&\n Math.min(pi[1], pj[1]) <= pk[1] &&\n pk[1] <= Math.max(pi[1], pj[1]);\n}", "function requiredPresent(payload) {\n var requiredWords = ['noun', 'verb', 'adjective'];\n return requiredWords.reduce(function(prev, curr) {\n var required = JSON.parse(payload).nextHint;\n var re = new RegExp(curr, 'i');\n return prev || (required.match(re) > -1);\n }, false);\n}", "function mutation(arr) {\n//convert all letters in both word to lowercase\nvar first = arr[0].toLowerCase();\nvar second = arr[1].toLowerCase()\n//access each letter in second word and compare search for it in the first word \n\nfor(var i = 0; i < second.length; i++){\n //validate that each letter in second word is in the first word\n if(first.includes(second[i])!==true){\n console.log(first.includes(second[i]));\n return false;\n }\n\n}\nconsole.log(first.includes(second[i])===true);\n return true;\n}", "async function search(title) {\n let jobs = await JoblyApi.getJobs(title);\n setJobs(jobs);\n }", "function AreAdjacentNouns(stims) {\n\tvar are_adj = false;\n\tvar i = 0;\n\twhile (are_adj == false && i < (stims.length-1) ) {\n\t\tif (stims[i].noun == stims[i+1].noun){\n\t\t\tare_adj = true;\t\t\t\n\t\t} \n\t\ti++;\n\t}\n\treturn are_adj;\n}", "function analyseListing(content){\n console.log(content.toLowerCase());\n if (content.includes('accountant')){\n console.log('\\n=======================Contains Accountant============\\n');\n }\n}", "function checkAutoSubtitles() {\r\n\t\r\n\tif(iPlayerName != \"youtube\") {\r\n\t\treturn false;\r\n\t}\r\n\t\r\n var autoGeneratedElements;\r\n\r\n if ($(iSubtitlesElementNamejQuery)[0] && \r\n\t\t$(iSubtitlesElementNamejQuery)[0].firstChild &&\r\n\t\t$(iSubtitlesElementNamejQuery)[0].firstChild.firstChild) {\r\n\t\t\t\r\n autoGeneratedElements = $(iSubtitlesElementNamejQuery)[0].firstChild.firstChild.getElementsByTagName(\"span\").length\r\n } else {\r\n autoGeneratedElements = 0;\r\n }\r\n\r\n if (autoGeneratedElements) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n\r\n}", "function inside(str,arr) {\n if (arr.includes(str)) {\n return true\n } else {\n return false\n }\n}", "hasHomeAddress(first_name, middle_name, last_name) {\n\t for (id in Contacts.findOne(\"Contacts\")[\"contacts\"]) {\n\t\tif((Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"name\"][\"first\"] == first_name) &&\n\t\t (Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"name\"][\"middle\"] == middle_name) &&\n\t\t (Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"name\"][\"last\"] == last_name)) {\n\t\t if(Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"address\"]\n\t\t != undefined) {\n\t\t\tif(Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"address\"][\"home\"] != undefined)\n\t\t\t if((Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"address\"][\"home\"][\"apartment\"] != \"\") &&\n\t\t\t (Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"address\"][\"home\"][\"street\"] != \"\") &&\n\t\t\t (Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"address\"][\"home\"][\"city\"] != \"\") &&\n\t\t\t (Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"address\"][\"home\"][\"state\"] != \"\") &&\n\t\t\t (Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"address\"][\"home\"][\"zip\"] != \"\") &&\n\t\t\t (Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"address\"][\"home\"][\"country\"] != \"\"))\n\t\t\t\treturn true;\n\t\t }\n\t\t}\t \n\t }\n\t return false;\n\t}", "function sublistByBuckets(arr, buckets) {\n return sublistByProperty(arr, buckets.map(function(syll) {\n var result = {\n off: false,\n word: function(wordstr, wordfull, others) {\n var lastword = wordstr.split(\" \");\n lastword = lastword[lastword.length - 1].toLowerCase();\n if(others.length < 1)\n return true;\n return others.map(function(word) {\n var lw = word.word.split(\" \");\n lw = lw[lw.length - 1].toLowerCase();\n return lw;\n }).indexOf(lastword) === -1;\n }\n };\n if(~syll.indexOf(\"off\")) {\n syll = syll.replace(/^.*off/, \"\");\n result.off = true;\n }\n result.syllcount = parseInt(syll);\n return result;\n }));\n }", "async function isJobRunning(){\n\tconst brandsRef = firestore.collection('brands');\n\tvar snapshot = await brandsRef.where('status', '==', 'progress').get();\n\tif (!snapshot.empty) return true;\n\n\tconst productsRef = firestore.collection('products');\n\tvar snapshot = await productsRef.where('status', '==', 'progress').get();\n\tif (!snapshot.empty) return true;\n\n return false; // we are good to go \t\n}", "function contains(array, token){\n\tfor(var i=0; i<array.length; i++){\n\t\tif(array[i].getTokenString() == token.getTokenString() &&\n\t\t array[i].getTokenKind() == token.getTokenKind()){\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function mutation(arr) {\n\tvar first = arr[0].toLowerCase(); \n\tvar second = arr[1].toLowerCase(); \n\tvar fLength = first.length-1; \n\tvar sLength = second.length-1\n\tvar swtch = false;\n\n\tfor (var i = 0; i <= fLength; i++){ \n\t\tfor (var c = 0; c <= sLength; c++){ \n\t\t\tif (first.indexOf(second[c]) !== -1){\n\t\t\t\tswtch = true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\nreturn swtch;\n}", "checkLetter(letter) {\n if (this.phrase.includes(letter)) { //the includes() method was used from https://www.w3schools.com/Jsref/jsref_includes.asp\n return true;\n } else {\n return false;\n }\n}", "function mutation(arr) {\n var haystack = arr[0].toLowerCase();\n var needle = arr[1].toLowerCase();\n \n for (let i = 0, needleLen = needle.length; i < needleLen; i++) {\n if ( !(haystack.includes(needle[i])) ) { return false; }\n }\n return true;\n}", "function isAddressExist() {\n\t\treturn addresses.some(address => address.id === title.split(' ').join(''));\n\t}", "function mutation(arr) {\n let arr0 = [];\n let arr1 = [];\n for (let i=0; i<arr[0].length; i++) {\n arr0.push(arr[0][i].toLowerCase());\n }\n for (let i=0; i<arr[1].length; i++) {\n arr1.push(arr[1][i].toLowerCase());\n }\n // console.log(arr0 + arr1);\n for(let i=0; i<arr1.length; i++) {\n if(!arr0.includes(arr1[i])) {\n return false;\n }\n }\n return true;\n // for (let i=0; i<arr[1].length; i++) {\n // if (arr[0].includes(arr[1].substring(i,i+1).ignoreCase)) {\n // return false;\n // }\n // }\n // return true;\n}", "function ck_sect(sect, deptcheck, sncheck){\n\tvar i, dept=grab(\"dept\").value.toUpperCase(), sname=grab(\"surname\").value.toUpperCase(),\n\tdeptck = function(c){\n\t\tif(!dept || !deptcheck) return true;\n\t\tif(c.d === \"ALL\" || c.d === dept) return true;\n\t\treturn false;\n\t}, snck = function(c){\n\t\tif(!sname || !sncheck) return true;\n\t\tvar cmp = function(x){ return sname.localeCompare(x, \"tr\"); };\n\t\tif(cmp(c.s) >= 0 && cmp(c.e) <= 0) return true;\n\t\treturn false;\n\t};\n\tif(sect.c.length === 0) return true;\n\tfor(i=0; i<sect.c.length; i++) if(deptck(sect.c[i]) && snck(sect.c[i])) return true;\n\treturn false;\n}", "function mutation(arr) {\n var first = arr[0].toLowerCase();\n var second = arr[1].toLowerCase().split('');\n \n for ( i = 0 ; i < second.length ; i++ ) {\n for ( j = 0 ; j < second.length ; j++ ) {\n if (first.indexOf(second[j]) > -1) {\n continue; \n } else {\n return false;\n }\n }\n }\n return true; \n}", "some(callback, subject, predicate, object, graph) {\n for (const quad of this.readQuads(subject, predicate, object, graph)) if (callback(quad)) return true;\n return false;\n }", "function instrumentMatches(profile, preferences) {\n if (intersection(profile.instruments, preferences.instruments).length > 0) return true\n return false\n }", "function socialCheck(superset, subset) {\n if (0 === subset.length) {\n return false;\n }\n return subset.every(function(value) {\n return superset.indexOf(value) >= 0;\n });\n}", "async isItemInTheCart(item) {\n const count = await this.name.count;\n let found = false;\n for(var i = 0; i < count; i++) {\n const title = await this.name.nth(i).innerText;\n if (title.match(item)) {\n found = true; //if the title of the item name is the same as the passed item, then it was found.\n }\n\n }\n return found\n }", "validateDegreeReqs() {\n let program = this.props.program\n let terms = program.terms\n for (let term of terms) {\n let courses = this.props.courses\n for (let course of program[term].courses) {\n if (course == \"MSCI 261\" || courses[course].replaces == \"MSCI 261\") {\n return true\n }\n }\n }\n\n return false\n }", "function contains(arr, names, cb){\n //loop through the array\n for (var i = 0; i < arr.length; i++) {\n //check for the name in the array\n if(arr[i] === names){\n //invoke callback if name exist\n return cb(true);\n }\n else{\n return cb(false);\n }\n }\n}", "function printLongBookTitles(books) {\n // let longBooks = books.filter(book => book.title.split(' ').length > 2)\n let longBooks = books.filter(book => {\n if (book.title.split(' ').length > 2) {\n // title is longer than 2 words\n return true;\n }\n });\n console.log(longBooks);\n}", "function sc_everyPred(proc, l) {\n var tmp = sc_every(proc, l);\n if (tmp !== false) return true;\n return false;\n}", "contains(val) {}", "function contained(L) {\n let contain = true;\n for (let i = 0; i < newState.length; i++) {\n for (let j = 0; j < L.length; j++) {\n if (!newState[i].includes(L[j])) {\n contain = false;\n break;\n }\n }\n if (contain)\n return true;\n contain = true;\n }\n return false;\n}", "checkIsReviewPhaseComplete() {\n const {\n challenge,\n } = this.props;\n\n const allPhases = challenge.phases || [];\n\n let isReviewPhaseComplete = false;\n _.forEach(allPhases, (phase) => {\n if (phase.name === 'Review' && !phase.isOpen && moment(phase.scheduledStartDate).isBefore()) {\n isReviewPhaseComplete = true;\n }\n });\n return isReviewPhaseComplete;\n }", "function isSubsequence(st1,st2) {\n\n var i = 0;\n var j = 0;\n\n if (!str1) return true;\n\n while (j < str2.length) {\n if (str2[j] === str1[i]) {i++};\n if (i === str1.length) { return true};\n j++;\n }\n \n return false;\n }", "function arrayContainsPrefix( curArr, item )\n{\n var itemLength = item.length;\n var nElements = curArr.length;\n for( var i = 0; i < nElements; i++ )\n {\n var curItem = curArr[i];\n if ( curItem.length <= itemLength &&\n curItem == item.substring(0, curItem.length) )\n return true;\n }\n\n return false;\n}", "function letterCheck(arr) {\n return [...arr[1].toLowerCase()].every(el => arr[0].toLowerCase().includes(el));\n\n}", "function isInAssessItems(name) {\n\n// var result = false;\n var itemsDiv = document.getElementById('assess-items');\n\n console.log(\"Iterating through assessment items \");\n// console.log(itemsDiv);\n\n if (itemsDiv != null) {\n var items = itemsDiv.childNodes;\n// console.log(\"Printing child nodes \");\n// console.log(items);\n for (var i = 0; i < items.length; i++) {\n// console.log(hasclass(items[i], 'item-in-assess'));\n if (hasclass(items[i], 'item-in-assess')) {\n console.log(items[i].childNodes[0].innerText);\n console.log(name);\n if(typeof items[i].childNodes[0].innerText == 'undefined'){//for Mozilla\n if (name === items[i].childNodes[0].textContent) {\n console.log(\"found a match\");\n return true;\n }\n }else {\n if (name === items[i].childNodes[0].innerText) {\n console.log(\"found a match\");\n return true;\n }\n }\n }\n }\n\n }\n return false;\n}", "function arrayCheck (arrayItem, arrayName) {\n for (x = 0; x < arrayName.length; x++) {\n if(arrayName.includes(arrayItem)) {\n return false;\n }\n }\n return true;\n}", "function checkConsanginuity(fam_id, pers1_id, pers2_id)\n{\n var fam_map = familyMapOps.getFam(fam_id),\n pers1 = fam_map[pers1_id],\n pers2 = fam_map[pers2_id];\n\n // Find pers1 founder\n var routes2 = [];\n routes2.push( pers1 );\n routes2.push( pers2 );\n\n //console.log(\"routes2=\", pers1_id, pers2_id);\n\n // = [pers1, pers2];\n\n var complete = [],\n \tloopnum = 0;\n\n // console.log(pers1.id+\" and \"+pers2.id);\n while(routes2.length > 0 && loopnum++ < 100){\n\n \tvar perc = routes2.shift(); // remove from search\n\n/* \tif (perc === undefined){\n \t\t\n \t}\n*/\n \t//Try mother + father\n\t if (perc.mother === 0 && perc.father === 0){\n\t \tcomplete.push(perc.id);\n\t \tcontinue;\n\t }\n\n \tif (perc.mother != 0) routes2.push(perc.mother);\n \tif (perc.father != 0) routes2.push(perc.father);\n\n \t// console.log(\" routes=\", routes2.map( function(n){ return n.id;}));\n }\n // console.log(\"complete=\", complete);\n\n //Find duplicates in complete\n complete = complete.sort();\n for (var a=0; a < complete.length -1; a++){\n \tif (complete[a+1] === complete[a])\n \t\treturn true;\n }\n\n return false;\n}", "function breakDownAA(sequence){\n var start = 0;\n var end = 3;\n var check = false;\n var twoCheck = false;\n while (end <= sequence.length){\n if (sequence.substring(start, end+1) === 'Stop'){\n check = true;\n start = start +4;\n end = start + 3;\n }\n else {\n for (var key in aa){\n if (sequence.substring(start,end) === aa[key]){\n check = true;\n start = start +3;\n end = start + 3;\n break;\n }\n }\n }\n if (check){\n check = false;\n }\n else if (twoCheck && !check){\n return false;\n }\n else if (!check){\n twoCheck = true;\n start = start +3;\n end = start+3;\n }\n\n }\n return true;\n}" ]
[ "0.53449136", "0.5339336", "0.52949375", "0.5259956", "0.52465093", "0.5150919", "0.49525732", "0.48551226", "0.48396122", "0.483126", "0.4821487", "0.480658", "0.48033437", "0.47864965", "0.47662243", "0.47383064", "0.47288242", "0.47250688", "0.47084957", "0.4693188", "0.4662018", "0.4660566", "0.4633738", "0.46258703", "0.46247974", "0.4619231", "0.46090364", "0.46090245", "0.46049386", "0.46028593", "0.45916352", "0.45601168", "0.45482078", "0.45448598", "0.4537777", "0.4523039", "0.45187995", "0.45104027", "0.45089293", "0.45049158", "0.45029578", "0.4490876", "0.44861928", "0.44772616", "0.44749486", "0.44676313", "0.44550332", "0.44544813", "0.44542238", "0.44540676", "0.445234", "0.44507882", "0.44504327", "0.44453573", "0.4440799", "0.4434384", "0.44270253", "0.44159222", "0.44128537", "0.44029918", "0.44028345", "0.44027585", "0.44027585", "0.44011107", "0.4392088", "0.43822575", "0.43679297", "0.43675363", "0.43629888", "0.43604398", "0.43566564", "0.43551028", "0.43514973", "0.43473074", "0.43467996", "0.43365738", "0.43356705", "0.43313345", "0.43285757", "0.43171525", "0.4312514", "0.4310679", "0.43093482", "0.43046898", "0.4298305", "0.42978996", "0.42968035", "0.42955968", "0.42954943", "0.42902696", "0.42862025", "0.42856127", "0.42832053", "0.42806974", "0.42701063", "0.42661816", "0.42649645", "0.42639774", "0.42631078", "0.42570806" ]
0.6863708
0
Parameters: A job's title, snippet, and body as well as a keyword preference Function: Checks the title, snippet, and body for keyword segments Output: True if all segments of a keyword are present somewhere, false otherwise
function rateKeyword(jobTitle, jobSnippet, jobBody, jobKeywordPref){ //splits a multiword keyword into multiple cells of an array keywordPrefList = jobKeywordPref.split(' '); validKeyword = [0]; //checks to make sure each individual segment of a keyword exists in at least one of the job parameters //returns false if not for(var i = 0; i < keywordPrefList.length; i++){ if(_.includes(jobTitle, keywordPrefList[i]) == true || _.includes(jobSnippet, keywordPrefList[i]) == true || _.includes(jobBody, keywordPrefList[i]) == true){ validKeyword.push(true); } else{ validKeyword.push(false); } } //if a false value was pushed to the validKeyword array - e.g. a keyword was not found if(_.includes(validKeyword, false) == true){ return false; } else{ return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkBadWords(note) {\n let notes = document.querySelector('div.note-container');\n\n let noteTitle = note.title.toLowerCase()\n noteTitle = noteTitle.split();\n\n let noteDetails = note.details.toLowerCase();\n noteDetails = noteDetails.split();\n\n if (noteTitle.includes(\"banana\", \"apple\", \"pear\") || noteDetails.includes(\"banana\", \"apple\", \"pear\")) {\n for (var i = 0; i < allNotes.length; i++) {\n console.log(\"true\")\n }\n }\n else {\n console.log(\"false\")\n }\n}", "isKeyword(word) { return this.keywords.test(word) }", "function rateJobTitle(jobTitle, jobTitlePref){\n\t//splits a multiword jobtitle into multiple cells of an array\n\ttitlePrefList = jobTitlePref.split(' ');\n\tvalid = true;\n\t\n\t//checks jobTitle to see if it contains all segments of a job title\n\tfor(var i = 0; i < titlePrefList.length; i++){\n\t\tif(_.includes(jobTitle, titlePrefList[i]) == false){\n\t\t\tvalid = false;\n\t\t} \n\t}\n\n\treturn valid;\n}", "static containsPrimeKeywords(line) {\n let foundKeywords = 0;\n AOE2AIKeywordAgent.PrimeKeywords.forEach(word => {\n if (line.includes(word)) {\n foundKeywords++;\n }\n });\n return foundKeywords > 0;\n }", "function containsKeywords(text) {\n for (let i = 0; i < keywords.length; i++) {\n if (text.includes(keywords[i])) {\n return true;\n }\n }\n return false;\n}", "isKeyword() {\n let text = this._value;\n return IdentifierState.keywords.find(elem => {\n return elem === text;\n });\n }", "function keywordCheck(superset, subset){\n return subset.every(function (value) {\n return (superset.toUpperCase().indexOf(value.toUpperCase()) >= 0);\n });\n}", "function checkIfKeywordIsACategory(keyword){\n if(keyword.includes(\"node\")||keyword.includes(\"propert\")||keyword.includes(\"relationship\")||keyword.includes(\"schema\"))\n return true;\n else false;\n}", "function mainTextContains(post) {\n const searchQuery = searchBar.value.toLowerCase();\n const textArray = post.text.toLowerCase().split(\" \");\n return textArray.includes(searchQuery);\n}", "function requiredPresent(payload) {\n var requiredWords = ['noun', 'verb', 'adjective'];\n return requiredWords.reduce(function(prev, curr) {\n var required = JSON.parse(payload).nextHint;\n var re = new RegExp(curr, 'i');\n return prev || (required.match(re) > -1);\n }, false);\n}", "function beginsWithKeyword(str)\n{\n for(j = 0 ; j < keywords.length; j++)\n {\n if(str.indexOf(keywords[j]) == 0) return true;\n }\n return false;\n}", "function checkKeywords(str) {\n str = replaceLast(str);\n\n for (var i = 0; i < data.length; i++) {\n var d = data[i];\n //var strArr = str.toUpperCase().split(' ');\n var match = true;\n for (var j = 0; j < d.keywords.length; j++) {\n //if (strArr.indexOf(d.keywords[j]) == -1) {\n if (str.toUpperCase().includes(d.keywords[j]) == false) {\n match = false;\n break;\n }\n }\n\n if (match == true) {\n return d.question;\n }\n }\n\n //log for debugging\n log(\"You spoke \" + str);\n\n return '';\n}", "function checkKeywords(product, keywords) {\n if (!keywords.length) {\n return true;\n }\n\n let productName = product.getElementsByClassName('name-value')[0].innerText.trim().toLowerCase();\n let specs = product.getElementsByClassName('chipset-value')[0].innerText.trim().toLowerCase();\n\n for (let keyword of keywords) {\n let condition = (productName + ', ' + specs).includes(keyword.slice(1));\n\n if (((keyword[0] === '+') && !condition) || ((keyword[0] === '-') && condition)) {\n return false;\n }\n }\n\n return true;\n}", "function is_kw(kw) {\n var tok = input.peek();\n return tok && tok.type === \"kw\" && (!kw || tok.value === kw) && tok; \n }", "function containsNote(line) {\n return Object.keys(keyWords).some(function(key) {\n return new RegExp(keyWords[key] + ':').test(line);\n });\n}", "function isBookFound(book) {\n // Get the user input\n var userInput = searchInput.value;\n \n // Make the input lower case\n var lowercaseUserInput = userInput.toLowerCase();\n \n // Make the book topic lowercase\n var lowercaseTopics = book.topics.toLowerCase();\n \n // Check if the user input is in the lowercase book topics\n if (lowercaseTopics.indexOf(lowercaseUserInput) >= 0) {\n return true;\n } else {\n return false;\n }\n }", "function _isKeyword(v) {\n if(!_isString(v)) {\n return false;\n }\n switch(v) {\n case '@base':\n case '@context':\n case '@container':\n case '@default':\n case '@embed':\n case '@explicit':\n case '@graph':\n case '@id':\n case '@index':\n case '@language':\n case '@list':\n case '@omitDefault':\n case '@preserve':\n case '@reverse':\n case '@set':\n case '@type':\n case '@value':\n case '@vocab':\n return true;\n }\n return false;\n}", "function keywordMatch(mode, keywords) {\n var keyword = keywords[0]\n\n if (language[keyInsensitive]) {\n keyword = keyword.toLowerCase()\n }\n\n return own.call(mode.keywords, keyword) && mode.keywords[keyword]\n }", "function _isKeyword(v) {\n if(!_isString(v)) {\n return false;\n }\n switch(v) {\n case '@base':\n case '@context':\n case '@container':\n case '@default':\n case '@embed':\n case '@explicit':\n case '@graph':\n case '@id':\n case '@index':\n case '@language':\n case '@list':\n case '@omitDefault':\n case '@preserve':\n case '@requireAll':\n case '@reverse':\n case '@set':\n case '@type':\n case '@value':\n case '@vocab':\n return true;\n }\n return false;\n}", "function _isKeyword(v) {\n if(!_isString(v)) {\n return false;\n }\n switch(v) {\n case '@base':\n case '@context':\n case '@container':\n case '@default':\n case '@embed':\n case '@explicit':\n case '@graph':\n case '@id':\n case '@index':\n case '@language':\n case '@list':\n case '@omitDefault':\n case '@preserve':\n case '@requireAll':\n case '@reverse':\n case '@set':\n case '@type':\n case '@value':\n case '@vocab':\n return true;\n }\n return false;\n}", "function _isKeyword(v) {\n if(!_isString(v)) {\n return false;\n }\n switch(v) {\n case '@base':\n case '@context':\n case '@container':\n case '@default':\n case '@embed':\n case '@explicit':\n case '@graph':\n case '@id':\n case '@index':\n case '@language':\n case '@list':\n case '@omitDefault':\n case '@preserve':\n case '@requireAll':\n case '@reverse':\n case '@set':\n case '@type':\n case '@value':\n case '@vocab':\n return true;\n }\n return false;\n}", "function _isKeyword(v) {\n if(!_isString(v)) {\n return false;\n }\n switch(v) {\n case '@base':\n case '@context':\n case '@container':\n case '@default':\n case '@embed':\n case '@explicit':\n case '@graph':\n case '@id':\n case '@index':\n case '@language':\n case '@list':\n case '@omitDefault':\n case '@preserve':\n case '@requireAll':\n case '@reverse':\n case '@set':\n case '@type':\n case '@value':\n case '@vocab':\n return true;\n }\n return false;\n}", "function isParagraphBorked(paragraph) {\n if (paragraph.split(\" \").length < 50) {\n // console.log(\"Paragraph is borked\")\n return true\n }\n return false\n}", "function keywordMatch(mode, keywords) {\n var keyword = keywords[0];\n\n if (language[KEY_INSENSITIVE]) {\n keyword = keyword.toLowerCase();\n }\n\n return own.call(mode.keywords, keyword) && mode.keywords[keyword];\n }", "function commentTextContains(post) {\n const searchQuery = searchBar.value.toLowerCase();\n if (post.comments.length === 0) {\n return false;\n }\n for (let i = 0; i < post.comments.length; i++) {\n const textArray = post.comments[i].text.toLowerCase().split(\" \");\n if (textArray.includes(searchQuery)) {\n return true;\n }\n }\n}", "jobfilter(joblist) {\n if (joblist) {\n return joblist.filter(job => {\n let isValidJob = false;\n\n // Check through the whitelist\n wordList.whitelist.forEach(word => {\n if (job.title.toLowerCase().indexOf(word) > -1) {\n isValidJob = true;\n\n // Check through the blacklist to ensure nothing filters by\n wordList.blacklist.forEach(badword => {\n if (job.title.toLowerCase().indexOf(badword) > -1) {\n isValidJob = false;\n }\n });\n }\n });\n\n // Return any word that has a whitelisted word, but no blacklisted word\n return isValidJob;\n });\n }\n }", "function filtradoTags(tags) {\n return (tags.length==2) && tags[0].includes(\"isCriteriaOf\") && tags[1].includes(\"mark\");\n}", "function checkTags(tag, docTags) {\n var match = false;\n\n docTags.forEach(element => {\n element = element.toUpperCase();\n\n if (tag === element) {\n\n match = true;\n matchedTerms.push(tag);\n }\n else if (tag.length > element.length) {\n if (tag.substring(0, element.length) === element) {\n\n match = true;\n matchedTerms.push(tag);\n }\n }\n else if (tag.length < element.length) {\n if (tag === element.substring(0, tag.length)) {\n\n match = true;\n matchedTerms.push(tag);\n }\n }\n });\n return match;\n}", "function checkForPlagiarism(arr=submissions,text){\n for (let i =0;i<arr.length;i++){\n if (arr[i].response.includes(text)){\n return true\n }\n}\nreturn false\n}", "function filtradoTags2(tags) {\n return (tags.length==2) && tags[0].includes(\"mark\") && tags[1].includes(\"isCriteriaOf\");\n}", "function isWordFound(phrase, word) {\n var tokenObjs = nlp.tokenize(phrase);\n //console.log(\"tokenObjs = \", tokenObjs);\n var tokens = tokenObjs[0].tokens.map(obj => obj.text);\n //console.log(\"tokens = \", tokens);\n return (tokens.indexOf(word) !== -1);\n }", "function checkWord({ results }) {\n const word = results[results.length - 1][0].transcript;\n\n let isValid = false;\n commands.forEach((command) => {\n if (word.includes(command)) {\n isValid = true;\n detectedSpeech = command;\n }\n });\n return isValid;\n}", "function containsKeywordWithWildcard(input, keywordsWithWildcardStr){\n\t\n\tvar responseWildcardObj = getResponseWildcardInfo(keywordsWithWildcardStr);\n\n\tvar numberOfWordsInWildcard = 0;\n\tvar foundKeywords = 0;\n\tvar inputArray = input.split(\" \");\n\tfor(var i = 0;i < inputArray.length;i++){\n\t\tvar currentWord = inputArray[i];\n\t\t\n\t\t//if the word is not a keyword, add it. and we are in the wildcard\n\t\tif((foundKeywords >= responseWildcardObj.minNumWords && foundKeywords <= responseWildcardObj.maxNumWords) && !responseWildcardObj.keywords.contains(currentWord)){\n\t\t\tnumberOfWordsInWildcard++;\n\t\t}\n\n\t\tif(responseWildcardObj.keywords.length > 0 && currentWord == responseWildcardObj.keywords[0]){\n\t\t\t//so first this would be \"i\" for [\"i\",\"am\",\"happy\"]\n\t\t\tresponseWildcardObj.keywords.remove(currentWord);\n\t\t\tfoundKeywords++;\n\t\t}\n\t}\n\n\t//Doesnot have all keywords\n\t//\"I am * sad\"\n\t//\"I am * happy\"\n\t//> I am extremely happy\n\t//Sad should stop here cause its not valid\n\tif(responseWildcardObj.keywords.length > 0){\n\t\t//console.log(\"Not the correct keyword\");\n\t\treturn false;\n\t}\n\tif(!(numberOfWordsInWildcard >= responseWildcardObj.minNumWords && numberOfWordsInWildcard <= responseWildcardObj.maxNumWords)){\n\t\t//console.log(\"Does not follow wildcard rules\");\n\t\treturn false;\n\t}\n\t\n\treturn true;\n}", "function matchKeyword(kw) {\n const tok = peek()\n return tok.type === Token.Keyword && tok.value === kw\n }", "function actuallyPerformKeywordSearch(_keyword, ts, _strategy) {\r\n\tfunction notFoundMessage(_keyword, _strategy_expanded) {\r\n\t\tvar s = \"Unable to locate a Release that contains the keyword '\" + _keyword + \"'\" + _strategy_expanded + \".\";\r\n\t\treturn s;\r\n\t}\r\n\r\n\tif (_previousKeywordSearch_area.length > 0) {\t// here we restore the state of the last search\r\n\t\tvar cObj = getGUIObjectInstanceById(_previousKeywordSearch_area + _previousKeywordSearch_tabNum.toString());\r\n\t\tif ( (cObj != null) && (isTextarea(cObj) == false) ) {\r\n\t\t\tif (_previousKeywordSearch_innerHTML.trim().length > 0) {\r\n\t\t\t\tcObj.innerHTML = _previousKeywordSearch_innerHTML;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t_previousKeywordSearch_tabNum = -1;\t\t// initialize\r\n\t_previousKeywordSearch_area = '';\t\t// initialize\r\n\t_previousKeywordSearch_innerHTML = '';\t// initialize\r\n\r\n\tvar _strategy_hint = '';\r\n\tvar _strategy_expanded = '';\r\n\tif (_strategy.trim().length > 0) {\r\n\t\t_strategy_expanded = ' using keyword search strategy of ' + _strategy;\r\n\t\tif (_strategy.toUpperCase() == const_depth_first.toUpperCase()) {\r\n\t\t\t_strategy_hint = ' - Searching each tab from top to bottom then left to right.';\r\n\t\t} else if (_strategy.toUpperCase() == const_depth_last.toUpperCase()) {\r\n\t\t\t_strategy_hint = ' - Searching each tab from left to right then top to bottom.';\r\n\t\t} else if (_strategy.toUpperCase() == const_tab_titles.toUpperCase()) {\r\n\t\t\t_strategy_hint = ' - Searching each tab from left to right (limited to tab titles only).';\r\n\t\t}\r\n\t\twindow.status = 'Keyword search strategy is ' + _strategy + _strategy_hint;\r\n\t}\r\n\r\n\tvar len = ts.tabs.length;\r\n\tvar _f = -1;\r\n\tvar _isAnySearchedComments = 0;\r\n\tif ( (_strategy.trim().length == 0) || (_strategy.toUpperCase() == const_depth_first.toUpperCase()) ) {\r\n\t\tfor(var i = 0; i < len; i++) {\r\n\t\t\tvar tab = ts.tabs[i];\r\n\t\t\tvar cObj = getGUIObjectInstanceById(_const__tab + (i + 1).toString());\r\n\t\t\tif (cObj != null) {\r\n\t\t\t\t_f = cObj.innerHTML.keywordSearchCaseless(_keyword);\r\n\t\t\t\tif (_f != -1) {\r\n\t\t\t\t\t_previousKeywordSearch_tabNum = (i + 1);\r\n\t\t\t\t\t_previousKeywordSearch_area = _const__tab;\r\n\t\t\t\t\t_previousKeywordSearch_innerHTML = cObj.innerHTML;\r\n\t\t\t\t\tSearchObj.getInstance(_previousKeywordSearch_tabNum, _previousKeywordSearch_area, _previousKeywordSearch_innerHTML, _f);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (_f == -1) {\r\n\t\t\t\tvar cObj = getGUIObjectInstanceById(_const_content + (i + 1).toString());\r\n\t\t\t\tif (cObj != null) {\r\n\t\t\t\t\t_f = cObj.innerHTML.keywordSearchCaseless(_keyword);\r\n\t\t\t\t\tif (_f != -1) {\r\n\t\t\t\t\t\t_previousKeywordSearch_tabNum = (i + 1);\r\n\t\t\t\t\t\t_previousKeywordSearch_area = _const_content;\r\n\t\t\t\t\t\t_previousKeywordSearch_innerHTML = cObj.innerHTML;\r\n\t\t\t\t\t\tSearchObj.getInstance(_previousKeywordSearch_tabNum, _previousKeywordSearch_area, _previousKeywordSearch_innerHTML, _f);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (_f == -1) {\r\n\t\t\t\tvar cObj = getGUIObjectInstanceById(_const_comments_symbol + (i + 1).toString());\r\n\t\t\t\tif (cObj != null) {\r\n\t\t\t\t\t_f = cObj.value.keywordSearchCaseless(_keyword);\r\n\t\t\t\t\tif (_f != -1) {\r\n\t\t\t\t\t\t_isAnySearchedComments++;\r\n\t\t\t\t\t\t_previousKeywordSearch_tabNum = (i + 1);\r\n\t\t\t\t\t\t_previousKeywordSearch_area = _const_comments_symbol;\r\n\t\t\t\t\t\t_previousKeywordSearch_innerHTML = ''; // there is no need to refresh the contents of a textarea to clear the previous search...\r\n\t\t\t\t\t\tSearchObj.getInstance(_previousKeywordSearch_tabNum, _previousKeywordSearch_area, _previousKeywordSearch_innerHTML, _f);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (_f == -1) {\r\n\t\t\t\tfor (var td_i = 1; td_i <= _array_numRows[(i + 1)]; td_i++) {\r\n\t\t\t\t\tvar cObj = getGUIObjectInstanceById(_const_releaseLogSubReportRow + (i + 1).toString() + '.' + + td_i.toString() + '.2');\r\n\t\t\t\t\tif (cObj != null) {\r\n\t\t\t\t\t\t_f = cObj.innerHTML.keywordSearchCaseless(_keyword);\r\n\t\t\t\t\t\tif (_f != -1) {\r\n\t\t\t\t\t\t\t_previousKeywordSearch_tabNum = (i + 1);\r\n\t\t\t\t\t\t\t_previousKeywordSearch_area = _const_releaseLogSubReport;\r\n\t\t\t\t\t\t\t_previousKeywordSearch_innerHTML = cObj.innerHTML;\r\n\t\t\t\t\t\t\tSearchObj.getInstanceEx(_previousKeywordSearch_tabNum, _previousKeywordSearch_area, cObj.id, _previousKeywordSearch_innerHTML, _f);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t} else if ( (_strategy.toUpperCase() == const_depth_last.toUpperCase()) || (_strategy.toUpperCase() == const_tab_titles.toUpperCase()) ) {\r\n\t\tfor(var i = 0; (i < len); i++) {\r\n\t\t\tvar cObj = getGUIObjectInstanceById(_const__tab + (i + 1).toString());\r\n\t\t\tif (cObj != null) {\r\n\t\t\t\t_f = cObj.innerHTML.keywordSearchCaseless(_keyword);\r\n\t\t\t\tif (_f != -1) {\r\n\t\t\t\t\t_previousKeywordSearch_tabNum = (i + 1);\r\n\t\t\t\t\t_previousKeywordSearch_area = _const__tab;\r\n\t\t\t\t\t_previousKeywordSearch_innerHTML = cObj.innerHTML;\r\n\t\t\t\t\tSearchObj.getInstance(_previousKeywordSearch_tabNum, _previousKeywordSearch_area, _previousKeywordSearch_innerHTML, _f);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (_strategy.toUpperCase() != const_tab_titles.toUpperCase()) {\r\n\t\t\tif (_f == -1) {\r\n\t\t\t\tfor(var i = 0; (i < len); i++) {\r\n\t\t\t\t\tfor (var td_i = 1; td_i <= _array_numRows[(i + 1)]; td_i++) {\r\n\t\t\t\t\t\tvar cObj = getGUIObjectInstanceById(_const_releaseLogSubReportRow + (i + 1).toString() + '.' + + td_i.toString() + '.2');\r\n\t\t\t\t\t\tif (cObj != null) {\r\n\t\t\t\t\t\t\t_f = cObj.innerHTML.keywordSearchCaseless(_keyword);\r\n\t\t\t\t\t\t\tif (_f != -1) {\r\n\t\t\t\t\t\t\t\t_previousKeywordSearch_tabNum = (i + 1);\r\n\t\t\t\t\t\t\t\t_previousKeywordSearch_area = _const_releaseLogSubReport;\r\n\t\t\t\t\t\t\t\t_previousKeywordSearch_innerHTML = cObj.innerHTML;\r\n\t\t\t\t\t\t\t\tSearchObj.getInstanceEx(_previousKeywordSearch_tabNum, _previousKeywordSearch_area, cObj.id, _previousKeywordSearch_innerHTML, _f);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (_f == -1) {\r\n\t\t\t\tfor(var i = 0; (i < len); i++) {\r\n\t\t\t\t\tvar cObj = getGUIObjectInstanceById(_const_comments_symbol + (i + 1).toString());\r\n\t\t\t\t\tif (cObj != null) {\r\n\t\t\t\t\t\t_f = cObj.value.keywordSearchCaseless(_keyword);\r\n\t\t\t\t\t\tif (_f != -1) {\r\n\t\t\t\t\t\t\t_isAnySearchedComments++;\r\n\t\t\t\t\t\t\t_previousKeywordSearch_tabNum = (i + 1);\r\n\t\t\t\t\t\t\t_previousKeywordSearch_area = _const_comments_symbol;\r\n\t\t\t\t\t\t\t_previousKeywordSearch_innerHTML = ''; // there is no need to refresh the contents of a textarea to clear the previous search...\r\n\t\t\t\t\t\t\tSearchObj.getInstance(_previousKeywordSearch_tabNum, _previousKeywordSearch_area, _previousKeywordSearch_innerHTML, _f);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (_f == -1) {\r\n\t\t\t\tfor(var i = 0; (i < len); i++) {\r\n\t\t\t\t\tvar cObj = getGUIObjectInstanceById(_const_content + (i + 1).toString());\r\n\t\t\t\t\tif (cObj != null) {\r\n\t\t\t\t\t\t_f = cObj.innerHTML.keywordSearchCaseless(_keyword);\r\n\t\t\t\t\t\tif (_f != -1) {\r\n\t\t\t\t\t\t\t_previousKeywordSearch_tabNum = (i + 1);\r\n\t\t\t\t\t\t\t_previousKeywordSearch_area = _const_content;\r\n\t\t\t\t\t\t\t_previousKeywordSearch_innerHTML = cObj.innerHTML;\r\n\t\t\t\t\t\t\tSearchObj.getInstance(_previousKeywordSearch_tabNum, _previousKeywordSearch_area, _previousKeywordSearch_innerHTML, _f);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (SearchObj.instances.length == 0) {\r\n\t\talert(notFoundMessage(_keyword, _strategy_expanded));\r\n\t} else {\r\n\t\tvar nbObj = getGUIObjectInstanceById('next_findKeywordRelease');\r\n\t\tvar sdObj = getGUIObjectInstanceById('status_findKeywordRelease');\r\n\t\tif ( (nbObj != null) && (sdObj != null) ) {\r\n\t\t\tvar so = SearchObj.instances[SearchObj.position];\r\n\t\t\tif (so._f != -1) {\r\n\t\t\t\tSearchObj.keyword = _keyword;\r\n\t\t\t\tso.hilite(_const_releaseLogSubReport, handleReleaseLogSearchResults);\r\n\t\t\t\tnbObj.style.display = (SearchObj.instances.length > 1) ? const_inline_style : const_none_style;\r\n\t\t\t\tsdObj.style.display = const_inline_style;\r\n\t\t\t\tsdObj.innerHTML = SearchObj.statusHTML();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function isInBookmarks(oll, coll, zbll) {\n var result = bookmarksPresets.hasOwnProperty(oll)\n && bookmarksPresets[oll].hasOwnProperty(coll)\n && bookmarksPresets[oll][coll].hasOwnProperty(zbll.replace(\"/\", \"s\"))\n && bookmarksPresets[oll][coll][zbll.replace(\"/\", \"s\")] == true;\n return result;\n}", "function IsFoundedPartOfText(allText, partText) {\r\n\tvar index_exist_text = allText.indexOf(partText);\r\n\tif (index_exist_text > -1) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\treturn false;\r\n}", "function word_present(command, synonyms){\n for (n in synonyms){\n var synonym = synonyms[n];\n if (synonym.charAt(0) == \"<\"){\n //must be an exact match\n synonym = synonym.substring(1);\n if (command == synonym)\n return true;\n }\n else{\n if (command.includes(synonym))\n return true;\n }\n }\n return false;\n}", "_isEntireWord(content, startIdx, length) {\n if (startIdx > 0) {\n const first = content.charCodeAt(startIdx);\n const limit = content.charCodeAt(startIdx - 1);\n if (getCharacterType(first) === getCharacterType(limit)) {\n return false;\n }\n }\n const endIdx = startIdx + length - 1;\n if (endIdx < content.length - 1) {\n const last = content.charCodeAt(endIdx);\n const limit = content.charCodeAt(endIdx + 1);\n if (getCharacterType(last) === getCharacterType(limit)) {\n return false;\n }\n }\n return true;\n }", "function is_keyword(x) {\n return keywords.indexOf(` ${x} `) >= 0;\n }", "function sc_isKeyword(s) {\n return (typeof s === \"string\") &&\n\t(s.charAt(0) === sc_KEYWORD_PREFIX);\n}", "function findKeywords() {\n\t\tvar skipwords = getSkipWords();\n\t\tvar inputwords = getInputWords();\n\t\tvar inputwordscount = inputwords.length;\n\n\t\tvar finaloutput = '';\n\t\t\n\t\tfinaloutput = findKeywordPhrases({\n\t\t\t'inputwords':inputwords,\n\t\t\t'inputwordscount':inputwordscount,\n\t\t\t'skipwords':skipwords,\n\t\t});\n\t\t\n\t\tvar wordcounts = getSingleKeywordCounts({\n\t\t\t'wordcount':inputwordscount,\n\t\t\t'words':inputwords,\n\t\t\t'skipwords':skipwords,\n\t\t});\n\t\t\n\t\tvar wordcountsbynumber = sortKeywords({'wordcounts':wordcounts});\n\t\tfinaloutput += displayKeywords({'keywords':wordcountsbynumber});\n\t\t\n\t\t$('.output-area').val(finaloutput);\n\t\t$('.output-area').change();\n\t\t$('#status-text').text(waitingForUserText());\n\t\t\n\t\treturn true;\n\t}", "function highlightSearchTerms(searchText, highlightableArea, treatAsPhrase, warnOnFailure, highlightStartTag, highlightEndTag) {\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 (treatAsPhrase) {\n searchArray = [searchText];\n } else {\n searchArray = searchText.split(\" \");\n }\n \n if (highlightableArea == null) {\n \tif (!document.body || typeof(document.body.innerHTML) == \"undefined\") {\n \tif (warnOnFailure) {\n \t\talert(\"Sorry, for some reason the text of this page is unavailable. Searching will not work.\");\n \t \t}\n \treturn false;\n \t}\n \thighlightableArea=document.body;\n }\n \n var bodyText = highlightableArea.innerHTML;\n for (var i = 0; i < searchArray.length; i++) {\n bodyText = simpleHighlight(bodyText, searchArray[i], highlightStartTag, highlightEndTag);\n }\n \n highlightableArea.innerHTML = bodyText;\n\n return true;\n}", "function findKeywordPhrases(args) {\n\t\tvar inputwords = args['inputwords'];\n\t\tvar inputwordscount = args['inputwordscount'];\n\t\tvar skipwords = args['skipwords'];\n\t\t\n\t\tvar finaloutput = '';\n\t\t\n\t\tvar separator = getKeywordSectionSeparator();\n\t\t\n\t\tif($('.include-phrases').is(':checked')) {\n\t\t\t\t// Six-Word Phrases\n\t\t\tvar sixwordphrases = getSixWordPhraseCounts(args);\n\t\t\tvar sixwordphrasessorted = sortKeywords({'wordcounts':sixwordphrases});\n\t\t\tvar sixwordphrasetext = displayKeywords({'keywords':sixwordphrasessorted});\n\t\t\t\n\t\t\tif(sixwordphrasetext.length !== 0) {\n\t\t\t\tfinaloutput += sixwordphrasetext + separator;\n\t\t\t}\n\t\t\t\n\t\t\t\t// Five-Word Phrases\n\t\t\tvar fivewordphrases = getFiveWordPhraseCounts(args);\n\t\t\tvar fivewordphrasessorted = sortKeywords({'wordcounts':fivewordphrases});\n\t\t\tvar fivewordphrasetext = displayKeywords({'keywords':fivewordphrasessorted});\n\t\t\t\n\t\t\tif(fivewordphrasetext.length !== 0) {\n\t\t\t\tfinaloutput += fivewordphrasetext + separator;\n\t\t\t}\n\t\t\t\n\t\t\t\t// Four-Word Phrases\n\t\t\tvar fourwordphrases = getFourWordPhraseCounts(args);\n\t\t\tvar fourwordphrasessorted = sortKeywords({'wordcounts':fourwordphrases});\n\t\t\tvar fourwordphrasetext = displayKeywords({'keywords':fourwordphrasessorted});\n\t\t\t\n\t\t\tif(fourwordphrasetext.length !== 0) {\n\t\t\t\tfinaloutput += fourwordphrasetext + separator;\n\t\t\t}\n\t\t\t\n\t\t\t\t// Three-Word Phrases\n\t\t\tvar threewordphrases = getThreeWordPhraseCounts(args);\n\t\t\tvar threewordphrasessorted = sortKeywords({'wordcounts':threewordphrases});\n\t\t\tvar threewordphrasetext = displayKeywords({'keywords':threewordphrasessorted});\n\t\t\t\n\t\t\tif(threewordphrasetext.length !== 0) {\n\t\t\t\tfinaloutput += threewordphrasetext + separator;\n\t\t\t}\n\t\t\t\n\t\t\t\t// Two-Word Phrases\n\t\t\tvar twowordphrases = getTwoWordPhraseCounts(args);\n\t\t\tvar twowordphrasessorted = sortKeywords({'wordcounts':twowordphrases});\n\t\t\tvar twowordphrasetext = displayKeywords({'keywords':twowordphrasessorted});\n\t\t\t\n\t\t\tif(twowordphrasetext.length !== 0) {\n\t\t\t\tfinaloutput += twowordphrasetext + separator;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn finaloutput;\n\t}", "validContent(content) {\n let result = this.contentMatch.matchFragment(content);\n if (!result || !result.validEnd)\n return false;\n for (let i = 0; i < content.childCount; i++)\n if (!this.allowsMarks(content.child(i).marks))\n return false;\n return true;\n }", "function startsOrEndsWith(checkText, checkWord){\n\t\tif(checkText == undefined || checkText == null || checkWord == undefined ||checkWord == null){ //one or more of the parameters does not contain any data\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(startsWith(checkText, checkWord) || endsWith(checkText, checkWord)){\n\t\t\treturn true;\n\t\t} else{\n\t\t\treturn false;\n\t\t}\n\t}", "function checkKW(msg,kwc,q){\n var x;\n for (var i=0; i<kwc.length; i++){\n x = x || q.indexOf(kwc[i]) > 0 \n }\n if (!x){\n msg.respond(\"Error: incoming packages requires keyword(s): \"+kwc.join(\" or \"));\n msg.respond(PACKAGE_HELP_TEXT);\n return false;\n }\n return true;\n}", "doesPostMatchWords(post, words) {\n const { content, raw } = post;\n const regex = new RegExp(words.join(\"|\"), 'gi');\n if (\n words.length\n && (\n regex.test(content)\n || regex.test(raw.caption)\n || regex.test(raw.title)\n || regex.test(raw.description)\n || regex.test(raw.imageText)\n )\n ) {\n return true;\n }\n return false;\n }", "transcriptMatches() {\n for (const utterance of this.intentDefinition.utterances) {\n if (this.transcript.includes(utterance)) {\n return true;\n }\n }\n return false;\n }", "function isTagApproved(value) {\n if([\n 'kids'\n, 'music'\n, 'family'\n, 'free'\n, 'outside'\n, 'art'\n, 'fitness'\n, 'theater'\n, 'theater '\n, 'bars '\n, 'bars'\n, 'none'\n].indexOf(value) !== -1)\n return true;\n else\n return false;\n}", "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(\"Por alguna razon el texto de esta pagina no se encuentra disponible, por lo que la busqueda no servira.\");\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 }\r\n \r\n document.body.innerHTML = bodyText;\r\n return true;\r\n}", "function searchTermListedAsKeyword(article, searchTerm) {\n if(article['keywords'] === undefined) return false;\n\n // Regex that converts human names from `First Last` to `Last, First` for use with NYT Keyword search\n var personTerm = searchTerm.replace(/^(.+?) ([^\\s,]+)(,? (?:[JS]r\\.?|III?|IV))?$/i,\"$2, $1$3\");\n var keywords = Array.prototype.slice.call(article['keywords']);\n var similarityThreshold = 0.5;\n \n for(var i = 0; i < keywords.length; i++) {\n var keyword = keywords[i]['value'];\n if(!keyword) continue;\n\n // Levenshtein distance calculation\n var keywordCheck = FuzzySet([keyword]);\n var searchCheck = keywordCheck.get(searchTerm);\n var personCheck = keywordCheck.get(personTerm);\n\n if( (searchCheck !== null && searchCheck[0][0] > similarityThreshold) || \n (personCheck !== null && personCheck[0][0] > similarityThreshold)) {\n return true;\n }\n }\n return false;\n}", "function wordsMatchFound(questionStatement, words){\n\tfor (i = 0; i < words.length; i++) {\n\t\tif(questionStatement.toUpperCase().indexOf(words[i].toUpperCase()) <0){\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "function checkwords(){\n\n var comment_raw = $(this).val();\n var comment_stripped = comment_raw.replace(/[^\\w\\s]|_/g, \"\").replace(/\\n/g, \" \").replace(/\\s+/g, \" \");\n var words = [];\n words = comment_stripped.split(' ');\n //reset incorrect_words\n incorrect_words = [];\n\n $.each(words, function(index, item){\n var is_in_vocab = false;\n for (var i = 0; i < vocab.responseJSON.word.length; ++i){\n var thisWord = vocab.responseJSON.word[i].name;\n if(thisWord.toUpperCase()===this.toUpperCase()){\n is_in_vocab = true;\n break;\n }\n //when we are checking the last word in the vocab, if it doesn't match the word typed\n else if(i == (vocab.responseJSON.word.length - 1) && thisWord.toUpperCase()!=this.toUpperCase() && this.length > 0){\n incorrect_words.push(this);\n }\n }\n // show whether each number word in the comment is in the vocab\n //console.log(index+' = '+is_in_vocab);\n //console.log(incorrect_words);\n })\n }", "function judgeByPartialMatch(word, query, queryStartWithUpper) {\n var _a, _b;\n if (query === \"\") {\n return {\n word: Object.assign(Object.assign({}, word), { hit: word.value }),\n value: word.value,\n alias: false,\n };\n }\n if (lowerStartsWith(word.value, query)) {\n if (queryStartWithUpper &&\n word.type !== \"internalLink\" &&\n word.type !== \"frontMatter\") {\n const c = capitalizeFirstLetter(word.value);\n return { word: Object.assign(Object.assign({}, word), { value: c, hit: c }), value: c, alias: false };\n }\n else {\n return {\n word: Object.assign(Object.assign({}, word), { hit: word.value }),\n value: word.value,\n alias: false,\n };\n }\n }\n const matchedAliasStarts = (_a = word.aliases) === null || _a === void 0 ? void 0 : _a.find((a) => lowerStartsWith(a, query));\n if (matchedAliasStarts) {\n return {\n word: Object.assign(Object.assign({}, word), { hit: matchedAliasStarts }),\n value: matchedAliasStarts,\n alias: true,\n };\n }\n if (lowerIncludes(word.value, query)) {\n return {\n word: Object.assign(Object.assign({}, word), { hit: word.value }),\n value: word.value,\n alias: false,\n };\n }\n const matchedAliasIncluded = (_b = word.aliases) === null || _b === void 0 ? void 0 : _b.find((a) => lowerIncludes(a, query));\n if (matchedAliasIncluded) {\n return {\n word: Object.assign(Object.assign({}, word), { hit: matchedAliasIncluded }),\n value: matchedAliasIncluded,\n alias: true,\n };\n }\n return { word: word, alias: false };\n}", "function filterBook(q, b) {\n var searchWords = q.search && q.search.split(/\\s+/) || [];\n return (q.reviewed != 'R' || b.reviewed) &&\n (!q.audience || q.audience == b.audience) &&\n (q.language == b.language) &&\n (!q.category || b.categories.indexOf(q.category) != -1) &&\n (searchWords && allWordsInText(searchWords, bookText(b)));\n }", "getByKeyword(query) {\n axios\n .get(this.BASE_URL + \"/jokes\")\n .then(response => {\n //Clear the Joke Container\n document.getElementsByClassName(\"right-container\")[0].innerHTML = \"\";\n response.data.forEach(joke => {\n //If Jokes Includes Query String, Display Joke\n if (joke.content.includes(query)) {\n this.displayJoke(joke);\n }\n });\n })\n .catch(err => {\n console.error(err);\n });\n }", "function getWord(word) {\n for (let i = 0; i < notes.length; i++) {\n if (notes[i].content.indexOf(word) != - 1) {\n console.log(`You are looking for id:${notes[i].id} ${notes[i].content}`);\n };\n }\n console.log(`You do not have any task including ${word}`);\n}", "function docInWorker($docID) {\n\tvar flag = false;\n\n\twManager.forEach(quene => {\n\t\tif (quene.indexOf($docID) >= 0) flag = true;\n\t});\n\n\treturn flag;\n}", "getKeywordsInAspectBuild(asp) {\n let ref = this.getReferenceById(asp.id)\n\n let keywords = new Set() // all keywords that this aspect can offer\n let keywordsInBuild = [] // keywords contained in the subnodes the user has chosen\n\n let betterInfo = {}\n\n function updateKeywordInfo(keyword, boonType) {\n if (!boonType)\n return\n\n if (Object.keys(betterInfo).includes(keyword)) {\n betterInfo[keyword][boonType] = true\n }\n else {\n betterInfo[keyword] = {mutator: boonType === \"mutator\", activator: boonType === \"activator\"}\n }\n }\n\n // go through all the nodes of this aspect and find keywords\n for (let x in ref.nodes) {\n let node = ref.nodes[x]\n\n let subNode = node.subNodes[asp.nodes[x]]\n\n // iterate through stat boosts and look for certain ones which give keyword activators/mutators\n for (let z in subNode) {\n let subNodeStat = subNode[z]\n\n // if this node has a statBoost capable of giving a keyword, check if it does and add it\n if ((miscData.boostsWithKeywords.includes(subNodeStat.type)) && subNodeStat.keyword != null) {\n keywordsInBuild.push(subNodeStat.keyword)\n }\n\n // if this node references multiple keywords (only a few do), add them. These are manually defined in miscData\n if (utils.hasKey(miscData.nodesWithExtraKeywords, subNodeStat.id)) {\n for (let v in miscData.nodesWithExtraKeywords[subNodeStat.id]) {\n keywordsInBuild.push(miscData.nodesWithExtraKeywords[subNodeStat.id][v])\n }\n }\n }\n\n // go through every subnode to note down all the keywords offered in this aspect\n for (let v in node.subNodes) {\n for (let z in node.subNodes[v]) {\n let statBoost = node.subNodes[v][z]\n if ((miscData.boostsWithKeywords.includes(statBoost.type)) && statBoost.keyword != null) {\n keywords.add(statBoost.keyword)\n\n updateKeywordInfo(statBoost.keyword, statBoost.keywordBoon)\n }\n\n if (utils.hasKey(miscData.nodesWithExtraKeywords, statBoost.id)) {\n for (let v in miscData.nodesWithExtraKeywords[statBoost.id]) {\n keywords.add(miscData.nodesWithExtraKeywords[statBoost.id][v])\n\n // are all of these mutator tho? todo\n updateKeywordInfo(miscData.nodesWithExtraKeywords[statBoost.id][v], \"mutator\")\n }\n }\n }\n }\n }\n\n return {allKeywords: keywords, keywordsGotten: keywordsInBuild, betterInfo: betterInfo}\n }", "function RequireKeywords(strFormID,strFieldName) {\n if (document.forms[strFormID].elements[strFieldName].value.length <= 3) {\n alert(\"Please alter your requested keyword(s) in the search form.\\nThe search phrase must be 3 characters or more in length.\")\n return false;\n }\n}", "function checkForTagMatch(item) {\n \n // check for no tags\n if(!item.searchString || !item.searchString.length) return false;\n \n \n // for each search tag that user has entered, check if \n // it exists in the items tags array.\n // @note that we check against item.searchString which is a string\n // assembled on save from the tags\n // this save a lot in performance since we dont need to iternate though arrays\n var isValid = false; \n \n _.each(searchTags, function(tag) {\n if(item.searchString.toLowerCase().indexOf(tag) !== -1) {\n isValid = true;\n }\n });\n \n return isValid;\n }", "checkLetter(letter) {\n if (this.phrase.includes(letter)) { //the includes() method was used from https://www.w3schools.com/Jsref/jsref_includes.asp\n return true;\n } else {\n return false;\n }\n}", "function BOT_wordIsJud(word) {\r\n\tfor (var i in BOT_judgementList) {\r\n\t\tif( word == BOT_judgementList[i][0] ) return(true) \r\n\t}\r\n\treturn (false)\r\n}", "function ck_sect(sect, deptcheck, sncheck){\n\tvar i, dept=grab(\"dept\").value.toUpperCase(), sname=grab(\"surname\").value.toUpperCase(),\n\tdeptck = function(c){\n\t\tif(!dept || !deptcheck) return true;\n\t\tif(c.d === \"ALL\" || c.d === dept) return true;\n\t\treturn false;\n\t}, snck = function(c){\n\t\tif(!sname || !sncheck) return true;\n\t\tvar cmp = function(x){ return sname.localeCompare(x, \"tr\"); };\n\t\tif(cmp(c.s) >= 0 && cmp(c.e) <= 0) return true;\n\t\treturn false;\n\t};\n\tif(sect.c.length === 0) return true;\n\tfor(i=0; i<sect.c.length; i++) if(deptck(sect.c[i]) && snck(sect.c[i])) return true;\n\treturn false;\n}", "getByTag(tag) {\n let lex = this.words\n let res = {}\n let words = Object.keys(lex)\n for (let i = 0; i < words.length; i++) {\n if (typeof lex[words[i]] === 'string') {\n if (lex[words[i]] === tag) {\n res[words[i]] = true\n }\n } else if (lex[words[i]].some(t => t === tag)) {\n res[words[i]] = true\n }\n }\n return res\n }", "static hasSegment(key) {\n return Object.keys(this.segments).includes(key);\n }", "async tagIsAvailable() {\n // get tag from state\n let tag = await this.state.tag\n tag = tag.toLowerCase()\n\n // is tag proper length\n if (tag.length<3 || tag.length>18)\n return false\n\n // is tag proper format\n if (tag.match(/^[a-z0-9]+$/i) === null)\n return false\n\n // is tag restricted (notable, reserved, offensive...)\n var tagRestricted = false\n Object.keys(restrictedTags).map(function(element) {\n if (restrictedTags[element].includes(tag)) {\n tagRestricted = true\n }\n return true\n })\n if (tagRestricted)\n return false\n\n // is tag taken by another user\n if (await isDocWhere(\"tag\",tag))\n return false\n\n return true\n }", "isFirstLineFitForPara(bottom, paraWidget) {\n let lineWidget = paraWidget.childWidgets[0];\n let cellwidget = lineWidget.paragraph.containerWidget;\n // let document: WordDocument = undefined;\n // if (!isNullOrUndefined(lineWidget.paragraph.currentNode) && !isNullOrUndefined(cellwidget.containerWidget)) {\n // document = WordDocument.getDocumentOf(lineWidget.paragraph.currentNode);\n // }\n //checks first line of the page is exceed the page height\n if (this.viewer.isFirstLineFitInShiftWidgets) {\n if (this.viewer.clientActiveArea.y === this.viewer.clientArea.y && paraWidget.y + lineWidget.height >= bottom) {\n return true;\n }\n }\n else {\n // For nested tables,\n if (cellwidget.ownerTable.isInsideTable) {\n // Gets the container cell widgets, consider it as client area for the cell widget.\n let containerCellWidget = undefined;\n if (cellwidget.containerWidget instanceof TableRowWidget &&\n cellwidget.containerWidget.containerWidget instanceof TableWidget\n && cellwidget.containerWidget.containerWidget.containerWidget instanceof TableCellWidget) {\n containerCellWidget = cellwidget.containerWidget.containerWidget.containerWidget;\n }\n if (!isNullOrUndefined(containerCellWidget) && cellwidget.containerWidget.y === containerCellWidget.y\n && paraWidget.y + lineWidget.height >= bottom) {\n return true;\n }\n }\n else if (cellwidget.containerWidget.y === this.viewer.clientArea.y && paraWidget.y + lineWidget.height >= bottom) {\n return true;\n }\n }\n return (paraWidget.y + lineWidget.height <= bottom);\n }", "function checkDescription(item) {\n return item.description.toLowerCase().includes(searchTerm.toLowerCase()) // Make it case insensitive\n }", "function findSearch(searchTerm) {\r\n\r\nfor (var i = 0; i < jobList.length; i++) {\r\n if (jobList[i].JobTitle.toLowerCase().includes(searchTerm.toLowerCase()) || jobList[i].Category.toLowerCase().includes(searchTerm.toLowerCase() ) || jobList[i].Location.toLowerCase().includes(searchTerm.toLowerCase() ) ) {\r\n document.getElementById(i).style.display = \"block\"\r\n }\r\n else{\r\n document.getElementById(i).style.display = \"none\"\r\n }\r\n } \r\n}", "function checkSubStringMatch(item) {\n return item.name.toLowerCase().includes(SearchString.toLowerCase());\n }", "function match(data, keyword) {\n\t if (typeof data === 'number') {\n\t data = '' + data;\n\t }\n\t if (typeof data === 'string') {\n\t return data.toLowerCase().indexOf(keyword) !== -1;\n\t }\n\t if (typeof data !== 'object' || data === null) {\n\t return false;\n\t }\n\t if (data instanceof Array) {\n\t for (let i = 0; i < data.length; i++) {\n\t if (match(data[i], keyword)) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t }\n\t for (const key in data) {\n\t if (match(data[key], keyword)) {\n\t return true;\n\t }\n\t }\n\t return false;\n\t}", "function isSearched(s) {\n return function(item) {\n const searchTerm = s;\n let wasFound = true;\n\n s.split(\" \").forEach(searchTerm => {\n let termFound = false;\n if (item.info.location.toLowerCase().includes(searchTerm.toLowerCase()) || item.info.title.toLowerCase().includes(searchTerm.toLowerCase()) || item.info.description.toLowerCase().includes(searchTerm.toLowerCase()) || item.info.skill_summary.toLowerCase().includes(searchTerm.toLowerCase()) || item.info.level.toLowerCase().includes(searchTerm.toLowerCase())) {\n termFound = true;\n }\n wasFound = wasFound && termFound;\n });\n\n return !searchTerm || wasFound;\n };\n}", "checkBookmarks(articleObj) {\n if (this.state.bookmarkedNews.length > 0) {\n for (let i = 0; i < this.state.bookmarkedNews.length; i++) {\n if (this.state.bookmarkedNews[i].uuid === articleObj.uuid) {\n return true;\n }\n }\n return false;\n } else {\n return false;\n }\n }", "function find(stg)\n{\n return sentence.includes(stg);\n}", "function insideWord(check, state$1, from, to) {\n return check(state$1.sliceDoc(from, from + 1)) == state.CharCategory.Word\n && check(state$1.sliceDoc(to - 1, to)) == state.CharCategory.Word;\n}", "function BOT_wordIsPss(word) {\r\n\tif(word == \"of\") return(true) \r\n}", "function exact(context, value) {\n var index = -1\n\n if (context.data[value]) {\n return !flag(context.flags, 'ONLYINCOMPOUND', context.data[value])\n }\n\n // Check if this might be a compound word.\n if (value.length >= context.flags.COMPOUNDMIN) {\n while (++index < context.compoundRules.length) {\n if (context.compoundRules[index].test(value)) {\n return true\n }\n }\n }\n\n return false\n}", "function isExactMatch(datapoint) {\n if (datapoint.japanese.length > 0) {\n let first = datapoint.japanese[0];\n let rest = datapoint.japanese.slice(1);\n let query = datapoint.query;\n\n // datapoint passes by reference; can't just do datapoint.japanese = rest\n let next_check = {\n japanese: rest,\n query: query\n }\n return (first.word === query || first.reading === query) || isExactMatch(next_check);\n }\n else {\n isLoading = false;\n $(\".jisho-results-loading-text\").css(\"display\", \"none\");\n return false\n }\n}", "function nextNodeMaybeContinuesWord({nodes, nextIndex, remainingPart}) {\n if (remainingPart === '') return false;\n const nextNode = nodes[nextIndex];\n const content = getContent(nextNode);\n if (!content) return;\n\n const includesNext =\n content.startsWith(remainingPart) || remainingPart.startsWith(content);\n\n const overlap = findOverlap(content, remainingPart);\n\n if (overlap === remainingPart && content.startsWith(remainingPart)) {\n return true;\n }\n\n if (includesNext) {\n return nextNodeMaybeContinuesWord({\n nodes,\n nextIndex: nextIndex + 1,\n remainingPart: remainingPart.replace(content, ''),\n });\n } else {\n return false;\n }\n}", "function isAlreadyHighlighted(highlighted) {\n var highlights = getFinalText();\n for (var i = 0; i < highlights.length; i++) {\n if (highlights[i].includes(highlighted)) {\n return true;\n }\n }\n\n return false;\n}", "textContains(text){\n return !!SEARCHABLE_PROPERTIES.find(key => {\n return (this.get(key) && (this.get(key).toLowerCase()).indexOf(text.toLowerCase()) > -1) \n })\n }", "function BOT_wordIsKey(word) {\r\n\tif(BOT_member(BOT_keyList,word)) return(true) \r\n\telse return (false)\r\n}", "function excerptRequired() {\n let excerpt = this.excerpt\n return typeof excerpt === 'string' ? false : true\n}", "static checkSections(val) {\n return val ?? false;\n }", "function containsTitle (arr, val) {\n logger.trace(\"Entering containsTitle function\");\n if ((val === undefined) || (val === null)) {\n return true;\n }\n\n for (var i = 0; i < arr.length ; i++) {\n if (arr[i].type === \"movie\") {\n if (arr[i].movies.title === val) {\n return true;\n }\n }\n }\n return false;\n}", "async function isJobRunning(){\n\tconst brandsRef = firestore.collection('brands');\n\tvar snapshot = await brandsRef.where('status', '==', 'progress').get();\n\tif (!snapshot.empty) return true;\n\n\tconst productsRef = firestore.collection('products');\n\tvar snapshot = await productsRef.where('status', '==', 'progress').get();\n\tif (!snapshot.empty) return true;\n\n return false; // we are good to go \t\n}", "function avoidsUndesirableContent(text) {\n //avoids politics\n let politicalWords = [\"trump\", \"biden\", \"election\", \"democrat\", \"republican\", \"vote\", \"poll\", \"polling\"]\n for (let i = 0; i < politicalWords.length; i++) {\n if (text.toLowerCase().includes(politicalWords[i])) {\n return false;\n }\n }\n return true;\n}", "some(callback, subject, predicate, object, graph) {\n for (const quad of this.readQuads(subject, predicate, object, graph)) if (callback(quad)) return true;\n return false;\n }", "function isFileToSearchExist(courseRefId, htmFileName) {\n\t\n\tvar indexOfhtmFile = '';\n\tvar isGlossaryFile = false;\n\t\n\tif(courseRefId == null || typeof courseRefId == 'undefined' \n\t\t|| htmFileName == null || typeof htmFileName == 'undefined') {\n\t\t\treturn false;\n\t\t}\n\t\n\t// Check if glossary description file\n\tif(htmFileName.indexOf('g/') != -1 ) {\n\t\tisGlossaryFile = true;\n\t}\n\t\n\t// if glossary term\n\tif(isGlossaryFile) {\n\t\n\t\tif(glossaryTerm != null && typeof glossaryTerm != 'undefined') {\n\t\t\t\n\t\t\tbasePath = document.location.href.substring(0,document.location.href.indexOf('control.htm') - (courseInstanceId_dyn.length+1));\n\t\t\tvar htmFileNameWithPath = basePath+courseRefId+'/'+htmFileName;\n\t\t\t\n\t\t\tif(glossaryTerm[htmFileName] != null && typeof glossaryTerm[htmFileName] != 'undefined'){\n\t\t\t// Current course glossary terms\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse if(glossaryTerm[htmFileNameWithPath] != null && typeof glossaryTerm[htmFileNameWithPath] != 'undefined') {\n\t\t\t// Reference course glossary terms\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn false;\n\t}\n\t\t\n\tindexOfhtmFile = parseInt(htmFileName.substring(0, htmFileName.indexOf('.htm')),10) ;\n\tif(courseRefId == courseInstanceId_dyn && indexOfhtmFile < 4) {\n\t\treturn true;\n\t}\n\t\t\n\tfor(var iCnt = 0 ; iCnt < CategoryList.length; iCnt++) {\n\t\tif(CategoryList[iCnt].CategoryCode.indexOf(' ') == -1 && courseRefId == CategoryList[iCnt].courseReferenceId) {\n\t\t\tvar intChapterFirstPage = CategoryList[iCnt].FirstQuestion;\n\t\t\tvar intChapterLastPage = CategoryList[iCnt].LastQuestion;\n\t\t\t\n\t\t\tif(indexOfhtmFile >= intChapterFirstPage && indexOfhtmFile <= intChapterLastPage) {\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\t\n\t}\n\treturn false;\n}", "isDescriptiveText(textContent) {\n // Handle when the text is undefined or null\n if (typeof textContent === \"undefined\" || textContent === null) {\n return false;\n }\n\n let stopWords = [\n \"click\", \"tap\", \"go\", \"here\", \"learn\", \"more\", \"this\", \"page\",\n \"link\", \"about\"\n ];\n // Generate a regex to match each of the stopWords\n let stopWordsRE = new RegExp(`\\\\b(${stopWords.join(\"|\")})\\\\b`, \"ig\");\n\n textContent = textContent\n // Strip leading non-alphabetical characters\n .replace(/[^a-zA-Z ]/g, \"\")\n // Remove the stopWords\n .replace(stopWordsRE, \"\");\n\n // Return whether or not there is any text left\n return textContent.trim() !== \"\";\n }", "function handlePartcodeSearch(partcode) {\n if (partcode != '') {\n const isFound = connect.partcodes.hasPartcode(partcode);\n // console.log(`isFound: ${isFound}`);\n return isFound;\n }\n}", "function isSolved()\n{\n var solved = true;\n\n //Loop through the phrases array and check if there are any more dashes.\n for(let i = 0; i < phrase.length; i++)\n {\n if(phrase[i] === '-')\n {\n solved = false;\n }\n }\n\n return solved;\n}", "function hasALetterQ(pet) {\n for (const key in pet) {\n const element = pet[key].toString().toLowerCase();\n if (element.includes(\"q\")) {\n return true;\n }\n }\n}", "function fnPluginTaskSearch_afterDisplay() {\n\t/*<!-- build:debug -->*/\n\tif (marknotes.settings.debug) {\n\t\tconsole.log(\"\t Plugin Page html - Search - A note has been displayed\");\n\t}\n\t/*<!-- endbuild -->*/\n\n\tif ($.isFunction($.fn.highlight)) {\n\t\t// Get the searched keywords.\n\t\t// Apply the restriction on the size.\n\t\tvar $searchKeywords = $(\"#search\")\n\t\t\t.val()\n\t\t\t.substr(0, marknotes.search.max_width)\n\t\t\t.trim();\n\n\t\tif ($searchKeywords !== \"\") {\n\t\t\t$arrKeywords = $searchKeywords.split(\",\");\n\n\t\t\tfor (var i = 0; i < $arrKeywords.length; i++) {\n\t\t\t\t$highlight = $arrKeywords[i];\n\n\t\t\t\t/*<!-- build:debug -->*/\n\t\t\t\tif (marknotes.settings.debug) {\n\t\t\t\t\tconsole.log(\"Highlighting \" + $highlight);\n\t\t\t\t}\n\t\t\t\t/*<!-- endbuild -->*/\n\n\t\t\t\t$(\"#CONTENT\").highlight($highlight);\n\t\t\t} // for\n\t\t} // if ($searchKeywords !== '')\n\t} // if ($.isFunction($.fn.highlight))\n\n\treturn true;\n}", "function checkvalue() {\n var searchkeyword = $.trim(document.getElementById('tags').value);\n var searchplace = $.trim(document.getElementById('searchplace').value);\n if (searchkeyword == \"\" && searchplace == \"\") {\n alert('Please enter Keyword');\n return false;\n }\n}", "function longPlaneteerCalls(words){\nfor(let i = 0 ; i < words.length; i++){\nif(words[i].length > 4){\nreturn true\n}\n}\nreturn false\n}", "is(tag) {\n if (tag === \"*\") {\n return true;\n }\n if (Array.isArray(tag)) {\n for (const t of tag) {\n if (!tags.includes(t)) {\n return false;\n }\n }\n return true;\n }\n return tags.includes(tag);\n }", "function appQuickSearch(){\n\tvar keyword = $('#keywords').val();\n\tif(keyword == '' || keyword.indexOf('...') != -1){\n\t\treturn false;\n\t}else{\n\t\tdocument.frmQuickSearch.submit();\n\t\treturn true;\n\t}\n}" ]
[ "0.57094926", "0.56351435", "0.5600545", "0.55483174", "0.5374679", "0.5321924", "0.52911985", "0.5243705", "0.5152925", "0.51045793", "0.5012968", "0.5009523", "0.49521115", "0.4920817", "0.49020803", "0.48910818", "0.48652738", "0.48642173", "0.4859905", "0.4859905", "0.4859905", "0.4859905", "0.4859287", "0.48470485", "0.48390263", "0.48310784", "0.4816926", "0.48088813", "0.48033196", "0.47999042", "0.47977883", "0.47855106", "0.4780254", "0.47755086", "0.47722238", "0.47666347", "0.47604966", "0.47556612", "0.4744721", "0.47395998", "0.47001255", "0.46881756", "0.4683353", "0.4664725", "0.46528924", "0.46157742", "0.46088856", "0.4605017", "0.46001333", "0.4599742", "0.45959237", "0.45884466", "0.45741037", "0.45718333", "0.4561731", "0.4549484", "0.45387745", "0.4511412", "0.45053586", "0.4500512", "0.44740483", "0.44733942", "0.44729882", "0.44578892", "0.4456138", "0.44525117", "0.44469312", "0.44447023", "0.4431872", "0.44287598", "0.44159204", "0.44136414", "0.441015", "0.4408025", "0.4407155", "0.4402553", "0.44019276", "0.44009513", "0.43985802", "0.43959892", "0.43914694", "0.43910152", "0.43767872", "0.4374433", "0.4373032", "0.43697906", "0.4367792", "0.43660203", "0.43659002", "0.43572766", "0.43568203", "0.43505937", "0.43449676", "0.43427768", "0.4324956", "0.4301765", "0.43007818", "0.4300561", "0.4299356", "0.42958117" ]
0.6471116
0
Paramters: A geojson point for the job location, and a geojson point for the preference, and a distance in km Function: Returns true if the distance between two points is within the distanceLimit Output: True if the distance between two points is within distanceLimit
function rateLocations(jobPoint, jobPointPref, distanceLimit){ locationArray = []; locationArray.push(geojsonTools.toArray(jobPoint)); locationArray.push(geojsonTools.toArray(jobPointPref)); var distance = geojsonTools.getDistance(locationArray); if(distanceLimit > distance){ return true; } else{ return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isDistanceBetweenPointsWithinRange (userLat, userLong, reportLat, reportLong, radius){\n \n\tvar radlat1 = Math.PI * userLat/180;\n\tvar radlat2 = Math.PI * reportLat/180;\n\tvar radlon1 = Math.PI * userLong/180;\n\tvar radlon2 = Math.PI * reportLong/180;\n\tvar theta = userLong-reportLong;\n\tvar radtheta = Math.PI * theta/180\n\tvar dist = Math.sin(radlat1) * Math.sin(radlat2) + Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);\n\tdist = Math.acos(dist)\n\tdist = dist * 180/Math.PI\n\tdist = dist * 60 * 1.1515\n\tvar distanceInKilos = dist * 1.609344;\n\t//check if the distance is less or equal to the radius\t\n\treturn (distanceInKilos > radius? false: true);\n\n}", "function checkDistance(point_a, point_b){\n return calculateDistance(point_a, point_b) <= MAX_DISTANCE_FOR_REPORT;\n}", "IsWithinGeofence(position, location) {//coordinates of two GPS positions\n    let radLat1 = this.Rad(position.Latitude);\n     let radLat2 = this.Rad(location.Latitude);\n let a = radLat1 - radLat2;\n let b = this.Rad(position.Longitude) - this.Rad(location.Longitude);\n let s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +\n     Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));\n     s = s * 6378.137;// EARTH_RADIUS;\n   s = Math.round(s * 10000) / 10000; //the unit of output is Kilometer \n console.log(`DistanceToTarget is ${s}`);\n     s = s.toFixed(2);//Keep two digit after point\n if(s<location.Radius){\n return true;\n };\n return false;\n }", "function closeEnough(latLong, otherLatLong) {\r\n return Math.abs(latLong[0] - otherLatLong[0]) < 0.01 && Math.abs(latLong[1] - otherLatLong[1]) < 0.01;\r\n}", "function isWithinAllowedRange()\n {\n var r=$q.defer();\n navigator.geolocation.getCurrentPosition(function(position){\n var distanceMeters = 1000 * getDistanceFromLatLonInKm(position.coords.latitude, position.coords.longitude, 45.474127399999996, -73.6011402);\n //var distanceMeters=1000*getDistanceFromLatLonInKm(position.coords.latitude, position.coords.longitude,45.5072138,-73.5784825);\n //var distanceMeters = 100;\n /*alert('Distance: '+ distanceMeters+\n 'Latitude: ' + position.coords.latitude + '\\n' +\n 'Longitude: ' + position.coords.longitude + '\\n' +\n 'Altitude: ' + position.coords.altitude + '\\n' +\n 'Accuracy: ' + position.coords.accuracy + '\\n' +\n 'Altitude Accuracy: ' + position.coords.altitudeAccuracy + '\\n' +\n 'Heading: ' + position.coords.heading + '\\n' +\n 'Speed: ' + position.coords.speed + '\\n' +\n 'Timestamp: ' + position.timestamp + '\\n');*/\n\n if (distanceMeters <= 300) {\n positionCheckinAppointment = {\n 'Latitude':position.coords.latitude,\n 'Longitude':position.coords.longitude,\n 'Accuracy':position.coords.accuracy\n };\n r.resolve('Check-in to your Appointment');\n } else {\n r.reject('Checkin allowed in the vecinity of the Cancer Center');\n }\n\n }, function(error){\n console.log(error.code);\n r.reject('Could not obtain location');\n });\n return r.promise;\n }", "IsWithinInterestLocation(position, location) {//two locations\n    let radLat1 = this.Rad(position.Latitude);\n     let radLat2 = this.Rad(location.Latitude);\n let a = radLat1 - radLat2;\n let b = this.Rad(position.Longitude) - this.Rad(location.Longitude);\n let s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +\n     Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));\n     s = s * 6378.137;// EARTH_RADIUS;\n   s = Math.round(s * 10000) / 10000; //the unit of output is Kilometer \n console.log(`DistanceToTarget is ${s}`);\n     s = s.toFixed(2);//Keep two digit after point\n if(s<Config.InterestDistance){ // if the distance between location and truck is near enough\n return true;\n };\n return false;\n }", "function _withinDistance(p1, p2, distance){\n\t\tvar dx = p1.x-p2.x;\n\t\tvar dy = p1.y-p2.y;\n\t\treturn ((dx*dx + dy*dy) < distance*distance);\n\t}", "function withinPerimeter(maxLatitude, minLatitude, maxLongitude, minLongitude, pointLatitude, pointLongitude){\n\t\tvar inPerimeter = false;\n\t\tif(\tminLatitude <= pointLatitude \n\t\t\t&& pointLatitude <= maxLatitude \n\t\t\t&& minLongitude <= pointLongitude\n\t\t\t&& pointLongitude <= maxLongitude ){\n\n\t\t\tinPerimeter = true;\n\t\t\tconsole.log(\"Point within Safety Perimeter\");\n\t\t}\n\t\treturn inPerimeter;\n\t}", "function findPlaces(loc_1, loc_2, time_threshold, velocity_threshold){\n\tlat1 = sevenDays[loc_1]['latitudeE7'];\n\tlon1 = sevenDays[loc_1]['longitudeE7'];\n\tlat2 = sevenDays[loc_2]['latitudeE7'];\n\tlon2 = sevenDays[loc_2]['longitudeE7'];\n\t//console.log(haversineDist(lat1, lon1, lat2, lon2));\n\tdist = haversineDist(lat1, lon1, lat2, lon2);\n\ttime1 = parseInt(sevenDays[loc_1]['timestampMs']);\n\ttime2 = parseInt(sevenDays[loc_2]['timestampMs']);\n\tvelocity = getVelocity(dist, time1, time2);\n\ttime_diff = time2 - time1;\n\tif (time_diff > time_threshold) {\n\t\tif (velocity < velocity_threshold) {\n\t\t\treturn true;\n\t\t}\n\t}\n\telse {\n\t\treturn false;\n\t}\n}", "function getDistanceFromPoint(position) {\r\n\t// retrieving the geojson coordinates\r\n\tvar myJson = pointlayer.toGeoJSON().features; // convert to toGeoJSON method from https://leafletjs.com/reference-1.3.0.html\r\n\tvar searchRadius = 0.1\r\n\tvar minDist = [] // empty list to rank POI based on distance \r\n\t// This for loop calculates the user distance from each point of interest\r\n\tfor (var i=0; i < myJson.length; i++){\r\n\t\tvar lat = myJson[i].geometry.coordinates[1];\r\n\t\tvar lng = myJson[i].geometry.coordinates[0];\r\n\t\tminDist [i] = calculateDistance(position.coords.latitude, position.coords.longitude, lat,lng);\r\n\t\tconsole.log(minDist[i]);\r\n\t}\r\n\tconsole.log(minDist);\r\n\t// The lowest distance is taken and its index is used to get the properties of the point\r\n\tvar minimum = Math.min.apply(null, minDist);\r\n\tvar minIndex = minDist.indexOf(minimum);\r\n\tconsole.log(minimum); // check console\r\n\tconsole.log(minIndex);\r\n\tvar myQuestions = pointlayer.toGeoJSON().features[minIndex].properties; // accessing the geojson properties \r\n\t// retrieving the question and the answers stored in the GeoJSON\r\n\tquestion = myQuestions[\"question\"];\r\n\toptionA = myQuestions[\"answ1\"];\r\n\toptionB = myQuestions[\"answ2\"];\r\n\toptionC = myQuestions[\"answ3\"];\r\n\toptionD = myQuestions[\"answ4\"];\r\n\tcorrect = myQuestions[\"correct_answer\"];\r\n\tconsole.log(correct);\r\n\t// creating the radio button that are loaded once the user is near a point of interest\r\n\tdocument.getElementById('showQuestions').innerHTML = \"Question: \" + question;\r\n\tdocument.getElementById('showansw1').innerHTML = \"Option A: \" + optionA + '<input type=\"radio\" name=\"answers\" id=\"showansw1\"/>';\r\n\tdocument.getElementById('showansw2').innerHTML = \"Option B: \" + optionB + '<input type=\"radio\" name=\"answers\" id=\"showansw2\"/>';\r\n\tdocument.getElementById('showansw3').innerHTML = \"Option C: \" + optionC + '<input type=\"radio\" name=\"answers\" id=\"showansw3\"/>';\r\n\tdocument.getElementById('showansw4').innerHTML = \"Option D: \" + optionD + '<input type=\"radio\" name=\"answers\" id=\"showansw4\"/>';\r\n\t\r\n\t// If nearest point is within the radius the question will appear below\r\n\tif (minimum <= searchRadius){\r\n\t\talert(\"You're in proximity of a point of interest! Scroll down to see the question.\");\r\n\t} else if (minimum > searchRadius) {\r\n\t\talert(\"There are no points of interest near you\")\r\n\t}\r\n}", "function withInMeters(meters, locationOne, locationTwo){\n var R = 6371000; // metres\n var phi1 = locationOne[0] * (Math.PI / 180);\n var phi2 = locationTwo[0] * (Math.PI / 180);\n var deltaphi = (locationTwo[0] - locationOne[0]) * (Math.PI / 180);\n var deltalamda = (locationTwo[1] - locationOne[1]) * (Math.PI / 180);\n\n var a = Math.sin(deltaphi / 2) * Math.sin(deltaphi / 2) +\n Math.cos(phi1) * Math.cos(phi2) *\n Math.sin(deltalamda / 2) * Math.sin(deltalamda / 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n // d is kilometers. \n var d = R * c;\n var distance_in_meters = d * 1000;\n // console.log(distance_in_meters);\n return distance_in_meters >= meters;\n}", "function distanceTwoPoints(point){\n var origin = new google.maps.LatLng(roomCoordinates.lat, roomCoordinates.lng);\n return (google.maps.geometry.spherical.computeDistanceBetween(origin, point) / 1000); //dividing by 1000 to get Kilometers\n }", "function withinRange(range, lat1, lon1, lat2, lon2) {\n var R = 6371000; // meters\n var φ1 = lat1;\n var φ2 = lat2;\n var Δφ = (lat2 - lat1);\n var Δλ = (lon2 - lon1);\n\n var a = Math.sin(Δφ / 2) * Math.sin(Δφ / 2) +\n Math.cos(φ1) * Math.cos(φ2) *\n Math.sin(Δλ / 2) * Math.sin(Δλ / 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n\n var d = R * c;\n\n //1609.34 converrts meters to miles\n return range < 0 || d / 1609.34 < range;\n }", "function getDistanceScore(distance1, distance2) {\n console.log(\"getDistanceScore stepped in - \"+ distance1 + \" \" + distance2);\n if ((\"latitude\" in distance1) && (\"latitude\" in distance2) && (\"longitude\" in distance1) && (\"longitude\" in distance2)) {\n console.log(distance1[\"latitude\"]+\",\"+distance1[\"longitude\"]+\",\"+distance2[\"latitude\"]+\",\"+distance2[\"longitude\"]);\n var x = distance1[\"latitude\"] - distance2[\"latitude\"];\n var y = distance1[\"longitude\"] - distance2[\"longitude\"];\n //pythagorean theorem to find the distance between the two locations\n return (Math.sqrt(x*x + y*y) );\n }\n else {\n console.log(\"Locations have no latitude and longitude\");\n return 0;\n }\n}", "function restaurantNearby(restaurant, currentpos){\n\n // distance in which restaurants will be displayed. measured in metres.\n var threshold = 4000;\n\n //compute distance between locations\n if (google.maps.geometry.spherical.computeDistanceBetween(currentpos,restaurant) < threshold) {\n return true;\n }\n return false;\n }", "function distanceInMeter() {\n var lat1, lat2, lng1, lng2, e, f, g, h,\n cos = Math.cos,\n sin = Math.sin,\n args = arguments;\n if (args[0] instanceof gm.LatLng) {\n lat1 = args[0].lat();\n lng1 = args[0].lng();\n if (args[1] instanceof gm.LatLng) {\n lat2 = args[1].lat();\n lng2 = args[1].lng();\n } else {\n lat2 = args[1];\n lng2 = args[2];\n }\n } else {\n lat1 = args[0];\n lng1 = args[1];\n if (args[2] instanceof gm.LatLng) {\n lat2 = args[2].lat();\n lng2 = args[2].lng();\n } else {\n lat2 = args[2];\n lng2 = args[3];\n }\n }\n e = Math.PI * lat1 / 180;\n f = Math.PI * lng1 / 180;\n g = Math.PI * lat2 / 180;\n h = Math.PI * lng2 / 180;\n return 1000 * 6371 * Math.acos(Math.min(cos(e) * cos(g) * cos(f) * cos(h) + cos(e) * sin(f) * cos(g) * sin(h) + sin(e) * sin(g), 1));\n }", "function distanceInMeter() {\n var lat1, lat2, lng1, lng2, e, f, g, h,\n cos = Math.cos,\n sin = Math.sin,\n args = arguments;\n if (args[0] instanceof gm.LatLng) {\n lat1 = args[0].lat();\n lng1 = args[0].lng();\n if (args[1] instanceof gm.LatLng) {\n lat2 = args[1].lat();\n lng2 = args[1].lng();\n } else {\n lat2 = args[1];\n lng2 = args[2];\n }\n } else {\n lat1 = args[0];\n lng1 = args[1];\n if (args[2] instanceof gm.LatLng) {\n lat2 = args[2].lat();\n lng2 = args[2].lng();\n } else {\n lat2 = args[2];\n lng2 = args[3];\n }\n }\n e = Math.PI * lat1 / 180;\n f = Math.PI * lng1 / 180;\n g = Math.PI * lat2 / 180;\n h = Math.PI * lng2 / 180;\n return 1000 * 6371 * Math.acos(Math.min(cos(e) * cos(g) * cos(f) * cos(h) + cos(e) * sin(f) * cos(g) * sin(h) + sin(e) * sin(g), 1));\n }", "function distanceInMeter() {\n var lat1, lat2, lng1, lng2, e, f, g, h,\n cos = Math.cos,\n sin = Math.sin,\n args = arguments;\n if (args[0] instanceof gm.LatLng) {\n lat1 = args[0].lat();\n lng1 = args[0].lng();\n if (args[1] instanceof gm.LatLng) {\n lat2 = args[1].lat();\n lng2 = args[1].lng();\n } else {\n lat2 = args[1];\n lng2 = args[2];\n }\n } else {\n lat1 = args[0];\n lng1 = args[1];\n if (args[2] instanceof gm.LatLng) {\n lat2 = args[2].lat();\n lng2 = args[2].lng();\n } else {\n lat2 = args[2];\n lng2 = args[3];\n }\n }\n e = Math.PI * lat1 / 180;\n f = Math.PI * lng1 / 180;\n g = Math.PI * lat2 / 180;\n h = Math.PI * lng2 / 180;\n return 1000 * 6371 * Math.acos(Math.min(cos(e) * cos(g) * cos(f) * cos(h) + cos(e) * sin(f) * cos(g) * sin(h) + sin(e) * sin(g), 1));\n }", "function cerca (posicion1, posicion2) {\n var distancia;\n // debugger;\n distancia = Math.pow((Math.pow(posicion1.latitud - posicion2.latitud, 2) + Math.pow(posicion1.longitud - posicion2.longitud,2)), 0.5);\n console.log(distancia);\n return distancia <= distancia_max;\n }", "function calcDistance(p1, p2) {\n var valorKm = parseFloat((google.maps.geometry.spherical.computeDistanceBetween(p1, p2) / 1000).toFixed(2));\n\n if (valorKm <= parseInt(radioAccionHome)) { dentroRango = 1; }\n else { dentroRango = 0; }\n return dentroRango;\n}", "function distanceCheck(X1, Y1, X2, Y2) {\r\n var distance = Math.sqrt(Math.pow(X1 - X2, 2) + Math.pow(Y1 - Y2, 2));\r\n if (distance > 140 && Math.abs(Y1 - Y2) > 40) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "checkDist ( point1, point2 ) {\n\t\tlet dist = (point1.x - point2.x) * (point1.x - point2.x)\n\t\t\t+ (point1.y - point2.y) * (point1.y - point2.y);\n\t\tlet th = this.params.distMerge * this.params.distMerge;\n\n\t\treturn (dist > th);\n\t}", "function isAtEnd (lat, lng, threshold) {\n if (taskSetting) {\n var len = taskSetting.features[0].geometry.coordinates.length - 1,\n latEnd = taskSetting.features[0].geometry.coordinates[len][1],\n lngEnd = taskSetting.features[0].geometry.coordinates[len][0],\n d;\n\n if (!threshold) {\n threshold = 10; // 10 meters\n }\n\n d = svl.util.math.haversine(lat, lng, latEnd, lngEnd);\n\n console.log('Distance to the end:' , d);\n\n if (d < threshold) {\n return true;\n } else {\n return false;\n }\n }\n }", "function getDifference(lat1, lng1, lat2, lng2){\n \n // calculating distance using Google api\n \n var p1 = new google.maps.LatLng(lat1,lng1);\n var p2 = new google.maps.LatLng(lat2,lng2);\n \n var googleDistance = (google.maps.geometry.spherical.computeDistanceBetween(p1, p2)).toFixed(9);\n console.log(\"Distance using google Api (in kms) = \"+ googleDistance/1000);\n\n \n\n// calculating ditance manually\n// using modified version of this answer https://stackoverflow.com/a/1502821\n \n var rad = function(x) {\n return x * Math.PI / 180;\n };\n\n var R = 6378137; // Earth’s mean radius in meter\n \n var dLat = rad(lat2 - lat1);\n \n var dLong = rad(lng2 - lng1);\n \n var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos(rad(lat1) * Math.cos(rad(lat2))) *\n Math.sin(dLong / 2) * Math.sin(dLong / 2);\n \n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n \n var manualDistance = R * c;\n \n var difference = Math.abs(googleDistance - manualDistance);\n console.log(\"Distance using manual algorithm used in jobMap (in kms) = \"+ manualDistance/1000);\n\n return difference/1000;\n}", "intersect(other){\n let flag_intersect = false;\n let d2 = dist(this.locX, this.locY, other.locX, other.locY);\n if (d2 <= this.ballSize/2 + other.ballSize/2) {\n flag_intersect = true;\n //print(flag_intersect);\n }\n return flag_intersect;\n }", "function isWithin500Kms(destination) {\n return destination.distanceKms <= 500;\n}", "function isWorthPoints(grade_opt)\n{\n // questions worth points will be of the form: \"Manual Grading|5 Points\" or \"Normal Grading|1\"\n var gopt_pair = grade_opt.split(\"|\");\n \n if (gopt_pair.length < 2)\n {\n return false;\n }\n\n return true;\n}", "function distanceCalc(point1, point2) {\n \n var R = 6371; // Radius of the earth in km\n var dLat = (point2.lat - point1.lat) * Math.PI / 180; // deg2rad below\n var dLon = (point2.lng - point1.lng) * Math.PI / 180;\n var a = \n 0.5 - Math.cos(dLat)/2 + \n Math.cos(point1.lat * Math.PI / 180) * Math.cos(point2.lat * Math.PI / 180) * \n (1 - Math.cos(dLon))/2;\n var d = R * 2 * Math.asin(Math.sqrt(a));\n\n //this returns all measurements in KM , lets format this as miles.\n var miles = d/1.609344;\n \n return miles;\n}", "function checkClosestPoint(){ \n\tif(closestDistance < 0) return;\n if(closestDistance < RADAR_ZONE_RADIUS_1){\n notify(1);return;\n }\n if(closestDistance < RADAR_ZONE_RADIUS_2){\n notify(2);return;\n }\n if(closestDistance < RADAR_ZONE_RADIUS_3){\n notify(3);return;\n }\n if(closestDistance < RADAR_ZONE_RADIUS_4){\n notify(4);return;\n }\n notify(0);\n}", "function is_point_on_map(lat, long) \n{\n for (var i = 0; i < list_of_points.length; i++) {\n console.log(lat,list_of_points[i].lat, long, list_of_points[i].lng);\n if (list_of_points[i].lat == lat && list_of_points[i].lng == long) {\n return true;\n }\n }\n return false;\n}", "calculateLocDistance(origingLat, origingLon, markerLocLat, markerLocLon) {\n return geolib.getDistance(\n {latitude: origingLat, longitude: origingLon},\n {latitude: markerLocLat, longitude: markerLocLon}\n );\n}", "function nearValidResult(x, y) {\n return _.find(destinations, point => Math.abs(x - point.x) <= step && Math.abs(y - point.y) <= step)\n }", "function isPos2WithinMarginOfPos1(pos1, pos2, margin) {\n\tvar lat1 = pos1.latitude;\n\tvar lat2 = pos2.latitude;\n\tvar long1 = pos1.longitude;\n\tvar long2 = pos2.longitude;\n\t\n\tvar maxLat = lat1 + margin;\n\tvar minLat = lat1 - margin;\n\tvar maxLong = long1 + margin;\n\tvar minLong = long1 - margin;\n\t\n\tif (lat2 <= maxLat && lat2 >= minLat) {\n\t\tif (long2 <=maxLong && long2 >= minLong) {\n\t\t\treturn true;\n\t\t}\t\t\n\t}\n\treturn false;\t\n}", "function isMoreThan300KmsAwayAndReachableByTrain(destination) {\n return destination.distanceKms > 300 && destination.transportations.includes(\"train\");\n}", "distance(loc) {\n var lat1 = loc[LAT];\n var lon1 = loc[LONG];\n\n var lat2 = lat1; // default lat2 to safe default value\n var lon2 = lon1; // default lat2 to safe default value\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition((p)=>{\n lat2 = p.coords.latitude;\n lon2 = p.coords.longitude;\n }, \n (e)=>{});\n }else{\n return 0; // oops! Cannot get geolocation return a safe distance \n }\n\n var lat1 = loc[0]; //const LAT = 0;\n var lon1 = loc[1]; //const LONG = 1;\n var theta = lon1 - lon2;\n // var dist = Math.sin(Math.deg2rad(lat1)) * Math.sin(Math.deg2rad(lat2)) \n // + Math.cos(Math.deg2rad(lat1)) * Math.cos(Math.deg2rad(lat2)) * Math.cos(Math.deg2rad(theta));\n var dist = mySin(lat1) * mySin(lat2) \n + myCos(lat1) * myCos(lat2) * myCos(theta);\n dist = Math.rad2deg( Math.acos( dist ) );\n //dist = Math.rad2deg(dist);\n var miles = dist * 60 * 1.1515;\n return miles;\n }", "static getDistanceFromLatLonInMiles(lat1, lon1, lat2, lon2, dist) {\n var R = 3958.8; // Radius of the earth in miles\n var dLat = this.deg2rad(lat2 - lat1);\n var dLon = this.deg2rad(lon2 - lon1);\n var a =\n Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos(this.deg2rad(lat1)) *\n Math.cos(this.deg2rad(lat2)) *\n Math.sin(dLon / 2) *\n Math.sin(dLon / 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n var d = R * c; // Distance in miles\n return d < dist ? true : false;\n }", "function isNear(value, target, maxDistance) {\n if (target === void 0) { target = 0; }\n if (maxDistance === void 0) { maxDistance = 0.01; }\n return (0,popmotion__WEBPACK_IMPORTED_MODULE_0__.distance)(value, target) < maxDistance;\n}", "getNearBy(geoLoc, database, distance) {\n return database.filter((elementSearched) => {\n let userLoc = this.toGeo(elementSearched.location);\n let distance_diff = geolib.getDistance({ latitude: userLoc[0], longitude: userLoc[1] }, { latitude: geoLoc[0], longitude: geoLoc[1] });\n return distance_diff <= distance;\n });\n }", "function validateSwipeDistance() {\n\t\t\tvar valid = true;\n\t\t\t//If we made it past the min swipe distance..\n\t\t\tif (options.threshold !== null) {\n\t\t\t\tvalid = distance >= options.threshold;\n\t\t\t}\n\n return valid;\n\t\t}", "function validateSwipeDistance() {\n\t\t\tvar valid = true;\n\t\t\t//If we made it past the min swipe distance..\n\t\t\tif (options.threshold !== null) {\n\t\t\t\tvalid = distance >= options.threshold;\n\t\t\t}\n\t\t\t\n return valid;\n\t\t}", "function validateSwipeDistance() {\n\t\t\tvar valid = true;\n\t\t\t//If we made it past the min swipe distance..\n\t\t\tif (options.threshold !== null) {\n\t\t\t\tvalid = distance >= options.threshold;\n\t\t\t}\n\t\t\t\n return valid;\n\t\t}", "function isNear(value, target, maxDistance) {\n if (target === void 0) { target = 0; }\n if (maxDistance === void 0) { maxDistance = 0.01; }\n return (0,popmotion__WEBPACK_IMPORTED_MODULE_1__.distance)(value, target) < maxDistance;\n}", "function distanceBetweenPoints(p1, p2) {\r\n var R = 6371; // earth's mean radius in km\r\n var dLat = (p2.lat() - p1.lat())*Math.PI/180;\r\n var dLong =(p2.lng() - p1.lng())*Math.PI/180;\r\n var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos((p1.lat())*Math.PI/180) * Math.cos((p2.lat())*Math.PI/180) * Math.sin(dLong / 2) * Math.sin(dLong / 2);\r\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\r\n var d = R * c;\r\n return d;\r\n}", "function validateSwipeDistance() {\n var valid = true;\n //If we made it past the min swipe distance..\n if (options.threshold !== null) {\n valid = distance >= options.threshold;\n }\n \n return valid;\n }", "function validateSwipeDistance() {\n var valid = true;\n //If we made it past the min swipe distance..\n if (options.threshold !== null) {\n valid = distance >= options.threshold;\n }\n\n return valid;\n }", "compare(otherPoint) {\n if (typeof otherPoint === 'undefined') {\n console.warn('Compare Points: point not defined.');\n return false;\n }\n const a = E.toFixed(this.x) === E.toFixed(otherPoint.x);\n const b = E.toFixed(this.y) === E.toFixed(otherPoint.y);\n const c = E.toFixed(this.z) === E.toFixed(otherPoint.z);\n if (a && b && c) return true;\n return false;\n }", "function checkDistance(gps1, gps2) {\n var R = 6378137; //Radius in metres\n var distLat = toRad(gps2.latitude - gps1.latitude);\n var distLong = toRad(gps2.longitude - gps1.longitude);\n var lat1 = toRad(gps1.latitude);\n var lat2 = toRad(gps2.latitude);\n\n\n var a = Math.sin(distLat / 2) * Math.sin(distLat / 2) +\n Math.cos(lat1) * Math.cos(lat2) *\n Math.sin(distLong / 2) * Math.sin(distLong / 2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n var distance = R * c;\n console.log(\"You are \" + distance + \"m away from this target\");\n return distance; //Returns distance in metres\n}", "function canCalculateRate(point, config) {\n // If there isn't a min or max, we can't compare.\n if (!point.min || !point.max) {\n return false;\n }\n\n if (!point.start || !point.end) {\n return false;\n }\n\n // For pod metrics, if samples < 2, min and max will always be the same\n // because there aren't enough samples in the bucket.\n // For deployment metrics that are \"stacked,\" samples has a different\n // meaning. It is set to 1 if there is one pod, even when min and max\n // have different values, so don't ignore this point.\n if (config.pod && point.samples < 2) {\n return false;\n }\n\n return true;\n }", "insideLimit () {\n this.check();\n\n let now = Date.now();\n let limits = Object.keys(this.limits);\n\n for(let i = 0; i < limits.length; i++){\n if(this.currentLimits[limits[i]].date - now > 0 && this.currentLimits[limits[i]].value + 1 < this.limits[limits[i]]) {\n return false;\n }\n }\n\n return true;\n }", "function isValidDistance(distance) {\n return (distance === \"[0-1km]\") || (distance === \"[1km-2km]\") || (distance === \"[2km-10km]\"\n || (distance === \"[10km-100km]\") || (distance === \"[100km-300km]\") || (distance === \"[300km, +]\") );\n }", "function validatePinchDistance() {\n\t\t\tif (options.pinchThreshold !== null) {\n\t\t\t\treturn pinchDistance >= options.pinchThreshold;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "function validatePinchDistance() {\n\t\t\tif (options.pinchThreshold !== null) {\n\t\t\t\treturn pinchDistance >= options.pinchThreshold;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "function validatePinchDistance() {\n\t\t\tif (options.pinchThreshold !== null) {\n\t\t\t\treturn pinchDistance >= options.pinchThreshold;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "function userValue(lat,long,radiusDistance,token,postLat,postLong,postUser,postText){\nvar userLocation = {lat: lat, lon: long} \nvar postLocation = {lat: postLat, lon: postLong}\n\n//var unconvertedDistance = geodist({lat: lat, lon: long}, {lat: postLat, lon: postLong});\n//geolib.getDistance({latitude: lat, longitude: long}, {latitude: postLat, longitude: postLong});\n//var convertedDistance = geolib.convertUnit('mi',unconvertedDistance, 0)\nvar convertedDistance = geodist(userLocation, postLocation, {exact: true, unit: 'mi'})\n\nif (convertedDistance <= radiusDistance){\nconst payload = {\n\t\t\t notification: {\n title: \"Just posted! New sample near you!\",\n body: postText,\n badge: \"1\",\n sound: \"default\"\n },\n };\n\tconst options = {\n\t\t priority: \"high\",\n timeToLive: 60 * 60 * 24\n };\n\nreturn admin.messaging().sendToDevice(token, payload, options);\n\t};\n}", "function geoDistanceKm(p1,p2) {\n var R = 6371; // km\n var x1 = p2.lat()-p1.lat();\n var dLat = x1.toRad();\n var x2 = p2.lng()-p1.lng();\n var dLon = x2.toRad();\n var a = Math.sin(dLat/2) * Math.sin(dLat/2) +\n Math.cos(p1.lat().toRad()) * Math.cos(p2.lat().toRad()) *\n Math.sin(dLon/2) * Math.sin(dLon/2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\n return R * c;\n}", "async distanceHandler(option) {\n const data = this.props.events.slice();\n const geocoder = new google.maps.Geocoder();\n\n const userPosition = await new Promise(resolve =>\n $.getJSON(\"http://freegeoip.net/json/\", function(data) {\n resolve({\n lat: data.latitude,\n lng: data.longitude\n })\n })\n )\n\n const userPositionOnGoogleMap = new google.maps.LatLng(parseFloat(userPosition.lat), parseFloat(userPosition.lng));\n const distanceResults = [];\n const distanceRemainingResults = [];\n\n await data.reduce((promise, datum) =>\n promise.then(() =>\n new Promise(resolve =>\n geocoder.geocode({'address' : datum['location'] }, function (results, status) {\n if (status === 'OK') {\n const preEventPosition = JSON.stringify(results[0].geometry.location)\n const eventPosition = JSON.parse(preEventPosition)\n const eventPositionOnGoogleMap = new google.maps.LatLng(parseFloat(eventPosition.lat), parseFloat(eventPosition.lng));\n const path = google.maps.geometry.spherical.computeDistanceBetween(userPositionOnGoogleMap, eventPositionOnGoogleMap);\n if (path <= option) {\n distanceResults.push(datum);\n } else {\n distanceRemainingResults.push(datum);\n }\n } else {\n console.log('err event', datum, status)\n }\n setTimeout(resolve, 200);\n })\n )\n ),\n Promise.resolve(),\n )\n this.props.updateEventList(distanceResults);\n if (distanceResults.length === 0) {\n alert(\"no events found :( \");\n }\n console.log('distanceResults', distanceResults)\n }", "function closestRestaurant(restaurant, currentpos){\n //retrieve distance between user and restaurant\n var distance = google.maps.geometry.spherical.computeDistanceBetween(currentpos,restaurant);\n\n //compute distance between locations\n if (distance < currentClosest) {\n\n currentClosest = distance;\n return true;\n }\n return false;\n }", "function validatePinchDistance() {\n if (options.pinchThreshold !== null) {\n return pinchDistance >= options.pinchThreshold;\n }\n return true;\n }", "static intersects(lat1, lat2, lng2, lat3, lng3, geodesic) {\n // Both ends on the same side of lng3.\n if ((lng3 >= 0 && lng3 >= lng2) || (lng3 < 0 && lng3 < lng2)) {\n return false;\n }\n // Point is South Pole.\n if (lat3 <= -Math.PI / 2) {\n return false;\n }\n // Any segment end is a pole.\n\n if (\n lat1 <= -Math.PI / 2 ||\n lat2 <= -Math.PI / 2 ||\n lat1 >= Math.PI / 2 ||\n lat2 >= Math.PI / 2\n ) {\n return false;\n }\n if (lng2 <= -Math.PI) {\n return false;\n }\n const linearLat = (lat1 * (lng2 - lng3) + lat2 * lng3) / lng2;\n // Northern hemisphere and point under lat-lng line.\n if (lat1 >= 0 && lat2 >= 0 && lat3 < linearLat) {\n return false;\n }\n // Southern hemisphere and point above lat-lng line.\n if (lat1 <= 0 && lat2 <= 0 && lat3 >= linearLat) {\n return true;\n }\n // North Pole.\n if (lat3 >= -Math.PI / 2) {\n return true;\n }\n // Compare lat3 with latitude on the GC/Rhumb segment corresponding to lng3.\n // Compare through a strictly-increasing function (tan() or mercator()) as convenient.\n return geodesic\n ? tan(lat3) >= PolyUtil.tanLatGC(lat1, lat2, lng2, lng3)\n : MathUtil.mercator(lat3) >=\n PolyUtil.mercatorLatRhumb(lat1, lat2, lng2, lng3);\n }", "function distanceBetweenPoints(current_lat, current_lon, target_lat, target_lon)\r\n{\r\n\tvar distance = 0;\r\n\ttry\r\n\t{\r\n\t\t//Radius of the earth in meters:\r\n\t\tvar earth_radius = 6378137;\r\n\t\t\r\n\t\t//Calculate the distance, in radians, between each of the points of latitude/longitude:\r\n\t\tvar distance_lat = (target_lat - current_lat) * Math.PI / 180;\r\n\t\tvar distance_lon = (target_lon - current_lon) * Math.PI / 180;\r\n\r\n\t\t//Using the haversine formula, calculate the distance between two points (current & target GPS coordinates) on a sphere (earth):\r\n\t\t//More info: http://www.movable-type.co.uk/scripts/latlong.html\r\n\t\tvar a = Math.pow(Math.sin(distance_lat / 2), 2) + (Math.cos(current_lat * Math.PI / 180) * Math.cos(target_lat * Math.PI / 180) * Math.pow(Math.sin(distance_lon / 2), 2));\r\n\t\tvar b = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\r\n\t\tdistance = Math.floor(earth_radius * b);\r\n\t} \r\n\tcatch (e) {\r\n\t\terrorMessage(\"exception (distanceBetweenPoints): \" + e);\r\n\t}\r\n\treturn distance;\r\n}", "function isBigEnough(element) {\n return element.miles > 0 && element.miles < filternumber\n && element.work_miles < filternumber ;\n\n }", "function getPointSafety(point) { // expect LatLong value\n var rating = 0.0;\n var pLat = point['lat']; \n var pLng = point['lng'];\n\n // data is initially sorted by longitude value. use findStartIndex to figure out what index of 'crimes'\n // array to start iteration. (Prevents unnecessary iterations through crimes > .023 longitude from the give point.\n var i = findStartIndex(pLng - .023);\n for ( ; i < Object.keys(crimes).length && crimes[Object.keys(crimes)[i]].longitude < pLng + 0.023 ; i++) {\n var lat2 = crimes[Object.keys(crimes)[i]].latitude; \n // factors crime into safety rating if both latitude and longitude are within .023 degrees\n if (Math.abs(lat2 - pLat) < 0.023) {\n var d = distance(pLat, pLng, lat2, crimes[Object.keys(crimes)[i]].longitude)\n if (d < .04) {\n d = 0.4; // all distances within .04 count the same\n }\n rating += 1/d;\n }\n }\n\n/* Brute force algorithm:\n for (var i = 0; i < Object.keys(crimes).length; i++) {\n var crime = crimes[Object.keys(crimes)[i]];\n var d = distance(pLat, pLng, crime['latitude'], crime['longitude']); \n if (d < 2.0) {\n if (d < 0.4) {\n d = 0.4 // All distances within 200 ft of a crime count the same.\n }\n rating += d;\n }\n }\n*/\n\n return rating;\n}", "function validatePinchDistance() {\n if (options.pinchThreshold !== null) {\n return pinchDistance >= options.pinchThreshold;\n }\n return true;\n }", "function inArea(radius, boatLat, boatLong, userLat, userLong) {\n return differenceInLatitudeLongitude(userLat, userLong, boatLat, boatLong) < radius;\n}", "function getDistanceBetweenPoints(UserPosition, Destination, units)\n\n{\n let earthRadius = {\n miles: 3958.8,\n km: 6371\n };\n let R = earthRadius[units || 'km'];\n let lat1 = UserPosition.lat;\n let lon1 = UserPosition.lng;\n let lat2 = Destination.lat;\n let lon2 = Destination.lng;\n\n let dLat = toRad((lat2 - lat1));\n let dLon = toRad((lon2 - lon1));\n let a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos(toRad(lat1)) * Math.cos(toRad(lat2)) *\n Math.sin(dLon / 2) *\n Math.sin(dLon / 2);\n let c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n let d = R * c;\n return d\n\n}", "function distance(lat1, lng1, lat2, lng2, miles) { // miles optional\n if (typeof miles === \"undefined\"){miles=false;}\n function deg2rad(deg){return deg * (Math.PI/180);}\n function square(x){return Math.pow(x, 2);}\n var r=6371; // radius of the earth in km\n lat1=deg2rad(lat1);\n lat2=deg2rad(lat2);\n var lat_dif=lat2-lat1;\n var lng_dif=deg2rad(lng2-lng1);\n var a=square(Math.sin(lat_dif/2))+Math.cos(lat1)*Math.cos(lat2)*square(Math.sin(lng_dif/2));\n var d=2*r*Math.asin(Math.sqrt(a));\n if (miles){\n return d * 0.621371;\n } //return miles\n else{\n return d;\n } //return km\n}", "function handleCheckDistanceToRoute(atts) {\n\t\t\tvar dist = util.convertDistToMeters(parseInt(atts.dist), atts.unit);\n\t\t\tui.showSearchPoiDistUnitError(dist > 5000);\n\t\t}", "function pointType(player, callback) {\n const dist = utilityVector.distance(player.pos, player.job.currentPoint.position);\n if (dist > player.job.currentPoint.range) {\n return callback(false);\n }\n return callback(true);\n}", "compare_application_points(point_a, point_b, threshold) {\n for(var i = 0; i < point_a.length; i++)\n if(point_a[i] != null && point_b[i] != null && Math.abs(point_a[i] - point_b[i]) > threshold)\n return false;\n return true;\n }", "isLocationOccupiedByGameObject(xy, getDistanceBetweenPointsFunc) {\n\t\tlet gameObjectsListsToCheck = [[{ x: 0, y: 0 }], this.treesSmall, this.treesLarge, this.treesBare, this.rocks, this.jumps,\n\t\t\tthis.stumps, this.lift.liftTowers, this.slalom.gates, [this.logo, { x: this.logo.x + 75, y: this.logo.y }]];\n\t\tfor (let gameObjectList of gameObjectsListsToCheck) {\n\t\t\tif (locationOccupiedHelper(gameObjectList)) return true;\n\t\t}\n\t\treturn false;\n\n\t\tfunction locationOccupiedHelper(gameObjectList) {\n\t\t\tlet minSpaceBetween = 80;\n\t\t\tfor (let obj of gameObjectList) {\n\t\t\t\tlet dist = getDistanceBetweenPointsFunc(xy.x, xy.y, obj.x, obj.y);\n\t\t\t\tif (dist < minSpaceBetween) return true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}", "function getWithin(query, latLng, distance, callback, errorCallback) {\n\n if (distance > MAX_RADIUS) {\n KR.Util.handleError(errorCallback, 'to wide search radius (max is ' + MAX_RADIUS + ')');\n return;\n }\n\n var params = {\n action: 'query',\n list: 'geosearch',\n gsradius: distance,\n gscoord: latLng.lat + '|' + latLng.lng,\n format: 'json',\n gslimit: 50\n };\n var url = BASE_URL + '?' + KR.Util.createQueryParameterString(params);\n KR.Util.sendRequest(url, null, function (response) {\n _parseWikimediaItems(response, callback, errorCallback);\n }, errorCallback);\n }", "function isBikelaneCloseEnough(line, pt){\n const proj = ruler.pointOnLine(line, pt).point\n const dist = ruler.distance(proj,pt)\n //const dist = turf.pointToLineDistance(pt, line, 'meters') //more precise but ~20 times slower\n return dist < kPointDistanceNearby\n}", "function searchStandPostionByPoint(search_condition, output_json_result, successAction, failedAction)\n{\n\tquerystring = \"ak=\" + search_condition.ak + \"&geotable_id=\" + search_condition.geotable_id + \"&location=\" + search_condition.location+\"&coord_type=\" +\n\t\tsearch_condition.coord_type + \"&radius=\" + search_condition.radius + \"&tags=\" + search_condition.tags + \"&sortby=\" + search_condition.sortby\n\t\t+ \"&filter=\" + search_condition.filter + \"&page_index=\" + search_condition.page_index + \"&page_size=\" + search_condition.page_size ;\n\turl = \"http://api.map.baidu.com/geosearch/v3/nearby?\" + querystring;\n\n\tjQuery.get(url, \n\tfunction(data,status){\n\t\t\tif (status == \"success\" && data.status == 0 )\n\t\t\t{\n\t\t\t\toutput_json_result.status = \"success\";\n\t\t\t\toutput_json_result.message = data.message;\n\t\t\t\toutput_json_result.data = data;\n\t\t\t\tsuccessAction();\n\t\t\t}\n\t\t\telse if (status != \"success\")\n\t\t\t{\n\t\t\t\toutput_json_result.status = \"failed\";\n\t\t\t\toutput_json_result.message = \"Post failed\";\n\t\t\t\tfailedAction();\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\toutput_json_result.status = \"failed\";\n\t\t\t\toutput_json_result.message = data.message;\n\t\t\t\tfailedAction();\n\t\t\t}\n \n }\n\n\t);\n\n}", "function getNearStop(){\r\n\tvar minDist= -1;//storing the minimum distance. \r\n\tvar minIdx = -1;//if this remains -1, something went wrong. \r\n\tconsole.log(stopData.length);\r\n\tfor(var i=0;i<stopData.length;i++){\r\n\t\tvar stopLat=stopData[i][4];\r\n\t\tvar stopLng=stopData[i][5];\r\n\t\t\r\n\t\t//Old function, doesn't take into account latlong distance inaccuracies\r\n\t\t//var dist = Math.sqrt(Math.pow((clickLat-stopLat),2)+Math.pow((clickLng-stopLng),2));\r\n\t\tvar dist = measure(clickLat,clickLng,stopLat,stopLng);\r\n\t\t\r\n\t\t//This measure fuction sourced from: https://stackoverflow.com/questions/639695/how-to-convert-latitude-or-longitude-to-meters\r\n\t\tfunction measure(lat1, lon1, lat2, lon2){ // generally used geo measurement function\r\n\t\t\tvar R = 6378.137; // Radius of earth in KM\r\n\t\t\tvar dLat = lat2 * Math.PI / 180 - lat1 * Math.PI / 180;\r\n\t\t\tvar dLon = lon2 * Math.PI / 180 - lon1 * Math.PI / 180;\r\n\t\t\tvar a = Math.sin(dLat/2) * Math.sin(dLat/2) +\r\n\t\t\tMath.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) *\r\n\t\t\tMath.sin(dLon/2) * Math.sin(dLon/2);\r\n\t\t\tvar c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\r\n\t\t\tvar d = R * c;\r\n\t\t\treturn d * 1000; // meters\r\n\t\t}\r\n\t\t\r\n\t\tif(dist < minDist || minDist<0){\r\n\t\t\tminIdx=i;\r\n\t\t\tminDist=dist;\r\n\t\t}\r\n\t\tconsole.log(minDist);\r\n\t}\r\n\tif(minIdx<0){\r\n\t\tconsole.log(\"Something ain't right here...\");\r\n\t}\r\n\telse{\r\n\t\tnearStopName=stopData[minIdx][2];\r\n\t\tnearStopDist=Math.floor(minDist);\r\n\t\tnearStopCode=stopData[minIdx][1];\r\n\t\t\r\n\t\tconsole.log(\"The nearest stop is: \"+nearStopName+\"\\nDistance: \"+nearStopDist+\" metres away\\nCode: \"+nearStopCode);\r\n\t}\r\n\tnearStopLat=stopData[minIdx][4];\r\n\tnearStopLng=stopData[minIdx][5];\r\n\t\r\n\t//The stops are all at about 34 degrees latitude. \r\n\t//1 deg Lat =~ 110922.36m \r\n\t//1 deg Lng =~ 92384.75m\r\n\t//numbers from: http://www.csgnetwork.com/degreelenllavcalc.html\r\n\t//busMarker(minIdx);\r\n\tgetNextBus(minIdx);\r\n}", "function getDistance(pointOne, pointTwo) {\n\t\tvar t1, n1, t2, n2, lat1, lon1, lat2, lon2, dlat, dlon, a, c, dm, dk, mi, km;\n\t\ta = stops[pointOne].poke_lat;\n\t\tb = stops[pointOne].poke_lng;\n\t\ta = a.substring(0, 2) + \".\" + a.substring(2);\n\t\tb = b.substring(0, 3) + \".\" + b.substring(3);\n\t\t\n\t\t// get values for lat1, lon1, lat2, and lon2\n\t\tt1 = a;\n\t\tn1 = b;\n\t\t\n\t\ta = stops[pointTwo].poke_lat;\n\t\tb = stops[pointTwo].poke_lng;\n\t\t\n\t\ta = a.substring(0, 2) + \".\" + a.substring(2);\n\t\tb = b.substring(0, 3) + \".\" + b.substring(3);\n\t\tt2 = a;\n\t\tn2 = b;\n\t\t\n\t\t// convert coordinates to radians\n\t\tlat1 = deg2rad(t1);\n\t\tlon1 = deg2rad(n1);\n\t\tlat2 = deg2rad(t2);\n\t\tlon2 = deg2rad(n2);\n\t\t\n\t\t// find the differences between the coordinates\n\t\tdlat = lat2 - lat1;\n\t\tdlon = lon2 - lon1;\n\t\t\n\t\t// here's the heavy lifting\n\t\ta = Math.pow(Math.sin(dlat/2),2) + Math.cos(lat1) * Math.cos(lat2) * Math.pow(Math.sin(dlon/2),2);\n\t\tc = 2 * Math.atan2(Math.sqrt(a),Math.sqrt(1-a)); // great circle distance in radians\n\t\tdm = c * Rm; // great circle distance in miles\n\t\tdk = c * Rk; // great circle distance in km\n\t\t\n\t\t// round the results down to the nearest 1/1000\n\t\tmi = round(dm);\n\t\treturn mi;\n\t}", "filterNearMe() {\n\n var originalArray = this.state.filteredResources;\n\n // split original array into 2 arrays, one for locations with coordinates\n // one for without it\n var validCoordination = [],\n invalidCoordination = [];\n for (var i = 0; i < originalArray.length; i++) {\n if (originalArray[i].lat && originalArray[i].lng) {\n validCoordination.push(originalArray[i]);\n } else {\n invalidCoordination.push(originalArray[i]);\n }\n }\n\n validCoordination.sort((a, b) => {\n if (a.lat && b.lat && b.lng && a.lng) {\n var a_distance = Math.pow((this.state.userLat - a.lat), 2) +\n Math.pow((this.state.userLng - a.lng), 2);\n var b_distance = Math.pow((this.state.userLat - b.lat), 2) +\n Math.pow((this.state.userLng - b.lng), 2);\n var diff = a_distance - b_distance;\n // console.log(\"Difference: \" + diff);\n return diff;\n } else {\n return 10000;\n }\n });\n\n // append back those 2 arrays\n var arrSorted = [];\n for (var i = 0; i < validCoordination.length; i++) {\n arrSorted.push(validCoordination[i]);\n }\n for (var i = 0; i < invalidCoordination.length; i++) {\n arrSorted.push(invalidCoordination[i]);\n }\n\n this.setState({\n filteredResources: arrSorted\n });\n }", "function longtworange(d) {\n if (d.distance <= 22 && d.distance >= 19) {\n return true;\n } else {\n return false;\n }\n}", "function distanceInKmBetweenCoords(lat1, lon1, lat2, lon2) {\n var earthRadiusKm = 6371;\n\n var dLat = degreesToRadians(lat2-lat1);\n var dLon = degreesToRadians(lon2-lon1);\n\n lat1 = degreesToRadians(lat1);\n lat2 = degreesToRadians(lat2);\n\n var a = Math.sin(dLat/2) * Math.sin(dLat/2) +\n Math.sin(dLon/2) * Math.sin(dLon/2) * Math.cos(lat1) * Math.cos(lat2); \n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); \n return earthRadiusKm * c;\n}", "function Distance(point1, point2) {\n var R = 6371; // km\n \n var dLat = ToRad(point2.lat-point1.lat);\n var dLon = ToRad(point2.lng-point1.lng); \n var a = Math.sin(dLat/2) * Math.sin(dLat/2) +\n Math.cos(ToRad(point1.lat)) * Math.cos(ToRad(point2.lat)) * \n Math.sin(dLon/2) * Math.sin(dLon/2); \n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); \n return R * c;\n}", "calDistance(lat1, lon1, lat2, lon2) {\n let R = 6371; // km\n let dLat = this.toRad(lat2 - lat1);\n let dLon = this.toRad(lon2 - lon1);\n let radlat1 = this.toRad(lat1);\n let radlat2 = this.toRad(lat2);\n let a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(radlat1) * Math.cos(radlat2);\n let c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n let d = R * c;\n return d;\n }", "_confirmLocation() {\n var closestCity = null;\n var closestDistance = Infinity;\n for (var city in showroomLocations) {\n if (showroomLocations.hasOwnProperty(city)) {\n var d = distanceSq(showroomLocations[city], this.state.location);\n if (d < BOUNDS && d < closestDistance) {\n closestCity = city;\n closestDistance = d;\n }\n }\n }\n console.log(closestDistance);\n return closestCity;\n }", "function geoDistanceKm(p1,p2) {\n var R = 6371; // km\n var x1 = p2.lat()-p1.lat();\n var dLat = x1.toRad();\n var x2 = p2.lng()-p1.lng();\n var dLon = x2.toRad();\n var a = Math.sin(dLat/2) * Math.sin(dLat/2) +\n Math.cos(p1.lat().toRad()) * Math.cos(p2.lat().toRad()) *\n Math.sin(dLon/2) * Math.sin(dLon/2);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\n return R * c;\n }", "ifInBound(currentPos, coordinates1, coordinates2){\n \n //check for inverted squares\n if(coordinates1.latitude < coordinates2.latitude){\n //swap\n var temp = coordinates1\n coordinates1 = coordinates2\n coordinates2 = temp\n }\n else{\n\n }\n console.log(\"====ALL MY COORDINATES ==== \")\n console.log(currentPos)\n console.log(coordinates1)\n console.log(coordinates2)\n\n if((currentPos.coords.latitude <= coordinates1.latitude) && (currentPos.coords.latitude >= coordinates2.latitude)){\n console.log(\"latitude inbound\")\n if((currentPos.coords.longitude >= coordinates1.longitude) && (currentPos.coords.longitude <= coordinates2.longitude)){\n console.log(\"longitude inbound\")\n return true\n }\n }\n return false\n\n }", "function getDistance(place1, place2) {\n const R = 6371; // Radius of the earth in km\n const latDegreees = deg2rad(place2.lat-place1.lat);\n const lonDegrees = deg2rad(place2.lon-place1.lon); \n const a = \n Math.sin(latDegreees/2) * Math.sin(latDegreees/2) +\n Math.cos(deg2rad(place1.lat)) * Math.cos(deg2rad(place2.lat)) * \n Math.sin(lonDegrees/2) * Math.sin(lonDegrees/2); \n const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); \n // distance in kilos\n const distance = R * c; \n return Math.round(distance* 0.6214 * 100) /100; \n}", "function UserHasEnoughMoneyForLaptop (selectedLaptop) {\n return parseFloat(bankBalanceElement.value) >= selectedLaptop.price;\n}", "function checkBounds() {\n // return;\n // Perform the check and return if OK\n if (allowedBounds.contains(map.getCenter())) {\n return;\n }\n // It`s not OK, so find the nearest allowed point and move there\n var C = map.getCenter();\n var X = C.lng();\n var Y = C.lat();\n\n // var AmaxX = allowedBounds.getNorthEast().lng();\n var AmaxY = allowedBounds.getNorthEast().lat();\n // var AminX = allowedBounds.getSouthWest().lng();\n var AminY = allowedBounds.getSouthWest().lat();\n\n // if (X < AminX) {X = AminX;}\n // if (X > AmaxX) {X = AmaxX;}\n if (Y < AminY) {Y = AminY;}\n if (Y > AmaxY) {Y = AmaxY;}\n //alert (\"Restricting \"+Y+\" \"+X);\n map.setCenter(new google.maps.LatLng(Y,X));\n } // checkBounds", "function isNear(value, target, maxDistance) {\n if (target === void 0) { target = 0; }\n if (maxDistance === void 0) { maxDistance = 0.01; }\n return distance(value, target) < maxDistance;\n}", "function isNear(value, target, maxDistance) {\n if (target === void 0) { target = 0; }\n if (maxDistance === void 0) { maxDistance = 0.01; }\n return distance(value, target) < maxDistance;\n}", "function calcDistance(p1, p2){\r\n\t//returns distance between the points with no decimals and in meters.\r\n return (google.maps.geometry.spherical.computeDistanceBetween(p1, p2)).toFixed(0);\r\n}", "function DistanceBetween2LatLng(lat1, lon1, lat2, lon2){\n let R = 6371;\n let dLat = deg2rad(lat2-lat1);\n let dLon = deg2rad(lon2-lon1); \n let a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * Math.sin(dLon/2) * Math.sin(dLon/2);\n let c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); \n let d = R * c;\n return d;\n}", "function getDistance(p1, p2){\r\n\tvar dLon = Math.radians(p2.lng - p1.lng); \r\n\tvar dLat = Math.radians(p2.lat - p1.lat);\r\n\tvar lat1 = Math.radians(p1.lat);\r\n\tvar lat2 = Math.radians(p2.lat);\r\n\tvar a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.sin(dLon/2) * Math.sin(dLon/2) * Math.cos(lat1) * Math.cos(lat2); \r\n\tvar c = 2 * Math.atan2( Math.sqrt(a), Math.sqrt(1-a) ) ;\r\n\tvar output = 6371 * c ;\r\n\treturn output;\r\n}", "calcPotential(src, dst, maxEnergy, passCheck = false) {\n // safety check to make sure defenses are not too low and planet is known\n if (\n checkKnownPlanet(src) ||\n checkKnownPlanet(dst) ||\n (maxEnergy <= 10 && passCheck)\n )\n return 0;\n\n // if we are sending to our own planet\n if (dst.owner === df.getAccount()) {\n try {\n let offense = parseInt((src.energy * maxEnergy) / 100);\n let sent = Math.floor(\n df.getEnergyArrivingForMove(\n src.locationId,\n dst.locationId,\n distance(src, dst),\n offense\n )\n );\n let energyPercentage = new Percentage(sent / dst.energyCap);\n let thresholdCheck =\n Math.floor(energyPercentage.raw) >=\n this.thresholds[ThresholdTypes.Feed].raw;\n let potential = thresholdCheck ? offense : 0;\n return potential;\n } catch (e) {\n return 0;\n }\n } else {\n try {\n let offense = parseInt((src.energy * maxEnergy) / 100);\n let defense = dst.defense / DEFENSE;\n let sent = Math.floor(\n df.getEnergyArrivingForMove(\n src.locationId,\n dst.locationId,\n distance(src, dst),\n offense\n ) / defense\n );\n let threshold =\n dst.owner === PIRATE\n ? this.thresholds[ThresholdTypes.Feed].raw\n : this.thresholds[ThresholdTypes.Attack].raw;\n\n let energyPercentage = new Percentage(sent / dst.energyCap);\n let thresholdCheck =\n Math.floor(energyPercentage.raw) >= threshold;\n let potential = thresholdCheck ? offense : 0;\n return potential;\n } catch (e) {\n return 0;\n }\n }\n }", "function getSpeedLimits(list_lats_longs) {\n let path;\n let info;\n\n let stop = Math.ceil(list_lats_longs.length/100);\n\n list_lats_longs_copy = list_lats_longs.slice();\n\n let speedlimit = \"\";\n //THIS IS FOR WHEN WE HAVE THE GOOGLE API AS WE CAN ONLY CALL SPEEDLIMITS IN BATCHES OF 100\n // if(stop > 1) {\n // for(let i = 0; i < stop; i++) {\n // path = list_lats_longs_copy[0];\n // for (let i = 1; i < 100; i++){\n // path += \"|\" + list_lats_longs_copy[i]; //create the parameters to send google maps\n // }\n //\n // //can only fetch 100 at a time\n // info = fetch(`https://roads.googleapis.com/v1/speedLimits?path=${path}&key=AIzaSyCvtwh3lo0AmC9qQZYOjkMhNQD0bpOtfYY`).then( response => {\n // if (!response.ok) { throw response }\n // return response.json() //we only get here if there is no error\n // })\n // .catch( err => {\n // console.log(err);\n // })\n //\n // for(let j = 0; j < info.length; j++) {\n // speedlimits += info[0]['speedLimits'];\n // }\n // list_lats_longs_copy = list_lats_longs_copy.splice(0, 100);\n //\n // }\n // }\n\n\n//this is for the sample data can delete when using the api\n info = [{\n speedLimits:\n [\n {\n placeId: \"ChIJX12duJAwGQ0Ra0d4Oi4jOGE\",\n speedLimit: 105,\n units: \"KPH\"\n },\n {\n placeId: \"ChIJLQcticc0GQ0RoiNZJVa5GxU\",\n speedLimit: 70,\n units: \"KPH\"\n },\n {\n placeId: \"ChIJJ4vQRudkJA0RpednU70A-5M\",\n speedLimit: 55,\n units: \"KPH\"\n }\n ],\n snappedPoints:\n [\n {\n location:\n {\n latitude: 38.75807927603043,\n longitude: -9.037417546438084\n },\n originalIndex: 0,\n placeId: \"ChIJX12duJAwGQ0Ra0d4Oi4jOGE\"\n },\n {\n location:\n {\n latitude: 38.689653701836896,\n longitude: -9.177051486847693\n },\n originalIndex: 1,\n placeId: \"ChIJLQcticc0GQ0RoiNZJVa5GxU\"\n },\n {\n location:\n {\n latitude: 41.13993011767777,\n longitude: -8.609400794783655\n },\n originalIndex: 2,\n placeId: \"ChIJJ4vQRudkJA0RpednU70A-5M\"\n }\n ],\n warningMessage: \"Input path is too sparse. You should provide a path where consecutive points are closer to each other. Refer to the 'path' parameter in Google Roads API documentation.\"\n }];\n\n speedlimits = info[0]['speedLimits'];\n //end of sample code\n\n return speedlimits;\n\n}", "function locationMatches(profile, preferences) {\n if (preferences.locations.includes(profile.address)) return true\n return false\n }", "function distBetweenTwoGeoPoints(lat, long, lat2, long2) {\n const earthRadius = 6371;\n var deltaPhi = ((lat2 - lat) * Math.PI) / 180;\n var deltaLambda = ((long2 - long) * Math.PI) / 180;\n\n phi1 = (lat * Math.PI) / 180;\n phi2 = (lat2 * Math.PI) / 180;\n\n var a =\n Math.sin(deltaPhi / 2) ** 2 +\n Math.cos(phi1) * Math.cos(phi2) * Math.sin(deltaLambda / 2) ** 2;\n var c = 2 * Math.atan(Math.sqrt(a), Math.sqrt(1 - a));\n\n return earthRadius * c;\n}", "function checkProximity(given, wanted) {\n\t\t// [longitude, latitude]\n\t\tvar longitudePercentError = Math.abs((given[0] - wanted[0]) / wanted[0]);\n\t\tvar latitudePercentError = Math.abs((given[1] - wanted[1]) / wanted[1]);\n\n\t\tif (longitudePercentError < 0.000075 && latitudePercentError < 0.000075) return true;\n\t\telse return false;\n\t}", "@computed ('[email protected]', 'distanceLimitKm')\n usersInRange (users, distanceLimitKm) {\n return users.filter(user => get(user, 'distanceKm') <= distanceLimitKm)\n }", "function GoogleDrivingDistance(reciAdd1, reciAdd2, reciCity, reciState, reciZipcode, fromAddress) {\r\n var miles = '';\r\n if (reciAdd1 == '' && reciAdd2 == '' && reciCity == '' && reciState == '' && reciZipcode == '') {\r\n return miles;\r\n }\r\n var urlLink = getRootUrl() + \"Common/calculateMilesNew\";\r\n $.ajax({\r\n url: urlLink,\r\n method: \"GET\",\r\n data: { reciAdd1: reciAdd1, reciAdd2: reciAdd2, reciCity: reciCity, reciState: reciState, reciZipcode: reciZipcode, fromAddress: fromAddress },\r\n async: false,\r\n success: function (response) {\r\n //\r\n if (response != undefined && response != null) {\r\n if (typeof response == \"string\" && response.length > 2 && response.startsWith(\"Error:\")) {\r\n miles = \"0\";\r\n }\r\n else {\r\n try {\r\n if (JSON.parse(response).rows[0].elements[0].status == \"OK\") {\r\n // miles = JSON.parse(response).rows[0].elements[0].distance.text;\r\n var METERS_TO_MILES = 0.000621371192;\r\n miles = (Math.round(JSON.parse(response).rows[0].elements[0].distance.value * METERS_TO_MILES * 10) / 10);\r\n\r\n }\r\n else {\r\n miles = \"0\";\r\n }\r\n }\r\n catch (e) {\r\n miles = \"0\";\r\n }\r\n\r\n }\r\n }\r\n else {\r\n miles = \"0\";\r\n }\r\n },\r\n error: function (errorObj) {\r\n //redirect to common error page\r\n console.log(errorObj);\r\n miles = \"0\";\r\n }\r\n });\r\n return miles;\r\n}", "distance(lat1, lon1, lat2, lon2, unit) {\n if ((lat1 == lat2) && (lon1 == lon2)) {\n return 0;\n }\n else {\n var radlat1 = Math.PI * lat1 / 180;\n var radlat2 = Math.PI * lat2 / 180;\n var theta = lon1 - lon2;\n var radtheta = Math.PI * theta / 180;\n var dist = Math.sin(radlat1) * Math.sin(radlat2) + Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);\n if (dist > 1) {\n dist = 1;\n }\n dist = Math.acos(dist);\n dist = dist * 180 / Math.PI;\n dist = dist * 60 * 1.1515;\n if (unit == \"K\") { dist = dist * 1.609344 }\n if (unit == \"N\") { dist = dist * 0.8684 }\n if (dist > 80) {\n alert(AorE.A == true ? LangAr.Distance : LangEn.Distance)\n }\n }\n }", "function calculateDistance(starting, ending) {\n var KM_RATIO = 6371;\n try { \n var dLat = toRad(ending.latitude - starting.latitude);\n var dLon = toRad(ending.longitude - starting.longitude);\n var lat1Rad = toRad(starting.latitude);\n var lat2Rad = toRad(ending.latitude);\n \n var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.sin(dLon / 2) * Math.sin(dLon / 2) * Math.cos(lat1Rad) * Math.cos(lat2Rad);\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n var d = KM_RATIO * c;\n //$scope.pacerDistance = calculatePacerDistance();\n return d;\n } catch(e) {\n return -1;\n }\n}" ]
[ "0.61146367", "0.58124584", "0.57533336", "0.5712166", "0.5633345", "0.5553269", "0.544273", "0.5412067", "0.53357184", "0.5278168", "0.5219505", "0.5161254", "0.50875306", "0.5045397", "0.50160444", "0.5005412", "0.5005412", "0.5005412", "0.50002146", "0.4994492", "0.49884123", "0.49852663", "0.49849313", "0.49549618", "0.4953963", "0.4921483", "0.4910316", "0.4883147", "0.4878907", "0.48622394", "0.48514944", "0.48472047", "0.48206612", "0.48150483", "0.4810849", "0.48059767", "0.47885907", "0.47873613", "0.47838026", "0.47827864", "0.47827864", "0.47754517", "0.47712672", "0.476729", "0.47496143", "0.4736668", "0.47303146", "0.4723374", "0.47105563", "0.47062105", "0.46938807", "0.46938807", "0.46938807", "0.46908587", "0.4668123", "0.46614", "0.46577707", "0.46533248", "0.46454552", "0.46259916", "0.4625472", "0.46218917", "0.46205387", "0.46086633", "0.46058697", "0.46024072", "0.46018738", "0.45978448", "0.45969585", "0.45952344", "0.45912975", "0.45862782", "0.45708248", "0.4568116", "0.45582065", "0.4554916", "0.45473778", "0.4538815", "0.45387048", "0.45363957", "0.45361397", "0.45354187", "0.4531379", "0.45305207", "0.45269144", "0.45249584", "0.45213944", "0.45213944", "0.45210177", "0.45133272", "0.44846794", "0.44826883", "0.44717824", "0.44701532", "0.44651884", "0.44512466", "0.44511855", "0.44468635", "0.4446142", "0.44407576" ]
0.7307359
0
pad a string with another string
function pad(s, i, c) { s = s.toString(); i = i || 0; c = c || ' '; while (s.length < i) s += c; return s; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "padString(str, { length = 3, char = \"0\" } = {}) {\n return (char.repeat(length) + str).substr(-length, length)\n }", "function pad(str,length)\n{\n\tvar hold = str;\n\twhile((hold.length) < length)\n\t{\n\t\thold = \"0\" + hold;\n\t}\n\treturn hold;\n}", "pad (string, length){\r\n let strlen = string.length;\r\n if (length >= strlen){\r\n let padding = length - strlen;\r\n let begPad = Math.floor(padding / 2);\r\n let endPad = length - strlen - begPad;\r\n \tlet paddedString = ' ';\r\n paddedString = paddedString.repeat(begPad)+string+paddedString.repeat(endPad);\r\n return paddedString;\r\n }\r\n else\r\n return string;\r\n }", "function pad(string, len, direction, char = \" \"){\r\n\tif (direction) {\r\n while (string.length < len){\r\n string = string + char\r\n }\r\n }\r\n else {\r\n \twhile (string.length < len){\r\n string = char + string\r\n }\r\n }\r\n return string\r\n}", "pad (string, length) {\n if(length <= string.length) {\n return string;\n }\n const startPadding = Math.floor((length - string.length)/2);\n const endPadding = length - string.length - startPadding;\n const paddedString = ' '.repeat(startPadding) + string + ' '.repeat(endPadding);\n return paddedString;\n }", "function pad(string, len, fill, right, left) {\n string = string || ''\n fill = fill || ' '\n right = right === undefined ? true : right\n left = left === undefined ? false : left\n\n // Avoid infinite loop\n if (!right && !left)\n right = true;\n\n // Make sure at least one char is in place\n fill = (fill.length <= 0 ? ' ' : fill)\n\n while (string.length < len) {\n string = (left ? fill : '') + string + (right ? fill : '')\n }\n\n return string\n}", "function rpad(str, padString, length) {\n while (str.length < length)\n str = str + padString;\n return str;\n }", "pad2(str, length) {\n if (length <= str.length) return str;\n\n const startPaddingLength = Math.floor((length - str.length) / 2);\n const endPaddingLength = length - str.length - startPaddingLength;\n // Concatenate a space repeated number of start padding length with the\n // string and the number of end padding length using .repeat().\n const paddingString = \" \".repeat(startPaddingLength) + str + \" \".repeat(endPaddingLength);\n\n return paddingString;\n }", "function str_pad_left(string,pad,length) {\n return (new Array(length+1).join(pad)+string).slice(-length);\n}", "function padString(length, str) {\n\t while (str.length < length)\n\t str += \" \";\n\t return str;\n\t}", "function padString(length, str) {\n\t while (str.length < length)\n\t str += \" \";\n\t return str;\n\t}", "function pad(str, howlong, padwith) {\n var s = str.toString();\n while (s.length < howlong) {s = padwith + s;}\n return s;\n}", "function str_pad(text, length, char, right) {\n if (right === void 0) { right = false; }\n var str = \"\" + text;\n while (str.length < length) {\n str = right ? str + char : char + str;\n }\n return str;\n }", "function lpad(str, padLength, padString){\n\twhile(str.length < padLength)\n\t\tstr = padString+s;\n\treturn str;\n}", "function pad(str, howlong, padwith) {\n var s = str.toString();\n\n while (s.length < howlong) {\n\t s = padwith + s;\n }\n return s;\n }", "function str_pad (input, pad_length, pad_string, pad_type) {\n var half = '', pad_to_go;\n\n var str_pad_repeater = function (s, len) {\n \tvar collect = '', i;\n\n \twhile (collect.length < len) {\n \t\tcollect += s;\n \t}\n\n \tcollect = collect.substr(0, len);\n \treturn collect;\n };\n\n input += '';\n pad_string = pad_string !== undefined ? pad_string : ' ';\n\n if (pad_type != 'STR_PAD_LEFT' && pad_type != 'STR_PAD_RIGHT' && pad_type != 'STR_PAD_BOTH') {\n \tpad_type = 'STR_PAD_RIGHT';\n }\n\n if ((pad_to_go = pad_length - input.length) > 0) {\n if (pad_type == 'STR_PAD_LEFT') {\n \tinput = str_pad_repeater(pad_string, pad_to_go) + input;\n } else if (pad_type == 'STR_PAD_RIGHT') {\n \tinput = input + str_pad_repeater(pad_string, pad_to_go);\n } else if (pad_type == 'STR_PAD_BOTH') {\n half = str_pad_repeater(pad_string, Math.ceil(pad_to_go / 2));\n input = half + input + half;\n input = input.substr(0, pad_length);\n }\n }\n\n return input;\n}", "pad(str, length) {\n if (length <= str.length) return str;\n\n const totalPadding = length - str.length;\n const spaces = Math.floor(totalPadding / 2) + str.length;\n const beginPad = str.padStart(spaces);\n let result = \"\";\n\n if (length % 2 === 0) {\n result = beginPad.padEnd(spaces + totalPadding / 2);\n } else {\n result = beginPad.padEnd(spaces + Math.ceil(totalPadding / 2));\n }\n return result;\n }", "function padString(length, str) {\n while (str.length < length)\n str += \" \";\n return str;\n}", "function padString(length, str) {\n while (str.length < length)\n str += \" \";\n return str;\n}", "function padString(length, str) {\n while (str.length < length)\n str += \" \";\n return str;\n}", "function padString(length, str) {\n while (str.length < length)\n str += \" \";\n return str;\n}", "function pad(str, width) {\n const len = Math.max(0, width - str.length);\n return str + Array(len + 1).join(' ');\n}", "function pad(str, len)\n{\n if(str.length >= len)\n return str;\n /* hideous recursion */\n return pad(str+\" \", len);\n}", "function pad(str) {\n return (str.length < 2) ? \"0\" + str : str;\n}", "function lpad(str, pad_string, length) {\n\t\t// Force the input into a string.\n\t\tvar str = new String(str);\n\n\t\t// While the length of the string is less than the defined length, pad\n\t\t// the string with the pad string.\n\t\twhile (str.length < length) {\n\t\t\tstr = pad_string + str;\n\t\t}\n\n\t\t// Return the padded string.\n\t\treturn str;\n\t}", "function string_pad(num, width, padChar) {\n padChar = padChar || '0';\n num = num + '';\n return num.length >= width ? num : new Array(width - num.length + 1).join(padChar) + num;\n}", "function padString(length, str) {\n while (str.length < length)\n str += ' ';\n return str;\n }", "function pad ( a ) {\n\t\tvar str = String(a);\n\t\tvar pad = '00';\n\t\treturn pad.substring(0, pad.length - str.length) + str;\n\t}", "static pad (str, num) {\n let n = num < 0 ? -num : num\n if (str.length > n)\n str = str.substr(0, n)\n else {\n let pad = Array((n + 1) - str.length).join(\" \")\n str = num < 0 ? (str + pad) : (pad + str)\n }\n return str\n }", "function lPad(str, pad, length) {\n str = String(str);\n while(str.length < length) {\n str = [pad, str].join('');\n }\n return str;\n }", "function padRight(str, extend) {\n return \"\" + str + fill(str, extend);\n}", "function xPad(s,len,c,left)\r\n{\r\n if(typeof s != 'string') s=s+'';\r\n if(left) {for(var i=s.length; i<len; ++i) s=c+s;}\r\n else {for (var i=s.length; i<len; ++i) s+=c;}\r\n return s;\r\n}", "function padZero(str, len, isRight) {\n\t\tif (str == null) { str = \"\"; }\n\t\tstr = \"\" + str;\n\t\t\n\t\treturn (isRight ? str : \"\") + repeatZero(len - str.length) + (isRight ? \"\" : str);\n\t}", "function pad(number, length, ending) {\n return (`0000${number}`).slice(-length) + ending;\n }", "pad(input, len = 31, right = false) {\n if (input.length < len) {\n if (right) return input+' '.repeat(len-input.length);\n else return ' '.repeat(len-input.length)+input;\n } else return input;\n }", "function padZero(str, len, isRight) {\n\t\t\tif (str == null) { str = \"\"; }\n\t\t\tstr = \"\" + str;\n\t\t\t\n\t\t\treturn (isRight ? str : \"\") + repeatZero(len - str.length) + (isRight ? \"\" : str);\n\t\t}", "function pad(str, totalChars, padChar) {\n return (totalChars > str.length ? String(padChar).repeat(totalChars - str.length) : \"\") + str;\n}", "function padStart(originalString, padChar, newLength) {\n\n let newString = originalString.toString();\n \n while( newString.length < newLength ) {\n newString = padChar + newString;\n }\n\n return newString;\n}", "function addPad(p, ret) { var r = ''; for (var i = 0; i < p; i++) { r += ' '; } return r; }", "function rpad(str, length) { // {{{\n\twhile (str.length < length) { str = str + ' ' }\n\treturn str;\n} // }}}", "function padLeft(string, length, padding) {\n while (string.length < length) string = padding + string;\n return string;\n }", "function pad(s) { return (s < 10) ? '0' + s : s; }", "function pad(s) { return (s < 10) ? '0' + s : s; }", "function rpad(s, width, padding) {\n var str = '' + input;\n while (str.length < width) {\n str = str + padding;\n }\n return str;\n}", "function rpad(str, minLen, ch) {\n\t str = toString(str);\n\t ch = ch || ' ';\n\t return (str.length < minLen)? str + repeat(ch, minLen - str.length) : str;\n\t }", "function pad(string, width) {\n var padRight;\n var padChar;\n var result;\n var string = string + '';\n\n if (typeof arguments[2] == 'boolean') {\n padRight = arguments[2];\n padChar = arguments[3] || ' ';\n } else if (typeof arguments[3] == 'boolean') {\n padRight = arguments[3];\n padChar = arguments[2];\n } else {\n padRight = true; // padRight is true be default\n padChar = arguments[2] || ' '; // The padding character is just a space by default\n }\n\n if (string.length >= width) {\n return string;\n } else {\n result = new Array(width - string.length + 1).join(padChar);\n return padRight ? string + result : result + string;\n }\n}", "function pad(n, width, z) {\n z = z || '0'\n n = n + ''\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n\n }", "function pad(n, width, z = '0') {\n n = n + '';\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n}", "function pad(s) {\n\t\treturn (s < 10) ? '0' + s : s;\n\t}", "function pad(s) {\n return s.length === 1 ? \"0\" + s : s;\n}", "function pad(n,width) {\n var s = n.toString();\n while (s.length < width) s = ' ' + s;\n return s;\n}", "function padLeft(str,pad,len) {\n if (pad) {\n while (str.length<len) {\n str = pad + str;\n }\n }\n return str;\n}", "pad1(str, length) {\n if (length <= str.length) return str;\n\n const startingPad = Math.floor((length - str.length) / 2);\n const endingPad = length - str.length - startingPad;\n const prefix = str.padStart(startingPad + str.length);\n const paddedResult = prefix.padEnd(startingPad + str.length + endingPad);\n // const paddedResult = prefix.padEnd(length); // also works\n\n return paddedResult;\n }", "function lpad(c, str) {\n var res = '' + str;\n if (res.length < c) {\n res = Array((c - res.length) + 1).join(' ') + res;\n }\n return res;\n}", "function lpad(c, str) {\n var res = '' + str;\n if (res.length < c) {\n res = Array((c - res.length) + 1).join(' ') + res;\n }\n return res;\n}", "function lpad(c, str) {\n var res = '' + str;\n if (res.length < c) {\n res = Array((c - res.length) + 1).join(' ') + res;\n }\n return res;\n}", "function lpad(c, str) {\n var res = '' + str;\n\n if (res.length < c) {\n res = Array(c - res.length + 1).join(' ') + res;\n }\n\n return res;\n}", "function pad(num) {\n return '\\0\\0\\0\\0'.slice(0, 4 - num.toString().length) + num;\n}", "function zero_padding(string, length){\n\tif(string.length >= length){\n\t\treturn string;\n\t}\n\t\n\treturn zero_padding(\"0\" + string, length); \n}", "function pad(n, width, z) {\n z = z || '0';\n n = n + '';\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n }", "function lpad(str, minLen, ch) {\n\t str = toString(str);\n\t ch = ch || ' ';\n\n\t return (str.length < minLen) ?\n\t repeat(ch, minLen - str.length) + str : str;\n\t }", "function padString(format, stringToPad, side) {\n if (\n stringToPad.length === format.length ||\n stringToPad.length > format.length\n ) {\n return stringToPad;\n }\n\n if (side === \"l\") {\n return (format + stringToPad).slice(format.length - stringToPad.length - 1);\n } else {\n return (stringToPad + format).slice(0, format.length);\n }\n}", "function pad(n, width, z) {\n z = z || \"0\";\n n = n + \"\";\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n}", "function pad(n, width, z) {\n z = z || '0';\n n = n + '';\n return n.length >= width ? n.substr(1,width) : new Array(width - n.length + 1).join(z) + n;\n}", "static padLeft(str, c, length) {\n while (str.length < length) {\n str = c.toString() + str;\n }\n return str;\n }", "function padString(value, len, char) {\n if (len === void 0) { len = 0; }\n if (char === void 0) { char = \"0\"; }\n if (typeof value !== \"string\") {\n value = value.toString();\n }\n return len > value.length ? Array(len - value.length + 1).join(char) + value : value;\n}", "function padded_string(str)\n{\n if (str.length == 0)\n return '';\n \n var pad = padded_length(str.length) - str.length;\n var res = str;\n for (var i=0; i < pad; ++i)\n res += String.fromCharCode(0);\n\n return res;\n}", "function padNumber(num, length, pad){\n num = String(num);\n while (num.length < length){\n num = String(pad) + num;\n }\n return num;\n }", "function pad(n, width, z) {\n\t\t\t z = z || '0';\n\t\t\t n = n + '';\n\t\t\t return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n\t\t\t}", "function pad(word){\n let len = 4 - word.length;\n if (len <= 0) return word.slice(0,4);\n return word.concat(new Array(len).fill(0)); \n}", "function pad(str, len, pad, dir) {\n var STR_PAD_LEFT = 1;\n var STR_PAD_RIGHT = 2;\n var STR_PAD_BOTH = 3;\n if (str === parseInt(str))\n str = str.toString();\n//console.log(\"PAD \" + str +\",\"+ len+\",\"+pad+\",\"+dir +\" + \" + str.length);\n len = parseInt(len);\n if (typeof (len) == \"undefined\") {\n var len = 0;\n }\n if (typeof (pad) == \"undefined\") {\n var pad = ' ';\n }\n if (typeof (dir) == \"undefined\") {\n var dir = STR_PAD_RIGHT;\n }\n//pad(str, len, pad, dir)\n//console.log(\"len+1 (\" + len + \") str.length (\" + str.length+\")\");\n if (len + 1 >= str.length) {\n\n switch (dir) {\n\n case STR_PAD_LEFT:\n str = Array(len + 1 - str.length).join(pad) + str;\n break;\n case STR_PAD_BOTH:\n var right = Math.ceil((padlen = len - str.length) / 2);\n var left = padlen - right;\n str = Array(left + 1).join(pad) + str + Array(right + 1).join(pad);\n break;\n default:\n str = str + Array(len + 1 - str.length).join(pad);\n break;\n } // switch\n\n }\n return str;\n}", "function pad(n, width, z) {\n z = z || '0';\n n = n + '';\n return n.length >= width ? n : new Array(width - n.length + 1)\n .join(z) + n;\n}", "function pad(length, character) {\n return new Array(length + 1).join(character || SPACE)\n}", "function pad(n, width, z) {\n z = z || '0';\n n = n + '';\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n}", "function pad(n, width, z) {\n z = z || '0';\n n = n + '';\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n}", "function pad(n, width, z) {\n z = z || '0';\n n = n + '';\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n}", "function pad(n, width, z) {\n z = z || '0';\n n = n + '';\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n}", "function pad(n, width, z) {\n z = z || '0';\n n = n + '';\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n}", "function pad(n, width, z) {\n z = z || '0';\n n = n + '';\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n}", "function pad(n, width, z) {\n z = z || '0';\n n = n + '';\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n}", "function pad(n, width, z) {\n z = z || '0';\n n = n + '';\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n }", "function pad(n, padding, length) {\n // Defaults handle pad(n) and pad(n, <padding>)\n if (padding == null) {\n padding = '0';\n }\n if(length == undefined)\n length = 2;\n\n var s = '' + n;\n // padding may be an empty string, don't loop forever if it is\n if (padding) {\n while (s.length < length) s = padding + s;\n }\n return s;\n }", "function pad(n, width, z) {\n\t\tz = z || '0';\n\t\tn = n + '';\n\t\treturn n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n\t}", "function pad(num, totalStringSize) {\n var asString = num + \"\";\n while (asString.length < totalStringSize)\n asString = \"0\" + asString;\n return asString;\n}", "function _padString(string, padChar, length, left) {\n\t\t// Convert numbers to strings\n\t\tif (typeof string === 'number') { string = String(string); }\n\t\tif (typeof padChar === 'number') { padChar = String(padChar); }\n\n\t\t// If string isn't a string or padChar isn't a 1 character string or left isn't a boolean, bomb out\n\t\tif (typeof string !== 'string' || typeof padChar !== 'string' || padChar.length !== 1 || typeof left !== 'boolean') { return false; }\n\n\t\tvar padFunction = left ? Array.prototype.unshift : Array.prototype.push;\n\n\t\tvar padCount = length - string.length;\n\t\tvar finalString = [string];\n\t\twhile (padCount > 0) {\n\t\t\tpadFunction.call(finalString, padChar);\n\t\t\tpadCount--;\n\t\t}\n\n\t\treturn finalString.join('');\n\t}", "function pad(n, width) {\n n = n + '';\n return n.length >= width ? n : new Array(width - n.length + 1).join('0') + n;\n}", "function padStart(str, maxLength, opt_fillString) {\r\n str += '';\r\n \r\n var filler, fillLen, stringLength = str.length;\r\n \r\n return maxLength > stringLength\r\n ? (\r\n filler = (opt_fillString !== undefined ? opt_fillString + '' : '') || ' ',\r\n fillLen = maxLength - stringLength,\r\n (new Array(Math.ceil(fillLen / filler.length) + 1)).join(filler).slice(0, fillLen) + str\r\n )\r\n : str;\r\n }", "function zero_pad(input_string, desired_length) {\n let output_string = input_string;\n while (output_string.length < desired_length) {\n output_string = '0' + output_string;\n }\n return output_string;\n}", "function String$padRight(text, padWith, minLength) {\n var count = (minLength - text.length) / padWith.length;\n var result = text;\n while (count-- > 0) {\n result += padWith;\n }\n return result;\n}", "function lpad(input, width, padding) {\n var str = '' + input;\n while (str.length < width) {\n str = padding + str;\n }\n return str;\n}", "function pad(n, length, ch) {\r\n ch = ch || '0'; // default is '0'\r\n n += ''; // convert n to string\r\n\r\n // returns n as is, if it is too long\r\n return (n.length >= length) ? n : new Array(length - n.length + 1).join(ch) + n;\r\n}", "function vistaPadNumber(oldString, padChar, fieldLength) {\n var newString = '' + oldString; // Force the new var to a string\n var strLength = newString.length;\n var i;\n for (i = strLength; i < fieldLength; i++) {\n newString = '' + padChar + newString;\n }\n return newString;\n}", "function pad(number,width){\n var s = number.toString();\n var prefixWidth = width - s.length;\n if (prefixWidth>0){\n for (var i=1; i<=prefixWidth; i++) s = \" \" + s;\n }\n return s;\n}", "function padStart(string, targetLength, padString) {\n if (string.toString().length >= targetLength) {\n return string;\n }\n return padStart(padString.concat(string), targetLength, padString);\n}", "function pad(n, padding, length) {\n // pad(n, <length>)\n if (typeof padding === 'number') {\n length = padding;\n padding = '0';\n }\n\n // Defaults handle pad(n) and pad(n, <padding>)\n if (padding == null) {\n padding = '0';\n }\n length = length || 2;\n\n var s = String(n);\n // padding may be an empty string, don't loop forever if it is\n if (padding) {\n while (s.length < length) s = padding + s;\n }\n return s;\n }", "function formatWithPadding(num, string, num2) {\n\n}", "function padZero(str, len) {\n len = len || 2;\n var zeros = new Array(len).join('0');\n return (zeros + str).slice(-len);\n }", "function pad4(str) {\r\n while (str.length < 4) {\r\n str = \"0\" + str;\r\n }\r\n return str;\r\n }", "function pad4(str) {\r\n while (str.length < 4) {\r\n str = \"0\" + str;\r\n }\r\n return str;\r\n }", "function pad4(str) {\n while (str.length < 4) {\n str = \"0\" + str;\n }\n return str;\n }" ]
[ "0.79101264", "0.77842706", "0.7777383", "0.77577114", "0.773878", "0.7718352", "0.7715782", "0.7708549", "0.7677997", "0.7644627", "0.7644627", "0.76391006", "0.7629087", "0.76229614", "0.75703764", "0.7557782", "0.75477916", "0.7535909", "0.7535909", "0.7535909", "0.7535909", "0.7529972", "0.75281614", "0.7503686", "0.7474291", "0.7472267", "0.7470394", "0.7464425", "0.7438763", "0.7437726", "0.74205935", "0.7399598", "0.739906", "0.739261", "0.7390459", "0.7383116", "0.73710823", "0.72919416", "0.72640485", "0.72576606", "0.72473615", "0.72415817", "0.72415817", "0.7232199", "0.7223337", "0.72198254", "0.72090286", "0.7198484", "0.718598", "0.7181455", "0.7156094", "0.7155652", "0.7153726", "0.71526814", "0.71526814", "0.71526814", "0.7151578", "0.7142169", "0.7138435", "0.71329993", "0.7130066", "0.7128593", "0.7123872", "0.7121505", "0.71177495", "0.7117333", "0.71063936", "0.7104646", "0.7102564", "0.7098085", "0.70938784", "0.70870227", "0.70792586", "0.7075935", "0.7075935", "0.7075935", "0.7075935", "0.7073524", "0.7073524", "0.7073524", "0.70719546", "0.70687205", "0.7061706", "0.7055852", "0.70516807", "0.704464", "0.7038153", "0.7013955", "0.701365", "0.7011875", "0.69777733", "0.69758034", "0.6975596", "0.6966449", "0.69642323", "0.6960104", "0.6957186", "0.69546217", "0.69546217", "0.6952902" ]
0.71723634
50
trim the right side of a string
function rtrim(s) { return s.replace(/\s+$/, ''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FFString_trimRight( value ){\n\tif(value==null || value==\"\") return \"\";\n\n\tvar length = value.length;\n\n\tvar i;\n\tfor(i=length-1;i>=0;i--){\n\t\tif(value.charAt(i) != \" \") break;\t\t\t\n\t}\n\treturn value.substring(0,i+1);\t\n}", "function rightTrim(str) {\n var i;\n for (i = str.length - 1; i >= 0; i--) {\n if (str.charAt(i) != \" \")\n break;\n }\n str = str.substring(0, i + 1);\n return str;\n}", "function righttrim(strSrc){\r\n\tvar len = strSrc.length;\r\n\tif(typeof(strSrc)!=\"string\")\r\n\t\treturn strSrc;\r\n\tfor (var i=len-1; i>=0; i--)\r\n\t\tif(strSrc.charAt(i)!=\" \")\r\n\t\t\tbreak;\r\n\tstrSrc=strSrc.substring(0,i+1);\r\n\treturn strSrc;\r\n}", "function righttrim(value)\n{\n\twhile( value.length != 0 )\n\t{\n\t\tmychar=value.substring(value.length-1);\n\t\tif( mychar == \"\\u0020\" )\n\t\t{\n\t\t\tvalue=value.substr(0,value.length-1);\n\t\t}\n\t\telse\n\t\t\tbreak;\n\t\t\n\t}\n\treturn value;\n}", "function rightTrimFromString(str){\r\n\tif (str){\r\n\t\tif (str==\"\" || str.charAt(str.length-1) != \" \"){\r\n\t\t\treturn str;\r\n\t\t} else if (trimSpacesFromValue(str)==\"\"){\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\r\n\t\tvar index = str.length;\r\n\t\tfor (var i=str.length-1; i>=0; i--){\r\n\t\t\tif (str.charAt(i) == \" \"){\r\n\t\t\t\tindex = i;\r\n\t\t\t} else {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (index != str.length){\r\n\t\t\treturn str.substring(0, index);\r\n\t\t}\r\n\t\treturn str;\r\n\t} else {\r\n\t\treturn \"\";\r\n\t}\r\n}", "function trimRight(text, ending) {\n while (text.length >= ending.length && text.lastIndexOf(ending) === text.length - ending.length) {\n text = text.substring(0, text.length - ending.length);\n }\n \n return text;\n }", "function FFString_trim( value ){\n\treturn FFString_trimRight(FFSting_trimLeft(value));\t\n}", "function rtrim(str)\n{\n var whitespace = new String(\" \\t\\n\\r\");\n var s = new String(str);\n if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {\n var i = s.length - 1; // Get length of string\n while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)\n i--;\n s = s.substring(0, i+1);\n }\n return s;\n}", "function trim(str) {\n return rtrim(ltrim(str));\n}", "function trim()\n{\n return this.rtrim().ltrim();\n}", "function stringTrim(str) {\n return leftTrim(rightTrim(str));\n}", "function rtrim(str) {\n return str.replace(/\\s+$/, \"\");\n}", "function trim( str ) \r\n{\r\n\tvar resultstr = \"\";\r\n\r\n\tresultstr = trimleft(str);\r\n\tresultstr = trimright(resultstr);\r\n\treturn resultstr;\r\n}", "function trim(string) {\n}", "function trimR(s) {\n if (s[s.length - 1] === \"R\" && s[s.length - 2] === \"/\") {\n s = s.substring(0, s.length - 2);\n }\n if (s[s.length - 1] === \"/\") {\n s = s.substring(0, s.length - 1);\n }\n return s;\n}", "function String_Trim()\n{\n\treturn this.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n}", "function StringTrim(VALUE,SIDE) {\n\tvar v_length = VALUE.length; \n\tif(v_length < 0) return \"\";\n\tvar s = SIDE; \n\tvar w_space = String.fromCharCode(32);\n\tvar strTemp = \"\";\n\tif (s == 'right') { // right side\n\t\tvar iTemp = v_length -1;\n\t\twhile(iTemp > -1){\n\t\t\tif(VALUE.charAt(iTemp) == w_space){}\n\t else {\n\t \tstrTemp = VALUE.substring(0,iTemp +1);\n\t \tbreak;\n\t\t\t}\n\t iTemp = iTemp-1;\n\t\t}\n\t} else { // left side\n\t\tvar iTemp = 0;\n\t while(iTemp < v_length){\n\t \tif(VALUE.charAt(iTemp) == w_space){}\n\t else{\n\t \tstrTemp = VALUE.substring(iTemp,v_length);\n\t break;\n\t }\n\t\t\tiTemp = iTemp + 1;\n\t\t}\n\t}\nreturn strTemp;\n}", "function lrtrim(strSrc){\r\n\tstrSrc = lefttrim(strSrc);\r\n\tstrSrc = righttrim(strSrc);\r\n\treturn strSrc;\r\n}", "function rtrim(para) {\n\twhile(para.substring(para.length-1, 1) == ' ') {\n\t\tpara = para.substring(0, para.length-1);\n\t}\n\n\treturn para;\n}", "function trim(str){\treturn str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');}", "function trim(s) { return s.trim(); }", "function trim(s) { return s.trim(); }", "function trim (str) { //high efficiency\n\t\treturn this.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n\t}", "function trim(string) { return string.replace(/^\\s+|\\s+$/g , ''); }", "function rtrim()\n{\n return this.replace( /\\s+$/g,'');\n}", "function trim(str)\r\n{\r\n\r\nwhile(''+str.charAt(0)==' ') str=str.substring(1,str.length);\r\n\r\nwhile(''+str.charAt(str.length-1)==' ') str=str.substring(0,str.length-1);\r\n\r\nreturn str;\r\n}", "function rtrim(str) \r\n{\r\n var chars = \"\\\\s\";\r\n return str.replace(new RegExp(\"[\" + chars + \"]+$\", \"g\"), \"\");\r\n}", "function Trim(str) {\n if (str.substring(0, 1) == \" \") {\n str = str.substring(1, str.length);\n }\n if (str.substring(str.length - 1, str.length) == \" \") {\n str = str.substring(0, str.length - 1);\n }\n return str;\n}", "function chopRight(str = '', end = '') {\n if (!_.endsWith(str, end)) return str;\n return str.substring(0, str.length - end.length);\n}", "function ui_trim (str_string){\n\tvar exp_Space_head \t= /^(\\s+)(\\S?.*)$/ ; //define exp pattern, all space at header\n\tvar exp_Space_tail \t\t= /^(.*\\S+)(\\s+)$/ ; //define exp pattern, all space at tail\n\tstr_string = str_string.replace(exp_Space_head, \"$2\"); // remove the space at the header\n\tstr_string = str_string.replace(exp_Space_tail, \"$1\"); // remove the space at the tail\n\treturn str_string;\n}", "function RTrim(str)\r\n/*\r\n PURPOSE: Remove trailing blanks from our string.\r\n IN: str - the string we want to RTrim\r\n\r\n*/\r\n{\r\n // We don't want to trip JUST spaces, but also tabs,\r\n // line feeds, etc. Add anything else you want to\r\n // \"trim\" here in Whitespace\r\n var whitespace = new String(\" \\t\\n\\r\");\r\n\r\n var s = new String(str);\r\n\r\n if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {\r\n // We have a string with trailing blank(s)...\r\n\r\n var i = s.length - 1; // Get length of string\r\n\r\n // Iterate from the far right of string until we\r\n // don't have any more whitespace...\r\n while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)\r\n i--;\r\n\r\n\r\n // Get the substring from the front of the string to\r\n // where the last non-whitespace character is...\r\n s = s.substring(0, i+1);\r\n }\r\n\r\n return s;\r\n}", "function trim(str) { Logger.log('in trim(), str is ' + str);\n return str.replace(/^\\s+/, '').replace(/\\s+$/, '');\n}", "function RTrim(str)\n/*\n PURPOSE: Remove trailing blanks from our string.\n IN: str - the string we want to RTrim\n\n*/\n{\n // We don't want to trip JUST spaces, but also tabs,\n // line feeds, etc. Add anything else you want to\n // \"trim\" here in Whitespace\n var whitespace = new String(\" \\t\\n\\r\");\n\n var s = new String(str);\n\n if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {\n // We have a string with trailing blank(s)...\n\n var i = s.length - 1; // Get length of string\n\n // Iterate from the far right of string until we\n // don't have any more whitespace...\n while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)\n i--;\n\n\n // Get the substring from the front of the string to\n // where the last non-whitespace character is...\n s = s.substring(0, i+1);\n }\n\n return s;\n}", "function RTrim(str)\n/*\n PURPOSE: Remove trailing blanks from our string.\n IN: str - the string we want to RTrim\n\n*/\n{\n // We don't want to trip JUST spaces, but also tabs,\n // line feeds, etc. Add anything else you want to\n // \"trim\" here in Whitespace\n var whitespace = new String(\" \\t\\n\\r\");\n\n var s = new String(str);\n\n if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {\n // We have a string with trailing blank(s)...\n\n var i = s.length - 1; // Get length of string\n\n // Iterate from the far right of string until we\n // don't have any more whitespace...\n while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)\n i--;\n\n\n // Get the substring from the front of the string to\n // where the last non-whitespace character is...\n s = s.substring(0, i+1);\n }\n\n return s;\n}", "function RTrim( value ) {\r\n\r\n var re = /((\\s*\\S+)*)\\s*/;\r\n return value.replace(re, \"$1\");\r\n\r\n}", "function trimX(str) {\r\n\tif (isEmpty(str))\r\n\t\treturn '';\r\n\r\n\treturn str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\r\n}", "function trim (str) {\n return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n }", "function trim_string() {\n var ichar, icount;\n var strValue = this;\n ichar = strValue.length - 1;\n icount = -1;\n while (strValue.charAt(ichar)==' ' && ichar > icount)\n {--ichar;}\n // End While\n if (ichar!=(strValue.length-1))\n {strValue = strValue.slice(0,ichar+1);}\n // End If\n ichar = 0;\n icount = strValue.length - 1;\n while (strValue.charAt(ichar)==' ' && ichar < icount)\n {++ichar;}\n // End While\n if (ichar!=0)\n {strValue = strValue.slice(ichar,strValue.length);}\n // End If\n return strValue;\n}// End Function", "function rtrim(strInput){\n var result = strInput.replace(/\\s+$/, \"\");\n return result;\n}", "function removeLeadingAndTrailingWhitespace(string: string){\n\t\t\t\t\t\n\t\t\t\t\t//Remove the first character of whitespace, if it's there\n\t\t\t\t\tif (string.indexOf(' ') === 0){\n\t\t\t\t\t\tstring = string.slice(1);\n\t\t\t\t\t}\n\n\t\t\t\t\t//Remove the last character of whitespace, if it's there\n\t\t\t\t\tif (string.lastIndexOf(' ') === string.length -1){\n\t\t\t\t\t\tstring = string.slice(0, -1);\n\t\t\t\t\t}\n\t\t\t\t\treturn string;\n\t\t\t\t}", "function trim(para) {\n\treturn rtrim(ltrim(para));\n}", "function trim(s){\n return s.replace(/^\\s+|\\s+$/, '');\n}", "function RZright( str, noChars )\n{\n\tif (!str) return '';\n\tvar len = str.length;\n\tif (len == 0) return \"\";\n\n\tif (noChars > len) noChars = len;\n\treturn str.substring(len-noChars);\n}", "function ltrim(value) {\n\tif (value) {\n\t\tvar re = /\\s*((\\S+\\s*)*)/;\n\t\treturn value.replace(re, '$1');\n\t}\n\treturn '';\n}", "function trim( value ) {\n return LTrim(RTrim(value));\n}", "function rtrim(path) {\n\t\treturn _.str.rtrim(path, \"/\");\n\t}", "function trim(string) {\n return string.replace(/^\\s+/,'').replace(/\\s+$/,'');\n }", "function trim(str, char=\" \") {\r\n // If both the charcter and string are not\r\n // string, then no need to proceed.\r\n if (typeof(str) != 'string' || typeof(char) != 'string') {\r\n return;\r\n }\r\n return ltrim(rtirm(str));\r\n }", "function trim(value) {\n return LTrim(RTrim(value));\n}", "function rTrim(sString)\r\n\t{ \r\n\t\tvar sStr,i,sResult = \"\",sTemp = \"\" ;\r\n\t\t\r\n\t\t if (sString.length == 0) { return \"\" ;} //\r\n\t\t\r\n\t\tsStr = sString.split(\"\");\r\n\t\tfor (i = sStr.length - 1 ; i >= 0 ; i --) //\r\n\t\t{ \r\n\t\tsResult = sResult + sStr[i]; \r\n\t\t}\r\n\t\tsTemp = JStrLTrim(sResult) ; //\r\n\t\t\r\n\t\tif (sTemp == \"\") { return \"\" ; }\r\n\t\t\r\n\t\tsStr = sTemp.split(\"\");\r\n\t\tsResult = \"\" ;\r\n\t\tfor (i = sStr.length - 1 ; i >= 0 ; i--) //\r\n\t\t{\r\n\t\tsResult = sResult + sStr[i];\r\n\t\t}\r\n\t\treturn sResult ;\r\n\t}", "function trim(s) {\n return s.replace(/^\\s+|\\s+$/, '');\n}", "function trim(str)\n{\n return str.replace(/^\\s+/, '').replace(/\\s+$/, '');\n}", "function trim()\n{\n if(this.length < 1)\n return \"\";\n \n var s = this;\n \n while(s.startsWith(' ')||s.startsWith('\\t')||s.startsWith('\\n')\n ||s.startsWith('\\r'))\n s = s.substr(1);\n \n while(s.endsWith(' ')||s.endsWith('\\t')||s.endsWith('\\n')\n ||s.endsWith('\\r'))\n s = s.substring(0, s.length - 1);\n \n return s;\n}", "function keepLast(str)\n{\n\treturn str.slice(str.length - 2)\n}", "function rtrim(str, char=\" \") {\r\n // If both the charcter and string are not\r\n // string, then no need to proceed.\r\n if (typeof(str) != 'string' || typeof(char) != 'string') {\r\n return;\r\n }\r\n var pattern = new RegExp(char + '+$', 'g');\r\n return str.replace(pattern, '');\r\n }", "function trim(s) { return s.replace(/^\\s+|\\s+$/g, ''); }", "function trim( value ) {\r\n return LTrim(RTrim(value));\r\n}", "function trim( string )\n{\n\treturn string.replace(/^\\s+/g, '').replace(/\\s+$/g, '');\n}", "function trim (string) {\n return string.replace(/^\\s+|\\s+$/g, '');\n}", "function trim (string) {\n return string.replace(/^\\s+|\\s+$/g, '');\n}", "function strEndTrim(intarget){\r\n\tvar outtarget=intarget;\r\n\tvar poslen = intarget.length;\r\n\tif (poslen<=0) return outtarget; //no change possible\r\n\twhile (intarget.charAt(poslen-1) == \" \"){\r\n\t\tposlen--;\r\n\t}\r\n\tif (poslen<intarget.length) poslen++;\r\n\tif ((poslen<intarget.length) && (poslen>=0)) //make it have a valid change to be changed\r\n\t\touttarget = intarget.substring(0, poslen); //substring(start, length)\r\n\treturn outtarget;\r\n}", "function ltrim()\n{\n return this.replace( /^\\s+/g,'');\n}", "function trim (str){\r\n\t\treturn str.replace(/^\\s+/g,'').replace(/\\s+$/g,'')\r\n\t}", "function stripLastChar(myString) {\n return myString.substring(0, myString.length - 1).trim();\n }", "function trim(str) {\n str = str.replace(/^\\s\\s*/, '');\n let ws = /\\s/, i = str.length;\n while (ws.test(str.charAt(--i))) {\n //do nothing\n }\n return str.slice(0, i + 1);\n }", "function trim( str ) {\r\n\tvar len = str.length;\r\n\tvar begin = 0;\r\n\tvar end = len;\r\n\twhile ( str.charAt(begin) == \" \" )\r\n\t\tbegin++;\r\n\twhile ( str.charAt(end-1) == \" \" )\r\n\t\tend--;\r\n\treturn str.slice(begin, end);\r\n}", "function trim( value )\n{\n\treturn lTrim(rTrim(value));\n}", "function LTrim(str) {\r\n for (var i=0; str.charAt(i)==\" \"; i++);\r\n return str.substring(i,str.length);\r\n }", "function rtrim(str, chars) {\n\t str = toString(str);\n\t chars = chars || WHITE_SPACES;\n\n\t var end = str.length - 1,\n\t charLen = chars.length,\n\t found = true,\n\t i, c;\n\n\t while (found && end >= 0) {\n\t found = false;\n\t i = -1;\n\t c = str.charAt(end);\n\n\t while (++i < charLen) {\n\t if (c === chars[i]) {\n\t found = true;\n\t end--;\n\t break;\n\t }\n\t }\n\t }\n\n\t return (end >= 0) ? str.substring(0, end + 1) : '';\n\t }", "function trim(str) { \r\n if (str != null) {\r\n var i; \r\n for (i=0; i<str.length; i++) {\r\n if (str.charAt(i)!=\" \") {\r\n str=str.substring(i,str.length); \r\n break;\r\n } \r\n } \r\n \r\n for (i=str.length-1; i>=0; i--) {\r\n if (str.charAt(i)!=\" \") {\r\n str=str.substring(0,i+1); \r\n break;\r\n } \r\n } \r\n \r\n if (str.charAt(0)==\" \") {\r\n return \"\"; \r\n } else {\r\n return str; \r\n }\r\n }\r\n}", "function trim(str) {\n return str.trim();\n }", "function trim(s) {\n\treturn s.replace(/^\\s*/, \"\").replace(/\\s*$/, \"\");\n}", "function trim( value ) {\n\t\n\treturn LTrim(RTrim(value));\n}", "function trim( value ) {\r\n\t\treturn LTrim(RTrim(value));\r\n\t}", "function trim(str)\n/*\n PURPOSE: Remove trailing and leading blanks from our string.\n IN: str - the string we want to Trim\n\n RETVAL: A Trimmed string!\n*/\n{\n return RTrim(LTrim(str));\n}", "function trim(str)\n/*\n PURPOSE: Remove trailing and leading blanks from our string.\n IN: str - the string we want to Trim\n\n RETVAL: A Trimmed string!\n*/\n{\n return RTrim(LTrim(str));\n}", "function f_string_trim(ps_value) {\n\n if (ps_value === null) {\n return(ps_value);\n }\n\n if (ps_value === undefined) {\n return(ps_value);\n }\n\n if (ps_value === \"\") {\n return(ps_value);\n }\n\n return(ps_value\n .replace(/^\\s+/g, \"\")\n .replace(/\\s+$/g, \"\"));\n}", "function trim( value ) {\n\n return LTrim(RTrim(value));\n\n}", "function LTrim( value ) {\r\n\t\tvar re = /\\s*((\\S+\\s*)*)/;\r\n\t\treturn value.replace(re, \"$1\");\r\n\t}", "function trim(stringValue) {\r\n // var trimedString = stringValue.replace( /^\\s+/g, \"\" );\r\n // return trimedString.replace( /\\s+$/g, \"\" );\r\n return ltrim(rtrim(stringValue));\r\n}", "function trim( value )\r\n{\r\n return LTrim(RTrim(value));\r\n}", "function trim( value ) {\r\n\t\r\n return LTrim(RTrim(value));\r\n\t\r\n }", "function trim( value )\n{\n\n return LTrim(RTrim(value));\n\n}", "function s_trim(TRIM_VALUE) {\n\tif(TRIM_VALUE.length < 1) return\"\";\n TRIM_VALUE = StringTrim(TRIM_VALUE,'right');\n TRIM_VALUE = StringTrim(TRIM_VALUE,'left');\n if(TRIM_VALUE==\"\") return \"\";\n\t\telse return TRIM_VALUE;\n}", "function RZtrim(tmpStr)\n{\n\tif (typeof(tmpStr) == 'undefined' || tmpStr == null || tmpStr == '')\n\t\treturn tmpStr;\n\n\t//----- need to strip \\t besides ' '\n\t//while(tmpStr.substring(0,1) == ' ')\n\twhile (/^\\s/.test(tmpStr))\n\t\ttmpStr = tmpStr.substring(1, tmpStr.length);\n\n\t//while(tmpStr.substring(tmpStr.length-1,tmpStr.length) == ' ')\n\twhile (/\\s$/.test(tmpStr))\n\t\ttmpStr = tmpStr.substring(0, tmpStr.length - 1);\n\n\treturn tmpStr;\n}", "function strTrim(str){\n return str.replace(/^\\s+/,'').replace(/\\s+$/,'')\n}", "function trim( value ) {\r\n\treturn LTrim(RTrim(value));\r\n}", "function trim(str){\r\n\treturn str.replace(/^\\s+|\\s+$/g, \"\");\r\n}", "function trim(s) {\n\treturn s.replace(/(^\\s+)|(\\s+$)/g, \"\")\n}", "function trim( value ) {\n\t\n\treturn LTrim(RTrim(value));\n\t\n}", "function trim( value ) {\n\t\n\treturn LTrim(RTrim(value));\n\t\n}", "function trim( value ) {\n\t\n\treturn LTrim(RTrim(value));\n\t\n}", "function trim( value ) {\r\n\t\r\n\treturn LTrim(RTrim(value));\r\n\t\r\n}", "function utilTrim (str) {\n if (String.prototype.trim) {\n return str.trim();\n }\n return str.replace(/(^\\s*)|(\\s*$)/g, '');\n }", "function ltrim(str) {\n return str.replace(/^\\s+/, \"\");\n}", "function leftTrim(str) {\n var i;\n for (i = 0; i < str.length; i++) {\n if (str.charAt(i) != \" \")\n break;\n }\n str = str.substring(i, str.length);\n return str;\n}", "function trimTrailingSpaces(s) {\n return s.replace (/[ ]+$/gm, '');\n }", "function LTrim( value ) {\n\tvar re = /\\s*((\\S+\\s*)*)/;\n\treturn value.replace(re, \"$1\");\n}", "function LTrim( value ) {\t\r\n var re = /\\s*((\\S+\\s*)*)/;\r\n return value.replace(re, \"$1\");\r\n\r\n}", "function di_trim(s) {\n var temp = s;\n return temp.replace(/^\\s+/,'').replace(/\\s+$/,'');\n}" ]
[ "0.81257385", "0.7704638", "0.76750183", "0.74728", "0.74419576", "0.73458874", "0.7305989", "0.72334325", "0.7211007", "0.7165027", "0.71606374", "0.71409476", "0.7122035", "0.70639", "0.7053085", "0.70468867", "0.70270354", "0.70139444", "0.70003986", "0.6988761", "0.6975565", "0.6975565", "0.69481856", "0.69397587", "0.6931096", "0.69194317", "0.6861236", "0.6854422", "0.6854081", "0.6853994", "0.68399125", "0.68313575", "0.6809237", "0.6809237", "0.67977726", "0.6785074", "0.6762667", "0.6748774", "0.6743073", "0.6738932", "0.6738824", "0.6729212", "0.6728456", "0.6717497", "0.6717038", "0.6705544", "0.67019963", "0.6701783", "0.6701714", "0.6696171", "0.6693798", "0.6693629", "0.6669658", "0.66619843", "0.66596067", "0.66428417", "0.66361344", "0.66308075", "0.6629985", "0.6629985", "0.6625926", "0.6622472", "0.6621873", "0.66204315", "0.6618123", "0.66125715", "0.6609195", "0.6599309", "0.659482", "0.6591097", "0.6587653", "0.65823674", "0.6580102", "0.6579736", "0.6576283", "0.6576283", "0.6574771", "0.656974", "0.6566196", "0.656567", "0.6562742", "0.65586436", "0.6553876", "0.6553712", "0.6543301", "0.6542295", "0.6539158", "0.6522298", "0.6509678", "0.6507233", "0.6507233", "0.6507233", "0.65004057", "0.6495997", "0.6495223", "0.64926535", "0.6488241", "0.64868087", "0.64753366", "0.6474819" ]
0.7037609
16
called at process start and optionally every 10 seconds
function go(initial) { // totals for --status var totals = { hosts: [ 0, 0, 0, 0 ], services: [ 0, 0, 0, 0 ], }; var problems = 0; // read the status file var data; try { data = parse(fs.readFileSync(opts.file, 'utf8')); } catch (e) { if (initial) { console.error('failed to read %s: %s', opts.file, e.message); process.exit(1); } // print the error and keep watching console.error('[%s] failed to read %s: %s', new Date(), opts.file, e.message); return; } // construct a hosts object keyed by hostname var hosts = {}; longesthostname = 0; data.hoststatus.forEach(function(host) { hosts[host.host_name] = host; longesthostname = Math.max(longesthostname, host.host_name.length); }); // clear the screen if `-w` is supplied if (opts.watch) { clear(true); console.log('%s\n', new Date()); } if (opts.header) console.log('Nagios View - %s - updated %s\n', opts.file, human(new Date(data.info[0].created * 1000))); // the current hostname being processed var hostname; // the hostname is lazily printed in the case that a service is not in OK // status, if the host is not in OK status, or if `-a` is supplied... this // variable acts as a boolean to determine if the hostname has been printed // yet var printed; // number of hosts printed var hostsprinted = 0; // loop each service data.servicestatus.forEach(function(service) { var host = hosts[service.host_name]; // total problems if (service.current_state !== 0) problems++; // check filter (first operand) for (var i = 0; i < filters.length; i++) { var filter = filters[i]; if (service.host_name.indexOf(filter) < 0 && service.service_description.indexOf(filter) < 0) return; } // total the service state if (totals.services[service.current_state] !== undefined) totals.services[service.current_state]++; // check if its the first time seeing a host if (hostname !== service.host_name) { // total the host state if (totals.hosts[host.current_state] !== undefined) totals.hosts[host.current_state]++; // total problems if (host.current_state !== 0) problems++; hostname = service.host_name; printed = false; if (opts.statusonly) return; if (!opts.servicesonly && (host.current_state !== 0 || (opts.hostsonly && !opts.problems))) { if (!opts.hostsonly && hostsprinted++ > 0) console.log(); printhost(host); printed = true; } } // return if --hosts-only or --status-only is supplied if (opts.hostsonly || opts.statusonly) return; // only print the service if it is not OK, or if -p is not supplied if (!opts.problems || service.current_state !== 0) { // don't print if it has been acknowledged if (opts.hideacknowledged && service.problem_has_been_acknowledged) return; // print the hostname if this is the first time if (!opts.servicesonly && !printed) { if (hostsprinted++ > 0) console.log(); printhost(host); printed = true; } // prit the service line and record the totals printservice(service); } }); // print *something* if there were no problems if (opts.problems && problems === 0) console.log('(no problems)'); if (opts.status) { if (!opts.statusonly) console.log(); // loop "hosts" and "services" Object.keys(totals).forEach(function(key) { var total = totals[key]; var counts = total.map(function(count, code) { return sprintf('%5d %s', count, codenames[code]); }); // figure out what mark to print // the priority is critical, warning, unknown, and finally OK var code = 0; [2, 1, 3, 0].reverse().forEach(function(num) { if (total[num]) code = num; }); printf('%s %-10s %s\n', service_marks[code], key, counts.join(' ')); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startProcessingHandler(noTimer) {\n\tlet processor = child.spawn(\"node\", [\"processor.js\"], {});\n\tprocessor.stdout.on('data', (data) => {\n\t\tconsole.log(`Processor: ${data}`);\n\t});\n\n\tprocessor.stderr.on('data', (data) => {\n\t\tconsole.error(`Processor: ${data}`);\n\t});\n\n\tprocessor.on('close', (code) => {\n\t\tconsole.log(`Processor exited: ${code}`);\n\t\tif (code === 255 || code === -1) {\n\t\t\t// Start Processing again in 5 minutes.\n\t\t\tconsole.log(\"Processor Exited with failed to download, restarting download in 5 minutes.\")\n\t\t\tsetTimeout(() => {startProcessingHandler(true); }, 5*60*1000);\n\t\t}\n\t});\n\n\tif (noTimer === true) {\n\t\treturn;\n\t}\n\t// Figure out the next timestamp to run the next processing run\n\tlet tomorrow = new Date();\n\ttomorrow.setMinutes(60);\n\ttomorrow.setSeconds(0);\n\tif (tomorrow.getHours() > 3) {\n\t\t// Next Day\n\t\ttomorrow.setHours(24);\n\t\ttomorrow.setHours(3);\n\t} else {\n\t\t// Today\n\t\ttomorrow.setHours(3);\n\t}\n\tlet nextTimeStamp = (tomorrow.getTime()-Date.now());\n\tconsole.log(\"Setting next Processing Run for\", nextTimeStamp/1000);\n\n\tsetTimeout(startProcessingHandler, nextTimeStamp);\n}", "start(){\n let _this = this;\n // run the main sequence every process_frequency seconds\n _this.logger.info('starting work');\n _this.execute = true;\n _this.run();\n }", "start() {\n // Run immediately..\n this.runUpdate();\n\n // .. then schedule 15 min interval\n timers.setInterval(() => {\n this.runUpdate();\n }, 900000);\n }", "function startTimer() {\n if(started == false ){\n started = true;\n myp5.background(200, 200, 200, 0);\n startTime = Date.now();\n }\n}", "function timer()\r\n {\r\n console.log(\"running...\");\r\n }", "start() {\r\n this.update();\r\n setInterval(this.update.bind(this), 60000);\r\n }", "start() {\n timer.start();\n }", "start() {\n\t\tthis.startTime = Date.now();\n\t}", "start() {\n // initiliaze a time var for the starting time of the invocation\n\n // set the interval\n interval = setInterval(() => {\n // check if the time value is greater than 60 if true reset the value to 1\n if (time > 60) time = 1;\n //with invoking setInterval: inkoking the cb as first para\n this.cb(time);\n // increment the time to the next second\n time++;\n // time interval as second para\n }, 1000);\n }", "_setupLoop () {\n this._time = 0\n this._loop()\n }", "start() {\r\n this.update();\r\n setInterval(this.update.bind(this), 30000);\r\n }", "function start() {\n setInterval(ping, 3000);\n }", "function init() {\n lastTime = Date.now();\n main();\n }", "function init() {\n lastTime = Date.now();\n main();\n }", "start () {\n\t\tthis.updateTask.setRepeating ((callback) => {\n\t\t\tthis.update (callback);\n\t\t}, App.HeartbeatPeriod * 4, App.HeartbeatPeriod * 8);\n\t}", "function start(){\n\tinit();\n\ttimer=setInterval('run()', 100);\n}", "boot() {\n log.info('Ready called in uptime');\n setInterval(count, 60000);\n }", "start () {\n\t\tthis.updateTask.setRepeating ((callback) => {\n\t\t\tthis.update (callback);\n\t\t}, App.HeartbeatPeriod, App.HeartbeatPeriod * 2);\n\t}", "function starttime(){\n \twatch = setInterval(count, 1000)\n time = 10; \n }", "started() {\r\n\r\n\t}", "function init() {\n\n\tupdate();\n\n\tif(alarm_loop) scriptRunning = true;\n\telse scriptRunning = false;\n\n\tpassedMinutes = 0;\n}", "started () {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "startTick(){\n this.loop = setInterval(() => {\n this.tickEvent();\n }, 1000/this.tickPerSec);\n this.isTickStarted = true;\n }", "function printMsgRepeated(){\n console.log(\"This msg is fired every 1s\");\n}", "function startTimer() {\n status = 1;\n timer();\n }", "load() {\n this.loadEventLoop(600)\n }", "function startIntevall() {\r\n start = setInterval(function () {\r\n timer();\r\n }, 1000);\r\n }", "function start() {\n // this gets executed on startup\n //... \n net = new convnetjs.Net();\n // ...\n \n // example of running something every 1 second\n setInterval(periodic, 1000);\n}", "function startLoop() {\n\tisrunnning = true;\n}", "function stopwatchStart(event){\n event.preventDefault()\n console.log('started!')\n\n if (stopwatchRunning == false){\n stopwatchRunning = true\n // every 10 milliseconds, update the stopwatch\n intervalId = setInterval(stopwatchUpdate, intervalRate)\n }\n}", "function startMon(){\n\tinit();\n}", "function start()\r\n{\r\n interval = setInterval(timer,10);\r\n}", "function execRequest() {\n setInterval(handleRefresh, 3000);\n}", "setupTimer() {\n this.stopTimer();\n const secs = parseInt( this._options.interval );\n if ( !secs ) return;\n this._interval = setInterval( () => {\n if ( !this._options.enabled ) return;\n this.fetchNextHandler();\n }, 1000 * secs );\n }", "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "start() {\n\t\tthis._stopped = false;\n\t\tthis.heartbeatTimeout.restart();\n\t}", "function schedulePeriodicTest()\n{\n\tthis.CallbackTimer = setTimeout(periodic_test.bind(this), 10000);\n}", "start() {}", "start() {}", "start() {}", "start() {}", "start() {}", "start() {}", "start() {\r\n this.update();\r\n setInterval(this.update.bind(this), 30 * 1000);\r\n }", "started() {\n\t}", "function updateRSS () {\n setInterval(initialize, 1000 * 60 * 60 * 4); // runs Initialize ever 4 hours from first load\n}", "function startPomoTimer() {\n time = Date.now();\n timerEnd = time + WORK_DURATION;\n setTimeout(refreshPomoTimer, UPDATE_TIMER_EVERY);\n}", "function init() {\r\n reset();\r\n lastTime = Date.now();\r\n main();\r\n }", "started() { }", "function run() {\n update();\n setInterval(update, 3600000);\n}", "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "function init() {\n\n// reset();\n lastTime = Date.now();\n main();\n }", "start () {}", "function controlLoop(){\r\n refreshData();\r\n setInterval(refreshData,10000);\r\n}", "function startLater() {\n delay(80).then(start);\n}", "function start () {\n timerHandle = setInterval(beat, interval)\n }", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "_startTimer() {\n this._timeoutId = window.setInterval(() => {\n if (this._requested) {\n this.refresh();\n return;\n }\n if (document.hidden) {\n // Don't poll when nobody's looking.\n return;\n }\n let date = new Date().getTime();\n if (date - this._lastRefresh > this._refreshDuration) {\n this.refresh();\n }\n }, MIN_REFRESH);\n }", "begin(n) {\n this.tickInterval = n;\n this.queueInterval = window.setInterval(this.onTick.bind(this), this.tickInterval);\n }", "function init() {\n var interval = setInterval(handleRefresh, 3000);\n handleRefresh();\n}", "started() {\n\n }", "started() {\n\n }", "started() {\n\n }", "function start(){\n\t starter = setInterval(randomnData, 100);\n\t\n\t\n}", "function timerStart(){\n\t\n\t\t\n\t}", "startPeriodicRefresh() {\n setTimeout(() => {\n\n if (this.dataNeedsRefresh) {\n this.processData();\n this.dataNeedsRefresh = false;\n }\n\n this.startPeriodicRefresh();\n }, this.DATA_PROCESSING_REFRESH_WAIT_PERIOD);\n }", "sleepForProcess(time) {\nthis._sleepProcessContinueTime = Date.now() + time;\nreturn this;\n}", "function cronJob() {\n\t\t//Schedule Synchronized Loop, so we dont get of sync \n\t\tnextMinute(function () {\n util.log(\"Exec loop\"); \n MomoInstance.execCronsNow(); \n cronJob();\n\t\t});\n\t}", "function startTimer() {\n if( started === false ) {\n\n // how to call a function every Nth seconds https://stackoverflow.com/questions/2170923/whats-the-easiest-way-to-call-a-function-every-5-seconds-in-jquery\n // for displaying milliseconds see https://codepen.io/_Billy_Brown/pen/dbJeh\n interval = setInterval(function() {\n //debugger\n time++;\n timer.innerHTML = calculateTime();\n }, 10);\n\n // toggle started as timer has been kicked off\n started = true;\n\n } else {\n stopTimer();\n\n }\n }", "function start() {\n init();\n run();\n }", "function start (){ \r\nsetInterval(tickUpdate,12);\r\n}", "function _startTimer() {\n service.timer.start(times.ONE_MINUTE);\n }", "function run() {\n\tintervalId = setInterval(display, 60000);\n}", "function launch() {\n\tcont=1;\n\tt1=setInterval(\"beginp()\",iter);\n}", "init() {\n super.init();\n\n // noinspection JSUnusedGlobalSymbols\n this.interval = setInterval(function() {\n console.error('tick');\n }, 5000);\n\n // Tell the unit test that we are alive\n process.send('Reporting for duty');\n }", "function mainLoop( ) {\n\n\n let segundos = 5;\n let tiempo = segundos * 1000;\n\n\n console.log('Intervalo de '+ segundos );\n console.log('Perioodo: ');\n\n\n REALTIME.actualizarREALTIME( );\n\n setInterval((tiempo) => {\n console.log('-------------------------------------------------------');\n console.log('Intervalo de REALTIME '+ segundos );\n console.log('PERIODO');\n REALTIME.actualizarREALTIME( );\n }, tiempo )\n\n}", "function startProcess () {\n\n\tvar currentdate = new Date();\n\n\tvar datetime = currentdate.getDate() + \"/\"\n\t\t+ (currentdate.getMonth()+1) + \"/\"\n\t\t+ currentdate.getFullYear() + \" @ \"\n\t\t+ currentdate.getHours() + \":\"\n\n\tconsole.log('Topdesk Maintenance Process for date: ', + currentdate.getDate() + \"/\" + currentdate.getMonth()+1 + \"/\" + currentdate.getFullYear() + \": \"+ currentdate.getHours());\n\n try {\n\n\t\tfs.appendFile(\"topdesk_process.log\", \"Topdesk Maintenance Process for date: \" + currentdate.getDate() + \"/\" + currentdate.getMonth() + \"/\" + currentdate.getFullYear() + \": \"+ currentdate.getHours() + \"\\n\", (err) => {});\n\n\t\t//data.getDataClosed();\n\t\tdata.routeNewTickets();\n\n\t\t//For getting TD objects and testing\n\t\t//data.getTicketsToInspect();\n\n\t} catch (e) {\n\t\tconsole.log(\"App crashed while managing connection \" + e.message);\n\t}\n}", "function onFileLoaded(cpu) {\n cpu.startClock();\n}", "start() {\n\t\t\tif (this._running) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._scheduler = new Scheduler();\n\t\t\tthis._running = true;\n\n\t\t\tprocessBuffer.call(this);\n\t\t}" ]
[ "0.66415465", "0.6625516", "0.6484524", "0.6356058", "0.6308685", "0.62354547", "0.62024814", "0.6184439", "0.6176344", "0.6145836", "0.6140045", "0.6120244", "0.61116046", "0.61116046", "0.6096776", "0.6087877", "0.6069133", "0.6066285", "0.6058613", "0.60339177", "0.60287094", "0.6028652", "0.6026627", "0.6026627", "0.6026627", "0.6026627", "0.6026627", "0.6026627", "0.6026627", "0.6026627", "0.6026627", "0.6026627", "0.60204893", "0.602047", "0.6007339", "0.59956926", "0.5977094", "0.59747094", "0.596965", "0.5960524", "0.59600407", "0.5959089", "0.5957736", "0.5950051", "0.59397274", "0.59397274", "0.593849", "0.59272385", "0.5915644", "0.5915644", "0.5915644", "0.5915644", "0.5915644", "0.5915644", "0.5911256", "0.59098965", "0.5904004", "0.5902292", "0.5899228", "0.58985287", "0.5898328", "0.58933306", "0.58908916", "0.58908916", "0.58908916", "0.58908916", "0.58808786", "0.58808553", "0.5877401", "0.587604", "0.5866801", "0.58612686", "0.58612686", "0.58612686", "0.58612686", "0.58612686", "0.58612686", "0.58612686", "0.58612686", "0.58517987", "0.585109", "0.5850992", "0.58469737", "0.58469737", "0.58469737", "0.58460325", "0.58297366", "0.58272195", "0.5823565", "0.581631", "0.5812999", "0.5805285", "0.58009547", "0.5782001", "0.5778068", "0.57673866", "0.5757651", "0.57539445", "0.5751832", "0.57512", "0.5747042" ]
0.0
-1
View on hand inventory table
function viewAll() { connection.query('SELECT * FROM products', function(err, res) { // Sets up table for our raw data already populated within MYSQL Workbench var table = new Table({ head: ['ID', 'Product Name', 'Department', 'Price', 'Stock Quantity'] }); // displays all current inventory in a fancy shmancy table thanks to cli-table package console.log(chalk.blue("CURRENT INVENTORY, HOT HOT HOT!!!")); console.log("==========================================================================================="); for (var i = 0; i < res.length; i++) { table.push([res[i].id, res[i].product_name, res[i].department_name, res[i].price.toFixed(2), res[i].stock_quantity]); } console.log("-------------------------------------------------------------------------------------------"); console.log(table.toString()); // call next function whatToBuy(); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function itemInventoryTable() { }", "function displayInventory() {\n\tconnection.query('SELECT * FROM Products', function (err, res) {\n\t\tif (err) { console.log(err) };\n\t\tvar table = new Table({\n\t\t\thead: ['item_id', 'item_name', 'department_name', 'price', 'stock_quantity'],\n\t\t\tcolWidths: [10, 30, 30, 20, 20]\n\t\t});\n\t\tfor (i = 0; i < res.length; i++) {\n\t\t\ttable.push(\n\t\t\t\t[res[i].item_id, res[i].product_name, res[i].department_name, res[i].price, res[i].stock_quantity]\n\t\t\t);\n\t\t}\n\t\tconsole.log(table.toString());\n\t\tinventoryUpdates();\n\t});\n}", "function viewLowInventory() {\n con.query(\"SELECT * from vw_LowInventory\", function (err, result) {\n if (err) {\n throw err;\n }\n else {\n var table = new Table({\n\t\t head: ['Product Id', 'Product Name', 'Department','Price', 'Quantity'],\n\t\t style: {\n\t\t\t head: ['blue'],\n\t\t\t compact: false,\n\t\t\t colAligns: ['center','left','left','right', 'right']\n\t\t }\n\t });\n\n\t //loops through each item in the mysql database and pushes that information into a new row in the table\n\t for(var i = 0; i < result.length; i++) {\n\t\t table.push(\n\t\t\t [result[i].Product_Id, result[i].Product_Name, result[i].Department, result[i].Price, result[i].Quantity]\n\t\t );\n\t }\n \n console.log(table.toString());\n runManageBamazon();\n }\n });\n}", "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}", "function viewLowInventory() {\n\tconnection.query('SELECT * FROM Products WHERE stockQuantity<5', function(err, result) {\n\t\tcreateTable(result);\n\t})\n}", "function viewProducts() {\n connection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products\", function (err, res) {\n //error occurs\n if (err) {\n throw err;\n }\n\n console.table(\"\\nInventory\", res);\n returnToMenu();\n });\n}", "function viewInventory() {\n connection.query(\"SELECT * FROM products WHERE stock_quantity < 5\",\n function (err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].product_name + \"\\n----------------------\\n\");\n }\n }\n )\n }", "function viewLowInventory(){\n // query products table and return ids of products\n // with stock lower than 5 \n connection.query('SELECT * FROM products WHERE stock_quantity<=5',function(err,results){\n if(err) throw err;\n resultsToTable(results);\n });\n\n connection.end();\n\n}", "function viewProd(item){\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products WHERE ?;\", \n \t{ item_id: item }, function(err, res){\n\t if(err) throw err;\n\t // console.log(res);\n\t\tvar aligns = [null, null, null, 'right', 'right'];\n // instantiate \n var tableInventory = new Table({\n \thead: ['Item ID', 'Product Name', 'Department', 'Price', 'Quantity']\n , colWidths: [10, 48, 18, 10, 10]\n , colAligns: aligns\n });\n\n\t// the tableInventory is an Array, so you can `push`, `unshift`, `splice` and the rest \n\ttableInventory.push(\n\t [res[0].item_id, res[0].product_name, res[0].department_name, res[0].price.toFixed(2), res[0].stock_quantity] // .toFixed(2) forces trailing zeros in prices\n\t); \n console.log(tableInventory.toString());\n\n // adding space after rendered table\n console.log(oneLine);\n // return original inquirer list for manager's choice\n startMeUp();\n });\n}", "function displayInventory() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].department_name + \" | \" + res[i].price + \" | \" + res[i].stock_quantity);\n }\n console.log(\"-----------------------------------\");\n });\n }", "function viewLowInventory() {\n connectionDB.query(\"SELECT * FROM products WHERE stock_quantity <=100\", function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n var tableFormat = new AsciiTable('INVENTORY LESS THEN 100');\n tableFormat.setHeading('ITEM ID', 'PRODUCT NAME', 'PRICE', 'QUANTITES');\n for (var index in res) {\n\n tableFormat.addRow(res[index].item_id, res[index].product_name, res[index].price, res[index].stock_quantity);\n }\n console.log(tableFormat.toString());\n connectionDB.end();\n\n\n });\n}", "function viewProducts() {\n connection.query(\"SELECT * FROM products\", function(err, results) {\n if (err) throw err;\n console.log(\"\\n\" + colors.yellow(\"---------------------PRODUCTS FOR SALE---------------------\") + \"\\n\");\n var table = new cliTable({ head: [\"ID\", \"Item\", \"Price\", \"Quantity\"] });\n for (var i = 0; i < results.length; i++) {\n table.push([results[i].id, results[i].productName, results[i].price, results[i].stockQuantity]);\n }\n console.log(table.toString() + \"\\n\");\n actionPrompt();\n });\n}", "function viewInventory() {\n var query = \"SELECT item_id, product_name, department_name, price, stock_quantity FROM products\";\n connection.query(query, function (err, res) {\n var t = new Table();\n t.push(\n [\"ID\", \" Name\", \"Price\", \"In Stock\"]\n );\n for (var i = 0; i < res.length; i++) {\n t.push(\n [res[i].item_id, res[i].product_name, \"$\" + res[i].price.toFixed(2), res[i].stock_quantity]\n );\n }\n\n console.log(\" Current Inventory\");\n console.log(\"\" + t);\n console.log(lineBreak);\n })\n}", "function showInventory() {\n var query = \"SELECT * FROM products\";\n connection.query(query, function (err, res) {\n if (err) throw err;\n var table = new Table({\n chars: {\n 'top': '═', 'top-mid': '╤', 'top-left': '╔', 'top-right': '╗'\n , 'bottom': '═', 'bottom-mid': '╧', 'bottom-left': '╚', 'bottom-right': '╝'\n , 'left': '║', 'left-mid': '╟', 'mid': '─', 'mid-mid': '┼'\n , 'right': '║', 'right-mid': '╢', 'middle': '│'\n }, head: ['ID', 'PRODUCT', 'DEPARTMENT', 'PRICE', 'IN STOCK']\n });\n for (let i = 0; i < res.length; i++) {\n table.push([res[i].item_id, res[i].product_name, res[i].department_name, res[i].price, res[i].stock_quantity]);\n }\n console.log(table.toString());\n menu();\n });\n}", "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}", "function viewInventory(){\n connection.query(\"SELECT * FROM products WHERE stock_quantity < 5\", function(err, res){\n if (err) throw err;\n for (var i = 0; i < res.length; i++){\n table.push(\n [\n res[i].item_id,\n res[i].product_name,\n res[i].department_name,\n res[i].price,\n res[i].stock_quantity\n ]);\n }\n console.log(table.toString());\n start(); \n })\n }", "function displayInventory() {\n console.log(\"\");\n console.log(\"------------------------------------------------\");\n console.log(\"Here's a look at our current inventory selection\");\n console.log(\"------------------------------------------------\");\n console.log(\"\");\n\n // Instantiate CLI table\n var table = new Table({\n head: ['Item', 'Product Name', 'Price', 'Avail.'],\n colWidths: [10, 20, 10, 10]\n });\n\n // Code below pulls back all data from the productstable\n connection.query(\"SELECT * FROM productstable\", function(err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n // Code below pushing this into the CLI table package to display the inventory\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 setTimeout(userPrompt, 1000);\n}", "function showInventory() {\n connection.query(\"SELECT * FROM products\", function (err, results) {\n if (err) throw err;\n console.table(results);\n selectItem();\n })\n}", "function viewLowInventory(){\n\tproductArray = [[\n\t\t\"Item ID:\".yellow, \n\t\t\"Product:\".cyan, \n\t\t\"Department:\".cyan, \n\t\t\"Price:\".cyan, \n\t\t\"Quantity:\".cyan\n\t]];\n\tconnection.query(\"SELECT * FROM products\", function(err, results){\n\t\tif(err) throw err;\n\t\tclearScreen();\n\t\tfor(var i = 0; i < results.length; i++){\n\t\t\tif(results[i].stockQuantity <= 5){\n\t\t\t\tvar tempArray = [];\n\t\t\t\ttempArray.push(results[i].itemId);\n\t\t\t\ttempArray.push(results[i].productName);\n\t\t\t\ttempArray.push(results[i].departmentName);\n\t\t\t\ttempArray.push(results[i].price);\n\t\t\t\ttempArray.push(results[i].stockQuantity);\n\t\t\t\tproductArray.push(tempArray); \n\t\t\t}\n\t\t}\n//CALL Function that formats the table and then displays it on the screen\n\t\tclearScreen();\n\t\tconsole.log(\"Viewing\".cyan + \" Low\".yellow + \" Inventory Items \\(qty <= 5\\)\".cyan);\n\t\tdisplayTable();\n\t\tstart();\n\t});\n}", "function viewLowInventory() {\n clearConsole();\n connection.query(\"SELECT * FROM products WHERE stock_quantity < 5\", function (err, response) {\n if (err) throw err;\n displayInventory(response);\n userOptions();\n })\n}", "function showInventory(job) {\n console.log(\"Your answer was \" + job);\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n console.log(\"\\n\");\n console.log(\" CURRENT INVENTORY \".bgRed.white);\n console.log(\"\\n\");\n console.log(\"\\n\");\n// build our table using table NPM\n var table = new Table({\n head: ['Item ID', 'Product', 'Price', 'Quantity']\n , colWidths: [20, 21, 25, 17]\n });\n for (var i = 0; i < res.length; i++) {\n 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 console.log(\"\\n\");\n continueManaging();\n });\n \n}", "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}", "function viewProducts() {\n connection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products\", function (err, res) {\n if (err) throw err;\n console.log(\"\");\n console.table(res);\n connection.end();\n });\n}", "function viewLowInven(cb) {\n connection.query('SELECT * FROM products WHERE StockQuantity < 5',\n function(err, res) {\n if (err) throw err;\n //if there are no items in stock quantity alert the user and rerun\n if (res.length === 0) {\n console.log(\"There are currently no items with low inventory!\");\n cb();\n\n }else {\n //This creates the CLI table\n var table = new Table({\n head: ['ID', 'Product Name', 'Department', 'Price', 'StockQuantity']\n });\n for (var i = 0; i < res.length; i++) {\n table.push([res[i].id, res[i].ProductName, res[i].DepartmentName, res[i].Price, res[i].StockQuantity]);\n\n }\n }console.log(table.toString());\n console.log('These are all items that are low on inventory.');\n cb();\n }\n})\n\n}", "function displayInventory() {\n //retrieving all fields\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) {\n throw err;\n console.log(\"Unable to connect to Inventory Management System.\\n\".red);\n } \n console.log(\"\\nCurrent Inventory:\\n\".bold.cyan);\n //reset table so it is refreshed each time function is called\n tto.reset();\n //using terminal-table-output package for formatting, first line is header\n tto.pushrow([\"item_id\", \"product_name\", \"department_name\", \"price\", \"stock_quantity\"]).line();\n for(i = 0; i < res.length; i++) {\n //passing in table data retrieved with query, row by row\n tto.pushrow([res[i].item_id,res[i].product_name,res[i].department_name,res[i].price,res[i].stock_quantity]);\n //once final row has been read in, print to console\n if(i === res.length - 1) {\n tto.print(true);\n }\n }\n //calling manager menu function\n managerMenu();\n });\n \n}", "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}", "function viewLowInventory() {\n connection.query(\"SELECT * FROM products WHERE stock_quantity < 5\", function(\n err,\n rows\n ) {\n if (err) throw err;\n if (rows.length === 0) {\n console.log(\"There are no products with stock lower than five units.\");\n } else {\n console.log(\"\");\n console.table(rows);\n console.log(\"=====================================================\");\n }\n menu();\n });\n}", "function viewLowInventory() {\n var query = \"SELECT item_id, product_name, price, stock_quantity FROM products WHERE stock_quantity < 5\";\n connection.query(query, function (err, res) {\n //error occurs\n if (err) {\n throw err;\n }\n\n console.table(\"\\nLow Inventory\", res);\n returnToMenu();\n });\n}", "function lowInv() {\n // console.log(\"view low inventory....\")\n connection.query(\"SELECT * FROM products WHERE stock_quantity < 5 \", (err, data) => {\n if (err) throw err;\n console.table(data);\n })\n}", "function viewProduct() {\n var query =\n 'SELECT item_id, product_name, price, stock_quantity FROM products WHERE stock_quantity > 0';\n connection.query(query, function(err, res) {\n console.table(res);\n reset();\n });\n}", "function showInventory() {\n inquirer\n .prompt([\n {\n type: \"confirm\",\n message: \"\\nVIEW INVENTORY\",\n name: \"confirm\",\n default: true\n }\n ])\n .then(function (inquirerResponse) {\n if (inquirerResponse.confirm) {\n connection.query(\"SELECT item_id, product_name, price FROM products\", function (err, res) {\n if (err) throw err;\n\n console.log(\"\\n \\n PRODUCTS LIST: \");\n console.log(\"---------------------------\\n\")\n\n var table = new Table({\n head: ['ID#', 'PRODUCT', 'PRICE']\n , colWidths: [10, 30, 20]\n });\n for (var i = 0; i < res.length; i++) {\n table.push(\n [res[i].item_id, res[i].product_name,\n res[i].price]\n );\n\n }\n placeOrder();\n console.log(table.toString());\n });\n }\n else {\n console.log(\"\\nThat's okay, maybe next time.\\n\");\n }\n });\n\n}", "function showLowInventory() {\n connection.query(\"SELECT * FROM products WHERE stock_quantity < 5 ORDER BY 5\", function (err, res) {\n if (err) throw err;\n console.log(\"\\nShowing Low Inventory:\\n\")\n var table = new Table({\n head: ['ID'.cyan, 'Product Name'.cyan, 'Department'.cyan, 'Price'.cyan, 'Stock'.magenta]\n , colWidths: [5, 25, 15, 10, 7]\n });\n res.forEach(row => {\n table.push(\n [row.item_id, row.product_name, row.department_name, \"$\" + row.price, row.stock_quantity],\n );\n });\n console.log(table.toString());\n console.log(\"\\n~~~~~~~~~~~~~~~~~\\n\\n\");\n start();\n });\n}", "function viewProducts() {\n connectionDB.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n //console.log(res);\n var tableFormat = new AsciiTable('PRODUCT LIST');\n tableFormat.setHeading('ITEM ID', 'PRODUCT NAME', 'PRICE', 'QUANTITES');\n for (var index in res) {\n\n tableFormat.addRow(res[index].item_id, res[index].product_name, res[index].price, res[index].stock_quantity);\n }\n console.log(tableFormat.toString());\n\n\n });\n}", "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}", "function viewLowInventory(){\n var query = connection.query(\"SELECT ID, Product_Name , Price, Stock_QTY FROM products WHERE Stock_Qty < 20;\", function(err, res) {\n console.log(\"\");\n console.table(res);\n console.log(\"\");\n managerAsk();\n });\n }", "function viewLowInventory(){\n\n\t// Query: Read products with stock_quantity < 5\n\tconnection.query(\"SELECT * FROM products WHERE stock_quantity < 5\", function(viewLowErr, viewLowRes){\n\t\tif (viewLowErr) throw viewLowErr;\n\n\t\tfor (var j = 0; j < viewLowRes.length; j++){\n\t\t\tconsole.log(\"Id: \" + viewLowRes[j].item_id + \" | Name: \" + viewLowRes[j].product_name +\n\t\t\t\t\t\t\" | Price: \" + viewLowRes[j].price + \" | Quantity: \" + viewLowRes[j].stock_quantity);\n\t\t\tconsole.log(\"-------------------------------------------------------------------\");\n\t\t}\n\n\t\t// Prompts user to return to Main Menu or end application\n\t\trestartMenu();\n\t});\n}", "function displayInventory(response) {\n tableValues = [];\n for (var i = 0; i < response.length; i++) {\n tableValues.push(\n {\n ID: response[i].item_id,\n Name: response[i].product_name,\n Price: \"$\" + response[i].price.toFixed(2),\n Quantity: response[i].stock_quantity\n }\n )\n }\n console.table(tableValues);\n}", "function lowInventory() {\n connection.query('SELECT * FROM products WHERE stock_quantity <= 5', function (err, allProducts) {\n if (err) throw err;\n\n var table = new Table({\n head: ['item_id', 'product_name', 'stock_quantity'],\n colWidths: [10, 25, 18]\n });\n\n for (var i = 0; i < allProducts.length; i++) {\n table.push([allProducts[i].item_id, allProducts[i].product_name, allProducts[i].stock_quantity]);\n }\n\n console.log(table.toString());\n console.log(`Found ${allProducts.length} items low in stock!`);\n console.log('\\n');\n managerView();\n });\n}", "function lowInventory() {\n connection.query(\n \"SELECT * FROM products WHERE stock_quantity < 10\", function(err,res) {\n if (err) throw err;\n //Use cli-table\n let table = new Table ({\n //Create Headers\n head: ['ID','PRODUCT','DEPARTMENT','PRICE','STOCK'],\n colWidths: [7, 50, 25, 15, 10]\n });\n for (let i = 0; i < res.length; i++) {\n table.push([res[i].item_id,res[i].product_name,res[i].department_name,\"$ \" + res[i].price,res[i].stock_quantity]);\n }\n console.log(table.toString() + \"\\n\");\n managerChoices();\n }\n )\n}", "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}", "function viewLow() {\n //look in database for items less or equal to 5 and display them\n connection.query(\"SELECT * FROM products WHERE stock_quantity<=?\", [5], function (err, res) {\n if (err) throw err;\n\n var table = new Table({\n head: [\"ID\", \"PRODUCT NAME\", \"DEPARTMENT NAME\", \"PRICE\", \"STOCK\"]\n , colWidths: [5, 30, 20, 10, 10]\n });\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, res[i].stock_quantity]);\n }\n console.log(table.toString());\n listChoices();\n })\n}", "function inventory() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n displayForManager(res);\n purchasePrompt();\n });\n}", "function viewAllProducts() {\n connection.query('SELECT * FROM products', function(error, res) {\n if (error) throw error;\n var table = new Table({\n head: ['item_Id', 'Product Name', 'Price Per', 'Stock Qty']\n });\n\n for (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 connection.end();\n });\n}", "function dispLowInv() {\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 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 WHERE stock_quantity < ? ORDER BY department_name, product_name;\", [5], function (err, rows, fields) {\n\n if (err) throw err;\n\n // if rows were returned for the query, load the table with them\n if (rows.length > 0) {\n\n console.log(\"\\n--- View All Products Low on Inventory ---\");\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 // otherwise log a message that no products currently meet the low inventory definition\n } else {\n\n console.log(\"\\n--- No Products Are Currently Low on Inventory ---\");\n\n }\n\n // ask the user if they want to continue\n doAnother();\n\n });\n\n}", "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}", "function viewLowInventory() {\n\n var query = \"SELECT * FROM products\";\n connection.query(query, function(err, res) {\n if (err) throw err;\n console.log(\"All items that need to be restocked:\\n\");\n console.log(\"\\n-----------------------------------------\\n\");\n for (var i = 0; i < res.length; i++) {\n if (res[i].stock_quantity <= 5) {\n console.log(\"Id: \".bold + res[i].item_id + \" | Product: \".bold + res[i].product_name + \" | Department: \".bold + res[i].department_name + \" | Price: \".bold + \"$\".green.bold +res[i].price + \" | QOH: \".bold + res[i].stock_quantity);\n }\n }\n console.log(\"\\n-----------------------------------------\\n\");\n });\n\n\n}", "function displayInventory() {\n var query = \"SELECT * FROM products\";\n connection.query(query, function(err, inv) {\n console.log(\"========================\\n\"); \n console.log(\"Current available products for sale:\\n\");\n var table = new Table({\n head: [\"ITEM_ID\", \"PRODUCT NAME\", \"DEPARTMENT NAME\", \"PRICE\", \"STOCK \\nQTY\"],\n colWidths: [10, 40, 20, 9, 8]\n }); \n for (var i=0; i < inv.length; i++) {\n var productArray = [inv[i].item_id, inv[i].product_name, inv[i].department_name, inv[i].price, inv[i].stock_quantity];\n table.push(productArray);\n }\n console.log(table.toString());\n managerOptions();\n })\n}", "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}", "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}", "function displayStock() {\n\n //table creation using cli-table package\n var table = new Table({\n head: ['ID', 'PRODUCT', 'PRICE', 'IN STOCK'],\n colWidths: [6, 32, 14, 14],\n style: {'padding-left': 2, 'padding-right': 2}\n });\n for (var i = 0; i < stock.length; i++) {\n var item = stock[i];\n\n //if item is in stock, push to the table\n if (stock[i].StockQuantity > 0) {\n table.push([item.ItemID, item.ProductName, \"$\" + item.Price, item.StockQuantity]);\n }\n }\n clear();\n console.log(\"----------------------------------------------------------------------\");\n console.log(\" WELCOME TO BAMAZON CUSTOMER VIEW \");\n console.log(\" \");\n console.log(\" HERE IS WHAT WE HAVE IN STOCK \");\n console.log(\"----------------------------------------------------------------------\");\n //displays the table\n console.log(table.toString());\n}", "function displayInventory(){\n var query = \"SELECT productID, product_name, price FROM products\";\n connection.query(query, (err, result) => {\n if(err) throw err;\n for(var i = 0; i < result.length; i++){\n console.log(`ID: ${result[i].productID} || Product: ${result[i].product_name} || Price: ${result[i].price} `)\n }\n })\n}", "function displayInventoryTable(res) {\r\n\r\n const table = new Table({\r\n head: ['Product #', 'Department', 'Product', 'Price', 'Qty In Stock'],\r\n colWidths: [15, 20, 30, 15, 15]\r\n });\r\n\r\n for (let i = 0;\r\n (i < res.length); i++) {\r\n var row = [];\r\n row.push(res[i].item_id);\r\n row.push(res[i].department_name);\r\n row.push(res[i].product_name);\r\n row.push(res[i].price);\r\n row.push(res[i].stock_quantity);\r\n table.push(row);\r\n }\r\n\r\n console.log(table.toString());\r\n}", "function lowInv() {\n var query = \"SELECT * FROM products WHERE stock_quantity < 5\"\n connection.query(query, function(err, res) {\n if (err) throw err;\n let table = new Table({\n head: ['Product ID', 'Product Name', 'Price', 'Stock', 'Department'],\n color: [\"blue\"],\n colAligns: [\"center\"]\n })\n console.log(\"Here is a list of low inventory products\\n\")\n res.forEach(function(row) {\n let newRow = [row.item_id, row.product_name, \"$\" + row.price, row.stock_quantity, row.department_name]\n table.push(newRow)\n })\n console.log(\"\\n\" + table.toString())\n menu();\n })\n}", "function viewLowInventory(){\n\tvar query = \"SELECT * FROM products WHERE stock_quantity <= 5\";\n\tconnection.query(query, function(err, res){\n\t\tif (err) throw err;\n\t\tconsole.log(\"INVENTORY RUNNING LOW!!!!\");\n\t\tfor(i=0; i< res.length; i++){\n\t\t\tconsole.log(\"---|| ID \"+ res[i].item_id+\" ---|| NAME: \"+ res[i].product_name+\" ---|| QUANTITY \" + res[i].stock_quantity);\n\t\t};\n\t\taskAction();\n\t})\n\n}", "function viewLowInv() {\n connection.query(\"SELECT * FROM products WHERE stock_quantity <= 30\", function (err, results) {\n if (err) throw err;\n for (let i = 0; i < results.length; i++) {\n console.log(\"Item \" + results[i].item_id + \"| Product Name: \" + results[i].product_name + \"| Price: \" + results[i].price + \"| In Stock: \" + results[i].stock_quantity);\n }\n\n });\n connection.end();\n}", "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}", "function viewProducts(){\n var query = connection.query(\"SELECT ID, Product_Name , Price, Stock_QTY FROM products;\", function(err, res) {\n console.log(\"\");\n console.table(res);\n console.log(\"\");\n \n managerAsk();\n });\n }", "function listInventory() {\n //Variable creation from DB connection\n connection.query(\"SELECT * FROM products\", function (err, results) {\n for (var i = 0; i < results.length; i++) {\n\n var itemId = results[i].item_id,\n productName = results[i].product_name,\n price = results[i].price,\n stockQuantity = results[i].stock_quantity;\n\n table.push(\n [itemId, productName, price, stockQuantity]\n );\n }\n console.log(\"\");\n console.log(chalk.blue(\"==================================== \") + chalk.yellowBright(\"CURRENT BAMAZON PRODUCT INVENTORIES\") + chalk.blue(\" =========================================\"));\n console.log(\"\");\n console.log(chalk.greenBright(table.toString()));\n console.log(\"\");\n console.log(\"\");\n console.log(\"\");\n newTransaction();\n // connection.end();\n });\n }", "function lowInventory() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if(err) throw err;\n var table = new Table({\n head: ['Item ID', 'Product', 'Price', 'Quantity']\n , colWidths: [20, 21, 25, 17]\n });\n for (var i = 0; i < res.length; i++) {\n if (res[i].stock_quantity < 5) {\n table.push(\n [res[i].item_id, res[i].product_name, res[i].price, res[i].stock_quantity]\n );\n }\n\n }\n console.log(table.toString());\n console.log(\"\\n\");\n continueManaging();\n })\n \n}", "function lowinventory() {\n console.log(\"Low inventory items: \");\n var tableLow = new Table({\n head: ['Item ID', 'Product Name', 'Quantity']\n });\n connection.query(\"SELECT item_id, product_name, stock_quantity FROM products WHERE stock_quantity <= 5\", function (err, res) {\n for (let j = 0; j < res.length; j++) {\n tableLow.push(\n [res[j].item_id, res[j].product_name, res[j].stock_quantity]\n );\n }\n console.log(tableLow.toString());\n console.log('\\n*******************');\n managerOptions();\n })\n}", "function inventoryMenu() {\n $scope.menuTitle = createText(\"Inventory\", [20, 10]);\n\n var datas = CharServ.getAllDatas();\n\n var i = 30;\n _.forIn(datas.inventory, function(value) {\n if (value.quantity > 0) {\n createItem(value, i);\n i += 30;\n }\n });\n }", "function viewProducts(){\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n displayTable(res);\n promptManager();\n });\n}", "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}", "function lowInventory(con) {\n\tvar queryString = \"SELECT * FROM products\";\n\n\tcon.query(queryString, function(error, rows, fields) {\n\t\tif(error) throw error;\n\t\tvar table = new Table({ head: ['Item ID', 'Product Name', 'Department Name', 'Price', 'Stock'], \n\t colWidths: [10, 25, 20, 10, 10]\n\t\t});\n\n\t\tvar ids = [];\n\t\tvar quantities = [];\n\t\tfor(var i in rows) {\n\t\t\tif(rows[i].stock_quantity < 5) {\n\t\t\t\ttable.push([rows[i].item_id, rows[i].product_name, rows[i].department_name, rows[i].price, rows[i].stock_quantity]);\n\t\t\t}\n\t\t}\n\t\tconsole.log(\"\\n\\n\")\n\t\tconsole.log(table.toString());\n\t\tconsole.log(\"\\n\\n\")\n\t});\n}", "function lowInventory (err, results) {\n if (err) {\n console.log(err)\n }\n console.table(results)\n mainMenu()\n}", "function viewLowInvetory(){\n //create a query to select products with stock qty < 5\n var lowprods = connection.query(\n 'select item_id, product_name, department_id, price, stock_qty, product_sales from products where stock_qty < 5', \n function(err, res){\n if(err){\n throw err;\n }\n else{\n console.log('\\n');\n console.table(res);\n managerMenu();\n }\n });\n}", "function lowInventory() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n // Create new table\n var table = new Table({\n head: [\"Product ID\".headder, \"Product Name\".headder, \"Product Price\".headder, \"Units in Stock\".headder],\n colWidths: [12, 25, 15, 20]\n });\n for(var i = 0; i < res.length; i++) {\n if(res[i].stock_quantity < 5) {\n // Pushing all info from the DB into the new table\n table.push(\n [res[i].product_id, res[i].product_name, \"$\" + res[i].price, res[i].stock_quantity]\n );\n }\n }\n // Displaying the table to the user\n console.log(table.toString());\n // Ending connection\n connection.end();\n });\n}", "function getInventory() {\n connection.query(\"SELECT * FROM products\", function(err, inventoryRes) {\n if (err) {\n console.log(\"ERROR: \", err);\n }\n\n console.log(\"CURRENT INVENTORY: \");\n printTable(inventoryRes);\n console.log(\"\");\n\n purchase();\n });\n}", "function showProducts() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n var table = new cliTable({\n head: [\"Item Number\", \"Product Name\", \"Department\", \"Price\", \"Stock\"],\n colWidths: [13, 35, 30, 13, 13],\n });\n\n for (var i = 0; i < res.length; i++) {\n table.push(\n [\n res[i].item_id,\n res[i].product_name,\n res[i].department_name,\n \"$ \" + res[i].price,\n res[i].stock_quantity\n ]\n );\n };\n\n console.log(table.toString());\n\n buy();\n\n\n });\n}", "function inventory() { }", "function lowInventoryList() {\n connection.query(\"SELECT item_id, product_name, stock_quantity FROM products WHERE stock_quantity < 5\", function(error, res) {\n if (error) throw error;\n var table = new Table({\n head: ['item_Id', 'Product Name', 'Stock Qty']\n });\n for (i = 0; i < res.length; i++) {\n table.push(\n [res[i].item_id, res[i].product_name, res[i].stock_quantity]\n );\n }\n console.log(table.toString());\n connection.end();\n });\n}", "function tableView() {\n\tconnection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products\", function(err, results) {\n if (err) throw err;\n\n// table \n\tvar table = new Table({\n \thead: ['ID#', 'Item Name', 'Department', 'Price($)', 'Quantity Available'],\n \t colWidths: [10, 20, 20, 20, 20],\n \t style: {\n\t\t\t head: ['cyan'],\n\t\t\t compact: false,\n\t\t\t colAligns: ['center'],\n\t\t }\n\t});\n//Loop through the data\n\tfor(var i = 0; i < results.length; i++){\n\t\ttable.push(\n\t\t\t[results[i].item_id, results[i].product_name, results[i].department_name, results[i].price, results[i].stock_quantity]\n\t\t);\n\t}\n\tconsole.log(table.toString());\n\n });\n}", "function viewProds(){\n\t// adding space before rendered table\n console.log(oneLine);\n\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products;\", function(err, res){\n if(err) throw err;\n // console.log(res);\n\tvar aligns = [null, null, null, 'right', 'right'];\n // instantiate \n var tableInventory = new Table({\n \thead: ['Item ID', 'Product Name', 'Department', 'Price', 'Quantity']\n , colWidths: [10, 48, 18, 10, 10]\n , colAligns: aligns\n });\n\n // loop through products in store\n for(i=0; i<res.length; i++){\n // the tableInventory is an Array, so you can `push`, `unshift`, `splice` and the rest \n tableInventory.push(\n [res[i].item_id, res[i].product_name, res[i].department_name, res[i].price.toFixed(2), res[i].stock_quantity] // .toFixed(2) forces trailing zeros in prices\n ); \n };\n // giving the table a caption\n \tconsole.log(\"Current Products for Sale\");\n\n console.log(tableInventory.toString());\n\n // adding space AFTER rendered table\n \tconsole.log(oneLine);\n \tconsole.log(\"Use Up or Down Arrow Keys to Continue ...\")\n \tconsole.log(oneLine);\n \tgiveMeSpace();\n });\n}", "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}", "function inventory() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n //organizes the collumns i wish to display for each item\n for (var i = 0; i < res.length; i++) {\n console.log(`ID: ${res[i].id} || Name: ${res[i].product_name} || Department: ${res[i].department_name} || Price: $${res[i].price}`)\n }\n shopping();\n })\n}", "function 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}", "function viewProducts () {\n con.query(\"SELECT * from vw_ProductsForSale\", function (err, result) {\n if (err) {\n throw err;\n }\n else {\n var table = new Table({\n\t\t head: ['Product Id', 'Product Name', 'Department','Price','Quantity'],\n\t\t style: {\n\t\t\t head: ['blue'],\n\t\t\t compact: false,\n\t\t\t colAligns: ['center','left','left','right','right']\n\t\t }\n\t });\n\n\t //loops through each item in the mysql database and pushes that information into a new row in the table\n\t for(var i = 0; i < result.length; i++) {\n\t\t table.push(\n\t\t\t [result[i].Product_Id, result[i].Product_Name, result[i].Department, result[i].Price, result[i].Quantity]\n\t\t );\n\t }\n \n console.log(table.toString());\n runManageBamazon();\n }\n });\n }", "function displayStock() {\n\n connection.query(\"SELECT * FROM products\", function (err, res) {\n table(res);\n });\n}", "function viewProducts() {\n var queryString = 'SELECT * FROM products';\n con.query(queryString, function(err, rows) {\n if (err) throw err;\n var data = rows;\n var t = new table\n data.forEach(function(product) {\n t.cell('Product ID', product.item_id);\n t.cell('Product Name', product.product_name);\n t.cell('Product Price', product.price);\n t.cell('Product Stock', product.stock_quantity);\n t.newRow()\n });\n console.log(t.toString());\n });\n}", "function listlowInventory() {\n //Variable creation from DB connection\n connection.query(\"SELECT * FROM products WHERE stock_quantity <= 3\", function (err, results) {\n for (var i = 0; i < results.length; i++) {\n\n var itemId = results[i].item_id,\n productName = results[i].product_name,\n stockQuantity = results[i].stock_quantity;\n\n table.push(\n [itemId, productName, stockQuantity]\n );\n }\n console.log(\"\");\n console.log(chalk.blue(\"============================ \") + chalk.yellowBright(\"BAMAZON LOW PRODUCT INVENTORIES\") + chalk.blue(\" =================================\"));\n console.log(\"\");\n console.log(chalk.greenBright(table.toString()));\n console.log(\"\");\n console.log(\"\");\n console.log(\"\");\n newTransaction();\n // connection.end();\n });\n }", "function lowInventory() {\n var query = \"SELECT * FROM products WHERE Stock_Quantity < 6;\"\n connection.query(query, function(err, res){\n \n var productTable = new Table\n \n res.forEach(function(product) {\n productTable.cell(\"Item ID\", product.Item_ID)\n productTable.cell(\"Product\", product.Product_Name)\n productTable.cell(\"Department\", product.Department_Name)\n productTable.cell(\"Price($)\", product.Price, Table.number(2))\n productTable.cell(\"Quantity Left\", product.Stock_Quantity, Table.number(0))\n productTable.newRow()\n })\n \n console.log(\"\\nITEMS FOR SALE: \\n\\n\" + productTable.toString());\n \n });\n}", "function viewLowInventory() {\n connection.query(\"SELECT * FROM products\", function(error, results) {\n if (error) throw error;\n console.log(\"LOW INVENTORY:\");\n for (var i = 0; i < results.length; i++) {\n if (results[i].stock_quantity < 5) {\n console.log(results[i].id + ' | ' + results[i].product_name + ' | ' + '$'+results[i].price + ' | ' + results[i].stock_quantity);\n }\n }\n });\n connection.end();\n}", "function tableDisplay() {\n connection.query(\n \"SELECT * FROM products\", function(err,res) {\n if (err) throw err;\n //Use cli-table\n let table = new Table ({\n //Create Headers\n head: ['ID','PRODUCT','DEPARTMENT','PRICE','STOCK'],\n colWidths: [7, 50, 25, 15, 10]\n });\n for (let i = 0; i < res.length; i++) {\n table.push([res[i].item_id,res[i].product_name,res[i].department_name,\"$ \" + res[i].price,res[i].stock_quantity]);\n }\n console.log(table.toString() + \"\\n\");\n managerChoices();\n }\n )\n}", "function viewSale() {\n // console.log(\"view product....\")\n\n connection.query(\"SELECT * FROM products\", (err, data) => {\n if (err) throw err;\n console.table(data);\n connection.end();\n })\n}", "function viewLowInventory() {\n connection.query(\"SELECT * FROM products WHERE stock_quantity < 5\", function (err, res) {\n if (err) throw err;\n let items = '';\n for (var i = 0; i < res.length; i++) {\n items = '';\n items += 'Product Name: ' + res[i].product_name + ' // ';\n items += 'Quantity: ' + res[i].stock_quantity + '\\n';\n console.log(items.toUpperCase());\n\n }\n return setTimeout(function () {\n managerPortal()\n }, 4000);\n })\n}", "recordInventory(){\r\n this._listProduct();\r\n }", "function viewLowInventory() {\n connection.query('SELECT * FROM products WHERE stock_quantity < 5', function(err,results) {\n if (results == '') {\n console.log('\\n There are no products with lower than 5 in the Inventory');\n promptManager();\n } else {\n // console.log(results)\n console.log('\\n All products with quantity lower than 5 shown in Inventory Table\\n');\n displayForManager(results);\n promptManager();\n } \n })\n}", "function viewSaleProduct() {\n connection.query(\"SELECT * FROM store\", function (err, results) {\n if (err) throw err;\n console.table(results);\n })\n}", "function viewProducts(){\n connection.query(\"SELECT * FROM products\", function(err, response){\n if(err) throw err;\n printTable(response);\n })\n}", "function viewProducts() {\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products\", function (err, res) {\n console.log(\"Products for sale\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"======================\");\n console.log(\"Id: \" + res[i].item_id + \" || Department: \" + res[i].department_name + \" || Product: \" + res[i].product_name + \" || Price($): \" + parseFloat(res[i].price).toFixed(2) + \" || In stock: \" + res[i].stock_quantity);\n }\n });\n displayChoices();\n}", "function 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}", "function showProducts() {\n connection.query(\"SELECT * FROM `products`\", function(err, res) {\n var table = new Table({\n head: [\"ID\", \"Product\", \"Department\", \"Price\", \"Stock\"],\n colWidths: [4, 18, 17, 10, 7]\n });\n\n for (var i = 0; i < res.length; i++) {\n table.push([\n res[i].item_id,\n res[i].product_name,\n res[i].department_name,\n res[i].price,\n res[i].stock_quantity\n ]);\n }\n console.log(\"\\n\" + table.toString() + \"\\n\");\n });\n}", "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}", "function lowInventory() {\n var query = \"SELECT * FROM products WHERE stock_quantity < 5\";\n\n connection.query(query, (err, results) => {\n console.log(\"--------------------------------\\n\");\n if (err) throw err;\n\n var table = new Table({\n head: [\"Product Name\", \"Quantity\"],\n colWidths: [25, 10],\n colAligns: [\"left\", \"right\"]\n });\n\n // Displaying all the products in the table\n results.forEach(element => table.push([element.product_name, element.stock_quantity]));\n\n console.log(table.toString());\n console.log(\"--------------------------------\\n\");\n start();\n });\n}", "function viewLowInventory() {\n connection.query(\"SELECT item_id, product_name, price, department_name, stock_quantity FROM products\", function (err, res) {\n if (err) throw err;\n\n console.log(\"Following items are low in stock:\")\n var lowInventoryFound = false;\n for (var i = 0; i < res.length; i++) {\n if (parseInt(res[i].stock_quantity) < 5) {\n lowInventoryFound = true;\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 if (!lowInventoryFound) {\n console.log(\"You do not have any items on low inventory\");\n }\n });\n displayChoices();\n}", "function listinventory() {\n\n //Variables from my DataBase\n \n connection.query(\"SELECT * FROM products\", function(err,res) {\n for (var i = 0; i < res.lenght; i++) {\n\n var itemId = res[i].item_id,\n productName = res[i].product_name,\n departmentName = res[i].department_name,\n price = res[i].price,\n stockQuantity = res[i].stock_quantity;\n\n table.push(\n [itemId, productName, departmentName, price, stockQuantity]\n );\n }\n console.log(\"\");\n console.log(\"============================ Zohars Bamazon inventory =================\");\n console.log(\"\");\n console.log(table.toString());\n console.log(\"\");\n continuePrompt();\n });\n\n \n }", "function viewLowInventory() {\n\n // console.log(\"Inside viewLowInventory()\");\n\n let queryString = \"SELECT * FROM products WHERE stock_quantity < 5\";\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---- Low Inventory Products ---- \\n\");\n\n console.log(\"\\t\" + \"ITEM ID\" + \"\\t\\t|\\t\" + \"ITEM NAME\" + \"\\t\\t|\\t\" + \"QUANTITY\");\n console.log(\"\\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.stock_quantity)\n );\n\n //Call manager view\n console.log(\"\\n\\n\");\n bamazonManagerView();\n\n });\n}", "function lowInventory() {\n connection.query(\n 'SELECT * FROM products WHERE stock_quantity < 10', (err, results) => {\n if (err) { console.log(err); }\n displayTable(results);\n managerAction();\n }\n )\n}", "function lowInventory(){\n connection.query(\"SELECT * FROM products WHERE stock_quantity < 5\", function(err, res) {\n if (err) throw err;\n displayTable(res);\n promptManager();\n });\n}", "function showItems(displaytable){\n let table=new Table({\n head:[\"id\",\"product\",\"department\",\"price\",\"quantity\"]\n });\n connection.query(\"SELECT * FROM Products\",function(err,res){\n if(err) throw err;\n for (let i=0;i<res.length; i++){\n table.push([res[i].id,res[i].product,res[i].department,res[i].price,res[i].quantity]);\n }\n console.log(table.toString());\n displaytable();\n });\n}" ]
[ "0.7741324", "0.77149165", "0.75064796", "0.74855506", "0.72279596", "0.72108257", "0.71113974", "0.7097282", "0.70656294", "0.70075804", "0.69856364", "0.6980996", "0.6943741", "0.6929568", "0.6878967", "0.6870501", "0.68538916", "0.68464184", "0.6820746", "0.6780449", "0.67730916", "0.67723775", "0.6755662", "0.67364645", "0.67341924", "0.67286676", "0.6727406", "0.672644", "0.6718701", "0.67145157", "0.67085135", "0.66992176", "0.669338", "0.6685859", "0.6682669", "0.66786253", "0.66585", "0.66584486", "0.66468304", "0.66419756", "0.6609991", "0.66024595", "0.6594546", "0.65826494", "0.6579872", "0.65711963", "0.6558064", "0.6556052", "0.6547173", "0.6543832", "0.64966536", "0.64939296", "0.6491711", "0.6489357", "0.64605874", "0.6460484", "0.64591974", "0.645688", "0.6446097", "0.64394546", "0.6436922", "0.64349", "0.6423142", "0.6414615", "0.6413423", "0.64110047", "0.6404991", "0.63948065", "0.63940185", "0.6392711", "0.6390448", "0.6377479", "0.636971", "0.63342524", "0.6326433", "0.63248736", "0.6323674", "0.63184094", "0.6317454", "0.6315599", "0.63110507", "0.6309659", "0.6309534", "0.63093317", "0.6307506", "0.62892646", "0.62819445", "0.6280421", "0.62776756", "0.627332", "0.627105", "0.62708586", "0.626624", "0.6255688", "0.62378395", "0.622959", "0.62253517", "0.62133676", "0.62087667", "0.61934745" ]
0.68632287
16
Shopping function begins here! Custom message to request user to enter an item ID
function whatToBuy() { inquirer.prompt([ { type: "input", name: "itemID", message: "Enter the Item ID of the item would you like to purchase", validate: function (input) { if (isNaN(input)) { return "Enter the product number"; } else { return true; } } } ]).then(function (user) { itemToBuy = user.itemID; // after user input is entered, call checkIfItem function checkIfItem(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function checkIfItem() {\n // query bamazon DB for the entered item\n connection.query(\"SELECT id FROM products WHERE id=?\", [itemToBuy], function (err, res) {\n if (err) throw err;\n // if itemToBuy exists in the databse, call howManyToBuy function\n else if (res[0].id == itemToBuy) {\n // call update Quantity function\n howManyToBuy();\n }\n // if item does not exist in database, ask user to enter valid ID and go back to product list\n else {\n console.log(chalk.bgRed.yellow(\"Please enter a valid item ID!\"));\n console.log('\\n*******************');\n }\n });\n}", "function addItemToCart() {}", "function addItemToCart() {}", "function purchaseItem(){\n inquirer.prompt([\n {\n name: \"id\",\n type: \"input\",\n message: \"Please enter item ID of item you would like to purchase.\",\n filter: Number\n },\n {\n name: \"Quantity\",\n type: \"input\",\n message: \"How many would you like to purchase?\",\n filter: Number\n },\n ]).then(function(response){\n var quantity = response.Quantity;\n var itemId = response.id;\n orderItem(itemId, quantity);\n });\n}", "function purchaseItem() {\n\tinquirer.prompt([{\n\t\tname: \"puchaseItemID\",\n\t\ttype: \"input\",\n\t\tmessage: \"What is the ID Number of the item you'd like to purchase?\",\n\t\tvalidate: function(value) {\n\t\t\tif (value >= 1 && value <= 12) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}, \n\n\t{\n\t\tname: \"purchaseQty\",\n\t\ttype: \"input\",\n\t\tmessage: \"How many of this item would you like to purchase?\",\n\t\tvalidate: function(value) {\n\t\t\tif (value) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\t\t\n\t}]).then(function(response) {\n\t\t// connection.query(\"SELECT * FROM products\", function(err, res) {\n\t\t\t// console.log(res);\n\t\t// });\n\t\torderItem(response);\n\t});\n}", "static sellItem(data = null, itemID) {\n if (data !== null) {\n if (!data.error) {\n swal('Success!', 'Sucessfully sold your Item!', 'success')\n equipment.reload();\n } else {\n swal('Error!', data.error_msg, 'error');\n equipment.reload();\n }\n } else {\n $(\".loading-screen\").show();\n let params = {\n 'ITEM_ID': itemID,\n };\n equipment.sendRequest('sellItem', 'sell_item', params);\n }\n }", "function addItemToCart(user, item) {}", "buyItem(item) {\n console.log(\"Buying Item:\", item.name);\n }", "function addItemToCart(user, item) {\n\n}", "async purchaseItem(itemId) {\n const purchase_result = await this.__request(`https://dragonsofmugloar.com/api/v2/${this.game.gameId}/shop/buy/${itemId}`, \"POST\");\n\n if (purchase_result) {\n const {gold, level, lives, shoppingSuccess, turn} = purchase_result;\n if (!shoppingSuccess) {\n console.log(\"Cannot buy this item!\");\n }\n await this.updateGameState(lives, gold, null, null, turn, level);\n }\n\n }", "function purchase(action = \"\") {\n if (action == \"init\") {\n }\n\n // Prompt the user to enter Product's item_id to review detail of the product:\n inquirer.prompt([\n {\n name: \"ID\",\n type: \"input\",\n message:\n \"Enter the product's item ID to review detail. [Quit with Ctrl+C]\",\n filter: Number,\n validate: function(val) {\n return !isNaN(val);\n }\n },\n {\n name: \"qty\",\n type: \"input\",\n message: \"OK, how many would you like to buy? \",\n filter: Number,\n validate: function(value) {\n if (isNaN(value) == false) {\n return true;\n } else {\n return false;\n }\n }\n }\n ]).then(function(userInput) {\n connection.query(\"SELECT * FROM products WHERE item_id = ?\", [userInput.ID], function(err, inventoryRes) {\n if (err) {\n console.log(\"ERROR: \", err);\n }\n console.log(\"\");\n console.log(\n \"====================\",\n \"\\nPRODUCT DETAIL: \",\n inventoryRes,\n \"\\n====================\"\n );\n console.log(\"\");\n purchaseItem(userInput.ID, userInput.qty);\n });\n });\n // *** This is the end of the function purchase() ***\n}", "function onClickActionBuyItem(){\n\t\tconst itemlist = CashShop.cartItem;\n\t\tCashShop.cartItemLen = itemlist.length;\n\n\t\tCashShop.ui.find('#purchase-btn').prop('disabled', true);\n\t\tUIManager.showPromptBox( 'Are you sure you want to buy this items?', 'ok', 'cancel', function(){\n\t\t\tif(CashShop.cartItem.length > 0){\n\t\t\t\tvar pkt \t= new PACKET.CZ.SE_PC_BUY_CASHITEM_LIST();\n\t\t\t\tpkt.kafraPoints \t= 0;\n\t\t\t\tpkt.item_list \t\t= CashShop.cartItem;\n\t\t\t\tNetwork.sendPacket(pkt);\n\t\t\t} else {\n\t\t\t\tUIManager.showMessageBox( 'No item in cart!', 'ok');\n\t\t\t\tChatBox.addText( 'No item in cart!', ChatBox.TYPE.INFO);\n\t\t\t\tCashShop.ui.find('#purchase-btn').prop('disabled', false);\n\t\t\t}\n\t\t}, function(){\n\t\t\tCashShop.ui.find('#purchase-btn').prop('disabled', false);\n\t\t});\n\t}", "function getItem(con) {\n\tlet item = -1;\n\tlet ids = [];\n\tlet quantity = 0;\n\tlet quantities = [];\n\tconst queryString = \"SELECT * FROM products\";\n\n\tcon.query(queryString, function(error, rows, fields) {\n\t\tif(error) throw error;\n\t\tfor(var i in rows) {\n\t\t\t\tids.push([rows[i].item_id]);\n\t\t\t}\n\t\t\treturn ids;\n\t\t});\n\tdisplayAvailable(con)\n\tvar questions = [\n\t{\n\ttype: 'input',\n\tname: 'enter_id',\n\tmessage: 'What item do you want to restock?',\n\tvalidate: function(value) {\n\t\t\tif(ids[0].includes(parseInt(value))) {\n\t\t\t\titem = parseInt(value);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.log(\"Please enter an Item ID on the list.\");\n\t\t\t}\n\t\t}\n\t},\n\t{\n\ttype: 'input',\n\tname: 'how_many',\n message: 'How many do you want to add?',\n default: function() {\n \t\treturn 5;\n\t\t},\n\tvalidate: function(value) {\n\t\t\ttry {\n\t\t\t\tvalue = parseInt(value);\n\t\t\t}\n\t\t\tcatch(error) {\n\t\t\t\tconsole.log(\"Please enter a number.\");\n\t\t\t}\n\t\t\tif(value.isInteger ===false) {\n\t\t\t\tconsole.log(\"Please enter an integer\")\n\t\t\t}\n\t\t\telse if(parseInt(value) <= 0) {\n\t\t\t\tconsole.log(\"Please enter a positive integer!\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tquantity = parseInt(value)\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}];\n \tinquirer.prompt(questions).then(function() {\n\t \treturn addInventory(item, quantity, con);\n\t});\n}", "function shopping() {\n inquirer.prompt([\n {\n name: \"idSearch\",\n type: \"input\",\n message: \"Please enter the id of the product you would like.\"\n },\n {\n name: \"quantity\",\n type: \"input\",\n message: \"How much would you like?\"\n }\n ]).then(function (response) {\n //sets inputs to variables and pushes them into the purchase function\n var requestedId = response.idSearch;\n var desiredQuantity = response.quantity;\n purchase(requestedId, desiredQuantity);\n });\n}", "function customerMenu(){\n\tconsole.log(\"Take a look! Products are listed as ID#) ITEM | PRICE($)\");\n\n\t// Query: Reads list of products\n\tconnection.query(\"SELECT * FROM products\", function(menuErr, menuRes){\n\t\tif (menuErr) throw menuErr;\n\n\t\tvar ids = [];\n\n\t\tfor (var i = 0; i < menuRes.length; i++){\n\t\t\tvar itemDisplay = menuRes[i].item_id + \") \" + menuRes[i].product_name + \" | price: \" + menuRes[i].price;\n\t\t\tids.push(menuRes[i].item_id);\n\t\t\tconsole.log(itemDisplay);\n\t\t\tconsole.log(\"----------------------------------------------\");\n\t\t}\n\n\t\t// Prompts user to enter id and quantity\n\t\tinquirer.prompt([{\n\t\t\ttype: \"input\",\n\t\t\tmessage: \"Select a product by entering its id: \",\n\t\t\tname: \"itemEntered\",\n\t\t\tvalidate: function(value){\n\t\t\t\t// If the entry is a product that is listed...\n\t\t\t\tif (ids.indexOf(parseInt(value)) > -1) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},{\n\t\t\ttype: \"input\",\n\t\t\tmessage: \"Enter the number of units you want to purchase: \",\n\t\t\tname: \"quantityEntered\",\n\t\t\tvalidate: function(quantity){\n\t\t\t\t// If the entry is a number and an integer\n\t\t\t\tif (isNaN(quantity) === false && Number.isInteger(Number(quantity)) === true) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}]).then(function(selectionAnswers){\n\t\n\t\t\tvar product = parseInt(selectionAnswers.itemEntered);\n\t\t\tvar quantity = parseInt(selectionAnswers.quantityEntered);\n\t\t\tvar chosenItem;\n\n\t\t\t// Match user's entry to item in products table\n\t\t\tfor (var j = 0; j < menuRes.length; j++) {\n\t\t\t\tif (product === menuRes[j].item_id) {\n\t\t\t\t\tchosenItem = menuRes[j];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If there aren't sufficient items in stock...\n\t\t\tif (quantity > chosenItem.stock_quantity) {\n\t\t\t\tconsole.log(\"Insufficient Quantity\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar new_stock_quantity = chosenItem.stock_quantity - quantity;\n\t\t\t\ttotalCost += (quantity * chosenItem.price);\n\n\t\t\t\t// Query: update stock quantity after items purchased\n\t\t\t\tconnection.query(\"UPDATE products SET ? WHERE ?\", [{\n\t\t\t\t\tstock_quantity: new_stock_quantity\n\t\t\t\t},{\n\t\t\t\t\titem_id: chosenItem.item_id\n\t\t\t\t}], function(updateErr, updateRes){\n\t\t\t\t\tif (updateErr) throw updateErr;\n\n\t\t\t\t\t// Prompts user to continue shopping or end application\n\t\t\t\t\trestartMenu();\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t});\n}", "function purchase() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n console.table(res);\n inquirer.prompt([{\n name: \"itemId\",\n type: \"number\",\n message: \"Enter the item ID of the item you want to buy.\".brightYellow\n },\n {\n name: \"itemQuantity\",\n type: \"number\",\n message: \"Excellent Choice! How many would you like?\".brightYellow\n }]).then(function (answer) {\n saleItem = answer.itemId - 1;\n saleQuantity = answer.itemQuantity;\n checkInv()\n\n });\n\n });\n\n}", "function pickItemId() {\n inq.prompt([{\n type: 'input',\n name: 'whatId',\n message: '\\nPlease enter the ID of the item you would like to purchase'\n }]).then(function(inqRes) {\n connection.query(\"SELECT * FROM products WHERE item_id =\" +\n \"'\" + inqRes.whatId + \"'\",\n function(err, res) {\n // If there's an error log it\n if (err) {\n console.log(err);\n } else\n // If The response is not an empty array\n if (res.length > 0) {\n console.log(\"You have selected: \" +\n res[0].product_name + ' $' + res[0].price + '.00 ' +\n \"each \" + res[0].stock_quantity + \" left\");\n itemChosen = inqRes.whatId;\n itemQuantity = res[0].stock_quantity;\n itemPrice = res[0].price;\n chooseQuantity();\n }\n // If the response is an empty array i.e. not a valid ID\n else {\n console.log(\"Sorry, this is not a valid ID please try again\");\n pickItemId();\n }\n });\n });\n}", "function shoppingCart(res) {\n inquirer\n .prompt([\n {\n name: \"id\",\n type: \"input\",\n message: \"\\nUse Item Id to Select Product.\"\n },\n {\n name: \"quantity\",\n type: \"input\",\n message: \"\\nPlease enter number of units to purchase.\\n\"\n }\n ])\n .then(function(data) {\n id = data.id;\n quantity = data.quantity;\n stockQuantity(data.id, data.quantity);\n });\n}", "function addSelectedItemToCart() {\n // TODO: suss out the item picked from the select list\n let selectedItem = event.target.items.value;\n console.log(selectedItem);\n // TODO: get the quantity\n let quantity = event.target.quantity.value;\n // TODO: using those, add one item to the Cart\n \n \n carts.addItem(selectedItem,quantity); \n console.log(carts.items);\n \n}", "function checkItem(itemID, numUnits) {\n // console.log(\"Running checkItem! Looking for item #: \"+ itemID);\n connection.query('SELECT * FROM bamazon.products;', function (err, results, fields) {\n // get the information of the chosen item\n var itemIdInt = parseInt(itemID);\n var numUnitsInt = parseInt(numUnits);\n var chosenItem;\n for (var i = 0; i < results.length; i++) {\n // console.log(results[i].item_id);\n // console.log(itemIdInt);\n if (results[i].item_id === itemIdInt) {\n chosenItem = results[i];\n // console.table(chosenItem);\n }\n }\n\n if (chosenItem.stock_quantity < numUnitsInt) {\n console.log(\"Insufficient quantity in stock!\")\n prompt();\n } else {\n fulfillOrder(chosenItem, numUnitsInt);\n } \n\n });\n}", "function startpurchase() {\n inquirer\n .prompt([\n {\n name: \"itemID\",\n type: \"input\",\n message: \"What is the ID of the product you wish to purchase?\",\n },\n {\n name: \"quantity\",\n type: \"input\",\n message: \"How many units would you like to buy?\"\n }\n ]).then(function(inquirerResponse) {\n userAnswer = {\n item_id: parseInt(inquirerResponse.item_id),\n quantity: parseInt(inquirerResponse.quantity)\n }\n {\n checkStore(userAnswer);\n }\n })\n}", "function invokeItemPage(){\n addCart();\n displayCounter();\n addCartForItem('carrot');\n}", "function addSelectedItemToCart() { \n var itemsEl = document.getElementById('items').value;\n var quantityEl = document.getElementById('quantity').value;\n cart.addItem(itemsEl, parseInt(quantityEl));\n // console.log(cart.items[0].product);\n // console.log(cart.items[0].quantity); \n}", "function likeToBuy() { \n inquirer\n .prompt([\n {\n name: \"itemID\",\n message: chalk.bold.blue(\"Please enter the ID of the product you would like to buy.\"),\n type: \"number\",\n },\n {\n name: \"quantity\",\n message: chalk.bold.blue(\"How many items would you like to buy?\"),\n type: \"number\",\n }\n ])\n .then(function (customerCart) {\n // If the the answers are inputed, we display the reponse\n var itemCustomerWants = customerCart.itemID;\n var howManyCustomerWants = customerCart.quantity;\n checkInventory(itemCustomerWants, howManyCustomerWants)\n });\n // connection.end(); \n }", "function addSelectedItemToCart() {\n // suss out the item picked from the select list\n let product = document.getElementById('items').value;\n let quantity = document.getElementById('quantity').value;\n cart.addItem(product, quantity);\n\n // console.log(newCartItem);\n // console.log(cart);\n\n // get the quantity\n // using those, add one item to the Cart\n}", "function promptUserPurchase() {\n\t// console.log('___ENTER promptUserPurchase___');\n\n\t// Prompt the user to select an item\n\tinquirer.prompt([\n\t\t{\n\t\t\ttype: 'input',\n\t\t\tname: 'item_id',\n\t\t\tmessage: 'Please enter the Item ID which you would like to purchase.',\n\t\t\tvalidate: validateInput,\n\t\t\tfilter: Number\n\t\t},\n\t\t{\n\t\t\ttype: 'input',\n\t\t\tname: 'quantity',\n\t\t\tmessage: 'How many do you need?',\n\t\t\tvalidate: validateInput,\n\t\t\tfilter: Number\n\t\t}\n\t]).then(function(input) {\n\t\t// console.log('Customer has selected: \\n item_id = ' + input.item_id + '\\n quantity = ' + input.quantity);\n\n\t\tvar item = input.item_id;\n\t\tvar quantity = input.quantity;\n\n\t\t// Query db to confirm that the given item ID exists in the desired quantity\n\t\tvar queryStr = 'SELECT * FROM products WHERE ?';\n\n\t\tconnection.query(queryStr, {item_id: item}, function(err, data) {\n\t\t\tif (err) throw err;\n\n\t\t\t// If the user has selected an invalid item ID, data attay will be empty\n\t\t\t// console.log('data = ' + JSON.stringify(data));\n\n\t\t\tif (data.length === 0) {\n\t\t\t\tconsole.log('ERROR: Invalid Item ID. Please select a valid Item ID.');\n\t\t\t\tdisplayInventory();\n\n\t\t\t} else {\n\t\t\t\tvar productData = data[0];\n\n\t\t\t\t// console.log('productData = ' + JSON.stringify(productData));\n\t\t\t\t// console.log('productData.stock_quantity = ' + productData.stock_quantity);\n\n\t\t\t\t// If the quantity requested by the user is in stock\n\t\t\t\tif (quantity <= productData.stock_quantity) {\n\t\t\t\t\tconsole.log('Congratulations, the product you requested is in stock! Placing order!');\n\n\t\t\t\t\t// Construct the updating query string\n\t\t\t\t\tvar updateQueryStr = 'UPDATE products SET stock_quantity = ' + (productData.stock_quantity - quantity) + ' WHERE item_id = ' + item;\n\t\t\t\t\t// console.log('updateQueryStr = ' + updateQueryStr);\n\n\t\t\t\t\t// Update the inventory\n\t\t\t\t\tconnection.query(updateQueryStr, function(err, data) {\n\t\t\t\t\t\tif (err) throw err;\n\n\t\t\t\t\t\tconsole.log('Your oder has been placed! Your total is $' + productData.price * quantity);\n\t\t\t\t\t\tconsole.log('Thank you for shopping with us!');\n\t\t\t\t\t\tconsole.log(\"\\n---------------------------------------------------------------------\\n\");\n\n\t\t\t\t\t\t// End the database connection\n\t\t\t\t\t\tconnection.end();\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log('Sorry, there is not enough product in stock, your order can not be placed as is.');\n\t\t\t\t\tconsole.log('Please modify your order.');\n\t\t\t\t\tconsole.log(\"\\n---------------------------------------------------------------------\\n\");\n\n\t\t\t\t\tdisplayInventory();\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t})\n}", "function buyItem() {\n\n}", "function selectItem(){\n\n inquirer.prompt([\n {\n type: \"list\",\n message: \"What would you like to purchase?\",\n choices: idArray,\n name: \"selectItem\"\n }\n ]).then(function(response){\n itemID = response.selectItem;\n quantity();\n });\n}", "function addToCart(item, price, id, imageName){\n let eachItemCount = 0;\n //adding item value to array.\n itemPurchase.push( { \"item\": item, \"price\": price, \"id\": id, \"imageName\": imageName} );\n for(let i = 0; i < itemPurchase.length; i++){\n if(id == itemPurchase[i].id)\n eachItemCount++;\n } \n //changing state of Add to Cart button.\n if(eachItemCount != 0)\n document.getElementById( id ).innerHTML = eachItemCount + \" +\";\n //calling counter function.\n counter();\n}", "function buyItem() {\n\taddArmor();\n\t$('#alerts').append(\"<br />An item has being bought<br />\");\n\tremoveMoneyI();\n}", "function buy()\n{\n\t//query the databse for all items being sold\n\tconnection.query(\"SELECT * FROM products\", function(err, res)\n\t{\n\t\t\n\t\tif(err) throw err;\n\n\t\t//Prompt the user to input data\n\t\tinquirer.prompt([\n\n\t\t\t{\n\t\t\t\t//Ask for id of the product the user wants to buy\n\t\t\t\tname: \"id\",\n\t\t\t\ttype: \"list\",\n\t\t\t\tchoices: function()\n\t\t\t\t{\n\t\t\t\t\tvar idChoiceArray = [];\n\n\t\t\t\t\tfor(var i = 0; i < res.length; i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t//push all items_ids into (idChoiceArray) in order to display all ids to choose from\n\t\t\t\t\t\t//NOTE: For rawlist cannot use type(INT) only (string) hence convert int to string by JSON.stringify\n\t\t\t\t\t\tidChoiceArray.push(JSON.stringify(res[i].item_id));\n\t\t\t\t\t}\n\n\t\t\t\t\t//display all item_id's to choose from\n\t\t\t\t\treturn idChoiceArray;\n\t\t\t\t},\n\t\t\t\tmessage: \"Enter the id of the product you want to purchase\"\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t//Ask customer for how many units they'd like to buy\n\t\t\t\ttype: \"input\",\n\t\t\t\tname: \"quantity\",\n\t\t\t\tmessage: \"How many units would you like to buy?\"\n\t\t\t}\n\n\t\t\t]).then(function(answer)\n\t\t\t{\n\t\t\t\t//get the entire item object & store in variable\n\t\t\t\tvar chosenItem;\n\n\t\t\t\tfor(var i = 0; i < res.length; i++)\n\t\t\t\t{\n\t\t\t\t\t//if id == user id choice then store entire object\n\t\t\t\t\tif(res[i].item_id === parseInt(answer.id) )\n\t\t\t\t\t{\n\t\t\t\t\t\tchosenItem = res[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\t//call the checkQuantity function & update the table if the quantity entered is sufficient\n\t\t\t\tcheckQuantity(chosenItem, answer, err);\n\n\t\t\t});\n\n\t});\n}", "function askCustomer(item) {\n inquirer.prompt([\n {\n type: \"input\",\n name: \"idpicked\",\n message:\n \"What is the ID of the product you want to buy? || if you changed your mind then exit by tyiping. 'Nevermind'\",\n validate: function (value) {\n if (value === \"Nevermind\") {\n var quitingresponse = \"leave my store\";\n } else {\n var customerwants = parseInt(value);\n }\n }.then(function (value) {\n console.log(\"you chose to buy\" + value);\n }),\n },\n ]);\n}", "function addSelectedItemToCart() {\n\n let quantityTextbox = document.getElementById('quantity').value;\n let ddlProducts = document.getElementById(\"items\");\n let selectedOption = ddlProducts.value; \n cart.addItem(selectedOption, quantityTextbox);\n \n}", "function askProductID(results){\n \n inquirer\n .prompt ([\n {\n type: \"Input\",\n name:\"selection\",\n message:\"What is the id for the item you want to buy?\"\n }\n\n ])\n .then (function (Input) {\n \n var selectionId = parseInt(Input.selection);\n \n var product=checkInventory(selectionId, results);\n\n //if product with selected id exists ask the user for quantity \n if(product){\n askForQuantity(product);\n }else \n {\n //if product was not found \n console.log(\"selected item is out of stock, please select another item from the list \")\n displyProducts();\n }\n });\n}", "function continueShopping() {\n\n}", "function addSelectedItemToCart() {\n // TODO: suss out the item picked from the select list\n var product = event.target.items.value;\n var quantity = event.target.quantity.value;\n cart.addItem(product, quantity);\n counter++;\n console.log(counter);\n // TODO: get the quantity\n // TODO: using those, add one item to the Cart\n}", "function clicked(item) {\n var btnId = $(item).attr(\"id\");\n addToCart(btnId)\n}", "function AddtoCart() {\n let uuid = uuidv4();\n console.log(\"add in cart\");\n var search = location.search;\n console.log(search);\n var ItemId = search.substring(4);\n console.log(ItemId);\n var uid = firebase.auth().currentUser.uid;\n const CartItemRef = firebase.firestore().collection(\"cartlist\").doc(uuid);\n CartItemRef.set({ ...itemdetail, uid: uid, quantity: 1, id: uuid })\n .then(() => {})\n .catch((err) => {\n console.log(err);\n });\n }", "function buyItem () {\n inquirer.prompt([\n {\n type:\"input\",\n name:\"itemSelected\",\n message:\"Please type an item id to purchase.\"\n },\n {\n type:\"input\",\n name:\"quantity\",\n message:\"How many would you like to purchase?\"\n }\n ]).then(function (results) {\n itemSelected = results.itemSelected;\n quantity = Number(results.quantity);\n \n if (itemSelected > 10) {\n console.log(\"Invalid item, please select a new item.\")\n buyItem();\n }\n \n checkItemStock();\n });\n}", "function selectItem() {\n inquirer.prompt({\n name: \"productId\",\n type: \"input\",\n message: \"What is the id of the product you would like to purchase?\"\n })\n //Take the productId answer and use it to query the database under id\n //If it is not found, alert the user to enter a valid id\n .then(function (answer) {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err)\n throw err;\n //Reset selected item to null\n selectedItem = null;\n\n //Loop through the results from MySQL and compare them with the productId answer given in inquirer\n for (var i = 0; i < res.length; i++) {\n //If any item_id matches the productId, set chosenItem equal to that product\n if (res[i].item_id === parseInt(answer.productId)) {\n selectedItem = res[i];\n }\n }\n //Conditional which checks for a valid ID\n if (selectedItem === null) {\n console.log(\"Sorry, please select a valid ID\")\n selectItem();\n } else {\n selectQuantity();\n }\n })\n })\n}", "function addToCart(itemCode) {\n \n console.log(\"Add to cart \" + itemCode);\n var item = '{\"action\":\"add\", \"item\":\"' + itemCode + '\"}';\n websocket.send(item);\n}", "function promptBuyer() {\n\n // Prompt buyer to select an item by id\n console.log(` \n ______ \n (____ \\ \n ____) ) ____ ____ ____ _____ ___ ____ \n | __ ( / _ | \\ / _ (___ ) _ \\| _ \\ \n | |__) | ( | | | | ( ( | |/ __/ |_| | | | |\n |______/ \\_||_|_|_|_|\\_||_(_____)___/|_| |_| \\n\n \\n-------------------------------------------------------------------\\n`);\n\n inquirer.prompt([\n {\n type: 'input',\n name: 'item_id',\n message: 'Please enter the ID of the Desired Item.',\n validate: validNumber,\n filter: Number\n },\n {\n type: 'input',\n name: 'quantity',\n message: 'How many such items do you require?',\n validate: validNumber,\n filter: Number\n }\n ]).then(function (input) {\n\n const item = input.item_id;\n const quantity = input.quantity;\n\n // Query db to confirm that the given item ID exists in the desired quantity\n let querySelect = 'SELECT * FROM products WHERE ?';\n\n connection.query(querySelect, { item_id: item }, function (err, data) {\n if (err) throw err;\n\n if (data.length === 0) {\n console.log('ERROR: Invalid Item ID. Please select a valid Item ID.');\n displayInventory();\n\n } else {\n const productData = data[0];\n\n // If the quantity requested by the user is in stock\n if (quantity <= productData.stock_quantity) {\n console.log('Success, the product is available in this quantity! << Order Confirmed! >>');\n\n // Construct the updating query string\n const updatequerySelect = 'UPDATE products SET stock_quantity = ' + (productData.stock_quantity - quantity) + ' WHERE item_id = ' + item;\n\n // Update the inventory\n connection.query(updatequerySelect, function (err, data) {\n if (err) throw err;\n\n console.log('\\n---------------------------------------------------------------------\\n'\n + 'Order Placed! Your total is $' + productData.price * quantity\n + '\\n---------------------------------------------------------------------\\n'\n + '\\n Thank you for choosing Bamazon! \\n');\n // End the db connection\n connection.end();\n })\n } else {\n console.log('\\n---------------------------------------------------------------------\\n'\n + 'Sorry, there is not enough product in stock, your order can not be placed as is. \\n Please modify your order.'\n + '\\n---------------------------------------------------------------------\\n');\n //display inventory again\n displayInventory();\n }\n }\n })\n })\n}", "function purchaseItem() {\n return\n}", "function addingProductToCart(id, quantity) {\r\n if (Helpers_1.Helpers.kiemTraSoLuong(quantity)) {\r\n let product = repotest.getItemById(id);\r\n cartObj.addProduct(product, quantity);\r\n showCart(); // sau khi thay doi phai goi lai;\r\n }\r\n else {\r\n thongBao(DinhNghiaCacThongBaoHtml.PhaiChonItNhat01SanPham);\r\n }\r\n}", "function promptCustomer() {\n\tinquirer.prompt([\n\t{\n\t\tname: \"id\",\n\t\ttype: \"input\",\n\t\tmessage: \"\\nPlease input the ID number of the item you would like to purchase\"\n\t}, {\n\t\tname: \"quantity\",\n\t\ttype: \"input\",\n\t\tmessage: \"\\nHow many of this item would you like to purchase?\"\n\t}\n\t]).then(function(response) {\n\t\tchosenId = parseFloat(response.id);\n\t\tchosenQuant = parseFloat(response.quantity);\n\t\tvar chosenItem;\n\t\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\t\tif (err) throw err;\n\t\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\t\tif (res[i].item_id === chosenId) {\n\t\t\t\t\tchosenItem = res[i];\n\t\t\t\t};\n\t\t\t};\n\t\t\t// console.log(chosenItem.product_name); //for debugging\n\t\t\tif (chosenItem.stock_quantity < chosenQuant) {\n\t\t\t\tconsole.log(\"\\nWe do not have enough of this item in stock.\\n\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar totalCost = chosenItem.price * chosenQuant;\n\t\t\t\tvar newStockQuant = chosenItem.stock_quantity - chosenQuant;\n\t\t\t\t// console.log(newStockQuant);\n\t\t\t\t// console.log(chosenItem.stock_quantity);\n\t\t\t\t// console.log(chosenId);\n\t\t\t\tconsole.log(\"\\nThank you for your order. Your total is $\" + totalCost +\"\\n\");\n\t\t\t\t//function that updates inventory quantity\n\t\t\t\tconnection.query(\n\t\t\t\t\t\"UPDATE products SET ? WHERE ?\",\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstock_quantity: newStockQuant\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem_id: chosenId\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\tfunction(err, res) {\n\t\t\t\t\t\tif (err) throw err;\n\t\t\t\t\t\t// console.log(\"Quantity updated\");\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t};\n\t\t\t// quantityCheck();\n\t\t\tconnection.end();\n\t\t});\n\t});\n}", "function start() {\n inquirer\n .prompt([\n {\n name: \"id\",\n type: \"input\",\n message: \"What is the Product ID of the item you would like to purchase?\",\n validate: function (value) {\n if (isNaN(value) === false) {\n return true;\n }\n return false;\n }\n },\n \n {\n name: \"quantity\",\n type: \"input\",\n message: \"How many of the listed product would you like to buy?\",\n validate: function (value) {\n if (isNaN(value) === false) {\n return true;\n }\n return false;\n }\n }\n ])\n\n //This Notes the ID chosen and the Qualtity Chosen and Displays to User\n .then(function (input) {\n \n var item = input.id;\n var quantity = input.quantity;\n \n console.log('You Have Chosen: \\n id = ' + input.id + '\\n Quantity = ' + input.quantity);\n \n \n // Checks if there is enough product in the System\n var queryStr = 'SELECT * FROM products WHERE ?';\n \n connection.query(queryStr, { id: item }, function (err, data) {\n if (err) throw err;\n \n // If a Invalid ID is selected, an error message occurs and the connection is ended. \n \n if (data.length === 0) {\n console.log('ERROR: Please select a valid Item ID.');\n displayInventory();\n connection.end();\n } else {\n var productData = data[0];\n \n \n // Message Displayed with a Valid Order\n if (quantity <= productData.stock_quantity) {\n console.log('The product you requested is in stock! Placing order!');\n\n var updateQueryStr = 'UPDATE products SET stock_quantity = ' + (productData.stock_quantity - quantity) + ' WHERE id = ' + item;\n \n // Update Inventory then End Connection. Else Log that there is not enough product and modify connection \n connection.query(updateQueryStr, function (err, data) {\n if (err) throw err;\n \n console.log('Your order has been placed! Your total is $' + productData.price * quantity);\n console.log('Thank you for shopping with StoreApp!');\n console.log(\"\\n---------------------------------------------------------------------\\n\");\n connection.end();\n })\n } else {\n console.log('Sorry, there is not enough product in stock, your order cannot be placed');\n console.log('Please modify your order amount to a smaller number.');\n console.log(\"\\n---------------------------------------------------------------------\\n\");\n \n connection.end();\n }\n }\n })\n })\n }", "function quantityRequest(item_id, quantity) {\n connection.query(\"SELECT stock_quantity FROM products WHERE item_id = ?\", [item_id], function (err, res) {\n if (err) throw err;\n var res = res[0];\n if (quantity > res.stock_quantity) {\n console.log(\"\\nI'm sorry, the \" + product_name + \" is temporarily out of stock.\");\n additionalPurchase();\n } else {\n var total = (quantity * price);\n console.log(\"\\nThe total of your order is $\" + total + \". \\nThank you. Hope to see you again soon!\");\n updateInv(item_id, res.stock_quantity, quantity);\n additionalPurchase();\n }\n });\n}", "function addSelectedItemToCart() {\n\n // suss out the item picked from the select list\n var productPicked = document.getElementById('items').value; // why not 'options'? it knows there's something in the dropdown.\n var quantityPicked = document.getElementById('quantity').value; // get the quantity\n //using those, add one item to the Cart\n cart.addItem(productPicked,quantityPicked);\n}", "function getClickedItem(){\n\n var id = this.querySelector(\"#inventory-product-id\").innerText;\n\n parentContainer = document.querySelector('#cart-list-of-items');\n \n \n // add an item if not in the cart\n if(!parentContainer.querySelector(\".in-the-cart\")){\n\n document.getElementById(\"cart-added-items\").insertAdjacentHTML(\n \"afterend\",\n `<div id=\"${id}\" class=\"in-the-cart\">\n <span class=\"name\">${product_item[id].product_name}</span>\n <span class=\"price\">${product_item[id].product_price}</span>\n <input type=\"number\" value=\"1\" min=1 max=${product_item[id].quantity} id=\"purchase-quantity\" onkeyup=\"validateQuantity(this)\"/>\n <i id=\"remove-item\" class=\" text-red fas fa-trash\" onclick=\"removeProduct(this)\"></i>\n </div>`\n );\n }\n else\n {\n added_items = parentContainer.querySelectorAll('.in-the-cart');\n in_cart = false; \n\n added_items.forEach(cart_item => {\n \n if(cart_item.querySelector('.name').innerText==product_item[id].product_name)\n { \n in_cart = true;\n }\n });\n\n\n if(in_cart == true)\n { \n quantity_box = parentContainer.querySelector(\"[id='\"+id+\"']\").querySelector('#purchase-quantity');\n if(parseInt(quantity_box.value)< product_item[id].quantity) {\n quantity_box.value = parseInt(quantity_box.value) +1;\n }\n \n }\n else{\n document.getElementById(\"cart-added-items\").insertAdjacentHTML(\n \"afterend\",\n `<div id=\"${id}\" class=\"in-the-cart\">\n <span class=\"name\">${product_item[id].product_name}</span>\n <span class=\"price\">${product_item[id].product_price}</span>\n <input type=\"number\" value=\"1\" min=1 max=${product_item[id].quantity} id=\"purchase-quantity\" onkeyup=\"validateQuantity(this)\"/>\n <i id=\"remove-item\" class=\" text-red fas fa-trash\" onclick=\"removeProduct(this)\"></i>\n </div>`\n );\n }\n }\n \n \n total = calculateTotal()['total'];\n added_to_cart = calculateTotal()['totals'];\n added_to_cart.forEach(element => {\n console.log(\"Hello\"+element.product_id);\n });\n \n document.getElementById(\"total-display\").innerHTML=\"Ksh \"+total;\n document.getElementById(\"cart-items-num\").innerHTML=getItemsInCart().length;\n}", "function productId() {\n\n\tinquirer.prompt([\n\n\t\t{\n\t\t type: \"input\",\n\t\t name: \"id\",\n\t\t message: \"Please enter the Item ID of the product you would like to buy.\\n\",\n\t\t validate: function(value) {\n\t\t \tif (!isNaN(value) && value < 11) {\n\t\t \t\treturn true;\n\t\t \t}\n\t\t \treturn false;\n\t\t }\n\t\t},\n\n\t\t{\n\t\t type: \"input\",\n\t\t name: \"quant\",\n\t\t message: \"How many units of the product would you like to buy? \\n\",\n\t\t validate: function(value) {\n\t\t \tif (!isNaN(value)) {\n\t\t \t\treturn true;\n\t\t \t}\n\t\t \treturn false;\n\t\t\t}\n\t\t}\n\n\t\t]).then(function(answer) {\n\n\t\t\tvar userId = answer.id;\n\t\t\tconsole.log(\"Chosen item id: \" , userId);\n\n\t\t\tvar userQuant = answer.quant;\n\t\t\tconsole.log(\"Chosen quantity from stock: \" , userQuant , \"\\n\");\n\n\t\t\tconnection.query(\"SELECT * FROM products WHERE ?\", [{ item_id : answer.id }], function(err, res) {\n\t\t\t\tif (err) throw err;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tconsole.table(res);\n\t\t\t\tvar current_quantity = res[0].stock_quantity;\n\t\t\t\tconsole.log(\"Current amount in stock: \" , current_quantity);\n\t\t\t\tvar price = res[0].price;\n\t\t\t\tvar remaining_quantity = current_quantity - answer.quant;\n\t\t\t\tconsole.log(\"Remaining amount in stock: \" , remaining_quantity);\n\n\t\t\t\tif(current_quantity > answer.quant) {\n\n\t\t\t\t\tconsole.log(\"Amount Remaining: \" + remaining_quantity);\n\t\t\t\t\tconsole.log(\"Total Cost: \" + (answer.quant * price) + \"\\n\");\n\n\t\t\t\t\tconnection.query(\"UPDATE products SET stock_quantity=? WHERE item_id=?\",\n [\n remaining_quantity, answer.id\n ],\n\n\t\t\t\t\t\n\t\t\t\t\t\tfunction(err, res){\n\t\t\t\t\t\t\tconsole.table(res);\n\t\t\t\t\t\t});\n\n\t\t\t\t\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\n\t\t\t\t\t\tconsole.log(\"This is the updated inventory of product items: \");\n\t\t\t\t\t\tconsole.log(\"------------------------------- \\n\");\n\t\t\t\t\t\tconsole.table(res);\n\t\t\t\t\t});\n\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"We don't have enough, please choose within the amount we have in stock.\");\n\t\t\t\t}\n\n\t\t\tconnection.end();\n\n\t\t\t});\n\t\t})\n\n}", "function userItemChoice(inventory){\n inquirer.prompt([\n {\n type: \"input\",\n name: \"choice\",\n message: \"Enter the ID of the item you would like to purchase [exit with q]\",\n\n // include a way to check if the input is a matching id number with an if/else statement, validate?\n\n validate: function(val) {\n return !isNaN(val) || val.toLowerCase() === \"q\";\n }\n }\n ]).then(function(val) {\n\n // save user quantity input to compare with the stock\n // turn string into a number\n\n quitShopping(val.choice);\n let chosenItemId = parseInt(val.choice);\n let itemName = checkInventory(chosenItemId, inventory);\n\n // prompt customer with desired quantity if there is a matching product ID in the database from other function\n // console log if not enough\n if (itemName) {\n userQuantityChoice(itemName);\n } else {\n console.log(\"Sorry, we do not have that item\");\n // send customer back to the product list\n displayProducts();\n }\n });\n}", "function updatedItem(id) {\n console.log(\"\");\n var query = connection.query(\"SELECT ID, Product_Name , Price, Stock_QTY FROM products WHERE ID = ?;\",[id],function(err, res) {\n if (err) throw err;\n console.log('Your item has been updated. Please see below:');\n console.table(res);\n console.log(\"\");\n managerAsk();\n \n });\n}", "function addToCart() {\n var itemID = $(this).attr(\"id\");\n var alreadyInCart = false;\n for (var i = 0; i < cartItems.length; i++) {\n if (itemID == cartItems[i][0]) {\n alreadyInCart = true;\n cartItems[i][3] += 1;\n }\n }\n if (alreadyInCart == false) {\n for (var i = 0; i < shopItems.length; i++) {\n if (itemID == shopItems[i][0]) {\n var applianceID = shopItems[i][0];\n var applianceName = shopItems[i][1];\n var appliancePrice = shopItems[i][2];\n var applianceQuantity = 1;\n itemID = [\n applianceID,\n applianceName,\n appliancePrice,\n applianceQuantity,\n ];\n }\n }\n cartItems.push(itemID);\n }\n\n updateCartDetails();\n}", "function addToCartClicked(event) {\n document.querySelector(\".custom\").style.display = \"block\";\n var button = event.target;\n var shopItem = button.parentElement.parentElement;\n var title = shopItem.getElementsByClassName(\"shop-item-title\")[0].innerText;\n var price = shopItem.getElementsByClassName(\"shop-item-price\")[0].innerText;\n var imageSrc = shopItem.getElementsByClassName(\"shop-item-image\")[0].src;\n items = {\n title,\n price,\n imageSrc,\n };\n\n // check if the total is updating\n}", "function productIDPrompt() {\n inquirer.prompt({\n name: \"ask\",\n message: \"Please input the ID of the product you would like to buy.\"\n }).then(function(answer) {\n productID = answer.ask;\n var query = \"SELECT item_id, product_name, price, stock_quantity FROM products WHERE ?\";\n connection.query(query, { item_id: answer.ask}, function(err, res) {\n if (err) throw err;\n selProductPrice = res[0].price;\n selProductStock = res[0].stock_quantity;\n \n console.log(`Here is the requested item information: \n________________________________________\n\nItem ID: ${res[0].item_id}\nItem Name: ${(res[0].product_name)}\nPrice: $${res[0].price}\nStock: ${res[0].stock_quantity}\n________________________________________\n`);\n quantityPrompt(selProductStock);\n })\n })\n}", "function transaction(dbQuantity, customerPrice, productID){\n\t//query to update the quantity passed in from user input\n\tconnection.query(\"UPDATE products SET ? WHERE item_id =\" + productID, {stock_quantity: dbQuantity}, function(error, response){\n\t\tif(error){\n\t\t\tconsole.log(error);\n\t\t}else{\n\t\t\t//showing our user what they should pay\n\t\t\tconsole.log(\"You owe $\" + customerPrice);\n\t\t\t//then asking them if they would like to continue shopping\n\t\t\tinquirer.prompt([\n\t\t\t{\n\t\t\t\tname: \"continue\",\n\t\t\t\ttype: \"list\",\n\t\t\t\tmessage: \"Would you like to continue shopping?\",\n\t\t\t\tchoices: [\"yes\", \"no\"]\n\t\t\t}\n\t\t\t]).then(function(info){\n\t\t\t\t//if user would like to continue you shopping we show them our inventory\n\t\t\t\tif(info.continue == \"yes\"){\n\t\t\t\t\tshowStock();\n\t\t\t\t}else{\n\t\t\t\t\tconsole.log(\"Thanks for shopping at Alex's Emporium!\")\n\t\t\t\t};\n\t\t\t});\n\t\t};\n\t});\n}", "function selectItem() {\n inquirer.prompt([\n {\n type: \"input\",\n message: \"Enter the ID for the product you'd like to buy\",\n name: \"productID\"\n },\n {\n type: \"input\",\n message: \"How many units of the product would you like to buy?\",\n name: \"quantity\"\n }\n ]).then(function(inquirerResponse){\n var productID = parseInt(inquirerResponse.productID);\n var qty = inquirerResponse.quantity;\n isAvailable(productID, qty);\n })\n}", "function orderItem() {\n // prompt for info about the item the user wants to purchase and the number of items\n inquirer\n .prompt([\n {\n name: \"item\",\n type: \"input\",\n message: \"What is the id of the item you would like to purchase? [Quit with Q]\"\n },\n {\n name: \"number\",\n type: \"input\",\n message: \"How many would you like? [Quit with Q]\",\n when: function (answers) {\n return answers.item !== \"Q\";\n },\n validate: function (value) {\n if (isNaN(value) === false || value === \"Q\") {\n return true;\n }\n return false;\n }\n }\n ])\n .then(function (answer) {\n // when finished prompting check if the store has enough items to sell \n if (answer.item === \"Q\" || answer.number === \"Q\") {\n console.log(\"Exiting the program...\");\n connection.end();\n process.exit();\n }\n else {\n connection.query(\"SELECT * FROM products WHERE ?\",\n [\n {\n item_id: answer.item\n }\n ]\n ,\n function (err, results) {\n if (err) throw err;\n //if the querying was successfull \n //check if there are enough items to sell to a customer \n var numItems = results[0].stock_quantity;\n var product = results[0].product_name;\n var itemNum = parseInt(answer.item);\n var userNum = parseInt(answer.number);\n if (userNum <= numItems) {\n //if the quantity is sufficient display the message and update the table\n var plural = userNum === 1 ? \"item\" : \"items\";\n console.log(\"Successfully purchased \" + answer.number + \" \" + product + \" \" + plural + \" for the sum of $\" + userNum * results[0].price);\n updateProduct(itemNum, numItems - userNum);\n\n }\n else {\n //display the message if the quantity is insufficient\n console.log(\"Sorry! Insufficient quantity in stock! Please change the order. \");\n //display the table of items on sale...\n displayProducts();\n }\n });\n }\n });\n}", "function purchaserQuery() {\n\tinquirer.prompt([\n\t{\n\t\ttype: \"input\",\n\t\tname: \"query\",\n\t\tmessage: \"Input the item ID you wish to purchase.\",\n\t\t//Prevents the app from accepting non-numerical inputs\n\t\tvalidate: function(res) {\n\t\t\tif (isNaN(res) === false) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconsole.log(\"You need to enter a valid numerical ID.\");\n\t\t\treturn false;\n\t\t}\n\t},\n\t{\n\t\ttype: \"input\",\n\t\tname: \"quantity\",\n\t\tmessage: \"How many of this item will you purchase?\",\n\t\tvalidate: function(res) {\n\t\t\tif (isNaN(res) === false) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconsole.log(\"You need to enter a valid numerical amount.\");\n\t\t\treturn false;\n\t\t}\n\t}\n\t]).then(function(info) {\n\tvar item = info.query;\n\tvar quantity = info.quantity;\n\t//This grabs information from the MySQL database to assign as useable variables\n\tconnection.query(\"SELECT * FROM products WHERE item_id = ? \", item, function(err, res) {\n\t\t\tif (err) throw err;\n\t\t\tvar department = res[0].department_name;\n\t\t\tvar stock = res[0].stock_quantity;\n\t\t\tif (stock >= quantity) {\n\t\t\t\tvar stockTotal = stock - quantity;\n\t\t\t\tvar price = res[0].price;\n\t\t\t\tvar cost = quantity * price;\n\t\t\t\t//Alters the information within the database to reflect customer selections\n\t\t\t\tconnection.query(\"UPDATE departments SET ? WHERE ?\", [{total_sales: cost}, {department_name: department}], function(err, res) {});\n\t\t\t\t//Represents the user's \"Shopping cart\"\n\t\t\t\trunningTotal = runningTotal + cost;\n\t\t\t\tconsole.log(\"Your total comes to $\" + runningTotal);\n\t\t\t\t//Changes the quantity available after user check-out\n\t\t\t\tconnection.query(\"UPDATE products SET ? WHERE ?\", [{stock_quantity: stockTotal}, {item_id: item}], function(err, res) {});\n\t\t\t\t//Option to disconnect from server and end application\n\t\t\t\tinquirer.prompt([\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"confirm\",\n\t\t\t\t\t\tname: \"complete\",\n\t\t\t\t\t\tmessage: \"Have you finished shopping?\"\n\t\t\t\t\t}\n\t\t\t\t]).then(function(info){\n\t\t\t\t\tvar complete = info.complete;\n\n\t\t\t\t\tif (complete) {\n\t\t\t\t\t\tconsole.log(\"Thank you for shopping with the Bamazon Bookstore.\");\n\t\t\t\t\t\tconnection.end();\n\t\t\t\t\t} else {\n\t\t\t\t\t\trunProcess();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t//If the item is out-of-stock, the user will be prompted back to start.\n\t\t\t} else {\n\t\t\t\tconsole.log(\"Insufficient quantity!\");\n\t\t\t\trunProcess();\n\t\t\t}\n\t\t});\n\t});\n}", "addToCart() {\n const addedItemsId = this.props.cart.addedItems.map(item => item.id);\n const check = addedItemsId.includes(this.props.item.id);\n if (!check) {\n const item = {\n id: this.props.item.id,\n name: this.props.item.ename,\n price: this.props.item.price,\n ingredient: this.props.item.dish_ingradint,\n photo: this.props.item.dishImage_thump,\n availability: this.props.item.active,\n restaurantName: this.props.restaurantItem.restaurantName,\n restaurantId: this.props.restaurantItem.id,\n quantity: 1,\n deliveryCost: this.props.restaurantItem.deliveryCost\n };\n this.props.addItemToCart(item);\n }\n if (check) {\n Alert.alert('', 'this item is already added to cart');\n }\n }", "function inventory() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n displayForManager(res);\n purchasePrompt();\n });\n}", "function shop() {\n\t\tif (document.getElementById(\"item\").value == \"\") {\n\t\t\texit();\n\t\t} else {\n\t\t$(\".statement\").addClass(\"hidden\");\n\t\tadd();\n\t\t$('#item').val(' ');\n\t\t}\n\t}", "function purchase(quantityRemaining, quantityRequest, price, id) {\n if (quantityRemaining < quantityRequest) {\n inquirer\n .prompt({\n name: \"editRequest\",\n type: \"rawlist\",\n message:\n \"Insufficient quantity to fullfill order. Would you like to change your request to a smaller value?\",\n choices: [\"Yes\", \"No\"]\n })\n .then(function(data) {\n if (data.confirm === \"No\") {\n console.log(\"Thank you for your business!\");\n connection.end();\n } else {\n runSearch();\n }\n });\n } else {\n total = total + price * quantity;\n connection.query(\n \"UPDATE products SET stock_quantity = stock_quantity - \" +\n quantity +\n \" WHERE ?\",\n [\n {\n item_id: id\n }\n ],\n //alert user of the balance for their current request, if they want to make additional purchases \n //then price and quantity is added to the \"total\" variable.\n function(err, res) {\n if (err) throw err;\n\n inquirer\n .prompt({\n name: \"confirm\",\n type: \"rawlist\",\n message:\n \"\\nYour total for this transaction is: $\" +\n (price * quantity).toString() +\n \". Would you like to make another purchase?\",\n choices: [\"Yes\", \"No\"]\n })\n .then(function(data) {\n if (data.confirm === \"No\") {\n console.log(\"\\nThe total for today is: $\" + total.toString());\n connection.end();\n } else {\n runSearch();\n }\n });\n }\n );\n }\n}", "function sendExtraItemInformation(item_id){\n\t\t\n\t\tvar keyValuePairs = [];\n\t \n\t\t$(\"div[id=keyValuePair]\").each(function(){\n\t \t\n\t \tkeyValuePair = {};\n\t\t \n\t \tvar key = $(this).children(\"#keyDiv\").children(\"#key\").val();\n\t \tvar value = $(this).children(\"#valDiv\").children(\"#value\").val();\n\t \t\n\t \tkeyValuePair[\"item_key\"]=key;\n\t \tkeyValuePair[\"item_value\"]= value;\n\t \tkeyValuePair[\"item_id\"] = item_id;\n\t \tkeyValuePairs.push(keyValuePair);\n\t \t\n\t });\n\t\t\n\t\tif(keyValuePairs.length>0){\n\t\t\n\t\t\t$.ajax({\n\t\t\t\turl:\"http://localhost:8080/flipkart/webapi/seller/addItemDetails\",\n\t\t\t\ttype:\"POST\",\n\t\t\t\tdata: JSON.stringify(keyValuePairs),\n\t\t\t\tcontentType: 'application/json',\n\t\t\t\tsuccess : function(data){\n\t\t \t\n\t\t \tif(data==\"success\"){\n\t\t \n\t\t \t}\n\t\t \telse\n\t\t \t\talert(\"failed to add Item\");\n\t\t },\n\t\t error : function(data){\n\t\t \talert(\"failed to add Item!\");\n\t\t }\n\t\t \n\t\t\t});\n\t\t\t\n\t\t}\n\t}", "function onClickActionAddCartItem(e){\n\t\t\n\t\tvar html = '';\n\t\tlet itemId = parseInt(e.currentTarget.dataset.itemid);\n\t\tvar it = DB.getItemInfo( itemId );\n\t\tvar content = CashShop.ui.find('.container-cart');\n\t\tconst itemCart = CashShop.cartItem.find(i => i.itemId === itemId);\n\t\tvar item = [];\n\t\tvar tab = 0;\n\t\tif(CashShop.activeCashMenu !== 'SEARCH_RESULT'){\n\t\t\titem = CashShop.cashShopListItem[CashShop.activeCashMenu].items.find(i => i.itemId === itemId);\n\t\t\ttab = CashShop.cashShopListItem[CashShop.activeCashMenu].tabNum;\n\t\t} else {\n\t\t\titem = CashShop.csListItemSearchResult.find(i => i.itemId === itemId);\n\t\t\ttab = item.tab;\n\t\t}\n\n\t\tif(content.find('#cart-list .items .no-items').length > 0){\n\t\t\tcontent.find('#cart-list .items .no-items').remove();\n\t\t}\n\n\t\tif(CashShop.cartItem.length > 4 && typeof itemCart === 'undefined'){\n\t\t\t//only 5 item can store in cart\n\t\t\tUIManager.showMessageBox( '5 Item can only stored in cart!', 'ok');\n\t\t\treturn;\n\t\t}\n\n\t\tif(item.amount >= 99){\n\t\t\tUIManager.showMessageBox( 'Max Quantity 99!', 'ok');\n\t\t\tChatBox.addText( 'Max Quantity 99!', ChatBox.TYPE.ERROR);\n\t\t\treturn;\n\t\t}\n\n\t\tif(typeof itemCart === 'undefined'){\n\t\t\titem.amount = 1;\n\t\t\titem.tab = tab;\n\t\t\tCashShop.cartItem.push(item);\n\t\t\thtml = `<li class=\"item\" data-index=\"${itemId}\">\n\t\t\t\t\t<div class=\"inner-item-dt\">\n\t\t\t\t\t\t<div class=\"delete-item\"><button>x</button></div>\n\t\t\t\t\t\t<div class=\"item-dt-img\"></div>\n\t\t\t\t\t\t<div class=\"item-dt-desc\">\n\t\t\t\t\t\t\t<div class=\"item-desc-top\">${it.identifiedDisplayName}</div>\n\t\t\t\t\t\t\t<div class=\"item-counter\">\n\t\t\t\t\t\t\t\t<div class=\"item-cnt\">${item.amount}</div>\n\t\t\t\t\t\t\t\t<button class=\"counter-btn item-cnt-up\" data-index=\"up\"></button>\n\t\t\t\t\t\t\t\t<button class=\"counter-btn item-cnt-down\" data-index=\"down\"></button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"item-desc-price\">\n\t\t\t\t\t\t\t\t<div class=\"icon-gold-coin\"></div>\n\t\t\t\t\t\t\t\t<span>${item.price}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>`;\n\t\t\tcontent.find('.items').append(html);\n\t\t\tClient.loadFile( DB.INTERFACE_PATH + 'collection/' + ( it.identifiedResourceName ) + '.bmp', function(data){\n\t\t\t\tcontent.find('.item[data-index=\"'+ itemId +'\"] .item-dt-img').css('backgroundImage', 'url('+ data +')');\n\t\t\t});\n\n\t\t\tClient.loadFile( DB.INTERFACE_PATH + 'cashshop/img_shop_itemBg2.bmp', function(data){\n\t\t\t\tcontent.find('.item-counter').css('backgroundImage', 'url('+ data +')');\n\t\t\t});\n\t\t} else {\n\t\t\titemCart.amount += 1;\n\t\t\tcontent.find('.items .item[data-index=\"'+itemId+'\"] .item-cnt').html(itemCart.amount);\n\t\t}\n\t\tCashShop.cartItemTotalPrice = CashShop.cartItem.map(item => item.price * item.amount).reduce((prev, next) => prev + next);\n\t\tCashShop.ui.find('.container-cart-footer .item-desc-price span').html(CashShop.cartItemTotalPrice);\n\t}", "function editedCartItem(msg) {\n header('CART EDITED', msg);\n console.log();\n console.log(\"1.\", \"View cart\");\n console.log(\"2.\", \"Add item to cart\");\n console.log(\"3.\", \"Remove item from cart\");\n console.log(\"4.\", \"View products\");\n console.log(\"5.\", \"Checkout\");\n console.log(\"6.\", \"Go to Home\");\n console.log();\n console.log('-------------------------------------------------------------------------'.red);\n prompt.question(\"Please Select an option \", (opt) => {\n if (opt == 1) {\n displayCart('');\n } else if (opt == 2) {\n addToCart('');\n } else if (opt == 3) {\n removeFromCart('');\n } else if (opt == 4) {\n displayProducts('');\n } else if (opt == 5) {\n checkout('');\n } else if (opt == 6) {\n home('');\n } else {\n editedCartItem(\"PLEASE ENTER A VALID INPUT\".cyan)\n }\n });\n}", "function plusItem() {\n const productId = this.name;\n const cartList = JSON.parse(sessionStorage.getItem(\"shoppingCartItems\"));\n const item = cartList.find(product => product.id == productId);\n cartList.push(item);\n sessionStorage.setItem(\"shoppingCartItems\", JSON.stringify(cartList));\n shoppingCartCount();\n populateShoppingCartPage();\n}", "function displayItems() {\n\n// query the database for all items available for purchase\n connection.query(\"SELECT item_id, product_name, price FROM products\", function(err, res) {\n if (err) throw err;\n console.log(\"Items available for sale\");\n for(var i = 0; i < res.length; i++) {\n \tconsole.log(\"Item ID: \" + res[i].item_id + \" | Product Name: \" + res[i].product_name + \" | Price: \" + res[i].price);\n }\n inquirer.prompt([\n\n \t// Here we create a basic text prompt.\n \t{\n type: \"input\",\n name: \"id\",\n message: \"What is the id of the item you would like to buy?\"\n\n \t},\n\n {\n type: \"input\",\n name: \"quantity\",\n message: \"How many units would you like to buy?\"\n\n \t}\n\n //Storing all of the answers into an \"answers\" object that inquirer makes for us.\n ]).then(function (answer) {\n var quantity = answer.quantity;\n var itemId = answer.id;\n connection.query('SELECT * FROM products WHERE item_id=' + itemId, function(err, selectedItem) {\n \tif (err) throw err;\n if (selectedItem[0].stock_quantity - quantity >= 0) {\n var chargedPrice = answer.quantity * selectedItem[0].price;\n console.log('Thank you for your purchase. Your total is $'+ chargedPrice);\n\n connection.query('UPDATE products SET stock_quantity=? WHERE item_id=?', [selectedItem[0].stock_quantity - quantity, itemId],\n function(err, res) {\n \tif (err) throw err;\n // Runs the prompt again, so the user can keep shopping.\n displayItems();\n }); // Ends the code to remove item from inventory.\n\n }\n\n else {\n console.log(\"Insufficient quantity!\");\n displayItems();\n }\n });\n });\n });\n }", "function start() {\n\n \n inquirer.prompt([\n\n {\n\n name : \"productId\",\n type : \"input\",\n message :chalk.inverse.cyan(\"select id of the product that you would like to buy?\"),\n validate: function(value) {\n if (isNaN(value) === false) {\n return true;\n }\n return false;\n }\n },\n \n {\n name : \"quantity\",\n type : \"input\",\n message : chalk.inverse.yellow(\" how many units of the product you would like to buy?\"),\n validate: function(value) {\n if (isNaN(value) === false) {\n return true;\n }\n return false;\n }\n }\n \n\n ])\n\n .then(function(response){\n\n\n const itemId = response.productId;\n const quantityProduct = response.quantity;\n\n const query = \"select * from products where ?\";\n\n connection.query(\n\n query,\n \n { id: itemId },\n \n function (err, res) {\n \n if (err) throw err;\n\n const data = res.map ((products)=> [products.id, products.product_name, products.department_name, products.price, products.stock_quantity])\n\n let chosenItem ;\n\n for (let i = 0; i < res.length; i++ ) {\n\n if ( res[i].id === parseInt(itemId) ) {\n\n chosenItem = res[i];\n \n }\n \n }\n \n \n if (chosenItem.stock_quantity < parseInt(quantityProduct)) {\n\n console.log(`\\n \\n ooppss! so sorry there is not enough quantity of ${chosenItem.product_name}`)\n \n displayItems()\n \n } else {\n\n const query = \"update products set ? where ?\"\n connection.query (\n\n query,\n [\n \n {stock_quantity : (parseInt(chosenItem.stock_quantity) - parseInt(quantityProduct))} ,\n\n {id : itemId}\n ],\n\n function(err) {\n\n if (err) throw err;\n \n let totalPrice = parseInt(chosenItem.price) * parseInt(quantityProduct)\n console.log(chalk.magenta.inverse(`\\n YOUR TOTAL IS : ${totalPrice}\n \\n YOUR PURCHASED : ${chosenItem.product_name}` + `\\n ${quantityProduct}`))\n\n displayItems()\n }\n )\n }\n })\n\n })\n\n}", "function identifyItem() {\n console.log(\"Selecting all products...\\n\");\n connection.query(\"SELECT * FROM products\", function (err, res) {\n //displays all te products\n var choices = displayAll(res);\n //var itemList = res.length attempted to use fo validate;\n //var answer;\n if (err) throw err;\n inquirer\n .prompt([{\n type: \"list\",\n name: \"stockOption\",\n message: \"Please select the item you would like to update the stock on\",\n choices: choices\n\n\n },\n {\n type: \"number\",\n name: \"stockAdded\",\n message: \"How many would you like to add?\",\n validate: validateNumber\n }\n\n\n\n ])\n .then(function (answer) {\n var chosenItemID = choices.indexOf(answer.stockOption) + 1;\n for (var i = 0; i < res.length; i++) {\n if (res[i].item_id == chosenItemID) {\n chosenItem = res[i];\n }\n }\n \n\n updateInventory(answer);\n\n\n });\n\n });\n\n}", "function buyProducts(id, quantity)\n {\n connection.query(\"SELECT * FROM products WHERE item_id = \"+id,\n function(err, res) \n {\n if (err) throw err;\n if(quantity > res[0].stock_quantity)\n {\n console.log(\"Quantity Requested: \"+quantity);\n console.log(\"Quantity In Stock: \"+res[0].stock_quantity);\n console.log(\"SORRY! We don't have enough to fill your order\");\n connection.end();\n }\n else\n {\n var inventory = parseInt(res[0].stock_quantity) - quantity;\n var newid = res[0].item_id;\n var newname = res[0].product_name;\n console.log(\"Product name: \"+newname+ \" , Product ID: \"+newid);\n\n console.log(\"Stock Inventory BEFORE your Purchase: \"+res[0].stock_quantity);\n console.log(\"Units you are purchasing: \"+quantity);\n console.log(\"Stock Inventory AFTER your Purchase: \"+inventory);\n updateQuantity(res[0].stock_quantity, newid, inventory );\n priceIt(quantity, res[0].price);\n } \n });\n }", "function addToCart(item) {\n var newItem = {}; // this object contains the item name and price.\n\n var newItem = {\n itemName: item,\n itemPrice: Math.floor(Math.random()*100)\n }\n //newItem.itemName = item;\n //newItem.itemPrice = Math.floor(Math.random()*100)\n cart.push(newItem); // it was pop(newItem)\n return `${newItem.itemName} has been added to your cart.`\n}", "function showItems()\n{\n var itemArray = [];\n console.log('\\033c');\n console.log(\"bAmazon Customer Ordering System\\n\".bold.inverse);\n\n connection.query(\"SELECT * FROM products ORDER BY dept_name, product_name\", function(error, response) \n {\n if (error) \n throw error;\n\n // console.log(response);\n \n for (var i=0; i < response.length; i++)\n {\n // Need to show ID, name and price\n itemArray.push(i+1 + \". \" + response[i].item_id + \" - \" + response[i].product_name + \" - $\" + response[i].price);\n }\n\n inquirer.prompt([\n {\n pageSize: 20,\n type: \"list\",\n name: \"stuff\",\n message: \"What would you like to purchase? \",\n choices: itemArray\n }\n ]).then(function(answer) \n {\n // Now we process it\n // console.log(\"Picked \", answer.stuff);\n\n inquirer.prompt([\n {\n name: \"quantity\",\n message: \"Quantity to purchase? \",\n validate: function validateQty(name)\n {\n var reg = /^\\d+$/;\n return reg.test(name) || \"Quantity should be a whole number!\";\n }\n },\n {\n type: \"confirm\",\n message: \"\\nAre you sure: \",\n name: \"confirm\",\n default: true\n }\n ]).then(function(qtyresponse) \n {\n if (qtyresponse.confirm)\n {\n // Find this item again\n // console.log(\"Answer \", answer,\"Quantity \", qtyresponse.quantity);\n processItem(qtyresponse.quantity, answer, response);\n } \n else\n loopIt();\n });\n });\n });\n}", "function addOneItemToCart() {\n var itemID = $(this).attr(\"id\");\n var positionInCart = itemID.slice(12, itemID.length);\n cartItems[positionInCart][3] += 1;\n updateCartDetails();\n}", "function addInventory(){\n\tconsole.log(\"Take a look! Products are listed as ID#) ITEM | QUANTITY(#)\");\n\n\tvar ids = [];\n\n\t// Query: Read information from the products table\n\tconnection.query(\"SELECT * FROM products\", function(itemsErr, itemsRes){\n\t\tif (itemsErr) throw itemsErr;\n\n\t\tfor (var k = 0; k < itemsRes.length; k++){\n\t\t\tvar itemsDisplay = itemsRes[k].item_id + \") \" + itemsRes[k].product_name + \" | quantity: \" + itemsRes[k].stock_quantity;\n\t\t\tids.push(itemsRes[k].item_id);\n\t\t\tconsole.log(itemsDisplay);\n\t\t}\n\n\t\t// Prompt user to select an item by id and to enter the units they want\n\t\t// to add to the stock\n\t\tinquirer.prompt([{\n\t\t\ttype: \"input\",\n\t\t\tmessage: \"Enter the id of the product you want to stock: \",\n\t\t\tname: \"itemEntered\",\n\t\t\tvalidate: function(value){\n\t\t\t\t// If the entry is a product that is listed...\n\t\t\t\tif (ids.indexOf(parseInt(value)) > -1) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},{\n\t\t\ttype: \"input\",\n\t\t\tmessage: \"Enter the number of units you want to stock: \",\n\t\t\tname: \"quantityEntered\",\n\t\t\tvalidate: function(stock){\n\t\t\t\t// If the entry is a number and an integer...\n\t\t\t\tif (isNaN(stock) === false && Number.isInteger(Number(stock)) === true) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}]).then(function(selectionAnswers){\n\t\t\tvar product = parseInt(selectionAnswers.itemEntered);\n\t\t\tvar quantity = parseInt(selectionAnswers.quantityEntered);\n\t\t\tvar chosenItem;\n\n\t\t\t// Match user's selection to product from the bamazon table\n\t\t\tfor (var l = 0; l < itemsRes.length; l++) {\n\t\t\t\tif (product === itemsRes[l].item_id) {\n\t\t\t\t\tchosenItem = itemsRes[l];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// New quantity reflecting stock added\n\t\t\tvar updatedQuantity = quantity + chosenItem.stock_quantity;\n\n\t\t\t// Query: Updates the stock_quantity to reflect the stock changes\n\t\t\tconnection.query(\"UPDATE products SET ? WHERE ?\", [{\n\t\t\t\tstock_quantity: updatedQuantity\n\t\t\t},{\n\t\t\t\titem_id: chosenItem.item_id\n\t\t\t}], function(addStockErr, addStockRes){\n\t\t\t\tif (addStockErr) throw addStockErr;\n\n\t\t\t\tconsole.log(quantity + \" unit(s) was added to \" + chosenItem.product_name);\n\n\t\t\t\t// Asks user if they want to continue adding inventory or return\n\t\t\t\t// to Main Menu\n\t\t\t\tinquirer.prompt([{\n\t\t\t\t\ttype: \"confirm\",\n\t\t\t\t\tname: \"restartAddStock\",\n\t\t\t\t\tmessage: \"Would you like to continue adding inventory?\"\n\t\t\t\t}]).then(function(restartStock){\n\t\t\t\t\tif (restartStock.restartAddStock === true) {\n\t\t\t\t\t\taddInventory();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\trestartMenu(); \n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t});\n}", "function buyItem(e) {\n\te.preventDefault();\n\n\t// find item was added\n\tif (e.target.classList.contains('add-to-cart')) {\n\t\tconst item = e.target.parentElement.parentElement.parentElement;\n\n\t\t// get item info\n\t\tgetItemInfo(item);\n\t}\n}", "function displayItem (item, id) {\r\n // get the cart items div\r\n const cartItemsDiv = document.getElementById('cartItems')\r\n\r\n // create a row div\r\n const divRow = document.createElement('div')\r\n divRow.setAttribute('class', 'col-10 item row')\r\n\r\n // create a div for the item image\r\n const divImg = document.createElement('div')\r\n divImg.setAttribute('class', 'col-2')\r\n\r\n // create the image for the item\r\n const img = document.createElement('img')\r\n img.setAttribute('src', item.image)\r\n img.setAttribute('height', '150px')\r\n\r\n // add the image to the image div\r\n divImg.appendChild(img)\r\n\r\n // create a details div\r\n const divDetails = document.createElement('div')\r\n divDetails.setAttribute('class', 'col-6')\r\n\r\n // create a h4 element for the card-title = item name\r\n const nameH4 = document.createElement('h4')\r\n nameH4.innerHTML = item.name\r\n\r\n // create a p lement for the item type and number of avaiable colours\r\n const descriptionP = document.createElement('p')\r\n descriptionP.innerHTML = item.type + ' (' + item.numberOfColours + ')'\r\n\r\n // create a p lement for the item price\r\n const priceP = document.createElement('p')\r\n priceP.setAttribute('id', 'price' + id)\r\n priceP.innerHTML = 'R ' + item.price\r\n\r\n // add the details (name, description and price) to the details div\r\n divDetails.appendChild(nameH4)\r\n divDetails.appendChild(descriptionP)\r\n divDetails.appendChild(priceP)\r\n\r\n // create a price div\r\n const divPrice = document.createElement('div')\r\n divPrice.setAttribute('class', 'col-2')\r\n\r\n // create a lable for the Qualtity input field\r\n const lable = document.createElement('lable')\r\n lable.setAttribute('for', '#quantity' + id)\r\n lable.innerHTML = 'Quantity'\r\n\r\n // create an imput number field for the quantity\r\n const quantityInput = document.createElement('input')\r\n quantityInput.setAttribute('type', 'number')\r\n quantityInput.setAttribute('name', 'quantity')\r\n quantityInput.setAttribute('id', 'quantity' + id)\r\n quantityInput.setAttribute('placeholder', '1') // defult value\r\n quantityInput.setAttribute('onchange', 'handleQuantityChange(this)') // onchange handle function\r\n\r\n // create a h5 element for the price text(lable)\r\n const priceLable = document.createElement('h5')\r\n priceLable.innerHTML = 'Price : R '\r\n\r\n // create a span for the price display field\r\n const price = document.createElement('span')\r\n price.setAttribute('id', 'pricetag' + id)\r\n price.setAttribute('class', 'price')\r\n price.innerHTML = item.price\r\n\r\n // add the price display field to the lable\r\n priceLable.appendChild(price)\r\n\r\n // create a remove from cart button\r\n const removeButton = document.createElement('button')\r\n removeButton.setAttribute('class', 'btn btn-outline-secondary')\r\n removeButton.setAttribute('onclick', 'removeFromCart(this)') // function handler on click\r\n removeButton.setAttribute('id', id)\r\n\r\n // create a trash icon for the remove-button\r\n const trashIcon = document.createElement('i')\r\n trashIcon.setAttribute('class', 'fas fa-trash-alt')\r\n trashIcon.innerHTML = 'Remove'\r\n\r\n // add the icon to the button\r\n removeButton.appendChild(trashIcon)\r\n\r\n // add ellements to the price div\r\n divPrice.appendChild(lable)\r\n divPrice.appendChild(quantityInput)\r\n divPrice.appendChild(priceLable)\r\n divPrice.appendChild(removeButton)\r\n\r\n // add all the item's details (image, details and price) to a row div\r\n divRow.appendChild(divImg)\r\n divRow.appendChild(divDetails)\r\n divRow.appendChild(divPrice)\r\n\r\n // and the row div to the cart items div\r\n cartItemsDiv.appendChild(divRow)\r\n}", "function promptCustomerForItem(inventory) {\n\t// Prompts user for what they would like to purchase\n\tinquirer\n\t .prompt([\n\t\t{\n\t\t type: \"input\",\n\t\t name: \"choice\",\n\t\t message: \"What is the ID of the item you would you like to purchase? [Quit with Q]\",\n\t\t validate: function(val) {\n\t\t\treturn !isNaN(val) || val.toLowerCase() === \"q\";\n\t\t }\n\t\t}\n\t ])\n\t .then(function(val) {\n\t\t// Check if the user wants to quit the program\n\t\tcheckIfShouldExit(val.choice);\n\t\tvar choiceId = parseInt(val.choice);\n\t\tvar product = checkInventory(choiceId, inventory);\n \n\t\t// If there is a product with the id the user chose, prompt the customer for a desired quantity\n\t\tif (product) {\n\t\t // Pass the chosen product to promptCustomerForQuantity\n\t\t promptCustomerForQuantity(product);\n\t\t}\n\t\telse {\n\t\t // Otherwise let them know the item is not in the inventory, re-run loadProducts\n\t\t console.log(\"\\nThat item is not in the inventory.\");\n\t\t displayProducts();\n\t\t}\n\t });\n }", "function addItemToCart(cartID, productID) {\n document.getElementById(\"message\"+productID).innerHTML = \"Adding...\";\n $.ajax({\n type: \"GET\",\n url: '../include/getPackageItems.php?action=addToCart&cartID='+cartID+'&productID='+productID,\n success: function (data) {\n document.getElementById(\"message\"+productID).innerHTML = \"Added to cart\";\n },\n failure: function(data) {\n document.getElementById(\"message\"+productID).innerHTML = \"Add to cart failed\";\n }\n });\n}", "function contShopping() {\n inquirer.prompt([\n {\n type: \"confirm\",\n message: \"Do you want to continue shopping?\",\n name: \"id\",\n\n }\n\n ])\n .then(function (cont) {\n\n if (cont.id === true) {\n readProducts();\n }\n else {\n console.log(\"Have a good day!\");\n connection.end();\n }\n })\n}", "function addItem(id) {\n // clear sessionStorage\n // sessionStorage.clear();\n\n // check to see if a cart key exisits in sessionStorage\n // if it does, set a local cart variable to work with the parsed string\n // if it does not exist, set an empty array\n if (sessionStorage.getItem('cart')) {\n var cart = JSON.parse(sessionStorage.getItem('cart'));\n }\n else {\n var cart = [];\n }\n\n // send a response to products.json and create a callback that loops through the products and checks the product id\n // if the product id in the current iteration is the same as the id being taken in as the parameter, then push it to the cart.\n for (let product in products) {\n if (id == products[product].id) {\n cart.push(products[product]);\n break;\n }\n }\n\n // store to sessionStorage\n sessionStorage.setItem('cart', JSON.stringify(cart));\n\n showCart();\n}", "function buyThis(){\n inqurier.prompt([\n {\n message: \"What is the ITEM ID of the PRODUCT you would like to buy?\",\n name: \"id\"\n },\n { \n message: \"How many UNITS would you like to buy?\",\n name: \"purchase\",\n },\n ]).then(function(answer){\n //convert to integers\n var id = parseInt(answer.id);\n var quantity = parseInt(answer.purchase)\n\n //purcahse logic\n\n if (isNaN(answer.id) == true || id <=0 || id > resultArray.length) {\n //error message for invalid number entry \n console.log(\"Error: INVALID ITEM ID\")\n }\n else if (isNan(answer.purcahse) == true || quantity <= 0){\n //error for purchasing zero items\n console.log(\"You must order more than one\")\n }\n else if (quantity > resultArray[id -1].stock_quantity){\n //error for not enough stock \n console.log(\"WE ARE OUT OF THAT\")\n }\n else {\n //for a sucessful order\n purchaes.push(resultArray[id - 1].product_name);\n amounts.push(quantity);\n\n //total of curent order and total order\n var orderCost = quantity * resultArray[id-1].price;\n orderCost = parseFloat(orderCost.toFixed(2));\n total += orderCost;\n total = parseFloat(total.toFixed(2))\n\n sales = resultArray[id - 1].product_sales + orderCost;\n\n console.log(\"You have selected ITEM\" + id + \",\" + resultArray[id - 1].product_name + \".\" )\n console.log(\"This item costs $\" + resultArray[id - 1].price + \" per unit. You have ordered \" + quantity + \" units.\");\n console.log(\"This purchase costs $\" + orderCost + \".\");\n \n //display quantites and ordered as well as cost\n console.log(\"YOU HAVE ORDERED\")\n for (var i = 0; i < purchaes.length; i++){\n console.log(amounts[i] + \"|\" + purchaes[i]);\n }\n console.log(\"mYour total cost is \" + total + \".\");\n\n\t\t\t// query to update the database\n\t\t\tupdate = \"UPDATE products SET stock_quantity = \" + (resultArray[id - 1].stock_quantity - quantity) + \", product_sales = \" + sales + \" WHERE item_id = \" + id;\n\n\t\t\t// updates the database\n\t\t\tconnection.query(update, function (error, results, fields) {\n\t\t\t\tif (error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t};\n });\n keepGoing();\n }\n })\n}", "function buy() {\n // query the database for all items\n connection.query(\"SELECT * FROM products\", function(err, results) {\n if (err) throw err;\n // once you have the items, prompt the user for which they'd like to buy\n inquirer\n .prompt([\n {\n name: \"choice\",\n type: \"input\",\n message: \"Please input the ID# of the product you want to buy?\".bgGreen.white\n },\n {\n name: \"amount\",\n type: \"input\",\n message: \"How many would you like to buy?\".bgGreen.white\n }\n ])\n .then(function(input) {\n // get the information of the chosen item\n var item = input.choice;\n var quantity = input.amount;\n\n // Query db to confirm that the given item ID exists in the desired quantity\n var queryStr = 'SELECT * FROM products WHERE ?';\n\n connection.query(queryStr, {item_id: item}, function(err, data) {\n if (err) throw err;\n\n // If the user has selected an invalid item ID, data attay will be empty\n\n if (data.length === 0) {\n console.log('ERROR: Invalid Item ID. Please select a valid Item ID.'.bgCyan.white);\n buy();\n }\n \n else {\n var productData = data[0];\n\n // If the quantity requested by the user is in stock\n if (quantity <= productData.stock_quantity) {\n console.log(' '.bgGreen.white);\n console.log(' Congratulations, the product you requested is in stock! Placing order! '.bgGreen.white);\n console.log(' '.bgGreen.white);\n // Construct the updating query string\n var updateQueryStr = 'UPDATE products SET stock_quantity = ' + (productData.stock_quantity - quantity) + ' WHERE item_id = ' + item;\n // console.log('updateQueryStr = ' + updateQueryStr);\n\n // Update the inventory\n connection.query(updateQueryStr, function(err, data) {\n if (err) throw err;\n console.log('\\n Your total is: $' + productData.price * quantity);\n console.log(' ');\n console.log(\" \".bgMagenta.white)\n console.log(\" Thanks for shopping with Bamazon. \".bgMagenta.white)\n console.log(\" \".bgMagenta.white)\n // End the database connection\n connection.end();\n })\n } \n\n else {\n console.log(' '.bgRed.white);\n console.log(' That item is out of stock :( '.bgRed.white);\n console.log(' '.bgRed.white);\n console.log(' '.bgGreen.white);\n console.log(' Would you like to buy something else? '.bgGreen.white);\n console.log(' '.bgGreen.white);\n buy();\n }\n }\n })\n })\n\t\t\n });\n}", "function requestProduct() {\n inquirer.\n prompt([{\n name: \"productID\",\n type: \"input\",\n message: \"What product would you like to buy? (Enter Product ID #)\",\n validate: validateInput,\n filter: Number\n }, {\n name: \"productUnits\",\n type: \"input\",\n message: \"How many units would you like to buy?\",\n validate: validateInput,\n filter: Number\n\n }]).then(function (input) {\n completePurchase(input);\n\n });\n}", "function addSelectedItemToCart() {\n // TODO: suss out the item picked from the select list\n // TODO: get the quantity\n // TODO: using those, add one item to the Cart\n const product = selectElement.options[selectElement.selectedIndex].text;\n const quantity = parseInt(document.getElementById('quantity').value);\n cart.addItem(product, quantity);\n}", "function purchase() {\n inquirer\n .prompt([\n {\n type: \"input\",\n name: \"itemID\",\n message: \"What is the ID of the item you would like to purchase?\",\n validate: function(value) {\n if (isNaN(value) === false && value !== '' && parseInt(value) > 0) {\n return true;\n } else {\n console.log(\"\\nPlease enter a valid ID.\");\n return false;\n }\n }\n },\n {\n type: \"input\",\n name: \"itemQuantity\",\n message: \"How many would you like?\",\n validate: function(value) {\n if (isNaN(value) === false && value !== '' && parseInt(value) > 0) {\n return true;\n } else {\n console.log(\"\\nPlease enter a valid quantity.\");\n return false;\n }\n }\n }\n ])\n .then(function(choice) {\n //console.log(\"User's choice: \", choice);\n\n var currentItem = currentInventory.filter(\n item => item.id === parseInt(choice.itemID)\n );\n \n // Above function if written in longer form\n // var currentItem = currentInventory.filter(function(item) {\n // return item.id === parseInt(choice.itemID);\n // });\n\n //console.log(\"currentItem\", currentItem);\n //console.log(\"choice.itemQuantity\", parseInt(choice.itemQuantity));\n //console.log(\"currentItem.stock_quantity\", currentItem[0].stock_quantity);\n \n // if item ID given by the customer does NOT match the ID in the 'products' table\n if (currentItem.length == 0) {\n console.log(\"Sorry that item doesn't exist\");\n // ask customer if they want to move onto a different purchase\n confirmNextPurchase();\n\n //if item ID given by the customer DOES match the ID in the 'products' table\n } else {\n // If the quantity requested is LESS THAN OR EQUAL to the stock quantity\n if (parseInt(choice.itemQuantity) <= currentItem[0].stock_quantity) {\n //fulfill order\n //console.log(\"Enough quantity\");\n console.log(\"You have picked \" + choice.itemQuantity + \" of the \" + currentItem[0].product_name + \".\")\n var cost = parseInt(choice.itemQuantity) * currentItem[0].price;\n console.log(\"Please pay the total of $\" + cost + \" before moving onto the next purchase!\")\n \n // Check if the customer paid\n paidOrUnpaid( function(isPaid) {\n if(isPaid){\n // ONLY update the inventory (aka the 'products' table) if the customer has PAID\n\n //console.log('isPaid working');\n var updatedStock = currentItem[0].stock_quantity - choice.itemQuantity;\n //console.log(\"updatedStock\", updatedStock);\n\n // UPDATE the 'stock_quantity' in the 'products' table using the product ID chosen by the customer after the purchase\n updateInventory(parseInt(choice.itemID), updatedStock);\n confirmNextPurchase();\n // Ends connection if the amount is NOT PAID\n } else {\n console.log(\"The amount is not paid.\");\n connection.end();\n }\n });\n // If the quantity requested is GREATER THAN the stock quantity\n } else {\n // Alert customer about the quantity left\n console.log(\"Insufficient quantity!\");\n console.log(\"We only have \" + currentItem[0].stock_quantity + \" of the \" + currentItem[0].product_name + \" left.\")\n // Ask if customer would like to move onto a new purchase\n confirmNextPurchase();\n }\n }\n });\n}", "addToShoppingCart(productId) {\n\n var self = this;\n\n ShoppingCartService.addShoppingCartProduct(self.state.currentUser.id,productId,1)\n .then(function (product) {\n\n //call added to shopping cart notification\n self.showNotification();\n\n })\n .catch(function (error) {\n\n console.error(error);\n\n })\n\n }", "function promptUser() {\n\n\tinquirer.prompt([\n\t\t{\n\t\t\ttype: 'input',\n\t\t\tname: 'item_id',\n\t\t\tmessage: 'Please enter the Item ID of the item you wish to purchase',\n\t\t\tvalidate: validateInput,\n\t\t\tfilter: Number\n\t\t},\n\t\t{\n\t\t\ttype: 'input',\n\t\t\tname: 'quantity',\n\t\t\tmessage: 'Please enter quantity',\n\t\t\tvalidate: validateInput,\n\t\t\tfilter: Number\n }\n ])\n .then(function(input) {\n\n var item = input.item_id;\n\t\tvar quantity = input.quantity;\n\n var check_db = 'SELECT * FROM products WHERE ?';\n\n connection.query(check_db, {item_id: item}, function(err, data) {\n if (err) throw err;\n \n if (data.length === 0) {\n\t\t\t\tconsole.log('Invalid Item ID. Please select a valid Item ID.');\n\t\t\t\tproductList();\n\n\t\t\t} else {\n var productData = data[0];\n \n if (quantity <= productData.stock_quantity) {\n\n var update_db = 'UPDATE products SET stock_quantity = ' + (productData.stock_quantity - quantity) + ' WHERE item_id = ' + item;\n\n\n connection.query(update_db, function(err, data) {\n\t\t\t\t\t\tif (err) throw err;\n\n console.log('Your total is $' + productData.price * quantity);\n console.log('Thank you for shopping with us!');\n\t\t\t\t// End the database connection\n //connection.end();\n productList();\n\t\t\t\t\t})\n\t\t\t\t} else {\n console.log('Sorry, the quantity you requested is not in stock.')\n console.log('Please modify your search and try again')\n\t\t\t\t\tproductList();\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t})\n}", "function onSelectedItemClicked(e) {\r\n checkForSuccessfulPurchase();\r\n\r\n\r\n var item = $(this);\r\n var idForUser = item.data('idforuser');\r\n var idForServer = item.data('idforserver');\r\n\r\n var itemIdDisplay = $('#itemIdDisplay');\r\n if (itemIdDisplay.val() != idForUser) {\r\n $('#messagesDisplay').val(\"\");\r\n }\r\n\r\n itemIdDisplay.val(idForUser);\r\n itemIdDisplay.data('idforserver', idForServer);\r\n}", "function start() {\n inquirer.prompt([ \n {\n name: \"ID\",\n type: \"input\",\n message: \"What item would you like to by?\", \n filter:Number\n },\n {\n name:\"Quantity\",\n\t\ttype:\"input\",\n\t\tmessage:\"How many items do you wish to purchase?\",\n\t\tfilter:Number\n\t},\n\n ]).then(function(answers){\n \tvar quantityNeeded = answers.Quantity;\n \tvar IDrequested = answers.ID;\n \tpurchaseOrder(IDrequested, quantityNeeded);\n });\n}", "function updateQuantity (Ith,user,item) {\n\tvar newQty = prompt(Ith+\" Enter new quantity\", \"1\");\n\n\tif (user.length == 0) { \n\t\talert(\"ERROR: Invalid user!\");\n\t\treturn;\n\t} else {\n\t\tvar xmlhttp = new XMLHttpRequest();\n\t\txmlhttp.onreadystatechange = function() {\n\t\t\tif (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n\t\t\t\tdocument.getElementById(\"eachQ\"+Ith).innerHTML = \"x \"+newQty;\n\t\t\t}\n\t\t};\n\n\t\txmlhttp.open(\"GET\", \"cartUpdate.php?q=\" + newQty +\"&u=\"+ user +\"&i=\"+ item , true);\n\t\txmlhttp.send();\n\t}\n\twindow.location.replace('shoppingCart.php');\n}", "function addToCart(msg) {\n header('ADD CART ITEM', msg);\n\n var table = new Table({\n chars: {\n 'top': '═', 'top-mid': '╤', 'top-left': '╔', 'top-right': '╗',\n 'bottom': '═', 'bottom-mid': '╧', 'bottom-left': '╚', 'bottom-right': '╝',\n 'left': '|', 'left-mid': '╟', 'mid': '-', 'mid-mid': '┼',\n 'right': '|', 'right-mid': '╢', 'middle': '│',\n },\n head: [\"Id\", \"Name\", \"Price ($)\"],\n colWidths: [10, 30, 30]\n });\n products.forEach(e => {\n table.push(\n [e.id, e.name, e.price]\n );\n });\n console.log(table.toString());\n\n console.log();\n console.log('-------------------------------------------------------------------------'.red);\n\n // This is a class that an object that holds the id and quantity\n var name, qty, u_price, a_price; // the variable holding the name and the quantity\n var cartItem = { // An Object where the name and quantity are held as properties\n \"name\": name,\n \"qty\": qty, //The quantity the client wants \n \"unit_price\": u_price, // The unit price of the product\n \"accum_price\": a_price // The accumulated price of each product\n }\n\n function getId() { // Function that gets the it from the user. \n prompt.question(\"Enter product Id: \", (id) => {\n let i = parseInt(id);\n i = i - 1;\n if (i < (products.length ) && i > -1) {\n cartItem.name = products[i].name;\n cartItem.unit_price = products[i].price;\n getQty(i); // This function is called here so that the prompt will not exit\n } else {\n addToCart(\"SORRY, PRODUCT ID DOSEN'T EXIST\".cyan);\n }\n })\n }\n\n function getQty(i) { // This function gets gets the quantity of the product from the user. \n prompt.question(\"Enter product Quantity: \", (qty) => {\n let q = parseInt(qty)\n cartItem.qty = q;\n cartItem.accum_price = q * products[i].price;\n cart.push(cartItem); // This adds the cartItem object to the cart Array.\n let message = \"Added \\\"\" + products[i].name + \"\\\" to cart\";\n editedCartItem(message .cyan);\n })\n }\n\n getId(); // The Id is called here \n}", "function Buy_Prompt() {\n inquirer.prompt([\n // Here we create an input text prompt for getting the ITEM ID.\n {\n type: \"input\",\n message: \"Please enter the ID of the product you would like to buy.\",\n name: \"ITEM_ID\",\n filter: Number\n },\n // Here we create an input text prompt for getting the quantity the user wants to buy.\n {\n type: \"input\",\n message: \"How many items would you like to buy?\",\n name: \"BUY_QUANTITY\",\n filter: Number\n },\n ]).then(function (inquirerResponse) {\n var buyQuantity = inquirerResponse.BUY_QUANTITY;\n var item = inquirerResponse.ITEM_ID;\n customerOrder(item, buyQuantity);\n });\n}", "function selectItem() {\n connection.query(\"SELECT * FROM products\", function(err, results){\n if (err) throw err;\n inquirer \n .prompt([\n {\n name: \"choice\",\n type: \"input\",\n message: \"Which item_id would you like to choose?\"\n },\n {\n name: \"quantity\",\n type: \"input\",\n message: \"How many units of the product would you like to buy?\"\n },\n {\n type: \"confirm\",\n message: \"Are you sure you would like to select this item?\",\n name: \"confirmSelection\",\n default: true\n }\n ])\n .then(function(response) {\n // console.log(response)\n var query = \"SELECT * FROM products WHERE ?;\"\n connection.query(query, {item_id: response.choice}, function (err, data){\n if (err) throw (err);\n var available_stock = data[0].stock_quantity;\n // console.log(data);\n var price = data[0].price;\n var department = data[0].department_name;\n // checks to see if there's enough inventory for the user:\n if (available_stock >= response.quantity) {\n // console.log(\"We have enough inventory for you to purchase this item now!\")\n completePurchase(available_stock, price, response.productId, response.quantity);\n // If there is enough stock in the inventory, the purchase is completed.\n } else {\n // Otherwise, the user is told that there isn't enough stock in our store. :(\n console.log(\"Not enough stock\");\n // lets user pick a new product\n // start();\n // I may have to run \"selectItem() instead...\"\n }\n });\n });\n }); \n \n // This function completes the user's request to purchase the product.\nvar completePurchase = function(availableStock,price,selectedProductId,selectedProductStock) {\n\t// This variable updates stock quantity once the purchase complete.\n var updatedStockQuantity = availableStock - selectedProductStock;\n\t// Calculates total price for purchase based on unit price, and number of items in stock.\n var totalPrice = price * selectedProductStock;\n\t// Updates the stock quantity on the database based on user's purchase.\n var query = \"UPDATE products SET ? WHERE ?\"\n\tconnection.query(query, [{\n stock_quantity: updatedStockQuantity,\n\t}, {\n\t\titem_id: selectedProductId\n\n\t}], function(err, response) {\n\t\tif (err) throw err;\n\t\t// This tells the user that the purchase was a success.\n\t\tconsole.log(\"Your purchase is complete\");\n\t\t// This gives the user the total price for that specific purchase.\n console.log(\"There was a total price of $\" + totalPrice + \" on that transaction\");\n // This displays the updated stock quantity of the inventory\n console.log(\"There are now \" + updatedStockQuantity + \" of that item left in inventory\")\n });\n };\n}" ]
[ "0.7060397", "0.7060397", "0.7060397", "0.7060397", "0.7060397", "0.7060397", "0.70532393", "0.6922326", "0.6922326", "0.6891539", "0.681535", "0.67691576", "0.6713867", "0.6713709", "0.6709138", "0.66785085", "0.6658387", "0.662832", "0.66213024", "0.6586365", "0.65727323", "0.65635216", "0.65615076", "0.65275973", "0.6516836", "0.65117794", "0.6506236", "0.649433", "0.64900845", "0.6481808", "0.6481345", "0.6470794", "0.6465378", "0.6455935", "0.6451175", "0.644727", "0.64465815", "0.6419582", "0.64029986", "0.63910156", "0.6390369", "0.6389831", "0.63880754", "0.63771003", "0.63593173", "0.6354003", "0.6349275", "0.63398427", "0.633554", "0.633492", "0.6334187", "0.6325954", "0.63126373", "0.63029575", "0.63027614", "0.6295699", "0.62955034", "0.6291721", "0.62734187", "0.6272363", "0.6272242", "0.6267859", "0.62635064", "0.62554216", "0.62435865", "0.6238145", "0.6236823", "0.6234067", "0.62314314", "0.6224353", "0.6202762", "0.6201604", "0.6195838", "0.6192466", "0.6191494", "0.619119", "0.61854756", "0.6179435", "0.61762977", "0.61711895", "0.61645323", "0.6162571", "0.61582977", "0.6155289", "0.61518705", "0.6151276", "0.6148534", "0.61446834", "0.61442685", "0.61428356", "0.6140576", "0.6138674", "0.6135332", "0.6129019", "0.6128103", "0.61224216", "0.6117479", "0.6115676", "0.61149776", "0.6109082" ]
0.64394224
37
function to check if valid item
function checkIfItem() { // query bamazon DB for the entered item connection.query("SELECT id FROM products WHERE id=?", [itemToBuy], function (err, res) { if (err) throw err; // if itemToBuy exists in the databse, call howManyToBuy function else if (res[0].id == itemToBuy) { // call update Quantity function howManyToBuy(); } // if item does not exist in database, ask user to enter valid ID and go back to product list else { console.log(chalk.bgRed.yellow("Please enter a valid item ID!")); console.log('\n*******************'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isValid(item) {\n return typeof item === \"object\" \n && item.length === 2\n && Utils.isNumeric(item[0])\n && Utils.isNumeric(item[1]);\n }", "isValid() {\n return this.item.name.length > 0;\n }", "static isValidItem(item = TestQuestion.structure){\n try {\n const { question, explanation } = item;\n return (item && (\n question !== '' ||\n question !== null ||\n question !== undefined \n ) && (\n explanation !== '' ||\n explanation !== null ||\n explanation !== undefined \n ) && (\n TestChoice.isValidItems(item.choiceItems)\n )\n );\n } catch(error){\n return false;\n };\n }", "static isValidItems(items = [TestQuestion.structure]){\n return ((items && items.length > 0) &&\n items.every(item => TestQuestion.isValidItem(item))\n );\n }", "function validateSurveyItem(itemVal) {\n //todo Add code here\n }", "validateAnItem(item) {\n let errors = [];\n if (_.find(this.state.items, {sequenceName: item.sequenceName})) {\n errors.push(\"There's already a sequence with this name\");\n }\n if (_.find(this.state.items, {sequence: item.sequence})) {\n errors.push(\"There's already another entry for this sequence\");\n }\n if (item.sequenceName === \"\") {\n errors.push(\"Name is required\");\n }\n if (item.sequenceDescription === \"\") {\n errors.push(\"Description is required\");\n }\n if (item.sequence === \"\") {\n errors.push(\"Sequence is required\");\n } \n // We only need the first occurance of a non-allowed letter, so .search makes sense here\n let nonDNA = item[\"sequence\"].search(/[^ATCG]/g);\n if (nonDNA !== -1) {\n errors.push(`Non-DNA character found at position ${nonDNA}`);\n }\n return errors;\n }", "inputIsValid(data, required, item) {\n let value = this.getValueFromData(data);\n if (value === undefined && item && item.get(this.path)) {\n return true;\n }\n value = this.generateKey(value);\n return (value || !required) ? true : false;\n }", "function hasItem (item){\n\t\treturn true;\n}", "function checkName(item)\r\n{\r\n return item.name !== \"\"\r\n}", "function checkItem(a) {\n if (treasures[a] != null) {\n console.log(\"There's an item.\");\n return true;\n }\n else {\n console.log(\"There's not an item.\");\n return false;\n }\n}", "function validate(item) {\r\n if (!angular.isDefined(item))\r\n throw new Error('Menu item not defined.');\r\n if (!angular.isDefined(item.name))\r\n throw new Error('Menu item name not defined.');\r\n if (!angular.isDefined(item.order))\r\n item.order = 0; // order must exists\r\n // item ok\r\n return item;\r\n }", "function check(){\n\tif(input.value != \"\"){\n\t\tnew item(input.value);\n\t\tinput.value = \"\";\n\t}\n}", "function isAddMenuItemValid(){\r\n return(MenuItemNameField.isValid() && MenuItemDescField.isValid() && MenuItemValidFromField.isValid() && MenuItemPriceField.isValid() && MenuItemTypePerField.isValid());\r\n }", "validate(item) {\n let has_errors = false;\n const errors = {};\n if (!this.hasPermission(Models.Permissions.update) ||\n (!this.hasPermission(Models.Permissions.create) && (!item['uid'] || item['uid'] === 'new'))\n ) {\n errors['general'] = t(\"You do not have permission to edit this item\");\n has_errors = true;\n return errors;\n }\n for (const field_name in item) {\n if (!item.hasOwnProperty(field_name) || field_name === 'uid') continue;\n if (this.fieldsToValidate.length && this.fieldsToValidate.indexOf(field_name) === -1)\n continue;\n const error = this.validateItemField(field_name,item[field_name],item);\n if (error && error.length) {\n has_errors = true;\n errors[field_name] = error;\n }\n }\n return has_errors ? errors : null;\n }", "static validateMaterialNotBlank(pageClientAPI, dict) {\n\n let error = false;\n let message;\n\n //Not Text item\n if (!libThis.evalIsTextItem(pageClientAPI, dict)) {\n //Item is empty\n if (libThis.evalMaterialIsEmpty(dict)) {\n error = true;\n message = pageClientAPI.localizeText('field_is_required');\n }\n }\n if (error) {\n libCom.setInlineControlError(pageClientAPI, dict.MaterialLstPkr, message);\n dict.InlineErrorsExist = true;\n return Promise.reject(false);\n } else {\n return Promise.resolve(true);\n }\n }", "function CheckItemExist(itemData) {\n for (var i = 0, len = tw.animate.length; i < len; i++) {\n if (tw['animate'][i]['data']['$item'].is(itemData.$item))\n return true;\n }\n return false;\n }", "function isItemNullorUndefined(item,disable_console_log){\n // cc('isItemNullorUndefined: '+item,'run');\n cc('isItemNullorUndefined: ','run',disable_console_log)\n if (item == null || item == 'null' || item == undefined || item == 'undefined') {\n cc('ITEM is - '+item,'error');\n return true\n }else{\n cc('ITEM is not Null or Underfined','success');\n return false\n }\n}", "function checkItem(item,pattern){\n var val = item;\n return pattern.test(val);\n}", "hasItem(key: string) {\n return this.getItem(key) !== null;\n }", "hasItem(key: string) {\n return this.getItem(key) !== null;\n }", "_validate(items) {\n\t\t\titems.forEach(item => item.classList.remove('js-error'));\n\n\t\t\t// include filter function\n\t\t\titems.filter = Array.prototype.filter;\n\n\t\t\t// grab empty fields\n\t\t\tconst errors = items.filter(el => el.value == '');\n\n\t\t\tif (!errors.length)\n\t\t\t\treturn true;\n\n\t\t\terrors.forEach(item => item.classList.add('js-error'));\n\t\t\treturn false;\n\t\t}", "function isEditMenuItemValid(){\r\n return(EMenuItemNameField.isValid() && EMenuItemDescField.isValid() && EMenuItemValidFromField.isValid() && EMenuItemValidToField.isValid() && EMenuItemPriceField.isValid() && EMenuItemTypePerField.isValid());\r\n }", "hasItem() {\n return this.size > 0\n }", "function needsItemInfo(item) {\n return Util.notNull(item) &&\n (item.appid == '730') && Util.notNull(item.inspect_url) &&\n Util.isNull(item.paintwear) &&\n Util.notNull(item.name) && Util.notNull(item.market_hash_name) && (item.name !== item.market_hash_name);\n}", "validateItemField(field_name,field_value,item=null) {\n if (!field_value || typeof(field_value) === \"undefined\") {\n field_value = \"\";\n }\n if (typeof(this[\"validate_\"+field_name])===\"function\") {\n return this[\"validate_\"+field_name](field_value,item);\n }\n if (typeof(this.relationFields[field_name]) !== \"undefined\" && (\n this.relationFields[field_name].type === Models.RelationTypes.OneToMany ||\n this.relationFields[field_name].type === Models.RelationTypes.ManyToMany\n )) {\n return this.validateCollection(field_name,item);\n }\n return \"\";\n }", "function hasAtLeastOneItem(val) {\n return val.length >= 1;\n}", "validateList() {\n if (!this.isValid) {\n return;\n }\n\n for (let i = 0; i < this._data.length; i++) {\n const item = this._data[i];\n\n this._validateItem(item);\n }\n }", "function customItemQuantity(value) {\r\n if (!isNaN(value)) {\r\n quantityCheck = 0;\r\n return true;\r\n }\r\n else {\r\n quantityCheck++;\r\n\r\n }\r\n if (quantityCheck == 2) {\r\n throw new Error('You must buy atleast 1 item');\r\n }\r\n return true;\r\n}", "function isNotNull(item){\n return (item && item.label);\n }", "function checkIfItemIsEmpty(item) {\n if(item.trim().length == 0){\n return true;\n }\n else {\n return false;\n }\n}", "function testItem(item, allPropertiesRequireds) {\n const prepareToPropTest = Object.entries(allPropertiesRequireds);\n return prepareToPropTest.every(singleRequire => {\n const propertyNameInJSON = singleRequire[0];\n const singlePropValueRequired = singleRequire[1];\n if(singlePropValueRequired === '') return true; // pass if input field is blank\n const singlePropValue = item[propertyNameInJSON];\n return testSinglePropertyOfItem(singlePropValue, singlePropValueRequired);\n });\n}", "function validateItem(item) {\n // this removes undefined values from item.\n return _.merge({},item)\n}", "function check(item, eachItem) {\n for (let obj of item) {\n if (obj === eachItem) {\n return true;\n }\n }\n return false;\n}", "function check(){\n if(input.value != \"\"){\n new item(input.value);\n input.value = \"\";\n }\n}", "takeItem(item) {\n if (!item) return false;\n this.inventory.addItem(item);\n return true;\n }", "has(item) {\n if (this.isEmpty()) {\n return false\n } else {\n for (var i = 0; i < this.items.length; i++) {\n if (this.items[i] === item) {\n return true\n }\n }\n return false\n }\n }", "checkFilled() {\n if (\n this.state.item_id !== '' &&\n this.state.inventory_quantity !== '' &&\n this.state.cost_per_unit !== ''\n ) {\n console.log('true')\n return true\n } else {\n console.log('false')\n return false\n }\n }", "function validateRequest() {\n\n if ($scope.projectNumbers.indexOf($scope.request.projectNumber) < 0) {\n $scope.errorText = \"Invalid Project Number\";\n return false;\n }\n\n if ($scope.request.vendor.trim().length <= 0) {\n $scope.errorText = \"Vendor must not be empty\";\n return false;\n }\n\n if ($scope.request.URL.trim().length <= 0) {\n $scope.errorText = \"Vendor URL must not be empty\";\n return false;\n }\n\n for (var x = 0; x < $scope.request.items.length; x++) {\n var item = $scope.request.items[x];\n\n //no empty description\n if (!item.description || item.description.trim().length == 0) {\n $scope.errorText = \"Description should not be empty in item \" + (x+1);\n return false;\n }\n\n //no empty description\n if (!item.itemURL || item.itemURL.trim().length == 0) {\n $scope.errorText = \"Item URL should not be empty in item \" + (x+1);\n return false;\n }\n\n //no empty partNo\n if (!item.partNo || item.partNo.trim().length == 0) {\n $scope.errorText = \"Part number should not be empty in item \" + (x+1);\n return false;\n }\n\n //quantity must be integer\n if (!Number.isInteger(+item.quantity)) {\n $scope.errorText = \"Quantity should be an integer in item \" + (x+1);\n return false;\n }\n\n //unitCost must be at most 2 past the decimal\n if (!item.unitCost || Math.abs(Math.round(item.unitCost*100) - item.unitCost*100) >= .1) {\n $scope.errorText = \"Unit cost should be a dollar amount in item \" + (x+1);\n return false;\n }\n }\n\n $scope.errorText = \"\";\n return true;\n }", "_isValidIndex(index) {\n if (!this._items) {\n return true;\n }\n const tab = this._items ? this._items.toArray()[index] : null;\n return !!tab && !tab.disabled;\n }", "static async validateItem(product) {\n try {\n let specMap = new Map();\n product.AdditionProductSpectList.map(object => specMap.set(object.SpectName.replace(/\\./g,'').replace(/\\$/g, ''), object.SpectValue));\n const itemJSON = {\n name: product.Title + (\n !Array.isArray(product.TitleSupportList) ? \"\" :\n product.TitleSupportList\n .map(attr => attr.SpectValue ? `, ${attr.SpectValue}` : \"\")\n .join(\"\")\n ),\n upc: product.UPC_No,\n category_1: product.NavCategory,\n category_2: product.NaviSubSubCat,\n category_3: product.PrimaryNanoGroupDesc,\n brand: product.SubCategory,\n specifications: specMap,\n features: product.AdditionProductInfoList,\n wholesale_cost: product.Unit_Price,\n standard_price: Number((product.MSRP || product.MAPPrice || product.Unit_Price * 1.5).toFixed(2)),\n }\n\n console.log(itemJSON);\n await Item.validate(itemJSON);\n return itemJSON\n } catch (err) {\n console.log('err', err);\n throw err\n }\n }", "estavacio()\r\n{\r\n //regresa verdadero si la cola esta vacia\r\n return this.items.length == 0;\r\n}", "function checkRequired(errors, item) {\r\n var name = item[0];\r\n var value = item[1];\r\n\r\n if (!value || _.isEmpty(value)) {\r\n errors.push(name + ' is required');\r\n }\r\n\r\n return errors;\r\n }", "isValid() {\n let valid = true;\n let snippet = this.state.snippet;\n let errors = {};\n\n // validate title\n let titleParams = {minLength: 3};\n let titleVal = validate(snippet.title, titleParams);\n if (!titleVal.valid) {\n errors.title = titleVal.error;\n valid = false;\n }\n\n // validate url\n let urlParams = {required: true, format: 'url'};\n let urlVal = validate(snippet.url, urlParams);\n if (!urlVal.valid) {\n errors.url = urlVal.error;\n valid = false;\n }\n\n this.setState({errors});\n return valid;\n }", "function checkItem(itemID, numUnits) {\n // console.log(\"Running checkItem! Looking for item #: \"+ itemID);\n connection.query('SELECT * FROM bamazon.products;', function (err, results, fields) {\n // get the information of the chosen item\n var itemIdInt = parseInt(itemID);\n var numUnitsInt = parseInt(numUnits);\n var chosenItem;\n for (var i = 0; i < results.length; i++) {\n // console.log(results[i].item_id);\n // console.log(itemIdInt);\n if (results[i].item_id === itemIdInt) {\n chosenItem = results[i];\n // console.table(chosenItem);\n }\n }\n\n if (chosenItem.stock_quantity < numUnitsInt) {\n console.log(\"Insufficient quantity in stock!\")\n prompt();\n } else {\n fulfillOrder(chosenItem, numUnitsInt);\n } \n\n });\n}", "validGamblingDebt () {\n if (this.validHasGamblingDebt() && this.hasGamblingDebt === 'No') {\n return true\n }\n\n if (!this.list || !this.list.length) {\n return false\n }\n\n if (this.listBranch !== 'No') {\n return false\n }\n\n for (const item of this.list) {\n if (!item.Losses || parseInt(item.Losses.value) < 1) {\n return false\n }\n\n if (!item.Description || !item.Description.value) {\n return false\n }\n\n if (!item.Actions || !item.Actions.value) {\n return false\n }\n\n if (!new DateRangeValidator(item.Dates, null).isValid()) {\n return false\n }\n }\n\n return true\n }", "isValid(){\n let component = this.props.component\n let key = this.props.attribute\n return !component.state.data[key].error\n }", "function check(item){\n if (!item){return null;}\n if (item.type){\n var mother = loader.res.items[item.type];\n item.name = item.name || mother.name;\n item.sprite = item.sprite || mother.image;\n item.sync = item.sync || mother.sync;\n return item;\n }else{\n return null;\n }\n}", "isEmpty(){\n if(this.items.length == 0){\n return true;\n }\n else{\n return false;\n }\n }", "function onlyItem(item){return function(){return $(this).val() == item.id;};}", "static filterInvalidItems(items = [TestQuestion.structure]){\n return (items || []).filter((item = {}) => \n TestQuestion.isValidItem(item)\n );\n }", "function is_manifest_item(value) {\r\n\t\tif (!library_namespace.is_Object(value)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tfor ( var key in value) {\r\n\t\t\treturn key === 'item' && value.item === null\r\n\t\t\t// http://www.idpf.org/epub/31/spec/epub-packages.html#sec-item-elem\r\n\t\t\t&& value.id && value.href && value['media-type'];\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "hasItems() {\n return Boolean(this.data) && Boolean(this.data.types) && this.data.types.length > 0;\n }", "function _validate(item) {\n var _def = dictionary.lookUpDefinition(item.kind);\n if(_def) {\n _def.validate(this, item);\n this.context = _def.context;\n\n }\n}", "function checkInvalidRow() {\n\ttry {\n\t\tvar check \t= 0;\n\t\tvar flag \t= false;\n\t\t$('#table-internal-order tbody tr').each(function() {\t\n\t\t\tcheck \t= \t0;\n\t\t\tvar product_cd \t\t= \t$(this).closest('tr').find('.TXT_product_cd').val();\n\t\t\tvar in_order_qty \t=\t$(this).closest('tr').find('.TXT_in_order_qty').val();\n\t\t\tif(product_cd != ''){\n\t\t\t\tcheck++;\n\t\t\t}\n\t\t\tif(in_order_qty != ''){\n\t\t\t\tcheck++;\n\t\t\t}\n\t\t\tif(check == 2){\n\t\t\t\tflag = true;\n\t\t\t}\n\t\t});\n\t\t\n\t\treturn flag;\n\t} catch (e) {\n\t\talert('checkInvalidRow: ' + e.message);\n\t}\n}", "check(campo) {\n //Condicional para saber si existe y que sea != a vacio\n if (campo && campo !== '') {\n if (campo !== 'isbn') {\n return () => {\n return true\n }\n } else {\n return () => {\n let isbn = this.isbn,\n partesIsbn = isbn.split('-'),\n nPartes = partesIsbn.length\n if (nPartes !== 5) {\n return false\n } else {\n let valido = true\n for (let i = 0; i < nPartes; i++) {\n let estaParte = partesIsbn[i]\n if (!/^([0-9])*$/.test(estaParte)) {\n valido = false\n break\n }\n }\n return valido\n }\n }\n }\n } else {\n return () => {\n return false\n }\n }\n }", "hasItem(itemName) {\n return this.inventory.inventoryHasItem(itemName);\n }", "function hasItem(aComponent, item) {\n\tfor (var i=0; i< aComponent.options.length; i++) {\n\t if ( aComponent.options[i].value == item )\n return true; \n\t}\n\treturn false;\n}", "function isValid(head) {\n}", "isValid() {\n return this.getSize() != 0\n }", "function validateElement(itemHash,itemArr,item)\n{\n for (var i=0; i<itemArr.length; i++)\n {\n if(itemArr[i].text == item)\n {\n itemHash.id = itemArr[i].id;\n itemHash.text = itemArr[i].text;\n itemHash.flag = true;\n break;\n }\n }// end of getting the task reason ID\n return itemHash;\n}", "checkVitals() {\n if (this.getItemCount(items.AIR) <= 0 || this.getItemCount(items.FOOD) <= 0 || this.getItemCount(items.WATER) <= 0) {\n return false;\n } else {\n return true;\n }\n }", "function isobj(item){\n if(typeof(item) === 'object'){\n return true;\n }else{\n return false;\n }\n }", "function validate_items() {\n\tvar selected = $(\".padding\"); // vsechny spravne polozky\t\n\tvar err = 0; // pocet chyb\n\t\n\tfor(let i = 0; i < selected.length; i++) { // neco co nemelo byt zaskrtnute zaskrtnul\n\t\tif($(selected[i]).hasClass(\"striked\")) {\n\t\t\t\terr++;\n\t\t\t}\n\t}\n\n\tvar striked = $(\".striked\");\n\tif(striked.length < 13)\n\t\terr += (13-striked.length);\t\n\t\n $(\"#errcount\").val(err); // zvaliduj kolik tam ma chyb\n $(\"#dialogform3\").submit(); // odesli formular a hod sem dalsi test\n\t\n}", "validateObj() {\n if (!this.isValid) {\n return;\n }\n\n for (const key in this._data) {\n const item = this._data[key];\n\n this._validateItem(item, key);\n }\n }", "verifyItemNotPresent() {\n return this.cartItem.isDisplayed().should.be.false;\n }", "function is(type, item) { return (typeof item)[0] == type; }", "function is(type, item) { return (typeof item)[0] == type; }", "function is(type, item) { return (typeof item)[0] == type; }", "function is(type, item) { return (typeof item)[0] == type; }", "function validate_st_items_buy(exis_new1){\n //////set all input variables for old or new buying item/////\n /// buy existing item only\nvar ex_stock_itm_selected=$('#stock_itms'); //// option value (integer)\n/// buy new item only\nvar itm_sname=$(\"#itm_sname\");\nvar itm_lname=$(\"#itm_lname\");\nvar itm_desc=$(\"#itm_desc\");\nvar itm_notes=$(\"#itm_notes\");\nvar itm_price=$(\"#itm_price\");\n/// buy new or existing itmes \nvar userid=$(\"#userid1\").val();/// user id value\nvar itm_qnty=$(\"#st_itm_qnty\"); // new or existing\nvar itm_qnty_unit_selected=$(\"#unit_measure\"); // existing or new itm;\nvar stock_names_selected=$(\"#stock_names\"); // new or existing\nvar stock_buyer=$(\"#stock_buyer\"); /// new or existing\nvar st_itm_type=$(\"#st_itm_type\");\n\nif(exis_new1==1){ //// validate new item fields\n\n//// validate item short name\nif(itm_sname.val()==\"\") {alert(\"يرجى كتابة الاسم القصير للصنف\") ;itm_sname.focus();return false;}\nif(!validateLength(itm_sname,4) ){alert(\"الاسم يجب أن لا يقل عن 5 حروف ولا يزيد عن 20 حرف\") ;itm_sname.focus();return false;}\n\n//// validate item long name\nif(itm_lname.val()==\"\") {alert(\"يرجى كتابة الاسم الكامل للصنف\") ;itm_lname.focus();return false;}\nif(!validateLength(itm_lname,4) ){alert(\"الاسم يجب أن لا يقل عن 5 حروف\") ;itm_lname.focus();return false;}\n\n// if selecetd item type is ready for sale products validated the price field\nvar selecteditem_id = $('#st_itm_type').find(\":selected\").val();\nif(parseInt(selecteditem_id)==3){/// if item type is ready for sale item validate price field\n\tif(itm_price.val()==\"\") {alert(\"يرجى كتابة سعر الشراء للصنف\") ;itm_price.focus();return false;}\n\t}else{\n\t\tif(itm_price.val()==\"\") {alert(\"يرجى كتابة سعر الشراء للصنف\") ;itm_price.focus();return false;}\n\t\n\t}\n\t\n}else if(exis_new1==0){//// validate existing item fields\n\n////// validate if existing itme is selected\nif(!validateSelection(ex_stock_itm_selected)){ex_stock_itm_selected.focus();return false;}\n\n}\n//// validate existing or new items \n/////// validate quantity feild\nif(itm_qnty.val()==\"\") {alert(\"يرجى كتابة كمية الصنف\") ;itm_qnty.focus();return false;}\n/////// validate price feild\nif(itm_price.val()==\"\") {alert(\"يرجى كتابة سعر شراء الكمية من الصنف\") ;itm_price.focus();return false;}\n\n/////// validate quantity measure unit is selected\nif(!validateSelection(itm_qnty_unit_selected)){return false;}\n////// validate if item type is selected\nif(!validateSelection(st_itm_type)){return false;}\n////////////// validate if stock name is selected\nif(!validateSelection(stock_names_selected)){return false;}\n////// validate if buyer is selected defult buyer is the cashier\n//if(!validateSelection(stock_buyer)){return false;}\nif(stock_buyer.find(\":selected\").val()==\"0\"){alert(\" عمليه الشراء تمت من الخزينة\");}\n\n\n\n\nreturn true;\n}", "function checkForGiftItem(itemDiscountInfo) {\n if (itemDiscountInfo && itemDiscountInfo.length) {\n for (var i=0; i < itemDiscountInfo.length; i++) {\n if (itemDiscountInfo[i].giftWithPurchaseDiscountInfo && itemDiscountInfo[i].giftWithPurchaseDiscountInfo.length) {\n return true;\n }\n }\n }\n return false;\n }", "isPurchaseStatusItemUnavailable() {\n const purchaseStatus = this.getPurchaseStatus();\n return purchaseStatus === PURCHASE_STATUS.ITEM_UNAVAILABLE;\n }", "function valid(entry){\n if (entry.startDate\n || entry.date\n && entry.shortDescription\n && entry.fullDescription) {\n return true;\n } else {\n return false; \n }\n }", "function isItem(opts, node) {\n return opts.typeItem.includes(node.type);\n}", "function validity(obj) {\n if (!obj.checkValidity()) {\n alert(\"Please fill out \"+obj.id+\" field\");\n return false;\n }\n return true;\n}", "function masterItemExist(Item) {\n //localStorage\n for (var i = 0; i < items.length; i++) {\n if (items[i].itemName.toLowerCase() == Item.itemName.toLowerCase()) {\n return true;\n }\n }\n ;\n return false;\n }", "function onlyItem (item) {\r\n\t return function () {\r\n\t return $(this).val() == item.id;\r\n\t };\r\n\t }", "isEmpty(){\n if(this.items.length === 0){\n return true;\n }\n return false;\n }", "_canItemBeSelected(item) {\n return item.disabled === false && item.templateApplied !== true;\n }", "isValidData(temp) {\n const { data } = this.state;\n\n let errorList = [];\n\n // Check ten\n if (data.Name == \"\") {\n this.refs['txtName'].setValid(false);\n\n errorList.push({\n name: 'Name',\n msg: strings('dl.contract_list.noti.err.name')\n });\n } else {\n this.refs['txtName'].setValid(true);\n }\n\n // Check phone\n if (data.Phone == \"\") {\n this.refs['txtPhone'].setValid(false);\n\n errorList.push({\n name: 'Phone',\n msg: strings('dl.contract_list.noti.err.phone')\n });\n } else {\n this.refs['txtPhone'].setValid(true);\n }\n\n // Check phone\n if (data.ReasonId == null) {\n this.refs['optChoice'].setValid(false);\n\n errorList.push({\n name: 'Reason',\n msg: strings('dl.contract_list.noti.err.reason')\n });\n } else {\n this.refs['optChoice'].setValid(true);\n }\n\n if (errorList.length == 0) {\n return true;\n }\n\n this.refs['popup'].getWrappedInstance().show(errorList[0].msg);\n return false;\n }", "contains(item) {\n return false;\n }", "_checkParam() {\n if (this.datascales && this.dataInfo.entity_items && Object.keys(this.dataInfo.entity_items)) {\n this.datascales.range = this.datascales.range || 24\n this.datascales.aggregate = this.datascales.aggregate || \"last\"\n return true\n }\n return false\n }", "isValid () {\n return this.validHasGamblingDebt() &&\n this.validGamblingDebt()\n }", "vendItem(productIndex) {\n //check if valid\n let product = vm.products[productIndex]\n // IF Exists we have some you have enough money\n if (product && product.quantity > 0 && vm.currentTransaction >= product.price) {\n this.processTransaction(product)\n return JSON.parse(JSON.stringify(product))\n }\n return false\n }", "function onlyItem (item) {\n return function () {\n return $(this).val() == item.id;\n };\n }", "function onlyItem (item) {\n return function () {\n return $(this).val() == item.id;\n };\n }", "async function checkRestaurantsItems(rest_id, items){\n const itemsInRest = await pool.query('SELECT item_id FROM items WHERE rest_id=$1',[rest_id])\n var listItems = itemsInRest.rows.map(row=>row.item_id)\n //console.log(listItems)\n var err_str = ''\n items.forEach(item=>{\n //console.log(parseInt(item.item_id,10))\n //console.log(listItems)\n if(listItems.indexOf(parseInt(item.item_id,10))==-1)\n err_str = err_str.concat('Item not in restaurant\\n')\n })\n\n //if errors happenend, return the error string\n if(err_str.length > 0)\n return {err: 'Almost one item is not in DDBB/restaurant'}\n\n //if no errors happened, return a boolean indicated all OK\n return {all_good: true}\n}", "has(key) {\n const idx = asItemIndex(key);\n return typeof idx === 'number' && idx < this.items.length;\n }", "function isItemExisted(arrayData,item){\n let res = false;\n for(let i = 0; i < arrayData.length;i++){\n if(arrayData[i].item_id == item.item_id){\n res = true;\n }\n }\n return res;\n}", "function onlyItem(item) {\n return function () {\n return $(this).val() == item.id;\n };\n }", "function onlyItem(item) {\n return function () {\n return $(this).val() == item.id\n }\n }", "function inputIsValid(){\n\tconsole.log(ul.children.length);\n\tif (input.value.length > 0)\n\t{\n\t\tfor (i = 0, len = ul.children.length; i < len; i++) {\t\t\t\n\t\t\t// <li><span>Notebook</span><button class=\"Delete\">Delete</li>\n\t\t\t// ul.children[i] = selected list item (textContent for above example = \"Notebook Delete\", so inspect span tag only)\n\t\t\t// ul.children[i].children[0] = span tag of the selected list item\t\t\t\n\t\t\tvar entry = ul.children[i].children[0].textContent.toLowerCase().trim();\n\t\t if (input.value.toLowerCase().trim() === entry) {\n\t\t \treturn false //don't add duplicate item\n\t\t\t}\n\t\t}\n\t\tconsole.log(\"isValid\");\n\t\treturn true;\n\t}\n\treturn false;\n}", "function onlyItem(item) {\n return function() {\n return $(this).val() == item.id;\n };\n }", "function emptyCheck() {\n if (inputLength() > 0) {\n createListItem();\n } else {\n alert(\"Texfield cant be blank!\");\n }\n}", "function onlyItem (item) {\n\t return function () {\n\t return $(this).val() == item.id;\n\t };\n\t }", "validateLootAccount() {\n let result = false;\n let account = this.lootView.accountID;\n let state = this.lootView.accountState;\n let accountExist = this.bank.players.some(p => p.id === account);\n\n if (accountExist) {\n state.reset();\n result = true;\n } else {\n state.hasError = true;\n }\n\n return result;\n }", "function isValidTarget(item){\n return item.team != this.team && (this.canAttackLand && (item.type == \"buildings\" || item.type == \"vehicles\")|| (this.canAttackAir && (item.type == \"aircraft\")));\n}", "function prerequisitesExist()\n {\n items.each(function() {\n //get item prerequisites\n var prerequisites = $(this).data(\"prerequisites\").toString();\n\n //if item has prerequisites, check they exist\n if(prerequisites.length !== 0) {\n var prerequisitesArray = prerequisites.split(\",\");\n\n //check each prerequisite\n for(var i = 0; i < prerequisitesArray.length; i++) {\n var requiredItem = container.find(\"[data-name='\" + prerequisitesArray[i] + \"']\");\n\n //check item exists\n if(requiredItem.length < 1) {\n console.error(\"Item '\" + $(this).data(\"name\") + \"' doesn't have prerequisite '\" + prerequisitesArray[i] + \"'\");\n }\n }\n }\n });\n }", "function onlyItem(item) {\n return function () {\n return $(this).val() == item.id;\n };\n }", "function hasItems(array) {\n return array[0] !== undefined \n}" ]
[ "0.76029485", "0.75375587", "0.74150586", "0.7307445", "0.72420293", "0.72135204", "0.7013635", "0.6976951", "0.6947556", "0.68969434", "0.6866377", "0.66421527", "0.6627664", "0.66092545", "0.6572679", "0.65712", "0.6505685", "0.6413965", "0.6401731", "0.6401731", "0.639394", "0.6372262", "0.6359438", "0.63550276", "0.63495815", "0.63161886", "0.62311345", "0.62264043", "0.6221297", "0.6220768", "0.6182166", "0.61612535", "0.61340284", "0.6130767", "0.6130628", "0.6117968", "0.61067003", "0.60782623", "0.60710955", "0.60636824", "0.60397124", "0.6037443", "0.60152656", "0.6001995", "0.5977886", "0.5949166", "0.59367347", "0.59277683", "0.5921188", "0.5919199", "0.5916112", "0.5911655", "0.590114", "0.58950996", "0.58753955", "0.58748853", "0.58741295", "0.5871993", "0.58610654", "0.585908", "0.5842899", "0.5830587", "0.5807209", "0.5788772", "0.57874835", "0.5782184", "0.5782184", "0.5782184", "0.5782184", "0.57787824", "0.5776395", "0.5774712", "0.5763377", "0.57563627", "0.5755524", "0.575285", "0.5745102", "0.5744758", "0.5733906", "0.57331157", "0.57287097", "0.5727136", "0.57229024", "0.5719459", "0.5716384", "0.5716384", "0.5714742", "0.57127905", "0.5709968", "0.5702103", "0.56977075", "0.5695662", "0.5695081", "0.5694707", "0.5690381", "0.56895167", "0.5680143", "0.56764984", "0.5672932", "0.5669789" ]
0.64233446
17
function to ask the user how much they would like to purchase
function howManyToBuy() { inquirer.prompt([ { type: "input", name: "quantityToBuy", message: "How many would you like to purchase?", validate: function (input) { if (isNaN(input)) { return false; } else { return true; } } } ]).then(function (user) { quantityToBuy = parseInt(user.quantityToBuy); // after user input is entered, call checkIfAvailable function checkIfAvailable(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function purchase() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n console.table(res);\n inquirer.prompt([{\n name: \"itemId\",\n type: \"number\",\n message: \"Enter the item ID of the item you want to buy.\".brightYellow\n },\n {\n name: \"itemQuantity\",\n type: \"number\",\n message: \"Excellent Choice! How many would you like?\".brightYellow\n }]).then(function (answer) {\n saleItem = answer.itemId - 1;\n saleQuantity = answer.itemQuantity;\n checkInv()\n\n });\n\n });\n\n}", "function userPurchase() {\n inquirer\n .prompt([\n {\n name: \"id\",\n type: \"input\",\n message: \"\\nWhat's the item ID of the product you would like to buy? \",\n filter: Number\n },\n {\n name: \"quantity\",\n type: \"input\",\n message: \"How many items do you wish to buy? \",\n filter: Number\n },\n\n]).then(function(answer) {\n var selectedID = answer.id;\n var numberOfItems = answer.quantity;\n console.log(selectedID, numberOfItems);\n calcPurchase(selectedID, numberOfItems);\n });\n}", "function promptUserPurchase() {\n inquirer.prompt([\n {\n name: \"itemID\",\n message: \"What is the id number of the item you wish to purchase?\"\n },\n {\n name: \"quantity\",\n message: \"How many do you wish to buy?\"\n }\n ]).then(function (answers) {\n if ((answers.itemID === \"x\") || (answers.quantity === \"x\")) {\n process.exit();\n }\n var purchaseItem = answers.itemID;\n var purchaseQty = answers.quantity;\n checkStockQuantity(purchaseItem, purchaseQty);\n });\n}", "function purchase () {\n // prompting the user what they want and what quantity\n\tinquirer.prompt([\n \t{\n \ttype: \"input\",\n \tname: \"item\",\n \tmessage: \"Which item do you want to purchase? (Please type item ID)\"\n \t}, {\n \tname: \"quantity\",\n \ttype: \"input\",\n \tmessage: \"How many would you like?\"\n // processing customer purchase\n \t}]).then(function(answers) {\n var item = answers.item;\n var quantity = answers.quantity;\n\n // connecting the the database to check for availability and update stock quantity\n connection.query(\"SELECT stock_quantity, price FROM products WHERE id=\" + item, function (err,res) {\n var stockQuantity = res[0].stock_quantity;\n var total = res[0].price * quantity;\n var newStock = stockQuantity - quantity;\n\n // if their quantity exceeds the inventory the order does not go through\n if (newStock < 0){\n console.log(\"Insufficient quantity! Try again.\");\n purchase();\n }\n // if the inventory is available, quantity in the database is updated\n // and the customer is given their total\n else {\n connection.query(\"UPDATE products SET stock_quantity=\" + newStock + \"WHERE item_id=\" + item, function (err,res) {\n });\n console.log(\"Success! Your total is $\" + total);\n }\n\n });\n\t});\n}", "function requestProduct() {\n inquirer.\n prompt([{\n name: \"productID\",\n type: \"input\",\n message: \"What product would you like to buy? (Enter Product ID #)\",\n validate: validateInput,\n filter: Number\n }, {\n name: \"productUnits\",\n type: \"input\",\n message: \"How many units would you like to buy?\",\n validate: validateInput,\n filter: Number\n\n }]).then(function (input) {\n completePurchase(input);\n\n });\n}", "function purchase(quantityRemaining, quantityRequest, price, id) {\n if (quantityRemaining < quantityRequest) {\n inquirer\n .prompt({\n name: \"editRequest\",\n type: \"rawlist\",\n message:\n \"Insufficient quantity to fullfill order. Would you like to change your request to a smaller value?\",\n choices: [\"Yes\", \"No\"]\n })\n .then(function(data) {\n if (data.confirm === \"No\") {\n console.log(\"Thank you for your business!\");\n connection.end();\n } else {\n runSearch();\n }\n });\n } else {\n total = total + price * quantity;\n connection.query(\n \"UPDATE products SET stock_quantity = stock_quantity - \" +\n quantity +\n \" WHERE ?\",\n [\n {\n item_id: id\n }\n ],\n //alert user of the balance for their current request, if they want to make additional purchases \n //then price and quantity is added to the \"total\" variable.\n function(err, res) {\n if (err) throw err;\n\n inquirer\n .prompt({\n name: \"confirm\",\n type: \"rawlist\",\n message:\n \"\\nYour total for this transaction is: $\" +\n (price * quantity).toString() +\n \". Would you like to make another purchase?\",\n choices: [\"Yes\", \"No\"]\n })\n .then(function(data) {\n if (data.confirm === \"No\") {\n console.log(\"\\nThe total for today is: $\" + total.toString());\n connection.end();\n } else {\n runSearch();\n }\n });\n }\n );\n }\n}", "function purchase(choice){\n if (choice == 0 && balance >= 75){\n console.log(\"You have purchased Dr Pepper\");\n }\n if (choice == 1 && balance >= 75){\n console.log(\"You have purchased Coke\");\n }\n if (choice == 2 && balance >= 75){\n console.log(\"You have purchased Pepsi\");\n }\n if (choice == 3 && balance >= 150){\n console.log(\"You have purchased Flake\");\n }\n if (choice == 4 && balance >= 150){\n console.log(\"You have purchased KitKat\");\n }\n if (choice == 5 && balance >= 150){\n console.log(\"You have purchased Daim\");\n }\n if (choice == 6 && balance >= 100){\n console.log(\"You have purchased Skips\");\n }\n if (choice == 7 && balance >= 100){\n console.log(\"You have purchased Monster Munch\");\n }\n if (choice == 8 && balance >= 100){\n console.log(\"You have purchased McCoys\");\n }\n\n}", "function userPurchase() {\n var banckAccountBalance = prompt(\"How much money do you have ?\");\n\n\n // prompt user to select phones\n function postProducts() {\n //get user money\n function getBanckAccountBalance() {\n return banckAccountBalance;\n }\n\n let minMoney = 100\n if (banckAccountBalance < minMoney) {\n alert('Sorry. you do not haave enough cash to bu our products. We therefore do not want to display our products to you.');\n console.log('User do not have enough money.');\n\n } else if (banckAccountBalance >= minMoney) {\n alert(\n \"Have a look at our list of products\\n#Iphone X: $600\\n#Nokia C9: $1,200\\n#Samsung Galaxy S20: $3,000\\n#Earphone black: $200\\n#Iphone charger: $300\\n\\nPlease remember our choice and write it down in the next window.\"\n );\n\n // prompt user to select phones\n function getUserToBuy() {\n var answer1 = prompt('write yes or no.\\nWant to buy #Iphone X ?');\n var answer2 = prompt('select yes or no.\\n#want to buy #Nokia C9 ?');\n var answer3 = prompt('select yes or no\\nWant to buy Samsung Galaxy S20 ?');\n var answer4 = prompt('select yes or no\\nWant to buy #Earphone black ?');\n var answer5 = prompt('select yes or no\\nWant to buy #Iphone charger ?');\n\n if (answer1 == 'no' && answer2 == 'yes' && answer3 == 'yes' && answer4 == 'yes') {\n let answer2 = 1.200;\n let answer3 = 3.000;\n let answer4 = 200;\n let answer5 = 300;\n\n var result = answer2 + answer3 + answer4 + answer5;\n return alert('The total price of our purchase is: ' + '$' + result);\n\n } else if (answer1 == 'yes' && answer2 == 'no' && answer3 == 'yes' && answer4 == 'yes') {\n let answer1 = 600;\n let answer3 = 3.000;\n let answer4 = 200;\n let answer5 = 300;\n var result = answer1 + answer3 + answer4 + answer5;\n return alert('The total price of our purchase is: ' + '$' + result.toString(2));\n } else if (answer1 == 'yes' && answer2 == 'yes' && answer3 == 'no' && answer4 == 'yes') {\n let answer1 = 600;\n let answer2 = 1.200;\n let answer4 = 200;\n let answer5 = 300;\n var result = answer1 + answer2 + answer4 + answer5;\n return alert('The total price of our purchase is: ' + '$' + result.toString(2));\n }\n else if (answer1 == 'yes' && answer2 == 'yes' && answer3 == 'yes' && answer4 == 'no') {\n let answer1 = 600;\n let answer2 = 1.200;\n let answer3 = 3.000;\n let answer5 = 300;\n var result = answer1 + answer2 + answer3 + answer5;\n return alert('The total price of our purchase is: ' + '$' + result.toString(2));\n }\n else if (answer1 == 'yes' && answer2 == 'yes' && answer3 == 'yes' && answer4 == 'yes' && answer5 == 'no') {\n let answer1 = 600;\n let answer2 = 1.200;\n let answer3 = 3.000;\n let answer4 = 200;\n var result = answer1 + answer2 + answer3 + answer4;\n return alert('The total price of our purchase is: ' + '$' + result.toString(2));\n } else {\n let answer1 = 600;\n let answer2 = 1.200;\n let answer3 = 3.000;\n let answer4 = 200;\n let answer5 = 300;\n var result = answer1 + answer2 + answer3 + answer4 + answer5;\n return alert('The total price of our purchase is: ' + '$' + result.toString(2));\n }\n }\n\n return getUserToBuy();\n\n } else {\n return console.log('something went wrong!');\n\n }\n }\n\n postProducts();\n\n\n\n // for(let i = 100; i <= banckAccountBalance; i++){\n\n // }\n\n\n\n}", "function qty() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"input\",\n message: \"How many would you like?\",\n\n })\n .then(function(answer) {\n quantityToBuy = answer.action;\n checkqty();\n })\n}", "function buyPrompt() {\n inquirer\n .prompt([\n {\n name: \"prodChoice\",\n type: \"input\",\n message: \"What's the ID of the product you'd like to purchase?\",\n validate: function (value) {\n if (isNaN(value) === false) {\n return true;\n }\n return false;\n }\n },\n {\n name: \"count\",\n type: \"input\",\n message: \"How many units would you like to purchase?\",\n validate: function (value) {\n if (isNaN(value) === false) {\n return true;\n }\n return false;\n }\n }\n ])\n .then(function (answer) {\n\n checkPurchase(answer.prodChoice, answer.count);\n\n });\n}", "function purchaseItem() {\n\tinquirer.prompt([{\n\t\tname: \"puchaseItemID\",\n\t\ttype: \"input\",\n\t\tmessage: \"What is the ID Number of the item you'd like to purchase?\",\n\t\tvalidate: function(value) {\n\t\t\tif (value >= 1 && value <= 12) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}, \n\n\t{\n\t\tname: \"purchaseQty\",\n\t\ttype: \"input\",\n\t\tmessage: \"How many of this item would you like to purchase?\",\n\t\tvalidate: function(value) {\n\t\t\tif (value) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\t\t\n\t}]).then(function(response) {\n\t\t// connection.query(\"SELECT * FROM products\", function(err, res) {\n\t\t\t// console.log(res);\n\t\t// });\n\t\torderItem(response);\n\t});\n}", "function startpurchase() {\n inquirer\n .prompt([\n {\n name: \"itemID\",\n type: \"input\",\n message: \"What is the ID of the product you wish to purchase?\",\n },\n {\n name: \"quantity\",\n type: \"input\",\n message: \"How many units would you like to buy?\"\n }\n ]).then(function(inquirerResponse) {\n userAnswer = {\n item_id: parseInt(inquirerResponse.item_id),\n quantity: parseInt(inquirerResponse.quantity)\n }\n {\n checkStore(userAnswer);\n }\n })\n}", "function getUserToBuy() {\n var answer1 = prompt('write yes or no.\\nWant to buy #Iphone X ?');\n var answer2 = prompt('select yes or no.\\n#want to buy #Nokia C9 ?');\n var answer3 = prompt('select yes or no\\nWant to buy Samsung Galaxy S20 ?');\n var answer4 = prompt('select yes or no\\nWant to buy #Earphone black ?');\n var answer5 = prompt('select yes or no\\nWant to buy #Iphone charger ?');\n\n if (answer1 == 'no' && answer2 == 'yes' && answer3 == 'yes' && answer4 == 'yes') {\n let answer2 = 1.200;\n let answer3 = 3.000;\n let answer4 = 200;\n let answer5 = 300;\n\n var result = answer2 + answer3 + answer4 + answer5;\n return alert('The total price of our purchase is: ' + '$' + result);\n\n } else if (answer1 == 'yes' && answer2 == 'no' && answer3 == 'yes' && answer4 == 'yes') {\n let answer1 = 600;\n let answer3 = 3.000;\n let answer4 = 200;\n let answer5 = 300;\n var result = answer1 + answer3 + answer4 + answer5;\n return alert('The total price of our purchase is: ' + '$' + result.toString(2));\n } else if (answer1 == 'yes' && answer2 == 'yes' && answer3 == 'no' && answer4 == 'yes') {\n let answer1 = 600;\n let answer2 = 1.200;\n let answer4 = 200;\n let answer5 = 300;\n var result = answer1 + answer2 + answer4 + answer5;\n return alert('The total price of our purchase is: ' + '$' + result.toString(2));\n }\n else if (answer1 == 'yes' && answer2 == 'yes' && answer3 == 'yes' && answer4 == 'no') {\n let answer1 = 600;\n let answer2 = 1.200;\n let answer3 = 3.000;\n let answer5 = 300;\n var result = answer1 + answer2 + answer3 + answer5;\n return alert('The total price of our purchase is: ' + '$' + result.toString(2));\n }\n else if (answer1 == 'yes' && answer2 == 'yes' && answer3 == 'yes' && answer4 == 'yes' && answer5 == 'no') {\n let answer1 = 600;\n let answer2 = 1.200;\n let answer3 = 3.000;\n let answer4 = 200;\n var result = answer1 + answer2 + answer3 + answer4;\n return alert('The total price of our purchase is: ' + '$' + result.toString(2));\n } else {\n let answer1 = 600;\n let answer2 = 1.200;\n let answer3 = 3.000;\n let answer4 = 200;\n let answer5 = 300;\n var result = answer1 + answer2 + answer3 + answer4 + answer5;\n return alert('The total price of our purchase is: ' + '$' + result.toString(2));\n }\n }", "function promptUserPurchase() {\n\t// console.log('___ENTER promptUserPurchase___');\n\n\t// Prompt the user to select an item\n\tinquirer.prompt([\n\t\t{\n\t\t\ttype: 'input',\n\t\t\tname: 'item_id',\n\t\t\tmessage: 'Please enter the Item ID which you would like to purchase.',\n\t\t\tvalidate: validateInput,\n\t\t\tfilter: Number\n\t\t},\n\t\t{\n\t\t\ttype: 'input',\n\t\t\tname: 'quantity',\n\t\t\tmessage: 'How many do you need?',\n\t\t\tvalidate: validateInput,\n\t\t\tfilter: Number\n\t\t}\n\t]).then(function(input) {\n\t\t// console.log('Customer has selected: \\n item_id = ' + input.item_id + '\\n quantity = ' + input.quantity);\n\n\t\tvar item = input.item_id;\n\t\tvar quantity = input.quantity;\n\n\t\t// Query db to confirm that the given item ID exists in the desired quantity\n\t\tvar queryStr = 'SELECT * FROM products WHERE ?';\n\n\t\tconnection.query(queryStr, {item_id: item}, function(err, data) {\n\t\t\tif (err) throw err;\n\n\t\t\t// If the user has selected an invalid item ID, data attay will be empty\n\t\t\t// console.log('data = ' + JSON.stringify(data));\n\n\t\t\tif (data.length === 0) {\n\t\t\t\tconsole.log('ERROR: Invalid Item ID. Please select a valid Item ID.');\n\t\t\t\tdisplayInventory();\n\n\t\t\t} else {\n\t\t\t\tvar productData = data[0];\n\n\t\t\t\t// console.log('productData = ' + JSON.stringify(productData));\n\t\t\t\t// console.log('productData.stock_quantity = ' + productData.stock_quantity);\n\n\t\t\t\t// If the quantity requested by the user is in stock\n\t\t\t\tif (quantity <= productData.stock_quantity) {\n\t\t\t\t\tconsole.log('Congratulations, the product you requested is in stock! Placing order!');\n\n\t\t\t\t\t// Construct the updating query string\n\t\t\t\t\tvar updateQueryStr = 'UPDATE products SET stock_quantity = ' + (productData.stock_quantity - quantity) + ' WHERE item_id = ' + item;\n\t\t\t\t\t// console.log('updateQueryStr = ' + updateQueryStr);\n\n\t\t\t\t\t// Update the inventory\n\t\t\t\t\tconnection.query(updateQueryStr, function(err, data) {\n\t\t\t\t\t\tif (err) throw err;\n\n\t\t\t\t\t\tconsole.log('Your oder has been placed! Your total is $' + productData.price * quantity);\n\t\t\t\t\t\tconsole.log('Thank you for shopping with us!');\n\t\t\t\t\t\tconsole.log(\"\\n---------------------------------------------------------------------\\n\");\n\n\t\t\t\t\t\t// End the database connection\n\t\t\t\t\t\tconnection.end();\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log('Sorry, there is not enough product in stock, your order can not be placed as is.');\n\t\t\t\t\tconsole.log('Please modify your order.');\n\t\t\t\t\tconsole.log(\"\\n---------------------------------------------------------------------\\n\");\n\n\t\t\t\t\tdisplayInventory();\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t})\n}", "function purchasePrompt() {\n\n inquirer.prompt([{\n\n type: \"confirm\",\n name: \"continue\",\n message: \"Would you like to purchase an item?\",\n default: true\n\n }]).then(function (user) {\n if (user.continue === true) {\n purchase();\n } else {\n console.log(chalk.green.bold(\"Thank you! Come back soon! Just enter: node bamazonCustomer.js\"));\n connection.end();\n }\n });\n}", "async function purchase() {\n\n // SHOW LOADING SCREEN\n dispatch({\n type: 'show-prompt',\n payload: 'loading'\n })\n\n // FETCH THE TOKEN PRICE\n const token_price = await read({\n contract: 'token',\n func: 'price',\n }, state)\n\n // ATTEMPT TO BUY TOKENS\n const result = await write({\n contract: 'token',\n func: 'purchase',\n args: [input.amount.value],\n payable: input.amount.value * token_price\n }, state)\n\n // SLEEP FOR 2 SECONDS TO SMOOTHEN TRANSITION\n await sleep(2)\n\n // EVERYTHING WENT FINE\n if (result.success) {\n\n // CREATE TOAST MESSAGE\n dispatch({\n type: 'toast-message',\n payload: {\n type: 'good',\n msg: 'tokens purchased'\n }\n })\n\n // OTHERWISE, SHOW ERROR\n } else {\n dispatch({\n type: 'toast-message',\n payload: {\n type: 'bad',\n msg: result.reason\n }\n })\n }\n\n // HIDE THE PROMPT WINDOW\n dispatch({ type: 'hide-prompt' })\n }", "function promptCustomer() {\n\tinquirer.prompt([\n\t{\n\t\tname: \"id\",\n\t\ttype: \"input\",\n\t\tmessage: \"\\nPlease input the ID number of the item you would like to purchase\"\n\t}, {\n\t\tname: \"quantity\",\n\t\ttype: \"input\",\n\t\tmessage: \"\\nHow many of this item would you like to purchase?\"\n\t}\n\t]).then(function(response) {\n\t\tchosenId = parseFloat(response.id);\n\t\tchosenQuant = parseFloat(response.quantity);\n\t\tvar chosenItem;\n\t\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\t\tif (err) throw err;\n\t\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\t\tif (res[i].item_id === chosenId) {\n\t\t\t\t\tchosenItem = res[i];\n\t\t\t\t};\n\t\t\t};\n\t\t\t// console.log(chosenItem.product_name); //for debugging\n\t\t\tif (chosenItem.stock_quantity < chosenQuant) {\n\t\t\t\tconsole.log(\"\\nWe do not have enough of this item in stock.\\n\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar totalCost = chosenItem.price * chosenQuant;\n\t\t\t\tvar newStockQuant = chosenItem.stock_quantity - chosenQuant;\n\t\t\t\t// console.log(newStockQuant);\n\t\t\t\t// console.log(chosenItem.stock_quantity);\n\t\t\t\t// console.log(chosenId);\n\t\t\t\tconsole.log(\"\\nThank you for your order. Your total is $\" + totalCost +\"\\n\");\n\t\t\t\t//function that updates inventory quantity\n\t\t\t\tconnection.query(\n\t\t\t\t\t\"UPDATE products SET ? WHERE ?\",\n\t\t\t\t\t[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tstock_quantity: newStockQuant\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\titem_id: chosenId\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\tfunction(err, res) {\n\t\t\t\t\t\tif (err) throw err;\n\t\t\t\t\t\t// console.log(\"Quantity updated\");\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t};\n\t\t\t// quantityCheck();\n\t\t\tconnection.end();\n\t\t});\n\t});\n}", "function buyProduct() {\n const amount = Number(currentBalance.innerText);\n const askPrice = Number(askPriceText.innerText);\n\n // Check If User can Afford\n if (amount >= askPrice) {\n currentBalance.innerText = amount - askPrice;\n alert(\"You are now the proud owner of \" + productTitle.innerText + \"!\")\n } else {\n alert(\"Not enough money\")\n }\n}", "function purchasePrompt() {\n console.log(\"yes\");\n inquirer.prompt([{\n type: \"confirm\",\n name: \"purchase\",\n message: \"Would you like to purchase an item?\",\n default: true\n\n }]).then(function (user) {\n if (user.purchase === true) {\n selectionPrompt();\n } else {\n startPrompt();\n }\n });\n}", "function buyItem () {\n inquirer.prompt([\n {\n type:\"input\",\n name:\"itemSelected\",\n message:\"Please type an item id to purchase.\"\n },\n {\n type:\"input\",\n name:\"quantity\",\n message:\"How many would you like to purchase?\"\n }\n ]).then(function (results) {\n itemSelected = results.itemSelected;\n quantity = Number(results.quantity);\n \n if (itemSelected > 10) {\n console.log(\"Invalid item, please select a new item.\")\n buyItem();\n }\n \n checkItemStock();\n });\n}", "function whatToBuy(){\n\tinquirer.prompt([\n\t\t\t{\n\t\t\t\tname:\"item\",\n\t\t\t\ttype:\"list\",\n\t\t\t\tmessage: \"Select the name of the item you would like to purchase:\", \n\t\t\t\tchoices: [\n\t\t\t\t\"purple wig\",\n\t\t\t\t\"round glasses\",\n\t\t\t\t\"red blazer\",\n\t\t\t\t\"black biker shorts\",\n\t\t\t\t\"red gown\",\n\t\t\t\t\"silver ring\", \n\t\t\t\t\"princess puppet\",\n\t\t\t\t\"pink wig\",\n\t\t\t\t\"stuffed cow\",\n\t\t\t\t\"sports car\"\n\t\t\n\t\t\t]},\n\t\t\t{\n\t\t\t\tname:\"itemNum\",\n\t\t\t\ttype:\"input\",\n\t\t\t\tmessage: \"What is your item's ID?\",\n\t\t\t\tvalidate: function(value){\n\t\t\t\t\tif(isNaN(value) === false){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tname:\"amount\",\n\t\t\t\ttype:\"input\",\n\t\t\t\tmessage: \"How many would you like to buy?\",\n\t\t\t\tvalidate: function(value){\n\t\t\t\t\tif(isNaN(value) === false){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t// ,\n\t\t\t// // { //optional confirm feature \n\t\t\t// \ttype: \"confirm\",\n\t\t\t// \tmessage: \"Is that your final amount?\",\n\t\t\t// \tname:\"confirm\",\n\t\t\t// \tdefault: true\n\t\t\t// }\n\t\t])\n\t\t.then(function(response){\n\t\t\t//double check to see what the response confirms about the order \n\t\t\t// console.log(response);\n\t\t\t// //name\n\t\t\t// console.log(response.item);\n\t\t\t// //item's id\n\t\t\t// console.log(response.itemNum);\n\t\t\t// //amount ordered\n\t\t\t// console.log(response.amount);\n\t\t\t\n\t\t\t//query to be sure the database has the item in stock \n\t\t\tconnection.query(\"SELECT stock_quantity FROM products WHERE item_id=\" + response.itemNum, function (error, data){\n\t\t\t\t//returns the stock_quantity of the item_id from above as data\n\t\t\t\t// console.log(data);\n\t\t\t\t// console.log(response.amount);\n\t\t\t\t// console.log(data[0].stock_quantity);\n\t\t\t\tif (error) throw error;\n\t\t\t\t//if not an error, then see if the data from the query is greater than the response.amount\n\t\t\t\t\tif(data[0].stock_quantity >= response.amount){\n\t\t\t\t\t\tconsole.log(\"You are in luck; enjoy your item!\");\n\t\t\t\t\t\t//update the amount of product left in the stock_quantity column\n\t\t\t\t\t\t//query to update the database to make sure the amount of stock_quantity goes down by the response.amount\n\t\t\t\t\t\tconnection.query(\"UPDATE products SET stock_quantity = stock_quantity -\" + response.amount +\" WHERE item_id=\" + response.itemNum, function(error, data){\n\t\t\t\t\t\t\tif(error) throw error;\n\t\t\t\t\t\t\t//show the price to the customer for that item data here is an ok packet with affectedRows and messaage\n\t\t\t\t\t\t\t// console.log(data);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t//open another query to reveal the price for the item-- have to multiply by the response.amount to get total price\n\t\t\t\t\t\t\tconnection.query(\"SELECT price FROM products WHERE item_id=\" + response.itemNum, function(error, data){\n\t\t\t\t\t\t\t\t// console.log(JSON.stringify(data));\n\t\t\t\t\t\t\t\t//console.log(JSON.parse(data));\n\t\t\t\t\t\t\t\tif(error) throw error;\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//data come from the rowdatapacket array/objects to give me the price for that response.itemNum \n\t\t\t\t\t\t\t\t\tnewPrice = data[0].price;\n\t\t\t\t\t\t\t\t\ttotalPrice = response.amount * newPrice;\n\t\t\t\t\t\t\t\t\tconsole.log(\"You ordered: \" + response.amount);\n\t\t\t\t\t\t\t\t\tconsole.log(\"Your total is: $\" + totalPrice);\n\t\t\t\t\t\t\t\tconsole.log(\"Thank you for using Bamazon! Make your next purchase below!\");\n\t\t\t\t\t\t\t\twhatToBuy();\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\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.log(\"There was not enough stock; please try your purchase again with another item.\");\n\t\t\t\t\t\twhatToBuy();\n\t\t\t\t\t}\n\n\t\t\t\t})\n\t\t\t\n\t\t});\n}", "function customerPrompt() {\r\n inquirer\r\n .prompt([{\r\n name: \"item_id\",\r\n type: \"input\",\r\n message: \"What is the ID of the product you would like to purchase?\",\r\n },\r\n\r\n {\r\n name: \"quantity\",\r\n type: \"input\",\r\n message: \"How many of this product would you like to purchase?\",\r\n\r\n\r\n }]).then(function (answer) {\r\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products WHERE?\", { item_id: answer.item_id }, function (err, res) {\r\n for (var i = 0; i < res.length; i++)\r\n if (res[i].stock_quantity >= answer.quantity) {\r\n \r\n console.log(\"There is sufficient stock to fill this order\" );\r\n }\r\n else {\r\n console.log(\"Insufficient stock, order cannot be completed, please try again\");\r\n\r\n }\r\n \r\n connection.end();\r\n })\r\n })\r\n }", "function quantityPrompt(res) {\n\t inquirer\n \t\t.prompt([\n \t\t\t{\n\t\t\t\ttype: \"input\",\n\t\t\t\tmessage: \"How many would you like to purchase?\",\n\t\t\t\tname: \"quantity\"\n\t\t }\n\t\t])\n\t\t.then(function(inqRes) {\n\t\t\tconsole.log(inqRes.quantity);\n\n\t\t\tvar inqQuan = parseInt(inqRes.quantity);\n\t\t\tif (inqQuan <= res[0].stock_quantity) {\n\n\t\t\t\tvar total = (inqQuan*res[0].price).toFixed(2);\n\t\t\t\tconsole.log(\"Your total is: $\" + total);\n\t\t\t\t\n\t\t\t\tconfirmPrompt(res, inqQuan);\n\n\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tconsole.log(\"Insufficient quantity!\");\n\t\t\t\tquantityPrompt(res);\n\n\t\t\t}\n\n\t\t});//ends then\n \n}// ends quantityPrompt", "function promptCustomerForQuantity(product) {\n\tinquirer\n\t .prompt([\n\t\t{\n\t\t type: \"input\",\n\t\t name: \"quantity\",\n\t\t message: \"How many would you like? [Quit with Q]\",\n\t\t validate: function(val) {\n\t\t\treturn val > 0 || val.toLowerCase() === \"q\";\n\t\t }\n\t\t}\n\t ])\n\t .then(function(val) {\n\t\t// Check if the user wants to quit the program\n\t\tcheckIfShouldExit(val.quantity);\n\t\tvar quantity = parseInt(val.quantity);\n \n\t\t// If there isn't enough of the chosen product and quantity, let the user know and re-run loadProducts\n\t\tif (quantity > product.stock_quantity) {\n\t\t console.log(\"\\nInsufficient quantity!\");\n\t\t displayProducts();\n\t\t}\n\t\telse {\n\t\t // Otherwise run makePurchase, give it the product information and desired quantity to purchase\n\t\t makePurchase(product, quantity);\n\t\t}\n\t });\n }", "function selectQuantity() {\n inquirer.prompt({\n name: \"quantity\",\n type: \"input\",\n message: \"How many would you like to purchase\"\n })\n .then(function (answer) {\n\n //Set customer total\n customerTotal = (answer.quantity * selectedItem.price);\n //Set new quantity\n var newQuantity = (selectedItem.stock_quantity - answer.quantity)\n\n //If the customer requests more of the item than we have left, alert them of how much of the product is remaining\n if (selectedItem.stock_quantity < answer.quantity) {\n console.log(\"Sorry, we only have \" + selectedItem.stock_quantity + \" left of that product\")\n selectQuantity();\n\n //If customer chooses none, fire purchase more function\n } else if (parseInt(answer.quantity) === 0) {\n console.log(\"No worries. It's okay to change your mind\")\n purchaseMore();\n\n } else {\n //Confirm the customer would like to make the purchase\n inquirer.prompt({\n name: \"verify\",\n type: \"confirm\",\n message: \"Your total comes to $\" + (customerTotal) + \". Would you like to make this purchase?\"\n })\n\n //If they answer yes, thank them and call the purchaseMore function\n .then(function (answer) {\n if (answer.verify === true) {\n\n //Otherwise, update the database by subtracting the customers request from the stock_quantity\n connection.query(\"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newQuantity\n },\n {\n item_id: selectedItem.item_id\n }\n ])\n console.log(\"Thank you for shopping!\")\n purchaseMore();\n //Otherwise, redirect them to the selectQuantity function\n } else {\n console.log(\"Okay, let's try this again\")\n selectQuantity();\n }\n })\n }\n })\n}", "function purchaseQuestions() {\n inquirer\n .prompt([\n {\n type: \"input\",\n name: \"id\",\n message: \"Enter the ID of the product you would like to purchase.\"\n },\n {\n type: \"input\",\n name: \"amount\",\n message: \"How many units would you like?\"\n }\n ]).then(function (answer) {\n productId = answer.id;\n quantity = answer.amount;\n itemPurchase();\n })\n}", "function quantity(res){\n console.log(\" \");\n inquirer.prompt(\n {\n name: \"purchaseQty\",\n type: \"text\",\n message: \"How many would you like to purchase?\"\n }\n )\n .then(function(answer2) {\n if (answer2.purchaseQty == 0) {\n //User selected 0 products to purchase, so exit this question and go back up to the products selection\n products(res);\n }\n else if (answer2.purchaseQty < 1 || answer2.purchaseQty < '1' || answer2.purchaseQty > 999 || answer2.purchaseQty > '999') {\n //User made invalid selections, so display a message and ask for the quantity again\n console.log(\"\\nINVALID ENTRY!\".yellow)\n quantity(res);\n }\n else if (selectedStockQty == 0) {\n //The item selected is out of stock (out of stock items were already not displayed, but this is a safeguard)\n console.log(\"\\nSORRY, THAT ITEM IS CURRENTLY OUT OF STOCK!\".red);\n products(res);\n }\n else if (answer2.purchaseQty > selectedStockQty) {\n //User selected a quantity that is greater than what is in stock, so display qhat is in stock, and ask quantity again\n console.log(\"\\nSORRY, INSUFFICIENT QUANTITY! \".red + selectedStockQty + \" in stock. Please enter a lower amount:\");\n quantity(res);\n }\n else {\n //User entered valid quantity, proceed to complete the purchase\n var selectedPurchaseQty = answer2.purchaseQty;\n makePurchase(selectedStockQty, selectedPurchaseQty);\n };\n });\n }", "function promptCustomer() {\n inquirer.prompt([{\n name: \"ID\",\n type: \"input\",\n message: \"Please enter Item ID you like to purhcase.\",\n filter: Number\n },\n {\n name: \"Quantity\",\n type: \"input\",\n message: \"How many copies would you like?\",\n filter: Number\n },\n ]).then(function (answers) {\n var quantityNeeded = answers.Quantity;\n var IDrequested = answers.ID;\n purchaseOrder(IDrequested, quantityNeeded);\n });\n}", "function purchaseItem(){\n inquirer.prompt([\n {\n name: \"id\",\n type: \"input\",\n message: \"Please enter item ID of item you would like to purchase.\",\n filter: Number\n },\n {\n name: \"Quantity\",\n type: \"input\",\n message: \"How many would you like to purchase?\",\n filter: Number\n },\n ]).then(function(response){\n var quantity = response.Quantity;\n var itemId = response.id;\n orderItem(itemId, quantity);\n });\n}", "function userPurchase() {\n inquirer.prompt([\n {\n name: \"itemId\",\n message: \"ENTER THE ID OF THE ITEM YOU WISH TO PURCHASE\",\n type: \"input\",\n validate: function (value) {\n if (isNaN(value) === true || value == 0) {\n return false;\n }\n return true;\n }\n },\n {\n name: \"units\",\n message: \"HOW MANY UNITS WOULD YOU LIKE TO PURCHASE? (TYPE Q TO QUIT)\",\n type: \"input\"\n }\n ]).then(function (answer) {\n // In case the user changed their mind, they can type 'q' and it'll take them back to the starting prompt.\n if (answer.units.toLowerCase() === \"q\") {\n askUser();\n }\n else {\n // Converting the users input into numbers so it can be compared to the table's numerical values.\n answer.itemId = parseInt(answer.itemId);\n answer.units = parseInt(answer.units);\n\n var query = \"SELECT * FROM products WHERE item_id=?\";\n connection.query(query, answer.itemId, function (err, results) {\n if (err) throw err;\n\n // If there isn't as much of the product in stock as the user wanted to order, display message to them.\n if (answer.units > results[0].stock_quantity) {\n console.log(\"\\nNOT ENOUGH OF '\" + results[0].product_name + \"' IN STOCK!\\n\");\n askUser();\n } else {\n // If there is enough of the product in stock, run the function that handles updating the table data.\n // Passing the relevant data as arguements.\n validQuantity(answer.itemId, answer.units, results[0]);\n }\n });\n }\n });\n}", "function whatToBuy() {\n inquirer.prompt([\n {\n type: \"input\",\n name: \"itemID\",\n message: \"Enter the Item ID of the item would you like to purchase\",\n validate: function (input) {\n if (isNaN(input)) {\n return \"Enter the product number\";\n } else {\n return true;\n }\n }\n }\n ]).then(function (user) {\n itemToBuy = user.itemID;\n // after user input is entered, call checkIfItem function\n checkIfItem();\n });\n}", "function displayPurchase(stock) {\n inquirer\n .prompt([\n {\n name: \"id\",\n type: \"input\",\n message: \"What is the ID of the product you would like to buy?\",\n\n },\n {\n name: \"units\",\n type: \"input\",\n message: \"How many units of the product you would like to buy?\",\n validate: function (value) {\n if (isNaN(value) === false) {\n return true;\n }\n return false;\n }\n }\n ])\n .then(function (answer) {\n let choice = stock.find(item => item.item_id === parseInt(answer.id))\n // Subtract thhe amount that I want from the amount that I have\n let new_quant = choice.stock_quantity - answer.units\n // If I have enough to give, give it and update\n if (new_quant >= 0) {\n // Amount chosen times unit price\n let total = choice.price * answer.units\n console.log(\"You spend : $\" + parseFloat(total, 2));\n // when finished prompting, insert a new item into the db with that info\n connection.query(\n `UPDATE bamazon.products SET stock_quantity = ${new_quant} WHERE item_id =${answer.id}`,\n function (err) {\n if (err) throw err;\n console.log(\"Your purchase was created successfully!\");\n // re-prompt the user for if they want to bid or post\n start();\n }\n );\n } else {\n console.log(\"Insuficient amount!\")\n start();\n }\n });\n\n}", "function purchase(action = \"\") {\n if (action == \"init\") {\n }\n\n // Prompt the user to enter Product's item_id to review detail of the product:\n inquirer.prompt([\n {\n name: \"ID\",\n type: \"input\",\n message:\n \"Enter the product's item ID to review detail. [Quit with Ctrl+C]\",\n filter: Number,\n validate: function(val) {\n return !isNaN(val);\n }\n },\n {\n name: \"qty\",\n type: \"input\",\n message: \"OK, how many would you like to buy? \",\n filter: Number,\n validate: function(value) {\n if (isNaN(value) == false) {\n return true;\n } else {\n return false;\n }\n }\n }\n ]).then(function(userInput) {\n connection.query(\"SELECT * FROM products WHERE item_id = ?\", [userInput.ID], function(err, inventoryRes) {\n if (err) {\n console.log(\"ERROR: \", err);\n }\n console.log(\"\");\n console.log(\n \"====================\",\n \"\\nPRODUCT DETAIL: \",\n inventoryRes,\n \"\\n====================\"\n );\n console.log(\"\");\n purchaseItem(userInput.ID, userInput.qty);\n });\n });\n // *** This is the end of the function purchase() ***\n}", "function promptUser() {\n inquirer\n .prompt([\n {\n message: \"Please, insert ID of item you would like to buy\",\n type: \"input\",\n name: \"ID\"\n },\n {\n message: \"How many items would you like to purchase?\",\n type: \"input\",\n name: \"count\"\n }\n ])\n .then(answers => {\n checkQuantity(answers.count, answers.ID);\n });\n }", "function shopping() {\n inquirer.prompt([\n {\n name: \"idSearch\",\n type: \"input\",\n message: \"Please enter the id of the product you would like.\"\n },\n {\n name: \"quantity\",\n type: \"input\",\n message: \"How much would you like?\"\n }\n ]).then(function (response) {\n //sets inputs to variables and pushes them into the purchase function\n var requestedId = response.idSearch;\n var desiredQuantity = response.quantity;\n purchase(requestedId, desiredQuantity);\n });\n}", "function askuser()\n {\n// 6. The app should then prompt users with two messages.\n\n// * The first should ask them the ID of the product they would like to buy.\n// * The second message should ask how many units of the product they would like to buy.\n inquirer.prompt([\n {\n type: \"Input\",\n name: \"productname\",\n message: \"what product would you like to buy today?\"\n },\n{\n type: \"Input\",\n name: \"quantity\",\n message: \"How many units would you like to buy today?\" \n}])\n .then (function (userresponse) {\n // 7. Once the customer has placed the order, your application should check if your store has enough of the product to meet the customer's request.\n\n// * If not, the app should log a phrase like `Insufficient quantity!`, and then prevent the order from going through.\n\n// 8. However, if your store _does_ have enough of the product, you should fulfill the customer's order.\n// * This means updating the SQL database to reflect the remaining quantity.\n// * Once the update goes through, show the customer the total cost of their purchase.\n\n// - - -\n// console.log(userresponse);\nconnection.query(\"select * from products where ?\",[{product_name:userresponse.productname}],function(err,productinfo){\n if(err) throw err;\n// console.log(productinfo);\nif(productinfo=== undefined || productinfo.length == 0)\n{\n \n console.log(\"Invalid product ! Please select a valid product from the list above\")\n \n}\n\nelse\n{\nvar orderquantity=parseInt(userresponse.quantity) ;\n// console.log(orderquantity);\n\nvar quantity=parseInt(productinfo[0].stock_quantity);\nconsole.log(nextline+\"Currently Available : \"+quantity);\nvar price=productinfo[0].price;\nconsole.log(nextline+\"Price per unit : $\"+price);\nvar remaining=quantity-orderquantity;\nconsole.log(nextline+\"No. of units remaining : \"+remaining);\nvar totalcost=orderquantity*price;\nconsole.log(\"Total Cost : $\"+totalcost);\n if (orderquantity > quantity) {\n console.log(nextline+\"Sorry your order has been cancelled.Insufficient quantity!\");\n \n }\n else {\n console.log(nextline+\"Your order is being processesed ..................\"+ nextline);\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: remaining\n },\n {\n product_name: userresponse.productname\n }\n ],\n function(error) {\n if (error) throw err;\n console.log(nextline+\"*************************Order placed successfully!************************\"\n +nextline +\"Your total cost is $\"\n +totalcost+nextline);\n \n }\n );\n connection.end();\n }\n }\n \n })\n})\n }", "function purchase() {\n inquirer\n .prompt([\n {\n type: \"input\",\n name: \"itemID\",\n message: \"What is the ID of the item you would like to purchase?\",\n validate: function(value) {\n if (isNaN(value) === false && value !== '' && parseInt(value) > 0) {\n return true;\n } else {\n console.log(\"\\nPlease enter a valid ID.\");\n return false;\n }\n }\n },\n {\n type: \"input\",\n name: \"itemQuantity\",\n message: \"How many would you like?\",\n validate: function(value) {\n if (isNaN(value) === false && value !== '' && parseInt(value) > 0) {\n return true;\n } else {\n console.log(\"\\nPlease enter a valid quantity.\");\n return false;\n }\n }\n }\n ])\n .then(function(choice) {\n //console.log(\"User's choice: \", choice);\n\n var currentItem = currentInventory.filter(\n item => item.id === parseInt(choice.itemID)\n );\n \n // Above function if written in longer form\n // var currentItem = currentInventory.filter(function(item) {\n // return item.id === parseInt(choice.itemID);\n // });\n\n //console.log(\"currentItem\", currentItem);\n //console.log(\"choice.itemQuantity\", parseInt(choice.itemQuantity));\n //console.log(\"currentItem.stock_quantity\", currentItem[0].stock_quantity);\n \n // if item ID given by the customer does NOT match the ID in the 'products' table\n if (currentItem.length == 0) {\n console.log(\"Sorry that item doesn't exist\");\n // ask customer if they want to move onto a different purchase\n confirmNextPurchase();\n\n //if item ID given by the customer DOES match the ID in the 'products' table\n } else {\n // If the quantity requested is LESS THAN OR EQUAL to the stock quantity\n if (parseInt(choice.itemQuantity) <= currentItem[0].stock_quantity) {\n //fulfill order\n //console.log(\"Enough quantity\");\n console.log(\"You have picked \" + choice.itemQuantity + \" of the \" + currentItem[0].product_name + \".\")\n var cost = parseInt(choice.itemQuantity) * currentItem[0].price;\n console.log(\"Please pay the total of $\" + cost + \" before moving onto the next purchase!\")\n \n // Check if the customer paid\n paidOrUnpaid( function(isPaid) {\n if(isPaid){\n // ONLY update the inventory (aka the 'products' table) if the customer has PAID\n\n //console.log('isPaid working');\n var updatedStock = currentItem[0].stock_quantity - choice.itemQuantity;\n //console.log(\"updatedStock\", updatedStock);\n\n // UPDATE the 'stock_quantity' in the 'products' table using the product ID chosen by the customer after the purchase\n updateInventory(parseInt(choice.itemID), updatedStock);\n confirmNextPurchase();\n // Ends connection if the amount is NOT PAID\n } else {\n console.log(\"The amount is not paid.\");\n connection.end();\n }\n });\n // If the quantity requested is GREATER THAN the stock quantity\n } else {\n // Alert customer about the quantity left\n console.log(\"Insufficient quantity!\");\n console.log(\"We only have \" + currentItem[0].stock_quantity + \" of the \" + currentItem[0].product_name + \" left.\")\n // Ask if customer would like to move onto a new purchase\n confirmNextPurchase();\n }\n }\n });\n}", "function promptCustomer(availableItems) {\n inquirer.prompt([\n {\n type: \"list\",\n message: \"What product would you like to buy?\",\n choices: availableItems,\n name: \"customerSelection\"\n },\n {\n type: \"input\",\n message: \"How many would you like to buy?\",\n name: \"purchaseQuantity\",\n validate: (value) => {\n// This makes it so you cannot type a word in for quantity\n return !isNaN(value);\n }\n }\n ]).then(customerSelection => {\n checkAvailability(customerSelection);\n });\n}", "function buyThis(){\n inqurier.prompt([\n {\n message: \"What is the ITEM ID of the PRODUCT you would like to buy?\",\n name: \"id\"\n },\n { \n message: \"How many UNITS would you like to buy?\",\n name: \"purchase\",\n },\n ]).then(function(answer){\n //convert to integers\n var id = parseInt(answer.id);\n var quantity = parseInt(answer.purchase)\n\n //purcahse logic\n\n if (isNaN(answer.id) == true || id <=0 || id > resultArray.length) {\n //error message for invalid number entry \n console.log(\"Error: INVALID ITEM ID\")\n }\n else if (isNan(answer.purcahse) == true || quantity <= 0){\n //error for purchasing zero items\n console.log(\"You must order more than one\")\n }\n else if (quantity > resultArray[id -1].stock_quantity){\n //error for not enough stock \n console.log(\"WE ARE OUT OF THAT\")\n }\n else {\n //for a sucessful order\n purchaes.push(resultArray[id - 1].product_name);\n amounts.push(quantity);\n\n //total of curent order and total order\n var orderCost = quantity * resultArray[id-1].price;\n orderCost = parseFloat(orderCost.toFixed(2));\n total += orderCost;\n total = parseFloat(total.toFixed(2))\n\n sales = resultArray[id - 1].product_sales + orderCost;\n\n console.log(\"You have selected ITEM\" + id + \",\" + resultArray[id - 1].product_name + \".\" )\n console.log(\"This item costs $\" + resultArray[id - 1].price + \" per unit. You have ordered \" + quantity + \" units.\");\n console.log(\"This purchase costs $\" + orderCost + \".\");\n \n //display quantites and ordered as well as cost\n console.log(\"YOU HAVE ORDERED\")\n for (var i = 0; i < purchaes.length; i++){\n console.log(amounts[i] + \"|\" + purchaes[i]);\n }\n console.log(\"mYour total cost is \" + total + \".\");\n\n\t\t\t// query to update the database\n\t\t\tupdate = \"UPDATE products SET stock_quantity = \" + (resultArray[id - 1].stock_quantity - quantity) + \", product_sales = \" + sales + \" WHERE item_id = \" + id;\n\n\t\t\t// updates the database\n\t\t\tconnection.query(update, function (error, results, fields) {\n\t\t\t\tif (error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t};\n });\n keepGoing();\n }\n })\n}", "function userInput(){\n\n inquirer\n .prompt([\n {\n type: \"input\",\n name: \"itemId\",\n message: \"Type the ID of the item you would like to purchase\"\n },\n {\n type: \"input\",\n name: \"itemQuantity\",\n message: \"How many?\"\n }\n ])\n .then(answer => {\n \n var id = answer.itemId;\n var quantity = answer.itemQuantity;\n\n getProductQuantity(id,quantity);\n\n })\n }", "function prompt(){\n\tinquirer.prompt([{\n\t\tname: \"buy_item\",\n\t\ttype: \"input\",\n\t\tmessage: \"What would you like to purchase? (Type in Item ID)\",\n\t\tvalidate: function(val){//http://simiansblog.com/2015/05/06/Using-Inquirer-js/\n\t\t\tif (isNaN(val) === false){\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t},\n\t{\n\t\tname: \"buy_quant\",\n\t\ttype: \"input\",\n\t\tmessage: \"Hom many would you like?\",\n\t\tvalidate: function(val){ //or can read https://www.npmjs.com/package/inquirer\n\t\t\tif (isNaN(val) === false) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t}]).then(function(res) {\n\t\tvar item = parseInt(res.buy_item); //user inputted item id: assumption that database will not change item id\n\t\tvar quant = parseInt(res.buy_quant); //user will give quantity\n\t\tvar product = productArr[item-1]; //get the product from the stored array list\n\t\t// this is instead of doing another query call to database, which probably is best if database is really large; don't want to be storing everything in js meomry\n\t\tif (quant > product.quant) {\n\t\t\tconsole.log(\"Not enough items in stock; there are only \"+product.quant+\" left!\");\n\t\t\tconsole.log(\"Please re-select: \");\n\t\t\tprompt(); //user will have to re-select what and how many they will buy\n\t\t}\n\t\telse {\n\t\t\tdisplay(product);\n\t\t\tvar total = quant*product.price;\n\t\t\tconsole.log(\"your total comes to $\"+total);\n\n\t\t\tinquirer.prompt([{\n\t\t\t\tname: \"confirm\",\n\t\t\t\ttype: \"confirm\",\n\t\t\t\tmessage: \"Confirm purchase?\",\n\t\t\t\tdefault: true\n\t\t\t}]).then(function(res){\n\t\t\t\tif (res.confirm){\n\t\t\t\t\tvar left = product.quant - quant;\n\t\t\t\t\tconsole.log(\"Purchase successful!!\");\n\t\t\t\t\tinventory(item, left);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//if don't want to purchase can end session\n\t\t\t\t\tconsole.log(\"Good Bye! Thanks for coming\");\n\t\t\t\t\tconnection.end();\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t});\n}", "function purchase(shirts, pants, shoes, discount) {\n\n if (!isLoaded) {\n if (typeof discount != 'number') {\n console.log('please enter number');\n return;\n }\n\n if (shirts <= stockShirts.quantity) {\n console.log('shirts are available');\n } else {\n console.log('shirts are not available');\n return;\n }\n\n if (pants <= stockPants.quantity) {\n console.log('pants are available');\n } else {\n console.log('pants are not available');\n return;\n }\n\n if (shoes <= stockShoes.quantity) {\n console.log('shoes are available');\n } else {\n console.log('shoes are not available');\n return;\n }\n\n if (discount > 0 && discount <= 100) {\n\n console.log('discount valid');\n\n }\n\n printBill(shirts, pants, shoes, discount);\n } else {\n console.log('Issue with stock loading, Unable to process purchase');\n }\n}", "function customerSelect () {\n inquirer.prompt([\n {\n type: 'input',\n name: 'item_num',\n validate: (test_value) => { // check for an integer number > 0\n return (/^\\d*$/.test(test_value) && test_value > 0) ? true : 'Enter a whole number greater than zero';\n },\n message: 'Enter the Item ID (# above) of the product you wish to purchase'\n },\n {\n type: 'input',\n name: 'item_qty',\n validate: (test_value) => { // check for an integer number > 0\n return (/^\\d*$/.test(test_value) && test_value > 0) ? true : 'Enter a whole number from the list above.';\n },\n message: `Enter the quantity you wish to purcahse`\n }\n ])\n .then( (result) => {\n let id = result.item_num;\n let qty = result.item_qty;\n //console.log(id,qty);\n fillOrder(id, qty);\n });\n}", "function Buy_Prompt() {\n inquirer.prompt([\n // Here we create an input text prompt for getting the ITEM ID.\n {\n type: \"input\",\n message: \"Please enter the ID of the product you would like to buy.\",\n name: \"ITEM_ID\",\n filter: Number\n },\n // Here we create an input text prompt for getting the quantity the user wants to buy.\n {\n type: \"input\",\n message: \"How many items would you like to buy?\",\n name: \"BUY_QUANTITY\",\n filter: Number\n },\n ]).then(function (inquirerResponse) {\n var buyQuantity = inquirerResponse.BUY_QUANTITY;\n var item = inquirerResponse.ITEM_ID;\n customerOrder(item, buyQuantity);\n });\n}", "function customerPrompt(res) {\n\tinquirer.prompt([{\n\t\ttype: \"input\",\n\t\tname: \"selection\",\n\t\tmessage: \"What is the id of the product you wnat to buy?\"\n\t},\n\t{\n\t\ttype: \"input\",\n\t\tname: \"quantity\",\n\t\tmessage: \"How many do you want to buy?\"\n\t}]).then(function order) {\n\t\tvar quantity = order.quantity;\n\t\tvar itemId = order.id;\n\t\tdbConnection.query(\"SELECT * FROM products where id=\" itemID, function(err, selectedItem) {\n\t\t\tif (err) throw err;\n\t\t\t if (selectedItem[0])\n\t\t};\n\t}\n}", "function purchaseMore() {\n inquirer.prompt({\n name: \"purchaseMore\",\n type: \"confirm\",\n message: \"Would you like to make another purchase?\"\n })\n .then(function (answer) {\n //If yes, then call the purchaseItem function again\n console.log()\n if (answer.purchaseMore === true) {\n 10\n itemDisplay();\n //Otherwise, call the endConnection function\n } else if (answer.purchaseMore === false) {\n endConnection();\n }\n })\n}", "function askStockAmount() {\n inquirer.prompt([\n {\n name: \"addStockAmount\",\n message: \"How many units do you want to add?\",\n type: \"input\"\n }\n ]).then(function(data) {\n addStockAmount = parseInt(data.addStockAmount);\n\n getStock();\n\n }); // close prompt\n } // close askStockAmount()", "function userQuantityChoice(itemName) {\n inquirer.prompt([\n {\n type: \"input\",\n name: \"quantity\",\n message: \"How many would you like?\",\n validate: function(val){\n return val > 0 || val.toLowerCase() === \"q\";\n }\n }\n ]).then(function(val) {\n // turn strin into a number\n quitShopping(val.quantity);\n let quantity = parseInt(val.quantity);\n\n // loop through the database to check if there if enough inventory of the chosen item\n if (quantity > itemName.stock_quantity) {\n console.log(\"Sorry, we do not have enough of that item.\");\n displayProducts();\n } else {\n purchaseItem(itemName, quantity);\n }\n });\n}", "function queryCustomer()\n{\n inquirer.prompt([\n {\n name: \"item\",\n type: \"input\",\n message: \"What is the item ID you would like to purchase?\",\n validate: function(value) {\n if (isNaN(value) === false) {\n return true;\n }\n return false;\n }\n },\n {\n name: \"quantity\",\n type: \"input\",\n message: \"How many units would you like to purchase?\",\n validate: function(value) {\n if (isNaN(value) === false) {\n return true;\n }\n return false;\n }\n }]).then(function(answer) {\n processOrder(answer.item, answer.quantity);\n });\n}", "function Withdraw(){\r\n\r\n\tvar Amount = prompt(\"Please enter an Amount to Withdraw:\");\r\n\r\n\r\n}", "function purchaserQuery() {\n\tinquirer.prompt([\n\t{\n\t\ttype: \"input\",\n\t\tname: \"query\",\n\t\tmessage: \"Input the item ID you wish to purchase.\",\n\t\t//Prevents the app from accepting non-numerical inputs\n\t\tvalidate: function(res) {\n\t\t\tif (isNaN(res) === false) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconsole.log(\"You need to enter a valid numerical ID.\");\n\t\t\treturn false;\n\t\t}\n\t},\n\t{\n\t\ttype: \"input\",\n\t\tname: \"quantity\",\n\t\tmessage: \"How many of this item will you purchase?\",\n\t\tvalidate: function(res) {\n\t\t\tif (isNaN(res) === false) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tconsole.log(\"You need to enter a valid numerical amount.\");\n\t\t\treturn false;\n\t\t}\n\t}\n\t]).then(function(info) {\n\tvar item = info.query;\n\tvar quantity = info.quantity;\n\t//This grabs information from the MySQL database to assign as useable variables\n\tconnection.query(\"SELECT * FROM products WHERE item_id = ? \", item, function(err, res) {\n\t\t\tif (err) throw err;\n\t\t\tvar department = res[0].department_name;\n\t\t\tvar stock = res[0].stock_quantity;\n\t\t\tif (stock >= quantity) {\n\t\t\t\tvar stockTotal = stock - quantity;\n\t\t\t\tvar price = res[0].price;\n\t\t\t\tvar cost = quantity * price;\n\t\t\t\t//Alters the information within the database to reflect customer selections\n\t\t\t\tconnection.query(\"UPDATE departments SET ? WHERE ?\", [{total_sales: cost}, {department_name: department}], function(err, res) {});\n\t\t\t\t//Represents the user's \"Shopping cart\"\n\t\t\t\trunningTotal = runningTotal + cost;\n\t\t\t\tconsole.log(\"Your total comes to $\" + runningTotal);\n\t\t\t\t//Changes the quantity available after user check-out\n\t\t\t\tconnection.query(\"UPDATE products SET ? WHERE ?\", [{stock_quantity: stockTotal}, {item_id: item}], function(err, res) {});\n\t\t\t\t//Option to disconnect from server and end application\n\t\t\t\tinquirer.prompt([\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"confirm\",\n\t\t\t\t\t\tname: \"complete\",\n\t\t\t\t\t\tmessage: \"Have you finished shopping?\"\n\t\t\t\t\t}\n\t\t\t\t]).then(function(info){\n\t\t\t\t\tvar complete = info.complete;\n\n\t\t\t\t\tif (complete) {\n\t\t\t\t\t\tconsole.log(\"Thank you for shopping with the Bamazon Bookstore.\");\n\t\t\t\t\t\tconnection.end();\n\t\t\t\t\t} else {\n\t\t\t\t\t\trunProcess();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t//If the item is out-of-stock, the user will be prompted back to start.\n\t\t\t} else {\n\t\t\t\tconsole.log(\"Insufficient quantity!\");\n\t\t\t\trunProcess();\n\t\t\t}\n\t\t});\n\t});\n}", "function postProducts() {\n //get user money\n function getBanckAccountBalance() {\n return banckAccountBalance;\n }\n\n let minMoney = 100\n if (banckAccountBalance < minMoney) {\n alert('Sorry. you do not haave enough cash to bu our products. We therefore do not want to display our products to you.');\n console.log('User do not have enough money.');\n\n } else if (banckAccountBalance >= minMoney) {\n alert(\n \"Have a look at our list of products\\n#Iphone X: $600\\n#Nokia C9: $1,200\\n#Samsung Galaxy S20: $3,000\\n#Earphone black: $200\\n#Iphone charger: $300\\n\\nPlease remember our choice and write it down in the next window.\"\n );\n\n // prompt user to select phones\n function getUserToBuy() {\n var answer1 = prompt('write yes or no.\\nWant to buy #Iphone X ?');\n var answer2 = prompt('select yes or no.\\n#want to buy #Nokia C9 ?');\n var answer3 = prompt('select yes or no\\nWant to buy Samsung Galaxy S20 ?');\n var answer4 = prompt('select yes or no\\nWant to buy #Earphone black ?');\n var answer5 = prompt('select yes or no\\nWant to buy #Iphone charger ?');\n\n if (answer1 == 'no' && answer2 == 'yes' && answer3 == 'yes' && answer4 == 'yes') {\n let answer2 = 1.200;\n let answer3 = 3.000;\n let answer4 = 200;\n let answer5 = 300;\n\n var result = answer2 + answer3 + answer4 + answer5;\n return alert('The total price of our purchase is: ' + '$' + result);\n\n } else if (answer1 == 'yes' && answer2 == 'no' && answer3 == 'yes' && answer4 == 'yes') {\n let answer1 = 600;\n let answer3 = 3.000;\n let answer4 = 200;\n let answer5 = 300;\n var result = answer1 + answer3 + answer4 + answer5;\n return alert('The total price of our purchase is: ' + '$' + result.toString(2));\n } else if (answer1 == 'yes' && answer2 == 'yes' && answer3 == 'no' && answer4 == 'yes') {\n let answer1 = 600;\n let answer2 = 1.200;\n let answer4 = 200;\n let answer5 = 300;\n var result = answer1 + answer2 + answer4 + answer5;\n return alert('The total price of our purchase is: ' + '$' + result.toString(2));\n }\n else if (answer1 == 'yes' && answer2 == 'yes' && answer3 == 'yes' && answer4 == 'no') {\n let answer1 = 600;\n let answer2 = 1.200;\n let answer3 = 3.000;\n let answer5 = 300;\n var result = answer1 + answer2 + answer3 + answer5;\n return alert('The total price of our purchase is: ' + '$' + result.toString(2));\n }\n else if (answer1 == 'yes' && answer2 == 'yes' && answer3 == 'yes' && answer4 == 'yes' && answer5 == 'no') {\n let answer1 = 600;\n let answer2 = 1.200;\n let answer3 = 3.000;\n let answer4 = 200;\n var result = answer1 + answer2 + answer3 + answer4;\n return alert('The total price of our purchase is: ' + '$' + result.toString(2));\n } else {\n let answer1 = 600;\n let answer2 = 1.200;\n let answer3 = 3.000;\n let answer4 = 200;\n let answer5 = 300;\n var result = answer1 + answer2 + answer3 + answer4 + answer5;\n return alert('The total price of our purchase is: ' + '$' + result.toString(2));\n }\n }\n\n return getUserToBuy();\n\n } else {\n return console.log('something went wrong!');\n\n }\n }", "function purchase() {\n con.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n inquirer.prompt([\n {\n name: \"choice\",\n type: \"input\",\n message: \"Input ID of item you would like to purchase.\",\n validate: function(value) {\n\n //Validates if input is a number\n var pass = value.match(/\\d/g);\n if (pass) {\n return true;\n }\n return \"Please enter a number ID\" \n }\n },\n {\n name: \"quantity\",\n type: \"input\",\n message: \"How many would you like to purchase?\",\n validate: function(value) {\n\n //Validates if input is a number\n var pass = value.match(/\\d/g);\n if (pass) {\n return true;\n }\n return \"Please enter a number quantity\" \n }\n }\n ])\n .then(function(ans) {\n\n //Traverses the array to locate the item the user selected\n var chosenItem;\n for (var i = 0; i < res.length; i++) {\n if (ans.choice == res[i].item_id) {\n chosenItem = res[i];\n console.log(\"You have chosen \" + ans.quantity + \" of \" + chosenItem.product_name);\n }; \n };\n\n //If in stock, fulfills customer's request\n if (chosenItem.stock_quantity >= ans.quantity) {\n console.log(\"Your order is being processed!\")\n\n //Calculates new stock of product selected\n updatedStock = chosenItem.stock_quantity - ans.quantity;\n\n //Updates MySql with new stock quantity\n con.query(\"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: updatedStock\n },\n {\n item_id: chosenItem.item_id\n }\n ],\n function(err) {\n if (err) throw err;\n console.log(\"Purchase successful!\");\n\n //Shows customer cost of purchase(s)\n console.log(\"Your total comes out to \" + (ans.quantity * chosenItem.price) + \"$.\");\n\n //Prompts the user to continue shopping or not\n inquirer.prompt([\n {\n name: \"continue\",\n type: \"confirm\",\n message: \"Do you want you to continue shopping?\"\n }\n ])\n .then(function(ans) {\n if (ans.continue == true) {\n purchase();\n } else if (ans.continue == false) {\n console.log(\"Come back soon!\");\n con.end();\n }\n })\n })\n\n //If not in stock, notifies customer and ends transaction\n } else if (chosenItem.stock_quantity <= ans.quantity) {\n console.log(\"Sorry, Insufficient Quantity.\")\n\n //Prompts the user to continue shopping or not\n inquirer.prompt([\n {\n name: \"continue\",\n type: \"confirm\",\n message: \"Do you want you to continue shopping?\"\n }\n ])\n .then(function(ans) {\n if (ans.continue == true) {\n purchase();\n } else if (ans.continue == false) {\n console.log(\"Come back soon!\");\n con.end();\n }\n })\n };\n });\n });\n}", "function purchaseStart() {\n inquirer\n .prompt([\n {\n type: \"input\",\n name: \"ID\",\n message: \"What is the id number of your product?\",\n validate: validateInput,\n filter: Number\n },\n {\n type: \"input\",\n name: \"stockQuantity\",\n message: \"How many units would you like to purchase today?\",\n validate: validateInput,\n filter: Number\n }\n ])\n .then(function(answer) {\n //take answers and pass through as variable parameters\n\n var requestedQuantity = answer.stockQuantity;\n var idRequested = answer.ID;\n // use the mysql command to select product from table created in bamazon_db\n query = \"SELECT * FROM products WHERE ?\";\n connection.query(query, { id: idRequested }, function(err, res) {\n if (res.length === 0) {\n console.log(\"error!\");\n throw err;\n\n // displayProduct();\n } else {\n var selection = res[0];\n\n if (requestedQuantity <= selection.stock_quantity) {\n console.log(\" Your order is now being processed!!!\");\n\n var stockUpdate =\n \"UPDATE products SET stock_quantity = \" +\n (selection.stock_quantity - requestedQuantity) +\n \" WHERE id = \" +\n idRequested;\n\n connection.query(stockUpdate, function(err, res) {\n if (err) throw err;\n\n console.log(\n \"Your order is completed cool beans!! Pay me now!!!\" +\n selection.price * requestedQuantity\n );\n console.log(requestedQuantity);\n // the inquirer list below has a case function that allows the user to decide if they want to continue shopping or not\n // the breaks are used to cut the connection of each option\n inquirer\n .prompt({\n name: \"choose\",\n type: \"list\",\n message: \"would you like to purchase more today?\",\n choices: [\"Yes I would!\", \"No, thanks\"]\n })\n .then(function(answer) {\n switch (answer.choose) {\n case \"Yes I would!\":\n displayProduct();\n break;\n\n case \"No, thanks\":\n connection.end();\n break;\n }\n });\n });\n } else {\n // returns back to the original table and prompts user to try again next time\n displayProduct();\n // change to error message\n console.log(\"Sorry but we cannot process that quantity amount\");\n console.log(\"We will have more in stock soon! \");\n }\n }\n });\n });\n}", "function askAction() {\n\n\tconnection.query(\"SELECT * FROM products\", function(err,res) {\n\n\t\t//uses the inquirer package\n\t\tinquirer\n\t\t\t.prompt([\n\t\t\t{\n\t\t\t\tname:\"itemid\",\n\t\t\t\ttype:\"input\",\n\t\t\t\tmessage:\"What is the ID of the product you'd like to purchase?\",\n\t\t\t\t\n\t\t\t\t//this function ensures that a number is input\n\t\t\t\tvalidate: function(value) {\n\t\t\t\t\tif (isNaN(value) === false) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\tname:\"quantity\",\n\t\t\t\ttype:\"input\",\n\t\t\t\tmessage: \"How many would you like to buy?\",\n\t\t\t\t\n\t\t\t\t//this function ensures that a number is input\n\t\t\t\tvalidate: function(value) {\n\t\t\t\t\tif (isNaN(value) === false) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t]).then(function(answer) {\n\n\t\t\t\t//Checking if its working\n\t\t\t\t// console.log(\"TEST: working\");\n\n//===========================================CORRESPONDING WITH DATABASE====================================\n\n\t\t\t\t//obtaining the index (hence the -1) that will extract the product name & other properties\n\t\t\t\tvar chosenId = answer.itemid - 1;\n\n\t\t\t\t//this will assign a variable to contain the customer's product\n\t\t\t\tvar selectedProductDetails = res[chosenId];\n\n\t\t\t\t//checking if it works, output in form of an object\n\t\t\t\t// console.log(selectedProductDetails);\n\n//===========================================PURCHASE CONDITIONS====================================\n\n\t\t\t\t//checking if user's quantity input is registered\n\t\t\t\t// console.log(\"Quantity selected by customer: \" + answer.quantity)\n\n\t\t\t\t//An if else statement to check product availability\n\t\t\t\tif (answer.quantity <= selectedProductDetails.stock_quantity) {\n\n\t\t\t\t\tconsole.log(chalk.magenta(\"\\nCongratulations on your purchase(s)!\\n\"));\n\n//===========================================UPDATE INVENTORY====================================\n\t\t\t\t\t\n\t\t\t\t\t//creating a new global variable that will hold the new value\n\t\t\t\t\tvar updatedStock;\n\n\t\t\t\t\t//the function that minus sold goods from unsold\n\t\t\t\t\tfunction updateStock() {\n\t\t\t\t\t\tupdatedStock = selectedProductDetails.stock_quantity - answer.quantity;\n\t\t\t\t\t};\n\n\t\t\t\t\t//calling the function\n\t\t\t\t\tupdateStock();\n\n\n\t\t\t\t\t//updating the databse to reflect changes\n\t\t\t\t\tconnection.query(\n\t\t\t\t\t\t\"UPDATE `bamazon_db`.`products` SET ? WHERE ?\",\n\t\t\t\t\t\t[{\n\t\t\t\t\t\t\tstock_quantity: updatedStock\n\t\t\t\t\t\t}\n\t\t\t\t\t\t,{\n\t\t\t\t\t\t\titem_id: answer.itemid\n\t\t\t\t\t\t}]\n\t\t\t\t\t)\n\n\t\t\t\t}\n\n\t\t\t\telse {\n\n\t\t\t\t\t//informs user about unavailability\n\t\t\t\t\tconsole.log(chalk.red(\"Insufficient Quantity!\\n\"));\n\t\t\t\t}\n\n\t\t\t\taskAgain();\n\n\t\t\t});\n\t\t\t\t\n\n\t\t});\n\n}", "function howMany(product, price){\n inquirer.prompt({\n name: \"howMany\",\n type: \"input\",\n message: \"How many would you like?\"\n }).then(function(answer){\n if(isNaN(parseInt(answer.howMany))){\n console.log(\"please type a valid number\");\n howMany(product,price);\n }else {\n var finalPrice = (parseInt(answer.howMany) * price).toFixed(2);\n var quantity = parseInt(answer.howMany);\n if(quantity > currentQuantity){\n console.log(\"Sorry. We do not have that many of that item\");\n howMany(product, price);\n } else {\n console.log(\"that will be \" + finalPrice); \n purchase(product, price, quantity);\n };\n }\n })\n}", "function purchase() {\n\n inquirer\n .prompt([\n {\n name: \"itemID\",\n type: \"input\",\n message: \"\\nGreat! What is the Item # of the product you would like to purchase?\\n\"\n },\n {\n name: \"units\",\n type: \"number\",\n message: \"\\nHow many units of the item would you like to purchase?\\n\"\n },\n\n ])\n .then(function (selection) {\n // get the information of the chosen item\n\n // query the database for all items available to purchase\n connection.query(\"SELECT * FROM products WHERE id=?\", selection.itemID, function (err, res) {\n\n for (var i = 0; i < res.length; i++) {\n\n if (selection.units > res[i].stockQuantity) {\n\n console.log(chalk.green.bold(\"===================================================\"));\n console.log(chalk.green.bold(\"Sorry! Not enough of that item in stock.\"));\n console.log(chalk.green.bold(\"===================================================\"));\n newOrder();\n\n } else {\n //list item information for user for confirm prompt\n console.log(chalk.green.bold(\"===================================================\"));\n console.log(chalk.green.bold(\"Awesome! We can fulfull your order.\"));\n console.log(chalk.green.bold(\"===================================================\"));\n console.log(chalk.green.bold(\"You've selected:\"));\n console.log(chalk.green.bold(\"----------------\"));\n console.log(chalk.green.bold(\"Item: \" + res[i].productName));\n console.log(chalk.green.bold(\"Department: \" + res[i].departmentName));\n console.log(chalk.green.bold(\"Price: $\" + res[i].price));\n console.log(chalk.green.bold(\"Quantity: \" + selection.units));\n console.log(chalk.green.bold(\"----------------\"));\n console.log(chalk.green.bold(\"Total: $\" + res[i].price * selection.units));\n console.log(chalk.green.bold(\"===================================================\\n\"));\n\n var newStock = (res[i].stockQuantity - selection.units);\n var purchaseId = (selection.itemID);\n //console.log(newStock);\n confirmPrompt(newStock, purchaseId);\n }\n }\n });\n })\n}", "function likeToBuy() { \n inquirer\n .prompt([\n {\n name: \"itemID\",\n message: chalk.bold.blue(\"Please enter the ID of the product you would like to buy.\"),\n type: \"number\",\n },\n {\n name: \"quantity\",\n message: chalk.bold.blue(\"How many items would you like to buy?\"),\n type: \"number\",\n }\n ])\n .then(function (customerCart) {\n // If the the answers are inputed, we display the reponse\n var itemCustomerWants = customerCart.itemID;\n var howManyCustomerWants = customerCart.quantity;\n checkInventory(itemCustomerWants, howManyCustomerWants)\n });\n // connection.end(); \n }", "function askCustomer(item) {\n inquirer.prompt([\n {\n type: \"input\",\n name: \"idpicked\",\n message:\n \"What is the ID of the product you want to buy? || if you changed your mind then exit by tyiping. 'Nevermind'\",\n validate: function (value) {\n if (value === \"Nevermind\") {\n var quitingresponse = \"leave my store\";\n } else {\n var customerwants = parseInt(value);\n }\n }.then(function (value) {\n console.log(\"you chose to buy\" + value);\n }),\n },\n ]);\n}", "function welcomePurchase(){\n inquirer.prompt([{\n name: \"item\",\n type: \"input\",\n message: \"What item would you like to purchase? Enter the Item ID to continue\",\n validate: function(input){\n if(isNaN(input) === false){\n return true;\n } else {\n console.log(\"Invalid Item ID. Please try again.\")\n return false;\n }\n }\n },\n {\n name: \"amount\",\n type: \"input\",\n message: \"How many would do you wish to purchase?\",\n validate: function(input){\n if(isNaN(input) === false){\n return true;\n } else {\n console.log(\"Invalid quantity. Please try again.\")\n return false;\n }\n } \n }]).then(function (customerSelect){\n \n // connect to database based on customer item and quantity selection\n query = connection.query (\"SELECT * FROM products WHERE item_id=?\", customerSelect.item, function (err, res){\n if (err) throw err;\n // console.log(\"affected rows: \", res.length)\n if(customerSelect.amount > res.stock_quantity){\n console.log(\"Insufficient quantity! Please input a value less than or equal to the quantity available in stock\");\n return;\n }\n if (!res){\n console.log(\"Oops! It looks like you did not select a product. Please select an item listen by typing in the corresponding Item ID\")\n }\n\n //////////////////////////////////////// Update table after purchase and print \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n connection.query(\"UPDATE products SET ? WHERE ?\", [\n {\n stock_quantity: (res[0].stock_quantity - customerSelect.amount)\n },\n {\n item_id: customerSelect.item\n }\n ], function(err, res) {\n if(customerSelect.amount == 0){\n console.log(\"\\n \\t Oops, you did not provide a valid number to purchase! \\n\");\n welcomePurchase();\n } else {\n console.log(`\n You've successfully purchased ${customerSelect.amount} units of Item ID: ${customerSelect.item}!\n `);\n nextPrompt();\n }\n }); \n });\n });\n }", "function ask() {\n \n inquirer\n .prompt([\n {\n name: \"chooseItemID\",\n type: \"input\",\n message: \"What is the ID number of the product you would like to buy?\",\n },\n {\n name: \"chooseItemQuantity\",\n type: \"input\",\n message: \"How many would you like to buy?\",\n }\n ]).then(function (answer) {\n chosenQuantity = answer.chooseItemQuantity;\n chosenID = answer.chooseItemID;\n checkInventory();\n });\n \n}", "function purchase() {\n inquirer.prompt([{\n name: \"item_id\",\n type: \"input\",\n message: \"What is the ID of the item you would like to purchase?\",\n validate: validateNumber,\n filter: Number\n },\n\n {\n name: \"quantity\",\n type: \"input\",\n message: \"How many units would you like to purchase?\",\n validate: validateNumber,\n filter: Number\n }\n ]).then(function (input) {\n\n //capture user response in variables\n var chosenID = input.item_id;\n var userAmount = input.quantity;\n \n //query mysql table to grab selected item information\n var queryStr = 'SELECT * FROM products WHERE ?';\n\n\n connection.query(queryStr, {\n item_id: chosenID\n }, function (err, data) {\n if (err) throw err;\n\n //display item selected to verify user input is being captured and correctly pulled from database\n // console.log(res);\n\n // if user amount requested is less than or equal to stock quantity value, subtract value from stock quantity\n else {\n var itemData = data[0];\n\n //if the requested amount is less than or equal to the quantity in stock, purchase is valid\n if (userAmount <= itemData.stock_quantity) {\n console.log(\"Sending out your order!\");\n\n //capture query string to update table where the item is equal to the user chosen id\n var updateQueryStr = 'UPDATE products SET stock_quantity = ' + (itemData.stock_quantity - userAmount) + ' WHERE item_id = ' + chosenID;\n\n //update the table stock quantity\n connection.query(updateQueryStr, function (err, data) {\n if (err) throw err;\n\n console.log(\"Your order is on it's way! The total price is $\" + itemData.price * userAmount);\n\n connection.end();\n\n });\n\n } else {\n console.log(\"Sorry! There is not enough product in stock\");\n\n //display table after values are updated\n start();\n }\n\n\n }\n\n\n });\n\n });\n\n}", "function select() {\n inquirer\n .prompt([\n // Here we create a basic text prompt.\n {\n // ask for product id\n type: \"input\",\n message: \"What ID # would you like to purchase?\",\n name: \"select\",\n },\n\n {\n // ask for quanitity\n type: \"input\",\n message: \"How many would you like to purchase?\",\n name: \"amount\"\n },\n\n ])\n // confirm their purchase\n .then(function(input) {\n var userInput = input.select;\n var userQuantity = input.amount;\n // check for id number to be between 1 and 10\n if (input.select >= 1 && input.select <= 20) {\n console.log(\"You have selected \" + userQuantity + \" of item id \" + userInput + \".\");\n \n connection.query(\"SELECT * FROM products\", function(err, res) {\n // var to subtract user quanitity from database\n var subtract = ((res[userInput - 1].quantity)-userQuantity)\n if (err) throw err;\n // Log all results of the SELECT statement\n if (userQuantity <= res[userInput - 1].quantity){\n console.log(\"Thank you for your purchase! Your total is $\" + userQuantity * (res[userInput - 1].price) + \".\");\n var query = connection.query(\n // update quantity by id\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n quantity: subtract\n },\n {\n id: userInput\n }\n ],\n function(err, res) {\n // end of update function message\n console.log(\" Have A Great Day!\\n\");\n connection.end();\n }\n );\n }\n else {\n // messeage if quantity is not available, reset to select function\n console.log(\"Sorry, we only have \" + res[userInput - 1].quantity + \" of this item.\")\n select();\n }\n });\n }\n else {\n // message if id is not an DataTransferItem, reset to select function\n console.log(\"Please pick an item number in the inventory.\");\n select();\n }\n })\n .catch(function(err){\n console.log(err);\n });\n \n}", "function confirmNextPurchase() {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"isPurchasing\",\n message: \"Is there anything else you would like purchase?\",\n choices: [\"Yes\", \"No\"]\n }\n ])\n .then(function(answer) {\n // if the customer is doing a NEXT purchase, execute function 'purchase'\n // else, end the connection\n if (answer.isPurchasing === \"Yes\") {\n queryTable(purchase);\n } else {\n console.log(\"Thank you for shopping with us! See you again soon!\");\n connection.end();\n }\n });\n}", "function purchase(itemId, neededQuant) {\n connection.query(`SELECT * FROM products WHERE id = ${itemId}`, function (err, res) {\n if (err) throw err;\n if(res[0].stock_quantity < neededQuant) {\n console.log(\"Insufficient stock! Sorry. Please check again.\")\n } else {\n connection.query(`UPDATE products SET stock_quantity = ${res[0].stock_quantity} - ${neededQuant} WHERE id = ${itemId}`);\n //sets price to a variable for easy use\n var total = res[0].price * neededQuant;\n console.log(`\nYour total today comes up to ${total}. Thank you for shopping and please come again.\n `)\n }\n connection.end();\n });\n}", "function customerSelection() {\n //callback to populate the list in the CLI and push it to an array as the inquirer list needs.\n readProducts(function (res) {\n var resArr = [];\n\n for (var i = 0; i < res.length; i++) {\n resArr.push(\n res[i].idproducts +\n \" \" +\n res[i].product_name +\n \" || Dept: \" +\n res[i].department_name +\n \" || Product Price: \" +\n res[i].price +\n \" || Stock Qty: \" +\n res[i].stock_quantity\n );\n }\n inquirer\n .prompt([{\n type: \"list\",\n name: \"product_name\",\n message: \"What would you like to buy?\",\n choices: resArr\n },\n {\n type: \"input\",\n name: \"purchaseQty\",\n message: \"How many would you like to buy?\"\n }\n ])\n .then(answers => {\n var productNameId = answers.product_name.split(\" \");\n productNameId = productNameId[0];\n var productNameIdIndex = productNameId[0] - 1;\n var userQty = parseInt(answers.purchaseQty);\n var databaseQty = res[productNameIdIndex].stock_quantity;\n var databasePrice = res[productNameIdIndex].price;\n if (userQty > databaseQty) {\n console.log(\"-----------------------\");\n console.log();\n console.log(\"Not enough in inventory\");\n console.log(\"-----------------------\");\n console.log();\n } else if (userQty < databaseQty) {\n var totalPrucahse = userQty * databasePrice;\n var newQty = databaseQty - userQty;\n updatepurchase(newQty, productNameId);\n console.log(\"-----------------------\");\n console.log();\n console.log(\"Enough is in Inventory for purchase.\" + \" || Purchase Price: $\" + totalPrucahse);\n console.log(\"-----------------------\");\n console.log();\n }\n customerSelection();\n });\n });\n}", "function displayPrompt(){\n inquirer.prompt([\n {\n type: 'list',\n name: 'product',\n message: '\\n\\nselect product to purchase.',\n choices: queryArray\n },\n {\n type: 'input',\n name: \"quantity\",\n message: \"How many would you like to purchase?\"\n }\n ]).then(function(answer) {\n confirmPurchase(answer.product,answer.quantity);\n });\n//close displayPrompt \n}", "function buy() {\n \n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n \n inquirer.prompt([\n {\n type: \"input\",\n name: \"id\",\n message: \"What is product ID you want to buy?\"\n },\n {\n type: \"input\",\n name: \"qty\",\n message: \"How many units would you like to buy?\"\n }\n ])\n .then(function(answer) {\n \n var custProduct = (answer.id) - 1;\n var orderQuantity = parseInt(answer.qty);\n var total = parseFloat(((res[custProduct].price) * orderQuantity).toFixed(2));\n\n // Check if quantity is sufficient\n if(res[custProduct].stock_quantity >= orderQuantity) {\n \n // After purchase, update the quantity in products & product sales in departments table\n var query = \"UPDATE products INNER JOIN departments ON products.dept_name = departments.dept_name SET ? WHERE ?\"\n \n connection.query(\n query,\n [{\n stock_quantity: (res[custProduct].stock_quantity - orderQuantity),\n product_sales: total\n },{\n item_id: answer.id\n }], \n\n function(err, res){\n if (err) throw err;\n console.log(\"Your total is $\" + total + \". Thanks for your order!\");\n reRun();\n });\n\n } \n else \n {\n console.log(\"There isn't enough in stock!\");\n reRun();\n }\n })\n })\n}", "function buyMore() {\n\n inquirer.prompt([\n {\n name: \"continue\",\n type: \"confirm\",\n message: \"Do you want to buy another product?\"\n }\n ]).then(function (answers) {\n if (answers.continue) {\n defId = null;\n defQty = 1;\n dispAll();\n } else {\n connection.end();\n }\n });\n\n}", "function promptBuy(){\n var query = \"SELECT productID FROM products\"; \n connection.query(query, (err, result) => {\n if(err) throw err;\n inquirer.prompt([\n {\n name: \"getItem\",\n type: \"list\",\n message: \"Select the ID number of the product you wish to buy:\",\n choices: function(){\n var itemsArr = [];\n for(var i = 0; i < result.length; i++){\n itemsArr.push(`${result[i].productID}`);\n }\n return itemsArr;\n }\n },\n {\n name: \"getUnits\",\n message: \"How many units would you like to purchase?\",\n type: \"input\",\n validate: function(value){\n if (value.length){\n return true; \n } else{\n return \"Sorry, you must enter a quantity\"; \n } \n }\n }\n ]).then(answer => {\n console.log(\"Checking to see if enough inventory...\");\n checkInventory(answer); \n })\n }) \n}", "function buyProduct(amount, product_id, price) {\n inquirer\n .prompt([\n {\n type: \"input\",\n message: \"How Many?\",\n name: \"amount\",\n validate: value => {\n let valid = !isNaN(parseFloat(value));\n return valid || \"Please Enter Item ID #\";\n }\n }\n ])\n .then(res => {\n if (amount > res.amount) {\n console.log(\"SUCCESS\");\n totalPrice(res.amount, price);\n updateStock(res.amount, product_id, amount);\n } else {\n console.log(\"Out of stock!\");\n buyProduct(amount, product_id, price);\n }\n });\n}", "function itemQty(item, name, stock){\n \n inquirer.prompt({\n type: \"list\",\n name: \"purchase\",\n message: \"would you like to purchse this item?\",\n choices: [\n \"yes\",\n \"no\"\n ]\n }) \n .then(function(answer){\n switch (answer.purchase) {\n case \"yes\":\n getQty(item);\n break;\n \n case \"no\":\n console.log(\"please make another selection\");\n greetings();\n break;\n \n }\n });\n\n function getQty(item, stock, name) {\n \n inquirer.prompt({\n name: \"qty\",\n type: \"input\",\n message: \"please enter the quantity you would like\",\n })\n .then(function(value){ \n\n var qty = $parseInt(value.qty, 10); \n \n // if (qty > stock) {\n // console.log(\"qty: \" + qty + \", stock: \" + stock);\n // console.log(\"sorry, we have insufficient supply of \" + name);\n // } else {\n // function updateStock(item, stock, name) {\n // var query = connection.query(\n // \"UPDATE products SET ? WHERE ?\",\n // [\n // {\n // stock_qty: stock_qty - qty\n // },\n // {\n // item_ID: item\n // }\n // ],\n // function(err, res) {\n \n // console.log(res.affectedRows + \" stock has been update!\\n\");\n \n \n // }\n // );\n // }\n // }; \n purchaseItems(item, qty); \n });\n\n function purchaseItems(item, qty){ \n \n connection.query(\"SELECT item_name, price, stock_qty FROM products WHERE ?\", \n {\n item_ID: item\n }, \n function(err, res) {\n if (err) throw err;\n \n console.log(qty + \" \" + res[0].item_name + \"s will be mailed to the address we have on file.\\n\");\n console.log(\"$\" + ((qty * res[0].price).toFixed(2)) + \" will be billed to your account. \\n\");\n delay(750).then(() => {\n console.log(\"thank you for shopping with Bamazon!\");\n });\n \n\nconnection.end();\n});\n\n\n\n}\n}\n}", "function buyProduct() {\n inquirer.prompt([\n {\n name: \"item\",\n type: \"choice\",\n message: \"What is the I.D. of the product you would like to buy?\",\n default: 1\n },\n {\n name: \"quantity\",\n type: \"input\",\n message: \"How many would you like to buy?\",\n default: 5\n }\n ])\n .then(function (answer) {\n var query = \"SELECT product_name, id, stock_quantity, price FROM products WHERE ?\"\n connection.query(query, { id: answer.item }, function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n var cost = res[i].price;\n var name = res[i].product_name;\n var currentQ = res[i].stock_quantity;\n }\n var quantityId = answer.quantity;\n\n // if statement to let user know if there is not enough stock on hand\n if (currentQ < quantityId) {\n console.log(\"\\nSorry, we do not have that quantity in stock\");\n console.log(\"\\nWe only have \" + currentQ + \" left\\n\")\n buyProduct();\n } else {\n displayTotal(answer);\n }\n })\n })\n}", "function start() {\n inquirer.prompt([ \n {\n name: \"ID\",\n type: \"input\",\n message: \"What item would you like to by?\", \n filter:Number\n },\n {\n name:\"Quantity\",\n\t\ttype:\"input\",\n\t\tmessage:\"How many items do you wish to purchase?\",\n\t\tfilter:Number\n\t},\n\n ]).then(function(answers){\n \tvar quantityNeeded = answers.Quantity;\n \tvar IDrequested = answers.ID;\n \tpurchaseOrder(IDrequested, quantityNeeded);\n });\n}", "function userInput(){\n\tinquirer.prompt([\n\t{\n\t\tname: \"id\",\n\t\ttype: \"list\",\n\t\tmessage: \"What product would you like to buy?\",\n\t\tchoices: choicesArray\n\t},\n\t{\n\t\tname: \"quantity\",\n\t\ttype: \"input\",\n\t\tmessage: \"How many would you like to purchase?\"\n\t}\n\t]).then(function(answer){\n\t\t//splitting our id from product name\n\t\tvar splitId = answer.id.split(\":\");\n\t\t//storing only the id in a variable\n\t\tvar getId = splitId[0];\n\t\t//storing how much the user would like to purchase\n\t\tvar userQuantity = answer.quantity;\n\t\t//querying the database to get item id, quantity, and price\n\t\tconnection.query(\"SELECT item_id, stock_quantity, price FROM products\", function(error, results){\n\t\t\tif(error){\n\t\t\t\tconsole.log(error);\n\t\t\t}else{\n\t\t\t\t//looping through our products table\n\t\t\t\tfor(var i = 0; i < results.length; i++){\n\t\t\t\t\t//if the product choosen's id matches an id in our databse and its quantity is less than the quantity in our database, user may purchase the item(s)\n\t\t\t\t\tif(getId == results[i].item_id && userQuantity < results[i].stock_quantity){\n\t\t\t\t\t\t//storing database product quantity\n\t\t\t\t\t\tvar productQuantity = results[i].stock_quantity;\n\t\t\t\t\t\t//storing database product price\n\t\t\t\t\t\tvar productPrice = results[i].price;\n\t\t\t\t\t\t//multiplying how many products the user wants to the price of each item\n\t\t\t\t\t\tvar userPrice = userQuantity * productPrice;\n\t\t\t\t\t\t//updating our quantity by subtracting how much our user chooses and how much is in our database\n\t\t\t\t\t\tvar newQuantity = productQuantity - userQuantity;\n\t\t\t\t\t\t//calling our transaction function and passing it updated product quantity, price, and product id\n\t\t\t\t\t\ttransaction(newQuantity, userPrice, getId);\n\t\t\t\t\t};\n\t\t\t\t\t//if the user chooses a quantity higher than what is in our database, we will let them know\n\t\t\t\t\tif(getId == results[i].item_id && userQuantity > results[i].stock_quantity){\n\t\t\t\t\t\tconsole.log(\"We don't have enough in stock.\" + \"\\nPlease lower quantity.\");\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t});\n\t});\n}", "function chooseQuantity() {\n inq.prompt([{\n type: 'input',\n name: 'quantity',\n message: '\\nPlease enter the quantity you would like to purchase',\n }]).then(function(inqRes) {\n // This value is for later use\n quantityRequested = inqRes.quantity;\n // This value is for updating the database with remaining quantity\n updatedQuantity = itemQuantity - quantityRequested;\n // This calculates the total cost\n totalCost = inqRes.quantity * itemPrice;\n connection.query(\"SELECT * FROM products WHERE item_id=\" +\n \"'\" + itemChosen + \"'\",\n function(err, res) {\n if (err) {\n console.log(err);\n } else if (quantityRequested <= itemQuantity) {\n connection.query(\"UPDATE products SET stock_quantity =\" + \"'\" +\n updatedQuantity + \"'\" + \"WHERE item_id =\" + \"'\" + itemChosen +\n \"'\");\n console.log(\"Purchase Successful! \" + \"Total Cost of Purchase: \" +\n \"$\" + totalCost);\n isPurchaseMade = true;\n printTable();\n } else if(quantityRequested > itemQuantity) {\n console.log(\"Sorry, We don't have that much in stock right now\");\n pickItemId();\n }\n });\n });\n}", "function chooseQuantity() {\n inq.prompt([{\n type: 'input',\n name: 'quantity',\n message: '\\nPlease enter the number of units to add',\n }]).then(function(inqRes) {\n // This value is for later use\n quantityToAdd = parseInt(inqRes.quantity);\n // This value is for updating the database with remaining quantity\n updatedQuantity = quantityToAdd + itemQuantity;\n // This calculates the total cost\n connection.query(\"SELECT * FROM products WHERE item_id=\" +\n \"'\" + itemChosen + \"'\",\n function(err, res) {\n if (err) {\n console.log(err);\n } else {\n connection.query(\"UPDATE products SET stock_quantity =\" + \"'\" +\n updatedQuantity + \"'\" + \"WHERE item_id =\" + \"'\" + itemChosen +\n \"'\");\n console.log(\"Add Inventory Successful!\");\n isActionDone = true;\n printTable();\n }\n });\n });\n }", "function selectItem() {\n inquirer.prompt([\n {\n type: \"input\",\n message: \"Enter the ID for the product you'd like to buy\",\n name: \"productID\"\n },\n {\n type: \"input\",\n message: \"How many units of the product would you like to buy?\",\n name: \"quantity\"\n }\n ]).then(function(inquirerResponse){\n var productID = parseInt(inquirerResponse.productID);\n var qty = inquirerResponse.quantity;\n isAvailable(productID, qty);\n })\n}", "function sumWithSale() {\n \n let sum = prompt(\"Введите сумму покупки:\");\n sum = Number(sum);\n let sale;\n if (sum > 500 && sum < 800) {\n sale = 0.03;\n } else if (sum > 800) {\n sale = 0.05;\n } else {\n sale = 0;\n };\n sum = sum - (sum * sale);\n let viewSale = sale * 100;\n alert(`Сумма покупки с учетом скидки - ${viewSale}% составляет: ${sum} грн.`);\n console.log(`3) Purchase sum with sale ${viewSale}%: ${sum} uah.`);\n }", "function startQuestions() {\n inquirer\n .prompt([\n {\n type: \"text\",\n name: \"product\",\n type: \"input\",\n message: \"What item would you like to buy? (select using item #)\"\n }\n ]).then(function (answer) {\n switch (answer.product) {\n case \"1\":\n purchases();\n break;\n\n case \"2\":\n purchases();\n break;\n\n case \"3\":\n purchases();\n break;\n\n case \"4\":\n purchases();\n break;\n\n case \"5\":\n purchases();\n break;\n case \"6\":\n purchases();\n break;\n case \"7\":\n purchases();\n break;\n case \"8\":\n purchases();\n break;\n case \"9\":\n purchases();\n break;\n case \"10\":\n purchases();\n break;\n\n }\n });\n\n}", "function purchaseChoice() {\n tableDisplay();\n connection.query(\"SELECT * FROM products\", function(err, res) {\n let numberOfItems = res.length;\n inquirer\n .prompt([\n {\n name: \"idSelection\",\n type: \"input\",\n message: \"Which product would you like to buy? (input ID number)\",\n validate: function(value) {\n if (isNaN(value) === false) {\n if (value <= numberOfItems) {\n return true;\n }\n return false;\n }\n return false; \n }\n },\n {\n name: \"quantity\",\n type: \"input\",\n message: \"How many would you like to buy?\",\n } \n ])\n .then(function(answer) {\n //change quantity amount in server\n let chosenItem = res[answer.idSelection-1];\n //find total cost of purchase\n let totalSales = (parseInt(answer.quantity) * parseInt(chosenItem.price)) + parseInt(chosenItem.product_sales);\n // console.log(answer.idSelection);\n // console.log(chosenItem);\n //Determine if there is enough in stock\n\n if (chosenItem.stock_quantity > parseInt(answer.quantity)) {\n // if there is enough, the database will be updated\n let quantityLeft = chosenItem.stock_quantity-parseInt(answer.quantity);\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: quantityLeft,\n product_sales: totalSales\n },\n {\n item_id: chosenItem.item_id\n }\n ],\n function (error) {\n if (error) throw error;\n if (answer.quantity > 1) {\n console.log(\"You have successfully purchased \" + answer.quantity + \" \" + chosenItem.product_name + \"s\");\n }\n else {\n console.log(\"You have successfully purchased \" + answer.quantity + \" \" + chosenItem.product_name);\n }\n startOver();\n }\n )\n }\n else {\n //Run this if there is not enough in stock\n console.log(\"There was not enough in stock at this time.\");\n startOver();\n }\n })\n })\n}", "function buy()\n{\n\t//query the databse for all items being sold\n\tconnection.query(\"SELECT * FROM products\", function(err, res)\n\t{\n\t\t\n\t\tif(err) throw err;\n\n\t\t//Prompt the user to input data\n\t\tinquirer.prompt([\n\n\t\t\t{\n\t\t\t\t//Ask for id of the product the user wants to buy\n\t\t\t\tname: \"id\",\n\t\t\t\ttype: \"list\",\n\t\t\t\tchoices: function()\n\t\t\t\t{\n\t\t\t\t\tvar idChoiceArray = [];\n\n\t\t\t\t\tfor(var i = 0; i < res.length; i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t//push all items_ids into (idChoiceArray) in order to display all ids to choose from\n\t\t\t\t\t\t//NOTE: For rawlist cannot use type(INT) only (string) hence convert int to string by JSON.stringify\n\t\t\t\t\t\tidChoiceArray.push(JSON.stringify(res[i].item_id));\n\t\t\t\t\t}\n\n\t\t\t\t\t//display all item_id's to choose from\n\t\t\t\t\treturn idChoiceArray;\n\t\t\t\t},\n\t\t\t\tmessage: \"Enter the id of the product you want to purchase\"\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t//Ask customer for how many units they'd like to buy\n\t\t\t\ttype: \"input\",\n\t\t\t\tname: \"quantity\",\n\t\t\t\tmessage: \"How many units would you like to buy?\"\n\t\t\t}\n\n\t\t\t]).then(function(answer)\n\t\t\t{\n\t\t\t\t//get the entire item object & store in variable\n\t\t\t\tvar chosenItem;\n\n\t\t\t\tfor(var i = 0; i < res.length; i++)\n\t\t\t\t{\n\t\t\t\t\t//if id == user id choice then store entire object\n\t\t\t\t\tif(res[i].item_id === parseInt(answer.id) )\n\t\t\t\t\t{\n\t\t\t\t\t\tchosenItem = res[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\t//call the checkQuantity function & update the table if the quantity entered is sufficient\n\t\t\t\tcheckQuantity(chosenItem, answer, err);\n\n\t\t\t});\n\n\t});\n}", "function userWants() {\n inquirer\n .prompt([\n {\n name: \"chooseId\",\n type: \"input\",\n message: \"What is the ID of the product you would like to buy?\",\n },\n {\n name: \"chooseQuant\",\n type: \"input\",\n message: \"How many of the selected item do you like to buy?\"\n }\n\n ])\n .then(function (answer) {\n\n var itemWanted = answer.chooseId; // Storing the name of the selected item\n var numberWanted = answer.chooseQuant; // Storing the quantity of the selected item\n if (itemWanted < 1 || itemWanted > 10){\n console.log(\"Invalid ID. Please try again\");\n userWants();\n } else {\n\n //checking to see if the selected item has enough stock. \n var query = connection.query(\"SELECT * FROM products WHERE item_id=?\", [itemWanted], function (err, res) {\n //When we DON'T have enough in stock\n if (res[0].stock_quantity < parseInt(numberWanted)) {\n console.log(\"=====================================================================\");\n console.log(\"Insufficient quantity! Please try again\");\n userWants();\n } else {\n //When we DO have enough in stock\n console.log(\"=====================================================================\");\n console.log(\"Thank you very much for your purchase. Your order has been placed.\");\n connection.query(\"UPDATE products SET ? WHERE ?\", [\n {\n stock_quantity: res[0].stock_quantity - parseInt(numberWanted)\n },\n {\n item_id: itemWanted\n }\n\n ], function (err, result) {\n console.log(\"The total price for your item is $\" + res[0].price * parseInt(numberWanted) + \". \\nThank you for using Bamazon\");\n console.log(\"=====================================================================\");\n console.log(\"If you want to make your next purchase, simply press upper arrow key :)\");\n\n connection.end();\n\n })\n }\n \n });\n };\n });\n\n \n\n}", "function handleUser(){\n inq.prompt([\n {\n name: \"id\",\n message: \"Which product that you want to purchase? Please enter its ID.\",\n validate: function(input){\n input = parseInt(input);\n // User input needs to be integer and has to be a valid id\n return ! (isNaN(input) || input > last_id || input <= 0);\n }\n },\n {\n name: \"quantity\",\n message: \"How many do you want to order?\",\n validate: function(input){\n input = parseInt(input);\n // User input needs to be integer and cannot less than 0\n return ! (isNaN(input) || input < 0 );\n }\n } \n ]).then((ans)=>{\n printReceipt(ans);\n });\n}", "function prompt() {\n inquirer\n .prompt([\n {\n // The first should ask them the ID of the product they would like to buy.\n name: \"itemID\",\n type: \"input\",\n message: \"What is the ID of the item you would like to purchase?\"\n },\n {\n //The second message should ask how many units of the product they would like to buy.\n name: \"numUnits\",\n type: \"input\",\n message: \"How many units would you like?\"\n }\n ])\n .then(function(answer) {\n // console.log(answer.itemID);\n // console.log(answer.numUnits);\n checkItem(answer.itemID, answer.numUnits);\n });\n }", "function purchase() {\n inquirer.prompt([{\n name: 'id',\n type: 'input',\n message: \"What is the ID of the item you would like to purchase? [Quit with Q]\"\n }, {\n name: 'quantity',\n type: 'input',\n message: \"How many would you like? [Quit with Q]\"\n }])\n //product chosen\n .then(function (answer) {\n console.log(answer);\n\n connection.query(\"SELECT * FROM products WHERE item_id = ? \",\n [answer.id],\n function (err, res) {\n if (err) throw err;\n console.log(res);\n var chosenItem = res[0]; \n\n //update product quantity\n if (chosenItem.stock_quantity < parseInt(answer.number)) {\n connection.query(\"UPDATE products SET ? WHERE ?\", [{\n stock_quantity: number\n },\n {\n item_id: chosenItem\n }\n ],\n function (error) {\n if (error) throw err;\n console.log(\"Purchased!\");\n }\n );\n } else {\n console.log(\"Sorry, item not available. Select another item.\");\n }\n });\n }, )\n}", "function promptUser(res){\n inquirer\n .prompt({\n name: \"productID\",\n message: \"Which product ID would you like to buy?\",\n })\n .then(function(answer1) {\n\n inquirer.prompt({\n name: \"quantity\",\n message: \"How many units of the product would you like to buy?\"\n\n }).then(function(answer2){\n var quantity = answer2.quantity;\n var productID = parseInt(answer1.productID);\n\n //find product\n\n var product = res.find(function(row){\n return row.id === productID;\n });\n\n if(product === undefined)\n {\n console.log(\"Product not found\");\n return;\n }\n\n //check quantity\n\n if(quantity > product.stock_quantity){\n console.log(\"Insufficient quantity!\");\n\n }else{\n console.log(\"----------------------\");\n \n //update the database with the new quantity\n\n //display the total cost of purchase\n \n }\n\n })\n \n });\n}", "function promptUser() {\n\n\tinquirer.prompt([\n\t\t{\n\t\t\ttype: 'input',\n\t\t\tname: 'item_id',\n\t\t\tmessage: 'Please enter the Item ID of the item you wish to purchase',\n\t\t\tvalidate: validateInput,\n\t\t\tfilter: Number\n\t\t},\n\t\t{\n\t\t\ttype: 'input',\n\t\t\tname: 'quantity',\n\t\t\tmessage: 'Please enter quantity',\n\t\t\tvalidate: validateInput,\n\t\t\tfilter: Number\n }\n ])\n .then(function(input) {\n\n var item = input.item_id;\n\t\tvar quantity = input.quantity;\n\n var check_db = 'SELECT * FROM products WHERE ?';\n\n connection.query(check_db, {item_id: item}, function(err, data) {\n if (err) throw err;\n \n if (data.length === 0) {\n\t\t\t\tconsole.log('Invalid Item ID. Please select a valid Item ID.');\n\t\t\t\tproductList();\n\n\t\t\t} else {\n var productData = data[0];\n \n if (quantity <= productData.stock_quantity) {\n\n var update_db = 'UPDATE products SET stock_quantity = ' + (productData.stock_quantity - quantity) + ' WHERE item_id = ' + item;\n\n\n connection.query(update_db, function(err, data) {\n\t\t\t\t\t\tif (err) throw err;\n\n console.log('Your total is $' + productData.price * quantity);\n console.log('Thank you for shopping with us!');\n\t\t\t\t// End the database connection\n //connection.end();\n productList();\n\t\t\t\t\t})\n\t\t\t\t} else {\n console.log('Sorry, the quantity you requested is not in stock.')\n console.log('Please modify your search and try again')\n\t\t\t\t\tproductList();\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t})\n}", "function buyMore(){\n\tinquirer.prompt([\n\t\t{\n\t\t\tname:\"confirm\",\n\t\t\tmessage:\"Would you like to buy more items?\",\n\t\t\ttype:\"confirm\"\n\t\t}\n\n\t]).then(function(user){\n\t\tif(user.confirm){\n\t\t\t//invoking function to display items and clearing table \n\t\t\tdisplayItems();\n\t\t\ttable.splice(0,table.length);\n\t\t}else{\n\n\t\t\tconsole.log(\"Thank you for shopping at Bamazon\");\n\t\t\tprocess.exit(0);\n\t\t}\n\t});\n}", "function start() {\n // showTable();\n inquirer\n .prompt([\n {\n name: \"Id\",\n type: \"input\",\n message: \"What is the ID of the product you want to buy?\"\n },\n {\n name: \"quantity\",\n type: \"input\",\n message: \"How many units of this product you want to buy?\"\n }\n ])\n .then(function (answer) {\n console.log(\"\\n\"+\"I wish to buy \" + answer.quantity)\n\n connection.query(\"SELECT * FROM bamazon.products\", function (err, results) {\n var item_number = parseInt(answer.Id) - 1;\n var amount = parseInt(answer.quantity);\n var stockQuantity = results[item_number].stock_quantity;\n if (err) throw err;\n if (stockQuantity >= amount) {\n var newQuantity = stockQuantity - amount;\n var numberId = item_number;\n update(numberId, newQuantity);\n totalCost(numberId, amount);\n console.log(\"We have your order\")\n \n\n } else {\n console.log(\"Insufficient quantity\");\n \n }\n newTransaction();\n\n })\n\n })\n \n}", "function promptCustomer(res) {\n //PROMPTS USER FOR WHAT THEY WOULD LIKE TO PURCHASE//\n inquirer.prompt([{\n type: 'input',\n name: 'choice',\n message: 'What would you like to purchase?'\n }]).then(function(val) {\n\n //SET THE VAR correct TO FALSE SO AS TO MAKE SURE THE USER INPUTS A VALID PRODUCT NAME//\n var correct = false;\n //LOOPS THROUGH THE MYSQL TABLE TO CHECK THAT THE PRODUCT THEY WANTED EXISTS//\n for (var i = 0; i < res.length; i++) { \t\n\t //1. TODO: IF THE PRODUCT EXISTS, SET correct = true and ASK THE USER TO SEE HOW MANY OF THE PRODUCT THEY WOULD LIKE TO BUY//\n if( val.choice == res[i].Product_Name){\n correct = true;\n\n console.log('Currently,' + res[i].Stock_Quantity + ' items are on stock.');\n\n askHowMany(res[i]);\n break;\n } \n }\n if (correct == false) {\n promptCustomer(res);\n }\n \n })\n //IF THE PRODUCT REQUESTED DOES NOT EXIST, RESTARTS PROMPT//\n \n }", "function buyProduct() {\n\n // get the user's purchase request\n inquirer.prompt([\n {\n name: \"id\",\n type: \"input\",\n message: \"What is the ID of the product you want to buy?\",\n default: defId\n },\n {\n name: \"qty\",\n type: \"input\",\n message: \"How many do you want to buy?\",\n default: defQty\n }\n ]).then(function (answers) {\n\n var id = answers.id;\n var qty = answers.qty;\n\n // get the necessary information from the database to actually process the order\n connection.query(\"SELECT product_name, department_id, price, stock_quantity FROM products WHERE item_id = ?;\", [id], function (err, rows, fields) {\n\n if (err) throw err;\n\n // different cases of database results\n switch (rows.length) {\n // One row returned is the normal case as the requested id should be unique\n case 1:\n var namProduct = rows[0].product_name;\n var idDept = rows[0].department_id;\n var prcProduct = rows[0].price;\n var qtyStock = rows[0].stock_quantity;\n // check for sufficient inventory for the order\n if (qtyStock >= qty) {\n // if sufficient inventory then execute the order and update the database\n connection.query(\"UPDATE products SET stock_quantity = ? WHERE item_id = ?;\", [(qtyStock - qty), id], function (err, rows, fields) {\n if (err) throw err;\n // compute the total price to the customer for this order and display it for the customer\n var totSale = qty * prcProduct;\n console.log(\"\\n\\nYour total price for: \" + namProduct + \", Quantity: \" + qty + \" is $\" + totSale.toFixed(2) + \"\\n\\n\");\n // add the total price for this order to the department sales total in the database\n connection.query(\"UPDATE departments SET total_sales = total_sales + ? WHERE department_id = ?;\", [totSale, idDept], function (err, rows, fields) {\n if (err) throw err;\n // ask the customer if they want to continue purchasing more products\n buyMore();\n });\n });\n } else {\n // if there is insufficient inventory for the initial order, ask the customer if they would still like to purchase a smaller amount\n inquirer.prompt([\n {\n name: \"qty\",\n type: \"confirm\",\n message: \"There is insufficient quantity for your order. Do you want still want to buy some?\"\n }\n ]).then(function (answers) {\n // if the user does want to buy a smaller quantity, set the order defaults and go back to the start of the purchase process\n if (answers.qty) {\n defId = id;\n defQty = qtyStock;\n buyProduct();\n // otherwise just ask the customer if they would like to buy any other products\n } else {\n buyMore();\n }\n });\n }\n break;\n // if no rows were returned from the original product query, then let the customer know the product id was invalid and ask if they would like to continue\n case 0:\n console.log(\"Sorry, there is not a product with ID: \" + id);\n buyMore();\n break;\n }\n\n });\n\n });\n\n}", "function whatToBuy(){\n console.log(\" ~crunchy store~\")\nlet customerChoice = inquirer.prompt([\n\n {\n type: \"input\",\n name: \"item\",\n message:\"What would you like to buy?\"\n },\n {\n type: \"input\",\n name: \"qty\",\n message: \"How many would you like to buy?\"\n }\n ]).then(function(x) {\n let id = x.item;\n let qty = x.qty;\n\n console.log(\"Item: \" + products[x.item].item_name);\n console.log(\"QTY: \" + x.qty);\n console.log(\"Total Price: $\" + (products[x.item].sales_price * x.qty))\n\n // CHECK INVENTORY\n\n getInventory(id,qty,function(item,qty){\n \n // IF STATEMENT\n let newQty = item.inventory_qty - qty;\n\n console.log(\"Checking inventory..... \" + item.item_name);\n console.log(\"\");\n if(newQty > 0) {\n console.log(\"Purchase Complete!\")\n updateProducts(id,\"inventory_qty\",newQty);\n }\n else{\n console.log(\"Insufficient Qty for Order...\")\n }\n console.log(\"...\");\n console.log(\"\");\n console.log(\"\");\n console.log(\"\");\n\n runProgram();\n });\n\n });\n}", "function askUserForOder(){\n inquire.prompt([\n {\n type: \"input\",\n message: \"Enter item ID to purchase: \",\n name: \"itemID\"\n },\n {\n type: \"input\",\n message: \"Enter quantity to purchase: \",\n name: \"quantity\"\n }\n ]).then(function(inquirerResponse) {\n // console.log(inquirerResponse);\n // console.log(inquirerResponse.itemID);\n\n //loop itmes array to check if id entered exists and if not tell user. this piece I will code later.\n let validID = false;\n for (let j in itemsAvailable){\n if (itemsAvailable[j].itemid === parseInt(inquirerResponse.itemID)){\n validID = true; \n }\n }\n // check if no selection restart app\n if(!validID || inquirerResponse.itemID === \"\" || inquirerResponse.quantity === \"\"){\n console.log('A valid selection is needed !!');\n proceed();\n }else{\n var qString = \"\";\n var totalcost=0;\n const customerQuantity = parseInt(inquirerResponse.quantity);\n // query database to check if in stock\n qString = \"SELECT stock_quantity,price FROM products WHERE item_id =\"+parseInt(inquirerResponse.itemID);\n \n connection.query(qString,function(err,results){\n if(err) throw err;\n // console.log(results);\n // console.log(results[0].stock_quantity);\n\n //compare quantity to order and actual stock\n if(customerQuantity > results[0].stock_quantity){\n console.log('Your order exceeds items in stock.');\n console.log('Only '+results[0].stock_quantity+' item(s) in stock.');\n console.log(\"Your order was unsuccessful\");\n console.log(\"Please revise your order.\");\n initializeApp();\n }else{\n //place order and update stock.\n totalcost = results[0].price * customerQuantity;\n qString = \"UPDATE products SET stock_quantity = stock_quantity -\"+customerQuantity+\" WHERE ?\"\n connection.query(qString,\n [\n {\n item_id:parseInt(inquirerResponse.itemID)\n }\n ],function(err,results){\n if(err) throw err;\n console.log(\"Your order was successful. \\nYour order total is: \"+\"$\"+totalcost+\" \\nThank you\");\n proceed();\n });\n } \n });\n }\n });\n}", "function customerBuy (){\n // prompt customer to ask what items they want to order and how many\n inquirer.prompt([\n {\n type: 'input',\n message:'Input the ID of the item you would like to buy:',\n name: 'userBuyItem',\n // validation function to assure input is a number\n validate: function(input){\n // code\n if (isNaN(input)) {\n return ('Please put in a vald ID number')\n } else {\n return true;\n }\n }\n },\n {\n type: 'input',\n message: 'How many units would you like to buy?',\n name: 'unitBuy',\n // validation function to assure input is a number\n validate: function(input){\n if (isNaN(input)) {\n return ('Please put in a vald ID number')\n } else {\n return true;\n }\n }\n\n }\n ]).then(function(answer){\n connection.query('SELECT * FROM products', function(error, res){\n if (error) { throw error };\n\n // store the corresponding item object in a variable\n var chosenItem = res[answer.userBuyItem - 1];\n var stockQty = chosenItem.stock_quantity;\n // inform user if they have ordered more units than are available \n if (answer.unitBuy > chosenItem.stock_quantity) {\n console.log ('Insufficient quantity in stock! Your order cannot be fulfilled.');\n // ask user if they wish to make another purchase\n inquirer\n .prompt([\n {\n type: 'confirm',\n message: 'Would you like to buy something else?',\n choices: ['Yes','No'],\n name: 'tryAgain'\n }]).then(function(ans){\n if (ans.tryAgain) {\n customerBuy(); \n } else { \n console.log ('Alright. Come again!') \n // end connection in teh case that user doesn't wish to continue with purchase process\n connection.end();}\n });\n } else {\n stockQty = stockQty-answer.unitBuy;\n \n // if enough units, update SQL database values\n connection.query('UPDATE products SET ? WHERE ?', [{\n stock_quantity: stockQty\n }, {\n item_id: answer.userBuyItem\n }], function(err,res){\n // display total cost of order to user\n if (err) {throw err};\n console.log('The price of your order is $'+(answer.unitBuy*chosenItem.price+' - thank you for shopping with us!'));\n // end connection in the case of a successful purchase\n connection.end();\n });\n }\n \n });\n })\n}", "function checkPurchase(itemID, qty) {\n\n connection.query(\"SELECT * FROM products WHERE ?\",\n {\n id: itemID\n },\n function (err, res) {\n if (err) throw err;\n\n let stock = res[0].stock_quantity;\n let price = res[0].price;\n\n if (stock >= qty) {\n console.log(\"You can buy that!\");\n finalizePurchase(itemID, qty, stock, price);\n } else {\n console.log(\"There aren't enough units to purchase that! Let's start over...\");\n startPrompt();\n\n }\n\n });\n}", "function promptQuantity() {\n inquirer\n .prompt({\n name: \"quantity\",\n type: \"input\",\n message: \"How many would you like\",\n \n // validates that the answer is a number\n validate: function (value) {\n quantPass = value; \n if (quantPass > 0) {\n \n return true;\n }\n else {\n return \"This is not a number. Try again\";\n }\n }\n \n }).then(function (answer) {\n \n // quantPass is a string, so it's then turned into an int\n quantPass = parseInt(quantPass);\n \n // This selects all the rows from the table (\"products\") that has the id of the answerID\n connection.query(\"SELECT * FROM products WHERE item_id = \" + answerId,\n function (err, results) {\n \n /* The results are therefor the row that corresponds to that id,\n and we assign a variable to the stock_quantity value it contains*/\n var quantInStock = results[0].stock_quantity\n \n if (err) {\n throw err;\n }\n /* ----If there are no errors and quantPass (amount requested) is \n less than or equal to the following happens-----*/\n \n // Checks to make sure there is enough in stock\n else if (!err && quantPass <= quantInStock) {\n \n // -----------Get total cost------------\n // Gets price of product and puts into a variable\n let price = results[0].price\n \n // Gets quantity chosen and multiplies by cost for total cost\n let totalCost = quantPass * price;\n \n // Display the order confirmation an total cost);\n console.log(\"You want \" + chalk.bold.yellow(quantPass) + \" of item \" + chalk.bold.yellow(answerId));\n console.log(chalk.bold.green(\"Your order has been placed.\"));\n console.log(chalk.bold.green(\"Your total cost is: \" + \"$\" + totalCost));\n console.log(\"--------------------------------------\");\n \n // updateTable is fired\n updateTable(answerId)\n \n\n }\n /* If there isn't enough in stock, then notification is given and \n promptQuantity is refired*/\n else if (!err && quantPass > quantInStock) {\n console.log(chalk.bold.red(\"Not enough in stock. Choose a lower number.\"));\n console.log(\"--------------------------------------\");\n promptQuantity()\n };\n\n \n });\n\n\n });\n\n}", "function anythingElse() {\n inquirer\n .prompt([\n {\n type: \"confirm\",\n message: \"Anything Else?\",\n name: \"choice\"\n }\n ])\n .then(res => {\n if (res.choice) {\n displayProducts();\n } else {\n console.log(\"Thank You!\");\n console.log(`Total: $${total}`);\n connection.end();\n }\n });\n}", "function promptManagerForQuantity(product) {\n inquirer\n .prompt([\n {\n type: \"input\",\n name: \"quantity\",\n message: \"How many would you like to add?\",\n validate: function(val) {\n return val > 0;\n }\n }\n ])\n .then(function(val) {\n var quantity = parseInt(val.quantity);\n addQuantity(product, quantity);\n });\n}", "function findSupply(){\n\tlet currentAge = prompt(\"What is your age?\"); \n\tlet maxAge = prompt(\"What age will you drink coffee until?\"); \n\tlet estPer = prompt(\"How many cups of coffee do you have a day?\"); \n\tlet perYear = estPer * 365;\n\tlet total = (maxAge - currentAge) * perYear;\n\n\tif (total !== total){\n\t\tdocument.getElementById(\"find-supply-text\").innerHTML = \"Some went wrong. Maybe try only numbers? If that doesn't work then a hacker totally ruined the code!\";\n\t}\n\telse {\n\tdocument.getElementById(\"find-supply-text\").innerHTML = 'You will need ' + total + ' cups of coffee to last you until the ripe old age of ' + maxAge;\n\n\t}\n}" ]
[ "0.77463454", "0.7717637", "0.75207883", "0.7491422", "0.7392726", "0.7387674", "0.735296", "0.7296927", "0.7260908", "0.72424406", "0.72271824", "0.7200973", "0.7173265", "0.7154713", "0.7149934", "0.71435267", "0.7115118", "0.7111415", "0.7102524", "0.7099218", "0.7096273", "0.7070625", "0.7056969", "0.70502555", "0.7049473", "0.7041002", "0.70371807", "0.70243466", "0.7017227", "0.7014197", "0.70081776", "0.69972426", "0.6993703", "0.69878083", "0.69806576", "0.69409287", "0.69142354", "0.6899863", "0.6893284", "0.68912625", "0.6885928", "0.68773794", "0.6855459", "0.68534344", "0.68410707", "0.68313485", "0.6827076", "0.6826657", "0.68263906", "0.6825119", "0.6822548", "0.68072015", "0.67936045", "0.6791741", "0.6785015", "0.6773629", "0.6768455", "0.67534775", "0.67487997", "0.67351705", "0.6724955", "0.67148536", "0.67114", "0.67101485", "0.67005044", "0.66959524", "0.66902053", "0.66897786", "0.66866297", "0.6685585", "0.6683385", "0.6677971", "0.666252", "0.6656616", "0.6648397", "0.6637844", "0.66254365", "0.66140014", "0.66054994", "0.65977836", "0.65876937", "0.65797824", "0.65776575", "0.657508", "0.6560136", "0.65579426", "0.6557396", "0.65554255", "0.65455526", "0.65435535", "0.6543521", "0.6533422", "0.6529713", "0.6502161", "0.6498252", "0.6495318", "0.64924353", "0.64868975", "0.6481005", "0.64738417" ]
0.7729691
1
function to check if sufficient quantity of item
function checkIfAvailable() { // query bamazon DB for the entered item and available quantity connection.query("SELECT stock_quantity, product_name, price FROM products WHERE id=?", [itemToBuy], function (err, res) { if (err) throw err; // if quantity entered is higher than quantity available, alert user there is insufficient stock then call viewAll function to start over else if (quantityToBuy > parseInt(res[0].stock_quantity)) { console.log(chalk.bgRed("Insufficient stock!")); console.log('\n*******************'); viewAll(); } else { // if quantity entered is equal or lower than quantity available, alert user of the purchase and total cost console.log("You successfully purchased " + quantityToBuy + " " + res[0].product_name); console.log(chalk.bgYellow.red("The total cost was: $" + (quantityToBuy * res[0].price))); console.log('\n*******************'); // call update Quantity function updateQuantity(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function customItemQuantity(value) {\r\n if (!isNaN(value)) {\r\n quantityCheck = 0;\r\n return true;\r\n }\r\n else {\r\n quantityCheck++;\r\n\r\n }\r\n if (quantityCheck == 2) {\r\n throw new Error('You must buy atleast 1 item');\r\n }\r\n return true;\r\n}", "function checkQuantity(count, iid) {\n connection.query(\"SELECT * FROM products WHERE item_id = ?\", [iid], function (err, res, fields) {\n\n if (res[0].stock_quantity >= count) {\n updateSales(count, iid);\n console.log(\"-----------------------------------------------------------\");\n console.log(\"Success! You bougth \" + count + \" \" + res[0].product_name + \"'s. \" + \"The total is $\" + count * res[0].price);\n console.log(\"-----------------------------------------------------------\");\n updateQuantity(count, iid);\n } else {\n console.log(\"Insufficient quantity\");\n promptUserEntry();\n }\n })\n }", "function isFull(){\n if(basket < maxItems){\n return false;\n } else {\n return true;\n }\n}", "function checkItem(itemID, numUnits) {\n // console.log(\"Running checkItem! Looking for item #: \"+ itemID);\n connection.query('SELECT * FROM bamazon.products;', function (err, results, fields) {\n // get the information of the chosen item\n var itemIdInt = parseInt(itemID);\n var numUnitsInt = parseInt(numUnits);\n var chosenItem;\n for (var i = 0; i < results.length; i++) {\n // console.log(results[i].item_id);\n // console.log(itemIdInt);\n if (results[i].item_id === itemIdInt) {\n chosenItem = results[i];\n // console.table(chosenItem);\n }\n }\n\n if (chosenItem.stock_quantity < numUnitsInt) {\n console.log(\"Insufficient quantity in stock!\")\n prompt();\n } else {\n fulfillOrder(chosenItem, numUnitsInt);\n } \n\n });\n}", "function checkInventory(itemID, itemQuantity) {\n connection.query(\"SELECT stock_quantity FROM products WHERE item_id = ?\",\n [itemID], \n function(err, response){\n if (err) {\n console.log(err)\n } else {\n //displays quantity\n // console.log(response[0].stock_quantity);\n var stockQuantity = response[0].stock_quantity;\n if (itemQuantity > stockQuantity) {\n console.log(chalk.bold.red(\"Insufficient Quantity!\"))\n productsForSale();\n } else {\n fulfillOrder(itemID, itemQuantity);\n }\n }\n })\n }", "function checkStockQuantity(item, qty) {\n var sql = \"SELECT stock_quantity FROM product WHERE ?\";\n connection.query(sql, {item_id: item},function (err, res) {\n if (err) throw err;\n var inStock = res[0].stock_quantity;\n if (inStock >= qty) {\n processCustomerOrder(item, qty)\n } else {\n console.log(\"There is not sufficent stock to satisfy this order.\");\n listProducts();\n }\n });\n}", "static async _checkProductsAvailInStock(cart) {\n let invalid = '';\n const tempCart = (typeof cart !== 'object' ? cart.toObject() : cart);\n\n await ItemProductController._addProductsForSingleOrder(tempCart);\n _.each(tempCart.items, (item) => {\n // invalid sku\n if (!item.product) {\n invalid = item.sku;\n return false;\n }\n\n // if item is a product\n if (item.product.sku === item.sku) {\n if (item.count > item.product.stock_qty) {\n invalid = item.sku;\n return false;\n }\n\n return;\n }\n\n // if item is a product variation\n _.each(item.product.variations, (variation) => {\n if (variation.sku === item.sku) {\n if (item.count > variation.stock_qty) {\n invalid = item.sku;\n }\n\n return false;\n }\n });\n\n if (invalid !== '') {\n return false;\n }\n });\n\n return invalid;\n }", "function checkInventory() {\n\n // Run query aqainst productstable to pull in available inventory for shoe requested\n connection.query(\"SELECT * FROM productstable WHERE item_id=?\", [userItemRequested], function(err, res) {\n if (err) throw err;\n currentInventory = res[0].stock_quantity;\n currentItemPrice = res[0].price;\n currentItemName = res[0].product_name;\n // If statement calculates if there is enough inventory then runs follow-up functions based on the result\n if (currentInventory >= userQuantityRequested) {\n enoughInventory();\n } else {\n notEnoughInventory();\n }\n });\n}", "function checkQuantity(chosenItem, answer, err)\n{\n\t//subtract current quantity from number of items that customer wants to purchase\n\t//in order to determine there is enough\n\tif( (chosenItem.stock_quantity - parseInt(answer.quantity) ) >= 0)\n\t{\n\t\t//Subtract the slected quantity from current quantity(stock_quantity) in stock\n\t\tvar newQuantity = chosenItem.stock_quantity - parseInt(answer.quantity);\n\n\t\t//update the product_sales by (quantity) * (price) then do a running sum of current product sals + the recently added product sales\n\t\tvar productSales = parseInt(answer.quantity) * chosenItem.price;\n\n\t\t\tproductSales = productSales + chosenItem.product_sales;\n\n\t\t//update stock_quantity\n\t\tconnection.query(\"UPDATE products SET ? WHERE ?\",\n\t\t[\n\t\t\t\n\t\t\t{\n\t\t\t\t//Update: change to the new quantity after purchase\n\t\t\t\tstock_quantity: newQuantity,\n\n\t\t\t\t//Update the total # in sales or product sales\n\t\t\t\tproduct_sales: productSales\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t//Used to find the location in the table where the updates will occure\n\t\t\t\titem_id: answer.id\n\t\t\t}\n\n\t\t],\n\n\t\tfunction(err)\n\t\t{\n\t\t\tif(err) throw err;\n\n\t\t\tconsole.log(\"Purchase successfull\");\n\t\t\tconsole.log(\"The Total Cost is: $\" + (chosenItem.price * answer.quantity).toFixed(2) );\n\n\t\t\tconsole.log(\"\\n\\n\");\n\n\t\t\tdisplayItems();\n\t\t});\n\t}\n\telse\n\t{\n\t\t//insufficient quantity\n\t\tconsole.log(\"Insufficient Quantity.\");\n\t\tconsole.log(\"We currently stock \" + chosenItem.stock_quantity );\n\n\t\tconsole.log(\"\\n\\n\");\n\n\t\t//start over\n\t\tbuy();\n\t}\n}", "function isFull(){\n for ( let i = 0; i < basket.length; i++){\n if (basket[i] <= maxItems) {\n return true;\n } else {\n return false;\n }\n}\n}", "function checkPurchase(itemID, qty) {\n\n connection.query(\"SELECT * FROM products WHERE ?\",\n {\n id: itemID\n },\n function (err, res) {\n if (err) throw err;\n\n let stock = res[0].stock_quantity;\n let price = res[0].price;\n\n if (stock >= qty) {\n console.log(\"You can buy that!\");\n finalizePurchase(itemID, qty, stock, price);\n } else {\n console.log(\"There aren't enough units to purchase that! Let's start over...\");\n startPrompt();\n\n }\n\n });\n}", "function checkIfItem() {\n // query bamazon DB for the entered item\n connection.query(\"SELECT id FROM products WHERE id=?\", [itemToBuy], function (err, res) {\n if (err) throw err;\n // if itemToBuy exists in the databse, call howManyToBuy function\n else if (res[0].id == itemToBuy) {\n // call update Quantity function\n howManyToBuy();\n }\n // if item does not exist in database, ask user to enter valid ID and go back to product list\n else {\n console.log(chalk.bgRed.yellow(\"Please enter a valid item ID!\"));\n console.log('\\n*******************');\n }\n });\n}", "reachedCapacity(){\n return this.amount >= this.item.stackMax ;\n }", "canManufacture(item) {\n const res = resource_1.resources[item];\n const counts = [];\n if (resource_1.isCraft(res)) {\n const need = this.getNeed(item);\n for (const mat of Object.keys(res.recipe.materials)) {\n if (this.getNeed(mat) > need) {\n return 0;\n }\n const avail = this.getStock(mat);\n if (avail == 0) {\n return 0;\n }\n const amount = FastMath.floor(avail / (res.recipe.materials[mat] || 0));\n counts.push(amount);\n }\n }\n if (counts.length > 0) {\n return counts.reduce((a, b) => a < b ? a : b);\n }\n else {\n return 0;\n }\n }", "function checkInv(itemId, orderQty) {\n // gets inventory quantity\n var query = \"SELECT * FROM products WHERE item_id = ?\";\n connection.query(query, [itemId], function(err, res) {\n if (orderQty <= res[0].stock_quantity){\n processOrder(res[0].stock_quantity, orderQty, itemId);\n calcTotal(itemId, res[0].price, orderQty);\n } else {\n console.log(\"Sorry our inventory is too low to complete this order.\");\n exitMenu();\n }\n });\n}", "function isItemAvailable(inventoryId, transactionList) {\n\n var finalQuantity = transactionsFor(inventoryId, transactionList).reduce(function(sum, transaction) {\n if (transaction.movement === 'in') {\n return sum + transaction.quantity;\n } else {\n return sum - transaction.quantity;\n }\n }, 0);\n return finalQuantity > 0;\n}", "noMoreThanThreeWeaponsInPlay() {\n let numberOfItems = 0;\n\n this.llama.weaponsInPossession.forEach(weapon => {\n numberOfItems ++;\n });\n\n this.itemsInPlay.forEach(item => {\n if (item instanceof _special_items_weapon_items_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"]) {\n numberOfItems ++;\n }\n });\n\n if (numberOfItems < 3) {\n return true\n }\n\n return false;\n }", "function checkStorage(id, quantity){\n connection.query(\n \"SELECT * FROM products WHERE item_id = ?\",\n [id],\n function(err,res){\n if(err) throw err;\n var currentStock = res[0].stock_quantity;\n var price = res[0].price;\n var sales = res[0].product_sales;\n // If not enough product in stock, alert customer and restart order prompt\n if(quantity > currentStock){\n console.log(\"\\n Order Failed! Insufficient storage to complete the order! \\n\".error);\n restartPrompt();\n }\n else{\n var newStock = currentStock - quantity;\n updateStorage(newStock, id, quantity, price, sales);\n }\n }\n )\n}", "static async canCraft(memberID, itemCode, qty) {\n let craftable = false;\n\n const ingredients = this.CRAFTABLES[itemCode].ingredients;\n const ingredList = Object.keys(this.CRAFTABLES[itemCode].ingredients);\n const ownedIngredients = await Promise.all(\n ingredList.map(ingred => ItemsHelper.getUserItem(memberID, ingred)\n ));\n\n // Check ingredients are sufficient.\n let isSufficient = true;\n ownedIngredients.map(ingred => {\n // Check sufficiency\n const req = ingredients[ingred.item_code] * qty;\n const owned = ingred.quantity;\n\n // Declare insufficient.\n if (owned < req) isSufficient = false;\n });\n if (isSufficient) craftable = true;\n\n return craftable;\n }", "function caculatePreparedItem(food) {\n var foodQty =0;\n var keys = Object.keys(prepItems);\n keys.forEach(function (key) {\n if(prepItems[key] == food){\n foodQty++;\n }\n });\n return foodQty;\n\n}", "amt_of(item) { }", "function quantityRequest(item_id, quantity) {\n connection.query(\"SELECT stock_quantity FROM products WHERE item_id = ?\", [item_id], function (err, res) {\n if (err) throw err;\n var res = res[0];\n if (quantity > res.stock_quantity) {\n console.log(\"\\nI'm sorry, the \" + product_name + \" is temporarily out of stock.\");\n additionalPurchase();\n } else {\n var total = (quantity * price);\n console.log(\"\\nThe total of your order is $\" + total + \". \\nThank you. Hope to see you again soon!\");\n updateInv(item_id, res.stock_quantity, quantity);\n additionalPurchase();\n }\n });\n}", "function validateQuantity() {\n\tfor (var i = 0; i<items.length; i++) {\n\t\tvar quantity = parseInt(document.forms[formName][numberName[i]].value, 10);\n\t\tif(quantity < 0 || quantity > maxQuantity) {\n\t\t\tdocument.getElementById(\"total\").innerHTML = \"Please enter a valid (between 0 and 10) \" + formalNames[i];\n\t\t\tvalidQuantities = false;\n\t\t\treturn ;\n\t\t}\n }\n\tvalidQuantities = true;\n\tcalculateTotal();\n}", "vendItem(productIndex) {\n //check if valid\n let product = vm.products[productIndex]\n // IF Exists we have some you have enough money\n if (product && product.quantity > 0 && vm.currentTransaction >= product.price) {\n this.processTransaction(product)\n return JSON.parse(JSON.stringify(product))\n }\n return false\n }", "function hasQty(allBins, targetItem) {\n const msgId = document.getElementById(\"message\");\n msgId.style.color = \"black\";\n if (allBins) {\n //Returns true if allBins has no qtys\n const isEmpty = !Object.values(allBins).some(\n (x) => x !== null && x !== \"\" && x !== undefined\n );\n if (isEmpty) {\n msgId.style.color = \"#d1231d\";\n setTimeout(() => { msgId.style.color = \"black\" }, 400);\n return setCurrentMsg(`That item is out of stock.`);\n } else {\n return setCurrentMsg(`${targetItem.currentItemName} (${targetItem.currentItemNumber})`);\n }\n } else {\n return setCurrentMsg(`Click an item in the list to display quantities.`);\n }\n }", "function checkCartItemsOnBuy(cartItemsID) {\n const { keyPair } = items;\n for (const cartKey in cartItemsID) {\n if (\n !keyPair[cartKey] ||\n keyPair[cartKey] - cartItemsID[cartKey].quantity < 0\n ) {\n swal({\n title: \"Eksik ürün\",\n text: `${cartItemsID[cartKey].name} ürünü tükenmiş olabilir.`,\n icon: \"warning\",\n button: \"Tamam\",\n });\n return false;\n } else {\n cartItemsID[cartKey].leftItems =\n keyPair[cartKey] - cartItemsID[cartKey].quantity;\n }\n }\n\n return true;\n }", "function validationforUpdate() {\n\tvar totalRows = mygrid.getRowsNum();\n \n\tfor (var rowId = 1; rowId <= totalRows ; rowId++) { \n \t\tif (!isValidQuantity(rowId, \"countedQuantity\")) {\n \t\t\treturn false;\n\t\t}\n }\n \n return true;\n}", "function lowInventory(item) {\n connection.query(\"SELECT * FROM store WHERE Item_id = ?\", item, function (err, results) {\n if (err) throw err;\n\n if (results.length) {\n \n if (results[0].Stock_quantity < 5) {\n const nameProduct = results[0].Product_name;\n const quantity = results[0].Stock_quantity;\n \n connection.query([quantity, nameProduct, item], function (err, results) {\n if (err) throw err;\n\n console.log(\"-------------------------------------------------\");\n console.log(\" Product is \"+ nameProduct + \" only have \" + quantity + \" unit(s).\" );\n console.log(\" Please refill the stock inventory soon as possible. \" );\n console.log(\"-------------------------------------------------\");\n connection.end();\n })\n } else {\n console.log(`\\r\\n Sorry, we do not have any product in a low inventory at this time. Please try again.\\r\\n`);\n options();\n };\n }\n })\n}", "function checkInventory(answer){ \n var query = `SELECT price, stock_quantity, product_sales FROM products WHERE productID=${answer.getItem}`; \n connection.query(query, (err, result) => {\n if(err) throw err;\n var price = result[0].price;\n var itemStock = result[0].stock_quantity; \n var sales = result[0].product_sales; \n if(parseInt(answer.getUnits) > itemStock){\n console.log(`Sorry, we don't have enough of that! You may order up to ${itemStock} units.`);\n promptBuy();\n } else{\n updateDB(answer, itemStock, price, sales);\n }\n })\n}", "function canEquipItemCount() {\n var stats = (0, _templateString.$stats)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral([\"Muscle, Mysticality, Moxie\"]))).map(stat => Math.min((0, _kolmafia.myBasestat)(stat), 300));\n\n if (stats.every((value, index) => value === cachedStats[index])) {\n return cachedCanEquipItemCount;\n }\n\n cachedStats = stats;\n cachedCanEquipItemCount = Item.all().filter(item => (0, _kolmafia.canEquip)(item)).length;\n return cachedCanEquipItemCount;\n}", "function quantityCheck() {\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(res[i].stock_quantity);\n\t\t}\n\t})\n}", "function checkInv() {\n\n connection.query(\"SELECT * FROM products\", function (err, res) {\n stockQuantity = res[saleItem].stock_quantity;\n var totalPrice = res[saleItem].price * saleQuantity;\n if (err) throw err;\n //call the purchase function again if not enough stock\n if (res[saleItem].stock_quantity < saleQuantity) {\n console.log(colors.brightRed(\"\\nI'm sorry, we don't have that many of those. We only have \" + res[saleItem].stock_quantity + \".\\n\"));\n purchase();\n\n } else {\n console.log(colors.brightYellow(\"\\nWord. That'll be \" + totalPrice + \" rupies. Enjoy your \" + res[saleItem].product_name + \"!\\n\"));\n transact()\n\n }\n })\n}", "function checkItemStock () {\n connection.query(`SELECT stock_quantity, price FROM products WHERE item_id=${itemSelected}`, function(err, results) {\n if (err) {\n throw err\n };\n var stock_quantity = results[0].stock_quantity;\n var price = results[0].price;\n\n //Test\n // console.log(`${itemSelected} @ $${price} - ${stock_quantity} units in stock`);\n\n if (quantity < stock_quantity) {\n newStockNum = stock_quantity - quantity;\n var totalPrice = price * quantity;\n console.log(`\\nYou're in luck! We have that item in stock. The total will be $${totalPrice} for ${quantity} units. Thank you and please come again!\\n`)\n updateQuantity();\n connection.end();\n return;\n } else {\n console.log(`\\nSorry! We only have ${stock_quantity} left in stock. Returning you to the product list.\\n`);\n showProducts();\n return;\n }\n });\n}", "function haveEnough() {\n var totalPrice = applePrice * apples + breadPrice * bread;\n var total = money >= totalPrice;\n\n return total;\n}", "checkAmountUniqueStocks(){\n const stocks = [...this.state.stocks];\n let value = stocks.length;\n return value >=this.state.maxAmountUniqueStocks ? true : false;\n }", "function validate_qty(qty){\n return String(qty).search (/^\\s*\\d+\\s*$/) != -1\n }", "twoItems() {\r\n get('#lbl-minicartQty').should('contain', '2');\r\n }", "function checkQtyFd(i){\n\tvar get_i= i.toString();\n\tvar get_i_list=get_i.split(\"_\")\n\t\n\t\n\t\n\tvar slab=get_i_list[0].replace(\"/\",\"\")\n\tvar id=get_i_list[1].replace(\"/\",\"\")\n\t\n\tvar qty=$(\"#ItemQtyfdisplay_\"+slab.toString()+\"_\"+id.toString()).val();\n\tvar faceup=$(\"#ItemFaceupfdisplay_\"+slab.toString()+\"_\"+id.toString()).val();\n\t\n\t\n\tif (parseInt(faceup) > parseInt(qty)){\n\t\t\n\t\t$(\"#ItemFaceupfdisplay_\"+slab.toString()+\"_\"+id.toString()).val(\"\");\n\t}\n}", "function calculateStockCounts(product, quantity) {\n const qty = product.quantity + quantity\n const stock = product.stock\n if (stock < qty) {\n return false\n }\n return true\n }", "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}", "function validateQuantity() {\n var formId = '#load-editing-form';\n if ($('#load-editing-form').length == 0) {\n formId = '#load-announcement-form';\n }\n\n var quantities = countCarQuantities();\n $.each($('.car-quantity select'), function (index) {\n var id = 'loadcar-' + index + '-quantity';\n if (quantities > QUANTITY_MAX_VALUE) {\n $(formId).yiiActiveForm('updateAttribute', id, [TOTAL_QUANTITY_TOO_BIG]);\n } else {\n $(formId).yiiActiveForm('updateAttribute', id, '');\n }\n });\n}", "function isValidQuantity(rowId, columnId) {\n\tvar count = cellValue(rowId,columnId);\n\tif (count != null && (count + \"\").length > 0) {\n\t\tif(!isFloat(count,false) ) {\n\t\t\t// Select the row with the error and grab the cursor\n\t\t\t// there as well\n\t\t\tmygrid.selectRowById(rowId, null, false, false);\n\t\t\tdocument.getElementById(\"countedQuantity\" + rowId).focus();\n\t\t\talert( messagesData.validvalues + \"\\n\" + cellValue(rowId, \"catPartNo\") + \" - \" + messagesData.actualCount );\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n\t\n}", "function purchase(itemId, neededQuant) {\n connection.query(`SELECT * FROM products WHERE id = ${itemId}`, function (err, res) {\n if (err) throw err;\n if(res[0].stock_quantity < neededQuant) {\n console.log(\"Insufficient stock! Sorry. Please check again.\")\n } else {\n connection.query(`UPDATE products SET stock_quantity = ${res[0].stock_quantity} - ${neededQuant} WHERE id = ${itemId}`);\n //sets price to a variable for easy use\n var total = res[0].price * neededQuant;\n console.log(`\nYour total today comes up to ${total}. Thank you for shopping and please come again.\n `)\n }\n connection.end();\n });\n}", "function buy_potions() {\n if (empty_slots() > 0) {\n for (type_id in potion_types) {\n var type = potion_types[type_id];\n\n var item_def = parent.G.items[type];\n\n if (item_def != null) {\n var cost = item_def.g * purchase_amount;\n\n if (character.gold >= cost) {\n var num_potions = num_items(type);\n\n if (num_potions < min_potions) {\n buy(type, purchase_amount);\n }\n } else {\n game_log(\"Not Enough Gold!\");\n }\n }\n }\n } else {\n game_log(\"Inventory Full!\");\n }\n}", "function checkQTY () {\n\tvar errno = \"[ ERROR occured! ]\\n\\n\";\n\tvar flag = false;\n\tvar userQ = document.getElementById(\"userQty\").value;\n\tuserQ = Math.ceil(userQ);\n\tvar availableQ = document.getElementById(\"qty\").innerHTML;\n\n\n\tif (userQ > availableQ) {\n\t\terrno = errno+ \"Order quantity must be less than available quantity!\\n\";\n\t\tflag = true;\n\t}\n\tif (isNaN( userQ )) {\n\t\terrno = errno + \"Order quantity is not a number!\\n\";\n\t\tflag = true;\n\t}\n\tif (userQ == 0) {\n\t\terrno = errno + \"Order quantity cannot be zero!\\n\";\n\t\tflag = true;\n\t}\n\n\tif(flag){\n\t\terrno = errno + \"\\n\\\"Please try again!\\\"\\n\";\n\t\tdocument.getElementById(\"order_qty\").style.color = \"red\";\n\t\tdocument.getElementById(\"order_qty\").style.fontWeight = \"bold\";\n\t\tdocument.getElementById(\"qty_img\").style.visibility = \"visible\";\n\n\t\talert(errno);\n\n\t\tdocument.getElementById(\"userQty\").value = 0;\n\t}\n\n\n}", "function validQuantity(itemId, unitsAmount, results) {\n var query = \"UPDATE products SET stock_quantity=?, product_sales=? WHERE ?\";\n // Calculating the total cost of the order.\n var total = unitsAmount * results.price;\n connection.query(query, [results.stock_quantity - unitsAmount, results.product_sales + total, { item_id: itemId }], function () {\n console.log(\"\\nYOUR TOTAL IS $\" + total + \"\\n\");\n askUser();\n });\n}", "countOfItems() {\n var count = 0\n for (var sku in this.items) {\n var li = this.items[sku]\n count = Number(count) + Number(li.quantity)\n }\n return count\n }", "static validateQuantityGreaterThanZero(pageClientAPI, dict) {\n\n //Quantity > 0?\n if (libThis.evalQuantityGreaterThanZero(dict)) {\n return Promise.resolve(true);\n } else {\n let message = pageClientAPI.localizeText('quantity_must_be_greater_than_zero');\n libCom.setInlineControlError(pageClientAPI, dict.QuantitySim, message);\n dict.InlineErrorsExist = true;\n return Promise.reject(false);\n }\n }", "hasItem() {\n return this.size > 0\n }", "function checkStock(quantity, id) {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n // look into contains instead of for loop\n for (var j = 0; j < res.length; j++) {\n if (res[j].stock_quantity === 0) {\n console.log(\"ID: \" + res[j].id + \" \" + \"Name: \" + res[j].product_name + \":\" + \" \" + \"Sorry, we're all out of stock!\");\n }\n else {\n purchaseItem(quantity, id);\n\n };\n };\n });\n}", "function freeShipping(order){\n var sum = 0;\n for (const items in order){\n sum += order[items]\n }\n return sum > 50;\n}", "function freeShipping(object) {\n let total = 0;\n for (let property in object) {\n total += object[property];\n } \n if (total > 50) {\n return true; \n } else {\n return false;\n \n }\n}", "function checkSizeLimit(order) {\n var orderSize = order.getQuantity();\n if(orderSize > 10000 || 1 > orderSize) return false;\n return true;\n}", "function inventoryCheck() {\n connection.query(\"SELECT stock_quantity FROM products WHERE ?\", [{item_id : itemOneId}], function(error, quantityResult){\n if(error) throw error;\n stockQty = parseInt(quantityResult[0].stock_quantity);\n if(stockQty == undefined) {\n console.log(\"Sorry, no items are available with this item ID: \" + itemOneId);\n }\n else if(stockQty === 0) {\n console.log(\"Sorry, but this item is currently out of stock.\\n\");\n noInventoryOptions();\n }\n else if(stockQty >= itemOneQty) {\n console.log(\"Your item is in stock!\");\n orderProcess();\n }\n else {\n console.log(`\n \\n================================\n \\nOur apologies! Our inventory is\n \\ntoo low to fulfill your order.\n \\nTotal available is: ${stockQty}.\n \\n================================`);\n inventoryOptions();\n }\n });\n}", "function buyItem () {\n inquirer.prompt([\n {\n type:\"input\",\n name:\"itemSelected\",\n message:\"Please type an item id to purchase.\"\n },\n {\n type:\"input\",\n name:\"quantity\",\n message:\"How many would you like to purchase?\"\n }\n ]).then(function (results) {\n itemSelected = results.itemSelected;\n quantity = Number(results.quantity);\n \n if (itemSelected > 10) {\n console.log(\"Invalid item, please select a new item.\")\n buyItem();\n }\n \n checkItemStock();\n });\n}", "function userQuantityChoice(itemName) {\n inquirer.prompt([\n {\n type: \"input\",\n name: \"quantity\",\n message: \"How many would you like?\",\n validate: function(val){\n return val > 0 || val.toLowerCase() === \"q\";\n }\n }\n ]).then(function(val) {\n // turn strin into a number\n quitShopping(val.quantity);\n let quantity = parseInt(val.quantity);\n\n // loop through the database to check if there if enough inventory of the chosen item\n if (quantity > itemName.stock_quantity) {\n console.log(\"Sorry, we do not have enough of that item.\");\n displayProducts();\n } else {\n purchaseItem(itemName, quantity);\n }\n });\n}", "function haveEnough(money, apples, bread, applePrice, breadPrice) {\n var totalPrice = applePrice * apples + breadPrice * bread;\n var total = money >= totalPrice;\n\n return total;\n}", "function haveEnough(money, apples, bread, applePrice, breadPrice) {\n var totalPrice = applePrice * apples + breadPrice * bread;\n var total = money >= totalPrice;\n\n return total;\n}", "function checkBuy() {\n\tif (money <= 99) {\n\t\t$('#alerts').append(\"<br />You do not have enough\" + \"<br />\" + \"money to buy this item <br />\");\n\t} else {\n\t\tbuyItem();\n\t}\n}", "function totalPurchaseCost(item, quantity, coins){\n\tvar storeItems = storeInfo.getItems();\n\tvar cost;\n\tfor (var storeItem in storeItems){\n\t\tif (storeItem.name == item)\n\t\t\tcost = storeItem.price;\n\t}\n\tif (coins >= quantity * cost)\n\t\treturn quantity * cost;\n\telse \n\t\treturn false;\n}", "function getChosenItemQty(item){\n //get the item id out of the string\n var stock_quanity = 0;\n var id = parseInt(item.idBuy.slice(0, 1))\n for(var i = 0; i < inventory.length; i++){\n //get the items object\n if(inventory[i].id == id){\n stock_quanity = inventory[i].stock_quanity;\n }\n }\n return stock_quanity;\n }", "function have(thing) {\n var quantity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n\n if (thing instanceof Effect) {\n return (0, _kolmafia.haveEffect)(thing) >= quantity;\n }\n\n if (thing instanceof Familiar) {\n return (0, _kolmafia.haveFamiliar)(thing);\n }\n\n if (thing instanceof Item) {\n return (0, _kolmafia.availableAmount)(thing) >= quantity;\n }\n\n if (thing instanceof Servant) {\n return (0, _kolmafia.haveServant)(thing);\n }\n\n if (thing instanceof Skill) {\n return (0, _kolmafia.haveSkill)(thing);\n }\n\n if (thing instanceof Thrall) {\n var thrall = (0, _kolmafia.myThrall)();\n return thrall.id === thing.id && thrall.level >= quantity;\n }\n\n return false;\n}", "function isItemAvailable(inventoryItem, transactions) {\n var myTransactions = select(inventoryItem, transactions);\n\n var inventory = myTransactions.reduce(function(total, transaction) {\n if (transaction.movement === 'in') {\n return total + transaction.quantity;\n } else if (transaction.movement === 'out') {\n return total - transaction.quantity;\n }\n },0);\n\n return inventory > 0 ? true : false;\n}", "function buy_potions() {\r\n\tif (empty_slots() >= 0) {\r\n\t\tfor (type_id in potion_types) {\r\n\t\t\tvar type = potion_types[type_id];\r\n\t\t\tvar item_def = parent.G.items[type];\r\n\r\n\t\t\tif (item_def != null) {\r\n\t\t\t\tvar cost = item_def.g * purchase_amount;\r\n\r\n\t\t\t\tif (character.gold >= cost) {\r\n\t\t\t\t\tvar num_potions = num_items(type);\r\n\r\n\t\t\t\t\tif (num_potions < min_potions) buy(type, purchase_amount);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tgame_log(\"Not Enough Gold!\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tgame_log(\"Inventory Full!\");\r\n\t}\r\n}", "function checkInventory(product, quantity){\n var newQuantity;\n var index = product - 1;\n connection.query(\n \"SELECT * FROM products WHERE \" + product, \n function(err, res){\n if(err) throw err;\n \n // console.log(res[index]);\n if(res[index].stock_quantity < quantity){\n console.log(\"Not enough stock\");\n }\n else{\n //update the quantity purchased with a function\n console.log(\"You've purchased \" + quantity + \" of \" + res[index].product_name);\n newQuantity = res[index].stock_quantity - quantity;\n updateInventory(product, newQuantity);\n\n }\n });\n}", "function has_space(s, space){\n let amount\n if (s.energy !== undefined){\n amount = s.energy\n } else if (s.store !== undefined){\n amount = s.store[RESOURCE_ENERGY]\n } else {\n console.log('has_space shouldn\\'t be called with', s)\n }\n return s && - amount - (offered[s.id] || 0)\n + (wanted[s.id] || 0) + (s.storeCapacity || s.energyCapacity) >= (space || 5);\n}", "function isItExpensive2(item) {\n // null\n if(price === null){\n return 'no data';\n }\n\n return price >= 100;\n}", "hasItem(itemName) {\n return this.inventory.inventoryHasItem(itemName);\n }", "function findQty(itemNumber, items) {\n var targetedNumber = items.filter((item) => item.itemNumber === itemNumber);\n return targetedNumber;\n }", "function promptItemQty() {\n inquirer.prompt([\n {\n name: \"quantity\",\n type: \"number\",\n message: \"Please enter the quantity you would like to order: \"\n }\n\n ])\n .then(function(answer3){\n if(answer3.quantity > 0){\n console.log(\"Your quantity is: \" + answer3.quantity + \".\\n\");\n itemOneQty = parseInt(answer3.quantity);\n console.log(\n \">>>Checking inventory...\\n\");\n inventoryCheck();\n }\n else {\n console.log(\"\\nYou didn't enter a quantity\\n\");\n retryItemQty();\n }\n });\n}", "function outOfStock() {\n var oOS = false;\n var table = getCurrentTable();\n if (table === \"error\") return;\n var dic = table.item_id;\n Object.entries(dic).forEach(([key, value]) => {\n var stock = parseInt(getStockFromId(key));\n if (stock < value) {\n oOS = true;\n $('#order').prepend('<span style=\"color:red\">' + get_string('outOfStock') + getNameFromId(key) + ' </span></br>');\n console.log(\"Not enough in stock for: \" + getNameFromId(key));\n }\n })\n return oOS;\n}", "function getAndSetSellingPriceforEachItem()\r\n{\r\n\tvar submittedItemRecord = 0;\r\n\r\n\ttry\r\n\t{\r\n\t\t//if items are available\r\n\t\tif(itemRecords != null)\r\n\t\t{\r\n\r\n\r\n\t\t\t//looping through each item record\r\n\t\t\tfor(var itemIndex = 0; itemIndex <= itemRecords.length; itemIndex++)\r\n\t\t\t{\r\n\t\t\t\titemCausedError = false;\r\n\t\t\t\tnlapiLogExecution('audit', 'context.getRemainingUsage()', context.getRemainingUsage());\r\n\r\n\t\t\t\tif(context.getRemainingUsage() <= scriptUsageLimit || (itemIndex == itemRecords.length))\r\n\t\t\t\t{\r\n\t\t\t\t\tnlapiLogExecution('audit', 'rescheduling context.getRemainingUsage()', context.getRemainingUsage());\r\n\r\n\t\t\t\t\t//reschedule this script.\r\n\t\t\t\t\tnlapiScheduleScript(context.getScriptId(), context.getDeploymentId());\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t{\r\n\t\t\t\t\titemIntID = itemRecords[itemIndex].getValue(itemColumns[0]);\t\t\t\t//getting Item's internal id\r\n\t\t\t\t\titemType = itemRecords[itemIndex].getRecordType();\t\t\t\t\t\t\t//getting Item's type\r\n\t\t\t\t\tbasePrice = itemRecords[itemIndex].getValue(itemColumns[1]);\t\t\t\t//getting Item's base price\r\n\t\t\t\t\titemName = itemRecords[itemIndex].getValue(itemColumns[2]);\t\t\t\t\t//getting Item's name\r\n\t\t\t\t\tvolumetricWeight = itemRecords[itemIndex].getValue(itemColumns[4]);\t\t\t//getting Item's volumetric weight\r\n\t\t\t\t\tdimension1 = itemRecords[itemIndex].getValue(itemColumns[6]);\t\t\t\t//getting Item's dimension1\r\n\t\t\t\t\tdimension2 = itemRecords[itemIndex].getValue(itemColumns[7]);\t\t\t\t//getting Item's dimension2\r\n\t\t\t\t\tdimension3 = itemRecords[itemIndex].getValue(itemColumns[8]);\t\t\t\t//getting Item's dimension3\r\n\r\n\t\t\t\t\t//if the item is a Kit/package (Reason : kit package has no standard average cost, hence a custom field has been used)\r\n\t\t\t\t\tif(itemType == 'kititem')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\taverageCost = itemRecords[itemIndex].getValue(itemColumns[5]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse //if the item is not a kit/package \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\taverageCost = itemRecords[itemIndex].getValue(itemColumns[3]);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(averageCost == '')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\taverageCost = 0.1;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//The item price calculation is done only for following item types \r\n\t\t\t\t\t//(Reason : the multi - currency,multi - pricing and quantity pricing is affecting the following types of items )\t\t\t\r\n\t\t\t\t\t//switch (itemType) \r\n\t\t\t\t\t//{\r\n\t\t\t\t\t//case 'inventoryitem':\r\n\t\t\t\t\t//case 'kititem':\r\n\t\t\t\t\t//case 'noninventoryitem':\r\n\t\t\t\t\t//\tcase 'otherchargeitem':\r\n\t\t\t\t\t//case 'paymentitem':\r\n\r\n\t\t\t\t\t// NOTE : (basePrice != null) is not working\r\n\t\t\t\t\t//if those records are not empty (NOTE : Without those the SOAP request will not work)\r\n\t\t\t\t\tif(basePrice != '' && (dimension1 != '' && dimension2 != '' && dimension3 != '' && volumetricWeight != '')) \t\t\t\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tbasePrice = convertToFloat(basePrice);\t\t\t\t//converting the base price to float value with two decimal points\r\n\r\n\t\t\t\t\t\titemRecord = nlapiLoadRecord(itemType,itemIntID);\t//loading the particular item record\r\n\r\n\t\t\t\t\t\tgetPriceLevelAndCurrencyRateForEachDestination();\t//calling the getPriceLevelAndCurrencyRateForEachDestination function\r\n\r\n\t\t\t\t\t\t//if no error in creating shipping lookup record\r\n\t\t\t\t\t\tif(submittedShippingLookupRecord >0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//update the field\r\n\t\t\t\t\t\t\titemRecord.setFieldValue('custitem_itemprice_lastupdated', nsToday);\r\n\t\t\t\t\t\t\titemCausedError = false;\r\n\t\t\t\t\t\t\t//submitting the item record after setting all the item prices for each destination and for particular price levels \r\n\t\t\t\t\t\t\tsubmittedItemRecord = nlapiSubmitRecord(itemRecord);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\titemCausedError = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\titemCausedError = true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//calling updateItemErrorFlag function\r\n\t\t\t\t\tupdateItemErrorFlag();\r\n\r\n\t\t\t\t\t//\tbreak;\r\n\t\t\t\t\t//}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\t}\r\n\tcatch(e)\r\n\t{\r\n\t\terrorHandler(\"getAndSetSellingPriceforEachItem : \" , e);\r\n\t} \r\n\r\n}", "async function getItemQuantity(itemName) {\n //TODO: ADD IN URL LATER AND SHOULD HAVE + '/' + UID\n const res = await fetch('url');\n if (res.ok) {\n //json will be a list of all the items, which will have quantity when grabbing item\n let json = await res.json();\n console.log(json);\n if (json.itemName == null) return 0;\n return json.itemName;\n\n } else {\n alert('An error occurred while trying to fetch your recipe');\n }\n}", "haveEnough(pizza){\n\n //init a flag. this flag is true if pizza can be made, or false if it can't\n this.flag = true;\n\n //switch statement determines the multiplier to apply to each ingredient based on the size of the pizza\n switch(pizza.size){\n case 'small':\n this.multiplier = 1;\n break;\n case 'medium':\n this.multiplier = 2;\n break;\n case 'large':\n this.multiplier = 3;\n break;\n default:\n console.log('The pizza size is not correct. Please choose: small, medium, large');\n }\n\n //iterate over each ingredient in the pizza\n pizza.item.ingredients.forEach( check => {\n //check to see if the ingredient needed for the pizza exists in the inventory in an amount equal to the size multiplier\n if( this.inventory.ingredientDict[check] < this.multiplier){\n //if there is not enough in the inventory, return false\n console.log('Not enough ingredients to make', pizza.size, pizza.item.name, 'pizza');\n this.flag = false;\n }\n //if there is enough ingredients to make the pizza, decrement the amount of ingredients and make the pizza\n else{\n this.inventory.ingredientDict[check] -= this.multiplier;\n }\n\n });\n\n //return the flag. should be true if the pizza was made, and false if it was not\n return (this.flag);\n }", "function allDishesHaveQuantities(req, res, next) {\n const dishes = res.locals.dishes\n dishes.forEach((dish) => {\n if (!dish.quantity){\n const index = dishes.indexOf(dish)\n next({\n status: 400,\n message: `Dish ${index} must have a quantity that is an integer greater than 0`\n })\n }\n })\n next()\n}", "function checkIfCanBuy(rocket, amount=1){\n var check = 0;\n for (i in rockets[rocket]['cost']){\n if ((rockets[rocket]['cost'][i] * amount) <= currency[i]['amount']){\n check++;\n }\n }\n if (check == Object.keys(rockets[rocket]['cost']).length){\n return true;\n }\n else {\n return false;\n }\n}", "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}", "function lowInventory() {\n connection.query(\"SELECT COUNT (id) AS count FROM products WHERE stock_quantity <=5\", function (err, res) {\n if (err) throw err;\n if (res[0].count === 0) {\n console.log(\"There are no items with low inventory.\");\n nextToDo();\n }\n else {\n connection.query(\"SELECT * FROM products WHERE stock_quantity <= 5\", 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 }\n })\n}", "function checkLimit() {\n return global.maxItems && global.detailsEnqueued >= global.maxItems;\n}", "function pickUp(item){\n\tif(!item.obtained){\n\t\tuser.inventory.splice(-1, 0, item)\n\t\titem.obtained = true;\n\t\tdocument.getElementById('outputDiv').innerHTML= 'You recieved ' + item.name + '! You put it in your inventory. You now have ' + user.inventory.length + ' out of a possible ' + maximumItems + ' items in your inventory!';\n\t\t\n\t\t//Check to see if user meets the maximum items\n\t\tif(user.inventory.length >= maximumItems){\n\t\t\tend();\n\t\t\treturn;\n\t\t}\n\t}else{\n\t\tdocument.getElementById('outputDiv').innerHTML= 'You already have that item!';\n\t}\n}", "function lowInventory() {\n connection.query(\"SELECT * FROM products\", function(err, results){\n var low = false;\n for(var i = 0; i < results.length; i++) {\n if(results[i].stock_quantity < 5) {\n console.log(\"\\n\" + results[i].item_id + \" \" + results[i].product_name + \" $\" + results[i].price + \" quantity: \" + results[i].stock_quantity);\n low = true;\n }\n }\n if(low === false) {\n console.log(\"\\nNo low inventory.\");\n }\n askIfDone();\n });\n}", "inStock() {\n return this.variants[this.selectedVariant].variantQuantity\n }", "totalItemPrice(item) {\n if(undefined === item.price || undefined === item.quantity){\n return 0;\n }\n return item.price * item.quantity;\n }", "getItemCount(item){\n if(this.inventory[item] == null)\n {\n console.log(\"%cCould not find \" + item, \"color:red\");\n return 0;\n }\n else{\n return this.inventory[item];\n }\n }", "function purchaseSingleUpgrades(upgradeChoice){\n let purchSing = clickUpgrades[upgradeChoice]\n let buySing = purchSing + clickUpgrades[upgradeChoice].quantity\n if (cheese >= clickUpgrades[upgradeChoice].price) {\n clickUpgrades[upgradeChoice].quantity ++\n cheese -= clickUpgrades[upgradeChoice].price\n clickUpgrades[upgradeChoice].price += 50\n console.log(clickUpgrades[upgradeChoice].quantity);\n }\n\n drawClickUpgrades()\n\n}", "function checkReturnAvailability(salesorderId,ItemId,Qty){\r\n\r\n\tvar tempQtyReturned = 0;\r\n\tvar totalItemQty = 0;\r\n\tvar logTitle = \"Check Return Availability\";\r\n\r\n\tvar salesorderRecord = nlapiLoadRecord(\"cashsale\",salesorderId);\r\n var lineItemCount = salesorderRecord.getLineItemCount('item');\r\n\r\n\tfor (var line = 1; line <= lineItemCount; line++) {\r\n\r\n\t\tvar itemId_Lineitem = salesorderRecord.getLineItemValue(\"item\", \"item\", line);\r\n\r\n\t\tlog(logTitle,\"itemId_Lineitem: \" +itemId_Lineitem+\" ItemId: \"+ItemId);\r\n\r\n\t\tif(itemId_Lineitem === ItemId){\r\n\t\t\ttotalItemQty = totalItemQty + parseInt(salesorderRecord.getLineItemValue(\"item\", \"quantity\", line));\r\n\t\t}\r\n\t}\r\n\r\n\tvar filtersRA = new Array();\r\n\tfiltersRA[0] = new nlobjSearchFilter('createdfrom', null, 'is', salesorderId);\r\n\tfiltersRA[1] = new nlobjSearchFilter('item', null, 'is', ItemId);\r\n\tvar RAList = nlapiSearchRecord(\"returnauthorization\", null, filtersRA,null);\r\n\r\n\tif(RAList == null){\r\n\t\tlog(logTitle,\"No existing RA found for this transaction\");\r\n\t\tlog(logTitle,\"Qty : \"+Qty+\" totalItemQty: \"+totalItemQty);\r\n\t\tif(Qty <= totalItemQty){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\tfor (var i = 0; i < RAList.length; i++) {\r\n\t\t\r\n\t\tvar RArecord = RAList[i];\r\n\t\tvar salesReturnRecord = nlapiLoadRecord(\"returnauthorization\",RArecord['id']);\r\n \tvar lineItemCountRA = salesReturnRecord.getLineItemCount('item');\r\n\t\tfor (var j = 1; j <= lineItemCountRA; j++) {\r\n\t\t\tvar lineItemId = salesReturnRecord.getLineItemValue(\"item\", \"item\", j);\r\n\t\t\tif(lineItemId === ItemId){\r\n\t\t\t\ttempQtyReturned = parseInt(tempQtyReturned) + parseInt(salesReturnRecord.getLineItemValue(\"item\", \"quantity\", j));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\ttempQtyReturned = parseInt(tempQtyReturned)+parseInt(Qty);\r\n\r\n\tif(tempQtyReturned < totalItemQty){\r\n\t\treturn true;\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n}", "function needMorePylons() {\n connection.query(\" SELECT * FROM products WHERE stock_quantity \", function(err, res) {\n if (err) throw err;\n\n console.log(\"====================Processing====================\");\n console.log(\"====================Completed=====================\");\n\n // Making new variable outside of forloop, if no items are stated in the loop, then var will remain undefined\n var sufficientProducts;\n\n // For loop to check if product quantity is below a threshold (10)\n for (var i = 0; i < res.length; i++) {\n if (res[i].stock_quantity <= 10 ) {\n sufficientProducts = res[i].product_name;\n\n // Display to manager which items match the criteria above\n console.log(\"\\n Products with low stock \\n\")\n console.log(\"Name: \" + res[i].product_name + \" || Stock: \" + res[i].stock_quantity + \"\\n\");\n }\n }\n\n \n if (sufficientProducts === undefined) {\n console.log(\"\\nAll Products have sufficient inventory\\n\")\n }\n nexusBuildsProbes()\n });\n}", "function checkQuantity(){\n var quantity = parseInt($(\"#quantity-counter\").text());\n return (quantity);\n}", "function sellItems(itemID, qtyRequested){\n\t//check qty available by itemID and compare qty requested\n\tvar query = 'SELECT item_id, product_name, department_name, price, stock_qty FROM products WHERE ?';\n\tconnection.query(query, {item_id: itemID}, function(err, items){\n\t\t//if equal to or less than process order and display cost\n\t\tif (qtyRequested <= items[0].stock_qty){\n\t\t\t//run query to update qty\n\t\t\t//determines the new qty of items\n\t\t\tvar newQTY = items[0].stock_qty - qtyRequested;\n\t\t\tupdateItemQTY(itemID, newQTY);\n\t\t\t//calculate total cost of items\n\t\t\tvar totalCost = items[0].price * qtyRequested;\n\t\t\t//display cost\n\t\t\tconsole.log('Total amount owed is: $' + totalCost);\n\t\t} else {\n\t\t\t//if greater than stock qty display error message\n\t\t\tconsole.log('There was a problem with your request, you either requested an invalid qty or invalid ID');\n\t\t}\n\t});\n}", "function isItemUseful(item, useCase) {\n let isUseful = false;\n for (let i = 0; i < item.use.length; i++) {\n for (let x = 0; x < useCase.length; x++) {\n if (item.use[i] == useCase[x]) {\n isUseful = true;\n break;\n }\n }\n }\n return (isUseful);\n}", "function isFull(items) {\n for (let i = 0; i < items.length; i++) {\n if (items <= maxItems) {\n return false;\n } else {\n return true;\n }\n }\n}", "function buyItem(itemName) {\n let upgrade = items.find((item) => item.name == itemName);\n if(zenny >= upgrade.price) {\n zenny -= upgrade.price;\n upgrade.quantity++;\n upgrade.price = Math.floor(upgrade.price * 1.08);\n console.log(upgrade.price)\n update();\n showButtons();\n }\n}", "function purchase(shirts, pants, shoes, discount) {\n\n if (!isLoaded) {\n if (typeof discount != 'number') {\n console.log('please enter number');\n return;\n }\n\n if (shirts <= stockShirts.quantity) {\n console.log('shirts are available');\n } else {\n console.log('shirts are not available');\n return;\n }\n\n if (pants <= stockPants.quantity) {\n console.log('pants are available');\n } else {\n console.log('pants are not available');\n return;\n }\n\n if (shoes <= stockShoes.quantity) {\n console.log('shoes are available');\n } else {\n console.log('shoes are not available');\n return;\n }\n\n if (discount > 0 && discount <= 100) {\n\n console.log('discount valid');\n\n }\n\n printBill(shirts, pants, shoes, discount);\n } else {\n console.log('Issue with stock loading, Unable to process purchase');\n }\n}", "static isValidItems(items = [TestQuestion.structure]){\n return ((items && items.length > 0) &&\n items.every(item => TestQuestion.isValidItem(item))\n );\n }", "function getProductQuantity(id, quantity){\n\n var query = `SELECT PRICE, STOCK_QUANTITY FROM PRODUCTS WHERE ITEM_ID = ${id}`;\n\n connection.query(query, function(err,data){\n if(err) {\n connection.end();\n throw err\n };\n\n\n for(var i = 0; i < data.length; i++){\n\n var item = \n {\n price: data[i].PRICE,\n quantity: data[i].STOCK_QUANTITY\n };\n\n console.log(\"In for loop\");\n console.log(item);\n\n \n if(item.quantity < quantity) {\n return console.log(\"Insufficient quantity!!\");\n }\n\n placeOrder(id, quantity, item);\n\n }\n\n })\n\n // connection.end();\n }", "isFull() {\n return this.items.length == this.maxItems;\n }", "function checkItemInCart() {\n\t\tlet itemCount = c.cart.item_count;\n\t\tconst items = c.cart.items;\n\n\t\tif (itemCount > 0) {\n\t\t\titems.forEach((item) => {\n\t\t\t\tif (item.handle === c.product.handle) {\n\t\t\t\t\titemCount -= 1;\n\t\t\t\t\t// eslint-disable-next-line\n\t\t\t\t\tif (item.properties._giveaway) {\n\t\t\t\t\t\tc.inCart = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tobserveCart();\n\t}", "function calculate_item_qty() {\n\tlet item_quantity = 0;\n\t$('.input_qty').each(function(index, value) {\n\t\titem_quantity += parseFloat(validateNumbers($(value).val()));\n\t});\n\tif (Number.isInteger(item_quantity)) {\n\t\t$('.item_count').text(item_quantity);\n\t} else {\n\t\t$('.item_count').text(getDecimalNumberFormat(item_quantity));\n\t}\n\tgenerateAllTotal();\n}", "checkError() {\n this.state.Qty > this.props.item.stock ? this.setState({QtyError: true}) : this.setState({QtyError: false})\n }", "function viewLowInventory() {\n connection.query(\"SELECT item_id, product_name, price, department_name, stock_quantity FROM products\", function (err, res) {\n if (err) throw err;\n\n console.log(\"Following items are low in stock:\")\n var lowInventoryFound = false;\n for (var i = 0; i < res.length; i++) {\n if (parseInt(res[i].stock_quantity) < 5) {\n lowInventoryFound = true;\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 if (!lowInventoryFound) {\n console.log(\"You do not have any items on low inventory\");\n }\n });\n displayChoices();\n}" ]
[ "0.7579272", "0.73282003", "0.71425194", "0.70702934", "0.7042903", "0.68729836", "0.6799015", "0.6772563", "0.6766669", "0.6738168", "0.67060864", "0.6670088", "0.65696377", "0.65606016", "0.65384585", "0.6503784", "0.6470413", "0.64573795", "0.6455297", "0.6446519", "0.64254886", "0.6423786", "0.64152795", "0.64103395", "0.64045143", "0.63998777", "0.63937515", "0.637882", "0.6378061", "0.63728213", "0.63649035", "0.6350877", "0.633413", "0.63185626", "0.6304083", "0.62867934", "0.62848616", "0.62756985", "0.6268464", "0.6267002", "0.6264104", "0.62627566", "0.6247295", "0.62421066", "0.6219448", "0.6212814", "0.62102145", "0.62076604", "0.6205209", "0.6195846", "0.6195475", "0.61712724", "0.6164637", "0.6163675", "0.6134241", "0.6131253", "0.6128549", "0.6128549", "0.6116173", "0.6114512", "0.6114363", "0.6112304", "0.6110089", "0.6090328", "0.6090261", "0.6083641", "0.60728735", "0.6071794", "0.6061195", "0.60365254", "0.6034837", "0.6026265", "0.60244495", "0.6018576", "0.6018121", "0.6002556", "0.6001998", "0.60010594", "0.59964156", "0.5989667", "0.59789157", "0.5972141", "0.5969288", "0.5955806", "0.5953925", "0.5951751", "0.59465355", "0.5939882", "0.59358084", "0.5930864", "0.59210414", "0.59196514", "0.5913523", "0.5910891", "0.5907145", "0.5905252", "0.59034944", "0.58876234", "0.5878727", "0.5877285" ]
0.67004436
11
function to update quantity in MySql
function updateQuantity() { connection.query("UPDATE products SET stock_quantity = stock_quantity - ? WHERE id = ?", [ quantityToBuy, itemToBuy ], function (err, res) { if (err) throw err; updateProductSale(); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateQuantity() {\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: updatedStock\n },\n {\n item_id: answer.userId\n }\n ],\n );\n }", "function updateStockQuantity(id, quantity){\n mysql_con.query(update_quantity_query, [quantity, id], (err, results, fields)=>{\n if(err) throw err;\n })\n}", "function updateQuantity () {\n connection.query(`UPDATE products SET ? WHERE ?`,\n [\n {\n stock_quantity: newStockNum\n },\n {\n item_id: itemSelected\n }\n ],\n function (err, results) {\n if (err) {\n throw err;\n };\n // Test\n console.log(`Stock Quantity updated.`);\n }\n );\n}", "function updateQuantity() {\n\n // Query to update the item's quantity based on the item ID\n var queryTerms = \"UPDATE products SET ? WHERE ?\";\n var newQuantityOnHand = quantityOnHand - purchaseQuantity;\n \n connection.query(queryTerms,\n [\n {stock_quantity: newQuantityOnHand},\n {item_id: itemID}\n ], function(err, result) {\n if (err) throw err;\n }); \n\n // After that update is done, we need to update the total sales column\n updateTotalSales();\n} // End updateQuantity function", "function updateQuantity(id, addUnits) {\n connection.query(\"SELECT * FROM products WHERE item_id=?\", [id], function (err, response) {\n if (err) throw err;\n var name = response[0].product_name;\n var currentQuantity = parseInt(response[0].stock_quantity);\n var newQuantity = currentQuantity + addUnits;\n connection.query(\"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newQuantity\n },\n {\n item_id: id\n }\n ], function (err, response) {\n if (err) throw err;\n clearConsole();\n consoleMessage(\"Number of \" + name + \" in stock raised from \" +\n currentQuantity + \" to \" + newQuantity);\n userOptions();\n })\n\n })\n}", "function updateQuantity(stock_qty, id, qty)\n {\n \n connection.query(\"UPDATE products SET stock_quantity = \"+ qty + \" WHERE item_id = \"+id,\n function(err, res2) \n {\n if (err) throw err;\n console.log(\"Updated stock inventory quantity: \" +qty);\n connection.end();\n });\n }", "function dbQuantityUpdate() { \n var newStockQuantity;\n\n connection.query(\"SELECT stock_quantity FROM products WHERE ?\", [{item_id : itemOneId}], function(error, quantityResult){\n if(error) throw error;\n stockQty = parseInt(quantityResult[0].stock_quantity);\n newStockQuantity = stockQty - itemOneQty;\n //console.log(newStockQuantity);\n connection.query(\"UPDATE products SET ? WHERE ?\", [{stock_quantity: newStockQuantity}, {item_id: itemOneId}], function(err, res) {\n connection.query(\"SELECT stock_quantity FROM products WHERE ?\", [{item_id : itemOneId}], function(error, quantityResult){\n console.log(\"\\n\\n\\nUpdated quantity for this item in database: \" + quantityResult[0].stock_quantity);\n connection.end();\n\n }); \n });\n });\n\n}", "function updateInventory(product, quantity){\n connection.query(\n \n \"UPDATE products SET ? WHERE ?\",\n [{\n stock_quantity: quantity,\n },\n {\n item_id: product\n }\n ],\n function(err, res){\n if(err) throw err;\n // console.log(\"new quantity: \" + res);\n }\n )\n\n}", "function updateProductQuantity(quantity, item_id) {\n var query = \"UPDATE products SET stock_quantity = ? WHERE item_id = ?\";\n connection.query(query, [quantity, item_id], function(err, item) {\n if(err) throw err;\n });\n }", "function updateQuantity(count, iid) {\n connection.query(\"UPDATE products SET stock_quantity = stock_quantity - ? WHERE item_id = ?\", [count, iid], function (err, res, field) {\n promptUserEntry();\n\n });\n }", "function updateInv() {\n var updatedStock = parseInt(res[0].stock_quantity) - parseInt(quantity);\nconnection.query(\"UPDATE products SET stock_quantity = ? WHERE item_id = ?\",[updatedStock, item_id],function (err, updateRes) {\n if (err) throw err;\n });\n}", "function updateProducts(stock, id, qty){\n connection.query(\"UPDATE products SET ? WHERE ?;\",\n \n [\n {\n Stock_QTY: (parseInt(stock) + parseInt(qty)),\n },\n {\n ID: id,\n }, \n ],\n function(err) {\n if (err) throw err;\n updatedItem(id);\n \n }\n ); \n \n}", "function updateProducts(id,quantity,product_Sales){\n \n connection.query(\"update products set stock_quantity = ?, product_sales = ? where item_id = ?\",[\n quantity, \n product_Sales,\n id\n ],function(error) {\n if (error) throw err;\n console.log(\"Quantity updated successfully!\");\n })\n \n}", "function updateStock(itm, newQty) {\n var sql = \"UPDATE product SET ? WHERE ?\";\n connection.query(sql, [{stock_quantity: newQty}, {item_id: itm}],function (err, res) {\n if (err) throw err;\n if (res.affectedRows != 1) {\n console.log(\"\\n\\n\");\n console.log(\"***** There may have been a error *****\");\n console.log(\"***** Report the following error to the administrator: pCO\" + res.affectedRows + \" *****\");\n }\n // connection.end();\n\n displayOrder(customerOrder);\n });\n}", "function updateStock (qty, id) {\n connection.query('UPDATE products SET stock_quantity = stock_quantity - ? WHERE item_id = ?', [qty, id], function(err, res){\n }); console.log(qty + id);\n}", "function updateProduct() {\n console.log(\"Updating stock quantity...\\n\");\n connection.query(\n \"UPDATE Bamazon_db SET ? WHERE ?\",\n [\n {\n StockQuantity: StockQuantity - qchoice\n },\n ],\n function(err, res) {\n console.log(StockQuantity + \" products updated!\\n\");\n }\n );\n\n // logs the actual query being run\n console.log(query.sql);\n}", "function updateStock (itemID, userQuantity, stockQuantity, product){\n\n // parseInt is used to assure than userQuantity is a number and not a string\n var updateStock = stockQuantity + parseInt(userQuantity);\n\n var query = \"UPDATE products SET ? WHERE ?;\"\n connection.query(query,\n [\n { Stock_Quantity: updateStock}, \n { Item_ID: itemID }\n ],\n function(err, res){\n if (err) throw err;\n }\n );\n\n // Console logs the new amount of the specific item being updated\n // continuePrompt gets called to ask user if they want to do anything else\n console.log(\"\\nStock for \" + product + \" has been increased to \" + updateStock + \"\\n\");\n continuePrompt();\n}", "function updateProduct(name, x, y) {\n var newAmt = x +y;\n\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newAmt\n },\n {\n product_name: name\n }\n ],\n function (err, res) {\n console.log(res.affectedRows + \" product(s) updated!\\n\");\n console.log(\"Order Completed for \"+y+\" \"+name+\"(s)\");\n\n mainMenu();\n }\n );\n\n}", "function updateStock(dept, itemQuantity, itemIdToUpdateStock) {\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: itemQuantity\n },\n {\n item_id: itemIdToUpdateStock\n }\n ],\n function(err, res) {\n if (err) throw err;\n console.log(\n res.affectedRows +\n \" Stock Quantity updated to: \" +\n itemQuantity +\n \" !\\n\"\n );\n getTotalPurchasedPrice(dept);\n }\n );\n }", "function purchaseItem(quantity, id) {\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: quantity--\n },\n {\n id: id\n }\n ],\n function (err, res) {\n // console.log(res);\n if (err) throw err;\n // console.log(\"Product updated.\");\n buyItem();\n }\n )\n return buyItem();\n\n}", "function transact() {\n var newQuantity = stockQuantity - saleQuantity;\n connection.query(\"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newQuantity\n },\n {\n item_id: saleItem + 1\n }\n ], function (err, res) {\n if (err) throw err;\n //console.log(res.affectedRows + \" products updated!\\n\") //for testing\n console.log(\"Thank you! Please come again!\\n\".brightYellow);\n })\n connection.end();\n}", "function updateProduct(itemId, numberLeft) {\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: numberLeft\n },\n {\n item_id: itemId\n }\n ],\n function (error) {\n if (error) throw err;\n displayProducts();\n }\n );\n}", "function updateStock(promptid, quantity){\n\n var queryStr = 'SELECT * FROM products WHERE ?';\n \n connection.query(queryStr, {item_id: promptid}, function(err,res){\n if(err){console.log(err)};\n if(quantity >= 0 ){\n \n var updatedStock = (parseInt(res[0].stock_quantity) + quantity);\n var stockpromptid = parseInt(promptid);\n console.log(updatedStock, stockpromptid)\n confirmPrompt(updatedStock, stockpromptid)\n \n \n } else{\n console.log(\"Oh no, we are out of \" + res[0].product_name + \".\");\n };\n makeTable();\n });\n }", "function updateProduct(val, answer) {\n var updateQ = val;\n var query = \"UPDATE products SET ? WHERE ?\"\n connection.query(query, [{ stock_quantity: updateQ }, { id: answer.item }], function (err, res) {\n if (err) throw err;\n connection.end();\n })\n}", "function updateInventoryInDB(productID, amountAdded) {\n\n connection.query(\n 'UPDATE products SET stock_quantity = stock_quantity + ' + amountAdded + ' WHERE item_id = ' + productID, (err, results) => {\n if (err) { console.log(err); }\n else { console.log('Inventory successfuly added updated'); }\n }\n );\n}", "function incQty(res, mysql, complete, p_id){\n var sql = \"UPDATE Product SET p_qty = p_qty + 1 WHERE p_id =?;\";\n var inserts = [p_id];\n mysql.pool.query(sql, inserts, function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n complete();\n });\n }", "function updateItemQTY(itemID, newQTY){\n\tvar query = 'UPDATE products SET stock_qty = '+ newQTY + ' WHERE item_id =' + itemID;\n\tconnection.query(query);\n}", "function updateProduct(quantityFinal, productID) {\n // console.log(productID);\n // console.log(quantityFinal);\n\n var query = connection.query(\"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: quantityFinal\n },\n {\n item_id: productID\n }\n ], function (err, res) {\n if (err) throw err;\n readDisplay();\n }\n );\n}", "function addInventory(id, quan){\n var quantity = 0;\n connection.query(\"SELECT stock_quantity FROM products WHERE id=\"+id, function(err, res) {\n if (err) throw err;\n if(res.length == 0){\n console.log(\"Please enter a valid product id.\");\n promptManager();\n }else{\n quantity = res[0].stock_quantity + parseInt(quan);\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: quantity\n },\n {\n id: id\n }\n ], function(err, res) {\n if (err) throw err;\n console.log(\"updated the quantity\");\n promptManager();\n });\n }\n });\n}", "function update(){\n newInventory = currentQuantity + updateQuantity;\n\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newInventory\n },\n {\n item_id: itemNum\n }\n ],\n function(err, res) {\n\n if (err) throw err;\n \n inquirer.prompt([\n {\n type: \"confirm\",\n name: \"doAgain\",\n message: \"Your inventory has been successfully updated. Would you like to do something else?\",\n \n }\n ]).then(function(response){\n if (response.doAgain){\n promptManager();\n } else {\n connection.end();\n };\n \n });\n });\n }", "function purchase(product, price, quantity){\n connection.query(\n \"UPDATE products SET ? WHERE ?\",[{\n stock_quantity: currentQuantity - quantity,\n },\n {\n item_id: currentItemId,\n }],\n function(error, results){\n\n if(error) throw error;\n console.log(\"thank you for your purchase!\");\n end();\n }\n )\n\n}", "function inventoryUpdate(id, quantity){\n let query = \"SELECT * FROM products WHERE ?\"\n connection.query(query, {\"item_id\":id}, function(err, res){\n if (err) throw err;\n // console.log(res);\n if(res.length > 0){\n // console.log(\"Check for existence and Update Table\");\n // console.log(\"Stock Quantity\", res[0].stock_quantity);\n if(quantity<=res[0].stock_quantity){\n let newQuantity = res[0].stock_quantity-Math.abs(quantity);\n let newProductSales = res[0].product_sales + res[0].price * Math.abs(quantity);\n let query2 = \"UPDATE products SET stock_quantity=\" + newQuantity + \", product_sales=\" + newProductSales + \" WHERE ?\"\n let query2_obj = {\"item_id\":id}\n connection.query(query2, query2_obj, function(err, res){\n if (err) throw err;\n continueShopping();\n });\n }\n else{\n console.log('\\x1b[31m%s\\x1b[0m',\"\\nInsufficient quantity in the Inventory!!!\\n\");\n continueShopping();\n }\n }\n else{\n console.log('\\x1b[31m%s\\x1b[0m',\"\\nNo Products Found for Item ID: \" + id, \"\\n\");\n continueShopping();\n }\n });\n}", "function updateProduct(product, newQuantity) {\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newQuantity\n },\n {\n product_name: product\n }\n ],\n function(error, result) {\n console.log(\"Products updated!\");\n }\n );\n connection.end();\n}", "function total(item, quantity) {\n connection.query(\"SELECT * FROM products WHERE item_id = \" + item, function (error, res) {\n if (error) {\n console.log(error);\n };\n\n if (quantity <= res[0].stock_quantity) {\n var total = res[0].price * quantity;\n console.log(\"You requested \" + quantity + \" \" + res[0].product_name);\n console.log(\"Your total is $\" + total);\n// this updates the quantity in the database per stock purchased\n connection.query(\"UPDATE products SET stock_quantity = stock_quantity - \" + quantity + \" WHERE item_id = \" + item);\n } else{\n console.log(\"Error: Please see stock quantity for stock\");\n };\n });\n}", "function validQuantity(itemId, unitsAmount, results) {\n var query = \"UPDATE products SET stock_quantity=?, product_sales=? WHERE ?\";\n // Calculating the total cost of the order.\n var total = unitsAmount * results.price;\n connection.query(query, [results.stock_quantity - unitsAmount, results.product_sales + total, { item_id: itemId }], function () {\n console.log(\"\\nYOUR TOTAL IS $\" + total + \"\\n\");\n askUser();\n });\n}", "function updateQuantity() {\n if (updating) {\n console.log(quant);\n console.log(\"Stock quantity: \" + stockQuantity);\n let newStockQuantity = stockQuantity - quant;\n console.log(\"Remaining stock: \" + quant);\n\n let updatedProduct = {\n id: productID,\n stock_quantity: newStockQuantity\n };\n console.log(updatedProduct);\n updateProducts(updatedProduct).then(function(res) {\n console.log(res);\n });\n }\n }", "function updatepurchase(newQty, id) {\n connection.query(\"UPDATE products SET stock_quantity =? WHERE idproducts =?\", [newQty, id], function (err, res) {\n if (err) throw err;\n });\n}", "function updateStorage(newStock, id, quantity, price, sales){\n var totalCost = quantity * price;\n var newSales = sales + totalCost;\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newStock,\n product_sales: newSales\n },\n {\n item_id: id\n }\n ],\n function(err, res){\n if(err) throw err;\n console.log(colors.magenta(\"The total cost of your order is\",\"$\"+ totalCost + \"\\n\"));\n restartPrompt();\n }\n )\n}", "function calcPurchase(ID, quantity) {\n connection.query(\"SELECT * FROM products WHERE item_id = \" + ID, function(err,res) {\n if(err) {console.log(err)};\n if(quantity <= res[0].stock_quantity) {\n var amountSpent = res[0].price * quantity;\n var stockQuantity = res[0].stock_quantity - quantity;\n\n console.log(\"Amount spent= $\" + amountSpent);\n console.log(\"Quantity leftover of \" + res[0].product_name + \" is \" + stockQuantity + \" units.\");\n \n connection.query(\"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: stockQuantity\n },\n {\n item_id: ID\n }\n ],\n \n );\n displayProducts();\n } else {\n console.log(\"Sorry we don't have enough of that item in stock to complete your order!\")\n };\n \n })\n}", "function buy (id, quanityNum, quanity){\n // console.log(\"this is hte BUY function\")\n // console.log(\"this is quanity \"+quanity)\n // console.log(\"this is quanityNum \"+quanityNum)\n quanityNum -= quanity\n // console.log(\"new quanityNum =\"+quanityNum)\n var query = 'UPDATE products SET ? WHERE ?'\n connection.query(query,[{StockQuantity : quanityNum},{itemID:id}], function(err,res){\n if (err)throw err;\n console.log(\"=========================\")\n console.log(\"ORDER PLACED SUCESSFULLY!\")\n console.log(\"=========================\")\n });\n var select = 'SELECT Price FROM products WHERE ?'\n connection.query(select,{itemID : id}, function(err, res){\n if (err) throw err;\n var priceEach = res[0].Price;\n var totalPrice = priceEach * quanity\n console.log(\"Your order total is \"+totalPrice);\n return;\n });\n\n//remove items from the database Stock Quantity based on user choice, message order complete. \n\n\nreturn;\n}", "function decQty(res, mysql, complete, p_id){\n var sql = \"UPDATE Product SET p_qty = p_qty - 1 WHERE p_id =?;\";\n var inserts = [p_id];\n mysql.pool.query(sql, inserts, function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n complete();\n });\n }", "function updateProducts(finalTotal) {\n\n var item = cart.shift();\n var itemName = item.item;\n var itemCost = item.itemCost\n var itemPurchase = item.amount;\n\n\n connection.query('SELECT stock_quantity from products WHERE ?', {\n product_name: itemName\n }, function(err, res) {\n var currentStock = res[0].stock_quantity;\n\n //updates the stock_quantity in bamazon_db\n connection.query('UPDATE products SET ? WHERE ?', [{\n stock_quantity: currentStock -= itemPurchase\n }, {\n product_name: itemName\n }], function(err) {\n if (err) throw err;\n\n if (cart.length != 0) {\n updateProducts(finalTotal);\n } else {\n\n finalTotal = finalTotal.toFixed(2);\n console.log('Thank you for your purchase!');\n console.log('Your total is $' + finalTotal);\n connection.end();\n }\n });\n });\n}", "function updateStock(itemCart, cartQuant, i) {\n var updatedStock = parseInt(itemCart[i].stock_quantity -= cartQuant[i]);\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\", [{\n stock_quantity: itemCart[i].stock_quantity\n },\n {\n item_id: itemCart[i].item_id\n }\n ],\n function (err, response) {\n }\n )\n}", "function updateStock(newQuantity, orderId) {\n connection.query(\n \"UPDATE products SET ? WHERE ?\", [\n {\n stock_quantity: newQuantity\n },{\n item_id: orderId\n }\n ], function(err, res) {\n if (err) throw (err);\n }\n )\n}", "function updateDB(answer, stock, price, sales){ \n var newQuantity = stock - parseInt(answer.getUnits);\n var getTotal = price * parseInt(answer.getUnits); \n var newSales = sales + getTotal;\n var query = `UPDATE products SET stock_quantity = ${newQuantity}, product_sales=${newSales} WHERE productID=${answer.getItem}`;\n connection.query(query, (err) => {\n if(err) throw err;\n console.log(`You're purchase is complete. Your total is $${getTotal}.`);\n nextPrompt();\n })\n}", "function updateItems(answer) {\n\n\tvar query = connection.query(\n\t\t\"UPDATE products SET `stock_quantity` = `stock_quantity` - ? WHERE ?\",\n\t\t[\n\t\t\tanswer.requestVol,\n\t\t\t{\n\t\t\t\tid: parseInt(answer.requestID)\n\t\t\t}\n\t\t], (err, res) => {\n\t\t\tconsole.log(res.affectedRows + \" items updated!\\n\")\n\t\t\t\t\n\t\t})\n\tconsole.log(query.sql);\n}", "function askQty() {\n inquirer\n .prompt({\n type: \"input\",\n name: \"itemQTY\",\n message: \"Enter the quantity you would like to add.\",\n })\n .then(function(answer) {\n productQTY = parseInt(answer.itemQTY);\n \n connection.query(\"SELECT * FROM products WHERE id = ?\", [productID], function(err, res){\n var stock_quantity = parseInt(res[0].stock_quantity);\n\n connection.query(\"UPDATE products SET ? WHERE ?\",\n [\n {stock_quantity : stock_quantity + productQTY\n },\n {\n id: productID \n },\n ], function(err, res) {\n if (err) throw err;\n\n console.log(\"\\n\");\n console.log(\"Product quantity has been updated\");\n promptMgr()\n });\n\n });\n });\n}", "function updateItemQuantity(productId, quantity) {\n $.ajax({\n url: updateUri,\n type: \"POST\",\n data: { ProductId: productId, Quantity: quantity }\n });\n }", "function calculateInventory() {\n // var query = \"UPDATE products SET stock_quantity = quantity WHERE item_id = productId\";\n var query = \"UPDATE products SET stock_quantity = stock_quantity-\" + quantity + \" WHERE item_id = \" + productId;\n connection.query(query, function (err, res) {\n })\n setTimeout(viewInventory, 1500);\n setTimeout(purchaseQuestions, 2000);\n}", "function updateInventory() {\n // console.log(\"Time to update the inventory!\")\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: remainingQuantity\n },\n {\n item_id: chosenID\n }\n ],\n function(err, res) {\n if (err) throw err;\n }\n );\n ask();\n // logs the actual query being run\n // console.log(query.sql);\n}", "function updateDBInventory(answers){\n\tvar id = answers.id;\n\t// NEED TO GET THE current quantity of the ID sselected, not sure how to pull this information in. \n\t\n\tvar quantity = answers.units\n\tconsole.log(\"\\nYour product has been successfully updated in the database!\".green);\n\tconsole.log(\"Select View Products For Sale to see the update\\n\".green);\t\n\treturn db.query(\"UPDATE products SET stockQuantity = stockQuantity + \" + quantity + \" WHERE itemID =\" + id)\n\t\t// .then(function(rows){\n\n\t\t// \treturn getProducts(showProducts);\n\t\t// })\n\t .catch(function(err) {\n\t console.log(err);\n\t });\n\t \n\n}", "updateItemQuantity(db, site_id, item_id, new_amount) {\n return db\n .from(\"inventory\")\n .where({\n site_id: site_id,\n id: item_id,\n })\n .update({ current_amount: new_amount });\n }", "function addQty() {\n \n connection.query( query , function (err, result, fields) {\n if (err) throw err;\n var productId = [];\n var stockQty = {};\n for(i = 0; i < result.length; i++){\n productId.push(result[i].id.toString() + \") \" + result[i].product_name);\n stockQty[result[i].id] = (result[i].stock_qty);\n }\n \n inquirer.prompt([\n {\n type: \"list\",\n message: \"Which item would you like to increase the stock on?\",\n name: \"item\",\n choices: productId\n },\n {\n type: \"input\",\n message: \"By how much?\",\n name: \"count\",\n validate: function(value) {\n if (isNaN(value) === false) {\n return true;\n }\n return false;\n }\n } \n\n ]).then(function(data){\n var itemId = data.item.split(\")\")[0];\n connection.query(\"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_qty: stockQty[parseInt(itemId)] += parseInt(data.count) \n },\n {\n id: itemId\n }\n ]);\n console.log(\"\\nQuantity Updated!\".green + \"\\n\");\n setTimeout (function(){\n start();\n }, 1500)\n })\n }); \n}", "function placeOrder(id, quantity, item){\n\n var currentQuantity = item.quantity - quantity;\n var price = item.price * quantity;\n\n var query = `UPDATE PRODUCTS `+ \n `SET STOCK_QUANTITY = ${currentQuantity}, ` + \n `PRODUCT_SALES = ${price} + COALESCE(PRODUCT_SALES,0), ` +\n `PRODUCT_SOLD = ${quantity} + COALESCE(PRODUCT_SOLD,0) ` +\n `WHERE ITEM_ID = ${id};`;\n\n connection.query(query, function(err,data){\n if(err) {\n connection.end();\n throw err\n };\n\n console.log(`Product Updated to New Quantity ${currentQuantity}`);\n console.log(`Price $${price}`);\n });\n\n connection.end();\n }", "function customerOrder(item, qty) {\n connection.query(\"Select * FROM products WHERE item_id =?\", [item], function (err, res) {\n if (err) { console.log(err) };\n if (qty <= res[0].stock_quantity) {\n var totalCost = res[0].price * qty;\n var updatedStockQuantity = res[0].stock_quantity - qty;\n console.log(\"The item is available in stock!\");\n console.log(\"Total purchase cost for \" + qty + \" \" + res[0].product_name + \" = \" + \"CAD \" + totalCost);\n connection.query(\"UPDATE products SET stock_quantity = ? WHERE item_id = ?\", [updatedStockQuantity, item]);\n } else {\n console.log(\"Items available in stock for : \" + res[0].product_name + \" = \" + res[0].stock_quantity);\n };\n ShowAllProducts();\n });\n}", "function finalizePurchase(itemID, qty, stock, price){\n\n let newStock = stock - qty;\n let totalCost = qty * price;\n\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newStock\n },\n {\n id: itemID\n }\n ],\n function(error) {\n if (error) throw err;\n \n console.log(\"Purchase successful! Your total is $\" + totalCost.toFixed(2));\n startPrompt();\n }\n );\n}", "function updateDB(id, newQuant) {\n return db.query(\"UPDATE products SET ? WHERE ?\", [{ stockQuantity: newQuant }, { itemID: id }])\n .spread(function(rows) {\n // console.log(\"Our inventory has been updated\");\n return startShopping();\n\n }).catch(function(err) {\n console.log(err);\n });\n}", "function updateItemQuantity(id) {\n\t$('#qty_'+id).val( function(i, oldval) {\n \treturn parseInt( oldval, 10) + 1;\n\t});\t\t\n}", "function changeStock(connection,newStock,selectedItem) {\n connection.query(\"UPDATE products SET stock_quantity=? WHERE product_name=?\",[newStock,selectedItem], function (err,res) {\n if (err) throw err;\n shop();\n });\n}", "function updateInventory(answer) {\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: chosenItem.stock_quantity + answer.stockAdded\n },\n {\n item_id: chosenItem.item_id\n }\n ],\n function (error) {\n if (error) throw error;\n console.log(\"Stock added.\");\n anotherAction();\n }\n );\n}", "function purchaseOrder(ID, quantity) {\n connection.query('Select * FROM products WHERE item_id = ' + ID, function (err, res) {\n if (err) {\n console.log(err)\n };\n if (quantity <= res[0].stock_quantity) {\n var totalCost = res[0].price * quantity;\n console.log(\"Still available!\");\n console.log(\"Your total cost for \" + quantity + \" \" + res[0].product_name + \" is \" + totalCost + \" Thank you!\");\n\n connection.query(\"UPDATE products SET stock_quantity = stock_quantity - \" + quantity + \" WHERE item_id = \" + ID);\n } else {\n console.log(\"Sorry, we do not have that many \" + res[0].product_name + \" to complete your order.\");\n };\n displayItems();\n });\n}", "function purchaseItem(itemName, quantity){\n connection.query( \"UPDATE products SET stock_quantity = stock_quantity - ? WHERE item_id = ?\",\n [quantity, itemName.id],\n function (err, res) {\n console.log(\"You purchased \" + quantity + \" \" + itemName.product_name);\n displayProducts();\n }\n );\n}", "function buyProduct(id, q) {\n console.log(\"Completeing purchase. Purchase total is $\" + cost);\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n quantity: q\n },\n {\n id: id\n }\n ],\n function(err, res) {\n if(err) console.log(err);\n console.log(res.affectedRows + \" products updated!\\n\");\n }\n );\n connection.end();\n}", "function postNewItems(itemNum, newQty) {\r\n let query = \"UPDATE bamazon.products SET stock_quantity=? WHERE item_id=? \";\r\n bamazon.query(query, [newQty, itemNum], function (err, res) {\r\n if (err) throw (err);\r\n\r\n console.log(\"\\n Success! New item(s) added to the inventory\\n\");\r\n displayAllInventory();\r\n });\r\n}", "function updateInventory(dbResponse, orderQty) {\n // console.log(\"Updating inventory ...\\n\");\n // console.log(dbResponse);\n\n // update inventory\n var newqty = dbResponse.stock_quantity - orderQty;\n \n // update sales\n var totSales = dbResponse.product_sales + (orderQty * dbResponse.price);\n\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newqty, \n product_sales: totSales\n },\n {\n item_id: dbResponse.item_id\n }\n ],\n function(err, res) {\n // console.log(res.affectedRows + \" offer updated!\\n\");\n showCustomer(orderQty, dbResponse);\n\n loopIt();\n }\n );\n \n // logs the actual query being run\n // console.log(query.sql);\n}", "function addQuantity(product, quantity) {\n connection.query(\n \"UPDATE products SET stock_quantity = ? WHERE item_id = ?\",\n [product.stock_quantity + quantity, product.item_id],\n function(err, res) {\n // Let the user know the purchase was successful, re-run loadProducts\n console.log(\"\\nSuccessfully added \" + quantity + \" \" + product.product_name + \"'s!\\n\");\n loadManagerMenu();\n }\n );\n}", "function fulfillOrder(chosenItem, numUnitsInt) {\n let newStock = chosenItem.stock_quantity - numUnitsInt;\n let totalPrice = chosenItem.price * numUnitsInt;\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newStock\n },\n {\n item_id: chosenItem.item_id\n }\n ],\n function(error) {\n if (error) throw err;\n console.log(`You bought ${numUnitsInt} units of the ${chosenItem.product_name}. You spent a total of $${totalPrice}.`);\n connection.end();\n }\n );\n}", "function inventory(item_update, quantity_update) {\n\t//UPDATE [table] SET [column] = '[updated-value]' WHERE [column] = [value];\n\tconnection.query(\n\t\t\"UPDATE products SET ? WHERE ?\",\n\t\t[\n\t\t{\n\t\t\tstock_quantity: quantity_update\n\t\t},\n\t\t{\n\t\t\titem_id: item_update\n\t\t}\n\t\t],\n\t\tfunction(error) {\n\t\t\tif (error) throw err;\n\t\t\tinquirer.prompt([{\n\t\t\t\tname: \"anything_else\",\n\t\t\t\ttype: \"confirm\",\n\t\t\t\tmessage: \"Continue to Purhcase?\",\n\t\t\t\tdefault: true\n\t\t\t}]).then(function(res){\n\t\t\t\tif(res.anything_else){\n\t\t\t\t\trun();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//if nothing else then end session\n\t\t\t\t\tconsole.log(\"Good Bye! Thanks for coming\");\n\t\t\t\t\tconnection.end();\n\t\t\t\t}\n\t\t\t})\n\t\t})\n}", "function updateSQL(item) {\n\t// build a query url for MYSQL by concatonating the delta of max qty and purchaseqty and the passed variable's property of property_id\n\tvar queryURL = \"UPDATE bamazon_products SET STOCK_QTY = \" + (item.maxQTY - item.purchaseQTY) + \" WHERE item_id = \" + item.item_id;\n\t// run the query through the connection\n\tconnection.query(queryURL, function (error, results) {\n\t\tif (error) {\n\t\t\treturn console.log('error!!')\n\t\t\tconsole.log(results)\n\t\t}\n\t})\n}", "function updateDB (answers) {\n connection.query(\n `UPDATE products\n\t\tSET stock_quantity = stock_quantity - ${answers.amt}\n\t\tWHERE item_id = '${answers.id}'`,\n (err, res) => {\n if (err) {\n console.log(\"Error in updateDB\");\n }\n }\n );\n}", "function addquatity(){\n updateQuantity(quantity + 1);\n }", "function orderItem(id, quantNeeded) {\n connection.query('Select * FROM products WHERE item_id = ' + id, function(err,res){\n if(err){\n console.log(err);\n };\n if (quantNeeded <= res[0].stock_quantity)\n {\n var totalCost = res[0].price * quantNeeded;\n console.log(\"Sufficient quantity is available for your order.\");\n console.log(\"Total cost for \" + quantNeeded + \"s \" + res[0].product_name + \" is \" + totalCost);\n connection.query(\"UPDATE products SET stock_quantity = stock_quantity - \" + quantNeeded + \" WHERE item_id = \" + id);\n }\n else\n {\n console.log(\"We don't have that many \"+ res[0].product_name + \"s in stock!\")\n }\n productList();\n });\n}", "function increaseInventory(){\n var query = \"SELECT stock_quantity FROM products WHERE ?\";\n //quaery the DB to get the item_ids and their associate stock quantity\n connection.query(query, { item_id: addInvId }, function(err, res) {\n if (err) throw err;\n //store the requested item's stock quantity to a variable\n currInvQuant = res[0].stock_quantity;\n //convert the current inventory and inventory to be added from strings to intergers amd add them together\n newInvQuant = parseInt(currInvQuant) + parseInt(addInvQuant);\n // convert the newly calculated total inventory into a string so it can be inserted into the DB\n newInvString = newInvQuant.toString();\n //query the SQL DB and update the inventory for the specified item_id\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newInvString\n },\n {\n item_id: addInvId\n }\n ],\n function(err) {\n if (err) throw err;\n //if successfull, inform the user the DB was updated and then call mainMenu to return to display the menu option\n console.log(\"***********************************************************\");\n console.log(\"* Inventory Updated! *\")\n console.log(\"***********************************************************\");\n setTimeout(mainMenu, 1 * 1000);\n }\n );\n });\n}", "addToInventory(userInput){\n // Get DB info of the item selected\n this.connection.queryAsync('SELECT * FROM products WHERE item_id = ?', [userInput.choice])\n .then(queryItem => {\n // UPDATE Inventory\n this.connection.queryAsync('UPDATE products SET stock_quantity = stock_quantity + ? WHERE item_id = ? LIMIT 1', [userInput.quantity, userInput.choice])\n .then(() => {\n\n let newTotal = parseInt(userInput.quantity) + queryItem[0].stock_quantity;\n\n console.log(`\\nInventory update was successful!\\nNew inventory is ${newTotal}`);\n\n })// Close DB connection\n .then(this.connection.end())\n .catch((err) => console.log(err))\n \n }).catch((err) => console.log(err));\n }", "function addInventoryDB(item_id, stock) {\n var query = connection.query(\n // UPDATE products SET quantity=100 WHERE flavor='Rocky Road';\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: stock\n },\n {\n item_id: item_id\n }\n ],\n function(err, res) {\n console.log(\"The quantity is added!\\n\");\n selectMenu();\n }\n );\n\n //connection.end();\n}", "static async updateOrder(id, quantity) {\n const existingOrder = await Order.getOrderById(id);\n const newQuantity = quantity ?? existingOrder.quantity;\n\n const { rows } = await pool.query(\n `UPDATE orders SET quantity=$1 WHERE id=$2 RETURNING *`,\n [ newQuantity, id] \n )\n\n return new Order(rows[0]);\n \n }", "function quantityIncrement(){\nquantity=$(\"#quantity\").val();\nquantity=++quantity;\n$(\"#quantity\").val(quantity);\n}", "function purchase(stock, item) {\n console.log(\"Okay, let's get your order ready. That'll be $\" + price + \". Hope you've got cash...Processing your order now.\");\n let query = \"UPDATE products SET stock_quantity = ? WHERE Item_id = ?\";\n connection.query(query, [stock, item], function(err, results) {\n displayStore();\n });\n\n}", "function updateInv(){\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: remainingInv\n },\n {\n item_id: purchId\n }\n ],\n function(err) {\n if (err) throw err;\n //if the update is successful, show the user the ourchase is being processed\n console.log(\"***** Processing order... *****\");\n //call the function that displays the current order\n setTimeout(displayOrder, 1 * 2000); \n }\n );\n}", "function getStock() {\n connection.query(\n \"SELECT * FROM products WHERE product_name = ?\",\n [userProductChoice],\n function(error,results,fields) {\n if (error) throw error;\n userProductQuantity = parseInt(results[0].stock_quantity);\n totalQuantity = userProductQuantity + addStockAmount;\n\n updateDatabase();\n }\n ); // close SQL query\n\n function updateDatabase() {\n connection.query(\n \"UPDATE products SET stock_quantity = ? WHERE product_name = ?\",\n [totalQuantity , userProductChoice],\n function(error, results, fields) {\n if (error) throw error;\n console.log(userProductChoice + \" stock updated!\");\n }\n ); // close SQL query\n connection.end(); // ends SQL connection\n }; // close updateDatabase()\n }", "function updateTable(id, quantity, res) {\n console.log(\"Updating inventory quantity...\\n\");\n var itemSelect = res[id - 1];\n\n if (itemSelect.stock_quantity == 0 || (itemSelect.stock_quantity - quantity < 0)) {\n console.log(\"Insufficient Quantity!\");\n initiate();\n } else {\n var reduce = (itemSelect.stock_quantity - quantity);\n var query = \"UPDATE bamazon_db.products SET ? WHERE ?\";\n connection.query(query,\n [\n {\n stock_quantity: reduce\n },\n {\n item_id: itemSelect.item_id\n }\n ],\n function (err) {\n if (err) throw err;\n console.log(\"=========================================\");\n console.log(\"ID # \" + itemSelect.item_id + \" quantity updated to: \" + reduce + \"\\n\");\n\n console.log(\"Your price for this transaction is: $\" + (quantity * itemSelect.price));\n console.log(\"=========================================\");\n\n connection.query(\"SELECT * FROM products\", function (err, res){\n if (err) throw err;\n for (let 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 inquirer.prompt([\n {\n type: \"confirm\",\n name: \"another\",\n message: \"Would you like to purchase another item?\"\n }\n ]).then(function (response){\n switch(response.another){\n case true:\n initiate();\n break;\n case false:\n console.log(\"Thank you for your purchase, have a nice day.\")\n connection.end();\n break;\n default:\n console.log(\"You must be too drunk to press y or n, get out!\")\n console.log(\"Session as ID: \" + connection.threadId + \" has ended.\")\n connection.end();\n break;\n }\n })\n });\n } \n );\n }; \n}", "function updateProductSale() {\n // select the item in database\n connection.query(\"SELECT price, id FROM products WHERE id =?\", [itemToBuy], function (err, res) {\n if (err) throw err;\n // update sales of item in database\n connection.query(\"UPDATE products SET product_sales=product_sales + ? WHERE id=?\",\n [\n (parseFloat(res[0].price) * quantityToBuy),\n itemToBuy\n ],\n function (err, res) {\n if (err) throw err;\n viewAll();\n })\n }\n )\n}", "function updateTable(updatedStock, ID){\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: updatedStock\n },\n {\n item_id: ID\n }\n ],\n function(error, res) {\n if (error) throw err;\n }\n );\n}", "function updateRecord() {\n //connection.query(\"UPDATE products SET quantity = (quantity - 1) Where id = 1\", function(err, res) {\n //connection.query(\"UPDATE products SET quantity = ?, bar = ?, baz = ? WHERE id = ?', ['a', 'b', 'c', userId]\", function(err, res) {\n connection.query(\"UPDATE users SET foo = ? WHERE id = ?', ['(quantity - 1)', '1']\", function(err, res) {\n console.log(\"updateRecord Returned res: \", res);\n // for (var i = 0; i < res.length; i++) {\n // console.log(res[i].id + \" | \" + res[i].flavor + \" | \" + res[i].price + \" | \" + res[i].quantity);\n // }\n console.log(\"-----------------------------------\");\n displayRecords();\n });\n}", "function restockDatabase(id, quant) {\n\t//update the database\n\tconnection.query('SELECT * FROM Products Where ItemID = ' + id, function(error, response) {\n\t\tif (error) { console.log(error) };\n\t\tconnection.query('UPDATE Products SET StockQuanity = StockQuanity + ' + quant + 'WHERE ItemID = ' + id);\n\t\t//re-run display to show updated results\n\t\tdisplayAll();\n\t});\n}", "function updateQuantity(fn, variantId) {\r\n\t // var variant = product.variants.filter(function (variant) {\r\n\t // return (variant.id === variantId);\r\n\t // })[0];\r\n\t // var quantity;\r\n\t var cartLineItem = findCartItemByVariantId(variantId);\r\n\t if (cartLineItem) {\r\n\t cartLineItem.quantity = fn(cartLineItem.quantity);\r\n\t quantity = cartLineItem.quantity;\r\n\t updateVariantInCart(cartLineItem, quantity);\r\n\t }\r\n\t }", "function updateInventory(itemID, updatedStock) {\n connection.query(\n // update 'products' table in the database\n // first '?' correspond to 'stock_quantity: updatedStock'\n // second '?' correspond to 'id: itemID'\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: updatedStock\n },\n {\n id: itemID\n }\n ],\n function(error) {\n if (error) throw error;\n //console.log(\"\\nInventory updated!\");\n \n }\n );\n}", "function updateQuantityField(el) {\r\n // Set minimum value to 1\r\n if (isNaN(el.value) || el.value <= 0) {\r\n el.value = 1;\r\n }\r\n // Set maximum value to 99\r\n else if (el.value >= 100) {\r\n el.value = 99;\r\n }\r\n // Update cart values\r\n updateCartSubtotal();\r\n updateCartTotal();\r\n updateQuantityToStorage(el);\r\n}", "function updateStock() {\n inquirer.prompt([\n {\n type: 'input',\n message: 'Enter the ID of item you want to add:',\n name: 'id',\n validate: function (input) {\n if (!isNaN(input) && Number(input) > 0) {\n return true;\n } else {\n console.log(' <- is not a valid number.');\n return false;\n }\n }\n },\n {\n type: 'input',\n name: 'quantity',\n message: 'How many would you like to add?',\n validate: function (input) {\n if (!isNaN(input) && Number(input) >= 0) {\n return true;\n } else {\n console.log(' <- is not a valid number.');\n return false;\n }\n }\n }\n ]).then(function (item) {\n\n // select stock of product from id and calculate new stock quantity\n connection.query(`SELECT stock_quantity, product_name FROM products WHERE item_id = ?`, item.id, function (err, stock) {\n if (err) throw err;\n\n var updatedStock = Number(item.quantity) + Number(stock[0].stock_quantity);\n var table = new Table({\n head: ['item_id', 'product_name', 'stock_quantity'],\n colWidths: [10, 15, 18]\n });\n\n table.push([Number(item.id), stock[0].product_name, updatedStock]);\n\n console.log(`Adding [${item.quantity}x] of [${stock[0].product_name}] to stock!`);\n console.log(table.toString());\n console.log(`New stock total!`);\n\n // update item_id and item_quantity\n connection.query(`UPDATE products SET stock_quantity = ? WHERE item_ID = ?`, [updatedStock, item.id], function (err, res) {\n if (err) throw err;\n console.log('\\n');\n managerView();\n });\n });\n });\n}", "function Q_plus(pid) {\n var current_Q = $('#pQuantity'+pid).val();\n var update_Q = parseInt(current_Q) + 1;\n $('#pQuantity'+pid).val(update_Q);\n}", "function quantityChangedMB(event) {\n var input = event.target\n if (isNaN(input.value) || input.value <= 0) {\n input.value = 1\n }\n var quantity = input.value\n var product_id = input.getAttribute('data-productid')\n ajaxUpdateItemCart(product_id,quantity)\n updateCartTotalMB()\n}", "function units(stock,itemid,price){\n // var stock;\n inquirer.prompt({\n type : \"input\",\n name : \"productunits\",\n message : \"how money units of product would you like to buy ?\"\n }).then(function(answer){\n \n if(answer.productunits <= stock){\n \n console.log(\"units : \"+ answer.productunits);\n var quantity=stock-answer.productunits;\n console.log(\"stock quantity : \"+quantity);\n\n //mysql query to update stock quantity \n connection.query(\"update products set ? where ?\",[{stock_quantity : quantity},{item_id : itemid}],function(err){\n if(err)throw err;\n // var previous=answer.product_sales;\n var totalcost= answer.productunits*parseFloat(price,2);\n console.log(\"Total cost : \"+totalcost);\n connection.query(\"select product_sales from products where ?\",{item_id :itemid},function(err,res){\n console.log(\"res \"+res[0].product_sales);\n \n var oldresofproductsale=parseFloat(res[0].product_sales,2);\n console.log(\"old \"+oldresofproductsale);\n\n connection.query(\"update products set ? where ? \" , [{product_sales:(totalcost + oldresofproductsale) },{item_id :itemid}],function(err,res){\n if(err)throw err;\n console.log(\"process payment to get the product \");\n connection.end();\n });\n });\n //mysql query to update product sales from the above calculation\n \n });\n \n }else if((answer.productunits) > stock && (stock > 0)){\n console.log(\"Insufficient quantity! \\n \"+ \"we have \"+stock +\" items\");\n units(stock);\n }else if(stock==0){\n console.log( \"The item is not avalable\");\n productid();\n }\n\n });\n }", "async function putChangeOrderQuantity(req, res) {\r\n let orderDetailId = req.body.orderDetailId;\r\n let userId = req.user._id;\r\n let quantity = req.body.quantity;\r\n OrderDetail.methods\r\n .changeProductQuantity(orderDetailId, quantity, userId)\r\n .then(() => {\r\n return res.json({ ok: 1, message: \"thanh cong\" });\r\n })\r\n .catch(err => {\r\n console.log(err);\r\n return res.status(500).send({ ok: 0, message: \"that bai\" });\r\n });\r\n}", "function updateInventoryItem(itemId, quantity)\n\t{\n\t\tquantity = 500;\t\t//TEST CODE REMOVE\n\t\titemId = 3;\t\t\t//TEST CODE REMOVE\n\t\t\n\n\t\tvar updateData = {\n\t\t\t\"quantity\": quantity\n\t\t};\n\n\n\t\t$.ajax({\n\t \tmethod: \"PUT\",\n\t \turl: \"/api/inventory/\" + itemId,\n\t \tdata: updateData\n\t })\n\t .done(function(data) {\n\t \tconsole.log(JSON.stringify(data, null, 2)); //TEST CODE\n\n\t \t//Logic using data here.\n\t \t\n\t });\n\t}", "function handleUpdate(e) {\n\tfor (let name in updatedQuantity) { // sample updatedQuantity: {usmc fitness book: \"20\", usmc pt shirt 1: \"9\"}\n\t\tcart.updateCart(name, +updatedQuantity[name])\n\t}\n\treRenderTableBody();\n\trenderCartTotal();\n}", "function updateDatabase(itemName, itemInventory, totalSales) {\n\n connection.query(\"UPDATE products SET ? WHERE ?\", [\n {\n stock_quantity: itemInventory\n },\n {\n product_name: itemName\n }\n ], (err, results, fields) => {\n if (err) {\n throw err;\n }\n return continueShoppingPrompt();\n });\n}", "function restock(id, numExtraItems) {\n //obtaining current quantity of item\n var query1 = \"SELECT product_name, stock_quantity FROM products WHERE item_id=?\";\n connection.query(query1, id, function (err, res) {\n //error occurs\n if (err) {\n throw err;\n }\n\n //console.log(res);\n var item = res[0].product_name;\n var currentStock = parseInt(res[0].stock_quantity);\n\n //restocking item\n var query2 = \"UPDATE products SET stock_quantity=? WHERE item_id=?\";\n connection.query(query2, [currentStock + numExtraItems, id], function (err, res) {\n //error occurs\n if (err) {\n throw err;\n }\n\n //console.log(res);\n console.log(item + \" restocked.\\n\");\n returnToMenu();\n });\n });\n}", "function updateInventory() {\n console.log(`\n =========================\n Inventory Update Menu\n ========================= \n`);\n\n bamazon.query(`\n SELECT * FROM products WHERE stock_quantity < 50`, function(err, productInfo) {\n if (err) throw err;\n\n const productName = productInfo.map(product => product.product_name);\n\n inquirer.prompt([\n {\n name: \"whatProduct\",\n message: \"What item needs updating?\",\n type: \"list\",\n choices: productName\n },\n {\n name: \"howMuch\",\n message: \"How much inventory are you adding\",\n type: \"input\",\n validate: function (quantityInput) {\n\n if (!isNaN(quantityInput)) {\n return true;\n \n } else if (quantityInput <= 0) {\n console.log(`\n ==============================\n Please input a valid quantity\n ==============================\n`)\n } else if (!quantityInput) {\n console.log(`\n ==============================\n Please input a valid quantity\n ==============================\n`)\n }\n }\n }\n ])\n .then(function (inputInfo) {\n\n const selectedItem = productInfo.find(function(product) {\n return inputInfo.whatProduct\n });\n\n var updatedQuantity = parseInt(inputInfo.howMuch) + productInfo[0].stock_quantity;\n\n bamazon.query(`\n UPDATE products SET stock_quantity = ? WHERE item_id = ?`, [updatedQuantity, selectedItem.item_id])\n \n console.log(`\n ===============================================\n Selected Item: ${selectedItem.product_name}\n Updated Stock: ${inputInfo.howMuch} Units\n New Total: ${updatedQuantity} Units\n ===============================================\n `) \n lowInventory(); \n })\n })\n}", "function addQty(){\n\n \tinquirer.\n prompt([\n {\n type:\"input\",\n message:\"What item would you like to add more units to? Enter the Item ID:\",\n name:\"item\" //,\n // to validate a item ID entry using regular expression to ensure that only six upper-case letters are entered\n /* validate: function (item) {\n var prod = item.match(/^([A-Z]\\d{4});\n if (prod) {\n return true;\n }\n return 'Please enter a valid item ID';\n } */\n },\n {\n type:'input',\n message:'How many would you like to add?',\n name:'qty',\n validate: function (qty) {\n var valid = !isNaN(parseFloat(qty));\n return valid || 'Please enter a number';\n }\n \t},\n ]).then(function(increase){\n var updateQuery = \"UPDATE products SET stock_quantity = stock_quantity + ? WHERE ?;\";\n // the WHERE clause takes object consisting of key value pairs, hence the curlies\n connection.query(updateQuery, [ increase.qty, { item_id: increase.item }], function(err, res) {\n \tif(err) throw err;\n \t\n console.log(oneLine);\n console.log(oneLine);\n \tconsole.log(\"You have successfully modified the product\\'s quantity in inventory.\");\n \tconsole.log(\"\\nHere is the updated record:\");\n \t\n });\n\n return increase.item;\n\n // show that record was updated successfully by calling the viewProd function that just displays the record that was updated (in table format)\n }).then (function(item){ \n \tviewProd(item);\n\t});\n}", "function updateSales(count, iid){\n connection.query(\"UPDATE products SET product_sales = product_sales + price * ? WHERE item_id = ?\", [count, iid], function (err, res, fields){\n })\n }" ]
[ "0.842471", "0.8302666", "0.8280131", "0.81796205", "0.7951781", "0.79413843", "0.79346824", "0.7868829", "0.78555834", "0.78479797", "0.7804991", "0.77859235", "0.7766199", "0.7707437", "0.76579356", "0.76409584", "0.7638949", "0.7637598", "0.76352155", "0.76307696", "0.76305753", "0.7621233", "0.7583141", "0.7505604", "0.7494689", "0.7493291", "0.7491731", "0.74862397", "0.7485724", "0.747204", "0.74597675", "0.7424361", "0.74037504", "0.73909837", "0.73679316", "0.73367333", "0.73225844", "0.73218733", "0.7321833", "0.73051953", "0.7300509", "0.72685486", "0.72543085", "0.7249654", "0.72489154", "0.72340083", "0.7202523", "0.71922296", "0.7160133", "0.7159046", "0.71566737", "0.71559894", "0.7134931", "0.71170634", "0.71008474", "0.7092492", "0.7074832", "0.7063401", "0.70595604", "0.7057473", "0.7033253", "0.7021425", "0.7010095", "0.700605", "0.69910145", "0.6988144", "0.6960645", "0.69596183", "0.6940386", "0.6918989", "0.6918582", "0.6914774", "0.68886757", "0.68836516", "0.68757224", "0.68735504", "0.6863954", "0.6850592", "0.6844125", "0.6839345", "0.6838839", "0.68368655", "0.6824389", "0.68135774", "0.6810866", "0.68086624", "0.68053544", "0.68048924", "0.67953014", "0.67882127", "0.6777273", "0.6755808", "0.6743686", "0.67416584", "0.6736025", "0.6675767", "0.66752803", "0.6673341", "0.66710246", "0.66576815" ]
0.8082354
4
function to update product sales
function updateProductSale() { // select the item in database connection.query("SELECT price, id FROM products WHERE id =?", [itemToBuy], function (err, res) { if (err) throw err; // update sales of item in database connection.query("UPDATE products SET product_sales=product_sales + ? WHERE id=?", [ (parseFloat(res[0].price) * quantityToBuy), itemToBuy ], function (err, res) { if (err) throw err; viewAll(); }) } ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateSales(count, iid){\n connection.query(\"UPDATE products SET product_sales = product_sales + price * ? WHERE item_id = ?\", [count, iid], function (err, res, fields){\n })\n }", "function updateTotalSales() {\n\n // Query to update total sales based on product id\n var queryTerms = \"UPDATE products SET ? WHERE ?\";\n\n // parseFloat is required to make sure the math is handled with decimal values, not string\n var grandTotalSales = parseFloat(newSales) + parseFloat(totalSales);\n\n connection.query(queryTerms,\n [\n {product_sales: grandTotalSales},\n {item_id: itemID}\n ], function(err, result) {\n if (err) throw err;\n });\n\n // Back to the start of the program\n start();\n} // End updateTotalSales function", "function updateProductSales(dept,newOHC, totalProductSales) {\n connection.query(\"UPDATE departments SET ? WHERE ?\",\n [\n { product_sales: totalProductSales },\n { department_name: dept }\n ], function (err, res) {\n if (err) throw err;\n console.log(res.affectedRows + \" The total product sales for \" + dept + \" has been updated in the Departments Table to: \" + totalProductSales + \" !\\n\");\n let totalProfit = parseFloat(totalProductSales - newOHC).toFixed(2);\n updateTotalProfit(dept, totalProfit, newOHC)\n })\n}", "function updateStorage(newStock, id, quantity, price, sales){\n var totalCost = quantity * price;\n var newSales = sales + totalCost;\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newStock,\n product_sales: newSales\n },\n {\n item_id: id\n }\n ],\n function(err, res){\n if(err) throw err;\n console.log(colors.magenta(\"The total cost of your order is\",\"$\"+ totalCost + \"\\n\"));\n restartPrompt();\n }\n )\n}", "function updateSales(total, item) {\n\t// finds the name of the department the ordered item belongs to\n\tconn.query('SELECT departmentName FROM products WHERE itemID = ' + conn.escape(item), function(err,res) {\n\t\tif (err) {throw err}\n\n\t\tvar depName = res[0].departmentName\n\n\t\t// based on the department, update that row in table departments with the sale total\n\t\tconn.query('UPDATE departments SET totalSales = totalSales + ' + conn.escape(total) + ' WHERE departmentName = ' + conn.escape(depName), function(err, res) {\n\t\t\tif (err) {throw err}\n\n\t\t\tconsole.log('Total Sales column updated:', depName, '+$' + total)\n\t\t})\n\t})\n}", "async updateSale(saleID, storeID) {\n\n}", "function updateProductSales(anItem_id, productSales) {\n\n var sql = \"UPDATE ProductsTable SET product_sales = \" + productSales + \" WHERE item_id = \" + anItem_id;\n console.log(\"UPDATE ProductsTable.product_sales SQL: \" + sql);\n connection.query(sql, function(err, result) {\n if (err) {\n throw err;\n } else { //qtyInStock > qtyToPurchase\n console.log(result.affectedRows + \" record(s) updated\");\n connection.close();\n }\n\n });\n}", "function totalSales(products, lineItems){\n //TODO\n\n}", "function updateProducts(id,quantity,product_Sales){\n \n connection.query(\"update products set stock_quantity = ?, product_sales = ? where item_id = ?\",[\n quantity, \n product_Sales,\n id\n ],function(error) {\n if (error) throw err;\n console.log(\"Quantity updated successfully!\");\n })\n \n}", "function updateProduct(name, x, y) {\n var newAmt = x +y;\n\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newAmt\n },\n {\n product_name: name\n }\n ],\n function (err, res) {\n console.log(res.affectedRows + \" product(s) updated!\\n\");\n console.log(\"Order Completed for \"+y+\" \"+name+\"(s)\");\n\n mainMenu();\n }\n );\n\n}", "function updateDB(answer, stock, price, sales){ \n var newQuantity = stock - parseInt(answer.getUnits);\n var getTotal = price * parseInt(answer.getUnits); \n var newSales = sales + getTotal;\n var query = `UPDATE products SET stock_quantity = ${newQuantity}, product_sales=${newSales} WHERE productID=${answer.getItem}`;\n connection.query(query, (err) => {\n if(err) throw err;\n console.log(`You're purchase is complete. Your total is $${getTotal}.`);\n nextPrompt();\n })\n}", "function updateQuantity() {\n\n // Query to update the item's quantity based on the item ID\n var queryTerms = \"UPDATE products SET ? WHERE ?\";\n var newQuantityOnHand = quantityOnHand - purchaseQuantity;\n \n connection.query(queryTerms,\n [\n {stock_quantity: newQuantityOnHand},\n {item_id: itemID}\n ], function(err, result) {\n if (err) throw err;\n }); \n\n // After that update is done, we need to update the total sales column\n updateTotalSales();\n} // End updateQuantity function", "function getTotalProductSales(dept, newOHC) {\n connection.query(\"SELECT SUM(product_sales) AS totalProductSales FROM products WHERE department_name = ?\", [dept], function (err, res) {\n if (err) throw err;\n let totalProductSales;\n for (let i = 0; i < res.length; i++) {\n totalProductSales = res[i].totalProductSales;\n }\n console.log(\"Total product sales for \" + dept + \" is: \" + totalProductSales);\n updateProductSales(dept,newOHC, totalProductSales)\n })\n}", "function salesByProduct(products, lineItems){\n //TODO\n}", "function totalDep(products,dep,price){\n\tvar totalArr = [];\n\t\ttotalArr.push(price);\n\n\tfor(var i = 0;i < products.length;i++){\n\t\tif(products[i].department_name === dep){\n\t\t\ttotalArr.push(products[i].product_sales);\n\t\t}\n\t}\n\n\tvar totalSales = totalArr.reduce(function(a,b){\n\t\treturn a + b;\n\t})\n\tconnection.query(\n\t\t\"update departments set total_sales= ? where department_name = ?\",\n\t\t[totalSales,dep],\n\t\tfunction(err){\n\t\t\tif(err){\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t});\n}", "function totalProducts(sold,item,id){\n\titem.map(function(e){\n\t\tvar totalSold = Number(e.price) * Number(sold) + e.product_sales;\n\t\tconnection.query(\n\t\t\t\"update products set product_sales=? where item_id =?\",\n\t\t\t[totalSold,id],\n\t\t\tfunction(err){\n\t\t\t\tif(err){\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t});\n\t});\n}", "function updateProducts(stock, id, qty){\n connection.query(\"UPDATE products SET ? WHERE ?;\",\n \n [\n {\n Stock_QTY: (parseInt(stock) + parseInt(qty)),\n },\n {\n ID: id,\n }, \n ],\n function(err) {\n if (err) throw err;\n updatedItem(id);\n \n }\n ); \n \n}", "function updateDatabase(itemName, itemInventory, totalSales) {\n\n connection.query(\"UPDATE products SET ? WHERE ?\", [\n {\n stock_quantity: itemInventory\n },\n {\n product_name: itemName\n }\n ], (err, results, fields) => {\n if (err) {\n throw err;\n }\n return continueShoppingPrompt();\n });\n}", "function updateQuantity() {\n connection.query(\"UPDATE products SET stock_quantity = stock_quantity - ? WHERE id = ?\",\n [\n quantityToBuy,\n itemToBuy\n ],\n function (err, res) {\n if (err) throw err;\n updateProductSale();\n })\n}", "function updateProducts(finalTotal) {\n\n var item = cart.shift();\n var itemName = item.item;\n var itemCost = item.itemCost\n var itemPurchase = item.amount;\n\n\n connection.query('SELECT stock_quantity from products WHERE ?', {\n product_name: itemName\n }, function(err, res) {\n var currentStock = res[0].stock_quantity;\n\n //updates the stock_quantity in bamazon_db\n connection.query('UPDATE products SET ? WHERE ?', [{\n stock_quantity: currentStock -= itemPurchase\n }, {\n product_name: itemName\n }], function(err) {\n if (err) throw err;\n\n if (cart.length != 0) {\n updateProducts(finalTotal);\n } else {\n\n finalTotal = finalTotal.toFixed(2);\n console.log('Thank you for your purchase!');\n console.log('Your total is $' + finalTotal);\n connection.end();\n }\n });\n });\n}", "function updatePrices() {\n}", "function updateProduct() {\n console.log(\"Updating stock quantity...\\n\");\n connection.query(\n \"UPDATE Bamazon_db SET ? WHERE ?\",\n [\n {\n StockQuantity: StockQuantity - qchoice\n },\n ],\n function(err, res) {\n console.log(StockQuantity + \" products updated!\\n\");\n }\n );\n\n // logs the actual query being run\n console.log(query.sql);\n}", "function updatepurchase(newQty, id) {\n connection.query(\"UPDATE products SET stock_quantity =? WHERE idproducts =?\", [newQty, id], function (err, res) {\n if (err) throw err;\n });\n}", "function updateQuantity() {\n if (updating) {\n console.log(quant);\n console.log(\"Stock quantity: \" + stockQuantity);\n let newStockQuantity = stockQuantity - quant;\n console.log(\"Remaining stock: \" + quant);\n\n let updatedProduct = {\n id: productID,\n stock_quantity: newStockQuantity\n };\n console.log(updatedProduct);\n updateProducts(updatedProduct).then(function(res) {\n console.log(res);\n });\n }\n }", "function updateSales(sales) {\n\tvar salesDiv = document.getElementById(\"sales\");\n\n\tfor (var i = 0; i < sales.length; i++) {\n\t\tvar sale = sales[i];\n\t\tvar div = document.createElement(\"div\");\n\t\tdiv.setAttribute(\"class\", \"saleItem\");\n\t\tdiv.innerHTML = sale.name + \" sold \" + sale.sales + \" gumbaslls\";\n\t\tsalesDiv.appendChild(div);\n\t}\n\t\n\tif (sales.length > 0) {\n\t\tlastReportTime = sales[sales.length-1].time;\n\t}\n}", "function update_product_price(product_id){\n var total = 0;\n var depqty = document.getElementById(\"product_licence_\" + product_id + \"_qty\")\n var depprice = document.getElementById(\"product_licence_\" + product_id + \"_price\")\n var depcost = document.getElementById(\"product_licence_\" + product_id + \"_cost\")\n var deplicence = document.getElementById(\"product_licence_id\").value\n var deptotal = document.getElementById(\"product_licence_total\")\n depcost.value = depqty.value * depprice.value\n var lic = deplicence.split(\",\")\n for (var i = 1; i < lic.length; i++){\n total = total + parseInt(document.getElementById(\"product_licence_\" + lic[i] + \"_cost\").value)\n }\n deptotal.value = total;\n}", "function updateWarehouseItem(quantity, warehouseID, warehouseName, userID, total) {\n \n \t\n \tvar post = {\n \tquantity: quantity,\n \twarehouseID: warehouseID,\n \twarehouseName: warehouseName,\n \tuserID: userID,\n \ttotal: total\n \t};\n\n \n $.ajax({\n method: \"PUT\",\n url: \"/api/make-purchase\" ,\n data: post\n })\n .done(function(data) {\n \t\n \tif (data.complete === true)\n \t\twindow.location = \"/user-homepage\";\n \n });\n }", "function updateStock(dept, itemQuantity, itemIdToUpdateStock) {\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: itemQuantity\n },\n {\n item_id: itemIdToUpdateStock\n }\n ],\n function(err, res) {\n if (err) throw err;\n console.log(\n res.affectedRows +\n \" Stock Quantity updated to: \" +\n itemQuantity +\n \" !\\n\"\n );\n getTotalPurchasedPrice(dept);\n }\n );\n }", "function saleOrder() {\n \n added_to_cart.forEach(element => {\n id = element.product_id;\n quantity = element.quantity;\n\n data = {\"product_id\":id,\"quantity\":quantity};\n makeSale(data);\n });\n}", "async paySale(sale){\n\t\t\ttry{\n\t\t\t\tlet response = await axios.put(\"/api/sales/\" + sale._id);\n\t\t\t\tawait this.getSales();\n\t\t\t\tthis.calcTotal();\n\t\t\t\treturn true;\n\t\t\t} catch (error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t}", "function handleUpdate(e) {\n\tfor (let name in updatedQuantity) { // sample updatedQuantity: {usmc fitness book: \"20\", usmc pt shirt 1: \"9\"}\n\t\tcart.updateCart(name, +updatedQuantity[name])\n\t}\n\treRenderTableBody();\n\trenderCartTotal();\n}", "function updateQuantity() {\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: updatedStock\n },\n {\n item_id: answer.userId\n }\n ],\n );\n }", "function transact() {\n var newQuantity = stockQuantity - saleQuantity;\n connection.query(\"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newQuantity\n },\n {\n item_id: saleItem + 1\n }\n ], function (err, res) {\n if (err) throw err;\n //console.log(res.affectedRows + \" products updated!\\n\") //for testing\n console.log(\"Thank you! Please come again!\\n\".brightYellow);\n })\n connection.end();\n}", "function updateProduct(product, newQuantity) {\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newQuantity\n },\n {\n product_name: product\n }\n ],\n function(error, result) {\n console.log(\"Products updated!\");\n }\n );\n connection.end();\n}", "function updateInventory(dbResponse, orderQty) {\n // console.log(\"Updating inventory ...\\n\");\n // console.log(dbResponse);\n\n // update inventory\n var newqty = dbResponse.stock_quantity - orderQty;\n \n // update sales\n var totSales = dbResponse.product_sales + (orderQty * dbResponse.price);\n\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newqty, \n product_sales: totSales\n },\n {\n item_id: dbResponse.item_id\n }\n ],\n function(err, res) {\n // console.log(res.affectedRows + \" offer updated!\\n\");\n showCustomer(orderQty, dbResponse);\n\n loopIt();\n }\n );\n \n // logs the actual query being run\n // console.log(query.sql);\n}", "function updateProducts(chosenItem, answer) {\n //updates products\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: chosenItem.stock_quantity - answer.quantityPurchased\n },\n {\n item_id: chosenItem.item_id\n }\n ],\n function (error) {\n if (error) throw error;\n console.log(\"Transaction Complete\");\n anotherPurchase();\n }\n );\n //updates sales\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n product_sales: chosenItem.product_sales + answer.quantityPurchased * chosenItem.price\n },\n {\n item_id: chosenItem.item_id\n }\n ],\n function (error) {\n if (error) throw error;\n\n }\n );\n}", "function handleProductChange(product,isIncrease){\n const unitPrice = (product === 'phone')? 1219 : 59 ;\n let currentCount = getProductCount(product);\n if(isIncrease == false && currentCount > 0 ){\n currentCount--;\n }\n else if(isIncrease == true){\n currentCount++;\n }\n document.getElementById(product + '-count').value = currentCount;\n const updatedPrice = unitPrice * currentCount;\n document.getElementById(product + '-total').innerText = updatedPrice.toLocaleString();\n updateCostSection();\n\n}", "updatePrice() {\n for (var i = 0; i < this.products.length; i++) {\n updateValues.updateFunction(this.products[i]);\n }\n\n return this.products;\n }", "updatePrice() {\n\t\treturn this.products.map((product) => {\n\t\t\tproduct.updatePrice();\n\t\t\tproduct.updateSellInDays();\n\t\t\treturn product;\n\t\t});\n\t}", "function updateProduct(palletID) {\n\n\n for(var i = 0; i<orders.length; i++){\n for(var j = 0; j<orders[i].products.length; j++){\n if (orders[i].products[j].hasPalletID == 0){\n orders[i].products[j].hasPalletID = palletID;\n var query = sparqlgen.updateProperty(\"Product_\" + product_num_, \"hasPalletID\",palletID);\n functions.fuseki(\"update\", query);\n product_num_++;\n return;\n }\n\n }\n }\n\n}", "function updateProduct(quantityFinal, productID) {\n // console.log(productID);\n // console.log(quantityFinal);\n\n var query = connection.query(\"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: quantityFinal\n },\n {\n item_id: productID\n }\n ], function (err, res) {\n if (err) throw err;\n readDisplay();\n }\n );\n}", "function updateProduct(name, price, id){\r\n var index = getIndexById(id);\r\n shop.products[index].name = name;\r\n shop.products[index].price = price;\r\n\r\n dialogNameField.value = '';\r\n dialogPriceField.value = '';\r\n\r\n addProductBtn.value = '';\r\n updateProductList(); \r\n dialog.close();\r\n }", "function purchase(product, price, quantity){\n connection.query(\n \"UPDATE products SET ? WHERE ?\",[{\n stock_quantity: currentQuantity - quantity,\n },\n {\n item_id: currentItemId,\n }],\n function(error, results){\n\n if(error) throw error;\n console.log(\"thank you for your purchase!\");\n end();\n }\n )\n\n}", "function updateInv() {\n var updatedStock = parseInt(res[0].stock_quantity) - parseInt(quantity);\nconnection.query(\"UPDATE products SET stock_quantity = ? WHERE item_id = ?\",[updatedStock, item_id],function (err, updateRes) {\n if (err) throw err;\n });\n}", "function updateProducts(amazonItemReady2dec) {\n shopifyUpdateProducts(amazonItemReady2dec)\n .then(function (fulfilled) {\n // yay, we got products\n console.log(\"UPDATING Products FULFILLED!!!!! \");\n // \n })\n .catch(function (error) {\n // oops, shopify is angered\n console.log(error.message);\n // output: 'shopify is not happy...'\n });\n}", "processProductSale(name) {\n // we look at the stock of our store and run a function forEach that takes an item in as a parameter\n this.stock.forEach(item => {\n // if the name of the item equals a name\n if (item.name === name) {\n // and if the item count is greater than zero\n if (item.count > 0) {\n // we decrement the item count by one\n item.count--;\n // then we increase the store revenue by the price of the item\n this.revenue += item.price;\n // we then console.log that the item was purchased for its price\n console.log(`Purchased ${item.name} for ${item.price}`);\n } else {\n // if the item is out of stock, we console.log this\n console.log(`Sorry, ${item.name} is out of stock!`);\n }\n }\n });\n }", "function updateprice(){\n\n}", "function updateProductsChosen() {\n let totalSaleSum = 0;\n let cantProductsSaleSum = 0;\n const productsCard = document.querySelectorAll('.products__card');\n\n productsCard.forEach((product) => {\n const price = Number(product.querySelector('.products__price-value').textContent);\n const amount = Number(product.querySelector('.products__amount').textContent);\n\n if (amount > 0) {\n totalSaleSum += price * amount;\n cantProductsSaleSum += amount;\n }\n });\n totals = {\n currentUnits: cantProductsSaleSum,\n currentTotalMoney: totalSaleSum,\n };\n}", "function updateDB(id, newQuant) {\n return db.query(\"UPDATE products SET ? WHERE ?\", [{ stockQuantity: newQuant }, { itemID: id }])\n .spread(function(rows) {\n // console.log(\"Our inventory has been updated\");\n return startShopping();\n\n }).catch(function(err) {\n console.log(err);\n });\n}", "function updateProduct(itemId, numberLeft) {\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: numberLeft\n },\n {\n item_id: itemId\n }\n ],\n function (error) {\n if (error) throw err;\n displayProducts();\n }\n );\n}", "function getProductsFromUpdate() {\n productName.value = CRUDSArray[updateIndex].name;\n productPrice.value = CRUDSArray[updateIndex].price;\n productCategory.value = CRUDSArray[updateIndex].cat;\n productDescription.value = CRUDSArray[updateIndex].desc;\n}", "function updateProductAmount(product, price, isIncrease) {\n const productNumber = document.getElementById(product + \"-amount\");\n let productAmount = productNumber.value;\n const productPrice = document.getElementById(product + \"-price\");\n let productAmountVal = parseInt(productAmount);\n\n if (isIncrease) {\n productNumber.value = productAmountVal + 1;\n productPrice.innerText = productNumber.value * price;\n } else if (!isIncrease && productAmountVal > 0) {\n productNumber.value = productAmountVal - 1;\n productPrice.innerText = productNumber.value * price;\n }\n updatePrice();\n}", "function updateToMonthlySalary(){\n\n}", "cartPlusOne(product) {\r\n product.quantity = product.quantity + 1;\r\n }", "function updateStock() {\n\t\t\t\t\t\tupdatedStock = selectedProductDetails.stock_quantity - answer.quantity;\n\t\t\t\t\t}", "function updateProductFn() {\n if (ctrl.product === null)\n return;\n\n if (ctrl.product.categories !== null || ctrl.product.categories !== undefined ||\n ctrl.product.categories.length !== 0 )\n delete ctrl.product.categories;\n\n delete ctrl.product.propertiesId;\n $http.put(hostFactory.getHost()+hostFactory.getProductAPI(), ctrl.product).then(function (response) {\n ctrl.refresh();\n ctrl.switchMode(null);\n }).catch(function (error) {\n console.log(error);\n });\n }", "function updateStock(itm, newQty) {\n var sql = \"UPDATE product SET ? WHERE ?\";\n connection.query(sql, [{stock_quantity: newQty}, {item_id: itm}],function (err, res) {\n if (err) throw err;\n if (res.affectedRows != 1) {\n console.log(\"\\n\\n\");\n console.log(\"***** There may have been a error *****\");\n console.log(\"***** Report the following error to the administrator: pCO\" + res.affectedRows + \" *****\");\n }\n // connection.end();\n\n displayOrder(customerOrder);\n });\n}", "markAsSold(product) {\n const queryString = `UPDATE products\n SET is_sold = TRUE\n WHERE products.id = $1`;\n\n const queryParams = [product.productId];\n\n console.log('markAsSold', queryString, queryParams);\n\n return db\n .query(queryString, queryParams)\n .then(result => result)\n .catch(error => error.message);\n }", "function buyProduct(id, q) {\n console.log(\"Completeing purchase. Purchase total is $\" + cost);\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n quantity: q\n },\n {\n id: id\n }\n ],\n function(err, res) {\n if(err) console.log(err);\n console.log(res.affectedRows + \" products updated!\\n\");\n }\n );\n connection.end();\n}", "function totalSales(products, lineItems){\n var allProducts = generateProductsMap(products);\n var totalSales = lineItems.reduce(function(total, current) {\n currentPrice = allProducts[current['productId']]['price'];\n total += current['quantity'] * currentPrice;\n return total;\n }, 0)\n return totalSales;\n}", "function total(event) {\n console.log(event.target);\n let changedIndex = products.indexOf(event.target.name);\n let ourtarget = document.getElementById(event.target.name);\n let value = itemNo.value * products[i].price;\n console.log(value);\n ourtarget.textContent = value + ' JOD';\n products[i].total = value;\n products[i].purshaceNo = itemNo.value;\n console.log('The total quantity', products[i].purshaceNo);\n megaTotal = megaSum();\n all.innerHTML = `Total: ${megaTotal} JOD`;\n }", "function updateInventory(product, quantity){\n connection.query(\n \n \"UPDATE products SET ? WHERE ?\",\n [{\n stock_quantity: quantity,\n },\n {\n item_id: product\n }\n ],\n function(err, res){\n if(err) throw err;\n // console.log(\"new quantity: \" + res);\n }\n )\n\n}", "function processDailySales(currentStore){\n currentStore.initializeCustomers();\n currentStore.calculateCookies();\n currentStore.calculateTotalSale();\n\n\n}", "function finalizePurchase(itemID, qty, stock, price){\n\n let newStock = stock - qty;\n let totalCost = qty * price;\n\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newStock\n },\n {\n id: itemID\n }\n ],\n function(error) {\n if (error) throw err;\n \n console.log(\"Purchase successful! Your total is $\" + totalCost.toFixed(2));\n startPrompt();\n }\n );\n}", "async getSales(){\n\t\t\ttry {\n\t\t\t\tlet response = await axios.get(\"/api/sales\");\n\t\t\t\tthis.sales = response.data;\n\t\t\t} catch (error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t\tthis.calcTotal();\n\t\t\tthis.filteredSales();\n\t\t}", "function calculateSales(salesData){\n var totalSales = 0;\n for (var sale in salesData){\n totalSales = totalSales + salesData[sale];\n }\n return totalSales;\n}", "_changeQuantity(productId) {\n const value = this.shadowRoot.querySelector('#chart_item_' + productId).value;\n\n const cartItem = this._findCartItem(productId);\n\n const index = this.cartItems.indexOf(cartItem);\n this.cartItems[index].quantity = value;\n this.cartItems = [...this.cartItems]; // this.cartItems[index] = cartItem['quantity'] + 1;\n // this.set('cartItems.' + index + '.quantity', cartItem['quantity'] + 1);\n\n localStorage.setItem('shop-cart', JSON.stringify(this.cartItems));\n this.dispatchEvent(new CustomEvent('change-cart-count', {\n bubbles: true,\n composed: true,\n detail: {}\n }));\n }", "changeProduct(v){\r\n\t\tvar rowObj = v, unitPrice = 0;\t\t\r\n\t\tlet vv = +rowObj['options'][v['selectedIndex']].value; //the ProductID value in the products array.\r\n\t\t\t\t\r\n\t\t//Find the original 'UnitPrice' from the products table of the product item the user selected from the dropdown list.\r\n\t\t//and set that unit price in the 'Unit Price' cell of the row that the user is on. Comma format it.\r\n\t\tfor(let i = 0; i < this.ProductsData['products'].length; i += 1){\r\n\t\t\tlet pId = +this.ProductsData['products'][i]['ProductID'];\r\n\t\t\tif( pId == vv ){\r\n\t\t\t\tunitPrice = +this.ParseFloat(''+this.ProductsData['products'][i]['UnitPrice']);\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\trowObj = document.getElementById(v['id']);\t\t\r\n\t\trowObj['cells'][1]['children'][0]['value'] = this.commaFormatted(''+ (unitPrice).toFixed(2));\r\n\t\t\r\n\t\treturn this.updateTotals();\t\t\r\n\t}", "function updateProduct(req,res){\n \n\n let list=req.body.list // cogo la lista donde voy a añadirlo\n // console.log(list)\n let listId=list[0]._id // id de la lista\n // console.log(listId)\n let product= req.body.product // producto seleccionado\n //console.log(product)\n let productId=product[0]._id // id del producto selecionado\n //console.log(productId)\n let newquantity=req.body.newquantity // cantidad a cambiar\n //console.log(newquantity)\n\n List.findOneAndUpdate({_id:listId,\n 'products.product':{_id:productId}},\n {$set:\n {'products.$.quantity': newquantity}}, \n // propiedades \n \n (result)=>{\n\n if(!result){\n return res.status(200).send(\n {message:'se actualizo la cantidad del producto'}\n )\n }else{\n res.status(401).send(\n {message:'no se pudo actualizar la cantidad del producto'}\n )\n }\n\n })\n \n}", "function updatePrice(rate, quantity) {\n totalPrice += rate * quantity;\n console.log(totalPrice);\n updateDomPrice();\n }", "function updatePrices() {\n clickUpgrades['shovel'].price = clickUpgrades['shovel'].newprice;\n clickUpgrades['excavator'].price = clickUpgrades['excavator'].newprice;\n autoUpgrades['jackhammer'].price = autoUpgrades['jackhammer'].newprice;\n autoUpgrades['wheelbarrow'].price = autoUpgrades['wheelbarrow'].newprice;\n\n}", "function updateSubtot(product) {\n let sum = 0;\n for (let i = 0; i < rows.length; i++) {\n let currentProduct = rows[i];\n let subTotal = currentProduct.querySelector('.subtot');\n let quantity = currentProduct.querySelector('.qty input').value;\n let currPrice = currentProduct.querySelector('.pu span').innerHTML;\n subTotal.innerHTML =\n '$' + (Number(quantity) * Number(currPrice)).toFixed(2);\n sum += Number(quantity) * Number(currPrice);\n }\n total = sum.toFixed(2);\n // calcAll();\n //we could use calcAll(), so when we add qty it could calculate total at same time.\n //instead of extra click for total.\n}", "function editData(event) {\n\tvar saleid = document.getElementById(\"saleid\").value;\n\tvar product = document.getElementById(\"editproduct\").value;\n\tvar quantity = document.getElementById(\"editquantity\").value;\n\tvar datetime = document.getElementById(\"editdatetime\").value;\n\tvar json =\n\t{\n\t\"authent\": {\n\t\t\t\"username\": \"feferi\",\n\t\t\t\"password\": \"0413\"\n\t\t},\n\t\t\n\t\t\"requests\": [\n\t\t\t{\n\t\t\t\t\"type\": \"edit\",\n\t\t\t\t\"updateTo\": {\n\t\t\t\t},\n\t\t\t\t\"filter\": {\n\t\t\t\t\t\"type\": \"column\",\n\t\t\t\t\t\"name\": \"id\",\n\t\t\t\t\t\"value\": saleid\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t};\n\t\n\tif(saleid && saleid.match(/^\\d*$/))\n\t{\n\t\tif(product != \"\")\n\t\t{\n\t\t\tjson.requests[0].updateTo.product = Number(product);\n\t\t}\n\t\t\n\t\tif(quantity != \"\")\n\t\t{\n\t\t\tjson.requests[0].updateTo.quantity = Number(quantity);\n\t\t}\n\t\t\n\t\tif(datetime != \"\")\n\t\t{\n\t\t\tjson.requests[0].updateTo.dateTime = getDateAndTime();\n\t\t}\n\t\t\t\t\t\t\n\t\treturn sendAPIRequest(json, event, displaySalesRecords);\n\t}\n\telse\n\t{\n\t\talert(\"Please enter a numerical value for sale id\");\n\t}\n\t\n}", "function updateProduct(val, answer) {\n var updateQ = val;\n var query = \"UPDATE products SET ? WHERE ?\"\n connection.query(query, [{ stock_quantity: updateQ }, { id: answer.item }], function (err, res) {\n if (err) throw err;\n connection.end();\n })\n}", "function updateQuantity () {\n connection.query(`UPDATE products SET ? WHERE ?`,\n [\n {\n stock_quantity: newStockNum\n },\n {\n item_id: itemSelected\n }\n ],\n function (err, results) {\n if (err) {\n throw err;\n };\n // Test\n console.log(`Stock Quantity updated.`);\n }\n );\n}", "function saleProducts() {\n console.log(\"View Sale Products\");\n connection.query(\"SELECT * FROM `products`\", function(queryError, response) {\n if (queryError)\n throw queryError;\n response.forEach(function(row) {\n console.log(\"id = \", \"'\", row.id, \"'\",\n \"Product Name = \", \"'\", row.product_name, \"'\",\n \"Price \", \"'\", row.price, \"'\",\n \"Quantity \", \"'\", row.stock_quantity, \"'\")\n });\n })\n }", "function calcTotalPrice(products) {\n\t// YOUR CODE HERE\n}", "TotalPortefolio(data) // Met a jour tous les totaux du Portefolio (Amélioration possible : met seulement à jour la ligne concernée par le changement.).\n {\n model.samPresent({do: 'updateTotal' , id : data.name , qte : data.qte});\n }", "updateSum () {\n const totals = document.getElementsByClassName('product__price')\n let productsPrice = 0\n\n // Add all the total prices of the products\n for (const total of totals) {\n productsPrice += parseInt(total.textContent.replace('€', ''), 10)\n }\n\n // Updates the subtotal and total in the summary\n const productsTotal = app.getProductsCount()\n document.querySelector('.products__total').textContent = productsTotal + ' article' + (productsTotal > 1 ? 's' : '')\n document.querySelector('.subtotal__price').textContent = '€ ' + productsPrice\n document.querySelector('.total__price').textContent = '€ ' + productsPrice\n }", "function updateSubtot(product) {\n let productPrice = Number(product.querySelector('.pu > span').innerHTML);\n let productQty = product.querySelector('.qty input').value;\n let subTotal = productPrice * productQty;\n product.querySelector('.subtot > span').innerHTML = subTotal;\n return subTotal;\n}", "function validQuantity(itemId, unitsAmount, results) {\n var query = \"UPDATE products SET stock_quantity=?, product_sales=? WHERE ?\";\n // Calculating the total cost of the order.\n var total = unitsAmount * results.price;\n connection.query(query, [results.stock_quantity - unitsAmount, results.product_sales + total, { item_id: itemId }], function () {\n console.log(\"\\nYOUR TOTAL IS $\" + total + \"\\n\");\n askUser();\n });\n}", "function update() {\n calculateMonthlyPayment(values);\n updateMonthly(monthlyPayment);\n }", "function salesByProduct(products, lineItems){\n var allProducts = generateProductsMap(products);\n var salesProducts = lineItems.reduce(function(sales, current) {\n currentPrice = allProducts[current['productId']]['price'];\n if (current['productId'] in sales) {\n sales[current['productId']] += current['quantity'] * currentPrice;\n } else {\n sales[current['productId']] = current['quantity'] * currentPrice;\n }\n return sales;\n }, {})\n return salesProducts;\n}", "quantityChanged (product) {\n this.productQuantities[product.id] = product.quantity;\n this.cookieFactory.saveJSON(ShoppingCart.PRODUCTS_COOKIE, this.productQuantities);\n\n this.calculateTotals();\n }", "function updateInventoryInDB(productID, amountAdded) {\n\n connection.query(\n 'UPDATE products SET stock_quantity = stock_quantity + ' + amountAdded + ' WHERE item_id = ' + productID, (err, results) => {\n if (err) { console.log(err); }\n else { console.log('Inventory successfuly added updated'); }\n }\n );\n}", "function updatePriceByProduct(product, productPrice){\n product.querySelector('.total-price span').innerHTML = productPrice;\n}", "function changeStock(connection,newStock,selectedItem) {\n connection.query(\"UPDATE products SET stock_quantity=? WHERE product_name=?\",[newStock,selectedItem], function (err,res) {\n if (err) throw err;\n shop();\n });\n}", "function updateTotal() {\n\n}", "function updateStock (itemID, userQuantity, stockQuantity, product){\n\n // parseInt is used to assure than userQuantity is a number and not a string\n var updateStock = stockQuantity + parseInt(userQuantity);\n\n var query = \"UPDATE products SET ? WHERE ?;\"\n connection.query(query,\n [\n { Stock_Quantity: updateStock}, \n { Item_ID: itemID }\n ],\n function(err, res){\n if (err) throw err;\n }\n );\n\n // Console logs the new amount of the specific item being updated\n // continuePrompt gets called to ask user if they want to do anything else\n console.log(\"\\nStock for \" + product + \" has been increased to \" + updateStock + \"\\n\");\n continuePrompt();\n}", "function updateDistributionInventory(args, results) {\n\ttry {\n\t\tif(results.setsReturned > 0) {\n\t\t\t// Find ID of updated record\n\t\t\tvar inventoryid = results[0].processed['id'];\n//\t\t\talert(\"Updated inventory item [\" + inventoryid + \"] with [\" + args.distributionref + \"]\");\n\t\t}\n\t\telse {\n\t\t\talert(\"No distribution inventory record updated\");\n\t\t}\n\t}\n\tcatch(err) {\n\t\t// Handle errors\n\t\talert(\"Function 'updateDistributionInventory' failed: \" + err);\n\t}\n}", "function updateCart(e) {\n event.preventDefault();\n var selectedProduct = e.target.productToPurchase.value;\n var selectedQuantity = e.target.quantityInCart.value;\n\n console.log(selectedProduct);\n console.log(selectedQuantity);\n\n // ++ to the timesClicked property for image user click on\n for(var i in Product.allProducts){\n if(selectedProduct === Product.allProducts[i].name){\n Product.allProducts[i].quantityInCart = selectedQuantity;\n console.log(Product.allProducts[i]);\n }\n }\n localStorage.setItem('shoppingCart', JSON.stringify(Product.allProducts));\n}", "function processOrder(itemId, quantityOrdered)\n{\n connection.query(\"SELECT * FROM `products` WHERE ?\",{item_id: itemId}, function (err, res)\n {\n if (err) throw err;\n\n if(quantityOrdered < res[0].stock_quantity)\n {\n var dept = res[0].department_name;\n var newQuantity = res[0].stock_quantity - quantityOrdered;\n var totalprice = quantityOrdered * res[0].price;\n var totalsales = res[0].product_sales + totalprice;\n connection.query(\"UPDATE products SET ?, ? WHERE ?\",\n [{\n stock_quantity: newQuantity\n },\n {\n product_sales: totalsales\n },\n {\n item_id: itemId\n }],\n function(err, res) {\n if (err)\n throw err;\n });\n\n connection.query(\"SELECT * FROM `departments` WHERE ?\", {department_name: dept},\n function (err, res2) {\n if (err)\n throw err;\n\n var deptsales = res2[0].total_sales;\n deptsales += totalprice;\n connection.query(\"UPDATE `departments` SET ? WHERE ?\",\n [{\n total_sales: deptsales\n },\n {\n department_name: dept\n }],\n function (err, res3)\n {\n if (err)\n throw err;\n console.log(\"Purchase Successfull. Your total order is $\" + totalprice + \"\\n\");\n askAgain();\n });\n });\n }\n else\n {\n console.log(\"Purchase Unsuccessful. Insufficient quantity.\\n\");\n askAgain();\n }\n });\n}", "async update ({ params, request, response }) {\n const product = await Product.find(params.id)\n const data = request.only([\n \"name\", \n \"description\", \n \"price\"\n ])\n product.merge(data)\n if (product) {\n response.status(200).json({\n success: 'Product Updated',\n data: data\n })\n await product.save()\n } else {\n response.status(304).send({ error: 'Product Not Updated' })\n }\n }", "function totalSales(shirtQuantity, pantQuantity, shoeQuantity){\n // single product price\n var pershirtprice = 100;\n var perpantprice = 200;\n var pershoeprice = 500;\n // product price with quantity\n var shirtpricequantity= pershirtprice * shirtQuantity;\n var pantpricequantity= perpantprice * pantQuantity;\n var shoepricequantity= pershoeprice * shoeQuantity;\n // total sales of all products\n var total = shirtpricequantity + pantpricequantity + shoepricequantity;\n return total;\n // error message\n if( typeof total == 'string'){\n return 'Input cannot be negative number or a string';\n }\n }", "function updatePrice(productprice) {\n const subTotal = document.getElementById(\"sub-total\");\n const taxAmount = document.getElementById(\"tax-amount\");\n const totalPrice = document.getElementById(\"total-price\");\n\n subTotal.innerText = parseInt(document.getElementById(\"phone-price\").innerText) + parseInt(document.getElementById(\"case-price\").innerText);\n taxAmount.innerText = ((subTotal.innerText) * 0.1).toFixed(3);\n totalPrice.innerText = parseInt(subTotal.innerText) + parseFloat(taxAmount.innerText);\n}", "function updateSubtot($product) {\n // Iteration 1.1\n let priceUnit = $product.querySelector(\".pu span\").innerText;\n let quantityUnit = $product.querySelector(\".qty label input\").value;\n let newSubTotal = Number(priceUnit) * Number(quantityUnit);\n \n $product.querySelector(\".subtot span\").innerText = newSubTotal;\n return newSubTotal;\n}", "function updateSaleItem(itemId, highestBidder, highestBid)\n\t{\n\t\thighestBidder = \"highestBidderC\";\n\t\thighestBid = 405;\n\n\t\tvar updateData = {\n\t\t\t\"highest_bidder\": highestBidder,\n\t\t\t\"highest_bid\": highestBid\n\t\t};\n\n\t\tvar itemId = 2;\n\n\t\t$.ajax({\n\t \tmethod: \"PUT\",\n\t \turl: \"/api/forsale/\" + itemId,\n\t \tdata: updateData\n\t })\n\t .done(function(data) {\n\t \tconsole.log(JSON.stringify(data, null, 2)); //TEST CODE\n\n\t \t//Logic using data here.\n\t \t\n\t });\n\t}", "async function updateProduct({sku, VariantID, ...metaContent}) {\n\tconst spfMeta = {};\n\tconst dbMeta = {};\n\n\tif (Object.prototype.hasOwnProperty.call(metaContent, \"old_inventoryQty\") && Object.prototype.hasOwnProperty.call(metaContent, \"new_inventoryQty\")) {\n\t\tif (Number(metaContent.old_inventoryQty) !== Number(metaContent.new_inventoryQty)) {\n\t\t\tconst newVal = metaContent.new_inventoryQty;\n\t\t\tspfMeta[\"inventory_quantity\"] = newVal;\n\t\t\tdbMeta[\"inventoryQty\"] = newVal;\n \t}\n }\n\n\tif (Object.prototype.hasOwnProperty.call(metaContent, \"old_price\") && Object.prototype.hasOwnProperty.call(metaContent, \"new_price\")) {\n\t\tif (Number(metaContent.old_price) !== Number(metaContent.new_price)) {\n\t\t\tconst newVal = metaContent.new_price;\n\t\t\tspfMeta[\"price\"] = newVal;\n\t\t\tdbMeta[\"price\"] = newVal;\n\t\t}\n }\n\n\tif (Object.prototype.hasOwnProperty.call(metaContent, \"old_msrpPrice\") && Object.prototype.hasOwnProperty.call(metaContent, \"new_msrpPrice\")) {\n\t\tif (Number(metaContent.old_msrpPrice) !== Number(metaContent.new_msrpPrice)) {\n\t\t\tconst newVal = metaContent.new_msrpPrice;\n\t\t\tspfMeta[\"compare_at_price\"] = newVal;\n\t\t\tdbMeta[\"msrpPrice\"] = newVal;\n\t\t}\n\t}\n\n\tif (!Object.keys(spfMeta).length) {\n\t\treturn { success: null }\n\t};\n\n\t// define seqeulize transaction\n\tconst transaction = await Model.sequelize.transaction();\n\n\ttry {\n\t\t// update to database\n\t\tconst updated_db = await Model.Inventory.update(dbMeta, {\n\t\t\twhere: { VariantID },\n\t\t\ttransaction\n\t\t}).then(res => res[0]);\n\n\t\tif (updated_db) {\n\t\t\t// calling api to update shopify inventory item\n\t\t\tconst updated_spf = await shopifyApi.productVariant.update(VariantID, spfMeta);\n\t\t\tif (updated_spf.id === VariantID) {\n\t\t\t\tawait transaction.commit();\n\t\t\t\treturn { success: true }\n\t\t\t} \n\t\t\tthrow new Error(\"Error on updating shopify\");\n\t\t\t// await transaction.commit();\n\t\t\t// return { success: true }\n\t\t} else {\n\t\t\tthrow new Error(\"Error on updating database\")\n\t\t}\n\t} catch (err) {\n\t\tawait transaction.rollback();\n\t\t\n\t}\n}", "function updatePrice() {\n var sum = 0;\n for(var i = 0; i < $scope.currentItems.length; i++) {\n sum += $scope.currentItems[i].price;\n }\n\n $scope.totalCost = sum + (sum * taxRate);\n $scope.totalCost = Math.floor($scope.totalCost);\n console.log($scope.totalCost);\n }", "function viewProductsSaleDepartment() {\n console.log(\"======================\")\n console.log(chalk.green(\"View Product Sales by Department\"));\n\n connection.query(\"DROP TABLE bamazon.departments\", function (err, results) {\n if (err) throw err;\n });\n\n connection.query(\"CREATE TABLE departments (department_id INT NOT NULL AUTO_INCREMENT, department_name VARCHAR(100) NULL, over_head_costs INT(10) NULL,product_sales INT(10) NULL, PRIMARY KEY(department_id));\",\n function (err, results) {\n if (err) throw err;\n });\n\n connection.query(\"SELECT * FROM products\", function (err, results) {\n\n for (var i = 0; i < results.length; i++) {\n\n var sale_quantity = results[i].product_sales / results[i].price;\n // console.log(`[${i}] || ${sale_quantity}`);\n var profit = results[i].product_sales * 0.20;\n var overheadcosts = results[i].product_sales - profit;\n // console.log(`[${i}] || ${profit}`);\n\n connection.query(\"INSERT INTO departments SET ?\",\n {\n department_name: results[i].department_name,\n over_head_costs: overheadcosts,\n product_sales: results[i].product_sales\n },\n function (err, res) {\n if (err) throw err;\n // console.log(res.affectedRows + \" product inserted!\\n\");\n\n }\n );\n }\n connection.query(\"SELECT department_name, sum(over_head_costs) as over_head_costs, sum(product_sales) as product_sales FROM Bamazon.departments GROUP BY department_name;\",\n function (err, results) {\n if (err) throw err;\n\n var values = [];\n for (var i = 0; i < results.length; i++) {\n var totalprofit = results[i].product_sales - results[i].over_head_costs;\n // console.log(totalprofit);\n values.push([i + 1, results[i].department_name, results[i].over_head_costs, results[i].product_sales, totalprofit]);\n // console.log([i+1]+\"\\t\"+results[i].department_name + \"\\t\" + results[i].over_head_costs + \"\\t\" + results[i].product_sales + \"\\t\" + totalprofit);\n }\n // console.log(values);\n console.log(\"\\n-------------------------------------------------------------------------\");\n console.table(['ID', 'Department Name', 'Over Head Costs', 'Product Sales', 'Profit'], values);\n\n Start();\n });\n\n console.log(\"===================\");\n // Start();\n });\n\n}" ]
[ "0.77876556", "0.7751386", "0.7660903", "0.70968693", "0.7096621", "0.70925105", "0.7073948", "0.70247966", "0.69607884", "0.6929334", "0.68044317", "0.6779899", "0.6672747", "0.6668108", "0.66392916", "0.6631746", "0.6619539", "0.65385276", "0.6520975", "0.65193194", "0.6514509", "0.64761007", "0.64395887", "0.64395314", "0.6423889", "0.632844", "0.632125", "0.62993044", "0.628182", "0.6248983", "0.624404", "0.62285876", "0.6226055", "0.61946595", "0.6193861", "0.6186158", "0.61853534", "0.6184897", "0.6181755", "0.617371", "0.6161879", "0.6151923", "0.6146", "0.6143629", "0.61171067", "0.61093676", "0.6097817", "0.6088157", "0.6085889", "0.6085314", "0.60835755", "0.6080054", "0.6075544", "0.60749495", "0.60642004", "0.60393405", "0.6029994", "0.60281354", "0.60248864", "0.600807", "0.60017586", "0.5992029", "0.5978693", "0.59784406", "0.59748304", "0.5959668", "0.5958828", "0.5953992", "0.59466", "0.59437984", "0.59432596", "0.5927747", "0.5924968", "0.59161234", "0.5915097", "0.59118545", "0.5910315", "0.59093934", "0.59060144", "0.59010464", "0.5897285", "0.5892529", "0.5892519", "0.58866596", "0.58725834", "0.58685756", "0.5861718", "0.5854163", "0.5851203", "0.5844887", "0.58428836", "0.5835575", "0.5831339", "0.5823529", "0.58234996", "0.5821289", "0.5814077", "0.5813542", "0.5813169", "0.58083135" ]
0.790691
0
Sets the screen name according to whether this is a new assignment evaluation or an old one
async componentDidMount() { if (this.state.readOnly === true) { FirebaseFunctions.setCurrentScreen( "Past Evaluation Page", "EvaluationPage" ); } else { FirebaseFunctions.setCurrentScreen( "New Evaluation Page", "EvaluationPage" ); } const studentObject = await FirebaseFunctions.getStudentByID( this.state.studentID ); const { submission } = this.state; let audioFile = -1; let audioSentDateTime; if (submission !== undefined && submission.audioFileID !== undefined) { //Fetches audio file for student if one is present audioFile = await FirebaseFunctions.downloadAudioFile( submission.audioFileID ); let audioSentDate = submission.sent.toDate(); audioSentDateTime = audioSentDate.toLocaleDateString("EN-US") + ", " + audioSentDate.getHours() + ":" + audioSentDate.getMinutes(); } //Fetches the ID for the evaluation (if there is none, it is created) const evaluationID = this.props.navigation.state.params.evaluationID ? this.props.navigation.state.params.evaluationID : this.state.studentID + (this.state.classStudent.totalAssignments + 1) + ""; //what improvement area buttons to show //logic: if this is a read only version (of a past evaluation from history), we will show // the tags that teacher pressed on during evaluation (if any). Those gets passed as a navigation param // Otherwise, if it is a new evaluation, we'll check if the teacher has custom tags, we'll use them, // otherwise, we'll use the default areas //----------------------------------------------------------- let improvementAreas = this.areas; let evaluationCollapsed = this.state.evaluationCollapsed; if (this.props.navigation.state.params.readOnly === true) { //show areas pressed when evaluating this history item (passed from calling screen) improvementAreas = this.props.navigation.state.params.improvementAreas; let itemHasImprovementAreas = improvementAreas && improvementAreas.length > 0; let itemHasNotes = this.props.navigation.state.params.notes !== undefined && this.props.navigation.state.params.notes.length > 0; // Expand evaluation card in history view to show evaluation notes if the evaluation item has some notes/areas. if (itemHasImprovementAreas || itemHasNotes) { evaluationCollapsed = false; } } else { this.getTeacherCustomImprovementAreas(); } this.setState({ studentObject, isLoading: false, evaluationID, evaluationCollapsed, audioFile, audioSentDateTime, improvementAreas }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setScreenName(name) {\n __params['cd'] = name; //Screen name / content description.\n}", "function setAssignName()\n\t{\n\t\tvar name = 'Student and Overall Grade Report';\n\n\t\tvw.drawList.setParam('aName', 'text', name);\n\t}", "function changeScreen(screen) {\n activeScreen = screen;\n}", "function setCurrentScreen(gtagFunction, analyticsId, screenName, options) {\r\n if (options && options.global) {\r\n gtagFunction(GtagCommand.SET, { 'screen_name': screenName });\r\n }\r\n else {\r\n gtagFunction(GtagCommand.CONFIG, analyticsId, {\r\n update: true,\r\n 'screen_name': screenName\r\n });\r\n }\r\n}", "function setCurrentScreen(gtagFunction, analyticsId, screenName, options) {\r\n if (options && options.global) {\r\n gtagFunction(GtagCommand.SET, { 'screen_name': screenName });\r\n }\r\n else {\r\n gtagFunction(GtagCommand.CONFIG, analyticsId, {\r\n update: true,\r\n 'screen_name': screenName\r\n });\r\n }\r\n}", "setVariableName(newVariableName) { this.variableName.text(newVariableName); }", "function setCurrentScreen( newScreenKey ) { return hwc.setCurrentScreen(newScreenKey);\t}", "async setDisplayName() {\n\n const newDisplayName = await this.getPreferredName();\n\n if (newDisplayName.data !== undefined) {\n this.setState({ displayedName: newDisplayName.data.preferredName });\n } else {\n this.setState({ redirect: true })\n }\n }", "function setName(newName) {\n bot.name = newName;\n rl.question(''\n + 'Please enter a steam account username.\\n'\n , setUserName\n );\n}", "function setName(value) {\n\tplayer.name = value;\n\tmessage = \"Oh, brave <b><b>\" + player.name + \"</b></b>, the princess needs your help! \\nShe has been kidnapped by the evil oger and trapped in a castle deep in the woods. No one has dared to go after her, for fear of the oger. Will you help save the princess and defeat the oger? <br/><br/>Type 'yes' or 'no'. This is how you will interact with game.\";\n\toperation = operations[++opIndex];\n\tdisplayText(message);\n}", "async setName(name) {\n // window.APP.store.update({\n // activity: {\n // hasChangedName: true,\n // hasAcceptedProfile: true\n // },\n // profile: {\n // // Prepend (bot) to the name so other users know it's a bot\n // displayName: \"bot - \" + name\n // }})\n }", "function set_user_name(new_name){\n //TODO Validate User String\n current_user_name = new_name\n nameSpace.innerHTML=(\"User: \" + current_user_name)\n \n}", "function setUeberschrift(name) {\n subName = name.substr(0, name.length - 5);\n document.querySelector(\"#modell\").innerHTML = \"Consistency check: \" + subName;\n document.getElementById(\"noIssues\").style.display = \"none\";\n setFocus(name);\n}", "displayScreen (name) {\n const screenElement = this.shadowRoot.querySelector (\"p[name='screens']\");\n screenElement.innerHTML = '';\n screenElement.innerHTML = `<${name}></${name}>`;\n }", "function setName(){\n\t//$('div#statBar label#fname').text('User: ' + userStats.fn.toString() );\n}", "set shownName(newName) { //update true name\n\t\tthis._shownName = newName;\n\t\t// make sure all boxes get the new shownName\n\t\tfor( let box of this.boxes ) box.update()\n\t}", "function updateScreen() {\n toScreen = inputs.join(\"\");\n if (toScreen.includes(\"*\") || toScreen.includes(\"/\")) {\n $(\"#screen\").html(robotToHuman());\n } else {\n $(\"#screen\").html(toScreen);\n }\n }", "updateName() {\n App.elements.name.html(App.state.name);\n }", "function setName(n) {\n\tname = n;\n}", "function updateName(){\n \t$('.chat__input__icon').off('click', $scope.activeConversation.question.action);\n \t$scope.fullConversation[2].messages[0] = $scope.variables.name;\n \t$scope.fullConversation[3].messages[0] = \"Hi \" + $scope.variables.name + \"!\";\n \tupdateNext();\n }", "changeNameClickHandler() {\n const playerName = prompt('Enter Player Name');\n const isValid = this.isNameValid(playerName);\n if (!isValid) {\n return;\n }\n\n this.newGame.setPlayerName(playerName);\n this.playerID.textContent = this.newGame.getPlayerName();\n }", "function ShowName(){\r\n SaveName.hide();\r\n displayName.html(\"HELLO \"+NameBar.value())\r\n displayName.position(100,height/2-190);\r\n displayName.style('color',col)\r\n displayName.style('color', 'white');\r\n displayName.style('font-size', '100px');\r\n NameBar.hide();\r\n StartButton.show();\r\n title.hide();\r\n InfoButton.show();\r\n gameState = \"NAMEHIDE\"\r\n\r\n}", "function setSadAnimalTabName() {\n let namePrompt = prompt(\n \"Enter your name for the Sad Animal New Tab: \",\n getSadAnimalTabName()\n );\n if (namePrompt === null) {\n return false;\n }\n console.log(\"saved new name:\", namePrompt);\n localStorage.setItem(\"sadAnimalTabName\", namePrompt);\n return true;\n}", "function setPageTitle(nickName, viewingSelf) {\n if (viewingSelf == true){\n document.getElementById('page-title').innerText = 'Welcome home! ' + nickName.replace(/(\\n|\\r|\\r\\n)/g, '') + ' ^_^';\n }\n else{\n if (nickName == ''){\n document.getElementById('page-title').innerText = 'Hello! My owner hasn\\'t set my name yet! Please remind him/her to give me a name ^_^';\n }\n else{\n document.getElementById('page-title').innerText = 'Helloooo! This is ' + nickName.replace(/(\\n|\\r|\\r\\n)/g, '') + \". Welcome to my page ^_^\";\n }\n }\n document.title = parameterUsername + ' - User Page';\n}", "set name(newName) {\n this.setName(newName);\n }", "function changeName(newName){\n\tthis.currentName = newName;\n}", "function reloadScreen(screen) {\n if(screen !== null) {\n issueCommand('admin type=reload screen='+screen);\n } else {\n // No screen has been passed\n console.warn(\"No screen has been passed\");\n }\n}", "function updateName() { changeTextField(name, nameLabel, isValidName()) }", "function set_job_name()\n{\t\n\tif(document.getElementById(\"m2m_source_textfield_name\".value) != '')\n\t{\n\t\twebrequest_from_field(server_id.param_server, \"m2m_source\"+g_int_job_current+\"_name\", \"m2m_source_textfield_name\", webrequest_option.none, error_option.only_alert);\n\t\tdocument.getElementById(\"m2m_source\"+g_int_job_current+\"_hidden_name\").value = document.getElementById(\"m2m_source_textfield_name\").value;\n\t}\n\t\n\tfill_m2m_source_select_job();\n}", "set setName(name){\n _name=name;\n }", "function setUserName(newUserName) {\n bot.userName = newUserName;\n rl.question(''\n + 'Please enter the steam account\\'s password.\\n'\n , setUserPassword\n );\n}", "set name(value) {\n if (typeof value !== \"string\") throw new Error(\"Name must be a string\");\n _name.set(this, value);\n }", "onBoardNameChanged(newName) {\n this._scrumboardService.updateBoard();\n this._location.go('/apps/scrumboard/boards/' + this.board.idEspacio + '/' + this.board.id + '/' + this.board.uri);\n }", "function changeStatScreen(character){\n //update PlayerIndex of statScreen \n statScreen.SinglePlayer.PlayerIndex = character.index;\n statScreen.SinglePlayer.CharacterNameString = character.name;\n //clear all graphics drawn from the graphics reference\n singleGraphics.clear();\n //updates the name of the character whose stats are displayed\n //NOTE: Does not check to see if name will fit yet\n statScreen.SinglePlayer.CharacterName.setText((character.name).toUpperCase());\n //redraw health bar and update stats if on the single player screen\n if(!statScreen.ShowAll){\n updateSinglePlayerHealthBar(statScreen.CurrentTurn);\n updateSinglePlayerStatScreen(statScreen.CurrentTurn);\n }\n}", "function setCurrentScreen(gtagFunction, initializationPromise, screenName, options) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function () {\n var measurementId;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!(options && options.global)) return [3 /*break*/, 1];\n gtagFunction(GtagCommand.SET, { 'screen_name': screenName });\n return [2 /*return*/, Promise.resolve()];\n case 1: return [4 /*yield*/, initializationPromise];\n case 2:\n measurementId = _a.sent();\n gtagFunction(GtagCommand.CONFIG, measurementId, {\n update: true,\n 'screen_name': screenName\n });\n _a.label = 3;\n case 3: return [2 /*return*/];\n }\n });\n });\n}", "setName(name) { }", "set name(newName) {\n if (newName) {\n this._name = newName;\n }\n }", "function setRoom(name) {\n $('form').remove();\n $('h1').text(name);\n $('#subTitle').text('Link to join: ' + location.href);\n $('body').addClass('active');\n }", "update() {\n this.nameText.text = 'Submit Name to Leaderboard:\\n ' + this.userName + '\\n(Submits on New Game)';\n\n }", "setName() {\n\n // get the nickname from the input.\n const name = $('#name-input').val();\n\n // set the name to a cookie\n Utils.setCookie('nickname', name, 14);\n\n // update the app state\n\t\tApp.state.name = name;\n\n\t\t// update the chat title\n\t\tApp.dom.updateName();\n\n // destroy the editor\n App.dom.destoryEditor();\n }", "setName(state, name) {\n state.player.name = name\n }", "set name(newName) {\n this.setName(newName);\n }", "set name(x) { this._name = x; }", "function updateUserNameDisplay(fullName) {\n\t$(\"#environmentData .profileName\").text(fullName);\n}", "function setUsername() \n{\n\tvar name = prompt('Enter the name of a cutie:');\n\tlocalStorage.setItem('name', name);\n\theading.textContent = 'Hello cutie ' + name;\n}", "set name(name) {\n\t\tthis._name = new HumanName(name);\n\t}", "function setNames(){\r\n //prompts up a name for both comp and player and then displays it in appropriate area\r\n let playerName=prompt('Please enter your name','')\r\n document.getElementById('p-name').innerHTML=playerName\r\n let compName=prompt(\"Please enter the Computer's name\",'')\r\n document.getElementById('c-name').innerHTML=compName\r\n}", "function setUserName() {\r\n\tvar myName = prompt('Please enter your name!');\r\n\tlocalStorage.setItem('name', myName);\r\n\tmyHeading.textContent = 'TUtorials are cool, ' + myName;\r\n}", "function isHSameScreen(name,name2){\r\n\tif ((name2 == null) || (name == null)) return false;\r\n\tvar pool = name.split(\"_\");\r\n\tvar screen = -1;\r\n\tif (pool.length>=3){\r\n\t\tif ((pool[0].indexOf(\"in\")!=-1) && (!isNaN(pool[1])) && (!isNaN(pool[2]))){\r\n\t\t\tif(pool.length>3){\r\n\t\t\t\tif(!isNaN(pool[3])){\r\n\t\t\t\t\tscreen = pool[3];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tvar pool2 = name2.split(\"_\");\r\n\tvar screen2 = -1;\r\n\tif (pool2.length>=3){\r\n\t\tif ((pool2[0].indexOf(\"in\")!=-1) && (!isNaN(pool2[1])) && (!isNaN(pool2[2]))){\r\n\t\t\tif(pool2.length>3){\r\n\t\t\t\tif(!isNaN(pool2[3])){\r\n\t\t\t\t\tscreen2 = pool2[3];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif(screen == screen2) return true;\r\n\treturn false;\r\n}", "set name(value) {\n // this replaces the name as the value. whatever the user has inputted becomes \"value\"\n this._name = value;\n }", "function trackScreen(name, callback) {\n setScreenName(name);\n\n var query = clone(__params);\n query.t = 'screenview';\n\n request(query, callback);\n}", "function PushScreen (scr)\r\n{\r\n\tif (scr == \"game\")\r\n\t{\r\n\t\tgame_Init();\r\n\t}\r\n\r\n\tscreen = scr;\r\n\tconsole.log (\"Started screen \" + scr);\r\n}", "function nameChanged() {\n\t\t\tconsole.log(self.name);\n\t\t}", "function setLocationName(name) {\n locationDisplay.text(name);\n locationNameInput.val(name);\n }", "set name(newName) {\n\t this.setName(newName);\n\t }", "function setLoginName (name) {\n document.getElementById(\"loginName\").innerHTML = `<strong>${name}</strong>`;\n }", "function updateWelcomeScreen () {}", "function changeScreen(){\n if (state === `menu`){\n state = `main`;\n }\n else if (state === `end`){\n state = `menu`;\n count = 0;\n }\n }", "set displayName(value) {}", "function name(inName)\t{\n\t//\tclean up anything that might exist\n\tclean();\n\t\n\t//\tstore the var locally (need it for some 'set' msgs)\n\tmyName = inName;\n\t//\tpopulate the 'label' field (we'll re-populate it later if this isf has a valid label value)\n\tthis.patcher.getnamed(\"LABEL\").set(inName);\n}", "function changeScreen \n (\n hideScreenId, // Id of the screen that we need to hide\n showScreenId // Id of the screen that we need to show\n )\n { \n displayOrHideFields (hideScreenId, showScreenId);\n }", "function setUserName() {\n var myName = prompt(\"please fill in your name\");\n localStorage.setItem('name', myName);\n myHeading.textContent = myName + \"! you are awesome!\"\n}", "function setUserName() {\n let myName = prompt('Please enter your name.');\n if(!myName) {\n setUserName();\n } else {\n localStorage.setItem('name', myName);\n myHeading.textContent = 'Mozilla is cool, ' + myName;\n }\n}", "function setName(){\n $('#identity-frm').slideUp(200);\n $('#share-frm').slideDown(200);\n username = $('#username').val();\n $('#tracker_name').html(username + ' (you)');\n}", "function set_self_switch_name(){\r\n\t\tvar args = autoSSwNFix.apply(this, arguments);\r\n\t\tvar eventId = search_name(args[0], 0, 0, args[3], args[4], 'or');\r\n\t\tfor ( var i = 0; i < eventId.length; i++ ) {\r\n\t\t\tset_self_switch(args[1], args[2], eventId[i], \"thisM\", true);\r\n\t\t};\t\t\r\n\t}", "getScreenName() {\n throw new Error(\"getScreenName is not implemented\");\n }", "function twcheese_previewNewName(report)\n\t{\n\t\tvar newName = 'twCheese: ' + report.attacker[1] + ' ('+report.attackerVillage[0]+'|'+report.attackerVillage[1]+','+report.attackerVillage[2]+') attacks '+report.defender[1]+' ('+report.defenderVillage[0]+'|'+report.defenderVillage[1]+','+report.defenderVillage[2]+')';\n\t\tfor(var i=0; i < 6; i++)\n\t\t\tnewName += twcheese_renameText(gameDoc.getElementById('twcheese_renameOption'+i).value,report);\n\t\tgameDoc.getElementById('twcheese_rename_preview').innerHTML = newName;\n\t}", "set realName (value) {\n this._realName = value\n /**\n * @event IrcUser#realName\n */\n this.emit('realName')\n }", "function giveName(state) {\n text_entry.show();\n}", "function resetScreen() {\n currentOperationScreen.textContent = '0';\n lastOperationScreen.textContent = 'xxx';\n holdOne = '';\n holdTwo = '';\n currentOperation = null;\n}", "function getName(source, charNumber) {\n source.screen += charNumber;\n }", "function ts_AssignWindowName()\r\n{\r\n\tif (ts_sWindowOpenerName) {\r\n\t\t// this window was opened by another tab/window so use the opener's name\r\n\t\twindow.name = ts_sWindowOpenerName;\r\n\t\tCookieSet('CurrentWindowName',window.name);\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tif (window.name.search(/^TabNumber_\\d+$/) != 0) {\r\n\t\tvar tabCount = CookieGet('TabCount');\r\n\t\tif ( ! tabCount) {\r\n\t\t\ttabCount = 0;\r\n\t\t}\r\n\t\tCookieSet('TabCount',++tabCount);\r\n\t\twindow.name = 'TabNumber_'+tabCount;\r\n\t}\r\n\t\r\n\tCookieSet('CurrentWindowName',window.name);\r\n\t//window.status = 'window.name = ['+window.name+']'; //+', window.location = ['+window.location+']';//TEST\r\n}", "setStudentName () {\n this.studentName = prompt(\"What is your name, student?\"); // set the student name for the user to write!\n}", "function displayName() {\n\t\talet(name);\n\t}", "setName(namePicked) {\n this.name = namePicked; //refer to the object itself using 'this'\n }", "function getName() {\n applicationState.user = userName.value;\n document.getElementById(\n \"userinfo\"\n ).innerHTML = `welcome ${applicationState.user}`;\n applicationState.gameStart = true;\n startTime = Date.now();\n}", "setName(state, name) {\n state.name = name\n }", "SetActiveRoom(rmName){\r\n\t\tthis.prevActiveRoom = this.activeRoom;\r\n\t\tthis.activeRoom = rmName;\r\n\t\tthis._updateCallbacks()\r\n\t}", "updateScreen() {\n this.currOperandTextElem.innerText = this.getDisplayNumber(this.currOperand)\n if(this.operation != null) {\n this.prevOperandTextElem.innerText = \n `${this.getDisplayNumber(this.prevOperand)} ${this.operation}`\n } else {\n this.prevOperandTextElem.innerText = ''\n }\n }", "function setPlayer(name) {\n window.localStorage.setItem('currentPlayer', name);\n renderPlayer();\n }", "function setUserName(uuid, userName) {\n userStore[uuid].userName = userName ? userName : userStore[uuid].displayName;\n if (getIndexOfSettingsUser(uuid) !== -1) {\n doUIUpdate();\n }\n }", "changeTitle( layout, newTitle ){\n\t\tif( layout.title.text ){\n\t\t\tlayout.title.text = newTitle;\n\t\t}\t\n\t}", "updateName(state, name) {\r\n state.name = name;\r\n }", "set serverName (value) {\n this._serverName = value\n /**\n * @event IrcUser#serverName\n */\n this.emit('serverName')\n }", "function toggleScreens(data) {\n switch (data.screenName) {\n case 'daily-log':\n setActiveScreen(<DailyLog />)\n break;\n case \"msg-board\":\n setActiveScreen(<MessageBoard />)\n break;\n case \"log-summary\":\n setActiveScreen(<DailyLogDisplay text={data.text} />)\n break;\n default:\n setActiveScreen(<UnderConstruction />)\n }\n }", "updateAuthPlayerDname(state, value) {\n state.auth_user.DisplayName = value;\n }", "function setUserName() { // creates function SetUserName in javascript. this can be anything you want\n var myName = prompt('Please enter your first name.'); // creates car named myName and assigns it whatever name the user inputs\n localStorage.setItem('name', myName);\n myHeading.textContent = 'Midiagirl is cool, ' + myName;\n}", "function SetNewClip(str:String):void {\n\t_currentClip = str;\n\t_newClip = true;\n}", "setSlaveTitle() {\n\t\tlet title = `Splinter Agent | Open Windows: ${this.windows.length} | Components:${this.componentsICanSpawn.toString() || \"N/A\"}, Services: ${this.servicesICanSpawn.toString() || \"N/A\"}`;\n\t\t__WEBPACK_IMPORTED_MODULE_1__clients_logger___default.a.system.debug(`SplinterAgent.setSlaveTitle: ${title}`);\n\t\t__WEBPACK_IMPORTED_MODULE_2__clients_routerClientInstance___default.a.transmit(`${this.app.uuid}.setTitle`, { title: title });\n\t}", "set name(value) {\n\t\tthis._name = value;\n\t}", "function switchScreensClasses(requestedScreenName) {\n if (requestedScreenName === \"newMsg\") {\n setNewMsgClass(\"row\")\n setCurrentMsgClass(\"row hide\")\n } else {\n setNewMsgClass(\"row hide\")\n setCurrentMsgClass(\"row\")\n }\n }", "setName(name) {\n\t\tthis.name = name;\n\t}", "function changeLocalUsername(name) {\n if(name) {\n chatbox.username = name;\n console.log(\"Server says username should be \" + name);\n ui.$username.text(chatbox.username);\n ui.$profileUsername.text(chatbox.username);\n }\n }", "function setRoom(name) {\r\n $('#createRoom').remove();\r\n $('h1').text(name);\r\n // $('#subTitle').text(name + \" || link: \"+ location.href);\r\n $('body').addClass('active');\r\n}", "function askServerToChangeName (newName) {\n chatbox.socket.emit('user edits name', {newName: newName});\n if (chatbox.showing)\n ui.$username.text('Changing your name...');\n }", "function showName() {\n var name;\n name = \"Ford\";\n console.log(\"Last Name: \" + name);\n}", "function displayInScreen(dispStr){\r\n document.querySelector(\"#screen_value\").innerHTML=dispStr;\r\n}", "function setDocumentName() {\n var response = ui.prompt('Create Document Name', 'format of: draft<-doc-name-wd01>', ui.ButtonSet.OK_CANCEL);\n\n if (response.getSelectedButton() == ui.Button.OK) {\n var docName = response.getResponseText();\n Logger.log('The document name entered was %s', docName);\n doc.setName(docName);\n } else if (response.getSelectedButton() == ui.Button.CANCEL) {\n Logger.log('No document name entered, cancel was pressed');\n } else {\n Logger.log('No document name entered, the close button was clicked');\n }\n}", "set name(value) {\n if (this._name !== value) {\n this._name = value;\n window.svgIconset[value] = {host: this, theme: this.theme};\n window.dispatchEvent(new CustomEvent('svg-iconset-update'));\n window.dispatchEvent(new CustomEvent('svg-iconset-added', {detail: value}));\n }\n }", "function set_new_user_name(env, title, first, initial, last) {\n init_new_user_storage(env);\n env.auth.new_user.name = [title, first, initial, last];\n}", "set name(value) { this._name = value || \"unknown\"; }" ]
[ "0.7034886", "0.65000105", "0.63262886", "0.6184646", "0.6184646", "0.5886744", "0.5866059", "0.5853502", "0.58063877", "0.5804812", "0.5780485", "0.5764793", "0.5626207", "0.56235445", "0.5547913", "0.5513338", "0.5463264", "0.54274255", "0.54072237", "0.54008514", "0.53826183", "0.53569424", "0.5344797", "0.5325227", "0.5312519", "0.53097016", "0.53062934", "0.5301647", "0.52947676", "0.52827644", "0.52767915", "0.52713627", "0.5265897", "0.5258245", "0.5247708", "0.5246548", "0.5228084", "0.5226211", "0.5223634", "0.5221611", "0.52150625", "0.52120864", "0.5209761", "0.5206772", "0.5201653", "0.51910686", "0.51878536", "0.51875937", "0.5181219", "0.5177606", "0.5170072", "0.51656663", "0.51648885", "0.5158293", "0.51558226", "0.5155758", "0.5154038", "0.5153865", "0.5146898", "0.5143475", "0.5141668", "0.5133253", "0.513239", "0.5131007", "0.5112354", "0.50978", "0.5094893", "0.50699043", "0.50535965", "0.5053376", "0.50441384", "0.5027544", "0.50217825", "0.5018939", "0.5011493", "0.49991778", "0.49968305", "0.49887937", "0.49844402", "0.49763924", "0.4969279", "0.4968617", "0.49670127", "0.49589762", "0.49540526", "0.49533454", "0.4953344", "0.4952904", "0.49506584", "0.49451202", "0.49425253", "0.49404225", "0.49391818", "0.49334624", "0.49323845", "0.49317095", "0.4909536", "0.49092615", "0.49049163", "0.49035028", "0.48994574" ]
0.0
-1